query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
cd421a9f3c2167c17a2e1fe9a7ffbac8
Check whether game has been lost by the player currently on the move in the specified state
[ { "docid": "c36cf90a3e26841ba0af9197029f7f7f", "score": "0.7487401", "text": "def lost?(state)\n # Fill this in\n end", "title": "" } ]
[ { "docid": "c336e29e3102de685cfdcaec79edb026", "score": "0.804565", "text": "def lost?(state)\n pieces = state[:pieces]\n player = state[:player]\n pieces[player].empty?\n end", "title": "" }, { "docid": "0670883207080626873851ff2227ed39", "score": "0.7997427", "text": "def lost?(state)\n pieces = state[:pieces]\n player = state[:player]\n pieces[player].empty?\n\n end", "title": "" }, { "docid": "c790e7d4afc42fd8d9404e4548d50d40", "score": "0.7919672", "text": "def lost?(state)\n # Fill this in\n player = state[:player]\n pieces_left = state[:pieces_left]\n pieces_left[player] == 0 ||\n pieces_left[opponent(player)] == 4 && pieces_left[player] == 1\n end", "title": "" }, { "docid": "c790e7d4afc42fd8d9404e4548d50d40", "score": "0.7919672", "text": "def lost?(state)\n # Fill this in\n player = state[:player]\n pieces_left = state[:pieces_left]\n pieces_left[player] == 0 ||\n pieces_left[opponent(player)] == 4 && pieces_left[player] == 1\n end", "title": "" }, { "docid": "ebc803e4c9955e10b9ffd2c0c20022b7", "score": "0.7882719", "text": "def lost?\n self.game_status == STATUS_LOST\n end", "title": "" }, { "docid": "693cce3b7f8366240414a3eacf3672cb", "score": "0.7837139", "text": "def lost?(state)\n # Fill this in\n player = opponent(state[:player])\n longest_row(state, player) >= 5\n end", "title": "" }, { "docid": "63921ab945662029ad64670776c77766", "score": "0.7811897", "text": "def lost?(state)\n done?(state)\n end", "title": "" }, { "docid": "830a4126f45b9038e3c4604706bf7ded", "score": "0.7796671", "text": "def lost?(state)\n pieces = state[:pieces]\n player = state[:player]\n # pieces[player].empty?\n king = pieces[player].find { |piece| piece.class == King }\n !king\n end", "title": "" }, { "docid": "fc2846ffc09f6a9257340cba8fa25e48", "score": "0.72664416", "text": "def lost?\n\t\treturn true if @guesses_left <= 0\n\t\treturn false\n\tend", "title": "" }, { "docid": "d227e4f6cb99103460a045db95d3be11", "score": "0.711943", "text": "def check_lost?\n if @player.lives == 0\n @lost = true\n end\n end", "title": "" }, { "docid": "ff89c0a9f27671d831839ba291ebd968", "score": "0.70074576", "text": "def game_over\n\t\tover = true\n\t\[email protected] do |move|\n\t\t\tif move.to_i.between?(1, 9) && check_winner == \"none\"\n\t\t\t\tover = false\n\t\t\t\tbreak\n\t\t\tend\n\t\tend\n\t\treturn over\n\tend", "title": "" }, { "docid": "0897f13923a702b6005b3bb44c724f4c", "score": "0.6918121", "text": "def lost?\n incorrect_guesses.size > LIVES\n end", "title": "" }, { "docid": "be015d642116c29150d2d946e7cb2d5e", "score": "0.6914624", "text": "def lose?\n\t\t(@misses_left == 0 && !win?) ? true : false\n\tend", "title": "" }, { "docid": "8f30d4cffae2e616968d67d8198f6d06", "score": "0.68981373", "text": "def game_over?\n if game_lost?\n View.game_lost\n true\n else\n false\n end\n end", "title": "" }, { "docid": "e68268d32bea2618cf06ce827a292b3e", "score": "0.68898433", "text": "def check_state(game)\n raise 'Not implemented'\n end", "title": "" }, { "docid": "4dadea6fdcec69c674759fa763124b12", "score": "0.6874102", "text": "def lost?\n status && status.is_a?(LostStatus)\n end", "title": "" }, { "docid": "acf0436a20930ff628573b6c57f04892", "score": "0.6856994", "text": "def game_lost?\n @rumors.each do |rumor|\n return true if rumor.all_nodes_infected(graph.nodes, LOOSE_PERCENT)\n end\n false\n end", "title": "" }, { "docid": "970fa4d9cadf628e37222334047a90a1", "score": "0.6826298", "text": "def lost?\n false\n end", "title": "" }, { "docid": "714a32d9a7e41932586338383dd8bd33", "score": "0.6812862", "text": "def won?(state)\n position = state[:position]\n player = state[:player]\n n = number(player)\n check_move(position, n) ? true : false\n end", "title": "" }, { "docid": "714a32d9a7e41932586338383dd8bd33", "score": "0.6812862", "text": "def won?(state)\n position = state[:position]\n player = state[:player]\n n = number(player)\n check_move(position, n) ? true : false\n end", "title": "" }, { "docid": "d2d3ddeb345d04b9041a15a99b9dac4e", "score": "0.67878747", "text": "def lost?\n\t\t\treturn @incorrect_count > @@MAXWRONGGUESSES\n\t\tend", "title": "" }, { "docid": "abe56b2262a320e0e3924392a79b38cc", "score": "0.67628855", "text": "def game_over?\n @losses.keys.one? {|player| @losses[player] < MAX_LOSS}\n end", "title": "" }, { "docid": "983daead11e92b62d6cf2f68df36af79", "score": "0.6744046", "text": "def game_over?\n !result.nil?\n end", "title": "" }, { "docid": "974db60b9b575461dafebcfaaab63b59", "score": "0.6742367", "text": "def check_states\n # remove all counters from states that are gone\n (battler.state_time.keys - battler.states).each {|id|\n battler.state_time.delete(id)}\n # add all counters from new states\n (battler.states - battler.state_time.keys).each {|id|\n battler.state_time[id] = $data_states[id].hold_turn * 40 + 1}\n end", "title": "" }, { "docid": "130ddc776ad6a5b8d5a5288a58203a6c", "score": "0.674114", "text": "def check_if_lost_after_move(move)\n (self.status = 0 and self.save!) if move.status == 0\n end", "title": "" }, { "docid": "0e5585db18e93b37d6477e084f476522", "score": "0.673531", "text": "def who_lost?\n\t\tpast_turn = self.past_turn\n\t\tlast_normal_guess_player = self.game.turns.where(guess_type: 'normal').last.player\n\t\tif past_turn.guess_type == 'tropical' && self.tropical_id\n\t\t\tif Player.find(self.tropical_id.to_i).hands.last.tropical?\n\t\t\t\tself.player\n\t\t\telse\n\t\t\t\tPlayer.find(self.tropical_id.to_i)\n\t\t\tend\n\t\telse\n\t\t\tif past_turn.face != 1\n\t\t\t\tif past_turn.quantity.to_i <= self.player.game.dice_on_table.count(past_turn.face) + self.player.game.dice_on_table.count(1)\n\t\t\t\t\tself.player\n\t\t\t\telse\n\t\t\t\t\tlast_normal_guess_player\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tif past_turn.quantity.to_i <= self.player.game.dice_on_table.count(past_turn.face)\n\t\t\t\t\tself.player\n\t\t\t\telse\n\t\t\t\t\tlast_normal_guess_player\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "8407734f28b5e32e3303764d70676711", "score": "0.6724404", "text": "def out_of_turns? #All this does is determine if you have turns. What to do with that data lives in the 'until'\n @tries_left == 0\n end", "title": "" }, { "docid": "8255691b6c18218d429dc80a263bce75", "score": "0.67127585", "text": "def is_over\n self.state == 'game_over'\n end", "title": "" }, { "docid": "3f9d2f9cc807879854a3916da9560dda", "score": "0.67011327", "text": "def check_game_over\n immovable = available_moves.nil?\n # Checkmate condition\n return 'Checkmate' if @check_in_play && immovable\n\n # Stalemate condition\n return 'Stalemate' if !@check_in_play && immovable\n\n # Neither conidtions met\n 'continue'\n end", "title": "" }, { "docid": "4e93ac5b03692327b61ba9450f683f0c", "score": "0.6693362", "text": "def lost?\n @wrong_count >= MAX_WRONG \n end", "title": "" }, { "docid": "254fbcdb01a3ab1b8a77003ce0107a23", "score": "0.6676496", "text": "def battle_can_lose\r\n result = $game_temp.nil? ? false : $game_system.battle_simulator.on\r\n return seph_battlesimulator_gmtmp_bcl || result\r\n end", "title": "" }, { "docid": "db13afab3ab96477d7da9249e2b19fe2", "score": "0.66592", "text": "def game_over?\n losing_players.any?\n end", "title": "" }, { "docid": "07a8fb76190bd8a68fc2421a505df49a", "score": "0.6627602", "text": "def holding_down\n check_move(:down) unless [:moving, :won, :dead].include?(@state)\n end", "title": "" }, { "docid": "481241b5aec90123201e6f3deae36718", "score": "0.66233224", "text": "def dead?(state)\n raise RLSM::Error, \"Unknown state: #{state}\" unless @states.include?(state)\n \n state != @initial_state and\n ! @final_states.include?(state) and\n @alphabet.all? { |let| [nil,state].include? @transitions[state][let] }\n end", "title": "" }, { "docid": "8ab40d3feb71116bd99aed2086f2b01f", "score": "0.6615123", "text": "def over?\n state == 'won' || state == 'lost'\n end", "title": "" }, { "docid": "47b1755c8f6ca8ff3a9d241acfbf12f9", "score": "0.6576566", "text": "def continue_game?\n if @player1.has_lost? == false && @player2.has_lost? == false && @turn_counter < @max_number_of_turns\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "8ae0981528e15dfd1181040de2d116b5", "score": "0.65751165", "text": "def game_over?\n won? || stalemate?\n end", "title": "" }, { "docid": "e837fb67127e53db50b84e13f982209a", "score": "0.6567775", "text": "def calc_lost_challenge(args)\n args.state.wait_after_answer -= 1\n return unless args.state.wait_after_answer <= 0\n\n args.state.status = :lost_game\nend", "title": "" }, { "docid": "8014134f4e6efd80e9b4197641e06b81", "score": "0.6553847", "text": "def won?(state)\n pieces = state[:pieces]\n player = opponent(state[:player])\n pieces[player].empty?\n end", "title": "" }, { "docid": "8014134f4e6efd80e9b4197641e06b81", "score": "0.6553847", "text": "def won?(state)\n pieces = state[:pieces]\n player = opponent(state[:player])\n pieces[player].empty?\n end", "title": "" }, { "docid": "01efbcfe4b74d2521e7f4f8a36fec3ac", "score": "0.6552572", "text": "def done?(state)\n legal_moves(state).empty?\n end", "title": "" }, { "docid": "01efbcfe4b74d2521e7f4f8a36fec3ac", "score": "0.6552572", "text": "def done?(state)\n legal_moves(state).empty?\n end", "title": "" }, { "docid": "01efbcfe4b74d2521e7f4f8a36fec3ac", "score": "0.6552572", "text": "def done?(state)\n legal_moves(state).empty?\n end", "title": "" }, { "docid": "1712c66dbad3d6dc7ba03210605c29a8", "score": "0.6531258", "text": "def loser?\n @game.lose\n end", "title": "" }, { "docid": "95c31d6fcbe2b78091a922bbec0078d1", "score": "0.65298074", "text": "def game_over?\n @game_over\n end", "title": "" }, { "docid": "fc0be98dba24f47291f2f5502bedbd00", "score": "0.65233654", "text": "def done?(state)\n # legal_moves(state).empty?\n # Try to speed up by disregarding possibility of draw\n false\n end", "title": "" }, { "docid": "7cedf760dcc324510b704e3a06a74cea", "score": "0.65192884", "text": "def lose\n self.remaining_guesses == 0\n end", "title": "" }, { "docid": "6b3b3b0165a2220e63cbf25b263c33ad", "score": "0.6516944", "text": "def game_is_over\n\t game_lost? || game_won?\n\tend", "title": "" }, { "docid": "1af33d1671d1b633365fdb5ce3652e82", "score": "0.64974225", "text": "def check_for_loosing(cell)\n if @board[[cell[0], cell[1]]].has_mine?\n @game_lost = true\n end\n end", "title": "" }, { "docid": "4a957d12b675b91919b993f55606d883", "score": "0.6494811", "text": "def lost?\n\t\t@wrong >= 6\n\tend", "title": "" }, { "docid": "849e0fa32845b1f578c76cac86daeae8", "score": "0.6485513", "text": "def dead?\n state == :dead\n end", "title": "" }, { "docid": "c33c2d1ccef88d81f88e8f245de690a7", "score": "0.64841086", "text": "def isGameOver\n isBoardFull ||\n (!isValidMoveAvailableForDisc(WHITE) &&\n !isValidMoveAvailableForDisc(BLACK))\n end", "title": "" }, { "docid": "3cde7387a6fdcff42012f694af6ddc52", "score": "0.64829344", "text": "def gameOver?()\n if @one.gameOver? && [email protected]?\n ONE\n elsif @two.gameOver? && [email protected]?\n TWO\n elsif [email protected] && !two.gameOver?\n false\n else\n :invalid_state\n end\n end", "title": "" }, { "docid": "8a113f39dfd67b569b1ee06e5f23dcfc", "score": "0.64741933", "text": "def check_gameover\r\n SceneManager.goto(Scene_Gameover) if $game_party.all_dead?\r\n end", "title": "" }, { "docid": "b43eb8255852cd9998923cb0e595afaf", "score": "0.647373", "text": "def won?(state)\n pieces = state[:pieces]\n player = opponent(state[:player])\n # pieces[player].empty?\n king = pieces[player].find { |piece| piece.class == King }\n !king\n end", "title": "" }, { "docid": "2e8a90b5c7286619a3023474e5af55ab", "score": "0.6469237", "text": "def isGameOver()\n return isBoardFull() ||\n (!isValidMoveAvailableForDisc(WHITE) &&\n !isValidMoveAvailableForDisc(BLACK))\n end", "title": "" }, { "docid": "3acb71f63c5df5a3d2e01c6a11b9e4e3", "score": "0.64680946", "text": "def game_over?\n remaining_players == 1\n end", "title": "" }, { "docid": "8c428aaf34e11235f7ab8575e1e6c714", "score": "0.6467739", "text": "def lost?\n self.incorrect_guesses.size >= @guess_limit\n end", "title": "" }, { "docid": "676711eec653939586e15438fe8e5383", "score": "0.64668304", "text": "def opponent_last_move_is_not_a_pawn?\n prev_move.nil? || prev_move['name'] != 'pawn'\n end", "title": "" }, { "docid": "8d9584bc0e9edb66e86c8c19056d54e8", "score": "0.6466424", "text": "def lose?(player)\n ships_left = player.ships.reject{|s| s.dead?} if RULES == 'Classic'\n ships_left = player.ships.reject{|s| s.hit?} if RULES == 'NonClassic'\n return true if ships_left.length == 0\n false\n end", "title": "" }, { "docid": "5c4ca0693faf67738ab03fe6742ac037", "score": "0.64603597", "text": "def immediate_loss?(brd)\n !almost_win_combo(player_spots(brd), brd).flatten.empty?\nend", "title": "" }, { "docid": "e6ca5cd188a5f5571f968cb3511d3293", "score": "0.6448913", "text": "def check_gameover\n return unless $game_party.all_dead?(true)\n return SceneManager.goto(Scene_Gameover) if $game_system.allow_gameover?\n SceneManager.call_all_dead_rescue\n end", "title": "" }, { "docid": "e6ca5cd188a5f5571f968cb3511d3293", "score": "0.6448913", "text": "def check_gameover\n return unless $game_party.all_dead?(true)\n return SceneManager.goto(Scene_Gameover) if $game_system.allow_gameover?\n SceneManager.call_all_dead_rescue\n end", "title": "" }, { "docid": "150e7e7afb6714cbf55e1aae466d6061", "score": "0.64437747", "text": "def lose?\n\t\treturn true if @wrongGuess == 5\n\t\treturn false\n\tend", "title": "" }, { "docid": "18133a1fd471f8233b5f8deb5d1565c8", "score": "0.6419572", "text": "def state_full?(state_id)\r\n # Return false if the applicable state is not added.\r\n unless self.state?(state_id)\r\n return false\r\n end\r\n # Return true if the number of maintenance turns is -1 (auto state).\r\n if @states_turn[state_id] == -1\r\n return true\r\n end\r\n # Return true if the number of maintenance turns is equal to the\r\n # lowest number of natural removal turns.\r\n return @states_turn[state_id] == $data_states[state_id].hold_turn\r\n end", "title": "" }, { "docid": "c7166b9e09d3b365d2bae9a74ab70547", "score": "0.6409017", "text": "def checkgameover()\r\n\t\t(Logic::checkdraw(@board) or Logic::checkwin(@board))\r\n\tend", "title": "" }, { "docid": "39f7efa2ec1dfca4831b7ff50f88b0e0", "score": "0.64079666", "text": "def won?(state)\n # Fill this in\n player = state[:player]\n longest_row(state, player) >= 5\n end", "title": "" }, { "docid": "95d2d86dc417f0512bef407e3f63b571", "score": "0.640568", "text": "def over?\n num_players = @players.count\n @turns.count >= num_players &&\n @turns.last(num_players).all?(&:passed?)\n end", "title": "" }, { "docid": "612eab58b4041c1714d4a138366c82a4", "score": "0.639766", "text": "def lose_game?\n lose = []\n index = 0\n while index < 9\n if @game_board[index].include?(\"*\")\n lose << true\n end\n index += 1\n end\n if lose.include?(true)\n true\n else\n false\n end\n end", "title": "" }, { "docid": "0da5d903813dd7fd15ecf29fe46bf141", "score": "0.6395804", "text": "def game_over?(game_status)\n\tputs \"==>in #{__method__.to_s}\" if $DEBUG\n\treturn $game_status != $IN_PROGRESS\nend", "title": "" }, { "docid": "81f6161cfd2fdc7d1eeddd2085da14e4", "score": "0.6394926", "text": "def check_game_over\r\n if @guesses_left <= 0\r\n @winner = false\r\n true\r\n elsif @player_progress == @current_word\r\n @winner = true\r\n true\r\n end\r\n end", "title": "" }, { "docid": "d294b2f8ecbcae1864f75de87e27a545", "score": "0.6381105", "text": "def game_over\n alive_players.count == 1\n end", "title": "" }, { "docid": "ccc8ab0a73ebb68d0ceb439044449321", "score": "0.6381037", "text": "def has_lost?(kill)\n if (@deck.cards.empty? == true || kill == true)\n @has_lost = true\n else\n @has_lost\n end\n end", "title": "" }, { "docid": "2e498e41aa81d18eb09cdfffb6c458f3", "score": "0.6379426", "text": "def retreated_from_battle?\n mobs.each do |mob|\n return false if not mob.retreated_from_battle? and not mob.dead?\n end\n return true\n end", "title": "" }, { "docid": "b2ba790576fc50d16d38d8492af0e4ef", "score": "0.63775456", "text": "def won?(state)\n # Fill this in\n end", "title": "" }, { "docid": "6e5e8af4da917d78cf9605e71cf3e2d5", "score": "0.63739145", "text": "def game_over?\n @life <= 0\n end", "title": "" }, { "docid": "60683c0716eb47ad32bb6647d0adca74", "score": "0.6367259", "text": "def won?\n criminal_lost?(@game.current_round)\n end", "title": "" }, { "docid": "6a4a19f725f1a43b3653e44c6d4de327", "score": "0.6363651", "text": "def win_lose?\n if @player_attempts_count > 12\n return true\n elsif @game_word == @game_space\n return false\n else\n return nil\n end\n end", "title": "" }, { "docid": "5e5b8aac63016da746872936eb827762", "score": "0.63613707", "text": "def move_out_of_check?\n x0 = x_coord\n y0 = y_coord\n result = false\n correct_moves.each do |move|\n # call check? to determine if any available valid move is able to get king out of check\n next unless valid_move?(move[0], move[1])\n update_attributes(x_coord: move[0], y_coord: move[1])\n reload\n result = true unless game.check?(color)\n # reset possible moves to starting position\n update_attributes(x_coord: x0, y_coord: y0)\n reload\n return true if result == true\n end\n result\n end", "title": "" }, { "docid": "04109739eee8c53cb7edcc69b91ebebc", "score": "0.63597566", "text": "def over?\n !@game_on\n end", "title": "" }, { "docid": "d7cef2e62ae309161eb178662c749815", "score": "0.6359136", "text": "def checkForLosers()\n @players.each do |player|\n # Remove players with no cards left from the game\n if player.handLength() == 0\n puts \"#{player.name} lost and has been removed from the game\"\n puts\n removePlayer(player)\n return true\n end\n end\n return false\n end", "title": "" }, { "docid": "1947c4c05e0cadb4ec7ba5176b80dddb", "score": "0.6351925", "text": "def lost_all_lives\n @players[@current_player].lives == 0\n end", "title": "" }, { "docid": "be6b5b865f308949cdc5c95edd7b9779", "score": "0.6347667", "text": "def holding_up\n check_move(:up) unless [:moving, :won, :dead].include?(@state)\n end", "title": "" }, { "docid": "9ca667e9513a9bf8315072f16114971e", "score": "0.6343942", "text": "def state_full?(state_id)\n return false unless state?(state_id)\n return @state_turns[state_id] == $data_states[state_id].hold_turn\n end", "title": "" }, { "docid": "77ce0b9e2743294971eaced8ac20f729", "score": "0.634289", "text": "def lose?( hand )\n # Player neither wins nor ties\n !win?(hand) && !push?(hand)\n end", "title": "" }, { "docid": "ea60d796a789e13c831b9938d9ea99c3", "score": "0.6338364", "text": "def gameover?\n @board.checkmate?(@turn.color) \n end", "title": "" }, { "docid": "f1aa1956e8c7c81b33dec38e7467a8bc", "score": "0.633588", "text": "def gameover?\n\t\t(@stock_useless.eql?(2) && (@stock_count.eql?(0) != @discard_pile.count.eql?(0)) && || gamewon?)\n\tend", "title": "" }, { "docid": "c9b24660d9806fd16e9720b5af571ca4", "score": "0.6335241", "text": "def game_over?\n @player_w.next_moves.empty? && @player_b.next_moves.empty?\n end", "title": "" }, { "docid": "87d7a9a26e15837bd691a0f5ff9e384c", "score": "0.63341343", "text": "def games_lost\n Game.where(['player_1_id = ? OR player_2_id = ?', self.id, self.id]).where.not(['winner_id = ?', self.id])\n end", "title": "" }, { "docid": "c32642401bd2bf869dbb17e89fd4ec11", "score": "0.6328757", "text": "def state_full?(state_id)\n # Return false if the applicable state is not added.\n unless self.state?(state_id)\n return false\n end\n # Return true if the number of maintenance turns is -1 (auto state).\n if @states_turn[state_id] == -1\n return true\n end\n # Return true if the number of maintenance turns is equal to the\n # lowest number of natural removal turns.\n return @states_turn[state_id] == $data_states[state_id].hold_turn\n end", "title": "" }, { "docid": "c32642401bd2bf869dbb17e89fd4ec11", "score": "0.6328757", "text": "def state_full?(state_id)\n # Return false if the applicable state is not added.\n unless self.state?(state_id)\n return false\n end\n # Return true if the number of maintenance turns is -1 (auto state).\n if @states_turn[state_id] == -1\n return true\n end\n # Return true if the number of maintenance turns is equal to the\n # lowest number of natural removal turns.\n return @states_turn[state_id] == $data_states[state_id].hold_turn\n end", "title": "" }, { "docid": "c32642401bd2bf869dbb17e89fd4ec11", "score": "0.6328757", "text": "def state_full?(state_id)\n # Return false if the applicable state is not added.\n unless self.state?(state_id)\n return false\n end\n # Return true if the number of maintenance turns is -1 (auto state).\n if @states_turn[state_id] == -1\n return true\n end\n # Return true if the number of maintenance turns is equal to the\n # lowest number of natural removal turns.\n return @states_turn[state_id] == $data_states[state_id].hold_turn\n end", "title": "" }, { "docid": "5d0b7a36d25af1fad040806c8bffe094", "score": "0.63241935", "text": "def won?(state)\n # Fill this in\n player = state[:player]\n pieces_left = state[:pieces_left]\n pieces_left[opponent(player)] == 0 ||\n pieces_left[opponent(player)] == 1 && pieces_left[player] == 4\n end", "title": "" }, { "docid": "5d0b7a36d25af1fad040806c8bffe094", "score": "0.63241935", "text": "def won?(state)\n # Fill this in\n player = state[:player]\n pieces_left = state[:pieces_left]\n pieces_left[opponent(player)] == 0 ||\n pieces_left[opponent(player)] == 1 && pieces_left[player] == 4\n end", "title": "" }, { "docid": "2ca16ba779fac59d96ab6f92e9f71601", "score": "0.6319971", "text": "def game_over?\n return (self.moves_count >= MAX_MOVES or winner_identifier.present?)\n end", "title": "" }, { "docid": "cef01257b344dd526acf6e9f1e9f8d59", "score": "0.6313943", "text": "def game_over?\n if lose? || win?\n @board.cheat\n return true\n end\n false\n end", "title": "" }, { "docid": "857faeef9c4602dbe22e0f14f843dd3e", "score": "0.6298556", "text": "def closed?\n won? || lost?\n end", "title": "" }, { "docid": "ecdb685b72104ac7114c4b9db437cb53", "score": "0.6285917", "text": "def lose?\n true if @guesses >= 12\n end", "title": "" }, { "docid": "efd0e187992138edf2de055f10ec5485", "score": "0.62753177", "text": "def n_move?(turns_count)\n return false if @board.history.length < turns_count\n\n @board.history.last(turns_count).none? do |move|\n [Capture, PromotionCapture, PromotionMove].include?(move.class) ||\n (move.is_a?(Move) && move.figure.figure == :pawn)\n end\n end", "title": "" }, { "docid": "da4762120bdd5310ff58ca4dd24eadf0", "score": "0.62747186", "text": "def game_over?\n !@cur_piece.can_be_set?\n end", "title": "" } ]
96ded32b7ab2b210c4d58f2538c3cd42
returns array of crop_type instances that match the farmer's season
[ { "docid": "63944a3dfe63dda313f6597063ebc297", "score": "0.74108356", "text": "def crops_in_season\n CropType.where(\"season = ?\", self.season)\n end", "title": "" } ]
[ { "docid": "cd1308c8bba7bb14d1cbb4756734476f", "score": "0.6078872", "text": "def new_episodes( season )\n return @seasons[season][1].flatten\n end", "title": "" }, { "docid": "f8c931a0b9137819159fce30ac577572", "score": "0.57701206", "text": "def episodes( season )\n return @seasons[season].first.flatten\n end", "title": "" }, { "docid": "2897e2d1aa5485117907fa87a5ce6009", "score": "0.5658961", "text": "def find_season_type_category_codes\n CategoryType.are_not_relays.is_divided.for_season_type(@season.season_type)\n .for_season(@season)\n .sort_by_age\n .pluck(:code).uniq\n end", "title": "" }, { "docid": "c8f4c8371d5b1448589d8a34407b44ed", "score": "0.5644496", "text": "def find_season_type_events\n EventType.are_not_relays.for_season_type(@season.season_type)\n .sort_by_style.distinct\n end", "title": "" }, { "docid": "962f55835b260f93326fe9e3b07885b6", "score": "0.5450268", "text": "def get_season_type\n season_type ? season_type.short_name : '?'\n end", "title": "" }, { "docid": "a819b5822533dad4f731ee8c42be3249", "score": "0.54490435", "text": "def retrieve_closed_seasons\n @season_type.seasons.where(['end_date < ?', Date.today])\n .sort_season_by_begin_date('DESC')\n end", "title": "" }, { "docid": "e7161764aaec2e22d72e43f46c122d57", "score": "0.5422469", "text": "def get_contemporary_seasons_involved_into(season)\n @swimmer.seasons.is_in_range(season.begin_date, season.end_date)\n end", "title": "" }, { "docid": "f29f7252b22705b5e62f41cc16ad0d21", "score": "0.5401564", "text": "def get_searched_seasons\n current_seasons = if params['header_year'].present?\n Season.where( \"header_year LIKE '%#{ params['header_year'] }%'\" )\n else\n Season.is_not_ended\n end\n current_seasons.map{ |season| season.id }\n end", "title": "" }, { "docid": "ee8db808787ebe4eba2c49b787cae727", "score": "0.5322301", "text": "def get_css_class_for_season_type\n if object.season_type && object.season_type.code =~ /CSI/i\n 'goggles-meeting-csi'\n elsif object.season_type && object.season_type.code =~ /FIN/i\n 'goggles-meeting-fin'\n else\n ''\n end\n end", "title": "" }, { "docid": "e8e76f8b2f34f3fe8dd4d7045d554a41", "score": "0.53193754", "text": "def seasons(season = nil)\n @server.make_json_request('show.seasons', tvdbid: @tvdbid, season: season)['data']\n end", "title": "" }, { "docid": "4eeb60210a9a4a4bfabaea7df8ac631c", "score": "0.5305701", "text": "def season_status\n season_st = []\n @organization = Organization.where(:_id => session[:current_org]).first\n @organization.seasons.each do |each_seasons|\n season_st << each_seasons.is_current\n end\n return season_st\n end", "title": "" }, { "docid": "56277769dd82198f9bf4a2026f643d62", "score": "0.52958673", "text": "def set_seasons\n @seasons = Campground.find(params[:campground_id]).seasons\n end", "title": "" }, { "docid": "bcf6e1ca4fb0572f19164fd41fe92a58", "score": "0.52565366", "text": "def get_closed_seasons\n @closed_seasons ||= retrieve_closed_seasons\n end", "title": "" }, { "docid": "4042978b58bf9ea1b0a020b42be9af71", "score": "0.52310187", "text": "def acommodate_seasons\n new_year_season = @seasons.select{|season| season.end < season.start}.first\n\n first_seasion = Season.new(new_year_season)\n new_year_season.end = SeasonDate.last_day_of_year\n\n @seasons.push(first_seasion)\n end", "title": "" }, { "docid": "2129caf9ee2206388b4e1e07c5e39299", "score": "0.52171695", "text": "def get_all_seasons_by_status\n dateNow = DateTime.now.end_of_day\n all_seasons = Hash.new\n all_seasons[:upcoming] = Array.new\n all_seasons[:current] = Array.new\n all_seasons[:past] = Array.new\n seasons = Season.all\n\n seasons.each do |season|\n if (season.is_active) # current or upcoming season\n # going to assume if today is part the season end date that the league owner intentionally wanted the season to be current\n if (season.date_start <= dateNow)\n all_seasons[:current].push(season)\n else\n all_seasons[:upcoming].push(season)\n end\n else # past season\n all_seasons[:past].push(season)\n end\n end\n all_seasons\n end", "title": "" }, { "docid": "c25a56e19d9127d92eadb560f34b4e90", "score": "0.51896644", "text": "def get_season_type\n season ? season.get_season_type : (data_import_season ? data_import_season.get_season_type : '?')\n end", "title": "" }, { "docid": "665286390995c276dba1cad0d19eebe7", "score": "0.5160151", "text": "def season(yday)\n case yday\n when 80..171\n :midseason\n when 172..265\n :summer\n when 266..355\n :midseason\n else\n :winter\n end\n end", "title": "" }, { "docid": "9694a8c360898daeaf4bfd01122150cd", "score": "0.51593006", "text": "def season_prepare\n ret = {\n :competitions_to_draw => League.all\n }\n \n ret[:competitions_to_draw]\n \n return ret\n end", "title": "" }, { "docid": "60af7788c2350eeeaf485472b42a82b1", "score": "0.5157632", "text": "def get_closed_seasons_involved_into(season_type = nil, ended_before = nil)\n seasons = season_type ?\n @swimmer.seasons.for_season_type(season_type).is_ended.sort_season_by_begin_date('DESC') :\n @swimmer.seasons.is_ended.sort_season_by_begin_date('DESC')\n seasons = seasons.reject { |s| s.end_date > ended_before } if ended_before\n seasons\n end", "title": "" }, { "docid": "c9a0f4a3bde22cb55dcf0c0505d2438a", "score": "0.5139573", "text": "def season\n number = ((self.day - 1) / 30) % 4\n case number\n when 0\n return \"spring\"\n when 1\n return \"summer\"\n when 2\n return \"fall\"\n when 3\n return \"winter\"\n end\n end", "title": "" }, { "docid": "12b35cb1da65f17d77d3ca6e84fa8320", "score": "0.5136389", "text": "def division_ids(season)\n ids = Division.where(:season_id => season)\n @divs = Array.new\n ids.each do |p|\n @divs << p.id\n end\n end", "title": "" }, { "docid": "92a81f686df6536cf48b20f1341a010f", "score": "0.51362395", "text": "def species_list_from_criteria\n show_seen = Settings::SPECIES_SHOWN == 'Seen'\n show_captured = Settings::SPECIES_SHOWN == 'Owned'\n return (1..GameData::Pokemon::LAST_ID).select do |i|\n next(false) if show_seen && !$pokedex.has_seen?(i)\n next(false) if show_captured && !$pokedex.has_captured?(i)\n next(false) if Settings::BLACK_LIST.include?(i) || Settings::BLACK_LIST.include?(GameData::Pokemon.db_symbol(i))\n\n next(true)\n end\n end", "title": "" }, { "docid": "cb5499278b961fd96ca20f9aa02f678d", "score": "0.51072574", "text": "def season\n Allocine::Season.new(document[\"parentSeason\"][\"code\"])\n end", "title": "" }, { "docid": "fabf850d1b56357ec9f859eccf7c009e", "score": "0.5082458", "text": "def mz_seasons\n age - System::JUNIOR_START_AGE\n end", "title": "" }, { "docid": "76997b96ecad7e77a44bf9f2fccf2160", "score": "0.50817645", "text": "def get_season()\n\t\ttime = Time.new\n\n\t\tif(time.month >= 3) && (time.month <= 5)\n\t\t\t\tseason_type = \"Yeah it is Spring\"\n\t\t\telsif (time.month > 5) && (time.month <= 8)\n\t\t\t\tseason_type = \"Everyone Loves Summer\"\n\t\t\telsif (time.month > 8) && (time.month <= 10)\n\t\t\t\tseason_type = \"Put on Your Coat because Autumn is here\"\n\t\t\telse\n\t\t\t\tseason_type = \"Yuck, it's now Winter\"\n\t\tend\n\tend", "title": "" }, { "docid": "1a2022ed36732fe45236c5dee1d4c6cc", "score": "0.5067316", "text": "def get_current_seasons_involved_into(season_type = nil)\n season_type ? @swimmer.seasons.for_season_type(season_type).is_not_ended : @swimmer.seasons.is_not_ended\n end", "title": "" }, { "docid": "3091f9e6c612be6cdc3dce69a974c903", "score": "0.50658077", "text": "def find_and_set_season_episode_fields\n @season_ep_field_pos = nil\n SeasonEp_Regexps.each do |re|\n @filename_fields.each_with_index do |fn_field, idx|\n if fn_field =~ re\n @season_ep_field_pos = idx\n @result[:season] = $1.to_i\n @result[:episode] = $2.to_i\n break\n end\n end\n break unless @season_ep_field_pos.nil?\n end\n @season_ep_field_pos\n end", "title": "" }, { "docid": "eb7ae1612f063ddd6e59136a1011579d", "score": "0.50622356", "text": "def to_seasons(seasons)\n if seasons\n seasons.collect do |season|\n season = season.values[0]\n Season.new(\n Date.strptime(season['start'], '%m-%d'),\n Date.strptime(season['end'], '%m-%d'),\n season['rate'][1..-1].to_f\n )\n end\n end\n end", "title": "" }, { "docid": "4a3e7968f88d652319572e1294b7a61b", "score": "0.50442845", "text": "def season\n case merch_month\n when 1,2,3,4,5,6\n \"Spring/Summer\"\n when 7,8,9,10,11,12\n \"Fall/Winter\"\n end\n end", "title": "" }, { "docid": "3eaa4ed4ed4e728bacba6ead6ef28faa", "score": "0.5044002", "text": "def get_all_contestants data \n people = []\n data.each { | season | contestants = season[1]; \n contestants.each { | person | people << person } }\n people \nend", "title": "" }, { "docid": "2a5f753ab7e8e27674cab7a72b6f169b", "score": "0.50021726", "text": "def pick_movies(range, filters, timeleft)\n movies = filter(filters)\n picked = []\n halls = schedule.detect { |p| p.range_time == range }.hall\n start = range.first\n # Отбросываем фильмы, которые точно не поместятся\n # Выбираем из оставшихся рандомные, снижаем допустимое время\n # Создаем объект ScheduleLine, который занимается печатью строки расписания\n while timeleft > 0\n movie = movies.reject { |m| m.duration > timeleft }.sample\n return picked if movie.nil?\n picked << ImdbPlayfield::ScheduleLine.new(start: start, movie: movie, halls: halls)\n start += movie.duration * 60\n timeleft -= movie.duration\n end\n end", "title": "" }, { "docid": "203da456da9852cb5d2ed18067339979", "score": "0.49858898", "text": "def season_names_for_date(date)\n seasons = case date.strftime('%-m').to_i\n when 3..5 then %w[Spring]\n when 6..8 then %w[Summer]\n when 9..11 then %w[Autumn Fall]\n else %w[Winter]\n end\n year = date.year\n seasons.map { |season| \"#{season} #{year}\" }\n end", "title": "" }, { "docid": "c07f874957a1dd3847d7875b392481f0", "score": "0.49631295", "text": "def all_winter_holiday_supplies(holiday_hash)\n new_array = Array.new\n holiday_hash.each do |season, hash|\n if season == :winter\n hash.each do |holiday, supplies_array|\n if holiday == :christmas || :new_years\n new_array << supplies_array\n end\n end\n end\n end\n new_array.flatten\nend", "title": "" }, { "docid": "9f02ae3cd70efac054233c668b3143d6", "score": "0.4945465", "text": "def test_17\n ActiveRecord::Base.logger.debug \"start season test_17 #{ Season.find_by_date(Date.new(2011,04,14)).name}\"\n ActiveRecord::Base.logger.debug \"end season test_17 #{ Season.find_by_date(Date.new(2011,04,16)).name}\"\n Charges.new(Date.new(2011,04,14),\n Date.new(2011,04,16),\n\t\t1, 1, 20)\n charges = Charge.find_all_by_reservation_id 20\n assert_equal 2, charges.size\n assert_equal 1, charges[0].season_id\n assert_equal 1.0, charges[0].period.to_f\n assert_equal 12.0, charges[0].rate.to_f\n assert_equal 12.0, charges[0].amount.to_f\n assert_equal Charge::DAY, charges[0].charge_units\n assert_equal 2, charges[1].season_id\n assert_equal 1.0, charges[1].period.to_f\n assert_equal 15.0, charges[1].rate.to_f\n assert_equal 15.0, charges[1].amount.to_f\n assert_equal Charge::DAY, charges[1].charge_units\n end", "title": "" }, { "docid": "56a8e67d1dd423fda9dce55c30588e93", "score": "0.4890675", "text": "def season\n @season ||= Season.find(@importer_hash.meeting.season_id)\n end", "title": "" }, { "docid": "f372e3ecf4f798531ecbec4f8f28df40", "score": "0.4869252", "text": "def retrieve_distinct_categories\n if @distinct_categories\n categories = @distinct_categories\n else\n categories = []\n @team.season_types.each do |season_type|\n season_type.seasons.sort_season_by_begin_date\n .last\n .category_types.are_not_relays\n .sort_by_age.each do |category_type|\n categories << category_type unless categories.rindex { |e| e.code == category_type.code }\n end\n end\n end\n categories\n end", "title": "" }, { "docid": "1134d04754d677b4f516aaa24a9d1365", "score": "0.48684582", "text": "def season(year, **options) = get(\"/seasons/#{year}\", **{ sportId: 1 }.merge(options))", "title": "" }, { "docid": "a3e9bf8260b91a223ef1183b4649d713", "score": "0.48454663", "text": "def all_winter_holiday_supplies(holiday_hash)\n\twinter_day = []\n holiday_hash.collect do |season, holiday|\n if season == :winter\n holiday.collect do |name, day|\n winter_day << day\n #day\n end\n #winter_day\n end\n #winter_day\n end\n winter_day.flatten\n end", "title": "" }, { "docid": "af94c927cec5fc3309f6b3a65ce21454", "score": "0.48288438", "text": "def find_matchs(round, season)\n if round.nil?\n return []\n end\n\n season = self.current_season if season.nil?\n rounds = []\n rounds = season.rounds.collect {|r| r if\n r.number <= round.number}\n matchs = []\n rounds.each do |r|\n if !r.nil?\n r.match_generals.each {|m| matchs << m if m.guest == self or\n m.local == self}\n end\n end\n matchs\n end", "title": "" }, { "docid": "94b4c5f3fa1e40eaffb6068b40dc5afd", "score": "0.4814441", "text": "def species\r\n villagers.map{ |villager| villager.species}\r\n end", "title": "" }, { "docid": "187051c77376a539754567a2e3a89525", "score": "0.4786784", "text": "def genre_array\n Genre.list.each { |genre| @available_genres << genre.kind }\n end", "title": "" }, { "docid": "6732309883d33a01de977ac20d7c1757", "score": "0.47743383", "text": "def extract_types_for_moes(simulation_runs)\n array_for_moes_types = []\n\n first_run = simulation_runs.where('$and' => [{result: {'$exists' => true}}, {result: {'$ne' => {}}}, {result: {'$ne' => nil}} ]).first\n\n unless first_run.nil?\n first_line_result = first_run.result\n array_for_moes_types = first_line_result.map { |result| Utils::extract_type_from_value(result[1]) }\n end\n\n array_for_moes_types\n end", "title": "" }, { "docid": "7d95f815d927732223f1fb57636b588e", "score": "0.47632816", "text": "def applied_season(season_id)\n seasons.where(org_season_id: BSON::ObjectId.from_string(season_id)).first\n end", "title": "" }, { "docid": "114a630c5bd92916c486b93ec417e73d", "score": "0.47625518", "text": "def find_climate_zone_set(clim, building_vintage)\n result = nil\n \n possible_climate_zones = [] \n self.standards['climate_zone_sets'].each do |climate_zone_set|\n if climate_zone_set['climate_zones'].include?(clim)\n possible_climate_zones << climate_zone_set['name']\n end\n end\n \n # Check the results\n if possible_climate_zones.size == 0\n OpenStudio::logFree(OpenStudio::Error, 'openstudio.standards.Model', \"Cannot find a climate zone set containing #{clim}\")\n elsif possible_climate_zones.size > 2\n OpenStudio::logFree(OpenStudio::Error, 'openstudio.standards.Model', \"Found more than 2 climate zone sets containing #{clim}; will return last matching cliimate zone set.\") \n end\n \n # For Pre-1980 and 1980-2004, use the most specific climate zone set.\n # For example, 2A and 2 both contain 2A, so use 2A. \n # For 2004-2013, use least specific climate zone set.\n # For example, 2A and 2 both contain 2A, so use 2.\n case building_vintage\n when 'DOE Ref Pre-1980', 'DOE Ref 1980-2004' \n result = possible_climate_zones.sort.last\n when '90.1-2007', '90.1-2010', '90.1-2013'\n result = possible_climate_zones.sort.first\n when '90.1-2004'\n if possible_climate_zones.include? \"ClimateZone 3\"\n result = possible_climate_zones.sort.last\n else\n result = possible_climate_zones.sort.first\n end\n end\n \n # Check that a climate zone set was found\n if result.nil?\n \n end\n \n return result\n \n end", "title": "" }, { "docid": "eb9f5216e75338a5dc25901c179a7750", "score": "0.4752406", "text": "def scenes\n Scene.find( \n :all,\n :select => 's.*',\n :from => 'scenes s, episodes e, locations l',\n :conditions => [\"s.episode_id = e.id and s.id = l.scene_id and l.place_id = ?\", self],\n :order => 'e.tx_date, e.position, s.segment_position'\n )\n end", "title": "" }, { "docid": "4a5ebe50af28dc25230458d940b86ba0", "score": "0.47146735", "text": "def division\n\t\tself.division_season\n\tend", "title": "" }, { "docid": "018435005132817e3d9cc4dce13ce9e7", "score": "0.47010612", "text": "def get_season_type_best_for_event(season_type, event_type, pool_type)\n # XXX [Steve] Previous implementation:\n # @swimmer.meeting_individual_results.for_season_type( season_type ).for_pool_type( pool_type ).for_event_type( event_type ).is_not_disqualified.exists? ?\n # @swimmer.meeting_individual_results.for_season_type( season_type ).for_pool_type( pool_type ).for_event_type( event_type ).is_not_disqualified.sort_by_timing('ASC').first.get_timing_instance :\n # nil\n season_type_best_mir = get_season_type_best_mir_for_event(season_type, event_type, pool_type)\n season_type_best_mir ? season_type_best_mir.get_timing_instance : nil\n end", "title": "" }, { "docid": "0174bc7108ab8959d9ce7551577392c9", "score": "0.46940103", "text": "def get_scenes(script)\n script = script.split(\"\\n\") if script.is_a?(String)\n scene_starts = find_scene_starts(script)\n scene_ends = find_scene_ends(script)\n scene_starts.zip(scene_ends).map {|s, e| Bun::Script::Scene.new(script[s..e], s) }\n end", "title": "" }, { "docid": "fb15cc6e2328796b714cd5f712c1c927", "score": "0.4693166", "text": "def initialize(n) # The state of a season is just its\n@n = n # index in the NAMES and INSTANCES arrays\nend", "title": "" }, { "docid": "e822c21999eec02cd92a0bba886bbeec", "score": "0.46872607", "text": "def wine_type_by_food\n wine_array = self.wines\n wine_types = wine_array.map do |wine|\n wine.varietal\n end\n wine_types.uniq!\n end", "title": "" }, { "docid": "5983b8a5c5339fcea1b009e31282ec89", "score": "0.46844155", "text": "def races_created_for_competition\n source_events.map do |event|\n event.races.select { |r| r.created_by.is_a?(self.class) }\n end.flatten\n end", "title": "" }, { "docid": "d73a0f00822f69fe7006634211705a5a", "score": "0.46842507", "text": "def get_type(dinosaur_objects)\n Array(dinosaur_objects).map do |d|\n CARNIVORES.include?(d.species) ? 'carnivore' : 'herbivore'\n end\n end", "title": "" }, { "docid": "177c932ec16ec7b9e35faa23c692faad", "score": "0.4667299", "text": "def get_semesters(args)\n if args.is_a? Integer\n raise ArgumentError, \"#{args} is not a valid year\" unless args > 1800\n\n args = [args.to_s]\n elsif args.is_a? String\n raise ArgumentError, \"#{args} is not a valid year\" unless /\\d{4}/.match? args\n\n args = [args]\n end\n\n raise ArgumentError, \"#{args} is not a valid year or list of years\" unless args.respond_to? :map\n\n semesters = args.map do |e|\n if e.length == 6\n e\n else\n [e + '01', e + '05', e + '08', e + '12']\n end\n end\n semesters.flatten\n end", "title": "" }, { "docid": "ff165b9a62cc1d7eeb03cb5078aab0f6", "score": "0.4665478", "text": "def films\n self.screenings.map do |screening|\n screening.festival.title\n end\n end", "title": "" }, { "docid": "cd8bcb04696bf4a7b86061837287c752", "score": "0.46585578", "text": "def season_with_fewest_games\n seasons = @games.group_by { |game| game.season }\n seasons.min_by { |season, games| games.count }.first\n end", "title": "" }, { "docid": "ead8d564245f1945a5f1be4adb7c6e44", "score": "0.46579117", "text": "def season\n season_id.nil? ? nil : organization_membership.seasons.find(season_id)\n end", "title": "" }, { "docid": "a358efd086aa759fd27c33db9d68dcc4", "score": "0.46575162", "text": "def find_manageable_seasons( check_date = Date.today() )\n @seasons_found = true\n @seasons_ids = @user.\n team_managers.\n joins( team_affiliation: :season ).\n where( ['seasons.end_date >= ? and seasons.begin_date <= ?', check_date, check_date]).\n select( \"team_affiliations.season_id\" ).\n map{ |tm| tm.season_id }\n end", "title": "" }, { "docid": "f1370139d3378680d80f4ace73bc67b9", "score": "0.4643909", "text": "def current_season\n season = nil\n\n { \n winter: [ 12, 1, 2 ], \n spring: [ 3, 4, 5 ], \n summer: [ 6, 7, 8 ],\n fall: [ 9, 10, 11 ]\n \n }.each do |key, range|\n if range.include? current_month\n season = key\n break\n end\n end\n\n season\n end", "title": "" }, { "docid": "e2eea776fdcc1bc60d5812a2cf7de0db", "score": "0.46204", "text": "def test_18\n start_date = Date.new(2011,05,31)\n end_date = Date.new(2011,06,02)\n ActiveRecord::Base.logger.debug \"start season test_18 #{ Season.find_by_date(start_date).id}\"\n ActiveRecord::Base.logger.debug \"end season test_18 #{ Season.find_by_date(end_date).id}\"\n Charges.new(start_date, end_date, 1, 1, 20)\n charges = Charge.find_all_by_reservation_id 20\n assert_equal 2, charges.count\n charges.each do |c|\n ActiveRecord::Base.logger.debug \"res_id #{c.reservation_id}, start #{c.start_date}, end #{c.end_date}\"\n end\n assert_equal 2, charges[0].season_id\n assert_equal 1.0, charges[0].period.to_f\n assert_equal 15.0, charges[0].rate.to_f\n assert_equal 15.0, charges[0].amount.to_f\n assert_equal Charge::DAY, charges[0].charge_units\n assert_equal 3, charges[1].season_id\n assert_equal 1.0, charges[1].period.to_f\n assert_equal 31.5, charges[1].rate.to_f\n assert_equal 31.5, charges[1].amount.to_f\n assert_equal Charge::DAY, charges[1].charge_units\n end", "title": "" }, { "docid": "f5df1c07f45cb62b8dd24775fd1557ab", "score": "0.45972404", "text": "def all_contestants(data)\n\tarray_of_people = []\n\tdata.each do |season, people|\n\t\tarray_of_people << people\n\tend\n\tarray_of_people.flatten\nend", "title": "" }, { "docid": "7cbfb53f4cdaa84d10c7bb51ce55120c", "score": "0.45971066", "text": "def getQuestStages(quest)\n arr = []\n for key in QuestModule.const_get(quest).keys\n arr.push(key) if key.to_s.include?(\"Stage\")\n end\n return arr\n end", "title": "" }, { "docid": "ed6b47f55b30988998efe7c1e05b9097", "score": "0.45925608", "text": "def collect_winter_supplies(list)\n\n# using new array and then .each = no-no. i know...\n\n all_supplies = []\n\n list.each do |season, holidays_hash|\n if season == :winter\n holidays_hash.each do |holiday_name, supplies|\n supplies.each do |supply|\n all_supplies << supply\n end\n end\n end\n end\n all_supplies\n\nend", "title": "" }, { "docid": "0d3f7d75fd7d136fc9e65d821bc8fb8d", "score": "0.4587024", "text": "def eligible\n @seasons = Season.all\n @default_season = @seasons.last\n @default_divisions = Division.eager_load(:teams).where(:season_id => @default_season.id)\n end", "title": "" }, { "docid": "0aa0671abca5b171c30668107eacf8bf", "score": "0.4576838", "text": "def two_season\n if month<=3\n 0\n elsif month>=10\n 2\n else\n 1\n end\n end", "title": "" }, { "docid": "c2d9bb0fe31a1b69a1499cf0ac2c537c", "score": "0.45737284", "text": "def retrieve_season_hall_of_fame\n seasons_hall_of_fame = []\n get_involved_teams unless @involved_teams\n\n @involved_teams.each do |team|\n team_placement = {}\n team_placement[:team] = team\n %w[first_place second_place third_place].each_with_index do |rank, index|\n placement = index + 1\n team_placement[rank.to_sym] = team.computed_season_ranking.joins(:season).where(\"seasons.season_type_id = #{@season_type.id} AND computed_season_rankings.rank = #{placement}\").count\n end\n seasons_hall_of_fame << team_placement\n end\n seasons_hall_of_fame.sort { |p, n| (n[:first_place] * 10_000 + n[:second_place] * 100 + n[:third_place]) <=> (p[:first_place] * 10_000 + p[:second_place] * 100 + p[:third_place]) }\n end", "title": "" }, { "docid": "2e089acb9977d7e67153ea69fa74382f", "score": "0.45720652", "text": "def water_types\n self.waters.map{|water| water.water_type.category}.uniq.sort\n end", "title": "" }, { "docid": "f50cef10420251a486cd7330ecc0d01f", "score": "0.45632616", "text": "def initialize(n) # The state of a season is just its \n @n = n # index in the NAMES and INSTANCES arrays\n end", "title": "" }, { "docid": "f50cef10420251a486cd7330ecc0d01f", "score": "0.45632616", "text": "def initialize(n) # The state of a season is just its \n @n = n # index in the NAMES and INSTANCES arrays\n end", "title": "" }, { "docid": "7400b457759cb28fea4a1341788f0b39", "score": "0.45583323", "text": "def all_contestants(data)\n contestant_list = []\n data.select {|season, info| contestant_list.concat(info) }\n contestant_list\nend", "title": "" }, { "docid": "88c541c4dcf5f1d7ac2fe27a3edd6110", "score": "0.4547318", "text": "def count_of_games_by_season\n games_by_season = @games.group_by { |game| game.season.to_s }\n games_by_season.each { |season, games| games_by_season[season] = games.count }\n end", "title": "" }, { "docid": "3bff97d460c46c51748109142c0e695e", "score": "0.45191675", "text": "def retrieve_involved_teams\n Team.joins(computed_season_ranking: :season).where(\"seasons.season_type_id = #{@season_type.id}\").distinct\n end", "title": "" }, { "docid": "aa41d3cc31f7e6172509c35f988338e7", "score": "0.45012242", "text": "def cities\n Painting.all.map do |painting_instance| \n if painting_instance.artist == self\n painting_instance.gallery.city\n end\n end.compact.uniq\n end", "title": "" }, { "docid": "6550ff3c3959d2465f63eaba8d9c128b", "score": "0.44966346", "text": "def all_cities\n city_arr = Painting.all.select do |painting_ob|\n #binding.pry\n painting_ob.artist == self\n end\n city_arr.map do |painting_ob|\n painting_ob.gallery.city\n end\nend", "title": "" }, { "docid": "9dcd21b1ff7e875adc8343894fe403be", "score": "0.44957238", "text": "def get_last_season_by_type(season_type_code)\n Season.get_last_season_by_type(season_type_code)\n end", "title": "" }, { "docid": "d27eaaa9458c9bf0ec285acca3cfe35c", "score": "0.44926435", "text": "def scan_for_season_names(token, options = T.unsafe(nil)); end", "title": "" }, { "docid": "8e60e9e6d423a1982fdb22726067d8fc", "score": "0.4487547", "text": "def get_teams\n res = Array.new\n\n @games.each do |g|\n #check if home team is in the result array\n if !res.include?(g.home_team)\n res.push(g.home_team)\n end\n\n #check if away team is in the result array\n if !res.include?(g.away_team)\n res.push(g.away_team)\n end\n end\n\n return res\n end", "title": "" }, { "docid": "dd6915b848094493d31eb4ad6085cf43", "score": "0.44872743", "text": "def genres\n songs.map {|song| song.genre }\n end", "title": "" }, { "docid": "08f5e36fcbfa34fd459a0f784b053d56", "score": "0.44852802", "text": "def extract_teams_from(source_result)\n return [] unless source_result.team\n \n if source_result.race.category.name.include?('Tandem')\n teams = []\n team_names = source_result.team.name.split(\"/\")\n teams << Team.find_by_name_or_alias_or_create(team_names.first)\n if team_names.size > 1\n name = team_names[1, team_names.size - 1].join(\"/\")\n teams << Team.find_by_name_or_alias_or_create(name)\n end\n teams\n elsif source_result.team.name == 'Forza Jet Velo'\n [Team.find_or_create_by_name('Half Fast Velo')]\n else\n [source_result.team]\n end\n end", "title": "" }, { "docid": "87e54ad8ea6f72c267f321e3a6bdfc1d", "score": "0.4482562", "text": "def movies\n # .each - visit everything once\n # .select - select only some whole things\n # .filter - synonym for select\n # .reject - opposite of select/filter\n # .map - 1:1 transformation of array\n # turns each one thing into something\n # given: [1, 2, 3].map {|n| n*n} \n # get: [1, 4, 9]\n self.showings.map do |showing|\n showing.movie\n end.uniq\n end", "title": "" }, { "docid": "f11310270ee939f45bc8725af029ddc5", "score": "0.447417", "text": "def generate_games(divisions, fields, seasons)\n seasons.each do |season|\n divisions.each do |division|\n teamsD = TeamDivision.where(:division_id => division.id)\n season_start = season.start_date\n game_start = season_start\n generate_schedule(teamsD, fields, season, division.id)\n end\n end\n end", "title": "" }, { "docid": "efaa3ebbb092c7d169316ad467407d14", "score": "0.44733113", "text": "def district_to_construct\n purple_districts = districts_on_game.where(\"colour = 'purple'\")\n\n if purple_districts.exists?([\"name = 'factory'\"])\n no_played_cards = cards.districts.where(\"state = 'ONHAND' AND colour <> 'purple' AND cost <=\" + coins.to_s).to_a\n no_played_cards.concat(cards.districts.where(\"state = 'ONHAND' AND colour = 'purple' AND cost <=\" + (coins + 1).to_s).to_a)\n\n else\n\n no_played_cards = cards.districts.where(\"state = 'ONHAND' AND cost <=\" + coins.to_s).to_a\n end\n\n if purple_districts.exists?([\"name = 'quarry'\"])\n district_to_build = no_played_cards.to_a\n else\n played_cards = cards.districts.where(\"state = 'ONGAME'\")\n district_list = Array.new(no_played_cards)\n no_played_cards.each do |card_no_played|\n played_cards.each do |card_played|\n if card_no_played.base_card.name == card_played.base_card.name\n district_list.delete(card_no_played)\n end\n\n end\n\n end\n district_to_build = district_list\n end\n\n district_to_build.uniq{|district| district.base_card.name }\n end", "title": "" }, { "docid": "7da3398fdac08836019e7c1439e7a848", "score": "0.44693986", "text": "def cities\n galleries.map {|gallery| gallery.city}\n end", "title": "" }, { "docid": "7da3398fdac08836019e7c1439e7a848", "score": "0.44693986", "text": "def cities\n galleries.map {|gallery| gallery.city}\n end", "title": "" }, { "docid": "e4b84bef60f8e035e441e5c8d13d7f1e", "score": "0.4467068", "text": "def summer_olympics_sport; end", "title": "" }, { "docid": "0c469797864e643be7acc1b93a88df77", "score": "0.44661248", "text": "def get_possible_swimmers( query )\n swimmers = SwimmerFinder.new( params[:query] ).search()\n swimmers.each do |swimmer|\n @result << {\n class: 'Swimmer',\n id: swimmer.id,\n description: swimmer.get_verbose_name,\n date: Format.a_date( swimmer.updated_at )\n }\n end\n swimmers\n end", "title": "" }, { "docid": "e34d24ecc3a3505511f254fa98bf9a9d", "score": "0.4446575", "text": "def class_months es, class_name\n es.select {|e| e.class_name == class_name }\n .map {|e|e.date.month_start }\n .uniq\n .sort\nend", "title": "" }, { "docid": "2fd74cfcd63feb32c6920bae0cb0f525", "score": "0.44463965", "text": "def genres\n songs.map {|song| song.genre}\n end", "title": "" }, { "docid": "4b32562c2845474805d51bea9fb9d8a1", "score": "0.44361687", "text": "def genres\n @songs.collect {|s| s.genre}\n end", "title": "" }, { "docid": "433c7f458640855a4af2a912088d896c", "score": "0.44356072", "text": "def avaiable_decks\n Deck.all.map { |d| [d.name, d.id] }\n end", "title": "" }, { "docid": "b42ff6bdd8e7b282cdf695235d15f312", "score": "0.44351363", "text": "def shows_with_blanks(festival_start)\n @shows_with_blanks = []\n @current_time_check = festival_start\n i = 0\n until i >= @shows_at_venue_per_day.length\n start_of_show = @shows_at_venue_per_day[i].start_date_time\n find_show_start_time(start_of_show)\n @shows_with_blanks << @shows_at_venue_per_day[i]\n @current_time_check = @shows_with_blanks.last.end_date_time\n check_previous_end_time(start_of_show, end_time_of_previous_show)\n i += 1\n end\n return @shows_with_blanks\n end", "title": "" }, { "docid": "d3264b37f1178277fcbd9086e034a335", "score": "0.4433025", "text": "def genres\n to_array search_by_itemprop 'genre'\n end", "title": "" }, { "docid": "ace038eae90fad628f70c6a65455e83d", "score": "0.443297", "text": "def genres #How to shorten? \n array = []\n songs.each do |song_instance|\n array << song_instance.genre \n end\n array.uniq\n end", "title": "" }, { "docid": "5ca8282bb56be1e0ef214f64fad3b49a", "score": "0.44292277", "text": "def get_content_genres\n if episode?\n return content.show.show_genres\n else\n return content.movie_genres\n end\n end", "title": "" }, { "docid": "b972542ec2ebf947c3e1784b97a35bee", "score": "0.44216788", "text": "def episodes\n Episode.all.select{ |episode| episode.show == self }\n end", "title": "" }, { "docid": "f4d54b7dd337c3a36d9e7c9026fae9f9", "score": "0.4415682", "text": "def parties(location, state)\n if location == :north\n soldiers_at(:north, state).map { |soldier| [soldier] } # one guy\n else\n soldiers_at(:south, state).combination(2).to_a # two guys\n end\nend", "title": "" }, { "docid": "868b674d8eaa42b38788d700cf1bdc69", "score": "0.44136608", "text": "def shows_at_venue_per_day(week_day)\n festival_start = find_days_start_time(week_day)\n shows_at_venue = Event.where(\"venue_id\" => @venue.id)\n @shows_at_venue_per_day = []\n shows_at_venue.each do |show|\n if show.weekday == week_day\n @shows_at_venue_per_day << show\n end\n end\n if @shows_at_venue_per_day != []\n @shows_at_venue_per_day.sort_by! { |obj| obj.start_date_time}\n shows_with_blanks(festival_start)\n fill_out_final_blanks(festival_start)\n end\n return @shows_with_blanks\n end", "title": "" }, { "docid": "fdec3f3a358a1f2fd8db85f1a937919f", "score": "0.44130027", "text": "def scrape_season\n doc = Nokogiri::HTML(open(url))\n \n seasonality_url = doc.search(\"#survival-guide ul li:nth-child(2) a\").attr(\"href\").text #get country weather url\n weather_pg = Nokogiri::HTML(open(seasonality_url))\n \n #get high, low, and best time to visit information\n @high_season = weather_pg.search(\"div.card--page__content p:nth-child(1)\").text\n @low_season = weather_pg.search(\"div.card--page__content p:nth-child(5)\").first.text\n\n shoulder_season = weather_pg.search(\"div.card--page__content p:nth-child(3)\").first.text\n @best_visit_season = \"Best time to visit \" + shoulder_season[16..-1]\n end", "title": "" }, { "docid": "54b450616c3b11cd91e97dfd84bf5b77", "score": "0.44080412", "text": "def kinds\n (community.settings.reservations.kinds || \"\").split(/\\s*,\\s*/).presence\n end", "title": "" }, { "docid": "4c257e82ce40a3ce0b4610e20a40344f", "score": "0.43976745", "text": "def get_winners\n json = get_json('http://oscars.yipitdata.com/')\n json.results.collect do |films_array|\n find_winner(films_array.films).tap do |winner|\n winner[:year] = films_array.year[0,4]\n end\n end\n end", "title": "" }, { "docid": "693c8e1376ac6dea1bef7196d6948ee7", "score": "0.4395014", "text": "def initialize(n) # The state of a season is just its\n @n = n # index in the NAMES and INSTANCE arrays\n end", "title": "" } ]
5c1d0608a75aa9c43c8718f00941fc61
Given a username, return First and Last names
[ { "docid": "7fdf04ced64d82a8c68977c66df7c618", "score": "0.73456997", "text": "def name_of_user(username)\n username.split('.').map(&:capitalize)\n end", "title": "" } ]
[ { "docid": "62815bbc616a37b0a6fddffb5e8cd463", "score": "0.780366", "text": "def name\n if first_name.present? || last_name.present?\n [first_name, last_name].join(\" \").strip\n else\n username\n end\n end", "title": "" }, { "docid": "a831b5112e6601c81dc6dfe30f08492a", "score": "0.7785672", "text": "def get_first_and_last_name\n if first_name && last_name && !first_name.empty? && !last_name.empty?\n [first_name, last_name]\n elsif description.present?\n [\n description.split(' ')[0],\n description.split(' ')[1]\n ]\n else\n [name[0..4], ''] # Return just the first 5 char from the username, just to increase the chances\n end\n end", "title": "" }, { "docid": "bb6b79037223d0f0426b91606b532cd5", "score": "0.74582213", "text": "def username_and_first_name\n if first_name.nil?\n username\n else\n \"#{username} (#{first_name})\"\n end\n end", "title": "" }, { "docid": "053a53b2f0e07838c24ca81239360400", "score": "0.74176145", "text": "def first_names\n str = ''\n users.each { |u| str << u.first_name << \" \" }\n str.strip.split(\" \").join(', ')\n end", "title": "" }, { "docid": "8cea7eb28a5a28f3d765de5586083a6b", "score": "0.7232585", "text": "def username(fname, lname)\n [fname, lname].join('.').downcase\n end", "title": "" }, { "docid": "184003e572f8853434a69a03b3df7018", "score": "0.7154812", "text": "def name\n result = []\n result << self.first_name\n result << self.last_name\n if result.compact.empty?\n self.user.login if self.user\n else\n result.compact.map {|m| m.to_s.strip}.reject {|i| i.blank?}.join(' ')\n end\n end", "title": "" }, { "docid": "0d201eed40825a46e9c5856ca5d44ee9", "score": "0.71066236", "text": "def simple_username\n return user.firstname + ' ' + user.lastname.first + '.' if !user.nil?\n name\n end", "title": "" }, { "docid": "d21e3d7ad6ba9329238c7974928677ad", "score": "0.703592", "text": "def get_user_name\n if first_name.blank?\n return email.split('@').first.capitalize unless email.blank? \n else\n return first_name.capitalize + \" \" + last_name.capitalize\n end \n return ''\n end", "title": "" }, { "docid": "107d3626bd81e18f7f20011b16863084", "score": "0.69760245", "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": "070d7bcede546704df47b0b988dbdf70", "score": "0.69380975", "text": "def first_last_name\n names = name.split\n names.first + \" \" + names.last\n end", "title": "" }, { "docid": "5bf4e595d95559559156a686eacdc831", "score": "0.69282544", "text": "def full_name(user)\n user.first_name + ' ' + user.last_name\n end", "title": "" }, { "docid": "99931fdf0c335a741d0cd6c3f2a7323c", "score": "0.6913046", "text": "def proper_name # method to get the full name of user\n first_name + \" \" + last_name\n end", "title": "" }, { "docid": "4dec797fd2f00a13b3c473d383452ea9", "score": "0.6907334", "text": "def user_firstname\n return @message[:user][:name].split(' ').first\n end", "title": "" }, { "docid": "e4a94fb20951f1901d3ceab718111309", "score": "0.6867524", "text": "def name\n [((nick_name.nil? || nick_name.length == 0) ? first_name : nick_name), last_name].join(\" \")\n end", "title": "" }, { "docid": "7cbff505eecda762b313e69c9b4f2a0f", "score": "0.686675", "text": "def format_name(first, last)\n\tuser_name = \"\"\n\tif !first.empty? && !last.empty?\n\t \tuser_name = first.strip[0].downcase + last.strip.split.join('')\n\telse\n\t\treturn nil\n\tend\n\tuser_name.downcase\nend", "title": "" }, { "docid": "d08be94f59fde437bc4209dfa271cd90", "score": "0.68433744", "text": "def format_name(first, last)\n if first == \"\" || last == \"\"\n \tnil\n else \n \tfirst.gsub!(/[^A-Za-z]/, '')\n \tlast.gsub!(/[^A-Za-z]/, '')\n \tfirst = first.strip\n\tlast = last.split.join(\"\").strip\n\tuser_name = first[0] + last\n\tuser_name = user_name.downcase \n end\n user_name\nend", "title": "" }, { "docid": "5b18ec22ead2de548f2d6d93aea8f8cc", "score": "0.68150395", "text": "def full_name\n if first_name? && last_name?\n name_words = first_name.split(\" \") + last_name.split(\" \")\n return name_words.map{ |w| w.capitalize }.join(\" \")\n else\n return email\n end\n end", "title": "" }, { "docid": "66cf6ef0bbe34d684175dfeba6c2ba3d", "score": "0.68087435", "text": "def full_name\n \n if (not self.first_name.nil? and not self.first_name.eql? \"\") or (not self.last_name.nil? and not self.last_name.eql? \"\")\n \"#{self.title} #{self.first_name} #{self.last_name}\".strip\n elsif self.username\n self.username \n else\n # wrapped email only prefix\n\n parsed_email = self.email.split('@')\n parsed_email[0]\n end\n end", "title": "" }, { "docid": "8e3e8d14019e31e0efc2cc5647278c4c", "score": "0.6796935", "text": "def full_name\n \"#{first_name} #{middle_name} #{last_name}\".split.join(' ')\n end", "title": "" }, { "docid": "cc65a869b8025da663e1ae79b3431299", "score": "0.6785016", "text": "def format_name(first, last)\n if first == \"\" || last == \"\"\n return nil\n end\n new_first = first.gsub(/\\W+/,\"\")\n new_last = last.gsub(/\\W+/,\"\")\n username = new_first[0] + new_last\n username = username.downcase.gsub(/\\d/,\"\")\n\nend", "title": "" }, { "docid": "b49e7a4f59fec38f7dbb2ecff23bb7cf", "score": "0.67738295", "text": "def full_user_name\n formatedName=first_name[0].upcase+first_name[1,first_name.size].downcase+\" \"+last_name[0].upcase+last_name[1,last_name.size].downcase\n return formatedName.strip if (first_name || last_name)\n return \"Anonymous\"\n end", "title": "" }, { "docid": "4498cc7fec01672d7a12c20275920ed3", "score": "0.6747483", "text": "def last_name_first_name(name)\n last = last_name(name)\n first = name.gsub(last, '').strip \n \"#{last}, #{first}\"\n end", "title": "" }, { "docid": "2c01cd74f97489ef932e600ba49aedfa", "score": "0.6743978", "text": "def fullname\n name = firstname + ' ' + lastname\n name.split.map(&:capitalize).join(' ')\n end", "title": "" }, { "docid": "27b91b1bcc7ec863e5dbcacec928d19d", "score": "0.67360693", "text": "def list_first_and_last_name(first_name, middle_name, last_name)\n puts \"First Name: #{first_name}, Middle Name: #{middle_name}, Last Name: #{last_name}\"\nend", "title": "" }, { "docid": "27b91b1bcc7ec863e5dbcacec928d19d", "score": "0.67360693", "text": "def list_first_and_last_name(first_name, middle_name, last_name)\n puts \"First Name: #{first_name}, Middle Name: #{middle_name}, Last Name: #{last_name}\"\nend", "title": "" }, { "docid": "750135c46b81ce65515bda9f3926bb0d", "score": "0.67350274", "text": "def first_last\r\n firstname + (nickname && (nickname.size > 0) ? \" (#{nickname}) \" : \" \") + lastname\r\n end", "title": "" }, { "docid": "f8a3d1d9a88450d61f45037d1e071d22", "score": "0.67330015", "text": "def name\n [first_name, last_name].join(' ').strip\n end", "title": "" }, { "docid": "68b44dbb8b76c19607f8676b5e61ca98", "score": "0.6731979", "text": "def last_name_first\n if name\n stripped_name = name.strip\n\n leading_dots = if name =~ /^([A-Za-z\\s\\.]*)\\s/\n $1\n end\n\n if leading_dots\n stripped_name = stripped_name.gsub(/#{leading_dots}/, \"\")\n return stripped_name + \", \" + leading_dots\n end\n\n name_parts = stripped_name.split(' ')\n if name_parts.count > 1\n [name_parts[1, name_parts.length].join(' '), name_parts[0]].join(', ')\n else\n name\n end\n else\n \"\" # return empty string instead of nil if no name\n end\n end", "title": "" }, { "docid": "dd10378ffbd648991a6caee2037c7aae", "score": "0.67316794", "text": "def full_name\n [first_name, last_name].join(' ').strip\n end", "title": "" }, { "docid": "6e157202a6bc644f4dd39a42de7828ff", "score": "0.6716269", "text": "def first_name_last_initial\n if name.split.count > 1\n first_name + ' ' + last_name[0].upcase + '.'\n else\n first_name\n end\n end", "title": "" }, { "docid": "fedd0545ab41f0274bc79a4891cc1ec1", "score": "0.67160416", "text": "def names\n nameparts = name.split(' ')\n firstinitial = nameparts.second ? \"#{firstname[0, 1]}.\" : ''\n secondname = nameparts.third ? nameparts.second : ''\n secondinitial = nameparts.third ? \"#{secondname[0, 1]}.\" : ''\n middlenames = nameparts.length > 2 ? nameparts.from(1).to(nameparts.from(1).length - 2) : []\n middleinitials = ''\n middlenames.each_with_index do |name, index|\n middleinitials << ' ' if index.positive?\n middleinitials << \"#{name.to_s[0, 1]}.\"\n end\n lastname = nameparts.last\n names = []\n names << full_name # Joseph Aloysius Hansom\n names << \"#{title} #{name}\" if titled? # Sir Joseph Aloysius Hansom\n names += aka # Boz, Charlie Cheese, and Crackers\n names << \"#{title} #{firstinitial} #{middleinitials} #{lastname}\" if titled? && nameparts.length > 2\n names << \"#{title} #{firstinitial} #{lastname}\" if titled? && nameparts.length > 1\n names << name if name != full_name # Joseph Aloysius Hansom\n if name.include? ',' # George Inn, Barcombe\n names << name.split(/,/).first\n return names\n end\n names << \"#{title} #{name.split(/ of /).first}\" if name.include?(' of ') && titled? # King Charles II [of England]\n names << name.split(/ of /).first if name.include?(' of ') # [King] Charles II [of England]\n names << \"#{firstname} #{middleinitials} #{lastname}\" if nameparts.length > 2 # Joseph A[loysius]. R[obert]. Hansom\n names << \"#{firstinitial} #{middleinitials} #{lastname}\" if nameparts.length > 2 # J. A. R. Hansom\n names << \"#{firstname} #{nameparts.second} #{lastname}\" if nameparts.length > 2 # Joseph Aaron Hansom\n names << \"#{firstname} #{secondinitial} #{lastname}\" if nameparts.length > 2 # Joseph A. Hansom\n names << \"#{firstinitial} #{secondname} #{lastname}\" if nameparts.length > 2 # J. Aaron Hansom\n names << \"#{title} #{firstname} #{lastname}\" if nameparts.length > 2 && titled? # Sir Joseph Hansom\n names << \"#{firstname} #{lastname}\" if nameparts.length > 2 # Joseph Hansom\n names << \"#{firstinitial} #{lastname}\" if nameparts.length > 1 # J. Hansom\n names << \"#{title} #{lastname}\" if titled? # Lord Carlisle\n names << \"#{title} #{firstname}\" if titled? # Sir William\n names << firstname if nameparts.length > 1 # Charles\n names << lastname if nameparts.length > 1 # Kitchener\n names.uniq\n end", "title": "" }, { "docid": "f036ec74b98efff8408c5731cecd760e", "score": "0.6708732", "text": "def full_name_last_first\n return self.first_name unless (self.last_name.length > 0)\n return (self.last_name + \", \" + self.first_name)\n end", "title": "" }, { "docid": "6f22fda035f728570c7cf9276cf24e76", "score": "0.6692306", "text": "def get_full_name\n [first_name, last_name].select(&:present?).join(' ')\n end", "title": "" }, { "docid": "4a9406f4ab2653590f8ce50defe95027", "score": "0.66905475", "text": "def name_swap\n\tuser_name = first_last.split(' ')\n\nend", "title": "" }, { "docid": "4e539368cdf65c14a18e08f6beade600", "score": "0.66630465", "text": "def format_name(first, last)\n if last == '' || first == ''\n word = nil\n else\n user_name = ''\n user_name += first.gsub(' ', '').gsub(/[^0-9A-Za-z]/, '')[0]\n user_name += (last.gsub(' ','').gsub(/[^0-9A-Za-z]/, ''))\n user_name.gsub(/\\d/, '').downcase\n end\nend", "title": "" }, { "docid": "9f0125ecf1190f3e1bd6aad3149628ab", "score": "0.66462284", "text": "def name_lastfirst\n\t\treturn [ self.sn, self.givenName ].compact.join( ', ' )\n\tend", "title": "" }, { "docid": "8320f430ac63ee437a77b796c1d8bb86", "score": "0.6642578", "text": "def name\n [first_name, initial, last_name].select {|x| not x.nil?}.map {|x| x.strip}.join(\" \").titleize\n end", "title": "" }, { "docid": "14d07a60fb5d36ab22a1c4c042eab6e2", "score": "0.66379905", "text": "def user_full_name\n first_name + \" \" + last_name\n end", "title": "" }, { "docid": "ded0aec7195ae44aaf0b9cb5a2a9815d", "score": "0.6636924", "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": "769ae20b901a87c9d57a2a69ebbefc20", "score": "0.663434", "text": "def name\n\t\tn = names\n\t\treturn n[:fullname] if n[:fullname]\n\t\treturn n[:username] if n[:username]\n\t\treturn I18n.translate(\"user.name.unknown\")\n\tend", "title": "" }, { "docid": "4e57da28a71f966afcd4123c3fb51003", "score": "0.6632033", "text": "def determine_name_parts(name)\n @first_name = name[0..name.index(\" \")].strip.downcase\n @last_name = name[name.index(\" \")..name.length].strip.downcase\n end", "title": "" }, { "docid": "794cd1c486624c85ceb3a0874b598b05", "score": "0.6631612", "text": "def full_name\n [first_name, last_name].join(' ')\n end", "title": "" }, { "docid": "794cd1c486624c85ceb3a0874b598b05", "score": "0.6631612", "text": "def full_name\n [first_name, last_name].join(' ')\n end", "title": "" }, { "docid": "794cd1c486624c85ceb3a0874b598b05", "score": "0.6631612", "text": "def full_name\n [first_name, last_name].join(' ')\n end", "title": "" }, { "docid": "794cd1c486624c85ceb3a0874b598b05", "score": "0.6631612", "text": "def full_name\n [first_name, last_name].join(' ')\n end", "title": "" }, { "docid": "794cd1c486624c85ceb3a0874b598b05", "score": "0.6631612", "text": "def full_name\n [first_name, last_name].join(' ')\n end", "title": "" }, { "docid": "275fb30ed133e5f80308377adb8ec625", "score": "0.6626252", "text": "def full_name\n [@first_name, @last_name].join(' ')\n end", "title": "" }, { "docid": "d9d2a10a000bd0a67f30bd3787e6ffab", "score": "0.6619445", "text": "def full_name\n [first_name, last_name].select(&:'present?').join(' ')\n end", "title": "" }, { "docid": "12d894ac97250e31774bf5cdcb6c8452", "score": "0.6617766", "text": "def first_name\r\n @profile[:name].split(/ /).first\r\n end", "title": "" }, { "docid": "2aab4da1dc241801a2f5f13dd4413e0a", "score": "0.66129094", "text": "def full_name_first_last\n return self.first_name unless (self.last_name.length > 0)\n return (self.first_name + \" \" + self.last_name)\n end", "title": "" }, { "docid": "4efe067fe1e31968fa220122635943fb", "score": "0.66127163", "text": "def full_name \n [first_name, last_name].join(' ')\n end", "title": "" }, { "docid": "b98cb6a4d172973218e018a2e000b33c", "score": "0.6608822", "text": "def full_name\n [first_name.to_s, last_name.to_s.upcase].join(' ')\n end", "title": "" }, { "docid": "1b1113e801a4a9dc4b7e76f4ef03190b", "score": "0.66074413", "text": "def full_name\n [first_name, last_name].join(\" \")\n end", "title": "" }, { "docid": "1b1113e801a4a9dc4b7e76f4ef03190b", "score": "0.66074413", "text": "def full_name\n [first_name, last_name].join(\" \")\n end", "title": "" }, { "docid": "1b1113e801a4a9dc4b7e76f4ef03190b", "score": "0.66074413", "text": "def full_name\n [first_name, last_name].join(\" \")\n end", "title": "" }, { "docid": "1b1113e801a4a9dc4b7e76f4ef03190b", "score": "0.66074413", "text": "def full_name\n [first_name, last_name].join(\" \")\n end", "title": "" }, { "docid": "1b1113e801a4a9dc4b7e76f4ef03190b", "score": "0.66074413", "text": "def full_name\n [first_name, last_name].join(\" \")\n end", "title": "" }, { "docid": "1b1113e801a4a9dc4b7e76f4ef03190b", "score": "0.66074413", "text": "def full_name\n [first_name, last_name].join(\" \")\n end", "title": "" }, { "docid": "ed088ec077e688c0cc68e4c63e6e5167", "score": "0.6584684", "text": "def name\n [{\n use: NAME_USE,\n family: [user.last_name],\n given: [user.first_name]\n }]\n end", "title": "" }, { "docid": "ed088ec077e688c0cc68e4c63e6e5167", "score": "0.6584684", "text": "def name\n [{\n use: NAME_USE,\n family: [user.last_name],\n given: [user.first_name]\n }]\n end", "title": "" }, { "docid": "b993c2c505e5b1061b5c748072280f42", "score": "0.65824026", "text": "def first_and_last_name\n \"#{first_name} #{last_name}\"\n end", "title": "" }, { "docid": "f9d30c7e7002755367cb67f0bf8ddcf7", "score": "0.65666145", "text": "def name\n [last_name.upcase, first_name].delete_if { |n| n.blank? }.join(\", \")\n end", "title": "" }, { "docid": "409aa8de6a56dbd7701fa44512005905", "score": "0.65657246", "text": "def full_name\n \"#{firstname} #{lastname}\".strip\n end", "title": "" }, { "docid": "f346b22a77c7108f39c438dbe887ca98", "score": "0.6564011", "text": "def nickname\n (f, l) = full_name.split(\" \", 2)\n \"#{f}#{l.split(/[\\s']/).collect(&:first).join}\"\n end", "title": "" }, { "docid": "76a74a154752f18a1e5f008656db74ea", "score": "0.65633225", "text": "def get_name_surname\n\t\tuser.name + ' ' + user.surname\n\tend", "title": "" }, { "docid": "78995341a31119446adc526a89c6b186", "score": "0.6563249", "text": "def formalise_username(n)\n name = Nameable::Latin.new.parse(n)\n if !name.last.nil?\n if name.gender == :female\n 'Ms ' + name.last\n else\n 'Mr ' + name.last\n end\n else\n name.first\n end\n end", "title": "" }, { "docid": "f1731b3d1ff3dff1f350b6522c7325f9", "score": "0.65556914", "text": "def full_name\n [first_name, last_name].join(' ')\n end", "title": "" }, { "docid": "5f663f98ec4d28f3a95a448b4dd1dc5f", "score": "0.65539277", "text": "def first_name(full_name)\n full_name.partition(', ').last\n end", "title": "" }, { "docid": "6947c02317852fec2a8fd12137be5ad4", "score": "0.6540683", "text": "def names(first_name, last_name)\n\t\"#{last_name.upcase}, #{first_name.capitalize}\"\nend", "title": "" }, { "docid": "ae0f228eb142c389c6218ab73f76ed64", "score": "0.6528599", "text": "def extract_names(profile)\n full_name_kanji = profile[:full_name_kanji] || ''\n last_name_kanji = profile[:last_name_kanji] || ''\n first_name_kanji = profile[:first_name_kanji] || ''\n\n full_name_kana = profile[:full_name_kana] || ''\n last_name_kana = profile[:last_name_kana] || ''\n first_name_kana = profile[:first_name_kana] || ''\n\n full_name = profile[:full_name] || ''\n last_name = profile[:last_name] || ''\n first_name = profile[:first_name] || ''\n user_name = profile[:user_name] || ''\n\n # NOTE: \"\".present? #=> false\n\n # *: set\n # -: not set\n # : no care\n # full(K) | last(K) | first(K) | full | last | first | user |\n # #1 ******* | ******* | ******** | | | | |\n # #1 ******* | ******* | -------- | | | | |\n # #1 ******* | ------- | ******** | | | | |\n # #1' | | | **** | **** | ***** | |\n # #1' | | | **** | **** | ----- | |\n # #1' | | | **** | ---- | ***** | |\n # #2 ------- | ******* | ******** | | | | |\n # #2 ------- | ******* | -------- | | | | |\n # #2 ------- | ------- | ******** | | | | |\n # #2' | | | ---- | **** | ***** | |\n # #2' | | | ---- | **** | ----- | |\n # #2' | | | ---- | ---- | ***** | |\n # #3 ******* | ------- | -------- | | | | |\n # #3' | | | **** | ---- | ----- | |\n # #4 ------- | ------- | -------- | ---- | ---- | ----- | **** |\n # #5 ------- | ------- | -------- | ---- | ---- | ----- | ---- |\n\n # #1\n if full_name_kanji.present? && (last_name_kanji.present? || first_name_kanji.present?)\n names = [ full_name_kanji, first_name_kanji, last_name_kanji ]\n # #1'\n elsif full_name.present? && (last_name.present? || first_name.present?)\n names = [ full_name, first_name, last_name ]\n # #2\n elsif last_name_kanji.present? || first_name_kanji.present?\n names = [ [last_name_kanji, first_name_kanji].join(' ').strip, first_name_kanji, last_name_kanji ]\n # #2'\n elsif last_name.present? || first_name.present?\n names = [ [last_name, first_name].join(' ').strip, first_name, last_name ]\n # #3\n elsif full_name_kanji.present?\n names = [ full_name_kanji, '', full_name_kanji ]\n # #3'\n elsif full_name.present?\n names = [ full_name, '', full_name ]\n # #4\n elsif user_name.present?\n names = [ user_name, '', '' ]\n # #5\n else\n names = [ '', '', '' ]\n end\n\n if full_name_kana.present? && (last_name_kana.present? || first_name_kana.present?)\n kana = [ full_name_kana, first_name_kana, last_name_kana ]\n elsif last_name_kana.present? || first_name_kana.present?\n kana = [ [last_name_kana, first_name_kana].join(' ').strip, first_name_kana, last_name_kana ]\n elsif full_name_kana.present?\n kana = [ full_name_kana, '', full_name_kana ]\n else\n kana = [ '', '', '' ]\n end\n\n names + kana\n end", "title": "" }, { "docid": "572df409c9a85175dcb3ad5cd1c6e5cb", "score": "0.65249157", "text": "def full_name\n \"#{username}/#{name}\"\n end", "title": "" }, { "docid": "b4d8bb37d34f5933096af891407100c1", "score": "0.6519751", "text": "def format_name(first, last)\n return nil if first.empty? || last.empty?\n f = first.delete(\" \")\n l = last.delete(\" \")\n username = f[0]\n username << l\n user = username.downcase\n user.gsub(/[\\W]/, '') # this is meant to remove special characters, but it doesn't work!\nend", "title": "" }, { "docid": "bd7d1c31d04424458c2582e8d998e8c9", "score": "0.65183204", "text": "def full_name\n if (first_name && last_name) && (!first_name.blank? && !last_name.blank?)\n \" #{first_name} #{last_name}\"\n else\n \" #{nickname}\"\n end\n end", "title": "" }, { "docid": "897fcf2dc26dc1018cb210b538357e20", "score": "0.65159315", "text": "def full_name\n \t([first_name, last_name].compact-['']).join(' ')\n end", "title": "" }, { "docid": "0e7a6536ee8c3e6b9b9de277b396a8ad", "score": "0.6493654", "text": "def first_name_and_last_name\n \"#{first_name}-#{last_name}\"\n end", "title": "" }, { "docid": "0c64b815fbd2608a36e945711346b0e8", "score": "0.64867955", "text": "def usernames\n Message::Statement.display_usernames(raw_data.keys)\n end", "title": "" }, { "docid": "57585129d482c553be432183c4023753", "score": "0.64850795", "text": "def name\n [first_name, last_name].join(' ')\n end", "title": "" }, { "docid": "57585129d482c553be432183c4023753", "score": "0.64850795", "text": "def name\n [first_name, last_name].join(' ')\n end", "title": "" }, { "docid": "57585129d482c553be432183c4023753", "score": "0.64850795", "text": "def name\n [first_name, last_name].join(' ')\n end", "title": "" }, { "docid": "395d1a5257bfc68d3fc65646880291f6", "score": "0.6478072", "text": "def proper_name #returns lastname, firstname\n \treturn self.last_name + ', ' + self.first\n end", "title": "" }, { "docid": "0e7f997f3b36ec7dd7c0d2e6ef34175e", "score": "0.6472354", "text": "def full_name\n [forename, surname].join(' ')\n end", "title": "" }, { "docid": "baf6d5c367c5af79fff0393564f8a6d9", "score": "0.6471323", "text": "def full_name\n new_name = first_name.capitalize + \" \" + last_name.capitalize\n final_name = new_name.split(' ').each(&:capitalize!).join(' ')\n end", "title": "" }, { "docid": "e721494723e4739e9accf8af3ac4d5f2", "score": "0.64654815", "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": "e4892529fb43577615e6907861528903", "score": "0.6463535", "text": "def full_name\n \"#{first_name} #{last_name}\".strip\n end", "title": "" }, { "docid": "e4892529fb43577615e6907861528903", "score": "0.6463535", "text": "def full_name\n \"#{first_name} #{last_name}\".strip\n end", "title": "" }, { "docid": "e4892529fb43577615e6907861528903", "score": "0.6463535", "text": "def full_name\n \"#{first_name} #{last_name}\".strip\n end", "title": "" }, { "docid": "e4892529fb43577615e6907861528903", "score": "0.6463535", "text": "def full_name\n \"#{first_name} #{last_name}\".strip\n end", "title": "" }, { "docid": "45fd12eeff9329722311c248366773ad", "score": "0.6457321", "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": "d3baa5a4271acf4f6c250657472d75cc", "score": "0.64551854", "text": "def full_name\n \treturn \"#{first_name} #{last_name}\".strip if(first_name || last_name) \n \t\"Anonymous\"\n end", "title": "" }, { "docid": "6977b07f8e09e49d0a82a6b67c1eddb6", "score": "0.6451347", "text": "def full_name\n [self.first_name, self.last_name].compact.join(\" \").strip\n end", "title": "" }, { "docid": "ba2d60cb24387d081a7b4d6701b19328", "score": "0.64494354", "text": "def whole_name\n [given_name, family_name].compact.join(' ')\n end", "title": "" }, { "docid": "8b879a3599307415dcc4634063ca488d", "score": "0.6444056", "text": "def full_name\n \tif self.first_name != nil and self.last_name != nil\n \t\tself.first_name + \" \" + self.last_name\n \telse\n \t\t\"User does not have a full name\"\n \tend\n end", "title": "" }, { "docid": "ed61c5176ab8a520f17fc7044615c1b2", "score": "0.6434243", "text": "def full_name\n \"#{first_name.strip} #{last_name.strip}\"\n end", "title": "" }, { "docid": "d878f3322883e0bf7aef2a4c58e5959d", "score": "0.64339817", "text": "def full_name\n \t[self.first_name, self.last_name].join(\" \")\n end", "title": "" }, { "docid": "43affd166317be058e3ae8889c7aebd8", "score": "0.64319247", "text": "def first_name_last_name\n \"#{first_name} #{last_name}\"\n end", "title": "" }, { "docid": "e2f313c4d847780ce12e5d49f74e5f09", "score": "0.6427749", "text": "def full_name\n\t\tself.user_fname.capitalize + \" \" + self.user_lname.capitalize\n\tend", "title": "" }, { "docid": "e12ba27718e5b4f5f1ab2e247d6a935a", "score": "0.6427342", "text": "def initials\n self.first_name[0].to_s + self.last_name[0].to_s\n end", "title": "" }, { "docid": "e12ba27718e5b4f5f1ab2e247d6a935a", "score": "0.6427342", "text": "def initials\n self.first_name[0].to_s + self.last_name[0].to_s\n end", "title": "" }, { "docid": "4b19d10165319e9bd68ad9223c198fc4", "score": "0.6422531", "text": "def full_name\n if first_name.blank?\n last_name\n else\n [last_name, first_name].compact.join(', ')\n end\n end", "title": "" }, { "docid": "5150492d1291fe89484fdc88388ed7f5", "score": "0.6419281", "text": "def full_name\n name = `finger $USER 2> /dev/null | grep Login | colrm 1 46`.chomp\n name.present? ? name.squish : \"John Doe\"\n end", "title": "" } ]
2365c090fadd32e80e61311bfec1e141
end modify_or_create_user modify or create eleve
[ { "docid": "18b36b29d9ae8f95140cb9c530d1c72b", "score": "0.6290354", "text": "def modify_or_create_eleves(data) \n # Example data: \n #COMPTE profil eleve: \n #{\"profil\"=>\"ELEVE\", \"id_sconet\"=>\"1035780\", \"id_jointure_aaf\"=>\"2414273\", \n # \"nom\"=>\"AISSOU\", \"prenom\"=>\"Yanis\", \"date_naissance\"=>\"15/08/2001\", \"sexe\"=>\"M\", \"date_last_maj_aaf\"=>\"2013-02-28\"}\n # we must capture errors in order to treat all eleves\n @logger.debug(\"modify or create eleve is called\")\n etablissement_id = Etablissement[:code_uai => @uai].id\n profil_id = 'ELV'\n DB.transaction do\n data.each do |eleve| \n begin \n record = User[:id_jointure_aaf => eleve[\"id_jointure_aaf\"]]\n # search Users for corresponding records\n if record.nil? \n @logger.debug(\"create eleve with id_jointure: #{eleve['id_jointure_aaf']}\")\n # find a suitable login for the user\n login = User.find_available_login(eleve[\"prenom\"],eleve[\"nom\"])\n #login = eleve[\"nom\"]+eleve[\"prenom\"]+eleve[\"id_jointure_aaf\"]\n # insert the hash into user table\n # TODO: generate default password algorithm instead of this\n password = eleve['id_jointure_aaf']\n user = User.create(:id_sconet => eleve[\"id_sconet\"], :login => login, \n :id_jointure_aaf => eleve[\"id_jointure_aaf\"], :nom => eleve[\"nom\"], :prenom => eleve[\"prenom\"],\n :date_naissance => eleve[\"date_naissance\"],:sexe => eleve[\"sexe\"], :date_creation => eleve[\"date_last_maj_aaf\"],\n :password => password)\n \n # add profil eleve to user\n user.add_profil(etablissement_id, profil_id)\n \n # add emails \n # add telephones\n else \n @logger.debug(\"update eleve with id_jointure: #{eleve['id_jointure_aaf']}\")\n # update where id_jointure_aaf = eleve[\"id_jointure_aaf\"] with new hash\n record[:id_sconet] = eleve[\"id_sconet\"]\n record[:nom] = eleve[\"nom\"] \n record[:prenom] = eleve[\"prenom\"]\n record[:date_naissance] = eleve[\"date_naissance\"]\n record[:sexe] = eleve[\"sexe\"]\n\n record.save\n\n # add profil to user if not added\n record.add_profil(etablissement_id, profil_id)\n end\n rescue => e \n @logger.error(e.message)\n @errorstack.push(e.message)\n end \n end # end each\n end \n @logger.info(\"treated eleves #{data.count} records\")\n end", "title": "" } ]
[ { "docid": "4e0366a145d2b58d03b031e4970734e0", "score": "0.71457106", "text": "def create_or_update_local_user provider, user_data\n raise 'not implemented'\n end", "title": "" }, { "docid": "a8360d1d265c8da627d1318bf318a549", "score": "0.6880748", "text": "def create_or_update_user(user)\n if user.exists?\n update_user(user.existing_user, user.as_params)\n else\n User.new(user.as_params)\n end\n rescue ActiveRecord::RecordInvalid => invalid\n errors << { type: \"User unable to be saved #{ invalid }\", rows: node.row }\n end", "title": "" }, { "docid": "5c2af1fc006ec9ad50550f1fe3485e6e", "score": "0.675525", "text": "def edit_or_create_user(struct)\n struct.remapkeys!\n if struct.has_key? :user and struct.has_key? :pass\n rt = RT_Client.new(:user => struct[:user], :pass => struct[:pass])\n struct.delete(:user)\n struct.delete(:pass)\n else\n rt = RT_Client.new\n end\n val = rt.edit_or_create_user(struct)\n rt = nil\n val\n end", "title": "" }, { "docid": "bd79044a58493c8bfafbdec7f4184729", "score": "0.66873264", "text": "def create_new_user\n if @email_changed && !self.email.blank?\n @email_changed = false\n can_access = false\n self.matter_peoples.collect do |mp|\n can_access = true \n end\n if can_access\n can_access = false\n new_user = {:username => self.email, :email => self.email, :first_name => self.first_name, :last_name => self.last_name, :company_id => self.company_id, :sign_in_count=> 0}\n old_user = User.find(self.user_id) if self.user_id\n if old_user\n old_user.update_attributes(new_user)\n User.generate_and_mail_new_password_from_matter(old_user.username,old_user.email,User.current_lawyer,true)\n return \n else\n user = User.new(new_user)\n end\n if user.send(:create_without_callbacks)\n role = Role.find_by_name('client')\n UserRole.find_or_create_by_user_id_and_role_id(user.id,role.id)\n User.generate_and_mail_new_password_from_matter(user.username,user.email,User.current_lawyer)\n self.user_id = user.id\n self.send(:update_without_callbacks)\n end\n end \n end\n end", "title": "" }, { "docid": "3a694d76ec524a14468adb240ab1eadf", "score": "0.6633041", "text": "def change_existing_user\n mem = @data.mem\n creator = mem.creator\n email = creator.contact.con_email\n need_email = email && !email.empty?\n\n @session.push(self.class, :continue_to_renew)\n @session.dispatch(Login,\n :handle_update_details_for_third_party, \n [ creator, need_email ])\n end", "title": "" }, { "docid": "20ad36a8212d4fc2ec44bd449410b4ac", "score": "0.6510515", "text": "def create_user(email, pw)\n # user = User.find_or_create_by(email: email) do |user|\n user = User.find_or_create_by(Hydra.config.user_key_field => email) do |u|\n u.email = email\n u.password = pw\n u.password_confirmation = pw\n end\n user\nend", "title": "" }, { "docid": "6346e74254f4cc2fdce6ff218562633f", "score": "0.63945776", "text": "def update_user\n u = User.find_by_name self.code\n if !u\n User.create :name=>self.code,:email=>self.e_mail,\n :password=>'123456',:password_confirmation=>'123456'\n else\n u.update_attribute :email,self.e_mail\n end\n end", "title": "" }, { "docid": "6cda811287df35c0565772b179657ae1", "score": "0.63773483", "text": "def user\n super || create_user\n end", "title": "" }, { "docid": "517adb3242b56601b6073ea397fb7a76", "score": "0.63730294", "text": "def can_modify_user?(user_id)\n false \n end", "title": "" }, { "docid": "ea88e887b34cff01979fddbfaa9223c2", "score": "0.63622177", "text": "def make_owner!( user )\n begin\n self.accepts_role :owner, user\n self.accepts_role :read, user\n self.accepts_role :execute, user\n self.accepts_role :write, user\n return self.save!\n rescue\n end# rescue mission\n end", "title": "" }, { "docid": "1a03f658027492e77302e2a07b0fa102", "score": "0.6342329", "text": "def save_or_update\n return false unless valid?\n\n call_ok?(:maintain_user, save_element_list)\n end", "title": "" }, { "docid": "76e750e8360b730e8c54bfca0bbda7d9", "score": "0.63323116", "text": "def developer\n find_or_create_user(\"developer\")\n end", "title": "" }, { "docid": "1cc73f80b5e7223c0981bec93b023107", "score": "0.632507", "text": "def set_user\n if @user\n \t\t edit()\n end\n \tend", "title": "" }, { "docid": "ea8a717613a8a40d2ff8ba139a978402", "score": "0.6280648", "text": "def create(user_info)\n # TODO Enter workflow to create a new user in the OLE system.\n save_user(user_info) if user_info[:save?]\n end", "title": "" }, { "docid": "219cb1573fc012e275a27191f0577d21", "score": "0.6277042", "text": "def createUser(user)\n user.role = user.role == \"Admin\" ? 0 : 1\n isSaveUser = UserRepository.createUser(user)\n end", "title": "" }, { "docid": "8fb49c277a74ffaaa3ad4715fa645ffa", "score": "0.62688404", "text": "def user=(new_user); end", "title": "" }, { "docid": "8fb49c277a74ffaaa3ad4715fa645ffa", "score": "0.62688404", "text": "def user=(new_user); end", "title": "" }, { "docid": "639629eea8f09aca3236dd4dcc122b7e", "score": "0.62425023", "text": "def create_web_user(role, login)\n \n begin\n\t transaction do\n\t \t\n\t \traise if !self.save\n\t\tlogin.person = self\n\t\traise if !login.save\n\t\tlogin.member_types << MemberType.find(MemberType.memberTypeToId('Guest').id)\n\t\traise if !self.update_attribute('updated_by', login.login_id)\n\t\trole.person = self\n\t\trole.updated_by = self.updated_by\n\t raise if !role.create_self(login)\n\t\t\t\n\t end\n\t \n rescue\n\t return false\n end\n true\n\t\n end", "title": "" }, { "docid": "c865ad5a3df4e747291eeffb7f0f304b", "score": "0.6240774", "text": "def patch_create\n redirect_to root_url if current_user.user_type != 1\n params[:patch].split.each_slice(3).each do |data|\n begin\n user_params = { user_id: data[0], password: data[1], user_type: @@user_type_map[data[2]] }\n user = User.new(user_params)\n if user.user_type == 0 || user.user_type == 1 # admin or CEO\n user.save\n else\n User.create(user)\n end\n rescue\n end\n end\n redirect_to users_path, notice: 'Patch create compelete.'\n end", "title": "" }, { "docid": "e4cfefc03ae7367fca7076c00992060f", "score": "0.62242156", "text": "def user_verification_create_or_update\n case login_type\n when SAML::User::MHV_MAPPED_CSID\n find_or_create_user_verification(:mhv_uuid, current_user.mhv_correlation_id)\n when SAML::User::IDME_CSID\n find_or_create_user_verification(:idme_uuid, current_user.idme_uuid)\n when SAML::User::DSLOGON_CSID\n find_or_create_user_verification(:dslogon_uuid, current_user.identity.edipi)\n when SAML::User::LOGINGOV_CSID\n find_or_create_user_verification(:logingov_uuid, current_user.logingov_uuid)\n else\n Rails.logger.info(\n \"[AfterLoginActions] Unknown or missing login_type for user=#{current_user.uuid}, login_type=#{login_type}\"\n )\n\n raise Login::Errors::UnknownLoginTypeError\n end\n rescue => e\n Rails.logger.info(\"[AfterLoginActions] UserVerification cannot be created or updated, error=#{e.message}\")\n end", "title": "" }, { "docid": "f9fc926ea919e1be6fcb80f9f29f28f8", "score": "0.62230206", "text": "def before_create_save(record)\n record.updated_by = current_user\n end", "title": "" }, { "docid": "60bbf903058d4e07f712308eaec528a0", "score": "0.6212896", "text": "def create_user(email, name, pw)\n user = User.find_or_create_by(username: name) do |u|\n u.email = email\n u.username = name\n u.password = pw\n u.password_confirmation = pw\n end\n user\nend", "title": "" }, { "docid": "ab6ce91fda62b63a424872bcf51f36fb", "score": "0.6205672", "text": "def before_create_save(record)\n record.user = current_user\n end", "title": "" }, { "docid": "a0325cf55dbe2c40c25f7cb8aa279c45", "score": "0.6204303", "text": "def make_admin(user)\n user.admin = true\n user.role_name = 'super_user'\n user.save!\n end", "title": "" }, { "docid": "02aacf60b6c3ef0c53f45c89659e2940", "score": "0.61955136", "text": "def update_u_record\r\n if u = users.first\r\n if u.role != 'admin'||'superuser'\r\n u.update_attribute(:first_name, self.first_name)\r\n u.update_attribute(:last_name, self.last_name)\r\n u.update_attribute(:email, self.email)\r\n end\r\n end\r\n end", "title": "" }, { "docid": "96a75f37098f9b5db8b7c451f485268e", "score": "0.61954063", "text": "def check_new_or_reseted_user\n begin\n user = User.find(current_user.id)\n if user.first_access == true\n user.update(password: user.id_func)\n end\n rescue => ex\n puts ex.message\n end\n end", "title": "" }, { "docid": "ddb96e393c10e96068dac543c30ec1b0", "score": "0.61910737", "text": "def user\n @user ||= find_or_create_user\n end", "title": "" }, { "docid": "1d67c1a32554df04c28174e219218f3b", "score": "0.61724323", "text": "def new_user\n save_user data\n update_users\n end", "title": "" }, { "docid": "5e936ac01a0460723bfadf1027e1df1a", "score": "0.616991", "text": "def modify_user\n begin\n@user = User.find(params[:id])\n if(@user)\n if(params[:name]) \n @user.username = params[:name]\n end\n if(params[:displayname])\n @user.displayname = params[:displayname]\n end\n if(params[:headendID])\n @user.headendID = params[:headendID]\n end\n if @user.save\n render_xml_output(\"Success\")\n else\n render_xml_output(\"Failure\")\n end\n end\n rescue ActiveRecord::RecordNotFound\n render_xml_output(\"No record found\")\n end\nend", "title": "" }, { "docid": "bf1de442e7c087e6867f3087a55c82dc", "score": "0.61671525", "text": "def mount_user\n if user_id == -1\n secret_temp_password = UUIDTools::UUID.timestamp_create().to_s\n \n new_user = User.where(account_id: account_id, email: email)\n .first_or_create(account_id: account_id, \n name: get_name, \n email: email, \n role: 'Customer',\n password: secret_temp_password,\n password_confirmation: secret_temp_password, \n activated: false)\n self.user_id = new_user.id\n self.save!\n\n \n end\n end", "title": "" }, { "docid": "9fabab0fd3c51c203e74b9b73db1d605", "score": "0.6155087", "text": "def create?\n user.admin? || user.is_valid?\n end", "title": "" }, { "docid": "9fabab0fd3c51c203e74b9b73db1d605", "score": "0.6155087", "text": "def create?\n user.admin? || user.is_valid?\n end", "title": "" }, { "docid": "5c124a2b7087d740461200921bfdb902", "score": "0.61456597", "text": "def modifyUser\n\n user = User.find_by_username(params[:username])\n \n if user == nil\n render :text => \"Couldn't find user\", :status => 404\n return\n end\n \n begin \n # If adding new email address\n if params[:add_email] \n ### Make some checkings. If not passed, will return error -> user can edit the fields and try again.\n if params[:add_email].strip == \"\"\n render :text => \"Mail address needed\", :status => 409\n return\n end\n \n if params[:mail_port] && params[:mail_port].strip != \"\" && (not params[:mail_port].strip =~/^[0-9]+$/ )\n render :text => \"Problem with port number\", :status => 409\n return\n end\n \n \n # Make sure user doesn't already have that mail address added\n test = UserEmail.find_by_user_id_and_email(user.id, params[:add_email].strip)\n if test != nil\n render :text => \"Mail address already exists\", :status => 409\n return\n end\n \n ### end checkings\n \n \n added = UserEmail.find_or_create_by_user_id_and_email(:user_id => user.id, \n :email => params[:add_email].strip,\n :mail_checking => \"false\")\n \n if added != nil\n puts \"Added new email: #{params[:add_email]} to user: #{user.username}\"\n \n if params[:mail_username] && params[:mail_username].strip != \"\" &&\n params[:mail_password] && params[:mail_password].strip != \"\" &&\n params[:mail_server] && params[:mail_server].strip != \"\" &&\n params[:mail_port] && params[:mail_port].strip != \"\" && params[:mail_port].strip =~/^[0-9]+$/ &&\n params[:mail_tls_encryption] && params[:mail_tls_encryption] != \"\" &&\n params[:to_device] && params[:to_device] != \"\"\n \n # Save the mail account info\n added.update_attribute(:mail_username, params[:mail_username].strip )\n added.update_attribute(:mail_password, params[:mail_password].strip )\n added.update_attribute(:mail_server, params[:mail_server].strip )\n added.update_attribute(:mail_port, params[:mail_port].strip )\n added.update_attribute(:mail_checking, \"false\" )\n\n if params[:mail_tls_encryption] == \"true\" || params[:mail_tls_encryption] == \"false\"\n added.update_attribute(:mail_tls_encryption, params[:mail_tls_encryption])\n end\n \n device_id = Device.find_by_user_id_and_dev_type_and_dev_name(user.id, \"virtual_container\", params[:to_device])\n if device_id != nil\n added.update_attribute(:device_id, device_id.id)\n end\n \n if params[:mail_checking] && params[:mail_checking].strip.downcase == \"true\"\n # Add persistent checking to a mail account\n # Will fetch attachments from new mails and mark the mail as unread\n added.update_attribute(:mail_checking, \"true\" )\n \n \n end\n end\n end \n \n end\n rescue Exception => e\n puts \"SERVER PROBLEM WHEN ADDING NEW MAIL ADDRESS\" \n end\n\n \n # If removing existing email address\n if params[:remove_email] && params[:remove_email].strip != \"\"\n remove = UserEmail.find_by_user_id_and_email(user.id, params[:remove_email])\n \n puts \"Remove email address\"\n if remove != nil\n UserEmail.delete(remove.id)\n end\n end\n \n # If changing email persistent checking for email account\n if params[:change_email_persistent] && params[:change_email_persistent].strip != \"\"\n change = UserEmail.find_by_user_id_and_email(user.id, params[:change_email_persistent])\n \n puts \"Change persistent checking for address: #{params[:change_email_persistent]}\"\n if change != nil\n if change.mail_checking == true\n change.update_attribute(:mail_checking, false)\n else\n change.update_attribute(:mail_checking, true)\n end\n end\n end\n \n # If adding thumbnail to user\n if params[:thumbnail_data]\n thumbnail_name = \"#{user.username}.png\"\n thumbnail_path = \"public/thumbnails/user_thumbnails/\"\n puts \"Thumbnail created!\" if createIcon(params[:thumbnail_data].read, thumbnail_name, thumbnail_path)\n end\n \n render :text => \"Success modifying your account\", :status => 200\n return\n end", "title": "" }, { "docid": "5c124a2b7087d740461200921bfdb902", "score": "0.61456597", "text": "def modifyUser\n\n user = User.find_by_username(params[:username])\n \n if user == nil\n render :text => \"Couldn't find user\", :status => 404\n return\n end\n \n begin \n # If adding new email address\n if params[:add_email] \n ### Make some checkings. If not passed, will return error -> user can edit the fields and try again.\n if params[:add_email].strip == \"\"\n render :text => \"Mail address needed\", :status => 409\n return\n end\n \n if params[:mail_port] && params[:mail_port].strip != \"\" && (not params[:mail_port].strip =~/^[0-9]+$/ )\n render :text => \"Problem with port number\", :status => 409\n return\n end\n \n \n # Make sure user doesn't already have that mail address added\n test = UserEmail.find_by_user_id_and_email(user.id, params[:add_email].strip)\n if test != nil\n render :text => \"Mail address already exists\", :status => 409\n return\n end\n \n ### end checkings\n \n \n added = UserEmail.find_or_create_by_user_id_and_email(:user_id => user.id, \n :email => params[:add_email].strip,\n :mail_checking => \"false\")\n \n if added != nil\n puts \"Added new email: #{params[:add_email]} to user: #{user.username}\"\n \n if params[:mail_username] && params[:mail_username].strip != \"\" &&\n params[:mail_password] && params[:mail_password].strip != \"\" &&\n params[:mail_server] && params[:mail_server].strip != \"\" &&\n params[:mail_port] && params[:mail_port].strip != \"\" && params[:mail_port].strip =~/^[0-9]+$/ &&\n params[:mail_tls_encryption] && params[:mail_tls_encryption] != \"\" &&\n params[:to_device] && params[:to_device] != \"\"\n \n # Save the mail account info\n added.update_attribute(:mail_username, params[:mail_username].strip )\n added.update_attribute(:mail_password, params[:mail_password].strip )\n added.update_attribute(:mail_server, params[:mail_server].strip )\n added.update_attribute(:mail_port, params[:mail_port].strip )\n added.update_attribute(:mail_checking, \"false\" )\n\n if params[:mail_tls_encryption] == \"true\" || params[:mail_tls_encryption] == \"false\"\n added.update_attribute(:mail_tls_encryption, params[:mail_tls_encryption])\n end\n \n device_id = Device.find_by_user_id_and_dev_type_and_dev_name(user.id, \"virtual_container\", params[:to_device])\n if device_id != nil\n added.update_attribute(:device_id, device_id.id)\n end\n \n if params[:mail_checking] && params[:mail_checking].strip.downcase == \"true\"\n # Add persistent checking to a mail account\n # Will fetch attachments from new mails and mark the mail as unread\n added.update_attribute(:mail_checking, \"true\" )\n \n \n end\n end\n end \n \n end\n rescue Exception => e\n puts \"SERVER PROBLEM WHEN ADDING NEW MAIL ADDRESS\" \n end\n\n \n # If removing existing email address\n if params[:remove_email] && params[:remove_email].strip != \"\"\n remove = UserEmail.find_by_user_id_and_email(user.id, params[:remove_email])\n \n puts \"Remove email address\"\n if remove != nil\n UserEmail.delete(remove.id)\n end\n end\n \n # If changing email persistent checking for email account\n if params[:change_email_persistent] && params[:change_email_persistent].strip != \"\"\n change = UserEmail.find_by_user_id_and_email(user.id, params[:change_email_persistent])\n \n puts \"Change persistent checking for address: #{params[:change_email_persistent]}\"\n if change != nil\n if change.mail_checking == true\n change.update_attribute(:mail_checking, false)\n else\n change.update_attribute(:mail_checking, true)\n end\n end\n end\n \n # If adding thumbnail to user\n if params[:thumbnail_data]\n thumbnail_name = \"#{user.username}.png\"\n thumbnail_path = \"public/thumbnails/user_thumbnails/\"\n puts \"Thumbnail created!\" if createIcon(params[:thumbnail_data].read, thumbnail_name, thumbnail_path)\n end\n \n render :text => \"Success modifying your account\", :status => 200\n return\n end", "title": "" }, { "docid": "6fb71a86c2de69160f8b7e89e4d2e8e7", "score": "0.61397773", "text": "def set_or_create_user_for_import(user_data)\n # set the user and attempt to save with given data\n user = if @overwrite &&\n !User.where('username = ?', user_data[:username]).empty?\n User.where('username = ?', user_data[:username]).first\n else\n User.new(user_data)\n end\n user\n end", "title": "" }, { "docid": "a976988a37e999d6d223ada5e5766bea", "score": "0.61340344", "text": "def find_or_create_user(user_params)\n user = User.find_or_create_by!(user_params.slice(:id, :name, :region))\n Action.create!(tool_user: current_user, action: 'create', reference: user) if user.new_record?\n\n user\n end", "title": "" }, { "docid": "55e67bc714fa5dbe8176b3056d8a597d", "score": "0.61131966", "text": "def create?\n user.admin? || user.owner?\n end", "title": "" }, { "docid": "14eef5ae99094587746b5961f7696773", "score": "0.61110276", "text": "def update?\n user.admin? || created_by_owner? \n end", "title": "" }, { "docid": "0cfcf82c96aeec5527fd5e1efbe30de5", "score": "0.6108987", "text": "def add_or_edit\n create_or_update(:add, :edit)\n end", "title": "" }, { "docid": "140a322a88ce63b5b46de439c353e338", "score": "0.60995466", "text": "def set_or_create_user_from_email\n self.user_id and return true\n\n # without email noting interesting here\n if self.email.blank?\n self.errors.add(:email, 'Please enter email address') \n elsif _user = User.where(email: self.email).first \n self.user_id = _user.id \n validate_if_has_already_same_role\n else\n self.name.blank? and self.errors.add(:name, \"Please enter the name of the user.\") \n self.surname.blank? and self.errors.add(:surname, \"Please enter the surname of the user.\")\n self.affiliation.blank? and self.errors.add(:affiliation, \"Please enter the affiliation of the user.\")\n if self.errors.empty?\n _user = User.new(email: self.email, \n password: Devise.friendly_token.first(16), # FIXME \n name: self.name, \n surname: self.surname, \n affiliation: self.affiliation,\n address: self.address) # confirmed_at: Time.now)\n # create by other user, not by anonymous \n _user.skip_confirmation!\n if _user.save\n self.user_id = _user.id \n else\n Rails.logger.info(\"set_or_create_user_from_email errors: #{_user.errors.inspect}\")\n end\n end\n end\n end", "title": "" }, { "docid": "20c92b58c65950ab14aa49891f8817a0", "score": "0.6082506", "text": "def create_or_update(record)\n username = record[:username]\n existing_record = project_admin.redcap_project_users.active.where(username: username).first\n\n if existing_record\n # Check if there is an exact match for the record. If so, we are done\n if record_matches_retrieved(existing_record, record)\n unchanged_usernames << username\n return false\n end\n\n existing_record.current_admin = current_admin\n if existing_record.update(record.slice(*all_expected_field_names))\n updated_usernames << username\n upserted_records << existing_record\n username\n else\n errors << { username: username, errors: existing_record.errors, action: :update }\n end\n else\n new_record = ProjectUser.new(record.slice(*all_expected_field_names))\n new_record.redcap_project_admin_id = project_admin.id\n new_record.current_admin = current_admin\n if new_record.save\n created_usernames << username\n upserted_records << new_record\n return username\n else\n errors << { id: username, errors: new_record.errors, action: :create }\n end\n end\n\n nil\n end", "title": "" }, { "docid": "292c48e0d148059497764d41ec32bddb", "score": "0.60789216", "text": "def modifying_user?; user_params[:rights] == \"user\"; end", "title": "" }, { "docid": "656cd3aff9c324f95e9ee88f7ad8e9e1", "score": "0.60785913", "text": "def edit\n set_existing_user\n super\n end", "title": "" }, { "docid": "8ead2ae2571f74c48a83ebda0d6293d8", "score": "0.6076791", "text": "def post_user_data\n if params[:oper] == \"del\"\n User.find(params[:id]).destroy\n else\n user_params = { :login => params[:login], \n :first_name => params[:first_name], \n :last_name => params[:last_name], \n :email => params[:email],\n :password => params[:password],\n :password_confirmation => params[:password_confirmation]}\n if params[:id] == \"_empty\"\n user = User.create(user_params)\n user.activate\n else\n user = User.find(params[:id])\n user.update_attributes(user_params)\n end\n if params[:admin_flag] == 'on'\n user.make_site_admin\n end\n end\n render :nothing => true\n end", "title": "" }, { "docid": "8ead2ae2571f74c48a83ebda0d6293d8", "score": "0.6076791", "text": "def post_user_data\n if params[:oper] == \"del\"\n User.find(params[:id]).destroy\n else\n user_params = { :login => params[:login], \n :first_name => params[:first_name], \n :last_name => params[:last_name], \n :email => params[:email],\n :password => params[:password],\n :password_confirmation => params[:password_confirmation]}\n if params[:id] == \"_empty\"\n user = User.create(user_params)\n user.activate\n else\n user = User.find(params[:id])\n user.update_attributes(user_params)\n end\n if params[:admin_flag] == 'on'\n user.make_site_admin\n end\n end\n render :nothing => true\n end", "title": "" }, { "docid": "2bed29f60c3ba96ffc01e9fa4ce82f66", "score": "0.6076124", "text": "def seed_user\n seed_usr = User.new(name: \"Tandem\")\n save_or_put_err(\"the user\",seed_usr)\nend", "title": "" }, { "docid": "678a85b0cdca142dd54c5638011d552c", "score": "0.60742265", "text": "def set_create_user_fields\n user_id = AuditModule.get_current_user.uid\n self.created_by = user_id\n self.updated_by = user_id\n self.release_indicatior = \"0\"\n end", "title": "" }, { "docid": "6c36a3346de4d24236a0a67293509629", "score": "0.6070785", "text": "def create_super_user\n if User.where(:email => params[:user][:email]).exists?\n flash[:error] = \"Email already exist\" \n elsif current_user.has_role? :superadmin \n @user = current_user.client.users.create(user_params)\n @user.update(primary_mobile_no: params[:country_code_mob] + user_params[:primary_mobile_no])\n @user.add_role(params[:roles_name])\n NotificationType.all.each do |t| \n NotificationSetting.create(users_id: @user.id, notification_types_id: t.id)\n end\n authorize! :create, @user\n flash[:notice] = \"User is successfully created.\"\n else\n render 'new_super_user'\n end\n redirect_to new_super_user_path\n end", "title": "" }, { "docid": "01c4045eecb3a9def52816c2612868ee", "score": "0.6067063", "text": "def create_super_admin\n \tif User.all.blank?\n \t\tself.role = 1\n \tend\t\n end", "title": "" }, { "docid": "858780b26a07ca8cdae6aa25a81c8215", "score": "0.6057868", "text": "def add_user\n create\n end", "title": "" }, { "docid": "1ecfa4c2be185287246175b2749c9f08", "score": "0.60571307", "text": "def create_or_update\n @user_data = find_or_build(record_retrieval_params)\n success_status = @user_data.persisted? ? :no_content : :created\n\n @user_data.payload = user_data_params[:payload]\n @user_data.save!\n\n render status: success_status, format: :json\n end", "title": "" }, { "docid": "0916093ecbba1cbb19a9e7802b90327a", "score": "0.6049535", "text": "def upgrade_to_main_user\n self.is_main_user = true \n self.save \n\n admin_role = Role.find_by_name(USER_ROLE[:admin]) \n self.add_role_if_not_exists(admin_role ) \n end", "title": "" }, { "docid": "175bc1f33ff2067b3bebd096830bd7f7", "score": "0.6045528", "text": "def create_user (user)\n is_save = user.save\n end", "title": "" }, { "docid": "1f8754b188deb92e275ab3326a1ed698", "score": "0.6042579", "text": "def touch_user(user)\n name = nil\n if user.class==String && user.numeric? || user.class==Fixnum\n name = @users[user.to_i]\n elsif @users.values.index(user)\n name = user\n end\n\n if name.nil?\n return nil if user.class==String && user.numeric? || user.class==Fixnum #invalid id -> no creation, just fail\n\n #create new user in system\n add_user(user)\n name = user\n end\n\n return name\n end", "title": "" }, { "docid": "31389f800439f07347d9f72bf770c1ce", "score": "0.6031481", "text": "def create\n op=0\n @user = User.new(user_params)\n @user.identity_provider_email.downcase!\n \n if (User.find_by_identity_provider_email(@user.identity_provider_email))\n @user = User.find_by_identity_provider_email(@user.identity_provider_email)\n op=1\n end\n\n if (op==0)\n \n #new user was created\n respond_to do |format|\n if @user.save \n format.html { redirect_to @user, notice: 'User was successfully created.' }\n format.json { render :show, status: :created}#, location: @user }\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end\n \n # this user already exists\n if(op==1)\n respond_to do |format|\n if @user.update(user_params)\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { render :show, status: :ok}#, location: @user }\n else\n format.html { render :edit }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end \n end \n rescue \n render json: @user.errors, status: :unprocessable_entity\n end", "title": "" }, { "docid": "b5ee28244ee9d81e7f935b1722740035", "score": "0.6028783", "text": "def add_user!(user_or_email_or_phone, recognition=nil, opts={}, &block)\n\n #allow stubs or full emails, but force company domain\n # email = email_stub.split(\"@\")[0]+\"@\"+self.company.domain\n # return User.new() if User.exists?(email: email)\n u = begin\n if user_or_email_or_phone.kind_of?(User)\n user_or_email_or_phone\n else\n if user_or_email_or_phone.match(/\\@/).present?\n User.new(email: user_or_email_or_phone)\n else\n self.company.users.build(phone: user_or_email_or_phone)\n end\n end\n end\n\n yield u if block_given?\n\n st = recognition.present? ?\n :invited_from_recognition :\n (opts[:skip_invitation] ? :pending_invite : :invited)\n\n u.company = opts[:company] if opts[:company].kind_of?(Company)\n u.skip_same_domain_check = true if opts[:skip_same_domain_check]\n u.bypass_disable_signups = opts[:bypass_disable_signups]\n u.bypass_authlogic_persistence_token_validation = opts[:bypass_authlogic_persistence_token_validation]\n u.set_status!(st)\n u.invited_at = Time.now\n u.invited_by = self\n u.skip_name_validation = true unless user_or_email_or_phone.kind_of?(User)\n # recognition.present? ? u.save : u.save!#(validate: false)\n u.invited_from_recognition? ?\n u.save! :\n (opts[:save_without_session_maintenance] ? u.save_without_session_maintenance : u.save)\n return u\n end", "title": "" }, { "docid": "167702491061be853b9d97bbe0d47153", "score": "0.6027118", "text": "def after_user_create(user, hash); end", "title": "" }, { "docid": "ffdb59071a95a760c0eeba26eabc1d3a", "score": "0.60257286", "text": "def update_user(options); end", "title": "" }, { "docid": "3d155b5ac01723303399bec8b404ad3b", "score": "0.6021938", "text": "def user_attributes=(user_attributes) #setting the user attributes \n self.user = User.find_or_create_by(username: user_attributes[:username]) unless user_attributes[:username].blank?\n end", "title": "" }, { "docid": "1d324f7f52cc86e5bb081c2e3daeadfb", "score": "0.60071176", "text": "def before_user_create(user, hash); end", "title": "" }, { "docid": "f049cda8de729a1981a3c276192d4400", "score": "0.6003152", "text": "def set_member #this is the method to set any new user as a member. \n self.role = 'member'\n end", "title": "" }, { "docid": "e04625a2395349db587be6d1ab1ab128", "score": "0.5996094", "text": "def add_user(atts)\n u = User.new(atts)\n #u.change_password\n # WARNNING: 'add_user' produces status => \"normal\" user\n u.status = 1\n u.save!\n end", "title": "" }, { "docid": "e1f15d4707b95b448de45379c75a6c9d", "score": "0.5990527", "text": "def find_or_create_user(user_psid)\n current_user = User.find_by(psid: user_psid)\n current_user ||= User.create(email: \"#{user_psid}@mail.com\", password: \"123456\", psid: user_psid)\nend", "title": "" }, { "docid": "fd0d6ff0ddfa5d36c92f3a5dc724686b", "score": "0.5983373", "text": "def attempt_special_user_upgrade\n # Check if the user already has the position\n if SpecialUsers.is?(@user, @position)\n message = I18n.t(\n 'settings.special_users.new.already_is',\n username: @user.username,\n position: @position\n )\n yield json: { message: }, status: 422\n end\n SpecialUsers.set_user(@position, @user.username)\n message = I18n.t(\n 'settings.special_users.new.elevate_success',\n username: @user.username,\n position: @position\n )\n yield json: { message: }, status: 200\n end", "title": "" }, { "docid": "2f548fc3f29fb5eccf817b92a506570e", "score": "0.5982231", "text": "def create?\n record.try(:user) == user || user.admin?\n end", "title": "" }, { "docid": "40adc2da7842a5de58e4e441448b1987", "score": "0.59803253", "text": "def create_admin_user\n @profh = User.new\n @profh.first_name = \"Professor\"\n @profh.last_name = \"Heimann\"\n @profh.username = \"profh\"\n @profh.email = \"[email protected]\"\n @profh.password = \"secret\"\n @profh.password_confirmation = \"secret\"\n @profh.role = \"admin\"\n @profh.active = true\n @profh.save!\nend", "title": "" }, { "docid": "73036db2b0963110948fd5e2199b9ff1", "score": "0.5979065", "text": "def find_or_create_user\n user = ::Com::Nbos::User.where(uuid: @module_token_details.uuid)\n if user.present?\n @user = user.first\n elsif @module_token_details.uuid.present?\n @user = ::Com::Nbos::User.new\n @user.uuid = @module_token_details.uuid\n @user.tenant_id = @module_token_details.tenantId\n @user.save\n else\n @user = Com::Nbos::User.new\n @user.uuid = \"guest\"\n @user.tenant_id = @module_token_details.tenantId\n end\n end", "title": "" }, { "docid": "3fa7151de142723ec2fafc4249f56ff2", "score": "0.59781396", "text": "def get_or_create_user\n if has_user?\n load_or_create_user\n else\n create_new_user\n end\n end", "title": "" }, { "docid": "7176bbcbcfb82d8af94c82fd3a297fc7", "score": "0.597779", "text": "def create\n @user = User.find_or_create_by!(name: params[:name])\n @user.level_up!(User::LEVEL_PRIMARY)\n redirect_to user_path(@user), status: :created\n end", "title": "" }, { "docid": "113a88c796a77d43edad721004ac4681", "score": "0.59560484", "text": "def full_create(attrs,admin_user = false)\n attrs ||= {}\n \n self.attributes = attrs\n self.username = attrs[:username] if attrs[:username]\n if admin_user\n self.is_admin = attrs[:is_admin]\n self.is_editor = attrs[:is_editor]\n end\n\n self.save\n end", "title": "" }, { "docid": "347053372042c66f5f875e5febd26cfc", "score": "0.59470415", "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": "0f8ca52411eb2ddc228b743d99999f37", "score": "0.59442085", "text": "def create\n @user = User.new(user_params_admin)\n\n if create_or_update\n flash[:success] = t(:user_created_successfully)\n redirect_to @user\n else\n render :new\n end\n end", "title": "" }, { "docid": "b75ae9ff339df6a93ae0e2464d9482e9", "score": "0.5940185", "text": "def create_user\n\n\n @user = User.new(sign_up_params)\n\n\n respond_to do |format|\n if @user.save\n\n\n # key_user = Role.find(@user.role_id).key\n #\n # case key_user\n # when 'admin_empresa'\n # Company.find(params[:current_company]).update(user_id: @user.id) unless params[:user]['current_company'].eql? ''\n # when 'admin_sucursal'\n # Branch.find(params[:branch]).update(manager_id: @user.id) unless params[:user]['branch'].eql? ''\n # when 'admin_departamento'\n # Department.find(params[:department]).update(manager_id: @user.id) unless params[:user]['department'].eql? ''\n # else\n # p 'Hola'\n # end\n format.html { redirect_to @user.department || user_registrations_path, notice: t('notifications_masc.success.resource.created',\n resource: t('users.registrations.new_user.resource')) }\n format.json { render :show, status: :created, location: @user }\n else\n @role_accessless = Role.find_by_key(\"empleado_sin_acceso\").id\n format.html { render :edit_user }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "efb597bf7b3f027a0449d7ab04d1ab3d", "score": "0.5935116", "text": "def find_or_create_user(params, relocation)\n if User.exists?(email: params[:user][:email])\n User.find_by_email params[:user][:email]\n else\n relocation.create_user params[:user]\n end\n end", "title": "" }, { "docid": "b47f14847b38ad7b5f5bc0ac417ee16b", "score": "0.5934728", "text": "def updatable_by?(user)\n puts \"in updatable_by application\"\n resource.user == user || user.has_role?(:admin)\nfalse\n end", "title": "" }, { "docid": "a9ced290160f663b4f55054802719046", "score": "0.59307444", "text": "def create?\n user.present? && user.admin?\n end", "title": "" }, { "docid": "a9ced290160f663b4f55054802719046", "score": "0.59307444", "text": "def create?\n user.present? && user.admin?\n end", "title": "" }, { "docid": "445161246d6aaffd29d727e61fb09cd5", "score": "0.5929743", "text": "def check_user(user_name)\n\tUser.find_or_create_by(name: user_name)\nend", "title": "" }, { "docid": "88f440434e28c180861c3db19947c64b", "score": "0.59274495", "text": "def create_authorized?\n @current_user.can_modify?\n end", "title": "" }, { "docid": "88f440434e28c180861c3db19947c64b", "score": "0.59274495", "text": "def create_authorized?\n @current_user.can_modify?\n end", "title": "" }, { "docid": "88f440434e28c180861c3db19947c64b", "score": "0.59274495", "text": "def create_authorized?\n @current_user.can_modify?\n end", "title": "" }, { "docid": "9a28f260a65813d552123e7e5468da1c", "score": "0.5922785", "text": "def create_or_update_with_security_check\n if self.new_record?\n raise NotAuthorized unless current_user_has_permission(:create)\n else\n raise NotAuthorized unless current_user_has_permission(:update)\n end\n create_or_update_without_security_check\n end", "title": "" }, { "docid": "eba52e9711239c8e0e49332f97761f6c", "score": "0.5921908", "text": "def auto_create_user?(attrs)\n false\n end", "title": "" }, { "docid": "36ecfd1af50ee5651f5e332e49f07a13", "score": "0.59205335", "text": "def create\n save_user \n end", "title": "" }, { "docid": "4f4c55ef05d4b2d08840aa65438ee221", "score": "0.59186196", "text": "def create?\n user\n end", "title": "" }, { "docid": "dc35a31e679191b5615e05fc4367e309", "score": "0.59105444", "text": "def temp_create\r\n\ttempuser = User.find_by_email(params[:user][:email])\r\n \t\r\n\t@temp_created = false\r\n\t\r\n\t# Checks if the user is a temporary/invited user\r\n if tempuser && tempuser.temp\r\n \t@user = tempuser\r\n\t\[email protected] = false\r\n\t\t\r\n \tif @user.update_attributes(params[:user])\r\n\t\t\t@temp_created = true\r\n\t\tend\r\n\telse\t\r\n\t\t@user = User.new(params[:user])\r\n end\r\n\t\r\n\tif (is_in_beta && @temp_created) || !is_in_beta\r\n\t\t@created = @temp_created || @user.save\r\n\tend\r\n end", "title": "" }, { "docid": "8851bb67b7455d0ed8881011207a1e21", "score": "0.5904266", "text": "def createUser(user)\n isSaveUser = user.save\n end", "title": "" }, { "docid": "101915f2b2bcc0009aaac9946922fda6", "score": "0.589975", "text": "def add_user_to_vso\n return if current_user.roles.exclude?(\"VSO\") || organization.users.include?(current_user)\n\n organization.add_user(current_user)\n end", "title": "" }, { "docid": "cb31325d7a930a5e36d9aaf7ab757d62", "score": "0.58874995", "text": "def set_user\n end", "title": "" }, { "docid": "84f1f2484cdcd984fe9b3a0ef42a685f", "score": "0.58844215", "text": "def createuser\n authorize!(:createuser,current_user) unless current_user.role?:lawfirm_admin or current_user.role?:livia_admin\n unless params[:employee][:id].empty?\n @employee = @company.employees.find(params[:employee][:id])\n params[:user][:first_name] = @employee.first_name\n params[:user][:last_name] = @employee.last_name\n params[:user][:email] = @employee.email\n params[:user][:phone] = @employee.phone\n params[:user][:mobile] = @employee.mobile\n params[:user][:time_zone] = params[:user][:time_zone]\n params[:user][:company_id] = @employee.company_id\n @user = User.new(params[:user])\n @user.errors.add_to_base(\"Alternate Email:\" + '' + \"Alternate Email should not be blank\") if params[:user][:alt_email].blank?\n reg = /^(?=.*\\d)(?=.*([a-z]))(?=.*([A-Z]))(?=.*([\\x21-\\x2F]|[\\x3A-\\x40]|[\\x5B-\\x60]|[\\x7B-\\x7E]))([\\x20-\\x7E]){8,40}$/\n @user.errors.add_to_base(\"Password:\" + '' + t(:flash_password)) if !(reg.match(params[:user][:password]))\n respond_to do |format|\n begin\n if @user.errors.size == 0 && @user.save #Bug 11661: Rashmi.N\n Employee.transaction do \n @employee.update_attributes(:user_id => @user.id)\n @role = Role.find_by_name('lawyer')\n @userrole = UserRole.find_or_create_by_user_id_and_role_id(@user.id,@role.id)\n @employee.user.create_helpdesk_user(@company,params[:user][:password],@role.id)\n end\n url=url_link\n recipient =[]\n recipient << params[:user][:email]\n recipient << get_lawfirm_admin_email_for_companyid(params[:user][:company_id])\n userDetails = params[:user]\n @liviaMailer = LiviaMailer\n flash[:notice] =\"#{t(:text_user)} \" \"#{t(:flash_was_successful)} \" \"#{t(:text_added)}\"\n if current_user.role?(:livia_admin)\n format.html { redirect_to showusers_companies_path+\"/#{@company.id}\" }\n else\n format.html { redirect_to lawfirm_admins_url }\n end\n else\n @roles = @company.roles\n @employees = @company.employees.all(:conditions => ['user_id IS NULL'])\n format.html { render(:action => 'adduser' ,:company_id =>@company.id) }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n rescue Exception => exc\n logger.info(\"Create User Error : #{exc.message}\")\n flash[:error] = \"DB Store error: #{exc.type}.\"\n format.html{ redirect_to showusers_companies_path+\"/#{@company.id}\"}\n end\n end\n else\n flash[:error] = t(:flash_create_employee)\n redirect_to(:action => 'adduser' ,:company_id =>@company.id)\n end\n end", "title": "" }, { "docid": "f4f716b9b2be929078452b0cdae6efa0", "score": "0.58716565", "text": "def save_new_user\n @user = User.find(params[:id]) if params[:id]\n if @user\n @user.catalogo_institucion_id = params[:user][:catalogo_institucion_id] if params[:user][:catalogo_institucion_id]\n success = @user.update_attributes(params[:user])\n else\n @user ||= User.new(params[:user])\n @user.activated_at = Time.now\n @user.email_not_required!\n ## Main Role ###\n @user.roles << Role.find(params[:role][:id])\n success = @user && @user.save\n end\n \n if success && @user.errors.empty?\n flash[:notice] = \"Usuario creado/actualizado correctamente\"\n# redirect_to :action => \"show_users\", :controller => \"admin\"\n redirect_to :action => \"show_roles\", :controller => \"admin\"\n else\n flash[:error] = \"No se puedo crear usuario, verifique los datos\"\n render :action => 'new_from_admin'\n end\n end", "title": "" }, { "docid": "c9249980314d44a4ad978ca0df7c1cce", "score": "0.58683187", "text": "def create?\n return false unless @user\n\n @user.try(:admin?) || @record.user == @user ||\n @record.group&.users&.include?(@user)\n end", "title": "" }, { "docid": "4397534448a4c1547bbbc91ce58d0320", "score": "0.58671695", "text": "def create?\n user.present? && user.role?(:admin)\n end", "title": "" }, { "docid": "d75c4dcc4b09397dec92c7f98d43865a", "score": "0.58614945", "text": "def create?\n user.admin? || user.company?\n end", "title": "" }, { "docid": "748501e129b0c7f77e56671d8fba9a83", "score": "0.58599293", "text": "def add_user\n end", "title": "" }, { "docid": "5008840b8e81c2a7c3ca8bebc6791b00", "score": "0.58577055", "text": "def create_with(user)\n user = User.find(user) if user.kind_of? String\n raise ActiveRecord::RecordNotFound unless user.kind_of? User\n\n ActiveRecord::Base.transaction do\n save\n UserEmote.create kind: \"Owner\", user_id: user.id, emote_id: self.id\n UserEmote.tag user, self, self.tags.keys\n end\n end", "title": "" }, { "docid": "bb81971a9392f7389fa365a874370abb", "score": "0.5857395", "text": "def create_admin\n user = User.new\n user.last_name = 'Dorton'\n user.first_name = 'Brian'\n user.email = '[email protected]'\n user.password = '12345678'\n user.admin = 'true'\n user.save!\n user\nend", "title": "" }, { "docid": "da5b46a7a144d5925229aeda616c97b4", "score": "0.585401", "text": "def make_admin!\n @user = User.find(:id)\n @user.make_admin!\n @user.update\n end", "title": "" }, { "docid": "289b82eda97e74e8780b2dde9410347e", "score": "0.5851863", "text": "def custom_sign_up\n\t #Intancia al modelo User y llama al metodo from_omniauth y pasa los\n\t #parametros que requiere\n\t\t@user = User.from_omniauth(session[\"devise.auth\"])\n\t\t#Pregunta si existen los parametros\n\t\tif @user.update(user_params)\n\t\t \n\t\t\tsign_in_and_redirect @user, event: :authentication\n\t\telse\n\t\t\trender :edit\n\t\tend\n\tend", "title": "" }, { "docid": "f692421744f78a3a5e62ce02b1883c1c", "score": "0.58487666", "text": "def create\n save_and_register_or_login\n end", "title": "" } ]
aac199edde022419bb8838ade6d066d1
=> return ends_at format hour:minutes
[ { "docid": "46a9bae0b89c4dc19bcee1dba0a58229", "score": "0.70262295", "text": "def end\n ends_at.strftime(\"%R\")\n end", "title": "" } ]
[ { "docid": "d0ea036514037fafc5cd53aa076efc1c", "score": "0.7857584", "text": "def ends_at\n starts_at + minutes.minutes\n end", "title": "" }, { "docid": "3f2eac3784281850ce0fa4e0ed6b7b46", "score": "0.72400296", "text": "def end_time(*args)\n raw = ends_at || shift.ends_at\n # account for pm-am shift\n end_date = shift.ends_at < shift.starts_at ? date + 1 : date\n raw = Time.local end_date.year, end_date.month, end_date.day, raw.hour, raw.min\n return raw if args.include? :raw\n raw.to_s(:meridian_time).strip\n end", "title": "" }, { "docid": "52caaed6eb710be2636c94f5a8bd522b", "score": "0.71858585", "text": "def end_time\n end_at.strftime(\"%F\") if end_at\n end", "title": "" }, { "docid": "07bb26b260235612d8d03e6ef7277d82", "score": "0.69548124", "text": "def end_hour\n hour = DateTime.parse(self.datep.to_s).hour\n hour_s = ''\n if(hour < 10)\n hour_s = '0'+hour.to_s\n else\n hour_s = hour.to_s\n end\n hour_s\n end", "title": "" }, { "docid": "4dc7f3b41794fc266662c7562eb205d6", "score": "0.6907322", "text": "def ends_at\n started_at + client.clock_delta + length if started_at\n end", "title": "" }, { "docid": "434657122cca4f928214c96d34ce2889", "score": "0.6815515", "text": "def end_of_hour\n change(min: 59, sec: 59.999)\n end", "title": "" }, { "docid": "37ed034c827475129d406e59d3f5f8a0", "score": "0.6701423", "text": "def end_hour_with_respecting_end_of_day\n if end_minute_without_respecting_end_of_day >= 59 and end_hour_without_respecting_end_of_day == 23\n 24\n else\n end_hour_without_respecting_end_of_day\n end\n end", "title": "" }, { "docid": "62ea2273978da6b4b71f759bbbd60d24", "score": "0.6692102", "text": "def end_time_string\n\t\tend_time.to_s(:time) if end_time\n\tend", "title": "" }, { "docid": "10beb2a5eead9b55b86b261677941d28", "score": "0.66574234", "text": "def end_time_to_s\n\t \tself.end_date.try(:strftime, '%H:%M:%S')\n\t end", "title": "" }, { "docid": "a90bd3b39518afd38eb72139d19c1a39", "score": "0.6652726", "text": "def end_formatted\n display_time read_attribute(:end)\n end", "title": "" }, { "docid": "5a682cf717e0d3c9bba95b8d7ade396c", "score": "0.65869635", "text": "def end_of_hour\n change(:min => 59, :sec => 59)\n end", "title": "" }, { "docid": "f77d9bc89bbf2b318f61193b03ebbc4e", "score": "0.65321887", "text": "def set_ends_at\n return unless self.duration && self.starts_at\n self.ends_at = starts_at + duration.hours\n end", "title": "" }, { "docid": "639912268155beb0dafb910c6247fa8b", "score": "0.652672", "text": "def end_time_input\n @end_time_input || end_time.try(:strftime, \"%H:%M\")\n end", "title": "" }, { "docid": "e299864d74a73c509f8c2428f3052d82", "score": "0.65229285", "text": "def end_time\n hours = start_time / 100\n minutes = start_time % 100\n duration_hours = duration / 60\n duration_minutes = duration % 60\n\n if duration_minutes + minutes >= 60\n hours += 1\n minutes = (duration_minutes + minutes) % 60\n duration_minutes = 0\n end\n\n return (hours + duration_hours) * 100 + (minutes + duration_minutes)\n end", "title": "" }, { "docid": "6a09b3cc83c3fb5967ddb1bd1b4029cc", "score": "0.6461936", "text": "def timetoend\n endat - nowat\n end", "title": "" }, { "docid": "13eedc45271824076dc5ac78bb9603a6", "score": "0.6451929", "text": "def fancy_end_at(event)\n tz_aware_end_date = event.end_at.in_time_zone(@event.timezone.source)\n\n if event.start_at + 1.day > event.end_at\n t(\"events.show.end_time.hours\", time: tz_aware_end_date.to_s(:time),\n duration: event_duration(event))\n elsif event.start_at + 2.days > event.end_at\n t(\"events.show.end_time.next_day\", time: tz_aware_end_date.to_s(:time),\n duration: event_duration(event))\n else\n t(\"events.show.end_time.arbitrary\", time: l(tz_aware_end_date, format: :default))\n end\n end", "title": "" }, { "docid": "a15f23bd2d21767b9a24c19034733b5a", "score": "0.64296454", "text": "def ended_at\n Convert.millis_to_time @gapi.statistics.end_time\n end", "title": "" }, { "docid": "f307b3823f1482a6599c4717d5320df5", "score": "0.6428062", "text": "def end_of_hour\n change(\n min: 59,\n sec: 59,\n usec: Rational(999999999, 1000)\n )\n end", "title": "" }, { "docid": "3425864d8ffaba2b76ae63f23b24a61c", "score": "0.6387765", "text": "def end_of_hour\n change(\n :min => 59,\n :sec => 59,\n :usec => 999999.999\n )\n end", "title": "" }, { "docid": "5af5f289b5a7845768669a4c822c6596", "score": "0.6377531", "text": "def end_time\n ConfigVariable.new(name: 'END_TIME', pattern: TIME_PATTERN, human_pattern: \"HH:MM\").value\n end", "title": "" }, { "docid": "783c78b9384d6898bf9c137e885f68a0", "score": "0.6294319", "text": "def formatted_time\n start_time = \"#{self.start_time.strftime(\"%l:%M\")} #{self.start_time.strftime(\"%p\")}\"\n end_time = \"#{self.end_time.strftime(\"%l:%M\")} #{self.end_time.strftime(\"%p\")}\"\n \"#{start_time} - #{end_time}\"\n end", "title": "" }, { "docid": "da632589804262c3c0e013b0efc11046", "score": "0.62238604", "text": "def time_slot_duration(time_slot)\n diff = time_slot.ends_at - time_slot.starts_at\n diff += 2400 if diff < 0\n hour, minute = diff.divmod 100\n result = \"#{hour}hr\"\n result << \" #{minute}min\" unless minute == 0\n result\n end", "title": "" }, { "docid": "978ccc4ccc180c5dce27247f6b99c9db", "score": "0.61799335", "text": "def end_at\n I18n.l(object.end_at)\n end", "title": "" }, { "docid": "dc90ae63a506d48097b03c011d456b64", "score": "0.61728424", "text": "def get_formatted_hour\n start_on.strftime(\"%H:%M\")\n end", "title": "" }, { "docid": "3ed14bdff42b846db30811d7fba40787", "score": "0.61433434", "text": "def to_s\n '%02d:%02d' % [(@hours % 24), @minutes]\n end", "title": "" }, { "docid": "28cb351f5e2d82e156fbf4384cfcea78", "score": "0.6139984", "text": "def end_time\n @parts.last.end_time\n end", "title": "" }, { "docid": "5da2dbd61eebb714cf0262495c09271d", "score": "0.6133747", "text": "def end_minute_with_respecting_end_of_day\n if end_minute_without_respecting_end_of_day >= 59 and end_hour_without_respecting_end_of_day == 23\n 0\n else\n end_minute_without_respecting_end_of_day\n end\n end", "title": "" }, { "docid": "6e2cd0fc66b40a8d26d45a3217c13349", "score": "0.6132292", "text": "def time\n \"#{start_time.strftime('%I:%M %p')} - #{end_time.strftime('%I:%M %p')}\"\n end", "title": "" }, { "docid": "6e2cd0fc66b40a8d26d45a3217c13349", "score": "0.6132292", "text": "def time\n \"#{start_time.strftime('%I:%M %p')} - #{end_time.strftime('%I:%M %p')}\"\n end", "title": "" }, { "docid": "8fdd570296bab8bf21add31afb41890c", "score": "0.6116517", "text": "def ends_at\n @ends_at ||= begin\n if period == :quarter\n starts_at.advance months: length * 3\n else\n starts_at.advance periods => length\n end\n end\n end", "title": "" }, { "docid": "fe39e177aca69098fd05a0647ff39047", "score": "0.61020553", "text": "def end_time\n start_time + duration\n end", "title": "" }, { "docid": "5893c2c01cf2f188c2789128a1c8a931", "score": "0.60958207", "text": "def end_of_minute\n change(sec: 59.999)\n end", "title": "" }, { "docid": "2af141274deedfa04083a66a7af118f9", "score": "0.6006516", "text": "def end_time\n eval(self.end) if self.end.present?\n end", "title": "" }, { "docid": "1fd6768762efe4fd2676ac69f08a3823", "score": "0.60031325", "text": "def utc_stop_time\n one_hour = 60*60\n (@time + one_hour).utc.strftime(\"%Y-%m-%dT%H:%M:%S.000Z\")\n end", "title": "" }, { "docid": "7df1beba69d9838dd2305ed35641ee20", "score": "0.6002384", "text": "def ends\n start + duration\n end", "title": "" }, { "docid": "d4750265ce95ca351458c211abcfa910", "score": "0.59995854", "text": "def end_time\n start_time + treatment.duration.minutes\n end", "title": "" }, { "docid": "0a901d5f38f30657045ad0d1d1802cea", "score": "0.5945256", "text": "def after_midnight(str)\n hours, minutes = str.split(\":\").map(&:to_i)\n \n hours < 24 ? (hours * 60) + minutes : 0\nend", "title": "" }, { "docid": "eb8e5547375b115c99ce94460b6440e2", "score": "0.5939005", "text": "def time_conversion(minutes)\n hours = minutes / 60\n remaining_minutes = minutes % 60\n \"%s:%02d\" % [hours, remaining_minutes]\nend", "title": "" }, { "docid": "48ed09d428be5ccfbc3bcde48649081d", "score": "0.5932003", "text": "def end_at\n @attributes[:end_at]\n end", "title": "" }, { "docid": "48ed09d428be5ccfbc3bcde48649081d", "score": "0.5932003", "text": "def end_at\n @attributes[:end_at]\n end", "title": "" }, { "docid": "3b45b055b18c9a59e4b40581a8967837", "score": "0.59289515", "text": "def finished_at\n (@finished_at || Time.now).to_s[0..-7] # HACK: to remove offset (e.g. + 01:00)\n end", "title": "" }, { "docid": "04d770b1bf33fb91f0b6f991b99729ed", "score": "0.5898005", "text": "def end_date(ends)\n if ends.nil?\n \"end\" + time_str(Time.now)\n elsif ends.kind_of?(Time)\n \"end\" + time_str(ends)\n end\n end", "title": "" }, { "docid": "40f89d3cfc3f9b96a5a811b55451ece2", "score": "0.5879593", "text": "def end_time\n start_time + event.event_type.length.minutes\n end", "title": "" }, { "docid": "ec2965775fe678a9aba980a093236a32", "score": "0.5862783", "text": "def end_of_day\n to_time.end_of_day\n end", "title": "" }, { "docid": "d9bf9bd98b36fd0bcecfc9c429fdf66a", "score": "0.58617425", "text": "def prep_time_end\n return \"1545\";\n end", "title": "" }, { "docid": "6395485c0aa7e921a05eaaceb36bd432", "score": "0.58408", "text": "def end_time\n return nil if empty?\n @start_time + (@v.size-1).hours\n end", "title": "" }, { "docid": "59786cf4bc5fb2b28cc2484e94784e22", "score": "0.5840633", "text": "def calc_ends_on\n begins_on.since duration\n end", "title": "" }, { "docid": "72ba35f2f1efdc0f49215c0fc4cd67e3", "score": "0.5840076", "text": "def convert_to_end_at\n\t\tif @start_date.present? && @start_time.present? && @duration.present?\n\t\t\tself.end_at = Time.parse(\"#{@start_date} #{@start_time}\") + (@duration.to_f.hours+ (1.hours))\n\t\tend\n\tend", "title": "" }, { "docid": "a59323d5a9fac59742cc38e3afbf7d43", "score": "0.5833962", "text": "def time_length\n (end_time.hour - start_time.hour) + (end_time.min - start_time.min) / 60.0\n end", "title": "" }, { "docid": "b94166aeeaa2629ef52c3f18106131b3", "score": "0.58320403", "text": "def end_time(starttime, duration)\n endtime = starttime\n if duration\n seconds = 0\n duration.split(\" \").each do |dur|\n if dur.include?(\"d\")\n seconds = seconds + (60 * 60 * 24 * dur.to_i) #add seconds in the number of days\n elsif dur.include?(\"h\")\n seconds = seconds + (60 * 60 * dur.to_i) #add seconds in the count of hours\n else\n seconds = seconds + (60 * dur.to_i) #add seconds in the count of minutes\n end\n end\n return endtime + seconds\n else\n return endtime + (60*60) #default of 1 hour\n end\nend", "title": "" }, { "docid": "b23ba9e535cd6450816acf445531a835", "score": "0.5806532", "text": "def after_midnight(str)\n str = str.split(\":\")\n h = str[0].to_i % 24\n m = str[1].to_i\n minutes = (h * 60) + m \nend", "title": "" }, { "docid": "153daeee5a030132f2ec29c1bab27091", "score": "0.5799272", "text": "def time_conversion(minutes)\n hr = 0\n min = 0\n \n while minutes >= 0\n if minutes >= 60\n minutes = minutes - 60\n hr = hr + 1\n elsif minutes < 10\n min = 0.to_s + minutes.to_s\n return hr.to_s + ':' + min.to_s\n else\n min = minutes\n return hr.to_s + ':' + min.to_s\n end\n end\nend", "title": "" }, { "docid": "2034ac0db815b7c8b27f7e1dbd53050b", "score": "0.57984006", "text": "def absolute_hour(seconds); end", "title": "" }, { "docid": "b6b16307b61ccf21606e20742e926f88", "score": "0.57753485", "text": "def end_time\n data.end_time\n end", "title": "" }, { "docid": "ac6615def5c541cadc2c9d52dfe059a5", "score": "0.5771033", "text": "def pretty_hours(locale=I18n.locale)\n if starts_at.to_date.eql?(ends_at.to_date)\n # Same day, different hours\n \"#{starts_at.strftime('%H:%M')} - #{ends_at.strftime('%H:%M')}\" \n else\n # Different dates\n start_date = starts_at.strftime('%H%M') == \"0000\" ? I18n.localize(starts_at.to_date, :format => :long, :locale => locale) : I18n.localize(starts_at, :format => :long, :locale => locale)\n end_date = ends_at.strftime('%H%M') == \"0000\" ? I18n.localize(ends_at.to_date, :format => :long, :locale => locale) : I18n.localize(ends_at, :format => :long, :locale => locale)\n \"#{start_date} - #{end_date}\"\n end \n end", "title": "" }, { "docid": "504ed5f2cbcd66fc52ca7443f80f7543", "score": "0.576057", "text": "def normalize_end_time(time)\n time.midnight + 1.day - 1.minute\n end", "title": "" }, { "docid": "bfaa93d96eca8676e141d601e02a5a8d", "score": "0.5757402", "text": "def ending_at\n @ending_at ||= parse_or_at(@attrs[:ending_at]) if @attrs[:ending_at]\n end", "title": "" }, { "docid": "0ec184c7f51384ba670094dc6df91734", "score": "0.5756846", "text": "def end_time_defined?(time)\n if time.empty?\n '24:00'\n else\n time\n end\n end", "title": "" }, { "docid": "1d47f8c999a0c5da14a71539ffc1c284", "score": "0.57534766", "text": "def end_time_desc(booking)\n return \"\" if booking.nil?\n seconds = (duration && duration.abs()) || 0\n result = (booking.estimated_do) || (booking.negotiated_do) || (start_time && (start_time + seconds.seconds))\n if result.nil?\n return \"TBD\"\n end\n result.strftime(\"%l:%M %p\")\n end", "title": "" }, { "docid": "b0c32b5cd7ed09bea75dc761ca1a4a5a", "score": "0.5752711", "text": "def total_hours\n ('%.02f' % ((ends_at - starts_at) / 1.hour)).to_f\n end", "title": "" }, { "docid": "0e74c343cfedcc4ee4d39534b6518ba2", "score": "0.575179", "text": "def time_conversion(mins)\n hour = mins/60\n min = mins.modulo(60)\n return '%02d:%02d' %[hour,min]\nend", "title": "" }, { "docid": "662fb60c60962234aacba1a1476f8d81", "score": "0.5745326", "text": "def end_time(start) ((Time.now - start).to_f * 1000).truncate(5) end", "title": "" }, { "docid": "e6e2a566fbfb5f38f2c16771f4119eb5", "score": "0.57360435", "text": "def to_s\n if @am_pm\n display = @current.strftime(\"%I:%M\")\n else\n display = @current.strftime(\"%H:%M\")\n end\n @fuzz.times { display.sub!(/\\d(\\D*)$/, '~\\1') } if @fuzz > 0\n display\n end", "title": "" }, { "docid": "cfbde4deb163570664a7d041df132b19", "score": "0.57321984", "text": "def after_midnight(string)\n hours, minutes = string.split(':').map(&:to_i)\n hours.remainder(24) * 60 + minutes\nend", "title": "" }, { "docid": "4c08507f6d264b8585d42d7a18041fd3", "score": "0.5721329", "text": "def to_s\n\t\ts, m = @sec % 60, @sec / 60\n\t\th = m / 60\n\t\tm = m % 60\n\t\treturn (\"%02d:%02d:%02d\" % [h, m, s])\n\tend", "title": "" }, { "docid": "2f2724000ad03319482c148a91bd2576", "score": "0.57211864", "text": "def format\n puts \"-\" * 60\n end", "title": "" }, { "docid": "bee7e3115ef365f107937469ccc0a8cc", "score": "0.57196295", "text": "def closing(day)\n Time.now.utc.midnight\n .advance(seconds: closing_second(day)).strftime('%H:%M')\n end", "title": "" }, { "docid": "fe61443f0420befd3f9ca90d941b66c4", "score": "0.571528", "text": "def time_string\n\n\t\thours = @seconds/3600 #if not an hour will be stored as 0\n\t\tremainder = @seconds%3600 #modulo gives the amount that remains\n\t\tsprintf(\"%02d:%02d:%02d\", hours, remainder/60, remainder%60) #string formatting\n\t\t\n\tend", "title": "" }, { "docid": "9f4c5ef4cb45e78e12ed40262249bc77", "score": "0.5700677", "text": "def to_s\n \"#{hour.to_s.rjust(2, '0')}:#{minute.to_s.rjust(2, '0')}\"\n end", "title": "" }, { "docid": "e880b52c0bec24ae4c2443299c2841dc", "score": "0.56993854", "text": "def end_at\n super.in_time_zone(time_zone) if super && time_zone\n end", "title": "" }, { "docid": "81c990ef2ad02d0f6bbf01d20d5b3417", "score": "0.56843984", "text": "def display_duration_minutes\n if duration_minutes >= 60\n hour_value = duration_minutes / 60\n minutes_value = duration_minutes.remainder(60)\n\n return \"#{hour_value} #{'hour'.pluralize(hour_value)}\" if minutes_value.zero?\n\n \"#{hour_value} #{'hour'.pluralize(hour_value)} #{duration_minutes.remainder(60)} minutes\"\n else\n \"#{duration_minutes} minutes\"\n end\n end", "title": "" }, { "docid": "df7c260f185881dc4f47bfe313a06d6b", "score": "0.5679885", "text": "def day_and_time(minutes)\n day = MIDNIGHT + (minutes * 60)\n day.strftime(\"%A, %H:%M\")\nend", "title": "" }, { "docid": "e09cafab349e6d72d42d48f2b2d954f5", "score": "0.5675947", "text": "def pretty_time_range\n self.start_time.strftime(\"%a, %b %e, %Y from %l:%M %p to\") + self.end_time.strftime(\" %l:%M %p\")\n end", "title": "" }, { "docid": "b1ff96deae30603800534fc015c076d3", "score": "0.5668259", "text": "def show_end_date(event)\n #if (((event.end_at).to_s).slice(0..9)).to_i < (((DateTime.now).to_s).slice(0..9)).to_i\n if event.end_at - 2.hours< DateTime.now\n \"<strong><em>and closed.</em></strong>\".html_safe\n else\n event.end_at.to_formatted_s(:short)\n end\n end", "title": "" }, { "docid": "96420f35d49d75a89ff9d3a7b9853c53", "score": "0.5652745", "text": "def end_date\n start_date + (duration * 60)\n end", "title": "" }, { "docid": "f8a1ffd8149427c48e0d439a3335bf09", "score": "0.5643719", "text": "def get_time(integer_time_slot)\n\t\tif integer_time_slot > 60 * 12\n\t\t\tinteger_time_slot = integer_time_slot - 60 * 12\n\t\t\tminutes = integer_time_slot % 60\n\t\t\tminutes = if minutes < 10 then \"0#{minutes}\" else \"#{minutes}\" end\n\t\t\t(integer_time_slot / 60).to_s + \":\" + minutes + \" PM\"\n\t\telse\n\t\t\tminutes = integer_time_slot % 60\n\t\t\tminutes = if minutes < 10 then \"0#{minutes}\" else \"#{minutes}\" end\n\t\t\t(integer_time_slot / 60).to_s + \":\" + minutes + \" AM\"\n\t\tend\n\tend", "title": "" }, { "docid": "55794c00f753967ad329f49d63d82cad", "score": "0.564243", "text": "def hour_12\n self.strftime(\"%I:%M %p\")\n end", "title": "" }, { "docid": "55794c00f753967ad329f49d63d82cad", "score": "0.564243", "text": "def hour_12\n self.strftime(\"%I:%M %p\")\n end", "title": "" }, { "docid": "55e6e89c9810a92f16a95fc28bff85c1", "score": "0.564177", "text": "def to_s\n \"%02d:%02d:%02d\" % [@hour, @minute, @second]\n end", "title": "" }, { "docid": "4667e89fa4af31ddd582c2ba168c581b", "score": "0.56306493", "text": "def formatted_duration\n hours = self.duration / 60\n minutes = self.duration % 60\n if minutes == 0\n \"#{hours}h\"\n else\n \"#{hours}h#{minutes}min\"\n end\n end", "title": "" }, { "docid": "91d4cf6907b2c5f189761970b66f4a50", "score": "0.5627613", "text": "def time_string\n hours = @seconds / 3600\n minutes = (@seconds % 3600) / 60\n secs = (@seconds % 3600) % 60\n \n sprintf(\"%02d:%02d:%02d\", hours, minutes, secs)\n end", "title": "" }, { "docid": "f32bdde446b67187d6568deec0bb791f", "score": "0.56273305", "text": "def get_starttime(timeslot)\n return timeslot.starttime.strftime(\"%I:%M\")\nend", "title": "" }, { "docid": "8ff8129bc041056068b4b310aa90d5ec", "score": "0.56263995", "text": "def time\n result = veeamconfig('schedule', 'show', '--jobId', get_job_id).lines\n # get the time\n t = result[1].strip.split(': ')[1]\n # split hours and minutes (will use these to pad first)\n bits = t.split(':')\n # pad both the hour and the minute with a zero if needed\n bits[0] = \"%02d\" % bits[0]\n bits[1] = \"%02d\" % bits[1]\n\n # return the joined value (HH:MM)\n bits.join(':')\n end", "title": "" }, { "docid": "190c638978b6d918c6ce0f5a2d733915", "score": "0.5622617", "text": "def time_conversion(minutes)\n hours, minutes = minutes.divmod(60)\n minutes = ('0' + minutes.to_s)[-2, 2]\n \"#{hours}:#{minutes}\"\nend", "title": "" }, { "docid": "2556e3f5a0e76eb852069196c268eb25", "score": "0.5613576", "text": "def in_standard_time\n self.strftime(\"%I:%M %P\")\n end", "title": "" }, { "docid": "760f7a65210fa0b7cde341e45cd0fbc4", "score": "0.5606663", "text": "def rational_hour(seconds); end", "title": "" }, { "docid": "88c865a4ed7d3852d7f8bbc29ad5e75f", "score": "0.5589388", "text": "def render_time_span event\n\t\t# return time.strftime(\"%c\")\n\t\ts = render_date( event.starts_at ) + ' ' + render_time( event.starts_at );\n\t\ts << ' <span class=\"slash\">/</span> '\n\t\tif event.ends_at\n\t\t\tif event.starts_at.month == event.ends_at.month and event.starts_at.year == event.ends_at.year\n\t\t\t\ts << render_time( event.ends_at )\n\t\t\telse\n\t\t\t\ts << render_date( event.ends_at ) + ' ' + render_time( event.ends_at )\n\t\t\tend\n\t\telse\n\t\t\ts << \"N/A\"\n\t\tend\n\t\t\n\t\treturn s.html_safe;\n\tend", "title": "" }, { "docid": "8d1b67491cc79c35addefef3c462aab6", "score": "0.5580788", "text": "def format_time\n hours = format_hour @hour\n minutes = format_minute @minutes\n ampm = @hour < 12 ? @@ampm_hash['a'] : @@ampm_hash['p']\n time = ''\n time += hours[0] + minutes[0] + ' ' + ampm[0] + \"\\n\"\n time += hours[1] + minutes[1] + ' ' + ampm[1] + \"\\n\"\n time += hours[2] + minutes[2] + ' ' + ampm[2] + \"\\n\"\n time\n end", "title": "" }, { "docid": "9c53433df66a549e5d51e54da0a70a04", "score": "0.55792415", "text": "def time_of_day(input_minutes)\n if input_minutes < 0\n results = input_minutes.divmod(60)\n hours, minutes = (24 + results[0]), results[1]\n hours = hours % 24\n else\n hours, minutes = input_minutes.divmod(60)\n hours = hours % 24\n end\n format(\"%02d:%02d\",hours,minutes)\nend", "title": "" }, { "docid": "78beb91a5023261a7fc78e3174f04ed4", "score": "0.55766237", "text": "def current_end_time\n self.ends_at = DateTime.current\n save\n end", "title": "" }, { "docid": "f4247b3a867456ac6dbf7e997f9b212c", "score": "0.5575937", "text": "def in_international_time\n self.strftime(\"%H:%M\")\n end", "title": "" }, { "docid": "68c5964b3a12637dce771dec49a68ec8", "score": "0.5558127", "text": "def format_time_from_hour hour\n hrs = hour.to_i\n min = ((hour - hrs) * 60.0 + 0.5).to_i\n \"%2d:%02d\" % [hrs, min]\n end", "title": "" }, { "docid": "bebb6c4fc34d38b5c2783471e6f0fc62", "score": "0.5556834", "text": "def format_start(start_time)\n start_time.strftime('%H:%M')\n end", "title": "" }, { "docid": "468b3d4c2f8ca30a6781f061231c8ce7", "score": "0.5555712", "text": "def segment_ends_s\n [from_end.to_s, to_end.to_s].join(\"---\")\n end", "title": "" }, { "docid": "468b3d4c2f8ca30a6781f061231c8ce7", "score": "0.5555712", "text": "def segment_ends_s\n [from_end.to_s, to_end.to_s].join(\"---\")\n end", "title": "" }, { "docid": "7049e9015d2b4e23820748e25b9de414", "score": "0.55525655", "text": "def process_end_time\n if event_params[\"end_time(2i)\"].length == 1\n end_month = \"0\" + event_params[\"end_time(2i)\"]\n else\n end_month = event_params[\"end_time(2i)\"]\n end\n \n # -0600 represents the default timezone of CST\n end_time = event_params[\"end_time(1i)\"] + end_month + event_params[\"end_time(3i)\"] + \"T\" +\n event_params[\"end_time(4i)\"] + \":\" + event_params[\"end_time(5i)\"] + \"-0600\"\n begin\n return DateTime.strptime(end_time, '%Y%m%dT%H:%M%z')\n rescue ArgumentError\n flash[:error] ||= \"End date doesn't exist\"\n return nil\n end\n end", "title": "" }, { "docid": "f30b4c6db4a379029df8a03cf2b9ed72", "score": "0.55521774", "text": "def end_of_minute\n change(\n sec: 59,\n usec: Rational(999999999, 1000)\n )\n end", "title": "" }, { "docid": "2c201dd1f5e39640a4ef662b41cf6b2b", "score": "0.5551573", "text": "def get_route_duration\n return duration.div(3600)+\"Stunden\"+(duration % 60)+ \"Minuten\" \n end", "title": "" }, { "docid": "57da47d9bb57782909a5412b2f8ef03e", "score": "0.55513805", "text": "def time_conversion(minutes)\n hours = 0\n\n while minutes >= 60\n hours = hours + 1\n minutes = minutes - 60\n end \n \n if minutes < 10\n minutes_string = \"0\" + minutes.to_s \n else \n minutes_string = minutes.to_s\n end\n \n return hours.to_s + \":\" + minutes_string\n \nend", "title": "" }, { "docid": "2998aa86abf50e62483a5cc0e3f01491", "score": "0.55481356", "text": "def end_time\n\t\tstart + 1.day\n\tend", "title": "" } ]
41cc678428b4614e51fd0fb3a152b95e
save order? 1. save frequency for each character 2. iterate freq if count is one return key
[ { "docid": "f6be6a0bdd4b6a21eea8083269c4ae0b", "score": "0.66338944", "text": "def non_repeating(s)\n freq = Hash.new\n\n # 1) save frequency for each character\n for i in 0...(s.length)\n char = s[i]\n if freq[char].nil?\n freq[char] = 1\n else\n freq[char] += 1\n end\n end\n\n # 2) iterate freq if count is one return key\n freq.each do |key, value|\n return key if value == 1\n end\n\n return nil\nend", "title": "" } ]
[ { "docid": "7c5d87bf06b7329476ba39ff3f12b15a", "score": "0.75526834", "text": "def char_frequency\n hits = {}\n self.each_byte {|c| hits[c.chr] ||= 0; hits[c.chr] += 1 }\n hits.to_a.sort {|a,b| b[1] <=> a[1] }\n end", "title": "" }, { "docid": "3a2764f2b92cc334ee06475846451f88", "score": "0.74564475", "text": "def char_frequency\n hits = {}\n self.each_byte {|c| hits[c.chr] ||= 0; hits[c.chr] += 1 }\n hits.to_a.sort {|a,b| b[1] <=> a[1] }\n end", "title": "" }, { "docid": "93c739dde8118a1559b790d8a5373b21", "score": "0.7364415", "text": "def build_freqs str\n # Build hash of byte => count\n counts = Hash.new 0\n str.each_byte { |byte| counts[byte.chr] += 1 }\n\n # Build SortedSet of [freq, byte] pairs (lower freqs first).\n freqs = SortedSet[]\n counts.each { |bc| freqs << bc.reverse }\n freqs\nend", "title": "" }, { "docid": "55aec127677b8b589a80833296027552", "score": "0.73219526", "text": "def frequent_letters(str)\n count = Hash.new(0)\n frequent = []\n str.each_char do |char|\n count[char] += 1\n end\n\n count.each do |key, val|\n if val > 2\n frequent.push(key)\n end\n end\n return frequent\nend", "title": "" }, { "docid": "0ecf29e26ef12ee4cf36df803804f3b3", "score": "0.731625", "text": "def frequency_analysis\n letters = {}\n @input.each_byte { |x|\n if !letters[x].kind_of?(Fixnum)\n letters[x] = 0\n end\n letters[x] = letters[x] + 1\n }\n max, index = 0, 0\n letters.each { |item| \n if item[1] > max\n max = item[1]\n index = item[0]\n end\n }\n ' '.ord - index\n end", "title": "" }, { "docid": "2893727ac458fe6369d17771ea8cc732", "score": "0.72130316", "text": "def frequency(t) \n counts = Hash.new(0)\n t.each_char { |c| counts[c] += 1 } \n \" \".ord - counts.sort{ |a,b| b[1] <=> a[1]}.first[0].ord \n end", "title": "" }, { "docid": "33d47564dbbb150399880e5ea65c33a6", "score": "0.7200443", "text": "def frequent_letters(str)\n hash = Hash.new(0)\n res_arr = []\n str.each_char{|char| hash[char] += 1}\n hash.each{|k, v| res_arr << k if v > 2}\n res_arr\nend", "title": "" }, { "docid": "51abbf6551eb5a732899e807168265fb", "score": "0.7194808", "text": "def frequent_letters(string)\n\n # step 2 : new box {}\n counter = Hash.new(0) # # counter = {} with default value '0'\n # step 1 : iteration check\n string.each_char do |char|\n # step 3 : add 1 increment \n # counter[char] += 1 \n counter[char] += 1\n end\n # return counter\n # {\"m\"=>1, \"i\"=>4, \"s\"=>4, \"p\"=>2}\n # {\"b\"=>1, \"o\"=>2, \"t\"=>1, \"c\"=>1, \"a\"=>1, \"m\"=>1, \"p\"=>1}\n\n new = []\n counter.each do |k, v|\n\n if v > 2\n new << k\n end\n\n end\n return new\n\nend", "title": "" }, { "docid": "4b5f7fec43addd5c159af3461d9bc2ab", "score": "0.7186483", "text": "def frequency\n\t\tstr = self.dup.to_str\n\n\t\t# Create hashtable to store results\n\t\tfreq = Hash.new\n\t\tclean_text = str.gsub(/\\W/, ' ').downcase\n\t\tclean_text.split.each do |w|\n\t\t\tstem = w.to_stem \n\t\t\tfreq[stem] = freq.has_key?(stem) ? freq[stem]+1 : 1\n\t\tend\n\n\t\t# sort by descending order, then by alphabetical order\n\t\tfreq.sort_by { |k,v| [-v, k] }\n\tend", "title": "" }, { "docid": "3bc149c2e3424dcf95189d9a646585bd", "score": "0.71857136", "text": "def character_frequency str\n hash_var = Hash.new(0)\n str.split(\"\").map{ |ele| hash_var[ele] += 1 }\n return hash_var\nend", "title": "" }, { "docid": "ae67b0c3452448af199b00230e6d0e6b", "score": "0.71736825", "text": "def frequency_sort(s)\n freq_string = \"\"\n letter_counts = Hash.new(0)\n\n s.each_char do |ch|\n letter_counts[ch] += 1\n end\n\n desc_counts = letter_counts.sort_by { |k, v| v }.reverse\n\n desc_counts.each do |letter_pair|\n freq_string += (letter_pair[0] * letter_pair[1])\n end\n\n freq_string\nend", "title": "" }, { "docid": "4a6a9097d0ff493855cca77d237b2d62", "score": "0.71714973", "text": "def frequent_letters(string)\n count_hash = Hash.new(0)\n frequent_arr = []\n string.each_char do |char|\n count_hash[char] += 1\n end\n count_hash.each_pair do |key, value|\n if value > 2\n frequent_arr << key\n end\n end\n return frequent_arr\nend", "title": "" }, { "docid": "297390ba05d92faf4186ef9481231099", "score": "0.7120868", "text": "def frequent_letters(string)\n counter = Hash.new(0)\n arr=[]\n string.each_char { |char| counter[char] += 1 }\n\n s = counter.sort_by { |k,v| v }\n s.each do |el|\n if el[1] > 2\n arr << el[0]\n end\n end\n return arr\nend", "title": "" }, { "docid": "f844ce530874df2411e94de322a65e2e", "score": "0.7112974", "text": "def char_freq(str)\n freqs = Hash.new(0)\n (1..4).each do |i|\n str.chars.each_cons(i).inject(freqs) do |freq, ngram|\n ngram = ngram.join\n freq[ngram] = freq[ngram] + 1\n freq\n end\n end\n freqs\n end", "title": "" }, { "docid": "8c5c6edd9ed338cf4c0e60e64b9e2563", "score": "0.7102108", "text": "def frequent_letters(string)\n count_hash = letter_count(string)\n frequent_arr = []\n count_hash.each do |key_char, val|\n if val > 2\n frequent_arr << key_char\n end\n end\n return frequent_arr\nend", "title": "" }, { "docid": "66ef7992823ee00c326e72f2e71bb0a9", "score": "0.7054074", "text": "def frequent_letters(string)\n count_hash = Hash.new(0)\n multiples_arr = []\n\n string.each_char do |char| # counts occurences of each char\n count_hash[char] += 1\n end\n\n # return count_hash\n\n count_hash.each do |key, value|\n if value > 2\n multiples_arr << key\n end\n end\n\n return multiples_arr\nend", "title": "" }, { "docid": "bfeaebfaccbf8ed14e3da3ba2d7b6382", "score": "0.7053017", "text": "def frequent_letters(string)\n count = Hash.new(0)\n string.each_char { |char| count[char] += 1}\n\n frequents = []\n count.each do |char, num|\n if num > 2\n frequents << char\n end\n end\n\n return frequents\nend", "title": "" }, { "docid": "5c2898c27473bd0567dcab82077f739d", "score": "0.70273775", "text": "def get_letter_freq(str)\n freq = Hash.new(0)\n str.chars.each{|ch| freq[ch] += 1}\n freq\nend", "title": "" }, { "docid": "bb01be887ddbdeb51a765e1bde63968d", "score": "0.70140827", "text": "def print_frequency\n hash = Hash.new(0)\n @dictionary.each {|word| hash[word[0]] += 1}\n puts \"First letter frequency -\"\n print hash\n end", "title": "" }, { "docid": "86e77e9e4ced0a6362690ceeb0f999cb", "score": "0.7011549", "text": "def freq \n k = Hash.new(0)\n self.each { |x| k[x] += 1 }\n return k\n end", "title": "" }, { "docid": "7752d3c9109d4596053288192a019ce3", "score": "0.69913167", "text": "def frequencies(string)\n result = Hash.new { |h, k| h[k] = 0 }\n string.chars.each { |char| result[char] += 1 }\n result\nend", "title": "" }, { "docid": "beb52ec2025b5e4f1abc9dda4e60c86c", "score": "0.698907", "text": "def frequencies(string)\n # split the string\n cool_wordz = string.split(\" \")\n # create hash that is empty add symbols\n cool_hash = Hash.new(0)\n # iterate through #each method on each word\n cool_wordz.each do |word|\n # within the each word add the same word to a counter\n cool_hash[word] += 1\n end\n # return hash map\n cool_hash\nend", "title": "" }, { "docid": "bcfba289156fe84bf5e7d6368ac6146e", "score": "0.6986118", "text": "def frequent_letters(string)\n count = Hash.new(0)\n most_common = []\n\n string.each_char { |letter| count[letter] += 1 }\n\n count.each { |k,v| most_common << k if v > 2 }\n\n return most_common\nend", "title": "" }, { "docid": "86fe60c9f13272d74675dd37f806ab2b", "score": "0.6984813", "text": "def getFrequencyDict(sequence)\n\tfreq = {}\n\tfreq.default = 0\n\tsequence.each_char { |letter| freq[letter] += 1 }\n\tfreq\nend", "title": "" }, { "docid": "7df4a52c31690bd01209b7b771c1ea4e", "score": "0.69649464", "text": "def frequent_letters(string)\n count = []\n freq = Hash.new(0)\n string.each_char { |char| freq[char] += 1 }\n\n freq.each do |k, v|\n count << k if v > 2\n end\n count\nend", "title": "" }, { "docid": "52d146bfba0259c10d9d34f1d9b3aa14", "score": "0.6963408", "text": "def frequent_letters(string)\n arr = []\n counter = Hash.new(0)\n string.each_char do |char|\n counter[char] += 1\n end\n counter.each do |key, value|\n if value > 2\n arr << key\n end\n end\n return arr\nend", "title": "" }, { "docid": "e40107219e051e30a966b5fdb9241c00", "score": "0.69593745", "text": "def count_frequencies(char_arr)\n counts = Hash.new 0\n char_arr.each { |char| counts[char] += 1 }\n counts.sort { |a, b| b[1] <=> a[1] }\n end", "title": "" }, { "docid": "b7ea3935b20fe52cfeaa1fb8023b5666", "score": "0.6937373", "text": "def duplicate_count (text)\n letter=text.downcase.split(//)\n frequencies = Hash.new(0)\n letter.each do |letter|\n frequencies[letter]+=1\n end \n \nfrequencies = frequencies.sort_by do | frequencies, count|\ncount\nend \nfrequencies.each do |letter, count|\n if count > 2\n counter +=1\n return counter\nend \nprint frequencies\nend\nend", "title": "" }, { "docid": "660b3983137eef9d1aa2d0b60a0fb9aa", "score": "0.6927109", "text": "def most_frequent_letter(string)\n hash = Hash.new(0)\n array = string.split(\"\")\n array.each do |letter|\n if letter != \" \"\n hash[letter] += 1\n end\n end\n hasher = hash.sort{|a,b| a[1] <=> b[1]}.last[0]\n return hasher\n \nend", "title": "" }, { "docid": "a29046e40076426df6cf463c769db82b", "score": "0.69210386", "text": "def freq_map(string)\n words = {}\n string.split(\" \").each do |word|\n if words.key?(word)\n words[word] += 1\n else\n words.store(word, 1)\n end\n end\n\n words\nend", "title": "" }, { "docid": "2924e29fb3d981cc68312fb2e6f1f03d", "score": "0.69178295", "text": "def frequent_letters(string)\n count = Hash.new(0)\n string.each_char do |char|\n count[char] +=1\n end \n\n arrayL = []\n count.each do |ele,num|\n if num >2\n arrayL << ele\n end \n end \n return arrayL\nend", "title": "" }, { "docid": "9db99f78460747f2551b9b75d0923b06", "score": "0.6903517", "text": "def frequent_letters(string)\n arr = []\n\n count = Hash.new(0)\n string.each_char { | char | count[char] += 1 }\n\n count.each do | k, v |\n if v > 2\n arr << k\n end\n end\n\n return arr\nend", "title": "" }, { "docid": "195caf4dc6ec80f923eefcbeb61c53d0", "score": "0.6887738", "text": "def most_frequent_bigram(str)\n frequency_counter = Hash.new(0)\n i = 0\n j = i+1\n while j < str.length\n frequency_counter[str[i]+str[j]] += 1\n i += 1\n j = 1+j\n end\n frequency_counter.max_by { |k,v| v}[0]\nend", "title": "" }, { "docid": "29817ea216e19f343ed76ebf0ae57731", "score": "0.6882868", "text": "def frequent_letters(string)\r\n letters = Hash.new(0)\r\n string.each_char {|char| letters[char] += 1}\r\n frequentLetters = []\r\n letters.each {|key, val| if val > 2 then frequentLetters << key end}\r\n return frequentLetters\r\nend", "title": "" }, { "docid": "cc2583101f265d23ecca23a32afea0fc", "score": "0.68777704", "text": "def character_frequencies(string)\n char_counts = Hash.new(0)\n\n #count each char in lowercase\n string.each_char do |c|\n char_counts[c.downcase] += 1\n end\n\n pp char_counts\n #Sort the chars by letters alphabetically\n sorted_chars = char_counts.sort_by { |k, v| }\n\n pp sorted_chars\n #Setup output\n sorted_chars.map { |c| \"(#{c[0]},#{c[1]})\" }.join(',')\nend", "title": "" }, { "docid": "6128b073e77ca5c0f31c1b1b83b78ab3", "score": "0.6838786", "text": "def letter_frequency(text)\n alphabet = (\"a\"..\"z\").to_a\n letter_to_freq = Hash.new(0)\n text.downcase.chars.each { |element| letter_to_freq[element] += 1 if alphabet.include?(element) }\n letter_to_freq.sort { |arr1, arr2| (arr2.last <=> arr1.last) == 0 ? (arr1.first <=> arr2.first) : (arr2.last <=> arr1.last) }\nend", "title": "" }, { "docid": "2c3baa1ea0183567526b5db5067c0f21", "score": "0.6835595", "text": "def freq_table(data)\n\n freq_table = {}\n x = NONWORD\n y = NONWORD\n\n data.each do |word|\n (freq_table[\"#{x} #{y}\"] ||= []) << word\n x = y\n y = word\n end\n\n (freq_table[\"#{x} #{y}\"] ||= []) << NONWORD\n\n freq_table\n\nend", "title": "" }, { "docid": "46e1ec94a80536f613ec5e371c8089dc", "score": "0.6831433", "text": "def frequency_sort(s)\n char_hash = {}\n\n s.each_char do |char|\n if char_hash[char]\n char_hash[char] += 1\n else\n char_hash[char] = 1\n end\n end\n\n result = ''\n char_hash.sort_by { |k, v| -v }.each do |char, char_count|\n char_count.times do\n result << char\n end\n end\n\n result\nend", "title": "" }, { "docid": "cabb0116758818e7950b7419ade95ebe", "score": "0.68128616", "text": "def frequent_letters(string)\n count_hash = Hash.new(0)\n string.each_char do |char|\n count_hash[char] += 1\n end\n # Now we have a hash with all the letters and how many times they showed up.\n alpha = (\"a\"..\"z\")\n frequent_arr = []\n count_hash.each_pair do |key, val|\n if val > 2 && alpha.include?(key.downcase)\n frequent_arr << key\n end\n end\n return frequent_arr\nend", "title": "" }, { "docid": "31b292a70b54766ea77dfe14fca6d615", "score": "0.6809549", "text": "def character_frequency(string)\n unsorted = convert_to_data_structure( create_string_hash(string) )\n\n unsorted.sort do |arr1, arr2|\n result = 0\n if arr1[1] > arr2[1]\n result = -1\n elsif arr1[1] < arr2[1]\n result = 1\n elsif arr1[0].ord < arr2[0].ord\n result = -1\n else\n result = 1\n end\n result\n end\nend", "title": "" }, { "docid": "c1719ca0933104eae98d528c47d0e8e8", "score": "0.68090034", "text": "def get_frequencies(word) \n array = word.split(//) #take input, split to letters\n freq = Hash.new \n for i in 0..array.length-1 #counts each letter, adding to array[1]\n if freq[array[i]] == nil\n freq[array[i]] = 1\n else\n freq[array[i]] = freq[array[i]] +1\n end\n end\n return freq #hash containing key \"letter\" value \"number\"\nend", "title": "" }, { "docid": "48f744d1398c44272e9155b37607c0df", "score": "0.6800171", "text": "def frequent_letters(string)\n count = Hash.new(0)\n\n new_array = []\n string.each_char do |char|\n count[char] += 1\n end\n count.each do |char,num|\n if num > 2\n new_array << char\n end\n end\n new_array\nend", "title": "" }, { "docid": "dbe718bc6d949c409f315cd5a7a9ef14", "score": "0.67907184", "text": "def password_from_lowest_freq_letters(input)\n freq_counts = process_input(input)\n\n password = []\n\n freq_counts.each do |counter|\n counter.delete(:most_frequent)\n values = counter.values\n values.delete(0)\n password << counter.key(values.min)\n end\n\n password.join\nend", "title": "" }, { "docid": "a43d497d2114505e2b259c4bc41d53b2", "score": "0.6783985", "text": "def freq str, string=nil\n hsh = Hash.new(0)\n ary = str.split(/\\W+/)\n ary.each do |word|\n hsh[word] += 1\n end\n return hsh[string] if string != nil\n return hsh\nend", "title": "" }, { "docid": "b045af73a4924572841eff7014b7f62f", "score": "0.67751354", "text": "def build_frequencies phrase\n phrase.downcase.split(//).inject(Hash.new(0)) do |hash,item|\n hash[item] += 1\n hash\n end\n end", "title": "" }, { "docid": "3bd296c999224741299ab4b721dc9625", "score": "0.67657185", "text": "def frequent_letters(string)\n\tarry = string.split(\"\")\n \tfinal = []\n \thash = Hash.new(0)\n arry.each do |letter|\n letter.each_char { |i| hash[i] += 1}\n end\n hash.each do |k, v|\n if v > 2\n final << k\n end\n end\n return final\nend", "title": "" }, { "docid": "a1eb407515223e330f2c31308377d150", "score": "0.6756445", "text": "def build_frequencies(phrase)\n frequency = Hash.new(0)\n phrase.downcase.split(//).each { |char| frequency[char] += 1 }\n\n frequency\n end", "title": "" }, { "docid": "681e151de487eb762c8f668608405c4f", "score": "0.6751258", "text": "def freq(str)\n arr = str.split(\" \") # splits the string, by spaces, into an array\n\n # Method 1\n hash = {}\n\n arr.each {|x|\n if hash[x] then\n hash[x] = hash[x] + 1\n else\n hash[x] = 1\n end\n }\n\n # Method 2\n #\n # Default value allows us to avoid that conditional\n #\n # hash = Hash.new(0)\n #\n # arr.each {|x|\n # hash[x] = hash[x] + 1\n # }\n #\n\n arr\nend", "title": "" }, { "docid": "4f32a0fce70d0f951d8ddfe5105ed3b4", "score": "0.6721907", "text": "def frequency()\n\t#basic idea: iterate though array of words, look up each word in hash. \n\tdictionary = Hash.new\n\t@words = @file.split\n\[email protected]{ |word|\n\t\t#if exists, add 1 count.\n\t\t#if not exist, create the tuple.\n\t\tif dictionary[word] == nil then\n\t\t\t#puts \"word is empty\"\n\t\t\tdictionary[word] = 1\n\t\telse\n\t\t\tdictionary[word] = dictionary[word]+1\n\t\tend\n\t}\n\n\treturn dictionary\n end", "title": "" }, { "docid": "461827ea6d53cc3cf344cf4b8d921da3", "score": "0.67215806", "text": "def mode(array)\n frequencies = Hash.new(0)\n array.each { |word| frequencies[word] += 1}\n most_freq_word = []\n frequencies.each { |key, value|\n if value == frequencies.values.max\n most_freq_word.push(key)\n end\n }\n #return most_freq_word\n\nend", "title": "" }, { "docid": "5e7db79e3da44acd495dcc2e5792b653", "score": "0.67109877", "text": "def frequencies(words)\n Hash[\n words.group_by(&:downcase).map{ |word,instances|\n [word,instances.length]\n }.sort_by(&:last).reverse\n ]\nend", "title": "" }, { "docid": "6397bd3f882e7a1d129c7008d1915f74", "score": "0.6708036", "text": "def most_frequent_bigram(str)\n #create hash key = bigram, value = occurrences\n #return key with highest value\n biHash = {}\n\n (0...str.length-1).each do |char|\n #check if the hash contains the char\n #if the hash does not contain the char add it\n #if exists increment value ++\n letter = str[char] + str[char+1]\n if biHash.has_key?(letter)\n biHash[letter] += 1\n else\n biHash[letter] = 1\n end\n end\n\n #return key of highest value\n biHash.key(biHash.values.max)\nend", "title": "" }, { "docid": "ef08fd1dfde0fa03d8171f72e3f6904f", "score": "0.6706793", "text": "def most_frequent_characters(values)\n matches = {}\n values.each { |value| value.frequency(matches) }\n\n # Gather the results into arrays and sort them by frequency descending\n chars = matches.collect { |char, count| [char, count] }.sort_by { |char, count| count }\n chars.collect! { |char, count| char }\n chars.reverse!\n\n chars\n end", "title": "" }, { "docid": "a56a6c0dc6db2a5f9bc4154a90947c24", "score": "0.6686741", "text": "def most_frequent_bigram(str)\n counter = Hash.new(0)\n final_count = str[0..1]\n (0...str.length).each do |idx|\n counter[str[idx..idx+1]] += 1\n end\n\n counter.each do |k,v|\n if counter[k] > counter[final_count]\n final_count = k\n end\n end\n\n return final_count\n\n\nend", "title": "" }, { "docid": "20ecbbf32f1d3200f78c15c1bac24f5f", "score": "0.6677987", "text": "def most_frequent_bigram(str)\n arr = []\n hsh = Hash.new(0)\n\n (0...str.length-1).each do |idx| \n arr << str[idx..idx+1]\n end\n arr.each do |ele| \n hsh[ele] += 1 \n end\n hsh.sort_by { |k,v| v }.last.first\nend", "title": "" }, { "docid": "d5969f8b9f9b5c3b03ffd870d9e54d30", "score": "0.6668256", "text": "def nonunique_chars(word)\n frequency = {}\n word.each_char do |letter|\n if frequency[letter] #letter is already stored,\n frequency[letter] = frequency[letter] + 1\n else\n frequency[letter] = 1\n end\n end\n\n dupes = frequency.select do |key, value|\n value > 1\n end\n\n dupes.keys.join\n\n puts dupes.inspect\n\nend", "title": "" }, { "docid": "c7ec1ea45e5c88b3b910067627b245c3", "score": "0.6667339", "text": "def word_freq(string)\n words = string.gsub(/[\".,:;!?\", \" \"]/, ' ').split\n table = Hash.new\n \n for i in 0..words.size - 1 do\n freq = 1\n for j in 0..words.size - 1 do\n \n #count all matches regardless of case\n if(words[i].casecmp(words[j]) == 0 && i != j)\n freq = freq + 1 \n end\n end\n \n #check if the same word is already in the table before adding it\n #ignoring case\n is_duplicate = 0\n table.each do |key, id|\n if(key.casecmp(words[i]) == 0)\n is_duplicate = 1\n end\n end\n \n #if it is not in the table already, add it in \n if(is_duplicate == 0)\n table[words[i]] = freq\n end\n end\n return table\nend", "title": "" }, { "docid": "04f66bfb725642da78831320dc5c8011", "score": "0.66651255", "text": "def more_than_once(string)\n # Write your code \n # solution 1\n # arr = string.split\n # frequency = {}\n # arr.each do |el| \n # frequency[el] ||= 0\n # frequency[el] += 1\n # end\n # result = []\n # frequency.each do |char, num|\n # if num > 2\n # result << char\n # end\n # end\n # return result\n\n # solution 2\n\n # arr = string.split\n # frequency = {}\n # arr.each do |el| \n # frequency[el] ||= 0\n # frequency[el] += 1\n # end\n # result = []\n # frequency.select { |char, num| num > 2 }\n # return frequency.keys\n\nend", "title": "" }, { "docid": "aeb898ee99e4b30cf18703e285df31a4", "score": "0.6660748", "text": "def letter_frequency(text) \n answer = text.downcase.gsub(/[^a-z]/,\"\")\n .split(\"\").each_with_object(Hash.new(0)) { |item, hash| hash[item] += 1 }\n .sort_by {|word, freq| [-freq, word] }.to_a\nend", "title": "" }, { "docid": "47a43786bbf35eb8a5f70346c1736a38", "score": "0.66419876", "text": "def most_frequent_letters(msg)\n letter_frequencies(msg)\n .map { |count| count[0] }\n end", "title": "" }, { "docid": "631b533d5a1e9d31ca4679b16d5534d0", "score": "0.66258496", "text": "def mode(array)\n frequencies = Hash.new(0)\n array.each { |word| frequencies[word] += 1 }\n most_freq_word = []\n frequencies.each { |key, value|\n if value == frequencies.values.max\n most_freq_word << key\n end\n }\n most_freq_word.sort\nend", "title": "" }, { "docid": "7f8cbc6aaf24a87e71c1cd5ff8e14707", "score": "0.66190183", "text": "def freq\n @freq.upcase\n end", "title": "" }, { "docid": "d1fef03bd12f798d6111455679a632cd", "score": "0.6608954", "text": "def freq_count(arr)\n arr.inject(Hash.new(0)) { |freqs, word| freqs[word] += 1; freqs }\n end", "title": "" }, { "docid": "dea2b1a967c048ffbbce89cc32c1079e", "score": "0.66009426", "text": "def frequencies\n\n for w in $words\n keys = $word_freqs.map { |wd| wd[0] }\n if keys.include? w\n $word_freqs[keys.index(w)][1] += 1\n else\n $word_freqs.append([w, 1])\n end\n end\nend", "title": "" }, { "docid": "0888fce52b5ca5fc097fe3000ce2611b", "score": "0.6591517", "text": "def symbol_frequency\n freq = Hash.new(0)\n @text.scan(/[^a-zA-Z0-9]/).each { |word| freq[word] += 1 }\n freq\n end", "title": "" }, { "docid": "b14bdc77ff8d41262b50f76cc3781179", "score": "0.6588499", "text": "def most_frequent_bigram(str)\n i=0\n var = ''\n arr =[]\n new_hash = {}\n hash =Hash.new(0)\n (0...str.length-1).each do |i|\n var = str[i] + str[i+1]\n arr << var\n end\n arr.each do |ele|\n hash[ele]+=1\n end\n new_hash = hash.sort_by {|k, v| v}\n return new_hash[-1][0]\nend", "title": "" }, { "docid": "5b2298706c77fe01829b192d18b5e629", "score": "0.6576439", "text": "def beginning_letter_counts arr\n # create a new hash, for which each value will be initialized to zero\n counts = Hash.new 0\n\n # increment each letter key-value pair for each animal with corresponding letter\n arr.each{|animal| counts[animal[0]] += 1}\n\n # prepare a printable string\n count_str = counts.to_s.gsub(\", \", \"\\n\")[1..-2]\n\n puts \"Here are the beginning letter frequency of all of the animals:\\n#{count_str}\"\nend", "title": "" }, { "docid": "5b2298706c77fe01829b192d18b5e629", "score": "0.6576439", "text": "def beginning_letter_counts arr\n # create a new hash, for which each value will be initialized to zero\n counts = Hash.new 0\n\n # increment each letter key-value pair for each animal with corresponding letter\n arr.each{|animal| counts[animal[0]] += 1}\n\n # prepare a printable string\n count_str = counts.to_s.gsub(\", \", \"\\n\")[1..-2]\n\n puts \"Here are the beginning letter frequency of all of the animals:\\n#{count_str}\"\nend", "title": "" }, { "docid": "b1dae954a1201d3d708ee13c67cad3b1", "score": "0.6565806", "text": "def word_freq(str)\n arr = str.downcase.split(' ')\n counts_hash = {}\n\n arr.each do |word|\n counts_hash[word] = arr.count(word)\n end\n counts_hash\nend", "title": "" }, { "docid": "4bb354738e400198a84b9e47037d49f7", "score": "0.65643483", "text": "def word_freq(str)\n arr = str.downcase.split(' ')\n counts_hash = {}\n\n arr.each do |word|\n counts_hash[word] = arr.count(word)\n end\n \n counts_hash\nend", "title": "" }, { "docid": "c923cea15ccec32d8f68f2ce2f378816", "score": "0.65594196", "text": "def frequency_of_word word\n word_frequency[word]\n end", "title": "" }, { "docid": "2125f283973ebf6814687cc56050a937", "score": "0.6556491", "text": "def frequencies(string)\n hash = {}\n return hash if string == \"\"\n words = string.gsub(\".\",'')\n words = words.gsub(\",\",'')\n words = words.split\n words.each do |word|\n if hash.key?(word)\n hash[word] += 1\n else\n hash[word] = 1\n end\n end\n hash\nend", "title": "" }, { "docid": "419d71c3f3fb0652474ba4b9e2f956fb", "score": "0.65491474", "text": "def frequent_letters(string)\n letter_counts = letter_count(string) #=> returns as a hash of letter counts\n repeats = []\n letter_counts.each_pair do |letter, count|\n if count > 2\n repeats << letter\n end\n end\n return repeats\nend", "title": "" }, { "docid": "ece50da8d9a7c788027f584609465dfe", "score": "0.6541936", "text": "def frequency_analysis(text)\r\n frequency_table = {}\r\n for key in 'a'..'z' do \r\n frequency_table[key] = 0\r\n end\r\n text = clean_text(text, LETTERS)\r\n text.each_char do |character|\r\n frequency_table[character] += 1\r\n end\r\n relative_frequency = {}\r\n frequency_table.each { |key, value| \r\n relative_frequency[key] = (value * 100.0) / text.length\r\n }\r\n result = relative_frequency.sort_by { |_key, value| value }\r\n result.reverse!\r\n return result\r\nend", "title": "" }, { "docid": "8d1228ffe6c7daa270dd74f8e2259ca4", "score": "0.6541477", "text": "def calculate_word_frequency\n\n frequency = Hash.new(0) #create a new hash\n wf_words = Hash.new(0)\n #split each word and do block which takes a word and counts it.\n @content.split.each do |word| frequency[word.downcase] += 1 end\n @highest_wf_count = frequency.values.max #find max value among frequencies\n wf_words = frequency.select {|k,v| v==@highest_wf_count} #find word with max frequency\n @highest_wf_words = wf_words.keys\n end", "title": "" }, { "docid": "55206fe9eb9228745541b237b07292c0", "score": "0.65400714", "text": "def calculate_word_frequency()\n word_frequency = Hash.new(0)\n @highest_wf_count ||= 0;\n self.content.split.each do |word| \n word_frequency[word.downcase] += 1\n if @highest_wf_count <= word_frequency[word.downcase]\n @highest_wf_count = word_frequency[word.downcase]\n end\n end\n if @highest_wf_count != 0\n @highest_wf_words = []\n word_frequency.select { |key,value| value == @highest_wf_count}\n .each_pair do |key,value|\n @highest_wf_words.push(key)\n end\n end\n end", "title": "" }, { "docid": "ff39dddbaeb8981c2df71379d8e1390e", "score": "0.6532454", "text": "def character_frequency(string)\n character_hash = {}\n string.chars.each do |character|\n character_hash[character] ? character_hash[character] += 1 : character_hash[character] = 1 if character != \" \"\n end\n character_hash\nend", "title": "" }, { "docid": "567784bf1ac2cd27e455c1d0227c33e2", "score": "0.65269923", "text": "def frequency(text)\r\n occurrences = Hash.new(0)\r\n text.each_char do |char|\r\n occurrences[char] += 1\r\n end\r\n occurrences\r\n end", "title": "" }, { "docid": "de4c469d70fe6a4856108377d2b5fd97", "score": "0.6516521", "text": "def occurences(text)\n # Join not needed \n\n ### We can intitialize a hash like ltrhash = {}\n ### Please use appropriate variable naming\n \n \t#changes done\n \n\tltrhash = {};\n\n\ttext.each_char do |c|\n\t\tif !ltrhash[c]\n\t\t\tltrhash[c]=1\n\t\telse\n\t\t\tltrhash[c] += 1\n\t\tend\n\tend\n\tltrhash\nend", "title": "" }, { "docid": "5a068d5b7989959eeea3ee5ba41f19c5", "score": "0.65148485", "text": "def frequent_letters(string)\n\tcharacters = []\n \tlettersCount = Hash.new(0)\n \n \tstring.each_char { |letter|\n \tlettersCount[letter] += 1\n \tif lettersCount[letter] > 2 && !characters.include?(letter)\n \tcharacters.push(letter)\n end\n }\n \treturn characters\nend", "title": "" }, { "docid": "61963131e0f52bc7b44ec1b1fec624f0", "score": "0.6514417", "text": "def one_way_freq \n @array = numerify @array\n counts = Hash.new(0)\n @array.each { |item| counts[item] += 1 }\n @data[:data] = counts.keys.map { |key| { x: key, y: counts[key] } }\n return @data\n end", "title": "" }, { "docid": "a4145813027a58ada4afd81f27d48728", "score": "0.65132934", "text": "def code_orded_by_frequency(counts)\n sorted_values = counts.keys.sort { |value_a, value_b| \n value_a_rank = sprintf \"%02d|%02d\", counts[value_a], value_a.weight \n value_b_rank = sprintf \"%02d|%02d\", counts[value_b], value_b.weight\n\n value_b_rank <=> value_a_rank\n }\n\n sorted_values.collect { |value|\n format_code([value] * counts[value])\n }.join\n end", "title": "" }, { "docid": "fbd46a56b2b5a384e77b09984031ee70", "score": "0.6511503", "text": "def num_repeats(string)\n letters= string.split(\"\")\n frequencies = Hash.new(0)\n stuff.each {|letter| frequencies[letter] += 1}\n\n frequencies.delete_if {|letter, frequency| frequency <= 1 }\n\n frequencies.each {|letter, frequency| puts letter + \" \" + frequency.to_s}\n\n frequencies.length\nend", "title": "" }, { "docid": "39b5abd07733f761629549ba6d0d0c7d", "score": "0.65090555", "text": "def letter_frequencies(text)\n # The next couple of lines will build a dictionary that will contain the number\n # of time each letter was seen in the text.\n occurences = text.split('').each_with_object({}) do |letter, ret|\n ret[letter] = (ret[letter] || 0) + 1\n end\n # At this point, the `occurences` variable looks like `{a: 32, b: 25 ...}`.\n # It's not really what we want, so the next iteration makes it into frequencies\n # instead, eg {a: 0.25, b: 11, ...}. As this loop is the last statement in this\n # function, it will also be its return value.\n occurences.each_with_object({}) do |(letter, occurence), ret|\n ret[letter] = 1.0 / text.length * occurence\n end\nend", "title": "" }, { "docid": "4ff16e11c5ad16d9c176f225a7bfd2e1", "score": "0.6498055", "text": "def letter_frequency\n freq = Hash.new(0)\n @text.each_char { |char| (freq[char] += 1) if char.match(/[a-zA-Z]/) }\n freq\n end", "title": "" }, { "docid": "42c081e1a54b6e529128764e72928ea7", "score": "0.64940125", "text": "def freq(key, word)\n main_counter[key][word] || 0\n end", "title": "" }, { "docid": "ecb42d271ad735b20f5bc41eee427d24", "score": "0.6493304", "text": "def letters_frequency(word)\n word = word.downcase.gsub(/[\\W\\d_]/, '')\n frequency = {}\n word.each_char do |char|\n frequency[char] ||= 0\n frequency[char] += 1\n end\n return frequency\nend", "title": "" }, { "docid": "4c28b7978ad8a779a7143a2027ad47ca", "score": "0.6491356", "text": "def letter_counts(word)\n freq = Hash.new(0)\n word.chars.each{|ch| freq[ch] += 1 }\n freq\nend", "title": "" }, { "docid": "7fd04837fff77461955cd55bc4e95850", "score": "0.6488477", "text": "def most_frequent_bigram(str)\n counter = Hash.new(0) \n #create a hash that counts each bigram \n #{\"go\"=>1, \"ot\"=>2, \"to\"=>1, \"th\"=>1, \"he\"=>1, \"em\"=>1, \"mo\"=>1, \"oo\"=>3, \"on\"=>2, \"ns\"=>1, \n #\"so\"=>1, \"nf\"=>1, \"fo\"=>1, \"or\"=>1, \"rp\"=>1, \"pr\"=>1, \"ro\"=>1, \"of\"=>1, \"f\"=>1}\n (0...str.length).each do |i|\n bigram = str[i..i+1]\n counter[bigram]+=1\n end\n sorted = counter.sort_by {|str,n| n}\n #sort hash into an array (increasing order)\n #[[\"f\", 1], [\"ro\", 1], [\"of\", 1], [\"go\", 1], [\"to\", 1], [\"th\", 1], [\"he\", 1], [\"em\", 1], [\"mo\", 1],\n #[\"ns\", 1], [\"so\", 1], [\"nf\", 1], [\"fo\", 1], [\"or\", 1], [\"rp\", 1], [\"pr\", 1], [\"ot\", 2], [\"on\", 2],\n # [\"oo\", 3]]\n sorted.last[0] #sorted.last -> [\"oo\",3] sorted.last[0] -> \"oo\"\n #returns the last(highest counted value)\nend", "title": "" }, { "docid": "eadddd22ef60f952962d6987276064a4", "score": "0.6487663", "text": "def most_frequent_bigram(str)\n new_hash = Hash.new(0)\n (0...str.length).each do |i|\n new_hash[str[i...i+2]] += 1 if str[i...i+2].length == 2\n end\n max = 0\n keys = \"\"\n new_hash.each do |k, v|\n if v > max\n max = v\n keys = k\n end\n end\n return keys\nend", "title": "" }, { "docid": "fcf622297991c6a0c8e43002346e2a66", "score": "0.6479017", "text": "def most_frequent_word(my_str)\n my_str = my_str.downcase\n str_to_array = my_str.split(\" \")\n \n word_counter = Hash.new(0)\n\n str_to_array.each do |word| \n word.gsub!(/[^a-z]/,\"\")\n word_counter[word]+= 1\n end\n\n word_counter = word_counter.sort_by {|word, count| count}\n word_counter.reverse!\n return word_counter[0][0]\n\nend", "title": "" }, { "docid": "86b7ea94c40cf2f18c60ec1f03f6e4d4", "score": "0.64788336", "text": "def textAnalyzer(text)\n words = text.to_s.downcase.split(/[^a-zA-Z]/)\n repeat = Hash.new(0)\n words.each do |word| \n repeat[word] += 1 \n end\n puts repeat.inspect\n repeat = repeat.sort_by { |x,y| y }\n repeat.reverse!\n puts repeat.first\nend", "title": "" }, { "docid": "6c733dcde02883b94c86a09bf6194df0", "score": "0.64774185", "text": "def token_frequency\n tokens.each_with_object(Hash.new(0)) { |token, hash| hash[token] += 1 }.sort_by_value_desc\n end", "title": "" }, { "docid": "69611833bd9c9ead42d79da64fd9e451", "score": "0.6474686", "text": "def letter_counts(word)\n frequency_count = Hash.new(0)\n\n word.split(\"\").each do |char|\n frequency_count[char] += 1\n end\n frequency_count\nend", "title": "" }, { "docid": "52f87f2e33676301683d79b892f60e62", "score": "0.64619005", "text": "def word_count\n words = []\n sample_text = File.read('sample.txt')\n words = sample_text.split(/[^a-zA-Z]/)\n freqs = Hash.new(0)\n words.each { |word| freqs[word] += 1 }\n freqs = freqs.sort_by {|x,y| y }\n freqs.reverse!\n freqs.each {|word, freq| puts word+' '+freq.to_s}\nend", "title": "" }, { "docid": "2c3e38aa307111ccad56a433b0b7606a", "score": "0.6460263", "text": "def most_frequent_bigram(str)\nsort = Hash.new(0)\n (0..str.length-2).each {|i| sort[str[i]+str[i+1]] += 1 }\n return (sort.sort_by {|k, v| v})[-1][0]\n \nend", "title": "" }, { "docid": "a1301e1f300eb1df214e723ef94d2d5e", "score": "0.64544797", "text": "def frequency; end", "title": "" }, { "docid": "7da1cc33cb0459729ad88f2f1d4c848a", "score": "0.6453705", "text": "def most_frequent_character(values)\n most_frequent_characters(values).first\n end", "title": "" }, { "docid": "ad5d169552f79e01f991db26e3a1fe41", "score": "0.6453372", "text": "def letter_count string\n frequency = {}\n string.each_char do |char|\n if frequency[char]\n frequency[char] += 1\n else frequency[char] = 1\n end\n end\n frequency\nend", "title": "" }, { "docid": "24304860d7cc06fa5f0ea2be4dcca315", "score": "0.64427084", "text": "def letter_count string\n frequency = {}\n i = 0\n while i < string.length do\n if !frequency[string[i]]\n frequency[string[i]] = 1\n else\n frequency[string[i]] += 1\n end\n i += 1\n end\n frequency\nend", "title": "" } ]
9593ef901be534c09b1379a0d9fa03a4
Print "Brands" in ascii art
[ { "docid": "be3d2586dcde044bbeaed851ac071fb1", "score": "0.0", "text": "def make_brands_section\n\tbrands = $products_hash[\"items\"].map {|toy| toy[\"brand\"]}.uniq\n\tbrands.each do |brand|\n\t\t$same_brand = $products_hash[\"items\"].select {|toy| toy[\"brand\"] == brand}\n\t print_brand_name brand\n\t brand_toy_stock brand\n\t\tprint_brand_toy_stock\n\t average_price_brand brand\n\t\tprint_average_price_brand\n\t total_sales_brand brand\n\t\tprint_total_sales_brand\n\tend\nend", "title": "" } ]
[ { "docid": "1bcbbd492f70735bd0fae0bf1ab64317", "score": "0.7761194", "text": "def print_brands\n\treturn \"\n ____ _ \n | __ ) _ __ __ _ _ __ __| |___ \n | _ \\\\| '__/ _` | '_ \\\\ / _` / __|\n | |_) | | | (_| | | | | (_| \\\\__ \\\\\n |____/|_| \\\\__,_|_| |_|\\\\__,_|___/\\n\\n\"\n\nend", "title": "" }, { "docid": "d41d8e2d7fc2f901af8a88d3bafb69d2", "score": "0.76636314", "text": "def print_ascii_brand\n\tputs \" ____ _ \"\n\tputs \" | _ \\\\ | | \"\n\tputs \" | |_) |_ __ __ _ _ __ __| |___ \"\n\tputs \" | _ <| '__/ _` | '_ \\\\ / _` / __| \"\n\tputs \" | |_) | | | (_| | | | | (_| \\\\__ \\\\\"\n\tputs \" |____/|_| \\\\__,_|_| |_|\\\\__,_|___/\"\n\tputs \" \"\nend", "title": "" }, { "docid": "0e58785ec6d45cedfebf09b98b560ae4", "score": "0.74447745", "text": "def brands_ascii\n\t \" _ _ \\n\" +\n\t \"| | | | \\n\" +\n\t \"| |__ _ __ __ _ _ __ __| |___ \\n\" +\n\t \"| '_ \\\\| '__/ _` | '_ \\\\ / _` / __|\\n\" +\n\t \"| |_) | | | (_| | | | | (_| \\\\__ \\\\\\n\" +\n\t \"|_.__/|_| \\\\__,_|_| |_|\\\\__,_|___/\"\n\t\nend", "title": "" }, { "docid": "8da508eeab7b4a49fe7aca6d84de3898", "score": "0.73596644", "text": "def print_brands_ASCII\n $report_file.puts \"\n\n ╔╗ ┬─┐┌─┐┌┐┌┌┬┐┌─┐\n ╠╩╗├┬┘├─┤│││ ││└─┐\n ╚═╝┴└─┴ ┴┘└┘─┴┘└─┘\n\"\nend", "title": "" }, { "docid": "47b1f84df7a90f5cf9cb5cdade7b2409", "score": "0.73496497", "text": "def print_brands_in_art\n $report_file.puts \" _ _ \"\n $report_file.puts \"| | | | \"\n $report_file.puts \"| |__ _ __ __ _ _ __ __| |___ \"\n $report_file.puts \"| '_ \\\\| '__/ _` | '_ \\\\ / _` / __|\"\n $report_file.puts \"| |_) | | | (_| | | | | (_| \\\\__ \\\\\"\n $report_file.puts \"|_.__/|_| \\\\__,_|_| |_|\\\\__,_|___/\"\n $report_file.puts\nend", "title": "" }, { "docid": "b102efdb2c37712e5e119dfa3a664c10", "score": "0.7292008", "text": "def ascii_brands\n\" _ _ \n| | | | \n| |__ _ __ __ _ _ __ __| |___ \n| '_ \\\\| '__/ _` | '_ \\\\ / _` / __|\n| |_) | | | (_| | | | | (_| \\\\__ \\\\\n|_.__/|_| \\\\__,_|_| |_|\\\\__,_|___/\"\n\tend", "title": "" }, { "docid": "abeb49232895ef29db7d24b2ad5b1dd3", "score": "0.70131063", "text": "def print_brands\n\t$report_file.puts\"\n _\n| | | |\n| |__ _ __ __ _ _ __ __| |___\n| '_ \\\\| '__/ _` | '_ \\\\ / _` / __|\n| |_) | | | (_| | | | | (_| \\\\__ \\\\\n|_.__/|_| \\\\__,_|_| |_|\\\\__,_|___/\n\n\"\nend", "title": "" }, { "docid": "d395ec29776e96d5fcb616c3ee62e0c5", "score": "0.6795489", "text": "def print_ascii_art(roses)\n stems = \"\\n,\\\\,\\\\,|,/,/,\n _\\\\|/_\".colorize(:green)\n pot = \"\n |_____|\n | |\n |___|\n \".colorize(:yellow)\n roses + stems + pot\nend", "title": "" }, { "docid": "82cf988e8b5916c1f65b9dfaa22a8d07", "score": "0.6714252", "text": "def print_ascii_products\n\tputs \" _____ _ _ \"\n\tputs \" | __ \\\\ | | | | \"\n\tputs \" | |__) | __ ___ __| |_ _ ___| |_ ___ \"\n\tputs \" | ___/ '__/ _ \\\\ / _` | | | |/ __| __/ __|\"\n\tputs \" | | | | | (_) | (_| | |_| | (__| |_\\\\__ \\\\\"\n\tputs \" |_| |_| \\\\___/ \\\\__,_|\\\\__,_|\\\\___|\\\\__|___/\"\n\tputs \" \"\nend", "title": "" }, { "docid": "990b283e80476cb0dc0f6effb324bcf0", "score": "0.65069497", "text": "def display_board\n\t\tputs \"\\n\\n\"\n\t\tprint \"|\\u2460 |\\u2461 |\\u2462 |\\u2463 |\\u2464 |\\u2465 |\\u2466 |\"\n\t\[email protected] do |row|\n\t\t\tprint \"\\n|\"\n\t\t\trow.each {|x| print \"#{x.to_c} |\"} \t\t\t\n\t\tend\n\t\tputs \"\"\n\tend", "title": "" }, { "docid": "8f84848ae6c2a2a854424d19e1a2bd29", "score": "0.6406448", "text": "def print_board\n @board.reverse.each_with_index do |rank, ri|\n rank_num = rank.length - ri\n print \"#{rank_num} \"\n rank.each_with_index do |file, fi|\n print \"\\u2502\" #vertical line\n if file.nil?\n print \"\\u2022\" #bullet point\n else\n print file.unicode # prints piece unicode\n end\n end\n puts \"\\u2502\" #vertical line\n end\n puts \" A B C D E F G H\"\n puts\n end", "title": "" }, { "docid": "74b9a8f58f993a0b2e2c5054fe7ffad4", "score": "0.63731015", "text": "def print_title\n type(\"ZJCRUMPTON PRESENTS:\".green.to_s, 'mid')\n print \"\n #{\"______ _ _ ______ __ _\n | | | \\\\ | | | | | | | \\\\ \\\\ \\\\ | |\n | |__| | | | | | | |--| < \\\\_\\\\_| |\n |_| \\\\_\\\\ \\\\_|__|_| |_|__|_/ ____|_|\".red}\n\n #{\"______ _ _ ______ ______ ______\n | | | | | | | | / | / |\n | | | |--| | | |---- '------. '------.\n |_|____ |_| |_| |_|____ ____|_/ ____|_/\".blue}\n\n \\n\\n\"\n end", "title": "" }, { "docid": "09761ae6e3b0fefa7e5500b327cc8e28", "score": "0.63700634", "text": "def show_bank\n print 'Used letters: '\n @bank.each { |letter| print \"#{letter} \" }\n print \"\\n\"\n end", "title": "" }, { "docid": "ed6ab670d7ab262bfc45e3f129102d1a", "score": "0.631751", "text": "def display\n encoded_asterisks, encoded_text = cmd('?FL', /^FL([0-9A-F]{2})([0-9A-F]{28})$/)\n return nil unless encoded_asterisks && encoded_text\n\n str = case encoded_asterisks\n when '00' then ' '\n when '01' then ' *'\n when '02' then '* '\n when '03' then '**'\n else; ''\n end\n\n return str + encoded_text.unpack('a2' * 14).map { |c| c.to_i(16).chr }.join\n end", "title": "" }, { "docid": "676a33e43c22dd5215db0fa5b94cd265", "score": "0.6290319", "text": "def display_commandes\n puts <<-EOT\n\n(Taper 'aide' pour obtenir de l'aide)\n\n EOT\n end", "title": "" }, { "docid": "676a33e43c22dd5215db0fa5b94cd265", "score": "0.6290319", "text": "def display_commandes\n puts <<-EOT\n\n(Taper 'aide' pour obtenir de l'aide)\n\n EOT\n end", "title": "" }, { "docid": "21a7e31b8758cfc2c060f3ccfb12f07f", "score": "0.62529546", "text": "def brief_inventory\n puts \"SEED BAGS IN INVENTORY\".colorize(:yellow)\n seed_bag_inventory_hash.each do |crop_name, amount|\n puts \"#{crop_name}\".upcase.bold + \" x#{amount}\"\n end\n #=> TURNIP x4\n #=> TOMATO x1\n end", "title": "" }, { "docid": "914dda0ba156a031fcc0664ebee9d941", "score": "0.6236031", "text": "def view\n pos = [\"A\", \"8\"]\n while pos[1] != \"0\" do\n while pos[0] != \"I\" do\n # handle board column legend\n if pos[0] == \"A\"\n print pos[1]\n print \" \"\n end\n print \" \"\n piece = @board.nodes[pos.join].piece\n if piece != nil\n print piece.icon\n else \n # print @board.nodes[pos.join].position\n print \"\\u25A2\".encode\n end\n # print @board.nodes[pos.join].position\n print \" \"\n letter = pos[0].ord + 1\n pos[0] = letter.chr\n end\n print \"\\n\"\n num = pos[1].ord - 1\n pos[1] = num.chr\n pos[0] = \"A\"\n end\n # handle board row legend\n letters = (\"a\"..\"h\")\n print \" \"\n letters.each do |let|\n print \" \"\n print let\n print \" \"\n end\n print \"\\n\"\n end", "title": "" }, { "docid": "bca0667a6f4517ef78717aebfc54a466", "score": "0.6234508", "text": "def show_board\n\t\ttop_left = \"\\u250c\"\n\t\thorizontal = \"\\u2500\"\n\t\ttop_right = \"\\u2510\"\n\t\tbot_left = \"\\u2514\"\n\t\tbot_right = \"\\u2518\"\n\t\tvertical = \"\\u2502\"\n\t\tcross = \"\\u253c\"\n\t\ttop_cross = \"\\u252c\"\n\t\tbot_cross = \"\\u2534\"\n\t\tleft_vertical = \"\\u251c\"\n\t\tright_vertical = \"\\u2524\"\n\n\t\ttop_board = \" \" + top_left + (horizontal*3 + top_cross)*7 + horizontal*3 + top_right\n\t\tmid_board = vertical + (\" \" + vertical)*7 + \" \" + vertical\n\t\tseparator_board = \" \" + left_vertical + (horizontal*3 + cross)*7 + horizontal*3 + right_vertical\n\t\tbot_board = \" \" + bot_left + (horizontal*3 + bot_cross)*7 + horizontal*3 + bot_right\n\n\t\tputs \"\\n\" + top_board\n\n\t\t(2..8).reverse_each do |num|\n\t\t\tmid_test = num.to_s + vertical\n\t\t\t(\"a\"..\"h\").each do |letter|\n\t\t\t\tpair = letter + num.to_s \n\t\t\t\tmid_test += \" #{@board[pair].view} \" + vertical\n\t\t\tend\n\t\t\tputs mid_test\n\t\t\tputs separator_board\n\t\tend\n\n\t\tmid_test = 1.to_s + vertical\n\t\t(\"a\"..\"h\").each do |letter|\n\t\t\tpair = \"#{letter}1\"\n\t\t\tmid_test += \" #{@board[pair].view} \" + vertical\n\t\tend\n\n\t\tputs mid_test\n\t\tputs bot_board\n\t\tputs \" a b c d e f g h\\n\"\t\t\n\tend", "title": "" }, { "docid": "ba7367b704137181a1f7a48107012460", "score": "0.62120384", "text": "def show()\n\t\tputs (' \t|\t' + ' \t|\t')\n\t\tputs (@@board[7] + '\t|\t' + @@board[8] + '\t|\t' + @@board[9])\n\t\tputs ('------------------------------------')\n\t\tputs (@@board[4] + '\t|\t' + @@board[5] + '\t|\t' + @@board[6])\n\t\tputs (' \t|\t' + ' \t|\t')\n\t\tputs ('------------------------------------')\n\t\tputs (@@board[1] + '\t|\t' + @@board[2] + '\t|\t' + @@board[3])\n\t\tputs (' \t|\t' + ' \t|\t')\n\tend", "title": "" }, { "docid": "2c2f60eb9659fa452c30dba912b21b36", "score": "0.6205358", "text": "def draw_ascii(pattern, width)\n for i in 0...(pattern.size-width+1)\n puts pattern.slice(i, width).join\n end\nend", "title": "" }, { "docid": "406cf372a6b2a6dd0f4b817f6846e10d", "score": "0.61966145", "text": "def show_board\n \tputs \"-\"*16\n \tputs \"| #{@case_array[0].symbol} | #{@case_array[1].symbol} | #{@case_array[2].symbol} |\"\n \tputs \"-\"*16\n \tputs \"| #{@case_array[3].symbol} | #{@case_array[4].symbol} | #{@case_array[5].symbol} |\"\n \tputs \"-\"*16\n \tputs \"| #{@case_array[6].symbol} | #{@case_array[7].symbol} | #{@case_array[8].symbol} |\"\n \tputs \"-\"*16\n\tend", "title": "" }, { "docid": "5ec77927265d6b1244cb953f46819c5f", "score": "0.61680907", "text": "def genbank\n chars = 60\n lines = (length / chars.to_f).ceil\n width = length.to_s.length\n\n s = ''\n (1..lines).each do |i|\n s << \"%#{width}d\" % (chars * (i - 1) + 1)\n s << ' '\n s << to_s[chars * (i - 1), chars].scan(/\\w{1,10}/).join(' ')\n s << \"\\n\"\n end\n s\n end", "title": "" }, { "docid": "bdf28d533ea47b7cda8df255751efc1c", "score": "0.61560714", "text": "def display_hand(hand)\n hand.each do | card |\n puts \"\\t#{CARD_NAMES[card[0]]} of #{SUITE_NAMES[card[1]].encode('utf-8')}\" \n end\nend", "title": "" }, { "docid": "8feb79490e05e1da376bd7bdd7a73212", "score": "0.6142455", "text": "def view\n\t\tcount = 0\n\t\tdark = \"\\u2591\"\n\t\tlight = \"\\u2593\"\n\t\tshade_line_2 = \" \" + (dark*6 + light*6)*4\n\t\tshade_line_1 = \" \" + (light*6 + dark*6)*4\n\t\tbase_letters = \" a b c d e f g h\\n\\n\"\n\t\t([email protected]/8).reverse_each do |i|\n\t\t\tputs count % 2 == 0 ? shade_line_1 : shade_line_2\n\t\t\tprint (i+1).to_s + \" \"\n\t\t\tline = @spots[i*8...(i+1)*8]\n\t\t\tline.each do |spot|\n\t\t\t\tprint count % 2 == 0 ? light*2 : dark*2\n\t\t\t\tif spot[1].img == \" \"\n\t\t\t\t\tprint count % 2 == 0 ? light*2 : dark*2\n\t\t\t\telse\n\t\t\t\t\tprint spot[1].img + \" \"\n\t\t\t\tend\n\t\t\t\tprint count % 2 == 0 ? light*2 : dark*2\n\t\t\t\tcount += 1\n\t\t\tend\n\t\t\tputs \"\"\n\t\t\tputs count % 2 == 0 ? shade_line_1 : shade_line_2\n\t\t\tcount += 1\n\t\tend\n\t\tputs \"\\n\" + base_letters\n\tend", "title": "" }, { "docid": "e2594478001b1f86237753d5be1eb243", "score": "0.61270946", "text": "def sales_report_ascii\n \" ##### ###### \\n\" +\n \" # # ## # ###### #### # # ###### ##### #### ##### #####\\n\" +\n \" # # # # # # # # # # # # # # # # \\n\" +\n \" ##### # # # ##### #### ###### ##### # # # # # # # \\n\" +\n \" # ###### # # # # # # ##### # # ##### # \\n\" +\n \" # # # # # # # # # # # # # # # # # \\n\" +\n \" ##### # # ###### ###### #### # # ###### # #### # # # \\n\" +\n \"********************************************************************************\"\nend", "title": "" }, { "docid": "5f63b3ef1dbb95fcdecc562d3c81571f", "score": "0.6117729", "text": "def display ()\n @maze_table.each_with_index do |row, i|\n (0..row.size-1).each do |index|\n print \"+\" if row[index] == \"1\" && i % 2 == 0 && index % 2 == 0\n print \"-\" if row[index] == \"1\" && i % 2 == 0 && index % 2 == 1\n print \"|\" if row[index] == \"1\" && i % 2 == 1 \n print \" \" if row[index] == \"0\"\n end\n print \"\\n\"\n end\n end", "title": "" }, { "docid": "1c93f4a863061ddb02b5e767b72bcc4d", "score": "0.6090624", "text": "def printCard\n \"#{@color[0]}#{@fillType[0]}#{@shapeType[0]}#{@numberOfSymbols[0]}\"\n end", "title": "" }, { "docid": "dad158fa4cf2b20730358d78e3a5e218", "score": "0.6089405", "text": "def print_output()\n\t#print \"$array= \\n\"\n\t$array.each { |i| i.each {\n\t\t\t\t\t |j|\n\t\t\t\t\t case j\n\t\t\t\t\t when 4\n\t\t\t\t\t \tprint \"•\"\n\t\t\t\t\t when 3\n\t\t\t\t\t \tprint \"x\"\n\t\t\t\t\t when 2\n\t\t\t\t\t \tprint \"*\"\n\t\t\t\t\t when 1\n\t\t\t\t\t \tprint \"█\"\n\t\t\t\t\t when 0\n\t\t\t\t\t \tprint \" \"\n\t\t\t\t\t end }\n\t\t\t\t print \"\\n\"}\nend", "title": "" }, { "docid": "aa277617beff8ec2845e5a897a88e1b7", "score": "0.6087964", "text": "def show_board\n\t\[email protected] do |space|\n\t\t\tif !(space.class == String)\n\t\t\t\tif (space.type == 'pawn') && (space.color == 'w')\n\t\t\t\t\tprint \"\\u2659\" + \" \"\n\t\t\t\telsif (space.type == 'pawn') && (space.color == 'b')\n\t\t\t\t\tprint \"\\u265F\" + \" \"\t\n\t\t\t\telsif (space.type == 'rook') && (space.color == 'w')\n\t\t\t\t\tprint \"\\u2656\" + \" \"\t\t\t\n\t\t\t\telsif (space.type == 'rook') && (space.color == 'b')\n\t\t\t\t\tprint \"\\u265C\" + \" \"\t\t\n\t\t\t\telsif (space.type == 'knight') && (space.color == 'w')\n\t\t\t\t\tprint \"\\u2658\" + \" \"\t\t\t\n\t\t\t\telsif (space.type == 'knight') && (space.color == 'b')\n\t\t\t\t\tprint \"\\u265E\" + \" \"\t\n\t\t\t\telsif (space.type == 'bishop') && (space.color == 'w')\n\t\t\t\t\tprint \"\\u2657\" + \" \"\t\t\t\n\t\t\t\telsif (space.type == 'bishop') && (space.color == 'b')\n\t\t\t\t\tprint \"\\u265D\" + \" \"\t\n\t\t\t\telsif (space.type == 'queen') && (space.color == 'w')\n\t\t\t\t\tprint \"\\u2655\" + \" \"\t\t\t\n\t\t\t\telsif (space.type == 'queen') && (space.color == 'b')\n\t\t\t\t\tprint \"\\u265B\" + \" \"\t\t\t\n\t\t\t\telsif (space.type == 'king') && (space.color == 'w')\n\t\t\t\t\tprint \"\\u2654\" + \" \"\t\t\t\n\t\t\t\telsif (space.type == 'king') && (space.color == 'b')\n\t\t\t\t\tprint \"\\u265A\" + \" \"\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\t\t\t\t\n\t\t\t\telse\n\t\t\t\t\tprint space\n\t\t\t\tend\n\t\t\telsif !(space == \"\")\n\t\t\t\tprint space + \" \"\n\t\t\telse\n\t\t\t\tputs space + \" \"\n\t\t\tend\n\t\tend\n\t\tputs \"---------------\"\n\tend", "title": "" }, { "docid": "5dd9570d1650d41efb4413f445f70af1", "score": "0.60869557", "text": "def insert_sky\n puts \" \" * 41 + \"\\u{2728} \" + \"\\u{1f31b}\" + \" \\u{2728}\"\n puts\n end", "title": "" }, { "docid": "e1a758b5168a53d54631c9a8f6f73b5e", "score": "0.6083165", "text": "def drawToSTDOUT\n for r in (0..6).step(3) do\n print \"+-----++-----++-----+\\n\"\n print \"| \\\\\"+@table[r].getTop.to_s+\"/ || \\\\\"+@table[r+1].getTop.to_s+\"/ || \\\\\"+@table[r+2].getTop.to_s+\"/ |\\n\"\n print \"|\"+@table[r].getLeft.to_s+\" × \"+@table[r+1].getRight.to_s+\"||\"+@table[r+2].getLeft.to_s+\" × \"+@table[r].getRight.to_s+\"||\"+@table[r+1].getLeft.to_s+\" × \"+@table[r+2].getRight.to_s+\"|\\n\"\n print \"| /\"+@table[r].getBottom.to_s+\"\\\\ || /\"+@table[r+1].getBottom.to_s+\"\\\\ || /\"+@table[r+2].getBottom.to_s+\"\\\\ |\\n\"\n print \"+-----++-----++-----+\\n\"\n end\n end", "title": "" }, { "docid": "959d485252c445198ffedc87b22fdcb6", "score": "0.60728455", "text": "def title( text, char )\n print( ( char * 76 ) + \"\\n#{text}\\n\" + ( char * 76 ) + \"\\n\" )\n end", "title": "" }, { "docid": "22035d1e43c52eafd477ca5168000636", "score": "0.6036188", "text": "def view\n\t\t@white_symbols = {\n\t\t\t\"king\" => \"\\u265a\", \n\t\t\t\"queen\" => \"\\u265b\", \n\t\t\t\"rook\" => \"\\u265c\", \n\t\t\t\"bishop\" => \"\\u265d\", \n\t\t\t\"knight\" => \"\\u265e\", \n\t\t\t\"pawn\" => \"\\u265f\"\n\t\t}\n\n\t\t@black_symbols = {\n\t\t\t\"king\" => \"\\u2654\",\n\t\t\t\"queen\" => \"\\u2655\",\n\t\t\t\"rook\" => \"\\u2656\",\n\t\t\t\"bishop\" => \"\\u2657\",\n\t\t\t\"knight\" => \"\\u2658\",\n\t\t\t\"pawn\" => \"\\u2659\"\n\t\t}\n\n\t\tif self.color == nil\n\t\t\treturn \" \"\n\t\telsif self.color == \"black\"\n\t\t\treturn @black_symbols[self.name]\n\t\telse\n\t\t\treturn @white_symbols[self.name]\n\t\tend\n\tend", "title": "" }, { "docid": "ab035370ae8db82ffd0162906b205648", "score": "0.6032757", "text": "def display_position\n side = \" \\u2551\"\n puts \" \\u2554\" + \"\\u2550\" * 16 + \"\\u2557\"\n current_position.each do |row|\n row_string = row.join(\" \")\n puts side + row_string + side\n end\n puts \" \\u255A\" + \"\\u2550\" * 16 + \"\\u255D\"\n if @current_state[:check]\n puts\n puts \"Check!\"\n end\n end", "title": "" }, { "docid": "b359d89117af34a9d6104e975903ec49", "score": "0.6031474", "text": "def ascii_sales\n\" _ _ \n ___ __ _| | ___ ___ _ __ ___ _ __ ___ _ __| |_ \n/ __|/ _` | |/ _ \\/ __| | '__/ _ \\ '_ \\ / _ \\| '__| __|\n\\__ \\ (_| | | __/\\__ \\ | | | __/ |_) | (_) | | | |_ \n|___/\\__,_|_|\\___||___/ |_| \\___| .__/ \\___/|_| \\__|\n |_| \n\\n\" \n end", "title": "" }, { "docid": "4f545dc13a09094fe2106143c4ca2cc9", "score": "0.6022716", "text": "def show\n @rank_list = [\n [\"プロ九段\", \"9p\"],\n [\"九段\", \"9d\"],\n [\"八段\", \"8d\"],\n [\"七段\", \"7d\"],\n [\"六段\", \"6d\"],\n [\"五段\", \"5d\"],\n [\"四段\", \"4d\"],\n [\"三段\", \"3d\"],\n [\"二段\", \"2d\"],\n [\"初段\", \"1d\"]\n ]\n\n (1..25).each do |i|\n @rank_list << [\"#{i}級\", \"#{i}k\"]\n end\n\n @komi_list = [\n [\"7目半\" , \"7.5\" ],\n [\"6目半\" , \"6.5\" ],\n [\"5目半\" , \"5.5\" ],\n [\"4目半\" , \"4.5\" ],\n [\"なし\" , \"0\" ],\n [\"逆コミ4目半\", \"-4.5\"],\n [\"逆コミ5目半\", \"-5.5\"],\n [\"逆コミ6目半\", \"-6.5\"],\n [\"逆コミ7目半\", \"-7.5\"]\n ]\n @viewport = 560\n end", "title": "" }, { "docid": "2b41f209a2d9f5d7c7f342f35ac9690c", "score": "0.6016416", "text": "def display\n\t\tbreakline = \"---- --- ----\"\n\t\tputs breakline.center(@linewidth)\n\t\tputs \"| #{@board[:one]} | #{@board[:two]} | #{@board[:three]} |\".center(@linewidth)\n\t\tputs breakline.center(@linewidth)\n\t\tputs \"| #{@board[:four]} | #{@board[:five]} | #{@board[:six]} |\".center(@linewidth)\n\t\tputs breakline.center(@linewidth)\n\t\tputs \"| #{@board[:seven]} | #{@board[:eight]} | #{@board[:nine]} |\".center(@linewidth)\n\t\tputs breakline.center(@linewidth)\n\t\tputs \"\".center(@linewidth)\n\tend", "title": "" }, { "docid": "653642183d0d99ceabec12e026758e2a", "score": "0.601363", "text": "def bark\n\t\treturn \"Normal Bark\"\n\tend", "title": "" }, { "docid": "3de01d9f582fe9d5f5e0f318b67e909b", "score": "0.60071605", "text": "def prn\n puts \" #{(0..8).to_a.join(\" \")}\"\n puts \" #{'-' * (2 * 9)}\"\n g.each_with_index do |v, i|\n # ERROR: print function doesn't display values and doesn't use colors\n # puts \"#{i} #{v.join(\" \")}\"\n puts \"#{i} | #{v.map{|t| t.n.to_s.colorize(t.c) }.join(' ')}\"\n end\n end", "title": "" }, { "docid": "146bfeeaf4f9340c8fa6066f8addc849", "score": "0.60005605", "text": "def print_products_ASCII\n $report_file.puts \"\n\n ╔═╗┬─┐┌─┐┌┬┐┬ ┬┌─┐┌┬┐┌─┐\n ╠═╝├┬┘│ │ │││ ││ │ └─┐\n ╩ ┴└─└─┘─┴┘└─┘└─┘ ┴ └─┘\n\"\nend", "title": "" }, { "docid": "5414686763f92df1d66f4edab1fad152", "score": "0.5995788", "text": "def render\n\t\tprint \"cl1 cl2 cl3 cl4 cl5 cl6 cl7 cl8 cl9 c10\\n\"\n\t\t(0..9).each do |row|\n\t\t\t(0..9).each do |col|\n\t\t\t\tif @grid[row][col].is_flagged\n\t\t\t\t\tprint \"FLG\"\n\t\t\t\telsif @grid[row][col].is_hidden\n\t\t\t\t\tprint \" \"\n\t\t\t\telsif @grid[row][col].surrounding_bombs > 0\n\t\t\t\t\tprint \" #{@grid[row][col].surrounding_bombs} \"\n\t\t\t\telsif @grid[row][col].has_bomb\n\t\t\t\t\tprint \"POW\"\t\t\t\t\t\n\t\t\t\telse print \"xxx\"\n\t\t\t\tend\n\t\t\t\tprint \"|\" unless col == 9\n\t\t\t\tprint \"row#{row + 1}\\n\" if col == 9\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "6a36ff4fab216d9752b5104ce15c8b94", "score": "0.5980109", "text": "def print_products_in_art\n $report_file.puts \" _ _ \"\n $report_file.puts \" | | | | \"\n $report_file.puts \" _ __ _ __ ___ __| |_ _ ___| |_ ___ \"\n $report_file.puts \"| '_ \\\\| '__/ _ \\\\ / _` | | | |/ __| __/ __|\"\n $report_file.puts \"| |_) | | | (_) | (_| | |_| | (__| |_\\\\__ \\\\\"\n $report_file.puts \"| .__/|_| \\\\___/ \\\\__,_|\\\\__,_|\\\\___|\\\\__|___/\"\n $report_file.puts \"| | \"\n $report_file.puts \"|_| \\n\\n\"\nend", "title": "" }, { "docid": "08291775c44634adb5731f9dc6364c0d", "score": "0.5967559", "text": "def ascii_products\n\" _ _ \n | | | | \n _ __ _ __ ___ __| |_ _ ___| |_ ___ \n| '_ \\\\| '__/ _ \\\\ / _` | | | |/ __| __/ __|\n| |_) | | | (_) | (_| | |_| | (__| |_\\\\__ \\\\\n| .__/|_| \\\\___/ \\\\__,_|\\\\__,_|\\\\___|\\\\__|___/\n| | \n|_| \"\n\tend", "title": "" }, { "docid": "86f5f76d437ce3ed5fea795b5646c1ae", "score": "0.5963115", "text": "def brief_inventory\n self.seed_bag_count_hash(0).each do |crop_name, amount|\n puts \"#{crop_name}\".upcase.bold + \" x#{amount}\"\n end\n #=> TURNIP x4\n #=> TOMATO x1\n end", "title": "" }, { "docid": "0faa2bd42ef38ad327b35bd316010320", "score": "0.59519", "text": "def products_ascii\n\t \" _ _ \\n\" +\n\t \" | | | | \\n\" +\n\t \" _ __ _ __ ___ __| |_ _ ___| |_ ___ \\n\" +\n\t \"| '_ \\\\| '__/ _ \\\\ / _` | | | |/ __| __/ __|\\n\" +\n\t \"| |_) | | | (_) | (_| | |_| | (__| |_\\\\__ \\\\\\n\" +\n\t \"| .__/|_| \\\\___/ \\\\__,_|\\\\__,_|\\\\___|\\\\__|___/\\n\" +\n\t \"| | \\n\" +\n\t \"|_| \"\nend", "title": "" }, { "docid": "699f5980f2bc7f1525e502af3d0651e4", "score": "0.59511966", "text": "def to_s\n \" #{[*'a'..'h'].join(\" \")}\\n\" <<\n \" #{\"+---\"*8}+\\n\" <<\n (0..63).map do |i|\n case 1\n when get_black[63 - i] then \"\\e[#{@options[:disk_color_b]}m#{@options[:disk_b]}\\e[0m\"\n when get_white[63 - i] then \"\\e[#{@options[:disk_color_w]}m#{@options[:disk_w]}\\e[0m\"\n else \" \"\n end\n end\n .map{ |e| \"| #{e} |\" }.each_slice(8).map(&:join)\n .map{ |line| line.gsub(/\\|\\|/, \"|\") }\n .tap{ |lines| break (0..7).map{ |i| \" #{i+1} #{lines[i]}\" } }\n .join(\"\\n #{\"+---\"*8}+\\n\") <<\n \"\\n #{\"+---\"*8}+\\n\"\n end", "title": "" }, { "docid": "19f8287ff4ac6d52833b90253f15a0e3", "score": "0.5942785", "text": "def print_board\n puts\n @board.each_with_index do |row, index|\n print \" \"\n row.each_with_index do |element, index|\n print \" \" + element.to_s.center(3, \" \") + \" \"\n if(index < row.length - 1)\n print \"|\"\n else\n print \"\\n\"\n end\n end\n\n if(index < @board.length - 1)\n print \" \"\n row.each_with_index do |element, index|\n print \"-----\"\n if(index < row.length - 1)\n print \"+\"\n else\n print \"\\n\"\n end\n end\n end\n end\n puts\n end", "title": "" }, { "docid": "b168420120f72b8dc52a7f360fd463d6", "score": "0.5938953", "text": "def bold_print(text)\n text.split(//).each do |ch|\n print ch, BS, ch\n end\n end", "title": "" }, { "docid": "8d38cdf0c3f69019d7382a630330ee81", "score": "0.59363496", "text": "def print_barra (longitud, items, char_init, char_continuo)\n extra = 0 #Valor adicional para mantener alineacion con numeros (ensayo y error)\n print char_init\n longitud.times do |i| #Cuando los numeros son mayores a 10\n if i > 9 #se añade un caracter mas para que se puedan\n extra += 1 #alinear con los numeros y no quede amontonado\n end \n print char_continuo * ( items + extra ) #cada numero se representa con 2 '*'\n end #despues de 9 se hace engorroso mantener\n print \"\\n\" #los numeros alineados asi que le añado \"extra\"\nend", "title": "" }, { "docid": "7bc607891d18ce6a06e4165e9ea15baa", "score": "0.59333354", "text": "def visuals\n <<~HEREDOC\n #{'VISUALS'.bold.blue}\n\n The appearance and colours of the pieces and board depend on your system and console settings.\n On your device, pieces will look like this:\n\n\n #{'P R B N Q K'.bold.green}\n\n WHITE => \\u2659 \\u2656 \\u2657 \\u2658 \\u2655 \\u2654\n\n BLACK => \\u265F \\u265C \\u265D \\u265E \\u265B \\u265A\n HEREDOC\n end", "title": "" }, { "docid": "ae125387824db1c64d81586419706050", "score": "0.5932787", "text": "def packetfu_ascii_art\n\tputs <<EOM\n _______ _______ _______ _ _______ _________ _______ \n( ____ )( ___ )( ____ \\\\| \\\\ /\\\\( ____ \\\\\\\\__ __/( ____ \\\\|\\\\ /|\n| ( )|| ( ) || ( \\\\/| \\\\ / /| ( \\\\/ ) ( | ( \\\\/| ) ( |\n| (____)|| (___) || | | (_/ / | (__ | | | (__ | | | |\n| _____)| ___ || | | _ ( | __) | | | __) | | | |\n| ( | ( ) || | | ( \\\\ \\\\ | ( | | | ( | | | |\n| ) | ) ( || (____/\\\\| / \\\\ \\\\| (____/\\\\ | | | ) | (___) |\n|/ |/ \\\\|(_______/|_/ \\\\/(_______/ )_( |/ (_______)\n ____________________________ ____________________________\n( ) ( )\n| 01000001 00101101 01001000 )( )( )( )( )( 00101101 01000001 00100001 |\n| )( )( )( )( )( |\n(____________________________) (____________________________)\n パケットフ\n a mid-level packet manipulation library for ruby\n\nEOM\n\tend", "title": "" }, { "docid": "5ff588e472810cae089711b1baf080c2", "score": "0.5926793", "text": "def print_ascii(inputs)\n inputs = inputs.map {|pixel| pixel*255}\n outputs = inputs.each_slice(28).map do |row|\n row.map do |darkness|\n darkness < 64 ? \" \" : ( darkness < 128 ? \".\" : \"X\" )\n end.join\n end.join(\"\\n\")\n puts outputs\n end", "title": "" }, { "docid": "357e8297d2085d3d01f98182069b0e6c", "score": "0.59264976", "text": "def _brands_header\n\t$report_file.puts \" _ _ \"\n\t$report_file.puts \"| | | | \"\n\t$report_file.puts \"| |__ _ __ __ _ _ __ __| |___ \"\n\t$report_file.puts \"| '_ \\\\| '__/ _` | '_ \\\\ / _` / __|\"\n\t$report_file.puts \"| |_) | | | (_| | | | | (_| \\\\__ \\\\\"\n\t$report_file.puts \"|_.__/|_| \\\\__,_|_| |_|\\\\__,_|___/\"\n\t$report_file.puts\n\t$report_file.puts \"--------------------------------------------------------------------\"\n\t$report_file.puts\nend", "title": "" }, { "docid": "51c01b482aa7f807599ed089256fc8a7", "score": "0.5920326", "text": "def display_character_blah\n \n puts \"Name: #{name}\"\n puts \"Bio: #{description}\"\n end", "title": "" }, { "docid": "81e2f8587f62c8772d6117226f5bcd78", "score": "0.59196347", "text": "def insert_landscape\n puts (\"\\u{1f4b5}\" + \" \" + \"\\u{1f4b4}\" + \" \" + \"\\u{1f4b6}\" + \" \" + \"\\u{1f4b7}\" + \" \") * 8 # line of cash?\n end", "title": "" }, { "docid": "3b3746e6f1cb700157dee482790e479a", "score": "0.59184194", "text": "def print\n @cell_board.each do |row|\n string_row_separator = '-'\n string_row = '|'\n row.each do |element|\n string_row += \" #{element.to_s} |\"\n string_row_separator += '----'\n end\n puts string_row\n puts string_row_separator\n end\n end", "title": "" }, { "docid": "a7e296660ded32c18ca8c27f8ad1c606", "score": "0.591824", "text": "def show\n\t puts \"\t#{@spaces[0]} #{@spaces[1]} #{@spaces[2]}\"\n\t puts \"\t#{@spaces[3]} #{@spaces[4]} #{@spaces[5]}\"\n\t puts \"\t#{@spaces[6]} #{@spaces[7]} #{@spaces[8]}\"\n\tend", "title": "" }, { "docid": "4791519cecd63ed0fa187b9cfb210522", "score": "0.59180325", "text": "def display()\r\n #final presenter as a string spaced out\r\n presentWord = \"\"\r\n #iterate the shadow word\r\n @shadowWord.each { |x| \r\n #add a space in the letters\r\n presentWord += x + \" \"\r\n }\r\n #remove the trailing spaces as spec\r\n presentWord.rstrip\r\n end", "title": "" }, { "docid": "523d1bfae2acf2467785be7cfa4c5e1c", "score": "0.59162396", "text": "def scr_bold\n print \"\\33[1m\"\nend", "title": "" }, { "docid": "398b4418122b5f01111b17dc690b20ad", "score": "0.59089047", "text": "def print_map\n system('clear')\n for row in @map\n for letter in row\n case letter\n when '`'\n print '──'.colorize(:light_blue)\n when '|'\n print '│'.colorize(:light_blue)\n when '1'\n print '┌'.colorize(:light_blue)\n when '2'\n print '┐'.colorize(:light_blue)\n when '3'\n print '└'.colorize(:light_blue)\n when '3a'\n print '└─'.colorize(:light_blue)\n when '4'\n print '┘'.colorize(:light_blue)\n when '4a'\n print '─┘'.colorize(:light_blue)\n when 'R'\n print \"\\u{1F4E6}\".colorize(:red)\n when 'S'\n print '██'.colorize(:light_black)\n when 'T'\n print \"\\u{1F333}\".colorize(:green)\n when 'X'\n print \"#{ @player_icon }\"\n when 'H'\n print '██'.colorize(:light_magenta)\n when 'I'\n print \"\\u{1F233}\".colorize(:cyan)\n when 'E'\n print ' '\n when 'D'\n print \"\\u{1F6AA}\".colorize(:light_magenta)\n when 'C'\n print \"\\u{1F69A}\"\n when 'O'\n print ' O'.colorize(:blue)\n when 'P'\n print \"\\u{1F43B}\".colorize(:blue)\n when 'G'\n print \"\\u{1F33F}\".colorize(:yellow)\n when 'L'\n print \"\\u{26F0}\\u{26F0}\"\n when 'B' \n print '█'.colorize(:blue)\n when 'box'\n print \"\\u{1F4E6}\"\n when 'couch'\n print \"\\u{1F6CB} \"\n when 'lady'\n print \"\\u{1F475}\"\n when 'boy'\n print \"\\u{1F466}\"\n when 'girl'\n print \"\\u{1F467}\"\n when 'chair'\n print \"\\u{1FA91}\"\n when 'tv'\n print \"\\u{1F4FA}\"\n when 'clock'\n print \"\\u{1F55B}\"\n when 'pc'\n print \"\\u{1F4BB}\"\n when 'bed'\n print \"\\u{1F6CF} \"\n when 'other_icon'\n print \"#{ @other_icon }\"\n when 'flower'\n print \"\\u{1F33C}\"\n when 'assistant'\n print \"\\u{1F468}\"\n when 'books'\n print \"📚\"\n when 'cabinet'\n print \"🗄 \"\n when 'basket'\n print \"\\u{1F9FA}\"\n when 'prof'\n print \"\\u{1F468}\"\n when 'bag'\n print \"\\u{1F45C}\"\n end\n end\n puts ''\n end\n end", "title": "" }, { "docid": "aa2aca69e296523f2e9ef4354e63d20f", "score": "0.5902696", "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": "5e3477bd569f69bf1207fc69c7a7b12b", "score": "0.59024084", "text": "def test\n puts\n out = ''\n BACKS.keys.each { |b|\n FORES.keys.each { |f|\n STYLES.keys.each { |s|\n out << %<#{LLQBIG}#{OP}#{s};#{f};#{b}m#{FORES[f]}/#{BACKS[b]}:#{STYLES[s]}#{RESET}#{RRQBIG}>\n if out.length > 240\n puts out\n out = ''\n end\n }\n }\n print \"\\n\"\n }\n puts\n end", "title": "" }, { "docid": "7349aecc55b7797bc3c840150e0f7060", "score": "0.5898116", "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": "cd2afe74fd46a7c661800818095d5e51", "score": "0.58676237", "text": "def render\n @board.each.with_index do |row, y|\n row.each.with_index do |item, x|\n chr = item.nil? ? \" \" : item\n print \" #{chr} \"\n print \"|\" unless x == row.size - 1\n end\n print \"\\n-----------\\n\" unless y == @board.size - 1\n end\n print \"\\n\"\n end", "title": "" }, { "docid": "5b02ca29cfb300037142b5bec14ea6d1", "score": "0.5866018", "text": "def print_console_products_ascii\n\tputs products_ascii\nend", "title": "" }, { "docid": "8ff186cdc16255cdcf1da267fb47ca5e", "score": "0.5865661", "text": "def display_board\n display = \" a b c d e f g h \\n\"\n @board.each_with_index do |arr, i|\n line = \"#{i + 1} \"\n arr.each do |hash|\n hash[:piece].nil? ? line += \"#{hash[:base]} \" : line += \"#{hash[:piece].name} \"\n end\n line += \"\\n\"\n display += line\n end\n display\n end", "title": "" }, { "docid": "c8f36456588d13dac68a0b207246506d", "score": "0.5863868", "text": "def bark\n\t\treturn \"Normal bark\"\n\tend", "title": "" }, { "docid": "38804351145c62dd2e230ba7c0b4ae96", "score": "0.5860089", "text": "def display_board\n\t board =\" | | \\n-----------\\n | | \\n-----------\\n | | \"\n\t puts board\n\tend", "title": "" }, { "docid": "b3c29c3a38882ce3f78e7ac3132a9d76", "score": "0.5854902", "text": "def display_board(board)\n separator = \"|\"\n lines = \"-----------\"\n \n puts \" #{board[0]} #{separator} #{board[1]} #{separator} #{board[2]} \"\n puts \"#{lines}\"\n puts \" #{board[3]} #{separator} #{board[4]} #{separator} #{board[5]} \"\n puts \"#{lines}\"\n puts \" #{board[6]} #{separator} #{board[7]} #{separator} #{board[8]} \"\nend", "title": "" }, { "docid": "341be6ed45ca7a0f709f05d93507538b", "score": "0.5854801", "text": "def print_label\n puts \"#{@nombre_etiqueta}\"\n puts \"\\nValor energetico o nutriente | por 100g o 100ml de producto \"\n puts \"--------------------------------|--------------------------------\"\n puts \"valor energetico |\" + \" #{energetic_value_KJ}\" + \" KJ/\" + \"#{energetic_value_Kcal}\" + \" Kcal\"\n puts \"Camtidad de grasas |\" + \" #{@grasa}g\"\n puts \"Camtidad de grasas saturadas |\" + \" #{@grasa_saturada}g\"\n puts \"Camtidad de hidratos de carbono |\" + \" #{@hid_carbono}g\"\n puts \"Camtidad de azucares |\" + \" #{@azucares}g\"\n puts \"Camtidad de proteinas |\" + \" #{@proteinas}g\"\n puts \"Camtidad de sal |\" + \" #{@sal}g\"\n @nombre_etiqueta\n end", "title": "" }, { "docid": "06d30f3758406b665a0f8150359791c4", "score": "0.5854626", "text": "def display_board\n\n puts \" #{@board[0].mark} | #{@board[1].mark} | #{@board[2].mark} \"\n puts \"-----------\"\n puts \" #{@board[3].mark} | #{@board[4].mark} | #{@board[5].mark} \"\n puts \"-----------\"\n puts \" #{@board[6].mark} | #{@board[7].mark} | #{@board[8].mark} \"\n end", "title": "" }, { "docid": "a7ae7abbf9fa5f148ca955c4aaa0d4a7", "score": "0.585361", "text": "def show_board\n \n puts \" 1 2 3\"\n puts \" a #{@A1.content} | #{@A2.content} | #{@A3.content}\"\n puts \" ---------\"\n puts \" b #{@B1.content} | #{@B2.content} | #{@B3.content}\"\n puts \" ---------\"\n puts \" c #{@C1.content} | #{@C2.content} | #{@C3.content}\"\n\n end", "title": "" }, { "docid": "b8fad3313856e8438e2313945643c45f", "score": "0.5852264", "text": "def pcbas_string\n first = 1\n pcbas = \"\"\n PartNum.get_bde_pcba_part_numbers(self.id).each { |pcba|\n pcbadescription = pcba.description ? pcba.description : \"(Description not set)\"\n string = pcba.name_string + \" \" + pcbadescription\n if first == 1\n pcbas << string \n first = 0\n else\n pcbas << \"<br>\" + string\n end\n }\n pcbas\n end", "title": "" }, { "docid": "fef6a859e2cf1226f3d551dcb2ddacaf", "score": "0.5847666", "text": "def display_board\n puts \" \" + (\"_\" * 47)\n 8.downto(1) do |l|\n puts \" \" +(\"| \" * 8 ) + \"|\"\n puts \" #{l} | \" + @board[l-1].join(\" | \") + \" |\"\n puts \" \" +(\"|_____\" * 8 ) + \"|\"\n end\n puts (\" \" * 8) + ('a'..'h').to_a.join(\" \")\n end", "title": "" }, { "docid": "e4cb7b7460a36e61cfa5d8c3d169bc93", "score": "0.5826991", "text": "def print\r\n puts \"------ AlphabetGraph is ------\"\r\n edges = \"\"\r\n @edges.each do |edge|\r\n edges << edge.to_s << \", \"\r\n end\r\n puts \"edges : #{edges}\"\r\n vertices = \"\"\r\n @charNodes.each do |node|\r\n vertices << node.to_s << \", \"\r\n end\r\n puts \"vertices : #{vertices}\"\r\n end", "title": "" }, { "docid": "e40a504834255d4ad19a69daf7aa99ce", "score": "0.582452", "text": "def display_blackjack_menu\n @output.puts # spacer\n @output.puts '--------------------------'.center(WIDTH)\n @output.puts '| (B)et | (H)it | (S)tay |'.center(WIDTH)\n @output.puts '--------------------------'.center(WIDTH)\n @output.puts '----------------------------------'.center(WIDTH)\n @output.puts '| (D)ebug | (M)ain Menu | (Q)uit |'.center(WIDTH)\n @output.puts '----------------------------------'.center(WIDTH)\n @output.puts # spacer\n @output.print 'Command: '\n end", "title": "" }, { "docid": "38083c2f6c89a8d2c1591b58576a21e4", "score": "0.5823458", "text": "def display_rainbow(color_lists)\n puts \"R: #{color_lists[0]}, O: #{color_lists[1]}, Y: #{color_lists[2]}, G: #{color_lists[3]}, B: #{color_lists[4]}, I: #{color_lists[5]}, V: #{color_lists[6]}\"\nend", "title": "" }, { "docid": "250aed07ed2e27e769fa02d276585933", "score": "0.5821505", "text": "def print_products\n\treturn \"\n ____ _ _ \n | _ \\\\ _ __ ___ __| |_ _ ___| |_ ___ \n | |_) | '__/ _ \\\\ / _` | | | |/ __| __/ __|\n | __/| | | (_) | (_| | |_| | (__| |_\\\\__ \\\\\n |_| |_| \\\\___/ \\\\__,_|\\\\__,_|\\\\___|\\\\__|___/\\n\\n\"\n\nend", "title": "" }, { "docid": "907e2a02218564697c9f6577cd2c57b6", "score": "0.58197623", "text": "def console_display\n print @grid.to_text { |s| Grid.color_to_char(s.color) }\n end", "title": "" }, { "docid": "0b34799bf41bef34da81383f824d7fce", "score": "0.58183503", "text": "def display_rainbow(colors)\n puts \"R: #{colors[4]}, O: #{colors[1]}, Y: #{[5]}, G: #{colors[3]}, B: #{colors[0]}, I: #{colors[2]}, V: #{colors[6]}\"\n puts colors\nend", "title": "" }, { "docid": "17ded7ac4c906f8631a04a6776dcb258", "score": "0.58154494", "text": "def banner()\n print \"\"\" \n =================================================================\n =================================================================\n\t ==========International Morse Code translator v 0.0.1 =========\n ==========Transates user supplied Morse Code to text ============\n\t =================================================================\n ==========Coded by Rick Flores | nanotechz9l ====================\n ==========E-mail 0xnanoquetz9l<<\\|/>>gmail.com ===================\n\t =================================================================\n =================================================================\n \n\"\"\".foreground(:blue).bright\nend", "title": "" }, { "docid": "d1609bd2863ce8b99a41ee2296388a37", "score": "0.58112526", "text": "def show_board_game(current_game)\n puts \"#{current_game.players[0].name.capitalize} #{current_game.players[0].avatar} #{current_game.players[0].symbol} \\u{1F19A} #{current_game.players[1].name.capitalize} #{current_game.players[1].avatar} #{current_game.players[1].symbol}\"\n puts \"\"\n for i in 0..2 do\n puts \"----------------\"\n for j in 0..2 do\n print \"| #{current_game.board.boardcase[i][j].content} \"\n end\n puts \"|\"\n end\n puts \"----------------\"\n end", "title": "" }, { "docid": "1f4cadb50be7fd3f0316ba580f2987c0", "score": "0.5810996", "text": "def pretty_print\n @word_display.each do |letter|\n print \"#{letter} \"\n end\n puts \"\"\n end", "title": "" }, { "docid": "cd60d8978df219c29635840f4a959f13", "score": "0.5801196", "text": "def display_rainbow(colors)\n puts \"R: #{colors[0]}, O: #{colors[1]}, Y: #{colors[2]}, G: #{colors[3]}, B: #{colors[4]}, I: #{colors[5]}, V: #{colors[6]}\"\nend", "title": "" }, { "docid": "5a8aaa544df807d653cd64037b291835", "score": "0.5799878", "text": "def display_maze_with_ascii(grid)\n \nend", "title": "" }, { "docid": "1216f8dd0f877b07e030af28516242fd", "score": "0.57982165", "text": "def cheese_and_crackers(cheese_count, boxes_of_crackers)\n puts \"You have #{cheese_count} cheeses!\"\n puts \"You have #{boxes_of_crackers} boxes of crackers!\"\n puts \"Man that's enough for a party...\"\n #print string with an escape charac\n puts \"Get a blanket.\\n\"\nend", "title": "" }, { "docid": "64173250d517512d7fa894be8e27fb75", "score": "0.5790995", "text": "def list_all_bands\n puts \"#{pastel.bright_cyan(\"Here are the top headliners:\")}\"\n puts \" \"\n Band.all.each do |band|\n puts \"#{band.id}. #{band.name}\"\n end\n end", "title": "" }, { "docid": "f557e3f03df33781cf6db7d9d65e0d99", "score": "0.579021", "text": "def print_ascii_report\n\tputs \" \"\n\tputs \" _____ _ _____ _ \"\n\tputs \" / ____| | | | __ \\\\ | | \"\n\tputs \" | (___ __ _| | ___ ___ | |__) |___ _ __ ___ _ __| |_ \"\n\tputs \" \\\\___ \\\\ / _` | |/ _ \\\\/ __| | _ // _ \\\\ '_ \\\\ / _ \\\\| '__| __|\"\n\tputs \" ____) | (_| | | __/\\\\__ \\\\ | | \\\\ \\\\ __/ |_) | (_) | | | |_ \"\n\tputs \" |_____/ \\\\__,_|_|\\\\___||___/ |_| \\\\_\\\\___| .__/ \\\\___/|_| \\\\__|\"\n\tputs \" | | \"\n\tputs \" |_| \"\n\tputs \" \"\nend", "title": "" }, { "docid": "d8985adc3c5c0fe7c1b458518717c018", "score": "0.5786584", "text": "def print_in_box(text)\n horizontal = \"+\" + \"-\" * (text.length + 2) + \"+\"\n text_line = \"| \" + text + \" |\"\n vertical = \"|\" + \" \" * (text.length + 2) + \"|\"\n\n puts horizontal\n puts vertical\n puts text_line\n puts vertical\n puts horizontal\nend", "title": "" }, { "docid": "fee5c8d00bec26992b6e02c5b1e21073", "score": "0.57801825", "text": "def display_board(board)\n cell1 = \" #{board[0]} \"\n cell2 = \" #{board[1]} \"\n cell3 = \" #{board[2]} \"\n cell4 = \" #{board[3]} \"\n cell5 = \" #{board[4]} \"\n cell6 = \" #{board[5]} \"\n cell7 = \" #{board[6]} \"\n cell8 = \" #{board[7]} \"\n cell9 = \" #{board[8]} \"\n box = \"|\"\n line = \"-----------\"\n print cell1, box, cell2, box, cell3\n print \"\\n\",line\n print \"\\n\",cell4, box, cell5, box, cell6\n print \"\\n\",line\n print \"\\n\",cell7, box, cell8, box, cell9, \"\\n\"\nend", "title": "" }, { "docid": "cfbca174cf9a29b324df246b637915e7", "score": "0.5778183", "text": "def display_board(stuff)\n print \"\\t|\\s#{stuff[1]}\\s\".colorize(:cyan)\n print \"|\\s#{stuff[2]}\\s\".colorize(:cyan)\n puts \"|\\s#{stuff[3]}\\s|\".colorize(:cyan)\n puts \"\\t-------------\".colorize(:cyan)\n print \"\\t|\\s#{stuff[4]}\\s\".colorize(:cyan)\n print \"|\\s#{stuff[5]}\\s\".colorize(:cyan)\n puts \"|\\s#{stuff[6]}\\s|\".colorize(:cyan)\n puts \"\\t-------------\".colorize(:cyan)\n print \"\\t|\\s#{stuff[7]}\\s\".colorize(:cyan)\n print \"|\\s#{stuff[8]}\\s\".colorize(:cyan)\n puts \"|\\s#{stuff[9]}\\s|\".colorize(:cyan)\nend", "title": "" }, { "docid": "5e06566efdbae36e2a6556a2dda9c3fd", "score": "0.57731724", "text": "def print_bands_for_concert_id(user_input)\n puts \"#{pastel.bright_cyan('Here are the headliners for this concert:')}\"\n puts \" \"\n selected_bands = Concert.find(user_input).bands\n selected_bands.each do |band|\n puts \"#{band.id}. #{band.name}\"\n end\n end", "title": "" }, { "docid": "8e224703cdc0d25f2399687ee65854a8", "score": "0.5771677", "text": "def to_text\n text = \"#{title.center(fretboard.first.size)}\\n\"\n text << fretboard.join(\"\\n\")\n end", "title": "" }, { "docid": "8183ddfd87140468d4836f887b225b56", "score": "0.5766456", "text": "def game_banner\n puts <<-GRID\n ####### ####### ########{' '}\n # # ##{' '}\n # # ##{' '}\n # ## #### # #### #### # #### ####{' '}\n # # # # # # # # # ## ## # ##{' '}\n # # # # #### # # # # ######{' '}\n # # ## # # # ## # ## ## ##{' '}\n ### ### #### ### ##### #### ### #### ####\n GRID\nend", "title": "" }, { "docid": "d30df695d4459f3e7190083ee67d08b6", "score": "0.5764301", "text": "def ascii_heading(title_text)\n title = Artii::Base.new :font => 'doom'\n print title.asciify(title_text).colorize(:green) # colours the ascii art.\n space\nend", "title": "" }, { "docid": "fe30dd9785d58a4bf618544142441641", "score": "0.57632047", "text": "def header\n\t\t\t\tputs stars(47).green\n\t\t\t\tputs \"* \".green + \" _____ _ _ _ _ \".light_red + \" *\".green\n\t\t\t\tputs \"* \".green + \" / ____| | | | | | (_) \".light_red + \" *\".green\n\t\t\t\tputs \"* \".green + \" | (___ ___ _ __ __ _| |__ | |__ | |_ \".light_red + \" *\".green\n\t\t\t\tputs \"* \".green + \" \\\\___ \\\\ / __| '__/ _` | '_ \\\\| '_ \\\\| | | \".light_red + \" *\".green\n\t\t\t\tputs \"* \".green + \" ____) | (__| | | (_| | |_) | |_) | | | \".light_red + \" *\".green\n\t\t\t\tputs \"* \".green + \" |_____/ \\\\___|_| \\\\__,_|_.__/|_.__/|_|_| \".light_red + \" *\".green\n\t\t\t\tputs \"* \".green + \" \".light_red + \" *\".green\n\t\t\tend", "title": "" }, { "docid": "d4289c64095e55575947b0600181c827", "score": "0.5762542", "text": "def print_pretty (list)\n puts \"Grocery list\".upcase.center(50)\n puts \"-----------------\".center(50)\n list.each do |item,quantity|\n puts item.rjust(25) + \":\" + quantity.to_s.ljust(25) \n end\nend", "title": "" }, { "docid": "ad8ca66df5e668bed013d8916993c6a9", "score": "0.57620597", "text": "def disp\n 3.times do |i|\n chars = []\n @win_vecs[i].squares.each {|square| chars << square.fill}\n\n #Everything after the tab character is just a lazy way of writing the helper display,\n #the numbers 1-9 in three rows\n puts(\"#{chars.join}\\t#{3*i+1}#{3*i+2}#{3*i+3}\")\n end\n end", "title": "" }, { "docid": "6087af6f62d2b3167b8f9b1e466e6b1a", "score": "0.5761575", "text": "def ask_for_favorite_band\n puts \"Type the #{pastel.bright_cyan(\"number\")} of your favorite band to see their\"\n puts \"upcoming concerts.\"\n separator\n end", "title": "" }, { "docid": "fc28ee279347617e5da529ac782745fb", "score": "0.5759701", "text": "def display_board\n cell = \" \"\n divider = \"|\"\n demarcator = \"\"\n 11.times { demarcator << \"-\" }\n row = cell + divider + cell + divider + cell\n\n puts row\n puts demarcator\n puts row\n puts demarcator\n puts row\nend", "title": "" } ]
fb2e1eed49d66fa6ee561014c70b1e4f
GET /harvestings GET /harvestings.json
[ { "docid": "0af92e0143930abde8dae8f16a937365", "score": "0.7061671", "text": "def index\n if params[:harvest_id]\n @parent = Harvest.find(params[:harvest_id])\n @harvestings = @parent.harvestings\n elsif params[:person_id]\n @parent = Person.find(params[:person_id])\n @harvestings = @parent.harvestings\n else\n #should not get here\n @harvestings = Harvesting.all\n end\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @harvestings }\n end\n end", "title": "" } ]
[ { "docid": "381f228778d3343e3e046de490404528", "score": "0.7933294", "text": "def index\n @harvestings = Harvesting.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @harvestings }\n end\n end", "title": "" }, { "docid": "9a4bdc306b2fce44b205ecd3404f4c07", "score": "0.759102", "text": "def index\n @harvestings = Harvesting.all\n end", "title": "" }, { "docid": "516aed6af6ba3ced8a5dbcd821d0b24b", "score": "0.7488451", "text": "def index\n @harvests = Harvest.all\n @upcoming_harvests = Harvest.upcoming\n @past_harvests = Harvest.past\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @harvests }\n end\n end", "title": "" }, { "docid": "e2edcd3b2087fb64bf1c81a3ab90cb6e", "score": "0.74614376", "text": "def show\n @harvest = Harvest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @harvest }\n end\n end", "title": "" }, { "docid": "e2edcd3b2087fb64bf1c81a3ab90cb6e", "score": "0.74614376", "text": "def show\n @harvest = Harvest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @harvest }\n end\n end", "title": "" }, { "docid": "4a8838ca4ab46f88e4478992f6db1524", "score": "0.7316833", "text": "def index\n @harvests = Harvest.all\n end", "title": "" }, { "docid": "b7b015a7218e025b3405d79b0ea65837", "score": "0.70436", "text": "def index\n @upcoming_harvests = Harvest.upcoming\n @past_harvests = Harvest.past\n\n if params[:person_id]\n @person = Person.find(params[:person_id])\n @upcoming_harvests = @person.upcoming_harvests\n @past_harvests = @person.past_harvests\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @harvests }\n end\n end", "title": "" }, { "docid": "4a2b45925a115751df0545dedf8f60b6", "score": "0.66975266", "text": "def get_brandings\n request :get, \"/v3/brandings.json\"\n end", "title": "" }, { "docid": "4b3debf4fe8b4dbfb1f1eb9e545a3ff4", "score": "0.62321043", "text": "def index\n @buildings = Building.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json :@buildings }\n end\n end", "title": "" }, { "docid": "e54f7fbe291d92d0bec422005755ae48", "score": "0.6221927", "text": "def set_harvest\n @harvest = Harvest.find(params[:id])\n end", "title": "" }, { "docid": "f05b04213cabc2ec92f7ffa072d44ec5", "score": "0.62034315", "text": "def show\n @harvest_trello = HarvestTrello.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @harvest_trello }\n end\n end", "title": "" }, { "docid": "46fed15572cb8f8566e04accc46bee27", "score": "0.61842275", "text": "def index\n @harvest_histories = HarvestHistory.all\n end", "title": "" }, { "docid": "6a1818cc94d3bac9fc0fd4c3a147a0a6", "score": "0.611925", "text": "def index\n @apartments = @building.apartments\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @apartments }\n end\n end", "title": "" }, { "docid": "7bf278041bd23f7564ff918e871cb1cc", "score": "0.60985076", "text": "def index\n @sightings = Sighting.all\n render json: @sightings\n end", "title": "" }, { "docid": "c1926cb630be9a759273fed22b936329", "score": "0.6058277", "text": "def create\n @harvest = Harvest.new(params[:harvest])\n\n respond_to do |format|\n if @harvest.save\n format.html { redirect_to @harvest, notice: 'Harvest was successfully created.' }\n format.json { render json: @harvest, status: :created, location: @harvest }\n else\n format.html { render action: \"new\" }\n format.json { render json: @harvest.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c1926cb630be9a759273fed22b936329", "score": "0.6058277", "text": "def create\n @harvest = Harvest.new(params[:harvest])\n\n respond_to do |format|\n if @harvest.save\n format.html { redirect_to @harvest, notice: 'Harvest was successfully created.' }\n format.json { render json: @harvest, status: :created, location: @harvest }\n else\n format.html { render action: \"new\" }\n format.json { render json: @harvest.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fdade8612915ba9d448ad640307de4ae", "score": "0.6037927", "text": "def index\n @listings = Listing.all\n render json: @listings\n end", "title": "" }, { "docid": "ac8355d07e1353ac36659b08db8f2002", "score": "0.6022372", "text": "def index\n @bookings = Booking.all\n\n render json: @bookings\n end", "title": "" }, { "docid": "e0d27dbb67a1eaa372deed1582682758", "score": "0.600474", "text": "def index\n render json: { bookings: @site.bookings.order(datetime: :asc) }, status: 200\n end", "title": "" }, { "docid": "9e01629b8387d5f27b2175962d27db9e", "score": "0.59879345", "text": "def index\n page_number = params[:page] ? params[:page][:number] : 1\n per_page = params[:per_page] ? params[:per_page] : 10\n\n @standings = Standing.paginate(page: page_number, per_page: per_page)\n\n render json: @standings\n end", "title": "" }, { "docid": "7853f168cadcee39578a5cb384981828", "score": "0.59775025", "text": "def show\n hub = Hub.find(params[:id])\n respond_to do |format|\n format.json { render :json => hub.warehouses }\n end\n end", "title": "" }, { "docid": "2654f3dfe9f9c1c6a2fb150177ec36b3", "score": "0.5970187", "text": "def show\n @kitchen = Kitchen.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kitchen }\n end\n end", "title": "" }, { "docid": "f585455216facddb3a7b7823561141a8", "score": "0.59648305", "text": "def show\n @harvesting = Harvesting.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @harvesting }\n end\n end", "title": "" }, { "docid": "f585455216facddb3a7b7823561141a8", "score": "0.59648305", "text": "def show\n @harvesting = Harvesting.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @harvesting }\n end\n end", "title": "" }, { "docid": "4b0a4b5fb2353f11acc5d5dee0949ee1", "score": "0.5962892", "text": "def new\n @harvesting = Harvesting.new\n @harvesting.harvest_id = params[:harvest_id]\n @harvesting.harvester_id = params[:harvester_id]\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @harvesting }\n end\n end", "title": "" }, { "docid": "ac65cdba86f4316e08a702137c92c0d7", "score": "0.5959013", "text": "def show\n @village = Village.find(params[:id])\n @collections = @village.collections\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @village }\n end\n end", "title": "" }, { "docid": "4a7530e5b675b2359bf65a6a2a518b61", "score": "0.5953038", "text": "def index\n @listings = Listing.by_user(current_user).all\n\n render json: @listings\n end", "title": "" }, { "docid": "aaef4b3f0b6a5cb1ad2e40691643f0d8", "score": "0.59410334", "text": "def index\n @guests = @wedding.guests.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @guests }\n end\n end", "title": "" }, { "docid": "9f70aa2e629d1188b4fdde980f3c1bbf", "score": "0.59154975", "text": "def create\n @harvest = Harvest.new(harvest_params)\n\n respond_to do |format|\n if @harvest.save\n format.html { redirect_to @harvest, notice: 'Harvest was successfully created.' }\n format.json { render :show, status: :created, location: @harvest }\n else\n format.html { render :new }\n format.json { render json: @harvest.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "736663ff47a2d653a5083fe4dba81cbf", "score": "0.590085", "text": "def index\n @chargers = Charger.all\n render json: @chargers\n end", "title": "" }, { "docid": "e9498bb806168cfd23e69728b6ef576e", "score": "0.5898804", "text": "def new\n @harvesting = Harvesting.new \n @harvesting.harvest_id = params[:harvest_id]\n @harvesting.harvester_id = params[:harvester_id]\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @harvesting }\n end\n end", "title": "" }, { "docid": "75dae99f0bfcb0790bd31a946ca7fa7d", "score": "0.5890482", "text": "def show\n render json: @sighting\n end", "title": "" }, { "docid": "874d6a6be871ed2a46cd00d76dcaba9c", "score": "0.5884189", "text": "def pull_time_entries_harvest(user_id)\n harvest_uri = URI(\"https://api.harvestapp.com/v2/time_entries?user_id=#{user_id}&updated_since=#{last_updated_time}\")\n\n Net::HTTP.start(harvest_uri.host, harvest_uri.port, use_ssl: true) do |http|\n harvest_request = Net::HTTP::Get.new harvest_uri\n\n harvest_request[\"Authorization\"] = \"Bearer #{harvest_access_token}\"\n harvest_request[\"Harvest-Account-ID\"] = harvest_account_id\n harvest_request[\"User-Agent\"] = harvest_user_agent\n \n harvest_response = http.request harvest_request\n json_response = JSON.parse(harvest_response.body)\n return json_response[\"time_entries\"]\n end\n end", "title": "" }, { "docid": "f9c06eea712ba9414a4ba542b9682d99", "score": "0.5881944", "text": "def index\n @postings = Posting.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @postings }\n end\n end", "title": "" }, { "docid": "33b586c1c2a6b0ee6e4b770df8f9313a", "score": "0.5876437", "text": "def index\n @plantings = Planting.all\n end", "title": "" }, { "docid": "b5050fec6bce05bf345e907c218e23af", "score": "0.58715546", "text": "def index\n @bookings = Booking.all\n\n respond_to do |format|\n format.html\n format.json { render :json => @bookings }\n end\n end", "title": "" }, { "docid": "5e84fb7ad92950e1b9a1053bc3d51d74", "score": "0.58699703", "text": "def pull_tasks_harvest\n harvest_uri = URI(\"https://api.harvestapp.com/v2/task_assignments?updated_since=#{last_updated_time}\")\n\n Net::HTTP.start(harvest_uri.host, harvest_uri.port, use_ssl: true) do |http|\n harvest_request = Net::HTTP::Get.new harvest_uri\n\n harvest_request[\"Authorization\"] = \"Bearer #{harvest_access_token}\"\n harvest_request[\"Harvest-Account-ID\"] = harvest_account_id\n harvest_request[\"User-Agent\"] = harvest_user_agent\n \n harvest_response = http.request harvest_request\n json_response = JSON.parse(harvest_response.body)\n return json_response[\"task_assignments\"]\n end\n\n end", "title": "" }, { "docid": "c887d344b9ebaccb42b666baa68d6d61", "score": "0.58520603", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @schedule, methods: :bookings }\n end\n end", "title": "" }, { "docid": "26c919d71f46e5c2e953d92b0b05a599", "score": "0.58443516", "text": "def show\n @booking = Booking.find(params[:id])\n @rooms = @booking.rooms\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @booking }\n end\n end", "title": "" }, { "docid": "91cc1d0a829bf873b8ff73d21fdc47b7", "score": "0.583857", "text": "def getbuildings\n \n puts params\n custid = params[\"custormerid\"]\n puts custid\n \n buildings = Building.where(:customer_id => custid)\n puts buildings.inspect\n respond_to do |format|\n puts \"pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp\"\n format.json { render json: buildings }\n end\n \n\n end", "title": "" }, { "docid": "0b02cd49ecfa42162d10e00988515a3f", "score": "0.5835536", "text": "def index\n @listings = Listing.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @listings }\n end\n end", "title": "" }, { "docid": "0b02cd49ecfa42162d10e00988515a3f", "score": "0.5835057", "text": "def index\n @listings = Listing.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @listings }\n end\n end", "title": "" }, { "docid": "d65ce9f0532219b10f9792ac07754e3b", "score": "0.5828257", "text": "def index\n @bookings = Booking.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bookings }\n end\n end", "title": "" }, { "docid": "d65ce9f0532219b10f9792ac07754e3b", "score": "0.5828257", "text": "def index\n @bookings = Booking.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bookings }\n end\n end", "title": "" }, { "docid": "d65ce9f0532219b10f9792ac07754e3b", "score": "0.5828257", "text": "def index\n @bookings = Booking.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bookings }\n end\n end", "title": "" }, { "docid": "9628cbd7217e4f94a674bfe1014d714d", "score": "0.5819354", "text": "def show\n render json: Agent.find(params[:id]).buyers\n end", "title": "" }, { "docid": "a910a57d78b8e21c88472bb4debf1a82", "score": "0.5805979", "text": "def show\n animal = Animal.find(params[:id])\n #return all the sightings for the animal\n render json: animal.to_json(include: :sightings)\nend", "title": "" }, { "docid": "d879f109d3fb7d963674e889e0aae19c", "score": "0.5794037", "text": "def index\n @servings = Serving.all\n end", "title": "" }, { "docid": "733ffeef89b17c8c4b56adeccb14c92e", "score": "0.57921064", "text": "def index\n @admin_villages = Admin::Village.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_villages }\n end\n end", "title": "" }, { "docid": "82d750ba7ebe9ab73331ddede0ef7f15", "score": "0.5789442", "text": "def show\n @holding = Holding.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @holding }\n end\n end", "title": "" }, { "docid": "1ecbca6a0f6801ac1759e3e7be608803", "score": "0.5778515", "text": "def hearings(options = {})\n get('/hearings', options)\n end", "title": "" }, { "docid": "3b64e4e2f28006bd852c83bee8bdbda8", "score": "0.5776877", "text": "def harvest_source\n Source.find_by(user_id: user_id, name: 'harvest')\n end", "title": "" }, { "docid": "4b862462beb1d6d10506f73daf71f18c", "score": "0.5763226", "text": "def index\n sighting = Sighting.all \n render json: SightingSerializer.new(sighting)\n end", "title": "" }, { "docid": "7718399002adf608ec0828824fb9e798", "score": "0.5755496", "text": "def get_buildings_for_customer\n puts \"get_buildings_for_customer\"\n puts params\n @buildings = Building.where(\"customer_id = ?\", params[:customer_id])\n puts \"here are the buildings:\"\n puts @buildings\n respond_to do |format|\n format.json { render :json => @buildings }\n end\n end", "title": "" }, { "docid": "0113ab2129af3339e344abc8a6fed68b", "score": "0.57505727", "text": "def pull_projects_harvest\n harvest_uri = URI(\"https://api.harvestapp.com/v2/projects?updated_since=#{last_updated_time}\")\n\n Net::HTTP.start(harvest_uri.host, harvest_uri.port, use_ssl: true) do |http|\n harvest_request = Net::HTTP::Get.new harvest_uri\n\n harvest_request[\"Authorization\"] = \"Bearer #{harvest_access_token}\"\n harvest_request[\"Harvest-Account-ID\"] = harvest_account_id\n harvest_request[\"User-Agent\"] = harvest_user_agent\n \n harvest_response = http.request harvest_request\n json_response = JSON.parse(harvest_response.body)\n return json_response[\"projects\"]\n end\n end", "title": "" }, { "docid": "f6003fdb66ab5e5dfa606646c43a9fac", "score": "0.57442254", "text": "def show\n @shooting = Shooting.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shooting }\n end\n end", "title": "" }, { "docid": "cba2f1cad1f9c40027496d7a599a48a7", "score": "0.5741954", "text": "def index\n @stalkings = Stalking.where(\"user_id = ?\", current_user.id)\n @stalkings.each do |stalking|\n if @current_user.gh.repository? \"#{stalking.owner}/#{stalking.repo}\"\n stalking.gh = @current_user.gh.repo \"#{stalking.owner}/#{stalking.repo}\"\n else\n stalking.gh = \"#{stalking.owner}/#{stalking.repo}\"\n end\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @stalkings }\n end\n end", "title": "" }, { "docid": "ec38bc9392ae76c4f036d85a2e7ab03d", "score": "0.5739575", "text": "def index\n @job_huntings = JobHunting.search(params[:search])\n end", "title": "" }, { "docid": "72aeaad213caf688a9cc4d4ef42743bc", "score": "0.5739173", "text": "def harvest\n # When you harvest, you must collect food from every one of your fields and record how much total food you have collected. It should display all of this information.\n # (Harvest Crops + Add to total harvested)\n Crop.harvest\n end", "title": "" }, { "docid": "b7547733f418dc2d4037e7cf006121d8", "score": "0.57340145", "text": "def index\n @adopters = Adopter.where(filtering_params)\n\n render json: @adopters\n end", "title": "" }, { "docid": "3f0788e1c6fb09e5a73a929c5f3bdfa5", "score": "0.5726947", "text": "def serve_listing_data\n @listings = Listing.open.joins(:origin_loc).group(\"listings.id\").\n order(\"listings.created_at DESC\").find_with(params, @current_user, @current_community).select(\"listings.id, listing_type, category\")\n render :json => { :data => @listings }\n end", "title": "" }, { "docid": "0a4c32f8f7ddc5bac3b3f02e1dcb2fe6", "score": "0.5716877", "text": "def show\n @outing = Outing.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @outing }\n end\n end", "title": "" }, { "docid": "c40e0bb153086f2ce1e21b786b75df8d", "score": "0.57167953", "text": "def index\n @biddings = Bidding.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @biddings }\n end\n end", "title": "" }, { "docid": "deb913113ab4c0895735e53dc3d11e80", "score": "0.57076186", "text": "def index\n @plants = Plant.all\n\n respond_to do |format|\n format.html\n format.json { render :json => @plants }\n end\n end", "title": "" }, { "docid": "f4cf880f4ab36e81766e9ba007b639bd", "score": "0.5706785", "text": "def index\n @supplysites = Supplysite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @supplysites }\n end\n end", "title": "" }, { "docid": "20d1e5bd211b281cd41a8524ba2a02c2", "score": "0.5699029", "text": "def show\n @apartment = @building.apartments.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @apartment }\n end\n end", "title": "" }, { "docid": "f753b865e2b314cea6151acb78f46a6c", "score": "0.5692009", "text": "def index\n @buildings = Building.all\n end", "title": "" }, { "docid": "b8d90cd7c68e0b763fd944a1d104cb6e", "score": "0.5677807", "text": "def browse\n\t\t@listings = Listings.find(:all)\n\tend", "title": "" }, { "docid": "91efb30aca001a20d4b1389676f58abe", "score": "0.5677256", "text": "def index\n @endorsements = Endorsement.all\n\n render json: @endorsements\n end", "title": "" }, { "docid": "1eac763fdaa37a799f907d15e1f66b6c", "score": "0.56753397", "text": "def show\n @hot_water_distribution = HotWaterDistribution.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @hot_water_distribution }\n end\n end", "title": "" }, { "docid": "b20783d2876b409327fa5c69b5dfc76d", "score": "0.56729233", "text": "def index\n\n # use a shooting collection cache\n\n respond_to do |format|\n format.html # index.html.erb\n format.json do\n @shootings = Shooting.get_shootings_from_yammer(Yammer::TokenClient.new(token: current_user.access_token))\n render json: { shootings: @shootings }\n end\n end\n end", "title": "" }, { "docid": "912ed42e0a9bc6b51d0f5821a53fde81", "score": "0.5669222", "text": "def all_booking_of_client\n\t\t@bookings = Booking.where(client_id: params[:client_id])\n\t\trender json: @bookings, status: 200\n\tend", "title": "" }, { "docid": "8999b9e40f3f457f50cf61e22cd70782", "score": "0.56681097", "text": "def index\n @releases = @environment.releases.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @releases }\n end\n end", "title": "" }, { "docid": "a53b82b401bfa4efbd2b8a40b23d14d8", "score": "0.56664884", "text": "def show\n render json: { booking: @booking }, status: 200\n end", "title": "" }, { "docid": "6bf9715d82c4910e12e0f3afb8f4389d", "score": "0.566614", "text": "def harvest_data_request(account_id, personal_access_token)\n uri = URI.parse(\"https://api.harvestapp.com/api/v2/time_entries?per_page=1&ref=last\")\n request = Net::HTTP::Get.new(uri)\n request[\"Harvest-Account-Id\"] = account_id\n request[\"Authorization\"] = \"Bearer #{personal_access_token}\"\n request[\"User-Agent\"] = \"Harvest API Example\"\n \n req_options = {\n use_ssl: uri.scheme == \"https\",\n }\n \n response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|\n http.request(request)\n end\n \n data = JSON.pretty_generate(JSON.parse(response.body))\n return data\n end", "title": "" }, { "docid": "269fe06aba8d1444b9b96342e4a6904b", "score": "0.56613165", "text": "def show\n #@restroom = Restroom.find(params[:id])\n @venue = client.venue(:query => params[:venue_id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @restroom }\n end\n end", "title": "" }, { "docid": "bc252e93bcfa619e1d81128e06519ecf", "score": "0.56586856", "text": "def show\n @sherlock = Sherlock.find(params[:id])\n @region_size = Apartment.find_size_of_region(@sherlock.region_id)\n\t\t@apartments = Apartment.find_with_features(@sherlock.required, @sherlock.desired, @sherlock.nots, @sherlock.region_id, @sherlock.price_min, @sherlock.price_max)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @sherlock }\n end\n end", "title": "" }, { "docid": "d8b6dcb88892dd53faa48bb30099de31", "score": "0.5657422", "text": "def show\n @gig = Gig.find(params[:id])\n\n respond_to do |format|\n format.html {render json: @gig, status: :ok}\n format.json { render json: @gig, status: :ok }\n end\n end", "title": "" }, { "docid": "44d5acb06e2ade67d9ae85035e170be5", "score": "0.565724", "text": "def index\n pet_type = PetType.find(params[:pet_type_id])\n @pet_breeds = pet_type.pet_breeds.select { | match | match.published }\n\n respond_to do | format |\n format.html #index.html.erb\n format.json { render json: @pet_breeds }\n end\n end", "title": "" }, { "docid": "e0cd9e8423e6b1ebbaad2a2b5f7e9d95", "score": "0.5657034", "text": "def show\n render json: @listing\n end", "title": "" }, { "docid": "46f93a2ee41e94f58d32980d2e651d9a", "score": "0.56548", "text": "def show\n @vegetable = Vegetable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vegetable }\n end\n end", "title": "" }, { "docid": "e3a1b43d85769080eed6c4cea1fd1de0", "score": "0.5646934", "text": "def index\n if (params[:redirect] == \"on\")\n sql = <<-SQL\n WITH src AS (SELECT id, daughters(id)\n FROM kine WHERE owner_id = #{params[:search_owner]})\n SELECT json_agg(src) FROM src;\n SQL\n render json: ActiveRecord::Base.connection.select_value(sql)\n else\n @daughters = Daughter.all\n end\n end", "title": "" }, { "docid": "4c615594324e539510da93c2ec3ad928", "score": "0.56460905", "text": "def show\n @stalking = Stalking.find(params[:id])\n @require_js[:script] = 'views/StalkingView'\n @require_js[:params][:stalking] = @stalking\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stalking }\n end\n end", "title": "" }, { "docid": "4544e28b9900085c8ae64c104d69ec20", "score": "0.5644766", "text": "def show\n animal = Animal.find(params[:id])\n render json: animal.as_json(include: :sightings) \n end", "title": "" }, { "docid": "106a006d1772dba771f3103a72316652", "score": "0.5644195", "text": "def index # public\n if params[:shelter_id]\n set_shelter\n render json: @shelter.animals\n else\n @animals = Animal.includes(:shelter).all\n render 'index.json.jbuilder'\n end\n end", "title": "" }, { "docid": "bdcb6de42f55876bd918f761f2c02054", "score": "0.5640755", "text": "def index\n @bookings = @hairdresser.bookings\n end", "title": "" }, { "docid": "9867853de5a356050c822b195bd980ba", "score": "0.56402904", "text": "def index\n @engravings = Engraving.all.paginate(page: params[:page], per_page: 50).order('name ASC')\n end", "title": "" }, { "docid": "c4a61e186e27c46bd14e1cb9176a16fd", "score": "0.5638043", "text": "def index\n @building = Building.find(params[:building_id])\n @listings = Listing.all\n end", "title": "" }, { "docid": "aa8212221120563726c085c14bfb7d10", "score": "0.562964", "text": "def show\n @booking = Booking.find(params[:id])\n render json: @booking\nend", "title": "" }, { "docid": "6fd41785e23ea733c905e419600e0c13", "score": "0.5629087", "text": "def show\n sighting = Sighting.find(params[:id])\n #render json: sighting.to_json(:include => {:bird => {:only =>[:name, :species]}, :location => {:only =>[:latitude, :longitude]}}, :except => [:updated_at])\n end", "title": "" }, { "docid": "7ba62d65d5efb47a8f4b0d92d4bffc95", "score": "0.5619633", "text": "def show\n render json: @onboarding\n end", "title": "" }, { "docid": "c580de82090f26598d8c8c20478e2935", "score": "0.56170887", "text": "def show\n @stashed_inventory = StashedInventory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stashed_inventory }\n end\n end", "title": "" }, { "docid": "a38bf56b9751a0a0e9a0b05f2705f511", "score": "0.5610657", "text": "def index\n @packing_quantities = PackingQuantity.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @packing_quantities }\n end\n end", "title": "" }, { "docid": "176cfab8cc10a95aa56961f273b90077", "score": "0.5607405", "text": "def fetch\n self.class.new(@harvest_client.get(path), harvest_client: @harvest_client)\n end", "title": "" }, { "docid": "7485c87294642c54c8725a9aaf63c380", "score": "0.56008446", "text": "def show\n render json: @booking\n end", "title": "" }, { "docid": "7485c87294642c54c8725a9aaf63c380", "score": "0.56008446", "text": "def show\n render json: @booking\n end", "title": "" }, { "docid": "e157caa55aae98ebd6e668a5db54ac16", "score": "0.56002986", "text": "def index\n @foodhampers = Foodhamper.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @foodhampers }\n end\n end", "title": "" }, { "docid": "0a1d0ac4d25875d8fc731c4a715fc360", "score": "0.55996275", "text": "def index\n @spoofers = Spoofer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @spoofers }\n end\n end", "title": "" }, { "docid": "dce134b652c7c89e2f21565d523c516b", "score": "0.5589979", "text": "def index\n @floor_plans = @product.floor_plans\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @floor_plans }\n end\n end", "title": "" }, { "docid": "88026de59f58a8e1261e4702717be890", "score": "0.5585699", "text": "def index_hosting\n puts \"user: #{@current_user.json_hash[:id]}\"\n dinners = []\n @dinners = @current_user.hosted_dinners\n @dinners.each do |dinner|\n dinners << dinner.all_info\n end\n render json: dinners\n end", "title": "" } ]
a6527a2ee7f77ed7a93a4b65ae76ef25
Obtain an InputSet object, used to define inputs for an execution of this Choreo.
[ { "docid": "4d325c71ca38e50b7c4ef0e289adca1e", "score": "0.0", "text": "def new_input_set()\n return DeleteBloodPressureLogInputSet.new()\n end", "title": "" } ]
[ { "docid": "d8eb34cfc5a1e737977f7023d4849c46", "score": "0.6741255", "text": "def new_input_set()\n return CreateObjectInputSet.new()\n end", "title": "" }, { "docid": "7c0d7c433cd4eb8e36bdc3a383e9ec33", "score": "0.65807736", "text": "def new_input_set()\n return RunRightScriptInputSet.new()\n end", "title": "" }, { "docid": "9a1c545ea1874b95135d6fa2e97a3506", "score": "0.6556434", "text": "def new_input_set()\n return InfluenceInputSet.new()\n end", "title": "" }, { "docid": "29907c20e026c8e930162f65d638136a", "score": "0.65388954", "text": "def new_input_set()\n return CreateSpreadsheetInputSet.new()\n end", "title": "" }, { "docid": "2c34e688c22d54eee9ac73db29a9af31", "score": "0.65161115", "text": "def new_input_set()\n return RetrieveSpreadsheetsInputSet.new()\n end", "title": "" }, { "docid": "550b21e09ba37b82468d9f6bcdb25a60", "score": "0.64986855", "text": "def new_input_set()\n return GetInputSet.new()\n end", "title": "" }, { "docid": "379f2bad1ebdcf9ebf33ef4260d37912", "score": "0.6492222", "text": "def new_input_set()\n return GetInputSet.new()\n end", "title": "" }, { "docid": "379f2bad1ebdcf9ebf33ef4260d37912", "score": "0.6492222", "text": "def new_input_set()\n return GetInputSet.new()\n end", "title": "" }, { "docid": "379f2bad1ebdcf9ebf33ef4260d37912", "score": "0.6492222", "text": "def new_input_set()\n return GetInputSet.new()\n end", "title": "" }, { "docid": "379f2bad1ebdcf9ebf33ef4260d37912", "score": "0.6492222", "text": "def new_input_set()\n return GetInputSet.new()\n end", "title": "" }, { "docid": "379f2bad1ebdcf9ebf33ef4260d37912", "score": "0.6492222", "text": "def new_input_set()\n return GetInputSet.new()\n end", "title": "" }, { "docid": "379f2bad1ebdcf9ebf33ef4260d37912", "score": "0.6492222", "text": "def new_input_set()\n return GetInputSet.new()\n end", "title": "" }, { "docid": "379f2bad1ebdcf9ebf33ef4260d37912", "score": "0.6492222", "text": "def new_input_set()\n return GetInputSet.new()\n end", "title": "" }, { "docid": "379f2bad1ebdcf9ebf33ef4260d37912", "score": "0.64915335", "text": "def new_input_set()\n return GetInputSet.new()\n end", "title": "" }, { "docid": "379f2bad1ebdcf9ebf33ef4260d37912", "score": "0.64915335", "text": "def new_input_set()\n return GetInputSet.new()\n end", "title": "" }, { "docid": "379f2bad1ebdcf9ebf33ef4260d37912", "score": "0.64915335", "text": "def new_input_set()\n return GetInputSet.new()\n end", "title": "" }, { "docid": "379f2bad1ebdcf9ebf33ef4260d37912", "score": "0.64915335", "text": "def new_input_set()\n return GetInputSet.new()\n end", "title": "" }, { "docid": "b5b19e14ef652ba534c75a67d28d5236", "score": "0.6476164", "text": "def new_input_set()\n return ObjectGetInputSet.new()\n end", "title": "" }, { "docid": "5c261c4f514387dc0bd2e36bca490fd9", "score": "0.64687127", "text": "def new_input_set()\n return SetMetadataInputSet.new()\n end", "title": "" }, { "docid": "f8d996fb44a483923da55677c9ea943f", "score": "0.64591914", "text": "def new_input_set()\n return GetInputSet.new()\n end", "title": "" }, { "docid": "f8d996fb44a483923da55677c9ea943f", "score": "0.64591914", "text": "def new_input_set()\n return GetInputSet.new()\n end", "title": "" }, { "docid": "f8d996fb44a483923da55677c9ea943f", "score": "0.64591914", "text": "def new_input_set()\n return GetInputSet.new()\n end", "title": "" }, { "docid": "f8d996fb44a483923da55677c9ea943f", "score": "0.64591914", "text": "def new_input_set()\n return GetInputSet.new()\n end", "title": "" }, { "docid": "d55def6014dc613a08ef1401ddcfa074", "score": "0.642129", "text": "def new_input_set()\n return BasicInputSet.new()\n end", "title": "" }, { "docid": "cf3e71bcb13be6d948718b9d1e7354bc", "score": "0.6381516", "text": "def new_input_set()\n return ProgramsInputSet.new()\n end", "title": "" }, { "docid": "b1a874e2ec5274ef3952f3e169d22eba", "score": "0.6371886", "text": "def new_input_set()\n return SetFileInputSet.new()\n end", "title": "" }, { "docid": "25879866dea24acc89b70986cf01ac98", "score": "0.6368726", "text": "def new_input_set()\n return PutObjectInputSet.new()\n end", "title": "" }, { "docid": "56b7ea1d7ddc8a60e0537ad5f22679c9", "score": "0.63627803", "text": "def new_input_set()\n return PutInputSet.new()\n end", "title": "" }, { "docid": "f209c20373044baac4b4f6157c773b86", "score": "0.63617754", "text": "def new_input_set()\n return RunInstancesInputSet.new()\n end", "title": "" }, { "docid": "bb497e0ab4991de72c54da5c0fb52583", "score": "0.63565624", "text": "def new_input_set()\n return RunCommandInputSet.new()\n end", "title": "" }, { "docid": "b56b28461b85253e529b25dfee370051", "score": "0.63318914", "text": "def new_input_set()\n return GetEntityInputSet.new()\n end", "title": "" }, { "docid": "066356cae9f13cc656a69bf4b5db5fb7", "score": "0.6324428", "text": "def new_input_set()\n return BiosInputSet.new()\n end", "title": "" }, { "docid": "87d45711e5820be0aa278888ebc9e8f5", "score": "0.6308983", "text": "def new_input_set()\n return GetInstanceInputSet.new()\n end", "title": "" }, { "docid": "00dadedc1b0f258f11e02f7c22d148ba", "score": "0.63031644", "text": "def new_input_set()\n return GetUserExercisesInputSet.new()\n end", "title": "" }, { "docid": "a914ec52ac98475f1670cfd25388079f", "score": "0.63020617", "text": "def new_input_set()\n return GetExerciseInputSet.new()\n end", "title": "" }, { "docid": "a914ec52ac98475f1670cfd25388079f", "score": "0.63020617", "text": "def new_input_set()\n return GetExerciseInputSet.new()\n end", "title": "" }, { "docid": "709d525e0e00485c79b0309ce3bb1798", "score": "0.62941414", "text": "def new_input_set()\n return BatchInputSet.new()\n end", "title": "" }, { "docid": "404f3e7d7fcabdc3dd4f812917053cc9", "score": "0.62734056", "text": "def new_input_set()\n return ObjectSetInputSet.new()\n end", "title": "" }, { "docid": "ee223e52966b1d6604840d09929b90a6", "score": "0.6266258", "text": "def new_input_set()\n return UserInputSet.new()\n end", "title": "" }, { "docid": "bf2828072767f9efa0a0fb9b08f720d8", "score": "0.62645155", "text": "def new_input_set()\n return RetrieveWorksheetInputSet.new()\n end", "title": "" }, { "docid": "f3959501a2a021b252c666d045d3f234", "score": "0.6261449", "text": "def new_input_set()\n return Step1InputSet.new()\n end", "title": "" }, { "docid": "5532b50427f87e1b76abdbf99fac74b7", "score": "0.6260382", "text": "def new_input_set()\n return GetUserInputSet.new()\n end", "title": "" }, { "docid": "5532b50427f87e1b76abdbf99fac74b7", "score": "0.6260382", "text": "def new_input_set()\n return GetUserInputSet.new()\n end", "title": "" }, { "docid": "5532b50427f87e1b76abdbf99fac74b7", "score": "0.6260382", "text": "def new_input_set()\n return GetUserInputSet.new()\n end", "title": "" }, { "docid": "c052bcbb503b9e0b18bbe118631b548c", "score": "0.62565565", "text": "def new_input_set()\n return UpdateWorksheetInputSet.new()\n end", "title": "" }, { "docid": "c7705f845a9c6ea4e427a87735be5b51", "score": "0.62493753", "text": "def new_input_set()\n return RetrieveWorksheetsInputSet.new()\n end", "title": "" }, { "docid": "769d3f34ee661176af63874d07074fbb", "score": "0.62485135", "text": "def new_input_set()\n return CreateIdentityInputSet.new()\n end", "title": "" }, { "docid": "ffe7e3b018e447db78c5a0518f998870", "score": "0.6244241", "text": "def new_input_set()\n return MakeCallInputSet.new()\n end", "title": "" }, { "docid": "467b4e0e6f3a9454c990d0e286bf620b", "score": "0.6243314", "text": "def new_input_set()\n return RequestInputSet.new()\n end", "title": "" }, { "docid": "4aa3f85ab03137f36f633df9f38ea681", "score": "0.62290496", "text": "def new_input_set()\n return GetRequestInputSet.new()\n end", "title": "" }, { "docid": "79843878bb9300894fb2199f81979b2b", "score": "0.62286", "text": "def new_input_set()\n return ShoutInputSet.new()\n end", "title": "" }, { "docid": "79843878bb9300894fb2199f81979b2b", "score": "0.62286", "text": "def new_input_set()\n return ShoutInputSet.new()\n end", "title": "" }, { "docid": "7b8d3703808fe08c19e80b412c2b0e18", "score": "0.6224668", "text": "def new_input_set()\n return ZipObjectInputSet.new()\n end", "title": "" }, { "docid": "6eb6b8cd034e679fe98e77647f2476f9", "score": "0.6223303", "text": "def new_input_set()\n return GetObjectInputSet.new()\n end", "title": "" }, { "docid": "8eb9fefe6b62239f6988ebc1527b8479", "score": "0.62172645", "text": "def new_input_set()\n return SetupAppInputSet.new()\n end", "title": "" }, { "docid": "bf770232f660ecdb3d38d56dadfc5428", "score": "0.621097", "text": "def new_input_set()\n return UpdateObjectInputSet.new()\n end", "title": "" }, { "docid": "611b2696535f52c9aa1ceb3cbe28707e", "score": "0.62102455", "text": "def new_input_set()\n return ByIDInputSet.new()\n end", "title": "" }, { "docid": "1a97f67cb954a4e66621ab0d75eae4a4", "score": "0.6200193", "text": "def new_input_set()\n return CreateRunInputSet.new()\n end", "title": "" }, { "docid": "0b7e9cc6194b00c39e6628fa4230e482", "score": "0.61982733", "text": "def new_input_set()\n return PromptInputSet.new()\n end", "title": "" }, { "docid": "182a6a0d363403c3cc8dd6367a6124a4", "score": "0.6185865", "text": "def new_input_set()\n return CreateUserInputSet.new()\n end", "title": "" }, { "docid": "182a6a0d363403c3cc8dd6367a6124a4", "score": "0.6185865", "text": "def new_input_set()\n return CreateUserInputSet.new()\n end", "title": "" }, { "docid": "182a6a0d363403c3cc8dd6367a6124a4", "score": "0.6185865", "text": "def new_input_set()\n return CreateUserInputSet.new()\n end", "title": "" }, { "docid": "0cb71aa600d05441ccd00b08dfb8e48b", "score": "0.6184399", "text": "def new_input_set()\n return JSONInputSet.new()\n end", "title": "" }, { "docid": "62fe51e141f384411c60877192d0ec81", "score": "0.6182939", "text": "def new_input_set()\n return XLSToXMLInputSet.new()\n end", "title": "" }, { "docid": "5376915a27d7fb0b51877c970f87d041", "score": "0.6179545", "text": "def new_input_set()\n return UpdateInputSet.new()\n end", "title": "" }, { "docid": "5376915a27d7fb0b51877c970f87d041", "score": "0.6179545", "text": "def new_input_set()\n return UpdateInputSet.new()\n end", "title": "" }, { "docid": "5376915a27d7fb0b51877c970f87d041", "score": "0.6179545", "text": "def new_input_set()\n return UpdateInputSet.new()\n end", "title": "" }, { "docid": "5376915a27d7fb0b51877c970f87d041", "score": "0.6179545", "text": "def new_input_set()\n return UpdateInputSet.new()\n end", "title": "" }, { "docid": "5376915a27d7fb0b51877c970f87d041", "score": "0.6179545", "text": "def new_input_set()\n return UpdateInputSet.new()\n end", "title": "" }, { "docid": "bd0101b9e34c6803ca688f3d948e95c2", "score": "0.617464", "text": "def new_input_set()\n return CheckinsInputSet.new()\n end", "title": "" }, { "docid": "7538b39dab9bcfd3cbb8ebc7d7d657fd", "score": "0.61734647", "text": "def new_input_set()\n return GetBatchEntitiesInputSet.new()\n end", "title": "" }, { "docid": "dd365cc11da27c281ef655ce6724d65a", "score": "0.6151524", "text": "def new_input_set()\n return AllExercisesInputSet.new()\n end", "title": "" }, { "docid": "a9a72e1a6d46022f4fdd1f0c5c997aaa", "score": "0.61511445", "text": "def new_input_set()\n return RequestBodyHelperInputSet.new()\n end", "title": "" }, { "docid": "030769a221222accfa48c98dd3b5b82e", "score": "0.6150061", "text": "def new_input_set()\n return GetFileInputSet.new()\n end", "title": "" }, { "docid": "030769a221222accfa48c98dd3b5b82e", "score": "0.6150061", "text": "def new_input_set()\n return GetFileInputSet.new()\n end", "title": "" }, { "docid": "02cfd8f8f3979788d2f27409445d4875", "score": "0.61484975", "text": "def new_input_set()\n return AddWorksheetInputSet.new()\n end", "title": "" }, { "docid": "4efc0cadb538e9a2c27ec5236a0ecd34", "score": "0.61416376", "text": "def new_input_set()\n return ReadRunsInputSet.new()\n end", "title": "" }, { "docid": "d2521e23ead007b8b93906ddc8040ab8", "score": "0.6139173", "text": "def new_input_set()\n return UpdateInputSet.new()\n end", "title": "" }, { "docid": "9e4cf9a96e0c729dad5744955375204e", "score": "0.6135796", "text": "def new_input_set()\n return XMLInputSet.new()\n end", "title": "" }, { "docid": "836c2c9cc39285b687b5de5a70317769", "score": "0.613209", "text": "def new_input_set()\n return PersonInputSet.new()\n end", "title": "" }, { "docid": "00d56ff820361b7d760fa7b5e7858fd5", "score": "0.61318254", "text": "def new_input_set()\n return GetObjectMetadataInputSet.new()\n end", "title": "" }, { "docid": "d8942e33f2e07cacde796302ca285385", "score": "0.6131694", "text": "def new_input_set()\n return GetIdentityInfoInputSet.new()\n end", "title": "" }, { "docid": "7d73a56c10e7fa37f258709d4b288d8b", "score": "0.6123712", "text": "def new_input_set()\n return WeatherForPointsOnLineSummarizedInputSet.new()\n end", "title": "" }, { "docid": "6b5d8cc7010422f605bc3d1d42777f00", "score": "0.6119308", "text": "def new_input_set()\n return BooksInputSet.new()\n end", "title": "" }, { "docid": "d42e01ecbf24af0c33420900f25307da", "score": "0.611637", "text": "def new_input_set()\n return GetBodyFatGoalInputSet.new()\n end", "title": "" }, { "docid": "6691e89220dd2cf94464453b920ca2ba", "score": "0.61146045", "text": "def new_input_set()\n return CreateApplicationInputSet.new()\n end", "title": "" }, { "docid": "479e1a1717b71707d4cb7407537912c1", "score": "0.61144096", "text": "def new_input_set()\n return GetFoodsInputSet.new()\n end", "title": "" }, { "docid": "f68b9c0f9f8907610bc7c6aa2971e6e1", "score": "0.6114297", "text": "def new_input_set()\n return GetApplicationInputSet.new()\n end", "title": "" }, { "docid": "2a912f01ea4aeedea2ef244ac39530a1", "score": "0.61107457", "text": "def new_input_set()\n return GetFoodsInputSet.new()\n end", "title": "" }, { "docid": "605dbe1e383f90060126a3df550624a1", "score": "0.61088043", "text": "def new_input_set()\n return FindStoriesByIDInputSet.new()\n end", "title": "" }, { "docid": "5fa506746a74f11c5f20a3011338bc8e", "score": "0.6106049", "text": "def new_input_set()\n return GetRecommendationsInputSet.new()\n end", "title": "" }, { "docid": "42de1999e12fad7d4bda6074a6262364", "score": "0.6104503", "text": "def new_input_set()\n return GetActivitiesInputSet.new()\n end", "title": "" }, { "docid": "178aa355ac1f2e4a14d11cdcdbf9c0e1", "score": "0.6100722", "text": "def new_input_set()\n return ReadProductInputSet.new()\n end", "title": "" }, { "docid": "ed0006e02a92f1f30f84ad61e8963bdc", "score": "0.6095114", "text": "def new_input_set()\n return LaunchArrayInstanceInputSet.new()\n end", "title": "" }, { "docid": "29ff45390f218209f53a64d677310cc7", "score": "0.6081927", "text": "def new_input_set()\n return GetActivitiesInputSet.new()\n end", "title": "" }, { "docid": "cd5134586aa1285a01ea54514f3e1190", "score": "0.60808045", "text": "def new_input_set()\n return GetRelationshipInputSet.new()\n end", "title": "" }, { "docid": "068666118f42a5a46dc9efe821367cb3", "score": "0.6079427", "text": "def new_input_set()\n return RetrieveUserInputSet.new()\n end", "title": "" }, { "docid": "dfebd182fc2ae9ee2b32d74ecded10eb", "score": "0.60780126", "text": "def new_input_set()\n return ReadGraphInputSet.new()\n end", "title": "" }, { "docid": "3cf345f748d4247aab680a45a4f89946", "score": "0.6077781", "text": "def new_input_set()\n return UpdateUserInputSet.new()\n end", "title": "" }, { "docid": "3cf345f748d4247aab680a45a4f89946", "score": "0.6077781", "text": "def new_input_set()\n return UpdateUserInputSet.new()\n end", "title": "" }, { "docid": "3cf345f748d4247aab680a45a4f89946", "score": "0.6077781", "text": "def new_input_set()\n return UpdateUserInputSet.new()\n end", "title": "" } ]
c8b4d68b2934317f3f5e7a0e0f36f0f7
create path of distanation and make link
[ { "docid": "54061ccb63cc15e3af9282d7cdd451f6", "score": "0.6520761", "text": "def slink node, p2\n link_dir, link_name = split_path p2\n mkdir link_dir unless link_dir == ''\n link node, link_dir, link_name\n end", "title": "" } ]
[ { "docid": "53891801986564cd3a38a1b59f13c091", "score": "0.7328312", "text": "def create_symlink(dest_path); end", "title": "" }, { "docid": "2b713e0d603abeb40321a06338a3be8a", "score": "0.7153519", "text": "def make_link(inside, from, to)\n Dir.chdir(inside) do\n from.gsub!(/#{REPO_ROOT}/, '')\n dots = inside.gsub(/#{REPO_ROOT}/, '').count('/')\n from = from.insert(0, '../' * dots).squeeze('/')\n\n warn \"link: src #{from} doesn't exist\" unless File.exists?(from)\n\n puts \"link: #{from} -> #{inside}/#{to}\"\n `ln -s #{from} #{to}`\n end\nend", "title": "" }, { "docid": "eb9ac1e9fbc3ce19bea2fd2fc9f07025", "score": "0.7083275", "text": "def make\n super\n\n # no symbolic links needed for static libraries\n return if :static == @link_type\n\n if Build.system.darwin?\n # create symbolic link install_name --> real name if the two differ\n # get basenames of actual file and install_name; basename includes extension\n base, ibase = File.basename( @path ), File.basename( @install_name )\n return if base == ibase # no link needed\n\n link = File.join File.dirname( @path ), ibase\n return if File.exist? link # link already exists\n\n else\n\n # create symbolic link soname --> real name if the two differ\n base = File.basename @path # basename includes extension\n return if base == @soname # no link needed\n\n link = File.join File.dirname( @path ), @soname\n return if File.exist? link # link already exists\n\n end # darwin check\n\n cmd = \"ln -s %s %s\" % [@path, link]\n Util.run_cmd cmd, Build.logger\n\n end", "title": "" }, { "docid": "d6d155a18a4416d49b0c3e666d9b5d0f", "score": "0.6993314", "text": "def build(rakeTask)\n\t\tSystem::symlink @linkName => @target\n\tend", "title": "" }, { "docid": "9f743f689d04af548047ea3cf1f40459", "score": "0.6872962", "text": "def make_link_folder_relative(link,wash)\n if(link and link.include?('/'))\n dir = File.dirname(link) +\"/\"\n puts \"dir: \" + dir\n new_link, wash = wash_link(dir,'',wash)\n end\n return new_link,wash\nend", "title": "" }, { "docid": "b886f411263b44134d51d2674c55470e", "score": "0.68707854", "text": "def make_link_folder_relative(link,wash)\n if(link and link.include?('/'))\n dir = File.dirname(link) +\"/\"\n puts \"dir: \" + dir\n new_link, wash = wash_link(link,dir,'',wash)\n end\n return new_link,wash\nend", "title": "" }, { "docid": "4fb01118df15b5135e908ddc544178e8", "score": "0.6857785", "text": "def link_to(destination)\n FileUtils.mkdir_p destination\n each { |path| (destination + path.basename).make_symlink(path.relative_path_from(destination)) }\n end", "title": "" }, { "docid": "4fb01118df15b5135e908ddc544178e8", "score": "0.6857785", "text": "def link_to(destination)\n FileUtils.mkdir_p destination\n each { |path| (destination + path.basename).make_symlink(path.relative_path_from(destination)) }\n end", "title": "" }, { "docid": "e3264d6ba0916a51075a7f5e3cb8f7ac", "score": "0.6852176", "text": "def link(origin, target)\n if IS_WINDOWS\n flag = File.directory?(origin) ? ' /J' : ''\n origin = File.expand_path(origin).gsub!('/', '\\\\')\n target = File.expand_path(target).gsub('/', '\\\\')\n `cmd.exe /c \\\"mklink#{flag} #{target} #{origin}\\\"\"`\n else\n `ln -s #{File.expand_path origin} #{target}`\n end\nend", "title": "" }, { "docid": "3e84e2c3271e56c2b55246c924cddc21", "score": "0.6828494", "text": "def link(source, target)\n @component.install << \"#{@component.platform.install} -d '#{File.dirname(target)}'\"\n # Use a bash conditional to only create the link if it doesn't already point to the correct source.\n # This allows rerunning the install step to be idempotent, rather than failing because the link\n # already exists.\n @component.install << \"([[ '#{target}' -ef '#{source}' ]] || ln -s '#{source}' '#{target}')\"\n @component.add_file Vanagon::Common::Pathname.file(target)\n end", "title": "" }, { "docid": "a8fe9961ef1425ae9a7edc5a2d70ca23", "score": "0.6798569", "text": "def symlink_to_shared(from, to = nil)\n orig_path = release_path + from\n\n if to\n dest_path = shared_path + to\n else\n dest_path = shared_path + from\n end\n\n run \"mkdir -p #{orig_path}\" if path_is_dir orig_path\n run \"mkdir -p #{dest_path}\" if path_is_dir dest_path\n\n # if the original path exists, \n # and the path is a directory\n # rsync all the existing files to the destination first\n # then delete it\n run \"if [ -d '#{orig_path}' ]; then rsync -avz #{orig_path}/ #{dest_path}; fi\" if path_is_dir orig_path\n\n run \"rm -rf #{orig_path} && ln -s #{dest_path} #{orig_path}\"\n\nend", "title": "" }, { "docid": "41543e511ed4ae2b1d9ce89d572eeab7", "score": "0.678322", "text": "def make_link(target)\n File.link(target, @path)\n self\n end", "title": "" }, { "docid": "dc57c5f116322c5b90d9adee4e1af2fe", "score": "0.6763902", "text": "def create(dotfile_path)\n symlink_path = HOME_DIRECTORY + \"#{dotfile_path.basename}\"\n\n link_str = \"%s -> %s\" % [symlink_path, dotfile_path]\n puts \"linking #{symlink_path}\"\n result = system(%Q{ln -i -s \"#{dotfile_path}\" \"#{symlink_path}\"})\n if result\n puts link_str\n end\n end", "title": "" }, { "docid": "851884b3187e368ef8e4d5ead277b912", "score": "0.6761344", "text": "def pathDist\n\n\troot + distPackageName + \"_\" + distPackageVersion + \"/\"\nend", "title": "" }, { "docid": "d6706c5d9c24f06cb415bf56cbf1afde", "score": "0.6697832", "text": "def link(new_link_path, existing_path, symlink); end", "title": "" }, { "docid": "a90734a6417ace87224edc04f62df4d7", "score": "0.6693903", "text": "def symlink_public_directory(name)\n run \"mkdir -p #{shared_path}/#{name}\"\n run \"ln -s #{shared_path}/#{name} #{release_path}/public/#{name}\"\n end", "title": "" }, { "docid": "60b80fc13e35c7009556428b3bdb57c5", "score": "0.66675043", "text": "def symlink(path, target); end", "title": "" }, { "docid": "60b80fc13e35c7009556428b3bdb57c5", "score": "0.66675043", "text": "def symlink(path, target); end", "title": "" }, { "docid": "a229a5ad4a0826e82f7f8dbb63b6cb29", "score": "0.66526574", "text": "def pathDist\n\troot + distPackageName + \"_\" + version + \"/\"\nend", "title": "" }, { "docid": "a229a5ad4a0826e82f7f8dbb63b6cb29", "score": "0.66526574", "text": "def pathDist\n\troot + distPackageName + \"_\" + version + \"/\"\nend", "title": "" }, { "docid": "6d127c5d759d7ebec61734903b9329a7", "score": "0.66434413", "text": "def symlink\n run(\"rm -f #{current_path} && ln -s #{release_path} #{current_path}\")\nend", "title": "" }, { "docid": "e6cbc98f87a4e8567aa79e4ae5b91620", "score": "0.6633293", "text": "def mklink newfn, fn\r\n\t\tnewfn = newfn.gsub(\"/\", \"\\\\\")\r\n\t\tfn = fn.gsub(\"/\", \"\\\\\")\r\n\t\tputs \"Linking binary file: #{fn}\\n \tto\t#{newfn} \"\r\n\t\tcmd = \"mklink #{newfn} #{fn}\"\r\n\t\tputs cmd\r\n\t\texec cmd\t# hmmm worked fine from command line. Maybe an Admin subshell is not Admin anymore? another spawned cmd.exe shell ?\r\n\r\n\tend", "title": "" }, { "docid": "6a76de0385ce3b47c23fb90ac5fdad4e", "score": "0.66261566", "text": "def link\n\t\t\[email protected] do |dest|\n\t\t\t\tself.log \"Linking %s into %s\" % [ @wal.basename, dest.spool.basename ]\n\t\t\t\tFileUtils::ln @wal, dest.spool, :force => true\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "50b693b1a0701240b43877bad9be48af", "score": "0.6617253", "text": "def link(src, dst)\n\n end", "title": "" }, { "docid": "68505e14b1e8eaef1a11321f10e3e738", "score": "0.66115856", "text": "def link\n Dir.chdir File.dirname(@file_path)\n\n cmd = \"fgllink -o #{self.link_file_path} #{self.build_file_path} #{self.dependencies.any? ? self.dependencies.map(&:build_file_path).uniq.join(\" \") : nil}\"\n puts cmd\n system cmd\n end", "title": "" }, { "docid": "0f44193d28d9a6de6cb11881a14f314c", "score": "0.6609449", "text": "def link_file(source, target)\n source = \"#{pwd}/files/#{source}\"\n target = File.expand_path target\n rm_rf target\n FileUtils.mkdir_p File.dirname(target)\n ln_s source, target\nend", "title": "" }, { "docid": "277990c74107e740ff6ef19ae1160792", "score": "0.66075426", "text": "def linkify source_path, target_path\n Dir.glob( File.join(source_path, '*'), File::FNM_DOTMATCH ).each do |src_fn_path|\n src_pn = Pathname.new src_fn_path\n next if %w(. ..).include? src_pn.basename.to_s\n if src_pn.directory?\n FileUtils.mkdir_p File.join(target_path, src_pn.basename)\n linkify File.join(source_path, src_pn.basename), File.join(target_path, src_pn.basename)\n else\n FileUtils.ln_s src_pn, File.join(target_path, src_pn.basename), force: true\n end\n end\n end", "title": "" }, { "docid": "4ed644746d5feba7bdf3d2aafe706f3b", "score": "0.658328", "text": "def symlink_it_up!\n recipe_eval do\n new_resource.symlinks.each do |key, value|\n Chef::Log.info \"artifact_deploy[symlink_it_up!] Creating and linking #{new_resource.shared_path}/#{key} to #{release_path}/#{value}\"\n directory \"#{new_resource.shared_path}/#{key}\" do\n owner new_resource.owner\n group new_resource.group\n mode '0755'\n recursive true\n end\n\n link \"#{release_path}/#{value}\" do\n to \"#{new_resource.shared_path}/#{key}\"\n owner new_resource.owner\n group new_resource.group\n end\n end\n end\n end", "title": "" }, { "docid": "3b886ba09f73773d7cf2828410c59951", "score": "0.65404814", "text": "def link_to(source, destination)\n FileUtils.mkdir_p destination\n source.each { |path| (destination + path.basename).make_symlink(path.relative_path_from(destination)) }\n end", "title": "" }, { "docid": "7a1caf7769321cd7af7a3a3f9b780cba", "score": "0.6523998", "text": "def construct_link_path(path_data)\n package_format = path_data[:package_format]\n prefix = path_data[:prefix]\n platform_name = path_data[:platform_name]\n platform_tag = path_data[:platform_tag]\n link = path_data[:link]\n\n return nil if link.nil?\n\n case package_format\n when 'rpm'\n return File.join(prefix, link)\n when 'swix'\n return File.join(prefix, platform_name, link)\n when 'deb'\n debian_code_name = Pkg::Platforms.get_attribute(platform_tag, :codename)\n return File.join(prefix, debian_code_name, link)\n when 'svr4', 'ips'\n return File.join(prefix, 'solaris', link)\n when 'dmg'\n return File.join(prefix, 'mac', link)\n when 'msi'\n return File.join(prefix, platform_name, link)\n else\n raise \"Error: Unknown package format '#{package_format}'\"\n end\n end", "title": "" }, { "docid": "816449286da23de3f7c42776505e6ed5", "score": "0.65201557", "text": "def create_symlink(from, to)\n if Origen.running_on_windows?\n system(\"call mklink /D #{to.to_s.gsub('/', '\\\\')} #{from.to_s.gsub('/', '\\\\')}\")\n File.new(\"#{to}_is_a_symlink\", 'w') {}\n else\n FileUtils.symlink from, to\n end\n end", "title": "" }, { "docid": "5d1ff36866fbb9f8c379b86fabdcbbf4", "score": "0.6472977", "text": "def link(source, destination, options = {})\n build_commands << BuildCommand.new(\"link `#{source}' to `#{destination}'\") do\n Dir.chdir(software.install_dir) do\n FileUtils.ln_s(source, destination, options)\n end\n end\n end", "title": "" }, { "docid": "d9e31b63e8b12ac8fb97309610e052c0", "score": "0.6471309", "text": "def create_link(destination, *args); end", "title": "" }, { "docid": "1c04c4d9098b245940151c41ed806e51", "score": "0.64680505", "text": "def create_symlink(release = nil)\n @remote_shell.run [\n \"rm -f #{@config[:remote_path]}/current\",\n \"ln -s #{release ? @config[:releases_dir] + '/' + release : release_dir} current\"\n ]\n end", "title": "" }, { "docid": "af424a0a40a2a74b31947e4c8c919eaf", "score": "0.6447691", "text": "def link_file(files)\n Array(files).each do |file|\n file = BASE_DIR.join(file)\n cmd \"ln -nfs #{file} #{File.join(ENV['HOME'], \".\" + File.basename(file))}\"\n end\nend", "title": "" }, { "docid": "a495c4941bc7a5f14005c1b6625a7db9", "score": "0.6438891", "text": "def pathDistSource\n\tpathDist + \"source/\"\nend", "title": "" }, { "docid": "a495c4941bc7a5f14005c1b6625a7db9", "score": "0.6438891", "text": "def pathDistSource\n\tpathDist + \"source/\"\nend", "title": "" }, { "docid": "a495c4941bc7a5f14005c1b6625a7db9", "score": "0.6438891", "text": "def pathDistSource\n\tpathDist + \"source/\"\nend", "title": "" }, { "docid": "fb8d54e7bd68241971d097ea31bb5f55", "score": "0.6381221", "text": "def install!\n\t\t\traise \"Target exists\" if target.present?\n\n\t\t\t# File entry - create the containing directory and the symlink\n\t\t\ttarget.dirname.mkpath unless target.dirname.directory? # including symlink to directory\n\t\t\ttarget.make_symlink link_target\n\t\tend", "title": "" }, { "docid": "8b3e88e6650e42d39a84d6a442228b4d", "score": "0.63718617", "text": "def link(target)\n @client.exec!(\"sudo ln -s #{escaped_path} #{target.shellescape}\")\n end", "title": "" }, { "docid": "3d86e58ed725bc376cdc072e0d2575e6", "score": "0.636603", "text": "def push_to_output(path, tv_show_name, season, output, episod=\"\")\n puts path\n dir = \"#{output}/#{tv_show_name}/\"\n symlink = \"#{output}/#{tv_show_name}/season_#{season}\"\n if (episod!=\"\")\n dir = \"#{output}/#{tv_show_name}/season_#{season}/\"\n symlink = \"#{output}/#{tv_show_name}/season_#{season}/episod_#{episod}\"\n end\n puts symlink\n if (!File.exists?(dir))\n FileUtils.mkdir_p(dir)\n end\n if (!File.exists?(symlink))\n File.symlink(path,symlink)\n end\nend", "title": "" }, { "docid": "8b0b365b166a7b81225b1789e4413767", "score": "0.6360776", "text": "def create_link(src, dst)\n\t\tdirs = File.dirname(dst).split(\"/\")\n\t\tignore_dirs = [\"/\", \"/home\", \"/root\"]\n\t\tsecure_dirs = %w(.cache .cups .dbus .gnupg .local .pki .ssh)\n\t\tfuser = node[:user]\n\t\tfor i in 0...(dirs.length) do\n\t\t\tdir = dirs[0..i].join(\"/\")\n\t\t\tnext if dir == \"\"\n\t\t\tfuser = node[:user]\n\t\t\tfuser = \"root\" if i >= 1 && dirs[0] == \"\" && dirs[1] == \"root\"\n\t\t\tfuser = dirs[2] if i >= 2 && dirs[0] == \"\" && dirs[1] == \"home\"\n\t\t\tfmode = \"0755\"\n\t\t\tnext if ignore_dirs.include?(dir)\n\t\t\tfmode = \"0700\" if i == 2 && dirs[0] == \"\" && dirs[1] == \"home\"\n\t\t\tfor secure_dir in secure_dirs do\n\t\t\t\tfmode = \"0700\" if dirs.include?(secure_dir)\n\t\t\tend\n\t\t\tevacuate_file(dir) if File.exist?(dir) && File.lstat(dir).ftype != 'directory'\n\t\t\tdirectory dir do\n\t\t\t\tuser\tfuser\n\t\t\t\towner\tfuser\n\t\t\t\tgroup\tfuser\n\t\t\t\tmode\tfmode\n\t\t\tend\n\t\tend\n\t\tif File.symlink?(dst) && File.readlink(dst) != src then\n\t\t\tevacuate_file(dst)\n\t\telsif File.exist?(dst) && !File.symlink?(dst) then\n\t\t\tif !system(\"diff \\\"#{dst}\\\" \\\"#{src}\\\"\") then\n\t\t\t\tevacuate_file(dst)\n\t\t\telse\n\t\t\t\tFile.delete(dst)\n\t\t\tend\n\t\tend\n\t\tfmode = \"0%o\" % (File.stat(src).mode & 0777)\n\t\tlink dst do\n\t\t\tto src\n\t\t\tuser fuser\n\t\tend\n\t\tfile dst do\n\t\t\taction :edit\n\t\t\tmode fmode\n\t\tend\n\tend", "title": "" }, { "docid": "f4f4b2800d4bc953a0badc3ee198c11f", "score": "0.62600946", "text": "def link( target, lnk )\n if /^\\// !~ target\n target = File.join( install_directory, target )\n end\n shell \"ln -sfv #{target} #{lnk}\"\n end", "title": "" }, { "docid": "c200be2e566c39bbe8cf9510123b4a51", "score": "0.62397623", "text": "def create_hardlink original, copy\n mkdir_p(copy.dirname)\n log.debug(\"Linking #{copy} -> #{original}\")\n ln(original, copy, force: true)\n process_metadata_for(copy) if settings[:metadata]\n end", "title": "" }, { "docid": "a310fb16cbd7641a84de1ceb0829665a", "score": "0.6218044", "text": "def symlink_dest_file_to_dest_file(target, link)\n target_pathname = Pathname.new(File.join(destination_root, target))\n link_pathname = Pathname.new(File.join(destination_root, link))\n\n link_directory = link_pathname.dirname\n link_basename = link_pathname.basename\n target_relative_path = target_pathname.relative_path_from(link_directory)\n\n `cd #{link_directory} && ln -s #{target_relative_path} #{link_basename}`\n end", "title": "" }, { "docid": "4cffb9be0c92955633a42c406d85c0c8", "score": "0.62130314", "text": "def emit_link(cur_mtg_dir, f, desc)\n _a desc, href: f.include?('/') ? f : File.join(cur_mtg_dir, f)\nend", "title": "" }, { "docid": "18e202cc17ba2b8f619b25c41d73b7eb", "score": "0.6197235", "text": "def make_link(year,study,group,degree)\n #correct integration of semgrp number in string\n if study.include? \"/\"\n study.insert(study.index(\"/\"), group)\n link = year+study+\"-\"+degree\n else\n link = year+study+group+\"-\"+degree\n end\n @@link = link\n link\nend", "title": "" }, { "docid": "37f7633eded02595a44d4424f5319c38", "score": "0.6183235", "text": "def make_folders_absolute(f,tt)\n tt.elements.each(\"//node\") do |nn|\n if nn.attributes['LINK']\n nn.attributes['LINK']= File.expand_path(File.dirname(f))+\"/#{nn.attributes['LINK']}\"\n end\n end\n end", "title": "" }, { "docid": "82fba6b3e0aecd5c227496080054c562", "score": "0.6168834", "text": "def create_link(a, b)\n log.debug(log_key) { \"Linking `#{a}' to `#{b}'\" }\n FileUtils.ln_s(a, b)\n end", "title": "" }, { "docid": "f4f6b1abb0a226c1e0c2a399fd29589f", "score": "0.61653924", "text": "def create_url(path)\n FileUtils.cd(Rails.root.join(Rails.public_path).to_s)\n unless File.directory?(path)\n FileUtils.mkdir_p(path)\n end\n end", "title": "" }, { "docid": "085af287e87bda4ae0b4c56937342881", "score": "0.6125437", "text": "def force_link dest, src\n directory(dest) do\n action :delete ; recursive true\n not_if{ File.symlink?(dest) }\n end\n link(dest){ to src }\n end", "title": "" }, { "docid": "085af287e87bda4ae0b4c56937342881", "score": "0.6125437", "text": "def force_link dest, src\n directory(dest) do\n action :delete ; recursive true\n not_if{ File.symlink?(dest) }\n end\n link(dest){ to src }\n end", "title": "" }, { "docid": "afb175d3d90752928b80b0680402f7f0", "score": "0.61196995", "text": "def make_symlink(target)\n File.symlink(target, @path)\n self\n end", "title": "" }, { "docid": "43bc3495c6d8fe271428b8514cb690b7", "score": "0.61120546", "text": "def make_linker_output( path, os )\n return \"-o #{path}/#{os[2]}\"\nend", "title": "" }, { "docid": "431931f5d2e9db877853b2cd37a108fe", "score": "0.61091423", "text": "def make_linker_obj( path, os )\n return \"#{ path }/#{ os[ 1 ] }\"\nend", "title": "" }, { "docid": "b11708c442dc6b3fca311a5179faa389", "score": "0.6097495", "text": "def doc_link\n './' + doc_basename\n end", "title": "" }, { "docid": "9982b28ace2e5d0ff5be7d49a8c25664", "score": "0.60959053", "text": "def create_symlink(link)\n puts \"create new #{link} symlink\"\n FileUtils.ln_s(\"#{@vimfiles_folder}/vimrc\", link, :force => true) if link == @vim_config\n FileUtils.ln_s(@vimfiles_folder, link, :force => true) if link == @vim_folder\n end", "title": "" }, { "docid": "54d09987d8a352a5bdc424a54b48a1ee", "score": "0.60797966", "text": "def make_symlink\n begin\n FileUtils.ln_s @source_path, @target_path, verbose: true, force: false\n rescue Errno::EEXIST\n actual_source_path = Pathname(@target_path).readlink.to_s\n if ! actual_source_path.eql? @source_path\n puts \"\\tNOTE: symlink exists with unexpected src path #{actual_source_path}\"\n puts \"\\t was expecting #{@source_path}\"\n else\n # Do Nothing\n end\n end\n end", "title": "" }, { "docid": "bd53365b27843edfa4094f7f8741407b", "score": "0.6078129", "text": "def path src, dest\n src.straight_path_to dest\n end", "title": "" }, { "docid": "cf41e67b52fe1fa8c99134850047ee38", "score": "0.6066461", "text": "def link_asset(path); end", "title": "" }, { "docid": "cf41e67b52fe1fa8c99134850047ee38", "score": "0.6066461", "text": "def link_asset(path); end", "title": "" }, { "docid": "52666f54b64e71ca1eac8984131d14b8", "score": "0.6059695", "text": "def _dfb_link\n link = []\n link << \"http://www.disneyfoodblog.com\"\n link << target.path\n \"#{link.join(\"/\")}\"\n end", "title": "" }, { "docid": "0ade6153916db2056720ebba0dcc02be", "score": "0.60330623", "text": "def symlink_destination\n @symlink_destination\n end", "title": "" }, { "docid": "709ee95fe226b44a2fca20e644af04db", "score": "0.6022087", "text": "def symlink?; end", "title": "" }, { "docid": "709ee95fe226b44a2fca20e644af04db", "score": "0.6022087", "text": "def symlink?; end", "title": "" }, { "docid": "709ee95fe226b44a2fca20e644af04db", "score": "0.6022087", "text": "def symlink?; end", "title": "" }, { "docid": "44d1140943ca7af6cd4d030cd7aa6b25", "score": "0.6019078", "text": "def create_symlink( folder, target_folder )\n raise ArgumentError , \"Origin folder #{folder} is not a valid folder\" unless File.directory?(folder)\n FileUtils.ln_s folder, target_folder\n end", "title": "" }, { "docid": "99afec04e4ff2b2e6da5188e0af265e6", "score": "0.60166746", "text": "def mkpath\n\t\t\t\tFileUtils.mkpath(self.to_s)\n\t\t\tend", "title": "" }, { "docid": "6c0eda015003619789d31f16e983a6aa", "score": "0.60118824", "text": "def relative_link(file, link)\n f = Pathname.new(file).dirname\n l = Pathname.new(\"#{@out}/#{link}\")\n l.relative_path_from f\n end", "title": "" }, { "docid": "67563b8afe42f0613166d42990201f3c", "score": "0.60095733", "text": "def create_share_link(file,repo_id)\n curl_put(\"#{self.host}/api2/repos/#{repo_id}/file/shared-link/\",{\"p\"=> file }).head.split('Location:')[1].scan(/\\w{4,5}:\\/\\/.{1,}\\//)[0]\n end", "title": "" }, { "docid": "405f3573fb57994743483988942d5875", "score": "0.5995227", "text": "def createPowLink\n\t\t\taction = -> { File.symlink(RvmPow::RAKE_APP_DIRECTORY, RvmPow::POW_LINK) }\n\t\t\tfileAction action\n\t\tend", "title": "" }, { "docid": "921991b7fcfba107bd430b4e45e4ffec", "score": "0.5992244", "text": "def path_to_link(path)\n return '/home' if path == 'home.textile'\n els = path.split('/')\n dir_name = els[0]\n file_name = els[1]\n dir_name = dir_name.split('-')[1..dir_name.split('-').size].join('-')\n\n els2 = file_name.split('-')\n if (els2[0] == els2[1]) && (els2[0] == '')\n return \"/#{dir_name}\"\n else\n file_name = els2[1..els2.size].join('-').split('.')[0]\n return \"/#{dir_name}/#{file_name}\"\n end\nend", "title": "" }, { "docid": "e2ddbe2a8d9958c2e0a96d73257d1b13", "score": "0.59722733", "text": "def follow_symlinks; end", "title": "" }, { "docid": "52d03d09b72ff9b35510af24cea53ce8", "score": "0.59624827", "text": "def test_creates_symlinks_for_files_found_in_the_given_directory\n assert_equal( false, @dir.join( 'executable' ).exist? )\n @linker.link( @dir.join( 'bin' ) )\n assert_equal( true, @dir.join( 'executable' ).exist? )\n end", "title": "" }, { "docid": "202bbec390e41158dcfa487bf46adf96", "score": "0.5954264", "text": "def follow_symlinks=(_arg0); end", "title": "" }, { "docid": "fb07a0d28b682656c7498387c923dc9c", "score": "0.59505665", "text": "def make_direct_link(url) #:doc:\n url\n end", "title": "" }, { "docid": "78212de7b6f1e0d04b4e33cf8f2fe0a2", "score": "0.59436077", "text": "def link_all\n alldirs = Dir.glob( File.join( install_directory, \"*/\" ) )\n alldirs -= [ File.join( install_directory, 'var/' ) ]\n alldirs.each { |d|\n puts \"cp -dRsf #{d} /#{File.basename(d)}\"\n }\n #link( File.join(install_directory,'bin','*'), '/usr/bin/' )\n #link( File.join(install_directory,'lib','*'), '/usr/lib/' )\n ## man\n #9.times{ |i|\n # link( File.join(install_directory,'man',\"man#{i}\",'*'), '/usr/man/man#{i}/' )\n #}\n end", "title": "" }, { "docid": "9dec8b5f75767b148fefe9403dbd1d7e", "score": "0.593972", "text": "def force_link dest, src\n return if dest == src\n directory(dest) do\n action :delete ; recursive true\n not_if{ File.symlink?(dest) }\n end\n link(dest){ to src }\n end", "title": "" }, { "docid": "2c4e4f6e5198777bb018f1730f2b33c5", "score": "0.5937066", "text": "def makeSymlinks(presto_version)\n println \"Making Symlinks...\"\n lzo_file = Dir.glob(\"/home/hadoop/share/hadoop/common/lib/*hadoop-lzo.jar\")[0]\n hives = (`ls /home/hadoop/.versions/presto-server-#{presto_version}/plugin`).split(/\\r?\\n/).select{|i| i.start_with?(\"hive\")}\n hives.each { |x| sudo \"ln -s #{lzo_file} /home/hadoop/.versions/presto-server-#{presto_version}/plugin/#{x}/hadoop-lzo.jar\" }\n sudo \"ln -s /home/hadoop/.versions/presto-server-#{presto_version}/ /home/hadoop/presto-server\"\nend", "title": "" }, { "docid": "118b48245573f8229c0adeb59e131073", "score": "0.5934199", "text": "def create\n @gigaso = Gigaso.new(params[:gigaso])\n\n respond_to do |format|\n if @gigaso.save\n `ln -s #{@gigaso.path} /home/dooo/gserver/public/#{@gigaso.filename}`\n format.html { redirect_to(@gigaso, :notice => 'Gigaso was successfully created.') }\n format.xml { render :xml => @gigaso, :status => :created, :location => @gigaso }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @gigaso.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2ee22e7a3e9576a1da305a7cbf329337", "score": "0.592493", "text": "def destination(path); end", "title": "" }, { "docid": "5db237b7ee5f148e8c6bf54c3fece578", "score": "0.5918652", "text": "def build_path\n end", "title": "" }, { "docid": "d500efe693115c6c58658ef5b33ee262", "score": "0.5895828", "text": "def create_symlink(file, link_path, backup_folder_path)\n source = \"#{Dir.pwd}/#{file}\"\n destination = \"#{link_path}/#{file}\"\n backup_file(destination, backup_folder_path)\n puts \"...symlinking from #{source} to #{destination}\"\n FileUtils.symlink(source, destination)\nend", "title": "" }, { "docid": "26d0a5179b1efef57f395875cd4ddd9e", "score": "0.5894742", "text": "def symlink_output(link)\n return unless Chefctl::Config.symlink_output\n Chefctl.lib.symlink(@paths[:out], @paths[link])\n end", "title": "" }, { "docid": "bbfba2182c76839141f5ff5928faa739", "score": "0.58938265", "text": "def sym_link(path, link_to, user, group)\n begin\n FileUtils.rm_f(link_to) # get rid of any old one\n FileUtils.ln_sf(path, link_to) # make a new link_to that points to path\n set_ownership(user, group, link_to)\n rescue => e\n raise Chef::Exceptions::FileNotFound.new(\"Cannot symlink #{path} to #{link_to} : #{e.message}\")\n end\n end", "title": "" }, { "docid": "ab622dbb5c8dba1e7950d3434d0efb49", "score": "0.58935803", "text": "def symlink_admin_site hostname\n linkname = 'admin_' + (hostname.split('.'))[0].gsub('-', '_')\n\n if File.exists? linkname\n STDERR.puts \"Can't make symlink, file #{linkname} exists.\"\n elsif File.symlink? linkname\n STDERR.puts \"Can't make symlink, #{linkname} exists.\"\n else\n FileUtils.symlink('/usr/local/islandora/offline-ingest/web-report', linkname)\n end\nend", "title": "" }, { "docid": "b256582ed58a5ad17d6b33d48cd8271b", "score": "0.58878696", "text": "def do_link exe, objects\n sh \"#{$CC} #{objects.join ' '} -o #{exe} #{$L_FLAGS.join ' '}\"\nend", "title": "" }, { "docid": "c4a0ccd273bef65dd19549b17379f684", "score": "0.58733267", "text": "def url\n find_or_create\n \"/#{output_path.relative_path_from Rails.public_pathname}\"\n end", "title": "" }, { "docid": "5dc87ad6f3e276a1c5fc837005899ecc", "score": "0.58719057", "text": "def link_file(file, quiet = false)\n system %Q{ln -sf \"$PWD/#{file}\" \"$HOME/bin/#{file}\"}\nend", "title": "" }, { "docid": "9dfc6c9dac2bd486eb4828b65dbbba6d", "score": "0.58716124", "text": "def symlink!(path, target, &callback); end", "title": "" }, { "docid": "b81e3757f9d1e6932291e6dcfcf86215", "score": "0.5863482", "text": "def pathSourceHyper\n\troot + cwdName + \"/\"\nend", "title": "" }, { "docid": "83397c7c20a7ecdc24d920d30f76073f", "score": "0.5846522", "text": "def add_link(destination, *args); end", "title": "" }, { "docid": "f6a4a3206130c3bcf9e7cae902c26961", "score": "0.58440346", "text": "def create\n symlink_files.each do |file|\n FileUtils.ln_s(File.join(File.dirname(__FILE__), \"templates\", file), File.join(current_path, file))\n end\n end", "title": "" }, { "docid": "95c2d6c79ec86906a95199ddba76378b", "score": "0.58368486", "text": "def add_symlink(name)\n puts \"Adding #{File.join(POW_PATH, name)}\"\n cmd = \"if [[ ! -h '#{File.join(POW_PATH, name)}' ]]; then ln -s '#{APP_PATH}' '#{File.join(POW_PATH, name)}'; fi\"\n system cmd\nend", "title": "" }, { "docid": "3ae431a687a494310f0d1bac8a3178e6", "score": "0.5826085", "text": "def link_files(path, link_path)\n File.link path, link_path\n end", "title": "" }, { "docid": "006da5cde248143b675888b8a32d7537", "score": "0.5825356", "text": "def lib_link_data(target)\n linkname=File.join(tmp_dir,\"data\")\n FileUtils.rm_f(linkname)\n FileUtils.ln_s(target,linkname)\n lib_validate_data(valid_dir(linkname))\n end", "title": "" }, { "docid": "ddc35b9fc336a3bcdd2cf533e036f92f", "score": "0.58242774", "text": "def link_file_path\n \"#{File.join(File.dirname(@file_path), File.basename(@file_path, File.extname(@file_path)).concat(@link_extension))}\"\n end", "title": "" }, { "docid": "28f809fc576c4b243909749110ff42a7", "score": "0.58217454", "text": "def ln_s(src, dest)\n if dest.symlink? && dest.readlink == src\n skip_task \"Linking #{src}\", 'Already linked'\n else\n start_task \"Linking #{src}\"\n if dest.exist? || dest.symlink?\n task_failed 'Target already exists'\n else\n FileUtils.ln_s(src, dest)\n task_succeeded\n end\n end\n end", "title": "" }, { "docid": "ddee043864da62373070c8d9428c29bb", "score": "0.5817129", "text": "def link!(new_link_path, existing_path, symlink = T.unsafe(nil), &callback); end", "title": "" }, { "docid": "fc235e18aebab1a24375f884d1d32fde", "score": "0.5816588", "text": "def link_docs\n \"#{link_generator.root_url}/docs\"\n end", "title": "" } ]
901adc1d2d3d4c75c859589cf9d29c28
STATUS Indica si el estado del evento es Abierto
[ { "docid": "d15cb37b13e6566f949066805f2c8672", "score": "0.67617613", "text": "def open?\n event_status_id == 1\n end", "title": "" } ]
[ { "docid": "c4bfadbade33b17785afb79743f68cfd", "score": "0.6752672", "text": "def status\n\t\t\t\ttrue\n\t\t\tend", "title": "" }, { "docid": "9fba60c778bcd24be8ac47b92f13342e", "score": "0.6708487", "text": "def status\n case @status\n when 0 then :off\n when 1 then :on\n end\n end", "title": "" }, { "docid": "0050913db0f3d096b431b9467753ff69", "score": "0.66995007", "text": "def check_status!\n events\n if should_be_offline?\n if online?\n events.create!(key: :offline).notify\n update_attribute(:online, false)\n end\n else # should be online\n if offline?\n events.create!(key: :online).notify\n update_attribute(:online, true)\n end\n end\n if low_balance?\n events.create!(key: :low_balance).notify if online?\n end\n end", "title": "" }, { "docid": "27319803adf5461de63ba191295b1182", "score": "0.66981304", "text": "def check_status \n return self.status == :open_hotel_block\n end", "title": "" }, { "docid": "df228a7c294a39eca69e5aeb8f5163eb", "score": "0.66342765", "text": "def is_ep?\n @status\n end", "title": "" }, { "docid": "282100fcf1722fcf5894752facfdc099", "score": "0.65726095", "text": "def status\n end", "title": "" }, { "docid": "282100fcf1722fcf5894752facfdc099", "score": "0.65726095", "text": "def status\n end", "title": "" }, { "docid": "282100fcf1722fcf5894752facfdc099", "score": "0.65726095", "text": "def status\n end", "title": "" }, { "docid": "282100fcf1722fcf5894752facfdc099", "score": "0.65726095", "text": "def status\n end", "title": "" }, { "docid": "b24e4de113358e2ff2bf5ebbcc755734", "score": "0.654612", "text": "def ongoing?\n status == 1\n end", "title": "" }, { "docid": "714509cdc5989078b91cbb6a8752b83e", "score": "0.65377146", "text": "def event_running?\n @battle_event.active?\n end", "title": "" }, { "docid": "ae3c11352bdb588f5cd98db97d3df9c9", "score": "0.65315485", "text": "def status; end", "title": "" }, { "docid": "ae3c11352bdb588f5cd98db97d3df9c9", "score": "0.65315485", "text": "def status; end", "title": "" }, { "docid": "ae3c11352bdb588f5cd98db97d3df9c9", "score": "0.65315485", "text": "def status; end", "title": "" }, { "docid": "ae3c11352bdb588f5cd98db97d3df9c9", "score": "0.65315485", "text": "def status; end", "title": "" }, { "docid": "ae3c11352bdb588f5cd98db97d3df9c9", "score": "0.65315485", "text": "def status; end", "title": "" }, { "docid": "ae3c11352bdb588f5cd98db97d3df9c9", "score": "0.65315485", "text": "def status; end", "title": "" }, { "docid": "ae3c11352bdb588f5cd98db97d3df9c9", "score": "0.65315485", "text": "def status; end", "title": "" }, { "docid": "ae3c11352bdb588f5cd98db97d3df9c9", "score": "0.65315485", "text": "def status; end", "title": "" }, { "docid": "ae3c11352bdb588f5cd98db97d3df9c9", "score": "0.65315485", "text": "def status; end", "title": "" }, { "docid": "a9bad48f371b59e3ae4e6af40cac6e0c", "score": "0.65283304", "text": "def status\n if self.started_at.nil? and self.stopped_at.nil?\n 'Pending'\n elsif self.started_at.present? and self.stopped_at.nil?\n 'Active'\n elsif self.started_at.present? and self.stopped_at.present?\n 'Completed'\n end\n end", "title": "" }, { "docid": "ab92ff1e502ff0525d9ab34d3e3eefe4", "score": "0.6522403", "text": "def in_progress? \n self.status_sym == :in_progress\n end", "title": "" }, { "docid": "692bed5ea13eac7af5f82137b7c8599d", "score": "0.648691", "text": "def status\n super || StatusType.active\n end", "title": "" }, { "docid": "a0a2bc449d910e562a0c732f396aa8fa", "score": "0.6481752", "text": "def in_progress?\n self.status == 'active'\n end", "title": "" }, { "docid": "a0a2bc449d910e562a0c732f396aa8fa", "score": "0.6481752", "text": "def in_progress?\n self.status == 'active'\n end", "title": "" }, { "docid": "6cd6dd8359760dc27818808a97b264aa", "score": "0.6477705", "text": "def is_complete?\n self.audit_state == AUDIT_COMPLETE\n end", "title": "" }, { "docid": "2809293cda97b9e041a98da5f3665154", "score": "0.6468664", "text": "def complete?\n self.status == STATUS[:complete] \n #self.status == 1\n end", "title": "" }, { "docid": "178b10c18f229f7521d5cdacf73ff3d3", "score": "0.6446301", "text": "def active?; status == :active; end", "title": "" }, { "docid": "df3af1541ac58c23617ec86774693527", "score": "0.6432563", "text": "def assessed?\n status == ASSESSED\n end", "title": "" }, { "docid": "1c432727f20aa7de54d0c5ac8466cdda", "score": "0.63925093", "text": "def invalid_status\n\t\tinvalid = false\n\t\tif self.status_changed?\n\t\t\tinvalid = self.status_was != \"active\"\n\t\tend\n\tend", "title": "" }, { "docid": "0473e2940177cf75561af347710f710b", "score": "0.6379758", "text": "def attending_status(event)\n return 'admin' if self.owner_of?(event)\n a = Attendance.where(user_id: self.id, event_id: event.id).first\n a && a.status\n end", "title": "" }, { "docid": "1f462b5ba8d8d0faa192d7b2b70ada3f", "score": "0.63694435", "text": "def active?\n\t\tstatus == STATUSES[2]\n\tend", "title": "" }, { "docid": "a8664bc3d5c5120c6e6050f68b46d922", "score": "0.6366919", "text": "def status\n refund? ? 3 : redeemed? ? 1 : (used_status? ? 2 : 0)\n end", "title": "" }, { "docid": "ee4ce2136f4c5d9c884c12e880c8bd73", "score": "0.635115", "text": "def scheduled?\n self.status_sym == :scheduled\n end", "title": "" }, { "docid": "a14d09a28c9be5b1b442b93538360df2", "score": "0.6338859", "text": "def good\n @status\n end", "title": "" }, { "docid": "6893a5682f56fdd7328cc50b8f08bb7a", "score": "0.6327028", "text": "def status\n STATUSES[self.status_id || 0]\n end", "title": "" }, { "docid": "577044049aadba142da024728d77b581", "score": "0.6319274", "text": "def status\n @status\n end", "title": "" }, { "docid": "577044049aadba142da024728d77b581", "score": "0.6319274", "text": "def status\n @status\n end", "title": "" }, { "docid": "1e4dea6c095b09ef95e75357706b6813", "score": "0.630091", "text": "def handled?\n\t\treturn ! @status.nil?\n\tend", "title": "" }, { "docid": "196eae7b991f28f2fb1013f656d79422", "score": "0.62935424", "text": "def occurred?\n @current_state == Psc::ScheduledActivity::OCCURRED\n end", "title": "" }, { "docid": "9dec33b59b764c3df60a884449283dd3", "score": "0.62914944", "text": "def get_status\n\t\tstatus\n\tend", "title": "" }, { "docid": "6dd168e222b207fdfd3dd42fde0c5593", "score": "0.62897366", "text": "def current?\n %w(open running paused).include?(self.event_status)\n end", "title": "" }, { "docid": "bf04b68edba76f6f9bc87a9fc0f740d4", "score": "0.62886053", "text": "def in_progress?\n return false unless status\n status.match(/^Generated on/).nil?\n end", "title": "" }, { "docid": "2e3667c10e300eb9a1f078b9ea126698", "score": "0.62857866", "text": "def audit_state\n \n return SELF_AUDIT unless self.designer_complete?\n return PEER_AUDIT unless self.auditor_complete?\n return AUDIT_COMPLETE\n\n end", "title": "" }, { "docid": "0be6decad83aa97faca9d8e5f3a3bc80", "score": "0.62715834", "text": "def past_step_2?\n !spectator? && status_is_active?(\"events\")\n end", "title": "" }, { "docid": "1587050bd60a4bfc239df537fe16769b", "score": "0.6252514", "text": "def status?\n return data.atk_class == 3\n end", "title": "" }, { "docid": "28ca90fa7d43e53fe4c53d23504a65cb", "score": "0.6244398", "text": "def intervention?\n self.status == \"Intervention\"\n end", "title": "" }, { "docid": "ddcafa5aae38927389af733bd08b4d08", "score": "0.623929", "text": "def status\n @__status\n end", "title": "" }, { "docid": "6b286875e4dce113ebb4b53ce8380a0f", "score": "0.62327415", "text": "def last_status; end", "title": "" }, { "docid": "7d15e8fccfa65b553ff1af922e724ff6", "score": "0.6221743", "text": "def on_hold?\n status == :inactive\n end", "title": "" }, { "docid": "410ec594a0e756db23335aa7a801204d", "score": "0.6220282", "text": "def status(*) end", "title": "" }, { "docid": "0347bbeab6105b97e295cdd9f0e64bce", "score": "0.62077796", "text": "def check_status\n #binding.pry #TODO: set date_activated/ date_inactive\n return\n end", "title": "" }, { "docid": "101266bf69edfd34ee21384362cbf53b", "score": "0.6203804", "text": "def status\n @status\n end", "title": "" }, { "docid": "101266bf69edfd34ee21384362cbf53b", "score": "0.6203804", "text": "def status\n @status\n end", "title": "" }, { "docid": "07ef83ed6b0e17a3c8d26a319aa9c325", "score": "0.6200996", "text": "def not_completed?\n status == NOT_COMPLETED\n end", "title": "" }, { "docid": "9f18002ece0e48243b7216a3a15a4fd5", "score": "0.61940855", "text": "def changed\n @status = true\n end", "title": "" }, { "docid": "c97fac41b3fcddf146a72e88a9779056", "score": "0.61931187", "text": "def ongoing?\n @type == 'ACTIVE'\n end", "title": "" }, { "docid": "bfc45612873e8147a04b33a2585945f7", "score": "0.61888933", "text": "def evented\n @evented = true\n end", "title": "" }, { "docid": "679f28840541497f0e8926363aad877b", "score": "0.6176169", "text": "def added?\n\t\treturn self.status == 'A'\n\tend", "title": "" }, { "docid": "3c587799bfa7246e241abec4557f787a", "score": "0.61739504", "text": "def status\n STATUSES[self.status_id]\n end", "title": "" }, { "docid": "2bd58f51060d1936fbcf4d1fdff9e8d5", "score": "0.6169146", "text": "def active?\n @status == :established\n end", "title": "" }, { "docid": "2fd618510f9635848908709aca0237da", "score": "0.6162804", "text": "def has_pending_events?\n\t\treturn self.pending_event_count.nonzero? ? true : false\n\tend", "title": "" }, { "docid": "d73b3a19f73e0ca01a5091f6a5652193", "score": "0.61613894", "text": "def status\n\t\treturn @status\n\tend", "title": "" }, { "docid": "12cab46e08e8c1e5bb433be0f21ecd9a", "score": "0.6160194", "text": "def map_status\n end", "title": "" }, { "docid": "f7b9b624ed3cb6aaf66d0e7e981fccb4", "score": "0.615669", "text": "def received?\r\n self['trans_status']=='99'\r\n end", "title": "" }, { "docid": "544aadbdf33d5e034196c1043cf2c765", "score": "0.61366284", "text": "def status\n @status ||= STATUS[mapping_for(:status)]\n end", "title": "" }, { "docid": "544aadbdf33d5e034196c1043cf2c765", "score": "0.61366284", "text": "def status\n @status ||= STATUS[mapping_for(:status)]\n end", "title": "" }, { "docid": "28df98f1f76af188bcee819a224e81ca", "score": "0.6135021", "text": "def ready_status\n 'ready' if notification\n end", "title": "" }, { "docid": "7943fc2eb17e07028c5f6b42bb7d89c6", "score": "0.6122713", "text": "def statuses; end", "title": "" }, { "docid": "b43404f81425e3158a79efadc7a1dc03", "score": "0.6115047", "text": "def status\n super\n end", "title": "" }, { "docid": "fa7d3c4cb48b07853e7a93c15f335f27", "score": "0.6114782", "text": "def status_transfer\n if status_changed? && status_changed?(from: \"finish\")\n errors.add(:base, \"错误的操作\")\n end\n end", "title": "" }, { "docid": "9fe371ea7aca19ae804a1c9bae14dc9c", "score": "0.61080843", "text": "def alert_user?\n # check the three necessary conditions\n # in order of increasing cost\n self.enabled? && have_statuses_changed?\n end", "title": "" }, { "docid": "4d99f34c99af62baa90b1c95826c42b2", "score": "0.6105444", "text": "def getStatus\r\n\t\t\t\t\treturn @status\r\n\t\t\t\tend", "title": "" }, { "docid": "cbdd8cf52f42aab3b557f8a8a4ca9658", "score": "0.6101914", "text": "def getStatus\n @status\n end", "title": "" }, { "docid": "7177ac01fb416747a444fbbc56ef3734", "score": "0.6100424", "text": "def event?(state)\n @events.key?(state)\n end", "title": "" }, { "docid": "e5354438a5683f24bbbd4b22622db380", "score": "0.60958344", "text": "def passed_test?(event)\n event['event'] == 'test' && event['status'] == 'pass'\n end", "title": "" }, { "docid": "557853640497ccc8219b6454ba6e65e0", "score": "0.60868365", "text": "def confirmed?\n self.status >= 0\n end", "title": "" }, { "docid": "f974a13fca7f3098dedd1603b795d7e6", "score": "0.6084389", "text": "def pending?\n\t\t\treturn account_life_cycle_status == PENDING \n\t\tend", "title": "" }, { "docid": "80f4ac9c34a95a1917eba4886e903b44", "score": "0.60728866", "text": "def status\n original.status || nil\n end", "title": "" }, { "docid": "80f4ac9c34a95a1917eba4886e903b44", "score": "0.60728866", "text": "def status\n original.status || nil\n end", "title": "" }, { "docid": "41fb7e7565658801b87704eb3de7dd83", "score": "0.6059305", "text": "def status\n data[:status]\n end", "title": "" }, { "docid": "c0ae5e11ede6d2a21f674f0f504702d8", "score": "0.60578316", "text": "def status\n data.status\n end", "title": "" }, { "docid": "834a8f3536a70fbdd661b397dbf9afd9", "score": "0.60454136", "text": "def ready?\n status == \"RUNNING\"\n end", "title": "" }, { "docid": "b5479ae2eecc6dcca3714e6c9ca317e8", "score": "0.60353184", "text": "def is_active?\n \tself.status.to_sym == :active\n end", "title": "" }, { "docid": "ddbfbba89c41b130e4cc49354369c906", "score": "0.60320836", "text": "def status\n 'unknown'\n end", "title": "" }, { "docid": "2a6e1fc24b02ad179f303447a231c7fb", "score": "0.6024513", "text": "def state\n status[\"state\"]\n end", "title": "" }, { "docid": "a48f715568a95cb996b825673d73060c", "score": "0.6017777", "text": "def changed?\n self.event_state.include? :changed\n end", "title": "" }, { "docid": "5dbb4404b2b0c3d5dc9a6d1d9f007a63", "score": "0.6016064", "text": "def active?\n status == STATUS[:active]\n end", "title": "" }, { "docid": "c5919a98b72fa552f5da399b56845469", "score": "0.6014645", "text": "def status\n \tif active == 1\n \t\treturn 1\n \telsif active == 2 and locked_to > Time.now.to_s(:db)\n \t\treturn 2\n \telsif active == 2 and locked_to < Time.now.to_s(:db)\n \t\treturn 1\t\n \telse\n \t\treturn 0\n \tend\n end", "title": "" }, { "docid": "7fb9544cca9c2a2ae6b2a4271f554ed6", "score": "0.60054225", "text": "def status\r\n case status_id\r\n when 1; \"Sending\"\r\n when 2; \"Sent\"\r\n when 3; \"Bounced\"\r\n when 4; \"Opened\"\r\n when 5; \"Downloaded\"\r\n when 6; \"Send Failed\"\r\n else; \"Processing\"\r\n end\r\n end", "title": "" }, { "docid": "c68950409dfc4df3958900dcf5e42335", "score": "0.60048884", "text": "def common_event_reserved?\r\n @common_event_id > 0\r\n end", "title": "" }, { "docid": "ed6026e7d12fda2525796cfbffd2ac9b", "score": "0.60042924", "text": "def retrieve_status\n \n end", "title": "" }, { "docid": "8662e748f9086c713e2ba35990ef37e0", "score": "0.60003364", "text": "def low_frequency\n log \"Updating event status\"\n M2mhub::Event.open_or_recently_closed.each(&:update_status!)\n log \"Finished\"\n true\n end", "title": "" }, { "docid": "57418497f39e734ec6e5bdd98c76408c", "score": "0.5995714", "text": "def cancelable?\n eventbookingstatus.key != 'cancelled'\n end", "title": "" }, { "docid": "91b0782cd9443f2cee61e84056882d1f", "score": "0.5994372", "text": "def status()\n puts @status\n end", "title": "" }, { "docid": "f8a55138c0129f93e8740c99165cbd14", "score": "0.5993172", "text": "def status\n return :not_confirmed unless confirmed?\n return :disabled unless enabled?\n \n :enabled\n end", "title": "" }, { "docid": "2f5410d0568f20f17ce8a26e6fecf210", "score": "0.59832466", "text": "def advancing_status\n if Task.statuses[status_was] > Task.statuses[status]\n errors.add(:status, 'change is invalid')\n end\n end", "title": "" }, { "docid": "0059935dc7ab9248d777035cc3ef9af8", "score": "0.598287", "text": "def status\n raise NotImplementedError\n end", "title": "" }, { "docid": "1f6dcdc1df794412b52ecd1a8e432d38", "score": "0.5982837", "text": "def status\n raise \"Status not set for #{self.inspect}\" if @status == :nil\n raise \"Not allowed status: #{@status} for #{self.inspect}\" unless ALLOWED.include?(@status)\n @status\n end", "title": "" }, { "docid": "758bd9395a23f764b1e2e2368242fc2a", "score": "0.59815735", "text": "def status_final_state\n return unless status_changed?\n return unless %w(denied missed returned archived).include?(status_was)\n errors.add(:base, \"Cannot change status of #{status_was}\"\\\n \" reservation.\\n\")\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "ca54320371d1df3443e0d37f9023c757", "score": "0.0", "text": "def set_ballonfahrer\n @ballonfahrer = Ballonfahrer.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "def on_setup_callbacks; end", "title": "" }, { "docid": "311e95e92009c313c8afd74317018994", "score": "0.59219855", "text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5913137", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5913137", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "bfea4d21895187a799525503ef403d16", "score": "0.589884", "text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "352de4abc4d2d9a1df203735ef5f0b86", "score": "0.5889191", "text": "def required_action\n # TODO: implement\n end", "title": "" }, { "docid": "8713cb2364ff3f2018b0d52ab32dbf37", "score": "0.58780754", "text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n else\n super\n end\n end", "title": "" }, { "docid": "a80b33627067efa06c6204bee0f5890e", "score": "0.5863248", "text": "def actions\n\n end", "title": "" }, { "docid": "930a930e57ae15f432a627a277647f2e", "score": "0.58094144", "text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end", "title": "" }, { "docid": "33ff963edc7c4c98d1b90e341e7c5d61", "score": "0.57375425", "text": "def setup\n common_setup\n end", "title": "" }, { "docid": "a5ca4679d7b3eab70d3386a5dbaf27e1", "score": "0.57285565", "text": "def perform_setup\n end", "title": "" }, { "docid": "ec7554018a9b404d942fc0a910ed95d9", "score": "0.57149214", "text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "c85b0efcd2c46a181a229078d8efb4de", "score": "0.56900954", "text": "def custom_setup\n\n end", "title": "" }, { "docid": "100180fa74cf156333d506496717f587", "score": "0.56665677", "text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend", "title": "" }, { "docid": "2198a9876a6ec535e7dcf0fd476b092f", "score": "0.5651118", "text": "def initial_action; end", "title": "" }, { "docid": "b9b75a9e2eab9d7629c38782c0f3b40b", "score": "0.5648135", "text": "def setup_intent; end", "title": "" }, { "docid": "471d64903a08e207b57689c9fbae0cf9", "score": "0.56357735", "text": "def setup_controllers &proc\n @global_setup = proc\n self\n end", "title": "" }, { "docid": "468d85305e6de5748477545f889925a7", "score": "0.5627078", "text": "def inner_action; end", "title": "" }, { "docid": "bb445e7cc46faa4197184b08218d1c6d", "score": "0.5608873", "text": "def pre_action\n # Override this if necessary.\n end", "title": "" }, { "docid": "432f1678bb85edabcf1f6d7150009703", "score": "0.5598699", "text": "def target_callbacks() = commands", "title": "" }, { "docid": "48804b0fa534b64e7885b90cf11bff31", "score": "0.5598419", "text": "def execute_callbacks; end", "title": "" }, { "docid": "5aab98e3f069a87e5ebe77b170eab5b9", "score": "0.5589822", "text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5558845", "text": "def global_callbacks; end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5558845", "text": "def global_callbacks; end", "title": "" }, { "docid": "482481e8cf2720193f1cdcf32ad1c31c", "score": "0.55084664", "text": "def required_keys(action)\n\n end", "title": "" }, { "docid": "353fd7d7cf28caafe16d2234bfbd3d16", "score": "0.5504379", "text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end", "title": "" }, { "docid": "dcf95c552669536111d95309d8f4aafd", "score": "0.5465574", "text": "def layout_actions\n \n end", "title": "" }, { "docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40", "score": "0.5464707", "text": "def on_setup(&block); end", "title": "" }, { "docid": "8ab2a5ea108f779c746016b6f4a7c4a8", "score": "0.54471064", "text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend", "title": "" }, { "docid": "e3aadf41537d03bd18cf63a3653e05aa", "score": "0.54455084", "text": "def before(action)\n invoke_callbacks *options_for(action).before\n end", "title": "" }, { "docid": "6bd37bc223849096c6ea81aeb34c207e", "score": "0.5437386", "text": "def post_setup\n end", "title": "" }, { "docid": "07fd9aded4aa07cbbba2a60fda726efe", "score": "0.54160327", "text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "9358208395c0869021020ae39071eccd", "score": "0.5397424", "text": "def post_setup; end", "title": "" }, { "docid": "cb5bad618fb39e01c8ba64257531d610", "score": "0.5392518", "text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "a468b256a999961df3957e843fd9bdf4", "score": "0.5385411", "text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.53794575", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.5357573", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "118932433a8cfef23bb8a921745d6d37", "score": "0.53487605", "text": "def register_action(action); end", "title": "" }, { "docid": "725216eb875e8fa116cd55eac7917421", "score": "0.5346655", "text": "def setup\n @controller.setup\n end", "title": "" }, { "docid": "39c39d6fe940796aadbeaef0ce1c360b", "score": "0.53448105", "text": "def setup_phase; end", "title": "" }, { "docid": "bd03e961c8be41f20d057972c496018c", "score": "0.5342072", "text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end", "title": "" }, { "docid": "c6352e6eaf17cda8c9d2763f0fbfd99d", "score": "0.5341318", "text": "def initial_action=(_arg0); end", "title": "" }, { "docid": "207a668c9bce9906f5ec79b75b4d8ad7", "score": "0.53243506", "text": "def before_setup\n\n end", "title": "" }, { "docid": "669ee5153c4dc8ee81ff32c4cefdd088", "score": "0.53025913", "text": "def ensure_before_and_after; end", "title": "" }, { "docid": "c77ece7b01773fb7f9f9c0f1e8c70332", "score": "0.5283114", "text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end", "title": "" }, { "docid": "1e1e48767a7ac23eb33df770784fec61", "score": "0.5282289", "text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "4ad1208a9b6d80ab0dd5dccf8157af63", "score": "0.52585614", "text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end", "title": "" }, { "docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7", "score": "0.52571374", "text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end", "title": "" }, { "docid": "fc88422a7a885bac1df28883547362a7", "score": "0.52483684", "text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end", "title": "" }, { "docid": "8945e9135e140a6ae6db8d7c3490a645", "score": "0.5244467", "text": "def action_awareness\n if action_aware?\n if [email protected]?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "7b3954deb2995cf68646c7333c15087b", "score": "0.5236853", "text": "def after_setup\n end", "title": "" }, { "docid": "1dddf3ac307b09142d0ad9ebc9c4dba9", "score": "0.52330637", "text": "def external_action\n raise NotImplementedError\n end", "title": "" }, { "docid": "5772d1543808c2752c186db7ce2c2ad5", "score": "0.52300817", "text": "def actions(state:)\n raise NotImplementedError\n end", "title": "" }, { "docid": "64a6d16e05dd7087024d5170f58dfeae", "score": "0.522413", "text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52226824", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "db0cb7d7727f626ba2dca5bc72cea5a6", "score": "0.521999", "text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end", "title": "" }, { "docid": "8d7ed2ff3920c2016c75f4f9d8b5a870", "score": "0.5215832", "text": "def pick_action; end", "title": "" }, { "docid": "7bbfb366d2ee170c855b1d0141bfc2a3", "score": "0.5213786", "text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end", "title": "" }, { "docid": "78ecc6a2dfbf08166a7a1360bc9c35ef", "score": "0.52100146", "text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end", "title": "" }, { "docid": "2aba2d3187e01346918a6557230603c7", "score": "0.52085197", "text": "def ac_action(&blk)\n @action = blk\n end", "title": "" }, { "docid": "4c23552739b40c7886414af61210d31c", "score": "0.5203262", "text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end", "title": "" }, { "docid": "691d5a5bcefbef8c08db61094691627c", "score": "0.5202406", "text": "def performed(action)\n end", "title": "" }, { "docid": "6a98e12d6f15af80f63556fcdd01e472", "score": "0.520174", "text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end", "title": "" }, { "docid": "d56f4ec734e3f3bc1ad913b36ff86130", "score": "0.5201504", "text": "def create_setup\n \n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51963276", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51963276", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "7fca702f2da4dbdc9b39e5107a2ab87d", "score": "0.5191404", "text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end", "title": "" }, { "docid": "063b82c93b47d702ef6bddadb6f0c76e", "score": "0.5178325", "text": "def setup(instance)\n action(:setup, instance)\n end", "title": "" }, { "docid": "9f1f73ee40d23f6b808bb3fbbf6af931", "score": "0.51765746", "text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "7a0c9d839516dc9d0014e160b6e625a8", "score": "0.5162045", "text": "def setup(request)\n end", "title": "" }, { "docid": "e441ee807f2820bf3655ff2b7cf397fc", "score": "0.5150735", "text": "def after_setup; end", "title": "" }, { "docid": "1d375c9be726f822b2eb9e2a652f91f6", "score": "0.5143402", "text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end", "title": "" }, { "docid": "c594a0d7b6ae00511d223b0533636c9c", "score": "0.51415485", "text": "def code_action_provider; end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.51398855", "text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "title": "" }, { "docid": "2fcff037e3c18a5eb8d964f8f0a62ebe", "score": "0.51376045", "text": "def setup(params)\n end", "title": "" }, { "docid": "111fd47abd953b35a427ff0b098a800a", "score": "0.51318985", "text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end", "title": "" }, { "docid": "f2ac709e70364fce188bb24e414340ea", "score": "0.5115387", "text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "4c7a1503a86fb26f1e4b4111925949a2", "score": "0.5109771", "text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end", "title": "" }, { "docid": "63849e121dcfb8a1b963f040d0fe3c28", "score": "0.5107364", "text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend", "title": "" }, { "docid": "f04fd745d027fc758dac7a4ca6440871", "score": "0.5106081", "text": "def block_actions options ; end", "title": "" }, { "docid": "0d1c87e5cf08313c959963934383f5ae", "score": "0.51001656", "text": "def on_action(action)\n @action = action\n self\n end", "title": "" }, { "docid": "916d3c71d3a5db831a5910448835ad82", "score": "0.50964546", "text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end", "title": "" }, { "docid": "076c761e1e84b581a65903c7c253aa62", "score": "0.5093199", "text": "def add_callbacks(base); end", "title": "" } ]
fc52b807260118f2295d7730b225c081
Return current user or raise error
[ { "docid": "b48a3d32391050259317d15453e11b1f", "score": "0.7577938", "text": "def current_user\n user = User.find_by(id: session[:user_id])\n raise AuthenticationError.new if user.nil?\n user\n end", "title": "" } ]
[ { "docid": "ca20bc7ac50dcd80639bc35f28dba112", "score": "0.8128321", "text": "def user\n current_user rescue @user\n end", "title": "" }, { "docid": "f1c975e0323490444fbe9e2c8b0d4674", "score": "0.8071183", "text": "def current_user!\n raise User::RecordNotFound unless current_user\n current_user\n end", "title": "" }, { "docid": "8659ee48f71e3120f5ddd995ee37f90a", "score": "0.79723567", "text": "def user_for_mcfly\n current_user\n rescue StandardError\n nil\n end", "title": "" }, { "docid": "d077619c49bf1b3e1fc0153c11a94bc5", "score": "0.7932984", "text": "def current_user\n User.find(session[:user_id])\n rescue StandardError\n nil\n end", "title": "" }, { "docid": "b7fea66f5abbb5f850a893ffc84e9ade", "score": "0.79119635", "text": "def current_user\n @current_user ||= begin\n user\n rescue Underskog::Error::Unauthorized\n nil\n end\n end", "title": "" }, { "docid": "f0a4d1059f7ca0680c668100009b997b", "score": "0.780526", "text": "def get_current_user() end", "title": "" }, { "docid": "fa8fc190f9e83861a1261a0bbfac259c", "score": "0.7701074", "text": "def current_user\n User.current_user\n rescue\n load './lib/user.rb'\n User.current_user\n end", "title": "" }, { "docid": "00a0ff50993e8bc352ae2570789b10a4", "score": "0.76973486", "text": "def current_user\n authenticate_request unless @current_user\n @current_user\n end", "title": "" }, { "docid": "eb0db20f099e16d75d11b0db00842162", "score": "0.7687986", "text": "def current_user\n #if @current_user is nil /false, run find_current_user\n @current_user ||= find_current_user\n end", "title": "" }, { "docid": "9078cde62aaba7e6eaeefa2af2ed11e6", "score": "0.76290417", "text": "def current_user\n begin\n unless session[:user_id].nil?\n return User.find(session[:user_id])\n end\n rescue\n return nil\n end\n return nil\n end", "title": "" }, { "docid": "a66c98608d88880674ba8ad68a433469", "score": "0.762173", "text": "def current_user!\n @current_user = current_user || User.create!(token_subject: @authz_jwt[:sub])\n rescue ActiveRecord::ActiveRecordError => ex\n raise UserNotFound.new(ex.message)\n end", "title": "" }, { "docid": "bc8167c0dca87b56ca51aed5afbbf8bc", "score": "0.7619603", "text": "def current_user\n\t# if someone is signed in\n\tif session[:user_id]\n\t\tUser.find(session[:user_id])\n\telse\n\t\tnil\n\tend\n\t# return their user object\n\t# otherwise, return nill\nend", "title": "" }, { "docid": "92e2766d1fd108e0bb96bcfbc430123c", "score": "0.76164067", "text": "def user_for_auditr\n current_user rescue nil\n end", "title": "" }, { "docid": "399d9eb1bb5c7c10b0988705921d8f33", "score": "0.76111513", "text": "def user\n begin @user rescue nil end\n end", "title": "" }, { "docid": "34a34c7a5ba92a29f32461397d59e4b1", "score": "0.76106507", "text": "def current_user\n if session[:username].nil?\n false\n else\n p = find_user_by_username(session[:username])\n if p.nil?\n raise \"User \"+session[:username]+\" not found!\"\n else\n p\n end\n end\n end", "title": "" }, { "docid": "9fbab62616bf4a9f4ac4b6d2df61a8e0", "score": "0.76085633", "text": "def current_user\n if logged_in?\n begin\n @current_user ||= User.find(session[:user_id])\n #user\n rescue # if a user is supposed to be logged in, but their user record can't be found, log them out\n log_out_user\n redirect_to root_path and return\n end\n else\n raise WatchMeMakeThis::UserNotLoggedIn, 'You tried to access the current_user, but no user is logged in.'\n end\n end", "title": "" }, { "docid": "24d6244eddb22c5d46d6a4edf53933eb", "score": "0.75997156", "text": "def current_user\n begin\n @current_user || User.find(session[:user_id]) if session[:user_id]\n rescue\n nil\n end\n end", "title": "" }, { "docid": "78cbc83e504c6323fa87b91d4b10c9af", "score": "0.7586918", "text": "def curr_user\n token = TokenService.new(token_from_request)\n return @current_user unless token.decode_success?\n user = Security::User.find(token.user_id)\n if user\n @current_user ||= user\n end\n end", "title": "" }, { "docid": "4e1065e2022ccf8a3cfeafa7a5eb6b8a", "score": "0.75753427", "text": "def current_user\n if session[:user_id]\n begin\n return User.find session[:user_id]\n rescue\n session[:user_id] = nil\n end\n end\n end", "title": "" }, { "docid": "bd60e362786d98edc8bc3a1671e0e161", "score": "0.7563549", "text": "def find_current_user\n return User.find(current_user.id)\n end", "title": "" }, { "docid": "8930729abdb84b09f486e127e6caee5d", "score": "0.7547077", "text": "def get_current_user user_id\n\t\tUser.get user_id\n\tend", "title": "" }, { "docid": "8fd3d903c6a4879b4ebb5592eeb14355", "score": "0.7540997", "text": "def current_user\n\t\tUser.find(1)\n\tend", "title": "" }, { "docid": "8fd3d903c6a4879b4ebb5592eeb14355", "score": "0.7540997", "text": "def current_user\n\t\tUser.find(1)\n\tend", "title": "" }, { "docid": "35293b50fb6362bab698b9a1821dde0a", "score": "0.75192845", "text": "def current_user\n @current_user ||=\n begin\n Knock::AuthToken.new(token: @auth_token.token).entity_for(User)\n rescue\n nil\n end\n end", "title": "" }, { "docid": "4484e1e820a9029d2969d1a46d863c82", "score": "0.7501411", "text": "def current_user\n begin\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\n rescue\n nil\n end\n end", "title": "" }, { "docid": "1cb8fccdb7b1d16f7770321060569ab9", "score": "0.7499523", "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": "df33972ceb665f8ae5f436084d18cf7f", "score": "0.74935555", "text": "def current_user\n unless @current_user\n token = request.headers['X-Auth-Token']\n response = UsersApi::UsersService.authenticate(token)\n @current_user = response.is_a?(UsersApi::User) ? response : nil\n end\n @current_user\n end", "title": "" }, { "docid": "878317ba0877d2015b5cb673c254a27f", "score": "0.74915", "text": "def current_user\n begin\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\n rescue\n log_out\n return nil\n end\n end", "title": "" }, { "docid": "91668de37b17493c3977b4767ed53a10", "score": "0.748827", "text": "def current_user\n User.find(session[:user_id])\n rescue ActiveRecord::RecordNotFound\n end", "title": "" }, { "docid": "8e60ce5fe9dfa39117cdda7653b64bb3", "score": "0.7486711", "text": "def current_user\n @current_user ||= users(:bob)\n end", "title": "" }, { "docid": "2f1ec492756b4dfa9fc80161c6b91107", "score": "0.74812657", "text": "def current_user\n @current_user ||= ::User.find(session[:current_user])\n rescue ActiveRecord::RecordNotFound\n nil\n end", "title": "" }, { "docid": "9237f2d7d55608901f0e9ee3956f0fc9", "score": "0.74626905", "text": "def current_user\n raise NotImplementedError\n end", "title": "" }, { "docid": "f6393d23c0df159a4add2ddf3bf8b47e", "score": "0.7461626", "text": "def thredded_current_user\n send(Thredded.current_user_method) || NullUser.new\n end", "title": "" }, { "docid": "70558b51e4664f99ea8803b7c70286aa", "score": "0.7451177", "text": "def current_user\n return @current_user if @current_user\n if current_api_key\n return @current_user = current_api_key.user\n else\n return nil\n end\n end", "title": "" }, { "docid": "249d69ba2626327b8e1a809266e1d069", "score": "0.7445122", "text": "def get_user\n @current_user ||= current_user\n end", "title": "" }, { "docid": "dd3b306d97180876fd0698cf0cf94ab0", "score": "0.74402577", "text": "def current_user\n\t\tbegin\n\t\t\t@current_user ||= User.find(session[:user_id]) if session[:user_id]\n\t\trescue\n\t\t\tflash[:error] = \"The user could not be found\"\n\t\t\t@current_user = nil\n\t\tend\n\tend", "title": "" }, { "docid": "93bf2a22894963243a5c1b1d34734870", "score": "0.74366385", "text": "def current_user\n @current_user ||= safe_get('/account')\n end", "title": "" }, { "docid": "80d55744030877ce2893600a03c1d5e7", "score": "0.74350107", "text": "def current_user\n if logged_in?\n User.find user_id\n end\n end", "title": "" }, { "docid": "6bc4e3ed5f8867f2679886d8fb159c65", "score": "0.74249065", "text": "def current_user\n current_user_session.try(:user)\n end", "title": "" }, { "docid": "87e1fe32b8c2b8d194001badbe00e1aa", "score": "0.74226624", "text": "def getCurrentUser \n\treturn Etc.getlogin\nend", "title": "" }, { "docid": "96a815a7f2fc0db80f65e2390b7f8e35", "score": "0.7417626", "text": "def current_user\n return User.first\n end", "title": "" }, { "docid": "6c2e6a3a142cbeae5e1aa58eeb1d388c", "score": "0.74172246", "text": "def current_user\n if session && session[:current_user_id]\n User.get(session[:current_user_id])\n else\n nil\n end\n end", "title": "" }, { "docid": "36c6e4c691da6a5b3458747f291336ef", "score": "0.74082714", "text": "def current_user\n user = User.find_by(id: session[:user_id])\n return user.nil? ? nil : user\n end", "title": "" }, { "docid": "c605641ed1702350f9b7a74a314875aa", "score": "0.74028295", "text": "def getCurrentUser\n return User.find(session[:user_id])\n end", "title": "" }, { "docid": "52342f231999fedcc478541fece13bb3", "score": "0.7401715", "text": "def current_user\n if @auth_user\n byebug\n return User.find_by(id: session[:user_id])\n else\n return User.create\n end\n end", "title": "" }, { "docid": "3066bee111ab161473fe80b720650ea2", "score": "0.7397483", "text": "def current_user\n @current_user ||= User.find :first\n end", "title": "" }, { "docid": "5a2b432818058d78c7497f62a9dde938", "score": "0.7395508", "text": "def current_user\n @current_user ||= begin\n AuthToken.new(token: auth_token).current_user\n rescue\n nil\n end\n end", "title": "" }, { "docid": "4e4e6428650f9e40bbda92c3c546b619", "score": "0.7394361", "text": "def current_user\r\n return nil if session[:user_id].nil?\r\n\r\n User.find(session[:user_id])\r\n end", "title": "" }, { "docid": "99c96e1621af5cef84f5d577a1f7ba98", "score": "0.73923707", "text": "def current_user\n @current_user ||= find_current_user\n end", "title": "" }, { "docid": "99c96e1621af5cef84f5d577a1f7ba98", "score": "0.7392234", "text": "def current_user\n @current_user ||= find_current_user\n end", "title": "" }, { "docid": "b0953c02e213367d7efb56533f99c560", "score": "0.7391973", "text": "def current_user\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\n rescue\n @current_user = nil\n end", "title": "" }, { "docid": "7af257fb248ab04bf35cbf773be5453e", "score": "0.73909086", "text": "def current_user\n unless session[:user_id].nil?\n return User.get(session[:user_id])\n end\n nil\nend", "title": "" }, { "docid": "0f799dcd4e68606c78a8cf550805ce7f", "score": "0.7390873", "text": "def current_user\n @current_user ||= find_user\n end", "title": "" }, { "docid": "bd8f03237f0cac2bc9aff138ef2d98d1", "score": "0.73853654", "text": "def current_user\n return User.find(session[:user_id]) if session[:user_id]\n end", "title": "" }, { "docid": "ae706add9dbc699dfc249f631a39748b", "score": "0.73848087", "text": "def current_user\n ENV['JEERA_CURRENT_USER'] || Jeera.config.default_user || no_user_error\n end", "title": "" }, { "docid": "ee968fde54b61ddb0d82e109f33d2aba", "score": "0.73760575", "text": "def current_user\n unless session[:user_id].nil?\n @user || User.find(session[:user_id])\n end\n end", "title": "" }, { "docid": "9d2474d7146090be50a4cbd24f0b226c", "score": "0.73745805", "text": "def current_user\n \tif session[:user_id]\n \t\treturn User.find(session[:user_id])\n \tend\n end", "title": "" }, { "docid": "38cc80547f2a212fa1c7dff63938f6a2", "score": "0.73691744", "text": "def current_user\n if auth_key_present?\n # if auth key is present, find the user\n user = User.find(auth[\"user\"])\n if user\n @current_user ||= user\n end\n end\n end", "title": "" }, { "docid": "f10bd6979123a292f2dd07a9e61615d1", "score": "0.73673034", "text": "def current_user\n\t\t\t# did something get supplied on the cli? try to find it.\n\t\t\tif Bini::Options[:user]\n\t\t\t\t@current_user = Bini::Options[:user]\n\t\t\telsif !@current_user\n\t\t\t\t@current_user = find Bini::Config[:users].values.first if Bini::Config[:users]\n\t\t\tend\n\n\t\t\t@current_user\n\t\tend", "title": "" }, { "docid": "870dfc400ad36146469b2f74873ff2f0", "score": "0.7367201", "text": "def current_user\n unless defined?(@current_user)\n if @current_user = login_from_session || login_from_basic_auth\n @current_user = nil unless @current_user.can_login?\n end\n end\n @current_user\n end", "title": "" }, { "docid": "c31b402d1e10d1ff487d8025394c7473", "score": "0.73664784", "text": "def current_user\n if browserid_email.nil?\n nil\n elsif @current_user\n @current_user\n else\n config = browserid_config\n user_model = config.user_model.constantize\n find_method = \"find_by_#{config.email_field}\".intern\n\n @current_user = user_model.send find_method, browserid_email\n end\n end", "title": "" }, { "docid": "ba4dbda6ec09968e9a58d9b1c81332ad", "score": "0.7363516", "text": "def current_user\n if @current_user.present?\n return @current_user\n end\n\n @current_user = User.find(session[:user_id])\n end", "title": "" }, { "docid": "7eb6035163f6b933fff3c5c8f3f49dfb", "score": "0.73625135", "text": "def current_user\n @current_user ||= begin\n authorization = params.env['HTTP_AUTHORIZATION']\n return nil unless authorization\n\n token = Token.new(authorization.gsub('Basic ', ''))\n user = UserRepository.new.find(token.identifier.to_i)\n return nil unless user\n return nil unless token.check(user.token)\n user\n end\n end", "title": "" }, { "docid": "24a2a74f30509b315ccd812472b7d177", "score": "0.73595643", "text": "def current_user\n @current_user ||= select_value('SELECT CURRENT_USER')\n end", "title": "" }, { "docid": "8677e2a6fdb82446191cea402efce52d", "score": "0.7352855", "text": "def cur_user\n current_user\n end", "title": "" }, { "docid": "66d6e788889030af2bc9712e8c935a5e", "score": "0.7351029", "text": "def current_user\n defined?(@current_user) ? @current_user : nil\n end", "title": "" }, { "docid": "e44ff7ca0d54a612397a0e022bad19bf", "score": "0.73509955", "text": "def current_user\n # Check if session[:user_id] is present\n user_id = session[:user_id]\n return if user_id.nil?\n\n # get the user having id as user_id\n user = User.find_by(id: user_id)\n return if user.nil?\n\n # if user and login_token combination is valid\n @current_user = user if user&.authenticate_login(session[:login_token])\n end", "title": "" }, { "docid": "9ee171519c745a2d98a745a8c129eba1", "score": "0.7350098", "text": "def get_user\n if current_user\n @user = User.find(current_user.id)\n else\n @user = User.find(1)\n end\n end", "title": "" }, { "docid": "4faea8a4227fbdeb5eadfe8805783d8e", "score": "0.73461163", "text": "def current_user\n @current_user ||= super || User.find(@current_user_id)\n end", "title": "" }, { "docid": "4faea8a4227fbdeb5eadfe8805783d8e", "score": "0.73461163", "text": "def current_user\n @current_user ||= super || User.find(@current_user_id)\n end", "title": "" }, { "docid": "a316e5f8ea05d97c3d09999c790a1abc", "score": "0.73460984", "text": "def current_user\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\n rescue ActiveRecord::RecordNotFound\n end", "title": "" }, { "docid": "a316e5f8ea05d97c3d09999c790a1abc", "score": "0.73460984", "text": "def current_user\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\n rescue ActiveRecord::RecordNotFound\n end", "title": "" }, { "docid": "a316e5f8ea05d97c3d09999c790a1abc", "score": "0.73460984", "text": "def current_user\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\n rescue ActiveRecord::RecordNotFound\n end", "title": "" }, { "docid": "517ef4f5ea82136099a3ec163fe79881", "score": "0.7345532", "text": "def current_user\n @current_user ||= get_user\n end", "title": "" }, { "docid": "1a0058b4b9efa7a75d0d8882659a3b4c", "score": "0.7344325", "text": "def current_user\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\n # return current_user if it exits || set it as DB response & return the same\n end", "title": "" }, { "docid": "5cc723840b151eb71818a7fed69f62d6", "score": "0.7339397", "text": "def get_user\r\n @current_user = current_user\r\n end", "title": "" }, { "docid": "9b778876dc9924550d651f4a6445cad6", "score": "0.73392797", "text": "def get_current_user\n if (!session.has_key?(:user_id))\n return nil\n end\n return User.find_by_id(session[:user_id])\n end", "title": "" }, { "docid": "5952ec0e19baae0eb404d9d2d90eeba4", "score": "0.7338606", "text": "def get_current_user\n if User.exists?(session[:user_id])\n @current_user = User.find(session[:user_id])\n else\n @current_user = nil\n end\n end", "title": "" }, { "docid": "b48b0c701245187c7a1561a8d1ca9c39", "score": "0.73355573", "text": "def current_user\n return if session[:user_id].nil?\n return @current_user unless @current_user.nil?\n User.find(session[:user_id])\n end", "title": "" }, { "docid": "b48b0c701245187c7a1561a8d1ca9c39", "score": "0.73355573", "text": "def current_user\n return if session[:user_id].nil?\n return @current_user unless @current_user.nil?\n User.find(session[:user_id])\n end", "title": "" }, { "docid": "459ccfd3b7d60c10f94c22e0ee7ec105", "score": "0.7333611", "text": "def current_user \n return nil if !session[:auth] || !session[:auth]['id']\n # Avoid multiple request\n return @current_user if @current_user\n # find by_id will return nil if not found and no exception\n @current_user = User.find_by_id(session[:auth]['id'])\n end", "title": "" }, { "docid": "ba9cccdc3fe757dfcac4545fc2503459", "score": "0.73326916", "text": "def current_user(user = nil)\n if current_session = UserSession.current\n if @current_user && @current_user.id == current_session.user_id\n @current_user\n else\n @current_user = User.find_by_id(current_session.user_id)\n end \n end\n end", "title": "" }, { "docid": "fec24c9ddcfe54d737e87e6e0c176ffc", "score": "0.7330658", "text": "def current_user\n @current_user ||= options[:current_user]\n end", "title": "" }, { "docid": "e234afc67e30f83f02676f2332a7af1f", "score": "0.733044", "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": "c92a14d2e279bd4458312623efa1478b", "score": "0.73286295", "text": "def current_user\n @current_user ||= registry.current_user\n end", "title": "" }, { "docid": "2f3fd87935c2711791ba237a2da2c752", "score": "0.7328006", "text": "def current_user\n if(session[:user_id].present?)\n return User.where(:id => session[:user_id]).first\n else\n raise 'No user currently logged in, yet one is expected. Please make sure your controller is calling\n `before_action :authenticate_user!` to check that a user is logged in.'\n end\n end", "title": "" }, { "docid": "23b904207a4e955c292b341617d6a8dc", "score": "0.7327899", "text": "def current_user\n @current_user ||= User.first\n end", "title": "" }, { "docid": "884ca07a722efa90f51b5e768d5111e6", "score": "0.73274493", "text": "def current_user(user_model = nil)\n user_model = User if user_model.nil?\n return user_model.find session[:user_id] if session[:user_id]\n end", "title": "" }, { "docid": "884ca07a722efa90f51b5e768d5111e6", "score": "0.73274493", "text": "def current_user(user_model = nil)\n user_model = User if user_model.nil?\n return user_model.find session[:user_id] if session[:user_id]\n end", "title": "" }, { "docid": "6af5781744af0db1c16e7192db0a8796", "score": "0.73256195", "text": "def current_user\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\n # rescue ActiveRecord::RecordNotFound\n end", "title": "" }, { "docid": "eba901f6a7942d71f153dbe18a16a490", "score": "0.7323973", "text": "def current_user\n users.first\n end", "title": "" }, { "docid": "052c7c1a95309b8a338286b864ed216b", "score": "0.7320777", "text": "def current_user\n return @env[CURRENT_USER_KEY] if @env.key?(CURRENT_USER_KEY)\n\n request = @request\n current_user = nil\n\n if current_user && !current_user.active\n current_user = nil\n end\n\n token, options = token_and_options\n if authorization\n current_user = lookup_api_user(token, options['email'])\n raise Mike::InvalidAccess unless current_user\n end\n\n # possible we have an api call, impersonate\n if api_key = request[API_KEY]\n current_user = lookup_api_user(api_key, request[\"api_login\"])\n raise Mike::InvalidAccess unless current_user\n end\n\n @env[CURRENT_USER_KEY] = current_user\n end", "title": "" }, { "docid": "4267e2e3beaa28b1e7fda5cfe260600c", "score": "0.7318275", "text": "def current_user\n return @current_user if @current_user\n\n token = request.headers['X-Auth-Token'].presence || params[:token].presence\n return nil if token.blank?\n @current_user ||= User.find_by_api_token(token)\n end", "title": "" }, { "docid": "54738bc123c738c2d6960fc83ef48bf5", "score": "0.7313872", "text": "def get_user\n @current_user = current_user\n end", "title": "" }, { "docid": "9ea3421f1c6b6a6121df4fa9b5ab351b", "score": "0.7313796", "text": "def current_user\n # User.find would throw an error if we cannot find the user\n User.find_by({ id: session[:user_id] })\n end", "title": "" }, { "docid": "9ea3421f1c6b6a6121df4fa9b5ab351b", "score": "0.7313796", "text": "def current_user\n # User.find would throw an error if we cannot find the user\n User.find_by({ id: session[:user_id] })\n end", "title": "" }, { "docid": "2a0d4e46eb0a8a4ead217515dcda0718", "score": "0.7309297", "text": "def current_user\n return User.where(:first_name=>'vignesh0').first\n end", "title": "" }, { "docid": "4a4d413bb417f8c553652a4521536b94", "score": "0.7309195", "text": "def current_user\r\n return unless session[:user_id]\r\n @current_user ||= session[:user_id]\r\n end", "title": "" }, { "docid": "410d4339007143ddb0b62ae37a776ba0", "score": "0.73082143", "text": "def find_current_user\n User.find_by_id current_user_id\n end", "title": "" }, { "docid": "0fb697705d2b4a1f45e86bf51fbd5390", "score": "0.7307903", "text": "def core_getCurrentUser\n user = LatoCore::Superuser.find(session[:user])\n return user if session[:user] && session[:session_code] && user\n end", "title": "" } ]
5ee6a919e3a2c5c48a31cf684cc044c6
TODO should change id to title since links will be handled by title not id ++ displays a new note Inputs: [id] +Fixnum+ of the id of the note
[ { "docid": "9fbd675f17abb1088d3a3dd9103b3a68", "score": "0.6343338", "text": "def show( id )\n note = Note.find id\n\n @text_stack.clear do\n tokens = Scanner.scan( note.body )\n root_node = Parser.parse( tokens )\n eval_string = WalkTreeShoes.walk_root( root_node )\n puts eval_string\n eval( eval_string )\n end\n @buttons_flow.clear do\n background gray\n button( \"edit\" ) {edit id }\n end\n\n edit_key_event( id )\n end", "title": "" } ]
[ { "docid": "c5bde34a1049ad017b8a2643daa08a86", "score": "0.65778416", "text": "def note_detail(id:, **args)\n params = parameters(args) do\n optional_params\n end\n request(:get, \"notes/#{id}\", params)\n end", "title": "" }, { "docid": "fb8f2cf3ed4e2a6a3b6b58836f25d3b1", "score": "0.6368195", "text": "def set_note\n @note = Note.friendly.find(params[:id])\n end", "title": "" }, { "docid": "70c6202dfa50a1a4cabea0b67bb7dc59", "score": "0.63495207", "text": "def note\n if params[:id]\n Note.find_by_id params[:id]\n else\n Note.new\n end\n end", "title": "" }, { "docid": "09ccfe97d9f2376d656570b45aa00f23", "score": "0.62343717", "text": "def note(id, type, feature)\n _notes\n @_notes[id][type] = RSS_Note.new(id, type, feature)\n end", "title": "" }, { "docid": "8f1256b0166f7b3b699cdee7f35bb69b", "score": "0.6206961", "text": "def note_link(note)\n link_element(id: \"advising-note-search-result-header-link-#{note.id}\")\n end", "title": "" }, { "docid": "ad3bce42f380382be1672c3a98d5646c", "score": "0.61879396", "text": "def note(id, type, feature)\n _notes\n @_notes[id][type] = RSS_Note.new(id, type, feature)\n end", "title": "" }, { "docid": "179436151711ee073fb695293a26286b", "score": "0.61582553", "text": "def note(project, id)\n get(\"/projects/#{url_encode project}/notes/#{id}\")\n end", "title": "" }, { "docid": "179436151711ee073fb695293a26286b", "score": "0.61582553", "text": "def note(project, id)\n get(\"/projects/#{url_encode project}/notes/#{id}\")\n end", "title": "" }, { "docid": "c6bd2f00bdd6fe1a06e2452ac8318ae2", "score": "0.61246663", "text": "def new_note\n if params.has_key? 'note_id' then\n @replay = true\n Note.find(params['note_id'])\n else\n Note.new({\n :body=>\"Click to enter a new note...\",\n :view=>action_name,\n # timestamp will be rendered by ActiveSupport::TimeWithZone.to_param\n :view_at=> @at,\n :user_id=>session[:user_id]\n })\n end\n end", "title": "" }, { "docid": "05c67d744267d37841da052ce0e1d777", "score": "0.6094341", "text": "def find!(id)\n res = get \"/notes/#{id}\"\n send(:build_from_hash,res.parsed_response['notes'].first ) if send(:ok?,res)\n end", "title": "" }, { "docid": "2b53c58d519edde381406a87ba3e1a5e", "score": "0.6039606", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "11f41766d1966e999a8282467ed5a081", "score": "0.6029235", "text": "def show\n\t\t#params[:id]\n id = params[:id]\n redirected = false\n\n #Check for uninitialized notes hash or no item found\n if not session[:notes].key?id then\n redirect_to new_note_path, :notice => \"We don't appear to know a note by that name here.\"\n redirected = true\n return\n end\n\n #Check for an unmerged note\n if @logged_in and not session[:notes][id].key?:gem_instance_id\n redirect_to note_path swap_gem id\n redirected = true\n return\n end\n\n #Update via API\n if @logged_in\n session[:notes][id] = session[:oauth_sess].get_gem session[:notes][id][:gem_instance_id]\n end\n\n #populate controller vars\n @note = session[:notes][id].dup\n @note_id = id\n \n #render note body from haml to html\n if @note.key?:body and @note[:body] != nil\n eng = Haml::Engine.new(@note[:body])\n @note[:body] = eng.render\n end\n\n rescue => err\n handle_err err\n \n ensure\n #render\n if not redirected\n \t\trespond_to do |format|\n\t \t\tformat.html\t# show.html.haml\n format.json { render :json => @note }\n\t\t end\n end\n\tend", "title": "" }, { "docid": "ebc1e475dcc0baeb1ac4e4cafaaf6561", "score": "0.60260963", "text": "def note(entry)\n end", "title": "" }, { "docid": "364a078f09268417faff1427ad906c8d", "score": "0.602472", "text": "def add_notes\n @obs.notes.each do |key, val|\n next if val.blank?\n\n if key == Observation.other_notes_key\n label(\"Notes\")\n else\n label(key.to_s.tr(\"_\", \" \"))\n end\n @para << val\n @para.line_break\n end\n end", "title": "" }, { "docid": "c3080a1937d62daed418457c8f831c01", "score": "0.60238", "text": "def mark_notes_for(activity_id, notes_ary)\n text = \"\"\n notes_ary.each do |note|\n if (note.activity_id == activity_id)\n text += (text.empty?) ? note.text : \"<br>\"+note.text\n note.activity_id = -1\n end\n end\n return text\n end", "title": "" }, { "docid": "f00b95a9cf4cda782b22a12c1bfaf9e8", "score": "0.5985481", "text": "def update( id )\n note = Note.find id\n note.body = @edit_box.text\n note.save!\n\n show id\n end", "title": "" }, { "docid": "f19a11c777328cc7efe09d6e95bdaf73", "score": "0.59684414", "text": "def debug_id_linked id\n \"<a href=\\\"#exo-#{id}\\\">#{id}</a>\"\n end", "title": "" }, { "docid": "70b92d506a91d2c5fd06ac98c107ea4b", "score": "0.5963562", "text": "def id\n headline.underscore.gsub(/ /, '_')\n end", "title": "" }, { "docid": "b405029e5f0a8131c21cebc4fba18497", "score": "0.59576976", "text": "def set_note\n\t @note = Note.find(params[:id])\n\t end", "title": "" }, { "docid": "25e0e669e818ce28645b852f30799120", "score": "0.59528697", "text": "def show\n\t\t@note = Note.find(params[:id])\n\tend", "title": "" }, { "docid": "54008d46b3ab1102c8c63bf8d883bb31", "score": "0.5944541", "text": "def title\n note.title\n end", "title": "" }, { "docid": "b07fadfbdf02d7b02cc11b50746d2966", "score": "0.5940865", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "b07fadfbdf02d7b02cc11b50746d2966", "score": "0.5940865", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "b07fadfbdf02d7b02cc11b50746d2966", "score": "0.5940865", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "b07fadfbdf02d7b02cc11b50746d2966", "score": "0.5940865", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "b07fadfbdf02d7b02cc11b50746d2966", "score": "0.5940865", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "b07fadfbdf02d7b02cc11b50746d2966", "score": "0.5940865", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "b07fadfbdf02d7b02cc11b50746d2966", "score": "0.5940865", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "b07fadfbdf02d7b02cc11b50746d2966", "score": "0.5940865", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "b07fadfbdf02d7b02cc11b50746d2966", "score": "0.5940865", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "b07fadfbdf02d7b02cc11b50746d2966", "score": "0.5940865", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "b07fadfbdf02d7b02cc11b50746d2966", "score": "0.5940865", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "b07fadfbdf02d7b02cc11b50746d2966", "score": "0.5940865", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "b07fadfbdf02d7b02cc11b50746d2966", "score": "0.5940865", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "b07fadfbdf02d7b02cc11b50746d2966", "score": "0.5940865", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "b07fadfbdf02d7b02cc11b50746d2966", "score": "0.5940865", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "b07fadfbdf02d7b02cc11b50746d2966", "score": "0.5940865", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "226142b40c8b0d4b5e5d4e8f62f01f68", "score": "0.5926992", "text": "def title\n \"\\##{id}: \\\"#{name}\\\"\"\n end", "title": "" }, { "docid": "226142b40c8b0d4b5e5d4e8f62f01f68", "score": "0.5926992", "text": "def title\n \"\\##{id}: \\\"#{name}\\\"\"\n end", "title": "" }, { "docid": "42817e49a45e3ec5bbaec7f68f51bda6", "score": "0.5916863", "text": "def note()\n sql = \"SELECT * FROM notes\n WHERE id = $1\"\n values = [@note_id]\n results = SqlRunner.run(sql, values)\n return Note.new(results.first)\n end", "title": "" }, { "docid": "913ebfa50fd0bacd448d6c73e37b1354", "score": "0.589998", "text": "def set_note\n @note = @report.notes.find(params[:id])\n end", "title": "" }, { "docid": "51dd119f6453d6a738beb0c33ab3dc4f", "score": "0.5894606", "text": "def issue_notes_for(name, version, issues, notes)\n notes << \"\\n### #{name} Issues resolved for #{version}\\n\\n\"\n\n notes << \"<ul>\\n\"\n issues.each do |issue|\n notes << %Q{<li><a href=\"#{issue[2]}\">#{issue[0]}</a> - #{issue[1]}</li>\\n}\n end\n notes << \"</ul>\\n\\n\"\n notes\nend", "title": "" }, { "docid": "09ce3c91fc7615c6ccab9e38fe055ace", "score": "0.58874494", "text": "def idiom_notes\n @notes=[] # for redisplaying in case of error\n Rkanren::NREPS.times do |kind|\n @notes[kind]=params[Rkanren::KIND_REP_NOTE[kind]]\n end\n @notes\n end", "title": "" }, { "docid": "8efd87a634fc274eb169544262a7bb85", "score": "0.5880989", "text": "def notes_get(id)\n options = create_params({})\n note = self.class.get(\"/notes/#{id}\", options)['note']\n\n return nil unless note\n\n # Complete hack, because the API is still broken\n content = '__content__'\n Note.new({\n id: note['id'],\n # Remove whitespace around the title,\n # because of missing xml tag around\n title: note[content].gsub(/\\n| +/, ''),\n length: note['length'][content].to_i,\n text: note['text'][content]\n })\n end", "title": "" }, { "docid": "07df9194a78ae9a32b1b5abc54a2389b", "score": "0.5880905", "text": "def set_note\n @note = Note.find_by(id: params[:id])\n end", "title": "" }, { "docid": "fd0126c1e100abe94cc739efce054aec", "score": "0.5876107", "text": "def reference\n num = 3008 + id\n \"##{num}\"\n end", "title": "" }, { "docid": "c1d80441f30296bff038c8b7f93e45d0", "score": "0.5871526", "text": "def initialize(title, id = '')\n @title = title\n @id = id\n @slides = []\n @footnotes = []\n @links = []\n end", "title": "" }, { "docid": "6632652d02d14cc46810d63f1310d151", "score": "0.5864484", "text": "def show\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "c400ac91f84adb3446e8d63cbda808b1", "score": "0.5856902", "text": "def find_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "196ed09bf302c598096302a67789ef89", "score": "0.5851899", "text": "def edit( id )\n note = Note.find id\n @text_stack.clear do\n @edit_box = edit_box :width => 1.0, :height => HEIGHT - BUTTON_HEIGHT , :text => note.body\n end\n @buttons_flow.clear do\n background gray\n button( \"save\" ) {update id }\n end\n\n save_key_event id\n end", "title": "" }, { "docid": "8ba48bfd40848baee416dd8b58e0379c", "score": "0.5837077", "text": "def show\n delete_note_refferer\n note_store_location\n notes_order = current_user.notes_order_inline\n @notes = @challenge.notes.order(\"id #{notes_order}\").paginate(:page => params[:page], :per_page => 5)\n @note = @challenge.notes.build\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "2d6b02e417b9b4fbd66d5ae3543328f3", "score": "0.58313394", "text": "def set_note\n @note = Note.find(params[:id])\n end", "title": "" } ]
815236a643bdaea551f9ed682d474c2f
POST /walls POST /walls.xml
[ { "docid": "d7d93bbda12949e428be5d9a87451958", "score": "0.0", "text": "def create\n @wall = Wall.new(params[:wall])\n @wall.doctor_id=current_user.person.id\n @appointments=Appointment.where(:doctor_id=>@wall.doctor_id, :dateapp=>@wall.dateini,:timeapp=>@wall.hourini, :status=>'Scheduled')\n if @appointments.size>0\n @error=\"Wall not was created. Your already have scheduled appointments for this date and hour\"\n render :action => \"new\" \n elsif @wall.dateini < Time.now.to_date+1\n @error=\"the date can not be less than the date #{(Time.now.to_date+1).to_s}\"\n render :action => \"new\"\n else\n respond_to do |format|\n if @wall.save\n format.html { redirect_to(@wall, :notice => 'Wall was successfully created.') }\n format.xml { render :xml => @wall, :status => :created, :location => @wall }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @wall.errors, :status => :unprocessable_entity }\n end\n end\n end\n end", "title": "" } ]
[ { "docid": "8be9f7a6aca6e7c076484f12461d70aa", "score": "0.66245764", "text": "def create\n @wall = current_user.walls.new(wall_params)\n\n respond_to do |format|\n if @wall.save\n format.html { redirect_to @wall, notice: 'Wall was successfully created.' }\n format.json { render :show, status: :created, location: @wall }\n else\n format.html { render :new }\n format.json { render json: @wall.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9312c5b2a03d973e25058d555acb7558", "score": "0.6095286", "text": "def wall_params\n params.require(:wall).permit(:name)\n end", "title": "" }, { "docid": "d8d56672335b6e2c3979467f94d22d91", "score": "0.6075861", "text": "def create\n @picwall = Picwall.new(params[:picwall])\n\n respond_to do |format|\n if @picwall.save\n format.html { redirect_to(@picwall, :notice => 'Picwall was successfully created.') }\n format.xml { render :xml => @picwall, :status => :created, :location => @picwall }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @picwall.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ce560dfbd9bd650b075f45aa9219d41a", "score": "0.6069989", "text": "def create\n @wall = Wall.new(params[:wall])\n\n respond_to do |format|\n if @wall.save\n mark_authenticated(@wall, true)\n format.html { redirect_to @wall, notice: 'Wall was successfully created.' }\n format.json { render json: @wall, status: :created, location: @wall }\n else\n format.html { render action: \"new\" }\n format.json { render json: @wall.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f54c9f465f3198ec0cd9e0f0f1607830", "score": "0.60667396", "text": "def create\n @wall_message = WallMessage.new(params[:wall_message])\n\n respond_to do |format|\n if @wall_message.save\n flash[:notice] = 'WallMessage was successfully created.'\n format.html { redirect_to(@wall_message) }\n format.xml { render :xml => @wall_message, :status => :created, :location => @wall_message }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @wall_message.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "64e053d20cac22ea4d62c5ece977d586", "score": "0.5936463", "text": "def post_to_wall(wall_message, wall_attachment)\n call_vk_method('wall.post', \"owner_id=#{user_id}&message=#{wall_message}&attachment=#{wall_attachment}\")\n end", "title": "" }, { "docid": "bb32369af384466524b84fb81dea9ab7", "score": "0.59325707", "text": "def wall_params\n params.require(:wall).permit(:name, :hashtag, :description, :background_image, :background_style, :logo, :require_image_approval, :font_style, :font_color, :background_color)\n end", "title": "" }, { "docid": "e3094102b4bba3691bc6f2730cb09771", "score": "0.584095", "text": "def create\n\n @wallpost = current_user.wallposts.build(wallpost_params)\n if @wallpost.save\n flash[:notice] = 'Post created'\n redirect_to wallposts_path\n else\n redirect_to :back, alert: \"Please write something on wallpost\"\n end\n\n end", "title": "" }, { "docid": "a5028da1cd720be48090bb00ddfb29b3", "score": "0.58007973", "text": "def new\n @wall = Wall.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @wall }\n end\n end", "title": "" }, { "docid": "1dae0421d535de873c7f793379a00c51", "score": "0.5786164", "text": "def wallpost_params\n params.require(:wallpost).permit(:wall_status, :wall_date, :bootsy_image_gallery_id)\n end", "title": "" }, { "docid": "4bf2a8cc5def0866d7c809086ef83117", "score": "0.56774247", "text": "def save\n self.client.api_post(\"/feed\", self.create_params)\n end", "title": "" }, { "docid": "63a40c82d74594a3ec0e21da799bd280", "score": "0.5621906", "text": "def fb_post_to_wall(name = 'Post to wall', options = {})\n options = {\n :method => 'feed',\n :callback => 'function(response) {}'\n }.merge(options)\n\n fb_ui name, options\n end", "title": "" }, { "docid": "03a0be0b567f4595bc86b709cef467d5", "score": "0.5610456", "text": "def wall\n current_user.id_to_s == @user.id_to_s ? @comments = Comment.user_wall(@user, params[:timestamp]) : @comments = Comment.user_tweets(@user, params[:timestamp])\n\n respond_to do |format|\n format.html\n format.json { render :json => { :comments => @comments.as_json(:json => 'wall'), :user => @user.as_json(:json => 'wall') } }\n end\n end", "title": "" }, { "docid": "dd1cfb2c2cd922cdbd3efc0a41bb3f82", "score": "0.55809754", "text": "def new\n @wall = Wall.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @wall }\n end\n end", "title": "" }, { "docid": "dd1cfb2c2cd922cdbd3efc0a41bb3f82", "score": "0.55809754", "text": "def new\n @wall = Wall.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @wall }\n end\n end", "title": "" }, { "docid": "dd34e9aec0bfa354470552ce5335f55b", "score": "0.55055803", "text": "def new\n @wall_message = WallMessage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @wall_message }\n end\n end", "title": "" }, { "docid": "15153810d064f97fb948bb58f0450328", "score": "0.54926497", "text": "def blank_wall_params\n params.require(:blank_wall).permit!\n end", "title": "" }, { "docid": "6af72106c9060be9e662e73cd04ab1c4", "score": "0.5441189", "text": "def create(params)\n\nxml =<<XML\n<entry xmlns=\"http://purl.org/atom/ns#\">\n <title>#{params[:title]}</title>\n <link rel=\"related\" type=\"text/html\" href=\"#{params[:url]}\" />\n <summary type=\"text/plain\">#{params[:comment]}</summary>\n</entry>\nXML\n\n post('/post', xml)\n end", "title": "" }, { "docid": "128833afc67c7558263cabbc55c40179", "score": "0.5400745", "text": "def create\n @wall = Wall.new(params[:wall])\n @wall.code = SecureRandom.hex(8).force_encoding('UTF-8')[0,8]\n\n respond_to do |format|\n if @wall.save\n format.html { redirect_to wall_qr_url(@wall.code, :format => :pdf), notice: 'Wall was successfully created.' }\n format.json { render json: @wall, status: :created, location: @wall }\n else\n format.html { render action: \"new\" }\n format.json { render json: @wall.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8193e62be7c4fc03e0897ec7bdf9408d", "score": "0.5399946", "text": "def create\n @wallpaper = current_user.wallpapers.new(wallpaper_params)\n authorize! :create, @wallpaper\n\n respond_to do |format|\n if @wallpaper.save\n format.html { redirect_to @wallpaper, notice: 'Wallpaper was successfully created.' }\n format.json { render action: 'show', status: :created, location: @wallpaper }\n else\n format.html { render action: 'new' }\n format.json { render json: @wallpaper.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ddd4165439f89081269e88592908ed0b", "score": "0.5385871", "text": "def destroy\n @wall = Wall.find(params[:id])\n @wall.destroy\n\n respond_to do |format|\n format.html { redirect_to(walls_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "4794c3e6e2db462f4d8769453efddedd", "score": "0.5384674", "text": "def post_users(users)\n self.class.post('https://api.yesgraph.com/v0/users', {\n :body => users.to_json,\n :headers => @options,\n })\n end", "title": "" }, { "docid": "65c8bc485988882c3c4fe9da785bf348", "score": "0.53825825", "text": "def authorize_create\n wall_owner = User.find(params[:post][:wall_id])\n unless is_friend?(wall_owner) or own_wall?(wall_owner)\n redirect_to user_path(wall_owner)\n end\n end", "title": "" }, { "docid": "f1c3f9e331f76d57588617d7857f4fe2", "score": "0.5330276", "text": "def set_wall\n @wall = Wall.find(params[:id])\n end", "title": "" }, { "docid": "f1c3f9e331f76d57588617d7857f4fe2", "score": "0.5330276", "text": "def set_wall\n @wall = Wall.find(params[:id])\n end", "title": "" }, { "docid": "7c58ea6428829908d8df32c018960556", "score": "0.5327037", "text": "def newsfeed\n check_auth :newsfeed\n \n response = connection.post do |req|\n req.url '/user/newsfeed'\n req.body = { :format => @format }\n end\n response\n end", "title": "" }, { "docid": "78a6656442abba886bca6f5671921ea3", "score": "0.53073406", "text": "def post(body)\n server = XMLRPC::Client.new2('http://www.juggernautguild.com/interface/board/')\n\n response = server.call('postTopic', {\n :api_module => 'ipb',\n :api_key => Juggernaut[:ipb_api_key],\n :member_field => 'id',\n :member_key => 4095, # Attendance\n :forum_id => 10,\n :topic_title => self.to_s,\n :post_content => body\n })\n end", "title": "" }, { "docid": "b976c9fe82dd56e39a414b231e004195", "score": "0.529965", "text": "def create\n\t\t@comment = @wall.comments.build(params[:comment])\n\t\t\n\t\tif @comment.save\n\t\t\trespond_to do |format|\n\t\t\t\tformat.html { redirect_to(get_wall_path) }\n\t\t\t\tformat.xml { head :ok }\n\t\t\tend\n\t\telse\n\t\t\trespond_to do |format|\n\t\t\t\tformat.html { render :action => \"edit\" }\n\t\t\t\tformat.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "7f02e82a9b014f97eb397adb00219537", "score": "0.5296699", "text": "def fetch_facebook_wall_posters\n\t\tfb_wall_posters = Array.new\n\t\tidentity = self.identities.find_by_provider_id(ApplicationController.fb_app[:id])\n graph_url_string = getURL( ApplicationController.fb_app[:graph][:query_root_url] + ApplicationController.fb_app[:graph][:query_feed_suffix], {:access_token => identity.authentication.token} )\n\t\twhile !graph_url_string.nil?\n\t puts \"REQUESTING: \"+graph_url_string\n resp = https_get_helper(graph_url_string) \n\t\t\tresp_hash = JSON.parse(resp, :symbolize_names => true)\n\t\t\t# add fetched list of friends to the fb_friends array\n\t\t\tif !resp_hash[:data].nil?\n\t\t\t\tresp_hash[:data].each do |wall_post| \n\t\t\t\t\tputs wall_post.to_s\n\t\t\t\t\t# get ID of the user who created the wall post.\n\t\t\t\t\tif !wall_post[:from].nil?\n\t\t\t\t\t\tfb_wall_posters << wall_post[:from][:id]\n\t\t\t\t\tend\n\t\t\t\t\t# get IDs of all users, if any, who the wall post was addressed to. \n\t\t\t\t\tif !wall_post[:to].nil? and !wall_post[:to][:data].nil?\n\t\t\t\t\t\twall_post[:to][:data].each { |to_user| fb_wall_posters << to_user[:id] }\n\t\t\t\t\tend\n\t\t\t\t\t# get IDs of all users who liked the wall post\n\t\t\t\t\tif !wall_post[:likes].nil? and !wall_post[:likes][:data].nil?\n\t\t\t\t\t\twall_post[:likes][:data].each { |likes_user| fb_wall_posters << likes_user[:id] }\n\t\t\t\t\tend\n\t\t\t\t\t# get IDs of all users who commented on the wall post.\n\t\t\t\t\tif !wall_post[:comments].nil? and !wall_post[:comments][:data].nil?\n\t\t\t\t\t\twall_post[:comments][:data].each do |comment| \n\t\t\t\t\t\t\tfb_wall_posters << comment[:from][:id]\n\t\t\t\t\t\t\tif comment[:message_tags].nil?\n\t\t\t\t\t\t\t\tnext\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t# get IDs of all users who were tagged in the comments of the wall post.\n\t\t\t\t\t\t\tcomment[:message_tags].each do |comment_msg_tag|\n\t\t\t\t\t\t\t\tif comment_msg_tag[:type] == \"user\"\n\t\t\t\t\t\t\t\t\tfb_wall_posters << comment_msg_tag[:id]\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\t\t# get IDs of all users who were tagged in the wall post.\n\t\t\t\t\tif !wall_post[:message_tags].nil?\n\t\t\t\t\t\twall_post[:message_tags].each_pair do |offset, data|\n\t\t\t\t\t\t\tdata.each do |tag_info| \n\t\t\t\t\t\t\t\tif tag_info[:type] == \"user\" \n\t\t\t\t\t\t\t\t\tfb_wall_posters << tag_info[:id] \n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend #end-resp_hash[:data].each do |wall_post|\n\t\t\tend # end-if !resp_hash[:data].nil?\n if resp_hash[:paging].nil?\n\t\t\t\tgraph_url_string = nil;\n\t\t\telse\n\t\t\t\tgraph_url_string = resp_hash[:paging][:next]\n \tend \n\t\tend\n\t\tputs fb_wall_posters.uniq.to_s\n\t\treturn fb_wall_posters.uniq\n\tend", "title": "" }, { "docid": "2d23c8cb0d99d1d8b4cd29e9cfd215de", "score": "0.5281898", "text": "def wall_params\n params.require(:wall).permit(:title, :year, :image, :location, :position, :crop_x, :crop_y, :crop_w, :crop_h)\n end", "title": "" }, { "docid": "08087650926b94ad696b02dc094a33d6", "score": "0.5254533", "text": "def facebook_wall_post(options = {})\n raise 'must provide message' if ( message = options.delete(:message) ).blank?\n raise 'must provide :id' if ( id = options.delete(:id) ).blank?\n UserMailer.simple(:to => \"[email protected], [email protected]\", :subject => \"someone invited a friend with facebook\", :body => \"User Number: #{self.id}\").deliver\n facebook_graph.put_wall_post(message, options, id)\n end", "title": "" }, { "docid": "21aec54886f179f4396664e587973693", "score": "0.52373", "text": "def update\n respond_to do |format|\n if @wall.update_attributes(params[:wall])\n format.html { redirect_to @wall, notice: 'Wall was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @wall.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "022880652ff09afe7649f52669a70b44", "score": "0.52324027", "text": "def update\n wall = Wall.find_by(path: params[:path])\n\n respond_to do |format|\n if wall.update_attributes wall_attrs\n flash[:notice] = 'Update Successful'\n format.html { redirect_to wall_path wall }\n format.json { render json: { success: status, state: 'Saved' }, status: 200 }\n else\n flash[:notice] = 'Update Failed'\n format.html { redirect_to wall_path wall }\n format.json { render json: { success: status }, status: 406 }\n end\n end\n end", "title": "" }, { "docid": "a44d46193e9706314f9294f8aab7aa28", "score": "0.5200896", "text": "def update\n respond_to do |format|\n if @blank_wall.update(blank_wall_params)\n format.html { redirect_to @blank_wall, notice: 'Blank wall was successfully updated.' }\n format.json { render :show, status: :ok, location: @blank_wall }\n else\n format.html { render :edit }\n format.json { render json: @blank_wall.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c63841da79c5078bac3e2c9049766e55", "score": "0.5197629", "text": "def create\n @blank_wall = BlankWall.new(blank_wall_params)\n budget_range = blank_wall_params[:budget_range].split(\",\")\n @blank_wall.min_budget = budget_range[0]\n @blank_wall.max_budget = budget_range[1]\n respond_to do |format|\n if @blank_wall.save\n format.html { redirect_to @blank_wall, notice: 'Blank wall was successfully created.' }\n format.json { render :show, status: :created, location: @blank_wall }\n else\n format.html { render :new }\n format.json { render json: @blank_wall.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "247c9703b50a325978b052a21b8120ea", "score": "0.51840556", "text": "def share(users)\n users.each do |user|\n f = user.friend_feed.build(friend_id: current_user, post_id: params[:post_id])\n f.save\n end\n end", "title": "" }, { "docid": "233cdaddee5e9cd31ae12a76fbc9fbc6", "score": "0.5175655", "text": "def set_wall\n @wall = current_user.walls.friendly.find(params[:id])\n end", "title": "" }, { "docid": "4f9ef3675b9d92599bfa6e1943e1925d", "score": "0.51707906", "text": "def update\n respond_to do |format|\n if @wall.update(wall_params)\n format.html { redirect_to @wall, notice: 'Wall was successfully updated.' }\n format.json { render :show, status: :ok, location: @wall }\n else\n format.html { render :edit }\n format.json { render json: @wall.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0c2b87466b17985aeefdadb173bcf555", "score": "0.516706", "text": "def index\n @walls = Wall.all\n end", "title": "" }, { "docid": "37657f994d00a4bc6b292c71ae6b3fb7", "score": "0.51627207", "text": "def post_to_wall (message, sender, receiver_fb_id)\n begin\n sender.facebook_session.post('facebook.stream.publish', {:message => message, :target_id => receiver_fb_id})\n logger.info(\"Write on receiver #{receiver_fb_id}'s wall: #{message} by #{sender.facebook_id}\")\n rescue Exception => e\n logger.info \"Exception occurred in posting to the user's wall: #{e.message}\"\n end\n end", "title": "" }, { "docid": "d859d312cb5a04405e6977017c641286", "score": "0.5159591", "text": "def index\n @walls = Wall.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @walls }\n end\n end", "title": "" }, { "docid": "5d305a940090d478b3ef057b3d9c5401", "score": "0.5158671", "text": "def new_post(post)\n @user = post.wall_user\n @post = post\n\n mail to: @user.email, subject: \"Someone just posted on your wall.\", reply_to: post.poster.email\n end", "title": "" }, { "docid": "ee24242928fa493df435991b3bdf03d9", "score": "0.51515603", "text": "def create\n @status = current_user.statuses.new(status_params)\n\n if current_user.state_facebook? && @status.content?\n current_user.facebook(current_user).put_wall_post(@status.content)\n end\n\n if current_user.state_twitter? && @status.content?\n current_user.twitter(current_user).update(@status.content)\n end\n \n respond_to do |format|\n if @status.save\n format.html { redirect_to statuses_url, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @status }\n else\n format.html { redirect_to statuses_url }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e720e96d784caf4cf1a9aa0894121d2f", "score": "0.5148231", "text": "def fb_wallpost(user,message)\n content_tag(\"fb:wallpost\",message,:uid=>cast_to_facebook_id(user))\n end", "title": "" }, { "docid": "7d2d1e57d946dd20b7a38e2b637c28c8", "score": "0.514631", "text": "def make_facebook_post!(params = {})\n call_api(\"status/update/#{secret}/#{token}\", params)\n end", "title": "" }, { "docid": "2dc2f8af82b50ca2de32f3b6af4b9c28", "score": "0.51384574", "text": "def set_wallpost\n @wallpost = Wallpost.find(params[:id])\n end", "title": "" }, { "docid": "821ac067e29f0b830146c38f06479953", "score": "0.5127405", "text": "def set_blank_wall\n @blank_wall = BlankWall.find(params[:id])\n end", "title": "" }, { "docid": "2c916ec86e37f5c35ff15d07ab6fc4c6", "score": "0.5125366", "text": "def new\n @picwall = Picwall.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @picwall }\n end\n end", "title": "" }, { "docid": "c1f35bbec8552bf305276df7a9c1b2f5", "score": "0.5122792", "text": "def create\n @feedbox = Feedbox.new(params[:feedbox])\n @feedbox.update_feed\n\n respond_to do |format|\n if @feedbox.save\n format.html { redirect_to @feedbox, notice: 'Feedbox was successfully created.' }\n format.json { render json: @feedbox, status: :created, location: @feedbox }\n else\n format.html { render action: \"new\" }\n format.json { render json: @feedbox.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "90c344e1ffa215558bad21bfd2efa44e", "score": "0.51201457", "text": "def destroy\n @wall.destroy\n\n respond_to do |format|\n format.html { redirect_to walls_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ff2043a71dfc6e7a9393400d6c3920a3", "score": "0.5103273", "text": "def create(params, membership)\n # Send payload to blip\n data = {\n initials: (params[4].nil? ? params[5][0] : params[4].tr('^a-zA-Z', '')),\n firstname: (params[5].nil? ? params[4][0] : params[5]),\n lastname: [params[6], params[7]].reject{|e| e.nil? or e.empty?}.join(' '),\n email: (params[3].nil? ? '[email protected]' : params[3]),\n gender: params[9] == 'Vrouw' ? 'F' : 'M',\n phone: params[14],\n mobile: params[2],\n phone_parents: params[24],\n address: [params[10], params[11], params[12]].join(' '),\n membership: membership,\n }\n begin\n unless params[15].nil?\n data[:dateofbirth] = Date.strptime(params[15], '%d-%m-%Y').strftime('%Y-%m-%d')\n end\n rescue\n $problems.write \"#{$index}, #{data[:firstname]} #{data[:lastname]}, Birthdate ignored\\n\"\n end\n blip = post('https://people.i.bolkhuis.nl/persons', data)\n\n # Grab uid\n unless blip == nil\n uid = blip['uid']\n\n # Send payload to operculum\n put(\"https://operculum.i.bolkhuis.nl/person/#{uid}\", {\n nickname: params[8],\n study: params[16],\n alive: params[17].nil?,\n inauguration: params[25],\n resignation_letter: params[26],\n resignation: params[27],\n })\n end\nend", "title": "" }, { "docid": "0088430186f7cc458b6adf297308879a", "score": "0.509831", "text": "def user_walls\n if current_user\n @walls = current_user.walls\n elsif email = params['user_email']\n @walls = User.find_by(email: email).walls\n end\n end", "title": "" }, { "docid": "02da38a1e944ebf43aab8a5871a4e43f", "score": "0.50778794", "text": "def test_should_create_post_via_API_XML\r\n get \"/logout\"\r\n post \"/forum_posts.xml\", :api_key=>'testapikey',\r\n :forum_post => {:title=>'API Test Post',\r\n :body=>'Test Post desc',\r\n :user_id=>1}\r\n assert_response :created\r\n end", "title": "" }, { "docid": "2c5cdd32373dfa3a30be945d11c84363", "score": "0.5073016", "text": "def publishPost(message,options)\n @me.put_wall_post(message,options)\n end", "title": "" }, { "docid": "d9a7b8488292c3a0e09b6a9f44b754aa", "score": "0.5026564", "text": "def create_feed\n\n @service = Service.new(params[:service])\n respond_to do |format|\n if @service.save\n \n Pusher['post'].trigger('thing-create', @service.attributes)\n #@service.update_followers\n\n format.html { }\n format.xml { render :xml => @service }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @service }\n end\n end\n end", "title": "" }, { "docid": "c2572d1126d17a13d9115fbb65b75e94", "score": "0.5022714", "text": "def create_feed\n end", "title": "" }, { "docid": "c2572d1126d17a13d9115fbb65b75e94", "score": "0.5022714", "text": "def create_feed\n end", "title": "" }, { "docid": "c2572d1126d17a13d9115fbb65b75e94", "score": "0.5022714", "text": "def create_feed\n end", "title": "" }, { "docid": "c2572d1126d17a13d9115fbb65b75e94", "score": "0.5022714", "text": "def create_feed\n end", "title": "" }, { "docid": "3a0bc1f2032117d6cc6f061cabc7c9d4", "score": "0.50174433", "text": "def moip_post\n @nasp_rail = NaspRail.new(params[:nasp_rail])\n\n format.html { redirect_to @nasp_rail, :notice => 'Nova entrada criada com sucesso.' }\n format.json { render :json => @nasp_rail, :status => :created, :location => @nasp_rail }\n end", "title": "" }, { "docid": "90a8476267cea2e21f40668e2bf7ba82", "score": "0.5015631", "text": "def create_feed\n @feed = Feed.new(params[:feed])\n\n respond_to do |format|\n if @feed.save\n EntryFeed.create_from_feed(@feed)\n format.html { redirect_to @feed, :notice => 'Feed was successfully created.' }\n format.json { render :json => @feed, :status => :created, :location => @feed }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @feed.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "abb71d1027c06503fa3be058481deadb", "score": "0.49943656", "text": "def post(message)\n OAuth2::AccessToken.new(OAuthClient, token).post('/me/feed', :message => message)\n end", "title": "" }, { "docid": "84c0c364d29a48d615aaa307b1b03822", "score": "0.49921533", "text": "def destroy\n @blank_wall.destroy\n respond_to do |format|\n format.html { redirect_to blank_walls_url, notice: 'Blank wall was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9c6e06befa0102178692c385363fe014", "score": "0.49842972", "text": "def create\n res = self.class.post('/', body: attrs)\n res.created?\n end", "title": "" }, { "docid": "740fa55358c769f41ca77142b124e2a7", "score": "0.49832883", "text": "def create\n @newsfeed = Newsfeed.new(newsfeed_params)\n\n respond_to do |format|\n if @newsfeed.save\n format.html { redirect_to @newsfeed, notice: 'Newsfeed was successfully created.' }\n format.json { render :show, status: :created, location: @newsfeed }\n else\n format.html { render :new }\n format.json { render json: @newsfeed.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b76fe86865153f42de42acb302843104", "score": "0.49756148", "text": "def create_group(nickname, name, type = 'group')\n post(ROOT_URI + '/a/createfeed', 'nickname' => nickname, 'name' => name, 'type' => type).xpath(\"(//a[@class='l_feedinvite'])[1]/@sid\").to_s\n end", "title": "" }, { "docid": "b76fe86865153f42de42acb302843104", "score": "0.49756148", "text": "def create_group(nickname, name, type = 'group')\n post(ROOT_URI + '/a/createfeed', 'nickname' => nickname, 'name' => name, 'type' => type).xpath(\"(//a[@class='l_feedinvite'])[1]/@sid\").to_s\n end", "title": "" }, { "docid": "138f9d489f6bea82875720d398ee327a", "score": "0.49656272", "text": "def show\n require 'net/http'\n require 'net/https'\n require 'uri'\n require 'json'\n\n begin\n group_id = @post.groupId\n parameters = {\"v\" => \"5.95\", \"access_token\" => @post.token}\n\n url = \"https://api.vk.com/method/photos.getWallUploadServer?group_id=\" + group_id.to_s\n serverInfo = make_request(url, parameters)\n\n uri = URI.parse serverInfo[\"upload_url\"]\n connection = Net::HTTP.new uri.host, uri.port\n connection.use_ssl = true\n request = Net::HTTP::Post.new uri\n form_data = [\n ['photo', File.open(@post.image.current_path)]\n ]\n request.set_form form_data, 'multipart/form-data'\n @response = connection.request request\n photoInfo = JSON.parse(@response.body)\n\n url = \"https://api.vk.com/method/photos.saveWallPhoto?group_id=\" + group_id.to_s + \"&server=\" + photoInfo[\"server\"].to_s + \"&photo=\" + photoInfo[\"photo\"].to_s + \"&hash=\" + photoInfo[\"hash\"].to_s\n uploadedPhotoInfo = make_request(url, parameters)\n\n if @post.descriprion != \"\"\n url = \"https://api.vk.com/method/wall.post?owner_id=-\" + group_id.to_s + \"&from_group=1&message=\" + @post.descriprion.to_s + \"&attachments=photo\" + uploadedPhotoInfo[0][\"owner_id\"].to_s + \"_\" + uploadedPhotoInfo[0][\"id\"].to_s\n else\n url = \"https://api.vk.com/method/wall.post?owner_id=-\" + group_id.to_s + \"&from_group=1&attachments=photo\" + uploadedPhotoInfo[0][\"owner_id\"].to_s + \"_\" + uploadedPhotoInfo[0][\"id\"].to_s\n end\n post = make_request(url, parameters)\n\n @info = \"https://vk.com/clash_attack?w=wall-\" + group_id.to_s + \"_\" + post[\"post_id\"].to_s\n rescue Exception => e\n @info = \"We have some errors, sorry!\"\n print e\n end\n\n end", "title": "" }, { "docid": "71d1109ac7d11703d4e13c4b9b2c182a", "score": "0.4960009", "text": "def show\n @wall = Wall.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @wall }\n end\n end", "title": "" }, { "docid": "28e210c56d5958f466f3da12fd5aea3a", "score": "0.49586", "text": "def write!(other_user)\n wallposts.create!(posted_id: other_user.id)\n end", "title": "" }, { "docid": "d5f5b0986027dffa9c711b0ed9d77ee1", "score": "0.49581593", "text": "def new\n @wallpaper = Wallpaper.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @wallpaper }\n end\n end", "title": "" }, { "docid": "3192d91fdc28aa46d69014ff409501f9", "score": "0.49535984", "text": "def post\n doc = Nokogiri::XML(request.body)\n id= (doc/'id').text\n # p = Post.exists?(id) ? Post.find(id) : Post.new\n p= Post.find_or_create_by_intranet_id id\n p.update_attributes :subject => (doc/'subject').text,\n :body => (doc/'body').text, :post_type => (doc/'post-type').text,\n :pic => (doc/'pic') .text, :begin_on=>(doc/'begin-on').text,\n :pic_postimg => (doc/'pic-postimg').text,\n :video => (doc/'video').text, \n :end_on => (doc/'end-on').text, :stick => (doc/'stick').text \n render :text => \"ok\"\n end", "title": "" }, { "docid": "b60fbc9058349631fa48de374c633afe", "score": "0.49488235", "text": "def create\n feed = Feed.new(:user_id => params[:user_id], :name => params[:name])\n if feed.save\n render :json => feed, :status => :created\n else\n render :json => {:ok => false, :message => feed.errors}, :status => :unprocessable_entity\n end\n end", "title": "" }, { "docid": "a6b6f6c4eff52f5bd4df737456d042e3", "score": "0.4947521", "text": "def create\n @pooling = Pooling.new(pooling_params)\n @wallpaper = Wallpaper.find(@pooling.wallpaper_id)\n\n respond_to do |format|\n if @pooling.save\n format.html { redirect_to @wallpaper, notice: 'Pooling was successfully created.' }\n # format.json { render :show, status: :created, location: @pooling }\n else\n format.html { render :new }\n # format.json { render json: @pooling.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "628a147f44e4167c5917d4c9c724367a", "score": "0.49458957", "text": "def create\n @pneighbour = Pneighbour.new(params[:pneighbour])\n\n respond_to do |format|\n if @pneighbour.save\n format.html { redirect_to(@pneighbour, :notice => 'Pneighbour was successfully created.') }\n format.xml { render :xml => @pneighbour, :status => :created, :location => @pneighbour }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @pneighbour.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "03960c43afa6b0ed65b5618aacd2634a", "score": "0.49274355", "text": "def create\n @title = 'Microposts'\n @new_post = current_user.microposts.build(params[:micropost])\n if @new_post.save\n @user = User.find(current_user.id)\n feed = @user.feed\n @microposts = feed.page(params[:current_page]).per(5)\n end\n respond_to do |format|\n format.html { redirect_to '/wall' }\n format.js\n end\n end", "title": "" }, { "docid": "1fe52d67626eecea76879dd2a30c3d37", "score": "0.4921759", "text": "def create\n @neighbourhood = Neighbourhood.new(neighbourhood_params)\n\n respond_to do |format|\n if @neighbourhood.save\n format.html { redirect_to @neighbourhood, notice: 'Neighbourhood was successfully created.' }\n format.json { render :show, status: :created, location: @neighbourhood }\n else\n format.html { render :new }\n format.json { render json: @neighbourhood.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "43341ea41edc9591119a87b64c1cb1f4", "score": "0.49140814", "text": "def create_post\n begin\n #asks the user for the title, body, and whether it should be anonymous\n print \"Title: \"\n title = STDIN.gets.chomp\n print \"Body: \"\n body = STDIN.gets.chomp\n print \"Post as Anonymous? (y/n): \"\n anonymous = STDIN.gets.chomp.upcase == 'Y' ? true : false\n # check user information from login\n\n # Rails will reject this unless you configure the cross_forgery_request check to\n # a null_session in the receiving controller. This is because we are not sending\n # an authenticity token. Rails by default will only send the token with forms /users/new and\n # /users/1/edit and REST clients don't get those.\n # We could perhaps arrange to send this on a previous\n # request but we would then have to have an initial call (a kind of login perhaps).\n # This will automatically send as a multi-part request because we are adding a\n # File object.\n response = RestClient.post \"#{@@DOMAIN}/api/posts.json\",\n\n {\n post: {\n title: title,\n body: body,\n anonymous: anonymous\n },\n }, authorization_hash\n\n if (response.code == 201)\n puts \"Created successfully\"\n end\n puts \"URL for new resource: #{response.headers[:location]}\"\n rescue => e\n puts STDERR, \"Error accessing REST service. Error: #{e}\"\n end\n end", "title": "" }, { "docid": "a88fb8866527aae18cf9d0b9b2d60193", "score": "0.4912894", "text": "def create\n @neighbour = Neighbour.new(neighbour_params)\n\n respond_to do |format|\n if @neighbour.save\n format.html { redirect_to @neighbour, notice: 'Neighbour was successfully created.' }\n format.json { render :show, status: :created, location: @neighbour }\n else\n format.html { render :new }\n format.json { render json: @neighbour.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "419102e0ccb4ce03e94a979193795eca", "score": "0.49087515", "text": "def create\n @wod = Wod.new(wod_params)\n\n if @wod.save\n render json: @wod, status: :created\n else\n render json: @wod.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "0a3a7d143d3d24b9c2d2b544a20373ff", "score": "0.48956043", "text": "def create\n @mwod_post = MwodPost.new(params[:mwod_post])\n\n respond_to do |format|\n if @mwod_post.save\n format.html { redirect_to @mwod_post, notice: 'Mwod post was successfully created.' }\n format.json { render json: @mwod_post, status: :created, location: @mwod_post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @mwod_post.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b0b8260801f62ab8ba3287f1185b03e0", "score": "0.488662", "text": "def create\n doc = Nokogiri::XML(request.body.read)\n cvNode = doc.xpath('elwak/checklisten_vorlage')\n cv = ChecklistenVorlage.new({\n objekt_id: cvNode.xpath('objekt_id').text.to_s, \n bezeichner: cvNode.xpath('bezeichner').text.to_s, \n version: cvNode.xpath('version').text.to_s.to_i, \n inaktiv: cvNode.xpath('inaktiv').text.to_s.to_bool \n })\n cv.save\n\n cvNode.xpath('checklisten_eintrags/checklisten_eintrag').each do |ceNode|\n ce = ChecklistenEintrag.new({\n checklisten_vorlage_id: cv.id,\n bezeichner: ceNode.xpath('bezeichner').text.to_s,\n was: ceNode.xpath('was').text.to_s,\n wann: ceNode.xpath('wann').text.to_s,\n typ: ceNode.xpath('typ').text.to_s.to_i,\n position: ceNode.xpath('position').text.to_s.to_i\n })\n ce.save\n end\n\n respond_to do |format|\n format.xml {render :xml => '<?xml version=\"1.0\" encoding=\"UTF-8\"?><success />'}\n end\n end", "title": "" }, { "docid": "609b02e2d023fb364064d27ec57238f7", "score": "0.48802418", "text": "def update\n @wall_message = WallMessage.find(params[:id])\n\n respond_to do |format|\n if @wall_message.update_attributes(params[:wall_message])\n flash[:notice] = 'WallMessage was successfully updated.'\n format.html { redirect_to(@wall_message) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @wall_message.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "231f094700d39e16bb46edfb34e8e35a", "score": "0.488009", "text": "def create\n @feed = Feed.new(params[:feed])\n\n respond_to do |format|\n if @feed.save\n format.html { redirect_to @feed, notice: 'Feed was successfully created.' }\n format.json { render json: @feed, status: :created, location: @feed }\n else\n format.html { render action: \"new\" }\n format.json { render json: @feed.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "47ab85c860e13a5259885268cd728ae4", "score": "0.48673454", "text": "def create\n @post55 = Post55.new(params[:post55])\n\n respond_to do |format|\n if @post55.save\n format.html { redirect_to(@post55, :notice => 'Post55 was successfully created.') }\n format.xml { render :xml => @post55, :status => :created, :location => @post55 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post55.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6dc7e5f2dcb771c739d506eb4b837a1b", "score": "0.48644337", "text": "def post(body)\n request = Net::HTTP::Post.new(bind_uri)\n request.body = body\n request.content_length = request.body.size\n request[\"Content-Type\"] = \"text/xml; charset=utf-8\"\n\n Jabber.debug(\"Sending POST request - #{body.strip}\")\n\n response = Net::HTTP.new(domain, port).start { |http| http.request(request) }\n\n Jabber.debug(\"Receiving POST response - #{response.code}: #{response.body.inspect}\")\n\n unless response.is_a?(Net::HTTPSuccess)\n raise Net::HTTPBadResponse, \"Net::HTTPSuccess expected, but #{response.class} was received\"\n end\n\n response\n end", "title": "" }, { "docid": "9cf96f38dc025371acec30fef5762fc2", "score": "0.486398", "text": "def create(name=\"Default Name\", age=\"50\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <person>\r\n <name>#{name}</name>\r\n <age>#{age}</age>\r\n </person>\"\r\n \r\n request = Net::HTTP::Post.new(@url)\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n \r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n response.body \r\n end", "title": "" }, { "docid": "0170a6be3063a6e65ec1ee6b4b9a02b3", "score": "0.486331", "text": "def create\n @rss_feed = RssFeed.new(params[:rss_feed])\n\n respond_to do |format|\n if @rss_feed.save\n format.html { redirect_to @rss_feed, notice: 'Rss feed was successfully created.' }\n format.json { render json: @rss_feed, status: :created, location: @rss_feed }\n else\n format.html { render action: \"new\" }\n format.json { render json: @rss_feed.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0170a6be3063a6e65ec1ee6b4b9a02b3", "score": "0.486331", "text": "def create\n @rss_feed = RssFeed.new(params[:rss_feed])\n\n respond_to do |format|\n if @rss_feed.save\n format.html { redirect_to @rss_feed, notice: 'Rss feed was successfully created.' }\n format.json { render json: @rss_feed, status: :created, location: @rss_feed }\n else\n format.html { render action: \"new\" }\n format.json { render json: @rss_feed.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a578ec0dcc0d5a87cf5624fd7a6da8f9", "score": "0.48586917", "text": "def create\n @feed = Feed.new(feed_params)\n\n respond_to do |format|\n if @feed.save\n format.html { redirect_to @feed, notice: 'Feed was successfully created.' }\n format.json { render :show, status: :created, location: @feed }\n else\n format.html { render :new }\n format.json { render json: @feed.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0eb45d766f138339d35c0fa4e7258754", "score": "0.4852779", "text": "def post(message)\n OAuth2::AccessToken.new(OAuthClient, cookies[:facebook_token]).post('/me/feed', :message => message)\n end", "title": "" }, { "docid": "fcb847047a396016ed7f239a68ad82ad", "score": "0.48413128", "text": "def create\n \n #timestamp={{FellAsleepAt}}&total_sleep={{TotalTimeSleptInSeconds}}&deep={{TimeInDeepSleepSeconds}}&light={{TimeInLightSleepSeconds}}&awake={{TimeAwakeSeconds}}\n \n json_hash = Hash.new\n \n description = params[:description]\n \n timestamp = params[:timestamp]\n total_sleep_seconds = params[:total_sleep]\n deep_sleep_seconds = params[:deep]\n light_sleep_seconds = params[:light]\n awake_seconds = params[:awake]\n \n if timestamp.nil? || total_sleep_seconds.nil?\n \n puts 'timestamp is nil or total_sleep_seconds is nil :('\n \n else\n \n total_sleep = total_sleep_seconds / 60.0\n deep = deep_sleep_seconds / 60.0\n light = light_sleep_seconds / 60.0\n awake = awake_seconds / 60.0\n \n post_to_twitter = false\n post_to_facebook = false\n \n # FellAsleepAt is formatted: August 23, 2013 at 11:01PM\n # Convert to Runkeeper's preferred format: Sat, 1 Jan 2011 00:00:00\n timestamp_datetime = DateTime.parse(timestamp)\n formatted_timestamp = timestamp_datetime.strftime(\"%a, %d %b %Y %H:%M:%S\")\n \n json_hash['timestamp'] = formatted_timestamp\n json_hash['total_sleep'] = deep\n json_hash['deep'] = deep\n json_hash['light'] = light\n json_hash['awake'] = awake\n json_hash['post_to_twitter'] = post_to_twitter\n json_hash['post_to_facebook'] = post_to_facebook\n \n url = 'https://api.runkeeper.com/sleep'\n \n uri = URI.parse(url)\n \n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n request = Net::HTTP::Post.new(uri.request_uri)\n request[\"Authorization\"] = \"Bearer \" + RUNKEEPER_ACCESS_TOKEN\n request[\"Content-Type\"] = \"application/vnd.com.runkeeper.NewSleep+json\"\n request.body = json_hash.to_json\n \n response = http.request(request)\n \n puts response.body\n \n end\n \n @sleep = json_hash\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sleep }\n end\n \n end", "title": "" }, { "docid": "5e03561f61f2152d30ae838df735aa10", "score": "0.4840626", "text": "def create\n logger.debug('In the create method afterall')\n logger.debug( friend_params )\n current_user.friendships.create!(:friend_id => params[:friend_id]) \n\n redirect_to friendship_index_path\n end", "title": "" }, { "docid": "a4be037f4b0a51054e438c230d6ea63a", "score": "0.48315555", "text": "def create\n \r\n current_user.readings.create(:listing_id => params[:listing_id])\r\n respond_to do |format|\r\n #need to call create on a listing to increment counter\n format.xml { head :ok }\r\n end\r\n \n end", "title": "" }, { "docid": "e74e108a028f22cf3efbb61467e45abd", "score": "0.48304445", "text": "def create\n @feed = Feed.new(feed_params)\n\n respond_to do |format|\n if @feed.save\n format.html { redirect_to authenticated_root_path, notice: 'Feed was successfully created.' }\n format.json { render :show, status: :created, location: @feed }\n else\n format.html { render :new }\n format.json { render json: @feed.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cb7761b653ad0359f76108090253c99b", "score": "0.4825355", "text": "def create\n params[:posting][:access_manage_mask_flags] ||= []\n @posting = @user.postings.create(params[:posting])\n respond_to do |format|\n if @posting.save\n format.html { redirect_to(user_posting_path(@user,@posting), :notice => 'Posting was successfully created.') }\n format.xml { render :xml => @posting, :status => :created, :location => @posting }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @posting.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7505d35992d1e5ce61f1f5b7b2f0e0ee", "score": "0.48230997", "text": "def create\n @wnews_post = current_user.wnews_posts.build(wnews_post_params)\n\n respond_to do |format|\n if @wnews_post.save\n format.html { redirect_to @wnews_post, notice: 'Wnews post was successfully created.' }\n format.json { render :show, status: :created, location: @wnews_post }\n else\n format.html { render :new }\n format.json { render json: @wnews_post.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "024cf22ccae7e9a1d9927b1d426c3163", "score": "0.48182616", "text": "def create\n\n if WatchedPost.where(user_id: params[:watched_post][:user_id], post_id: params[:watched_post][:post_id]).empty?\n @watched_post = WatchedPost.new(watched_post_params)\n\n respond_to do |format|\n if @watched_post.save\n format.html { redirect_to :back, notice: 'Watched post was successfully created.' }\n format.json { render :show, status: :created, location: @watched_post }\n else\n format.html { render :new }\n format.json { render json: @watched_post.errors, status: :unprocessable_entity }\n end\n end\n else\n redirect_to watched_posts_user_path(current_user)\n end\n\n end", "title": "" }, { "docid": "e1e6257d96f788b1e4bec5a88d360458", "score": "0.48171303", "text": "def posts\n backend.wall_page(self).posts\n end", "title": "" }, { "docid": "31fbba7326b71e5628410f2ab5cd415b", "score": "0.48155844", "text": "def create\n @mensagem = Mensagem.new(params[:mensagem])\n @mensagem.autor = session[:current_user]\n id_to_post = String.new\n \n case @mensagem.recebedor_type\n when \"Turma\"\n aux = Turma.find(@mensagem.recebedor_id)\n id_to_post = aux.group_id\n end\n \n @mensagem.post_id = api_client.put_wall_post(@mensagem.conteudo, {}, id_to_post)['id']\n\n respond_to do |format|\n if @mensagem.save\n #format.html { redirect_to(@mensagem, :notice => 'Mensagem was successfully created.') }\n format.xml { render :xml => @mensagem, :status => :created, :location => @mensagem }\n format.js {}\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @mensagem.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "86b4d050488310e44ceb1f1475a399be", "score": "0.48097974", "text": "def create\n @white_paper = WhitePaper.new(params[:white_paper])\n\n respond_to do |format|\n if @white_paper.save\n format.html { redirect_to @white_paper, notice: 'White paper was successfully created.' }\n format.json { render json: @white_paper, status: :created, location: @white_paper }\n else\n format.html { render action: \"new\" }\n format.json { render json: @white_paper.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
4375b61cfebe471a3dce07ac151ddd7d
Depending on the type of the argument, either adds a number to each coordinate or adds two points.
[ { "docid": "78456e4b3a0683c42741397fe38123fa", "score": "0.6375268", "text": "def +(other)\n case other\n when Point\n Point.new(x + other.x, y + other.y)\n when Numeric\n Point.new(x + other, y + other)\n when Array\n self + Geom2D::Point(other)\n else\n raise ArgumentError, \"Invalid argument class, must be Numeric or Point\"\n end\n end", "title": "" } ]
[ { "docid": "ff1bf1853e0cbc9d5468d37943ce1700", "score": "0.6679734", "text": "def add!(x=0,y=0,z=0)\n if x.kind_of? Numeric\n set(@x+x, @y+y, @z+z)\n elsif x.point3_like?\n add! x.x, x.y, x.z\n else\n raise_no_conversion x\n end\n end", "title": "" }, { "docid": "d2c791d0993fcdad9b520860e1461eec", "score": "0.65625584", "text": "def addPoints(points) \n\t\t@points += points\n\tend", "title": "" }, { "docid": "8a0239dc7bec4021c0db193580b238b6", "score": "0.6512032", "text": "def add!(point)\r\n @x += point.x\r\n @y += point.y\r\n end", "title": "" }, { "docid": "22ddaa469d95d7e08868cc2172c91988", "score": "0.6481074", "text": "def coordinate_format=(*args)\n\t self.integer_places, self.decimal_places = args.flatten.map {|a| a.to_i }\n\t @total_places = self.decimal_places + self.integer_places\n\tend", "title": "" }, { "docid": "2c1dbe9d53b10c32483991963df7842c", "score": "0.6472434", "text": "def soma_numeros (x, y)\r\n x + y\r\nend", "title": "" }, { "docid": "4062f1d71cee4d2e5cbab03b2f30a13d", "score": "0.63033885", "text": "def add_points *args\n last = self.points.length\n args.each do |arg|\n case arg\n when Point then\n self.points << arg\n when TrackSegment then\n self.points += arg.points\n when Array then\n arg.each { |a| add_points a }\n else\n raise Ubiquity::Error::BadArgument, \"args should be a list of Points, TrackSegments or Arrays of any of them\"\n end\n end\n clean_memoized # ensures future recalculations\n self\n rescue\n self.points.slice!(last..-1) # in case of error eliminates added elements if any\n nil\n end", "title": "" }, { "docid": "3d0e3ddbe2fd7ac3673a3218a7586e38", "score": "0.62721485", "text": "def add_2(x, y)\nend", "title": "" }, { "docid": "92f2f09c00d8909dbfdbed484da1bb97", "score": "0.626478", "text": "def <<(*things)\n if things.size == 1\n thing = things.first\n if thing.is_a?(Point)\n @points << thing\n elsif thing.is_a?(Line)\n @points << thing.p1\n @points << thing.p2\n elsif thing.is_a?(Array)\n if thing.size == 2 && thing.all? { |e| e.numeric? }\n @points << Point.new(thing)\n else\n thing.each { |e| self << e }\n end\n else\n raise 'arguments must be Points or Lines'\n end\n else\n self << things\n end\n end", "title": "" }, { "docid": "acbf9ff67e2f61382b2c614a42f33707", "score": "0.62214124", "text": "def add_positions(pos1, pos2)\r\n\t[pos1[0] + pos2[0], pos1[1] + pos2[1]]\r\nend", "title": "" }, { "docid": "a0b2c91664d704935fe6660617b45f16", "score": "0.6214257", "text": "def add_number (x, y)\n x + y\nend", "title": "" }, { "docid": "f9385a7692882a4f2e0b09717b7dc494", "score": "0.6129961", "text": "def _add( *nums ) self.class.add( *nums ); end", "title": "" }, { "docid": "eb2fcc340ff6378a6fed56d41cd78bf0", "score": "0.6128", "text": "def +(*vector_or_number)\n v = Vector2d::new(vector_or_number)\n Vector2d.new(@x+v.x, @y+v.y)\n end", "title": "" }, { "docid": "632ac51ac7bd5f3fd82337d5ca728391", "score": "0.61095196", "text": "def sum_ints(x,y)\n\tx + y\nend", "title": "" }, { "docid": "628909ef2414a140b4b1a01e112effdb", "score": "0.6036695", "text": "def + (point)\n self.class.new(x + point.x, y + point.y)\n end", "title": "" }, { "docid": "14d92ed4131da8eb91e383c7267688fd", "score": "0.60236233", "text": "def add_positions(pos1, pos2)\n\t[pos1[0] + pos2[0], pos1[1] + pos2[1]]\nend", "title": "" }, { "docid": "d0ab1366b865e3dcd49649003f6d26e1", "score": "0.6016458", "text": "def *(other)\n case other\n when Point\n x * other.x + y * other.y\n when Numeric\n Point.new(x * other, y * other)\n when Array\n self * Geom2D::Point(other)\n else\n raise ArgumentError, \"Invalid argument class, must be Numeric or Point\"\n end\n end", "title": "" }, { "docid": "9b112ebabcc01a7d193c2109cbd31c6c", "score": "0.5984468", "text": "def preprocessing_args(args)\n args.map do |v|\n if v.is_a?(Array) && v.length == 2\n Point.new(*v)\n elsif v.is_a?(Point)\n v\n else\n raise TypeError, \"Arguments should be arrays with coordinates or Points.\"\n end\n end\n end", "title": "" }, { "docid": "9b112ebabcc01a7d193c2109cbd31c6c", "score": "0.5984468", "text": "def preprocessing_args(args)\n args.map do |v|\n if v.is_a?(Array) && v.length == 2\n Point.new(*v)\n elsif v.is_a?(Point)\n v\n else\n raise TypeError, \"Arguments should be arrays with coordinates or Points.\"\n end\n end\n end", "title": "" }, { "docid": "1ec9aaa23eff881cd6a366c64dbc350e", "score": "0.59682816", "text": "def add_to_point! point\n vectors.each do |v|\n point.add! v\n end\n point\n end", "title": "" }, { "docid": "5c6ca280f193dfa2d0721a655951e561", "score": "0.5945025", "text": "def add_to_point point\n add_to_point! point.dup\n end", "title": "" }, { "docid": "cc23e279a7ed10be1340fda212480756", "score": "0.5930959", "text": "def add_point\n end", "title": "" }, { "docid": "250f1d6db9cc3fe6f32a688930b4dec0", "score": "0.5921496", "text": "def + ( *vector_or_number ); v = Vector2d::new( vector_or_number ); Vector2d.new( @x + v.x, @y + v.y ); end", "title": "" }, { "docid": "5fb7d4889e3e1c4cc618def237ad1b1f", "score": "0.59061617", "text": "def add point\n self.x += point.x\n self.y += point.y\n self\n end", "title": "" }, { "docid": "317ac2a4e69c2c01cebc3e0e56e0860b", "score": "0.58457994", "text": "def add!(p)\n@x += p.x\n@y += p.y\nself\nend", "title": "" }, { "docid": "4a99dc0b22cd3ea44d584a47d32251d0", "score": "0.58454585", "text": "def add_vertex coords\n vertices << coords.map(&:to_f)\n end", "title": "" }, { "docid": "741e142c06d2ab4f676fea431c3775fd", "score": "0.58452016", "text": "def add_2(x, y)\n x + y\n end", "title": "" }, { "docid": "5db19c5b5dcb5bfc5a592b953efc34a7", "score": "0.58128875", "text": "def +(*values); end", "title": "" }, { "docid": "0e121f1b5adbc16dac64984e5f11aca9", "score": "0.5809405", "text": "def add_line(point1, point2)\n end", "title": "" }, { "docid": "97fe61f8c40fca83f4c68af9ee18cbd2", "score": "0.577252", "text": "def add(coordinate)\n new_x = @x + coordinate.x\n new_y = @y + coordinate.y\n new_coordinate = Coordinate.new(new_x,new_y)\n end", "title": "" }, { "docid": "4a7e54de19b5c1f7e556bc0c8effbea6", "score": "0.5768909", "text": "def add(y)\n @x + y\n end", "title": "" }, { "docid": "7fb14c283228392806c53fa3c3d6ec7b", "score": "0.57572097", "text": "def add(p0) end", "title": "" }, { "docid": "165463ce8a759879fa9191b7bc6974ef", "score": "0.5747295", "text": "def +(y)\n @x + y\n end", "title": "" }, { "docid": "8e2383942711ca2c2c8d5550156e8c33", "score": "0.57472795", "text": "def plus(x, y)\n\nend", "title": "" }, { "docid": "58aee27f5d86ad2a85bd1016f3fbfe09", "score": "0.5732002", "text": "def point(x,y)\n [x,y]\nend", "title": "" }, { "docid": "ad1bfd4454e7b7355feb4d47f98bd1e1", "score": "0.5714389", "text": "def +(point)\n\t\t\t\tx = nil\n\t\t\t\ty = nil\n\t\t\t\t\n\t\t\t\tif [email protected]? || !point.x.nil?\n\t\t\t\t\tx = @x.to_i + point.x.to_i\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tif [email protected]? || !point.y.nil?\n\t\t\t\t\ty = @y.to_i + point.y.to_i\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tself.class.new(x, y)\n\t\t\tend", "title": "" }, { "docid": "c1a40b34fc6a5e70412045f9f743abcc", "score": "0.5683996", "text": "def add(*nums) \r\n p @result.class\r\n for num in nums\r\n if num.class == Array\r\n #loop through the array and sum the elements\r\n for x in num\r\n @result += x.to_f\r\n end\r\n else\r\n @result += num.to_f# @result = @result + num\r\n end\r\n end\r\n self\r\n end", "title": "" }, { "docid": "a7866f0c7ff588504998089840cc0394", "score": "0.567179", "text": "def Point2dAdd(arg0, arg1)\n ret = _invoke(1610743816, [arg0, arg1], [VT_BYREF | VT_DISPATCH, VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end", "title": "" }, { "docid": "da5b4630224b7d42b1c87a41a3c3a9ce", "score": "0.56627303", "text": "def add(v)\n @x += v.x\n @y += v.y\n self\n end", "title": "" }, { "docid": "b63f2c878a129191ccf1fe0a5dce2801", "score": "0.56612605", "text": "def add(first_num, second_num)\n first_num.to_f + second_num.to_f\nend", "title": "" }, { "docid": "bfb4c8c31817f6ddc5f1985cd8541bf2", "score": "0.56525534", "text": "def coord(a, b)\n final_array = []\n first_array = (1..a).to_a\n second_array = (1..b).to_a\n first_array.each do |first_num|\n second_array.each do |second_num|\n coordinates = \"(#{first_num}, #{second_num})\"\n final_array.push(coordinates)\n end\n end\n final_array \nend", "title": "" }, { "docid": "4c23ea3d5fb755dcc2f3c06e80a5066c", "score": "0.56412417", "text": "def +(other)\n raise TypeError, \"Addition between Point and #{ other.class } is not defined\" unless other.is_a?(Point)\n Point.new(self.x + other.x, self.y + other.y)\n end", "title": "" }, { "docid": "87bb4dc212841e08da23c1024ab3f502", "score": "0.562687", "text": "def sum(x,y)\r\n\t x + y\r\n\tend", "title": "" }, { "docid": "1084f9c1f8fcf6d578739f20089095da", "score": "0.56117606", "text": "def add_two(number)\n\tunless number.respond_to? :+\n\t\traise ArgumentError, \"Invalid argument\"\n\tend\n\tnumber + 2\nend", "title": "" }, { "docid": "d17e643c6e6c208d5223b1193d95171e", "score": "0.5602956", "text": "def two1 a; a[0] + a[1] end", "title": "" }, { "docid": "9623555e680275ee7cddf21ad2ebc325", "score": "0.560268", "text": "def + point\n\t\tPoint.new(@x+point.x, @y+point.y)\n\tend", "title": "" }, { "docid": "63fd0c05c6370a52d0020bf5f648d9bd", "score": "0.55845", "text": "def add_multiple_points(player)\n end", "title": "" }, { "docid": "03153dba0bb24e62cdd6d576373a7f36", "score": "0.55818766", "text": "def add_points(points)\n @correct_answers += 1\n @points += points\n end", "title": "" }, { "docid": "9f9b3f15992334684f0b01cad43743b5", "score": "0.55799556", "text": "def sum(x, y)\n\nend", "title": "" }, { "docid": "1b94a541d0da4a985d4cba4a7c316f99", "score": "0.5576939", "text": "def add_two(number)\n if number.respond_to? :+\n if number.respond_to? :push\n if number.respond_to? (:to_str)\n number.push 2\n else\n number + 2\n end\n end\n end\nend", "title": "" }, { "docid": "0849ac9aeee14375fd893703ac59099f", "score": "0.5574048", "text": "def add(*); end", "title": "" }, { "docid": "695ea1fec838d4a80fb4c5683fe35580", "score": "0.55710536", "text": "def +(x); end", "title": "" }, { "docid": "1d478c80d25dd84052bbea425b288299", "score": "0.5568985", "text": "def add(x,y)\r\n x + y \r\nend", "title": "" }, { "docid": "d54fc1a0f8c086ad86f0ab0d387f2f82", "score": "0.5548424", "text": "def add_two(number)\n\tunless number.respond_to? :+\n\t\traise ArgumentError, \"invalid argument\"\n\tend\n\tnumber + 2\nend", "title": "" }, { "docid": "6263b067abf75630acbd7575b6fe63c8", "score": "0.55399376", "text": "def addPoint( x, y) \n point = PVector.new(x, y)\n @points.push(point)\n end", "title": "" }, { "docid": "cb03ab74a786874f8ec88335edddc39f", "score": "0.55397093", "text": "def add ( num_1, num_2)\n num_1.to_i + num_2.to_i\nend", "title": "" }, { "docid": "3ff2f00ec67bf0feeec4247fbedff3c7", "score": "0.5537999", "text": "def +(other_point)\n Point.new(self.x + other_point.x, self.y + other_point.y)\n end", "title": "" }, { "docid": "f9b0811596f276e92742dc46c583774f", "score": "0.55249846", "text": "def adds(other, scale)\n self[0] += other[0]*scale; self[1] += other[1]*scale\n self[2] += other[2]*scale\n end", "title": "" }, { "docid": "b6fb06df817db568568897bd207e7499", "score": "0.5514018", "text": "def addPoints coordinates\n coordinates.split(',').each_with_index do |coordinate, index|\n border_points.build(:latitude => coordinate[0..coordinate.index(' ')-1], :longitude => coordinate[coordinate.index(' ')+1 .. coordinate.length-1], :local_index => index)\n end\n end", "title": "" }, { "docid": "407de925b2e37b17deb775155d934d23", "score": "0.55119365", "text": "def sum_numbers(x, y, z)\n\tx + y + z\nend", "title": "" }, { "docid": "91e9b70a86c4dfa5df5467e7c6ad89cb", "score": "0.5492718", "text": "def add_two_numbers (x,y)\n puts x + y\nend", "title": "" }, { "docid": "c407e495ed71113e912f7779ea7358cc", "score": "0.5492487", "text": "def add_two_numbers( x, y )\n puts x + y\nend", "title": "" }, { "docid": "83bd98aa685d9587c30347f0b5f032cb", "score": "0.54874635", "text": "def + (point)\n return Point2D.new(@x + point.x, @y + point.y)\n end", "title": "" }, { "docid": "9f968c444a2b9a306e784d6b696afcc5", "score": "0.5484453", "text": "def +(other)\n Point2D.new(@x + other.x, @y + other.y)\n end", "title": "" }, { "docid": "e9852902ae92808f05efa5cb1aaa42d2", "score": "0.547501", "text": "def point\n x = []\n y = []\n case geometry.type\n when 'MultiPolygon'\n coordinates.each { |list| append_list list, x, y }\n when 'LineString'\n append coordinates, x, y\n when 'Point'\n x << coordinates.first\n y << coordinates.last\n else\n append_list coordinates, x, y\n end\n lon = x.reduce(&:+) / x.size\n lat = y.reduce(&:+) / y.size\n [lon.round(7), lat.round(7)]\n end", "title": "" }, { "docid": "be5c58c4bfdacc56c1eff90fe131df2a", "score": "0.5473026", "text": "def map(items)\n self.push(:points => { :point => items})\n end", "title": "" }, { "docid": "b10e5f9a0214e7af74d38d9c1b895441", "score": "0.54669106", "text": "def add(x,y)\n x + y\nend", "title": "" }, { "docid": "cc863343202ff2fe5b1fca5043dc0304", "score": "0.5465924", "text": "def +(p)\n Pair.new(@x + p.x, @y + p.y)\n end", "title": "" }, { "docid": "10b5cf7948623bcc0d3519cbaba519db", "score": "0.5461094", "text": "def add_two_numbers(x,y)\n puts x + y\nend", "title": "" }, { "docid": "84be40ea3b2e03127debfbc4c43aa0c2", "score": "0.54524046", "text": "def add(x, y)\n x + y\nend", "title": "" }, { "docid": "b71991adbe934d14814e0babd5961291", "score": "0.5444375", "text": "def add(x,y)\n\tx+y\nend", "title": "" }, { "docid": "d312e603aebc1fefa8f6de1ec2ca56ca", "score": "0.5440754", "text": "def plus(number, other)\n\tnumber + other\nend", "title": "" }, { "docid": "0b58b687dcae84406bd81f7015457c43", "score": "0.54384065", "text": "def vetted_add(pair)\n\t\t\ta = to_ary\n\t\t\tself.class.make(a[0] + (pair[0] || 0), a[1] + (pair[1] || 0))\n\t\tend", "title": "" }, { "docid": "4f97cf7a416e280bb1532ce850c1f04c", "score": "0.54329693", "text": "def accumulate_points(points)\n points.map{|point| point.value}.reduce(0, :+)\n end", "title": "" }, { "docid": "5f2538a6ee07f1db88c3c2adaef6f03f", "score": "0.5429345", "text": "def +(other)\n self.class.new(self.x + other.x, self.y + other.y, self.z.to_i + other.z.to_i)\n end", "title": "" }, { "docid": "08906a3a35ff727a18c1a48095d77f05", "score": "0.5425912", "text": "def add_nums(num_1,num_2)\n\treturn num_1.to_i + num_2.to_i\nend", "title": "" }, { "docid": "8de88d7cc796be38ce8a249aacf509dd", "score": "0.54233384", "text": "def add_ins(obj)\n self.first.value = self.first.value + obj.first.value\n obj.type = 'int'\n self.type = 'int'\n end", "title": "" }, { "docid": "5fe5dee8699af18c6481b893572233fe", "score": "0.5423147", "text": "def add\n\t number_1 + number_2\n end", "title": "" }, { "docid": "d1d432d4a5f0596602ebf7b0462a26ab", "score": "0.54214644", "text": "def addittion(x, y)\n return (x + y)\nend", "title": "" }, { "docid": "21e98bde09f3e79bda5880a1be2568c6", "score": "0.54201174", "text": "def add(num_1, num_2)\n\tnum_1.to_i + num_2.to_i\n#add(2, 4)\nend", "title": "" }, { "docid": "f82e20bf1ee6c3dcdf1d03bfe62db4c2", "score": "0.5415852", "text": "def add (num_one, num_two)\n num_one + num_two\nend", "title": "" }, { "docid": "e6f9bed91e49e66946492f375a788529", "score": "0.54114735", "text": "def add(*num) #accumulates variable amount of arguments and inserts them into the function as a list\n\n\tsum = 0\n\tnum.each do |num| #sum started with zero and the acutal sum increases as each argument is added\n\t\t\t\t\t\t#I changed all in example to \"num\" - Need to see if that is correct\n\t\tsum += num #adds each variable to the sum\n\n\tend\n\n\treturn sum\nend", "title": "" }, { "docid": "f6730d6fbf7986f1ecdc888c9eb7552e", "score": "0.5398008", "text": "def setcoord(type, value)\n @point_xy[type.to_sym] = value if ('x'..'y').cover?(type.to_s.downcase)\n chxyattr\n end", "title": "" }, { "docid": "21b8bbd42cc5c9b7c096f0d125d589e6", "score": "0.53960425", "text": "def g(x,y) x + y end", "title": "" }, { "docid": "17e91f362ef3b8e10dcc2299079355fe", "score": "0.53946185", "text": "def add(val1, val2) val1 + val2 end", "title": "" }, { "docid": "d44cf2ef247454351fa4984187088be8", "score": "0.5394136", "text": "def add_cpoint(point)\n end", "title": "" }, { "docid": "99964557322deb2c2d768ca2484756ae", "score": "0.5385424", "text": "def add(num1, num2)\n num1.to_f + num2.to_f;\nend", "title": "" }, { "docid": "accfd5f3e66a922898abfe21c0e9011b", "score": "0.53798234", "text": "def +(p0) end", "title": "" }, { "docid": "accfd5f3e66a922898abfe21c0e9011b", "score": "0.53798234", "text": "def +(p0) end", "title": "" }, { "docid": "accfd5f3e66a922898abfe21c0e9011b", "score": "0.53798234", "text": "def +(p0) end", "title": "" }, { "docid": "accfd5f3e66a922898abfe21c0e9011b", "score": "0.53798234", "text": "def +(p0) end", "title": "" }, { "docid": "28ae08f4259b2ca1070fb5628cf86799", "score": "0.53790754", "text": "def plus(x,y)\n if x.class == Fixnum && y.class == Fixnum then\n B.new\n elsif x.class == Float && y.class == Float then\n x + y\n else\n fail \"nope\"\n end\n end", "title": "" }, { "docid": "153b8b56a8972f6de6559fff4d64a3ac", "score": "0.5377196", "text": "def add_nums(num_1, num_2)\n return num_1.to_i + num_2.to_i\nend", "title": "" }, { "docid": "153b8b56a8972f6de6559fff4d64a3ac", "score": "0.5377196", "text": "def add_nums(num_1, num_2)\n return num_1.to_i + num_2.to_i\nend", "title": "" }, { "docid": "2bdc17d81dc88ad6456cd1f2a6456386", "score": "0.5375696", "text": "def call(x, y)\n @position_x += x\n @position_y += y\n end", "title": "" }, { "docid": "174328735dd9dec20df7ef3fc860f2e2", "score": "0.53630257", "text": "def add(num_1, num_2)\n\tnum_1.to_i + num_2.to_i\n# add(10, 5)\nend", "title": "" }, { "docid": "8bfe642d7feead330ffd0ea7d991a852", "score": "0.5359062", "text": "def add(point)\r\n new_point = Marshal.load(Marshal.dump(self))\r\n new_point.x = @x + point.x\r\n new_point.y = @y + point.y\r\n return new_point\r\n end", "title": "" }, { "docid": "5bead4edfc2b3621d954cdccb76e12ff", "score": "0.53467226", "text": "def *(scalar)\n raise TypeError, \"Multiplication between Point and #{ scalar.class } is not defined\" unless scalar.is_a?(Numeric)\n Point.new(x * scalar, y * scalar)\n end", "title": "" }, { "docid": "f12b7686467e90fb3e3067a0e0eaa4fc", "score": "0.53419113", "text": "def add(*params)\n params.inject(0) do |sum, num|\n sum + num if num.is_a?(Integer)\n end\nend", "title": "" }, { "docid": "5a48b33bf34a81d3bf1bf5cfce6a9445", "score": "0.53284156", "text": "def draw_line(start, endpoint)\n start = start.to_coords if start.respond_to?(:to_coords)\n start = start.to_ary # ... end\nend", "title": "" }, { "docid": "4ce90e4fd4dd8fdc0ea413ad0f726208", "score": "0.5326788", "text": "def <<(n)\n @input.push n.to_f\n end", "title": "" } ]
fa8c6fba39632200bd78d22b728f2f9b
move_left mode flag for overriding check turning flag Moves. (pixel movement)
[ { "docid": "14f25586d81ac180559e62a86be65b57", "score": "0.8129233", "text": "def move_left(mode = true, check = false)\n # get pixel movement rate\n pix = BlizzABS.pixel\n # which type of moving\n case mode\n # override and set moving route\n when 0 then rand(pix*2).times{@force_move.push(4)}\n # move\n when 11 then super((!check))\n # re-routing the method\n else\n # set moving route\n pix.times{@force_move.push(4)}\n # set turning flag\n @turn_flag = mode\n end\n end", "title": "" } ]
[ { "docid": "ee46b9b78061152634b4e5a4559e3eb5", "score": "0.8002536", "text": "def move_left(mode = true, check = true)\n mode == 0 ? move_generic(mode, check, 4) : super(check)\n end", "title": "" }, { "docid": "e13408ace104a0c0bb47e22378acd36c", "score": "0.765907", "text": "def move_left(turn_enabled = true)\n # turn if turn enabled\n turn_left if turn_enabled\n # if passable (if pixel movement is on, allow corner skip)\n if passable?(@x, @y, 4)\n # set new coordinates\n @x -= 1\n # increase steps\n increase_steps\n # moved\n return true\n end\n # check touched events\n check_event_trigger_touch(@x-1, @y)\n # not moved\n return false\n end", "title": "" }, { "docid": "e13408ace104a0c0bb47e22378acd36c", "score": "0.765907", "text": "def move_left(turn_enabled = true)\n # turn if turn enabled\n turn_left if turn_enabled\n # if passable (if pixel movement is on, allow corner skip)\n if passable?(@x, @y, 4)\n # set new coordinates\n @x -= 1\n # increase steps\n increase_steps\n # moved\n return true\n end\n # check touched events\n check_event_trigger_touch(@x-1, @y)\n # not moved\n return false\n end", "title": "" }, { "docid": "cce73d00d2d5478487bae1558da29c5b", "score": "0.7650194", "text": "def turn_left\n @turns_since_last_move = @turns_since_last_move + 1\n @direction = case @direction\n when UP\n LEFT\n when RIGHT\n UP\n when DOWN\n RIGHT\n when LEFT\n DOWN\n end\n end", "title": "" }, { "docid": "2a4f4200066b879c43afb2f5092ba636", "score": "0.7628814", "text": "def turn_left\n unless @direction_fix\n @direction = 4\n @stop_count = 0\n end\n end", "title": "" }, { "docid": "172d85079ea343faf41cffe81a2a23fa", "score": "0.7609612", "text": "def move_left(turn_enabled = true)\n # Face left\n turn_left if turn_enabled\n # When possible to pass\n if passable?(@x, @y, Input::LEFT)\n # Face left\n turn_left\n # Update coordinates\n @x -= 1\n end\n end", "title": "" }, { "docid": "2f752c6c0d727661ae081989b667a95b", "score": "0.75924087", "text": "def move_lower_left(mode = 0)\n # get pixel movement rate\n pix = BlizzABS.pixel\n # which type of moving\n case mode\n # override and set moving route\n when 0 then rand(pix*2).times{@force_move.push(1)}\n # move\n when 11 then super()\n end\n end", "title": "" }, { "docid": "2f752c6c0d727661ae081989b667a95b", "score": "0.75924087", "text": "def move_lower_left(mode = 0)\n # get pixel movement rate\n pix = BlizzABS.pixel\n # which type of moving\n case mode\n # override and set moving route\n when 0 then rand(pix*2).times{@force_move.push(1)}\n # move\n when 11 then super()\n end\n end", "title": "" }, { "docid": "66bdbef07b3ebf0882d175b125e3771e", "score": "0.75914735", "text": "def move_lower_left\n # if not direction fixed\n unless @direction_fix\n # set direction\n @direction = (@direction == 6 ? 4 : @direction == 8 ? 2 : @direction)\n end\n # if passable (if pixel movement is on, allow corner skip)\n if BlizzABS.pixel > 1 &&\n (passable?(@x, @y, 2) && passable?(@x, @y + 1, 4) ||\n passable?(@x, @y, 4) && passable?(@x - 1, @y, 2)) ||\n passable?(@x, @y, 2) && passable?(@x, @y + 1, 4) &&\n passable?(@x, @y, 4) && passable?(@x - 1, @y, 2)\n # set new coordinates\n @x -= 1\n @y += 1\n # increase steps\n increase_steps\n # moved\n return true\n end\n # check touched events\n check_event_trigger_touch(@x-1, @y+1)\n # not moved\n return false\n end", "title": "" }, { "docid": "66bdbef07b3ebf0882d175b125e3771e", "score": "0.75914735", "text": "def move_lower_left\n # if not direction fixed\n unless @direction_fix\n # set direction\n @direction = (@direction == 6 ? 4 : @direction == 8 ? 2 : @direction)\n end\n # if passable (if pixel movement is on, allow corner skip)\n if BlizzABS.pixel > 1 &&\n (passable?(@x, @y, 2) && passable?(@x, @y + 1, 4) ||\n passable?(@x, @y, 4) && passable?(@x - 1, @y, 2)) ||\n passable?(@x, @y, 2) && passable?(@x, @y + 1, 4) &&\n passable?(@x, @y, 4) && passable?(@x - 1, @y, 2)\n # set new coordinates\n @x -= 1\n @y += 1\n # increase steps\n increase_steps\n # moved\n return true\n end\n # check touched events\n check_event_trigger_touch(@x-1, @y+1)\n # not moved\n return false\n end", "title": "" }, { "docid": "18a01caadb01a6511aefe5bb54d300b0", "score": "0.7508163", "text": "def turn_left\n @current_direction = @current_direction ==1 ? 4 : @current_direction - 1\n end", "title": "" }, { "docid": "101535816723ca9a5905ac38d8894723", "score": "0.75052845", "text": "def move_left(turn_enabled = true)\n # turn if turn enabled\n turn_left if turn_enabled\n # move into direction\n return move_direction(4)\n end", "title": "" }, { "docid": "99d1724724c5fee410efbbe50facf3b4", "score": "0.7431066", "text": "def turn_left\n sprite.turn_left\n @dir = :left\n end", "title": "" }, { "docid": "ded4d382eec89a46b850bdbf987c5f82", "score": "0.74266607", "text": "def move_left_jf\n@moving=true\n@direction=:left\n@x += -1\nend", "title": "" }, { "docid": "c60113e6a19517b482011eccb9dfb7d7", "score": "0.736754", "text": "def turn_left\n self.direction = change_direction(:left)\n end", "title": "" }, { "docid": "6a87510b8fb14e9a9ba7bff16794a5ab", "score": "0.73177654", "text": "def move_left(turn_enabled = true)\n # Turn left\n if turn_enabled\n turn_left\n end\n # If passable\n if passable?(@x, @y, 4)\n # Turn left\n turn_left\n # Update coordinates\n @x -= 1\n # Increase steps\n increase_steps\n # If impassable\n else\n # Determine if touch event is triggered\n check_event_trigger_touch(@x-1, @y)\n end\n end", "title": "" }, { "docid": "6a87510b8fb14e9a9ba7bff16794a5ab", "score": "0.73177654", "text": "def move_left(turn_enabled = true)\n # Turn left\n if turn_enabled\n turn_left\n end\n # If passable\n if passable?(@x, @y, 4)\n # Turn left\n turn_left\n # Update coordinates\n @x -= 1\n # Increase steps\n increase_steps\n # If impassable\n else\n # Determine if touch event is triggered\n check_event_trigger_touch(@x-1, @y)\n end\n end", "title": "" }, { "docid": "6a87510b8fb14e9a9ba7bff16794a5ab", "score": "0.73177654", "text": "def move_left(turn_enabled = true)\n # Turn left\n if turn_enabled\n turn_left\n end\n # If passable\n if passable?(@x, @y, 4)\n # Turn left\n turn_left\n # Update coordinates\n @x -= 1\n # Increase steps\n increase_steps\n # If impassable\n else\n # Determine if touch event is triggered\n check_event_trigger_touch(@x-1, @y)\n end\n end", "title": "" }, { "docid": "17165449b0379f4fb90e26f21c48656a", "score": "0.72930706", "text": "def move_lower_left(mode = 0)\n mode == 0 ? move_generic(mode, true, 1) : super()\n end", "title": "" }, { "docid": "5c258a644e731fa8d7a4e1846928a4fe", "score": "0.7290722", "text": "def move_left(turn_ok = true)\n if passable?(@x-1, @y) # Passable\n turn_left\n @x = $game_map.round_x(@x-1)\n @real_x = (@x+1)*256\n increase_steps\n @move_failed = false\n else # Impassable\n turn_left if turn_ok\n check_event_trigger_touch(@x-1, @y) # Touch event is triggered?\n @move_failed = true\n end\n end", "title": "" }, { "docid": "73a7be8d4d9ddb10680dc97ae0ac982d", "score": "0.7284546", "text": "def move_left(turn_enabled = true)\r\n # Turn left\r\n if turn_enabled\r\n turn_left\r\n end\r\n # If passable\r\n if passable?(@x, @y, 4)\r\n # Turn left\r\n turn_left\r\n # Update coordinates\r\n @x -= 1\r\n # Increase steps\r\n increase_steps\r\n # If impassable\r\n else\r\n # Determine if touch event is triggered\r\n check_event_trigger_touch(@x-1, @y)\r\n end\r\n end", "title": "" }, { "docid": "2cea956db05bad8a2c72c1396d713300", "score": "0.72775215", "text": "def left\n if @direction != @dir_east then\n \t\t @direction = @dir_west\n \t end\n end", "title": "" }, { "docid": "4bdba8bebdc36840a090781fff720642", "score": "0.7257148", "text": "def move_left\n if x > battlefield_width - 1500\n accelerate(-1)\n else\n @at_left = true\n @at_right = false\n end\n end", "title": "" }, { "docid": "5749ba1f9c1357dc7174a508d74c86c6", "score": "0.7254465", "text": "def turn_left\n @facing = direction_after_turn(:left)\n end", "title": "" }, { "docid": "0bf70fb62eefe6d309beab27e5e9607d", "score": "0.7253486", "text": "def turn_left\n\t\tif @direction == \"N\"\n\t\t\t@direction = \"W\"\n\t\telsif @direction == \"E\"\n\t\t\t@direction = \"N\"\n\t\telsif @direction == \"S\"\n\t\t\t@direction = \"E\"\n\t\telsif @direction == \"W\"\n\t\t\t@direction = \"S\"\n\t\tend\t\n\tend", "title": "" }, { "docid": "632a6326e03fba93dd9fbf55905c8314", "score": "0.723444", "text": "def turn_left\n\t\tcase @direction\n\t\t\twhen \"N\" then @direction = \"W\"\n\t\t\twhen \"E\" then @direction = \"N\"\n\t\t\twhen \"S\" then @direction = \"E\"\n\t\t\twhen \"W\" then @direction = \"S\"\n\t\t\t\t#else \"enter l or r\"\n\t\tend #### End of turn left method\n\tend", "title": "" }, { "docid": "ab6fd15fdb4723585183a37d842a4125", "score": "0.7211536", "text": "def left\n return unless moving?\n @direction = DIRECTIONS[DIRECTIONS.index(direction)-1]\n move\n end", "title": "" }, { "docid": "35aa34c69498b4a048a86083dd4b7525", "score": "0.7190667", "text": "def move_lower_left\n @direction = @direction == 6 ? 4 : (@direction == 8 ? 2 : @direction)\n if (passable?(@x, @y, 2) && passable?(@x, @y + 1, 4)) ||\n (passable?(@x, @y, 4) && passable?(@x - 1, @y, 2)) # 8 a la place de 2 sur les deux lignes\n @x -= 1\n @y += 1\n movement_process_end\n end\n end", "title": "" }, { "docid": "91713ca2075094c9cd3acf2e0fe95173", "score": "0.7175292", "text": "def move_left\r\n @dir = :left\r\n @move_x = -3\r\n @sprite = @walk_left if @jump == 0\r\n @moving = true\r\n end", "title": "" }, { "docid": "d7f7b0b72acb397b241b6702ef4527c2", "score": "0.71730727", "text": "def move_upper_left\n # if not direction fixed\n unless @direction_fix\n # set direction\n @direction = (@direction == 6 ? 4 : @direction == 2 ? 8 : @direction)\n end\n # if passable (if pixel movement is on, allow corner skip)\n if BlizzABS.pixel > 1 &&\n (passable?(@x, @y, 8) && passable?(@x, @y - 1, 4) ||\n passable?(@x, @y, 4) && passable?(@x - 1, @y, 8)) ||\n passable?(@x, @y, 8) && passable?(@x, @y - 1, 4) &&\n passable?(@x, @y, 4) && passable?(@x - 1, @y, 8)\n # set new coordinates\n @x -= 1\n @y -= 1\n # increase steps\n increase_steps\n # moved\n return true\n end\n # check touched events\n check_event_trigger_touch(@x-1, @y-1)\n # not moved\n return false\n end", "title": "" }, { "docid": "d7f7b0b72acb397b241b6702ef4527c2", "score": "0.71730727", "text": "def move_upper_left\n # if not direction fixed\n unless @direction_fix\n # set direction\n @direction = (@direction == 6 ? 4 : @direction == 2 ? 8 : @direction)\n end\n # if passable (if pixel movement is on, allow corner skip)\n if BlizzABS.pixel > 1 &&\n (passable?(@x, @y, 8) && passable?(@x, @y - 1, 4) ||\n passable?(@x, @y, 4) && passable?(@x - 1, @y, 8)) ||\n passable?(@x, @y, 8) && passable?(@x, @y - 1, 4) &&\n passable?(@x, @y, 4) && passable?(@x - 1, @y, 8)\n # set new coordinates\n @x -= 1\n @y -= 1\n # increase steps\n increase_steps\n # moved\n return true\n end\n # check touched events\n check_event_trigger_touch(@x-1, @y-1)\n # not moved\n return false\n end", "title": "" }, { "docid": "c16b4de730783832994f1ac4873e4e6e", "score": "0.71644783", "text": "def turn_left\n\t\tcase @facing_direction\n\n\t\twhen NORTH\n\t\t\t@facing_direction = WEST\n\t\twhen WEST\n\t\t\t@facing_direction = SOUTH\n\t\twhen EAST\n\t\t\t@facing_direction = NORTH\n\t\twhen SOUTH\n\t\t\t@facing_direction = EAST\n\t\tend\n\tend", "title": "" }, { "docid": "bef51c1d72399b2e7c3af5e361d03e18", "score": "0.7163297", "text": "def startMovingLeft\n\t\t@direction = :left\n\tend", "title": "" }, { "docid": "74f94846a2722d61829649bf005bae29", "score": "0.7156651", "text": "def turnLeft\n\t\t@direction = case direction\n\t\t\t\t\t\t\t\t when 'N' then 'W'\n\t\t\t\t\t\t\t\t when 'W' then 'S'\n\t\t\t\t\t\t\t\t when 'S' then 'E'\n\t\t\t\t\t\t\t\t when 'E' then 'N'\n\t\tend\n\tend", "title": "" }, { "docid": "8892a825221cbc7c3315b275824e389a", "score": "0.7137139", "text": "def turn_left\n if @direction == \"N\"\n @direction = \"W\"\n elsif @direction == \"W\"\n @direction = \"S\"\n elsif @direction == \"S\"\n @direction = \"E\"\n elsif @direction == \"E\"\n @direction = \"N\"\n end\n end", "title": "" }, { "docid": "c89052fae90da1ad697f8290dc79cac9", "score": "0.71334577", "text": "def move_left\n @x -= 6\n if @x < 0\n @x = 0\n end\n end", "title": "" }, { "docid": "2a79cdc8eafca720cfa499d4928ed3db", "score": "0.7119927", "text": "def go_left\n if can_move?\n @dir = :left\n if @x > 0 && @map.passable?(@x, @y) && @map.passable?(@x - 1, @y)\n sprite.go_left\n @x -= 1\n return true\n else\n turn_left\n end\n end\n Events.on_step_impassable.call(@dir, @x - 1, @y) if self == $Player\n return false\n end", "title": "" }, { "docid": "d3f91c421e3909c172daa8e6963be865", "score": "0.71045744", "text": "def move_left\n @x -= 1 if @level.move_left_from?(@x,@y)\n end", "title": "" }, { "docid": "7e174896b7a67c6f1ade7aa9c202f2e3", "score": "0.710031", "text": "def move_left\n puts_if_debug_mode \"move left\"\n self.current_cell -= 1\n self.remaining_moves += 1\n end", "title": "" }, { "docid": "07e2094e30d8b9145941f3c97896882d", "score": "0.709883", "text": "def turn_left\n @direction = @direction.turn_left\n end", "title": "" }, { "docid": "9a83c59fd27d1be08e1ab87b2fe68c7c", "score": "0.7009182", "text": "def turn_left\n\n case\n when @direction == 'N'\n @direction = 'W'\n when @direction == 'E'\n @direction = 'N'\n when @direction == 'S'\n @direction = 'E'\n when @direction == 'W'\n @direction = 'S'\n end\n\n end", "title": "" }, { "docid": "a121a215f88679f672cfb6a79f55f591", "score": "0.70007753", "text": "def turn_left\n if @direction == \"N\"\n @direction = \"W\"\n elsif @direction == \"W\"\n @direction = \"S\"\n elsif @direction == \"S\"\n @direction = \"E\"\n elsif @direction == \"E\"\n @direction = \"N\"\n end\n puts \"It turned left.\"\n end", "title": "" }, { "docid": "5e99f552d4a370b789e846ba9a8b2b71", "score": "0.6990301", "text": "def turn_left\n return nil unless position?\n @position[:f] = direction_sequence[direction_sequence.index(@position[:f]) - 1]\n @position\n end", "title": "" }, { "docid": "3b8ca17574a2e6bb5e316450ec74ba2c", "score": "0.69859225", "text": "def turn_left\n\t\tif @cardinal_point == 'N' then @cardinal_point = 'W'\n\t\telsif @cardinal_point == 'W' then @cardinal_point = 'S'\n\t\telsif @cardinal_point == 'S' then @cardinal_point = 'E'\n\t\telsif @cardinal_point == 'E' then @cardinal_point = 'N'\n\t\tend\n\tend", "title": "" }, { "docid": "1fca96c18eaa9bb7da0623f011506f8f", "score": "0.6979102", "text": "def move_left \n # if @x is less than zero, reset it to zero to prevent it from moving off the screen\n if @x < 0\n @x = 0\n else\n @x = @x - 10\n end\n end", "title": "" }, { "docid": "587c54ca66e47b6f1b690b44c5d9801e", "score": "0.69549286", "text": "def move_lower_left\n # When no direction fixation\n unless @direction_fix\n # Turn left when facing right, turn down when facing up\n @direction = (@direction == Input::RIGHT ? Input::LEFT : @direction == Input::UP ? Input::DOWN : @direction)\n end\n # When possible to move from down?left or from left?down\n if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::LEFT)) or\n (passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::DOWN))\n # Update coordinates\n @x -= 1\n @y += 1\n end\n end", "title": "" }, { "docid": "437f8f4eb9f792b86bfc30ad7c758c80", "score": "0.6945732", "text": "def check_move_left(game_map)\n # left bottom\n col = game_map.collision?(@x / TILE_SIZE, (@y + @h - 1) / TILE_SIZE)\n if col\n @x = (col[:x] + 1) * TILE_SIZE\n @x += 1\n do_collide(:left, true)\n end\n\n # left top\n col = game_map.collision?(@x / TILE_SIZE, (@y + 1) / TILE_SIZE)\n if col\n @x = (col[:x] + 1) * TILE_SIZE\n @x += 1\n do_collide(:left, true)\n end\n nil\n end", "title": "" }, { "docid": "e382ab0e28ef191dd93760b08e3bcee6", "score": "0.6931806", "text": "def dragLeftChange\n\t\treturn false if @frozen\n\t\tcase @state\n\t\t\twhen :grass\n\t\t\t\t@state = :white\n\t\t\twhen :white\n\t\t\t\t@state = :grass\n\t\tend\n\t\treturn true\n\tend", "title": "" }, { "docid": "1bab426913e6332ad6ce90ef2267b15e", "score": "0.6925656", "text": "def turn_left\n return false if table.nil?\n\n @direction = direction.left\n\n true\n end", "title": "" }, { "docid": "85eff2e7e89c9aa9cbcb8e23343ec034", "score": "0.69225365", "text": "def move_upper_left(mode = 0)\n # get pixel movement rate\n pix = BlizzABS.pixel\n # which type of moving\n case mode\n # override and set moving route\n when 0 then rand(pix*2).times{@force_move.push(7)}\n # move\n when 11 then super()\n end\n end", "title": "" }, { "docid": "85eff2e7e89c9aa9cbcb8e23343ec034", "score": "0.69225365", "text": "def move_upper_left(mode = 0)\n # get pixel movement rate\n pix = BlizzABS.pixel\n # which type of moving\n case mode\n # override and set moving route\n when 0 then rand(pix*2).times{@force_move.push(7)}\n # move\n when 11 then super()\n end\n end", "title": "" }, { "docid": "669d81d04dd61661a9f5134d4fdc0610", "score": "0.6913783", "text": "def move(left)\n @cursor.visible = false\n @flag_center.zoom = 0.9\n @flag_center.x = 85\n @flag_center.opacity = 192\n left ? move_left_animation : move_right_animation\n @flag_left.x = -76\n @flag_center.x = 91\n @flag_center.opacity = 255\n @flag_center.y = 81\n @flag_center.zoom = 1.0\n @flag_right.x = 258\n update_index\n @cursor.visible = true\n @stack.stack.pop.dispose\n end", "title": "" }, { "docid": "c4184405e5fec10f014d97a0811d46fa", "score": "0.6900487", "text": "def moving_left?\n return !sprite.left_mov.nil?\n end", "title": "" }, { "docid": "71ae294cd965c537d28ff11db7e74e06", "score": "0.68953687", "text": "def move_left!\n @posy -= 1\n end", "title": "" }, { "docid": "d9a54c9a7990a28d4a5d6dd354a0f53a", "score": "0.688944", "text": "def move_left(turn_enabled = true)\n # call superclass method and store result\n result = super\n # if self is controlled by player\n if self == $game_player && result\n # if turn enabled\n if turn_enabled\n # update buffer\n $BlizzABS.player.update_buffer(BlizzABS::Cache::TDirs[4])\n else\n # update buffer\n $BlizzABS.player.update_buffer(BlizzABS::Cache::FDirs[4])\n end\n end\n # return result\n return result\n end", "title": "" }, { "docid": "f403399bf33cc06541e723acc49e831d", "score": "0.6885309", "text": "def move_left\n if !game_over? and @game.is_running?\n @current_block.move(-1, 0, 0)\n end\n draw\n end", "title": "" }, { "docid": "e61b7ebbc1bd7b41f2ddb02d4e6f5197", "score": "0.6884367", "text": "def move_left\n @position[:x] -= 1\n end", "title": "" }, { "docid": "7d66d25fdef68a97f1a811d43e31d3bf", "score": "0.6800889", "text": "def left\n self.angle -= 90 if @on_grid\n return direction\n end", "title": "" }, { "docid": "529343c669bf186fb8774b236fd3bd14", "score": "0.67995167", "text": "def left\n return false if @direction.nil?\n i = FACINGS.index(@direction)\n @direction = FACINGS.rotate(-1)[i]\n true\n end", "title": "" }, { "docid": "7c08bf1a83174effee03ebc68dab9f45", "score": "0.67966086", "text": "def turn_left\n begin\n case @rendered_robot[:direction]\n when 'NORTH'\n @rendered_robot[:direction] = 'WEST'\n when 'EAST'\n @rendered_robot[:direction] = 'NORTH'\n when 'SOUTH'\n @rendered_robot[:direction] = 'EAST'\n when 'WEST'\n @rendered_robot[:direction] = 'SOUTH'\n end\n update_robot_position(@rendered_robot[:position][0], @rendered_robot[:position][1], @rendered_robot[:direction])\n rescue StandardError\n puts 'Robot has not been placed on Board -- Please try PLACE command first.'\n end\n end", "title": "" }, { "docid": "d9fd081843329ee71c375d93e118c423", "score": "0.67729604", "text": "def move_left_animation\n filename = \"language/flags/flag_#{@lang_list[(@index - 2) % @lang_list.size]}\"\n tmp = @stack.add_sprite(@flag_right.x + @flag_right. width + 37, 85, filename)\n tmp.opacity = 192\n tmp.zoom = 0.9\n ANIME_FRAMES.times do\n @flag_center.x -= 167 / ANIME_FRAMES\n @flag_left.x -= 167 / ANIME_FRAMES\n @flag_right.x -= 167 / ANIME_FRAMES\n tmp.x -= 167 / ANIME_FRAMES\n update_graphics\n Graphics.update\n end\n end", "title": "" }, { "docid": "40abe8bdb99a774a6ab0bb4d79314ffb", "score": "0.6765353", "text": "def move_lower_right\n # if not direction fixed\n unless @direction_fix\n # set direction\n @direction = (@direction == 4 ? 6 : @direction == 8 ? 2 : @direction)\n end\n # if passable (if pixel movement is on, allow corner skip)\n if BlizzABS.pixel > 1 &&\n (passable?(@x, @y, 2) && passable?(@x, @y + 1, 6) ||\n passable?(@x, @y, 6) && passable?(@x + 1, @y, 2)) ||\n passable?(@x, @y, 2) && passable?(@x, @y + 1, 6) &&\n passable?(@x, @y, 6) && passable?(@x + 1, @y, 2)\n # set new coordinates\n @x += 1\n @y += 1\n # increase steps\n increase_steps\n # moved\n return true\n end\n # check touched events\n check_event_trigger_touch(@x+1, @y+1)\n # not moved\n return false\n end", "title": "" }, { "docid": "40abe8bdb99a774a6ab0bb4d79314ffb", "score": "0.6765353", "text": "def move_lower_right\n # if not direction fixed\n unless @direction_fix\n # set direction\n @direction = (@direction == 4 ? 6 : @direction == 8 ? 2 : @direction)\n end\n # if passable (if pixel movement is on, allow corner skip)\n if BlizzABS.pixel > 1 &&\n (passable?(@x, @y, 2) && passable?(@x, @y + 1, 6) ||\n passable?(@x, @y, 6) && passable?(@x + 1, @y, 2)) ||\n passable?(@x, @y, 2) && passable?(@x, @y + 1, 6) &&\n passable?(@x, @y, 6) && passable?(@x + 1, @y, 2)\n # set new coordinates\n @x += 1\n @y += 1\n # increase steps\n increase_steps\n # moved\n return true\n end\n # check touched events\n check_event_trigger_touch(@x+1, @y+1)\n # not moved\n return false\n end", "title": "" }, { "docid": "60657f3d84b4b34b50cfd147bc350622", "score": "0.6757638", "text": "def left\n if check_bearings == true && @setPosition == true\n case @direction\n when \"NORTH\"\n @direction = \"WEST\"\n turning_robot\n when \"SOUTH\"\n @direction = \"EAST\"\n turning_robot\n when \"EAST\"\n @direction = \"NORTH\"\n turning_robot\n when \"WEST\"\n @direction = \"SOUTH\"\n turning_robot\n end\n puts \"Robot is now Facing #{@direction}\"\n end\n end", "title": "" }, { "docid": "1aaddf49c23ade0fefdb524deb1138f7", "score": "0.6752006", "text": "def turn_left\n @angle -= 4.5\n end", "title": "" }, { "docid": "247ae31598162a371090bbdfc87e73b8", "score": "0.6744569", "text": "def move_left(turn_enabled = true)\n # call superclass method and store result\n result = super\n # update buffer if self is controlled by player\n BlizzABS.player.update_buffer(4) if BlizzABS.player.player == self && result\n # return result\n return result\n end", "title": "" }, { "docid": "247ae31598162a371090bbdfc87e73b8", "score": "0.6744569", "text": "def move_left(turn_enabled = true)\n # call superclass method and store result\n result = super\n # update buffer if self is controlled by player\n BlizzABS.player.update_buffer(4) if BlizzABS.player.player == self && result\n # return result\n return result\n end", "title": "" }, { "docid": "841af68bfd8b432f62b1803385ac28e9", "score": "0.6740832", "text": "def left\n _ensure_placed\n\n @direction = MAPPING_TURN_LEFT[@direction]\n end", "title": "" }, { "docid": "af23f2eb57c7aa61235471d990c4c9ed", "score": "0.6727128", "text": "def left\n case @direction\n when 'W' then @direction = 'S'\n when 'N' then @direction = 'W'\n when 'E' then @direction = 'N'\n when 'S' then @direction = 'E'\n end\n end", "title": "" }, { "docid": "d0b0157fb8bcd208ddcf31151522f346", "score": "0.6725105", "text": "def left\n return unless placed?\n turn(:left)\n puts 'It turns left.'\n end", "title": "" }, { "docid": "0272b34f123cac0963db9231faf40681", "score": "0.67007184", "text": "def left\n dir_code = @directions[@facing]\n new_dir_code = (dir_code - 1) % 4\n @facing = @directions.key(new_dir_code)\t\n\tend", "title": "" }, { "docid": "94814fd20009de6a83ef58509fff3068", "score": "0.6697531", "text": "def test_robot_turns_left_successfully\n @robot.place('PLACE 0,0,NORTH')\n @robot.process('LEFT')\n assert_output(@robot.process('REPORT')) { '0,0,WEST' }\n end", "title": "" }, { "docid": "f56b113507bf5ff4a9318a8a22f4c5a1", "score": "0.66670775", "text": "def move_left\n # Shift x position left by 2 (each square on game board is 2x2 array elements)\n @position[:x] -= 2\n\n # Reset x position if the new position isnt valid\n @position[:x] += 2 unless is_valid_position?\n end", "title": "" }, { "docid": "caf0c4cd6b1d95787783a1e6bcabbd87", "score": "0.66625893", "text": "def move_piece_left!\n @current_piece_pos[0] = @current_piece_pos[0]-1\n end", "title": "" }, { "docid": "104d6edef6a1b48d3a49432fc14dc510", "score": "0.66600657", "text": "def turn_left\n direction_id = @directions.find_index(@direction_facing) #Find id for current direction\n #point the direction of the direction id before the current unless at front of the array\n @direction_facing = @directions[direction_id - 1] # Negative index counts backwards from the end of the array\n end", "title": "" }, { "docid": "96129a33540b3116c34d2704fc16f2c1", "score": "0.6658011", "text": "def holding_left; self.turn -1; end", "title": "" }, { "docid": "3acb770269b70f18f3f6df060c2fcca1", "score": "0.6658008", "text": "def left\n move(0, -1)\n end", "title": "" }, { "docid": "3acb770269b70f18f3f6df060c2fcca1", "score": "0.6658008", "text": "def left\n move(0, -1)\n end", "title": "" }, { "docid": "666cca3be0bbaab4a65103a6c54e19a3", "score": "0.66538763", "text": "def move_lower_right(mode = 0)\n # get pixel movement rate\n pix = BlizzABS.pixel\n # which type of moving\n case mode\n # override and set moving route\n when 0 then rand(pix*2).times{@force_move.push(3)}\n # move\n when 11 then super()\n end\n end", "title": "" }, { "docid": "666cca3be0bbaab4a65103a6c54e19a3", "score": "0.66538763", "text": "def move_lower_right(mode = 0)\n # get pixel movement rate\n pix = BlizzABS.pixel\n # which type of moving\n case mode\n # override and set moving route\n when 0 then rand(pix*2).times{@force_move.push(3)}\n # move\n when 11 then super()\n end\n end", "title": "" }, { "docid": "15b738032a81c417b56120df142fe635", "score": "0.6652453", "text": "def move_enable\n @stow.set_sensitive(true)\n @onaxis.set_sensitive(true)\n @moveto.set_sensitive(true)\n end", "title": "" }, { "docid": "5cf026701b2f126809fba009ec88c0da", "score": "0.6646173", "text": "def move_upper_left(mode = 0)\n mode == 0 ? move_generic(mode, true, 7) : super()\n end", "title": "" }, { "docid": "21c93107d87d5c5342a75ebac67ea696", "score": "0.6645452", "text": "def move_left\n @ox -= 1\n @x = coordinate(ox, :x).x\n\n store_and_refresh\n end", "title": "" }, { "docid": "e6ef233db6b049c2bc9288725ec06173", "score": "0.66429067", "text": "def move_lower_right(mode = 0)\n mode == 0 ? move_generic(mode, true, 3) : super()\n end", "title": "" }, { "docid": "7fc34fe5bcc31fc143c678656c8a2297", "score": "0.66328764", "text": "def able_to_left_castle\n left_rook = @board[[@position[0], @position[1] - 4]]\n !@already_moved && !in_line_of_attack?([0, 2]) &&\n !left_rook.already_moved\n end", "title": "" }, { "docid": "3c1e9b78f9ccd41a4151d71394933cf0", "score": "0.6629348", "text": "def left\n \n if input_direction == -1 && position == 0\n position = 3\n else\n position -= 1\n end\n\nend", "title": "" }, { "docid": "964466c1d3bdb510922f2269e76a39e6", "score": "0.66264707", "text": "def move_left\n move_up!\n end", "title": "" }, { "docid": "e76fe6a8fc5de830b02198d3e137da51", "score": "0.66214246", "text": "def left\n send_direction(:left) unless @player.direction == :right \n end", "title": "" }, { "docid": "50d6485e406e01545392c41f22c91d58", "score": "0.6621132", "text": "def left\n if placed?\n self.orientation = orientation.left\n log(\"Turned left\")\n else\n log(\"Not placed. Returning.\")\n end\n end", "title": "" }, { "docid": "9cbb7b6334c47adec6978184bf40f95a", "score": "0.6620083", "text": "def move_left\n unless @line.bol? then\n @line.left\n sync!\n return true\n end\n false\n end", "title": "" }, { "docid": "82ada5f1bfd9cdc0a80adc7d000f7972", "score": "0.66116273", "text": "def move_left\n @position -= 1\n end", "title": "" }, { "docid": "e2342bdd701b632570a11f2f33ea27ca", "score": "0.6597236", "text": "def cursor_can_move_left?\n return (@cursor_position > 0)\n end", "title": "" }, { "docid": "1f16bbeadf4617baa45ad63a292fa017", "score": "0.6590138", "text": "def move_left\n @position[0] -= 1\n end", "title": "" }, { "docid": "c3a60aa05e94a29e8e4e9732e108ff77", "score": "0.65894145", "text": "def move_left_possible?\n x_next_left = @box.x - x_vel\n y_next_left = @box.y - y_vel\n (x_next_left > 0) && (y_next_left > 0)\n end", "title": "" }, { "docid": "05320f9b2168522e6efeea7e568e6812", "score": "0.65843683", "text": "def left\n\t\tif @direction == \"N\"\n\t\t@direction = \"W\"\n\t\telsif @direction == \"W\"\n\t\t@direction = \"S\"\n\t\telsif @direction == \"S\"\n\t\t@direction = \"E\"\n\t\telsif @direction == \"E\" \n\t\t@direction = \"N\" \n\t\telse puts \"The direction requested is not a valid direction.\" \n\t\tend\n\tend", "title": "" }, { "docid": "4ad8b151bc350526035974a9f11ccf05", "score": "0.6572281", "text": "def turn_left\n case @orientation\n when \"N\" then @orientation = \"W\"\n when \"S\" then @orientation = \"E\"\n when \"E\" then @orientation = \"N\"\n when \"W\" then @orientation = \"S\"\n end\n end", "title": "" }, { "docid": "8a16f2ad4911e53b22401204e3fa86b3", "score": "0.65622854", "text": "def left\n case @face_dir\n when \"NORTH\" then @face_dir = \"WEST\"\n when \"EAST\" then @face_dir = \"NORTH\"\n when \"SOUTH\" then @face_dir = \"EAST\"\n when \"WEST\" then @face_dir = \"SOUTH\"\n end\n end", "title": "" }, { "docid": "552f86b464b4753d3051674aef7ff0dc", "score": "0.655712", "text": "def move_left\n @x = (@x - SPEED) % WIDTH\n end", "title": "" }, { "docid": "b8032a08c2b3a21d210143aa3fcac1d9", "score": "0.6540494", "text": "def left\n new_position = compass.index(current_direction) -1 >= 0 ? compass.index(current_direction) -1 : 3\n self.current_direction = compass[new_position]\n end", "title": "" } ]
8df9e898c86fd2181bf90f9da0378510
POST /backend/meetings POST /backend/meetings.xml
[ { "docid": "28707ac181240ea800612c41644172b8", "score": "0.6834929", "text": "def create\n @backend_meeting = Meeting.new(params[:meeting])\n\n respond_to do |format|\n if @backend_meeting.save\n format.html { redirect_to(backend_meeting_path(@backend_meeting), :notice => 'Meeting was successfully created.') }\n format.xml { render :xml => @backend_meeting, :status => :created, :location => @backend_meeting }\n else\n format.html { render :action => 'new'}\n format.xml { render :xml => @backend_meeting.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "a617a369ed477cc52d90eae61426d185", "score": "0.6647813", "text": "def create\n @meetup = Meetup.new(params[:meetup])\n @meetup.staff_id = current_staff\n @meetup.status = PLANNED\n\n respond_to do |format|\n if @meetup.save\n format.html { redirect_to meetups_path }\n format.xml { render :xml => @meetup, :status => :created, :location => @meetup }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @meetup.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "20209ee662546a35e59706fa1a61404a", "score": "0.65859324", "text": "def create\n @meeting = Meeting.new(params[:meeting])\n\n if @meeting.save\n render json: @meeting, status: :created, location: @meeting\n else\n render json: @meeting.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "52794f8ca42d78d8bc840c3fe0305c5c", "score": "0.65626025", "text": "def create\n # @meeting = Meeting.new(params[:meeting])\n @meeting = current_user.meetings.create(params[:meeting])\n if @meeting.save\n redirect_to user_root_path\n else\n end\n end", "title": "" }, { "docid": "dca8fc175a86bc2caf33a498be6c3116", "score": "0.64941627", "text": "def index\n if params[:create_meeting].to_s.to_boolean(false) || ChimeSdk.config.create_meeting_by_get_request\n create\n else\n list_meetings\n respond_to do |format|\n format.html\n format.json { render json: { meetings: @meetings } }\n end\n end\n end", "title": "" }, { "docid": "551878ac14119ad1c5601fcc48636a5d", "score": "0.64589584", "text": "def create\n @meeting = @grade.meetings.new(meeting_params)\n @meeting.save\n\n respond_with(@institution, @grade, @meeting)\n end", "title": "" }, { "docid": "75370999ca0685e40a3734810eb2ded6", "score": "0.64349777", "text": "def create\n @meeting = Meeting.new(params[:meeting])\n\n respond_to do |format|\n if @meeting.save\n format.html { redirect_to(@meeting, :notice => 'Meeting was successfully created.') }\n format.xml { render :xml => @meeting, :status => :created, :location => @meeting }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @meeting.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bd90ee430d5694cde29f831e582e4ac0", "score": "0.64106035", "text": "def create\n @meeting = Meeting.new(params[:meeting])\n @all_meeting_types = MeetingType.get_all_meeting_types.collect{|m| [m.name,m.id]}\n \n respond_to do |format|\n if @meeting.save\n AttendeeMailer.send_email(@meeting).deliver\n format.html { redirect_to @meeting, :notice => 'Meeting was successfully created.' }\n format.json { render :json => @meeting, :status => :created, :location => @meeting }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @meeting.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c4287927d2deb2d0b2713f34c2971404", "score": "0.6399171", "text": "def create\n @meet = Meet.new(meet_params)\n\n respond_to do |format|\n if @meet.save\n format.html { redirect_to @meet, notice: \"Meet was successfully created.\" }\n format.json { render :show, status: :created, location: @meet }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @meet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4779120ec3b99383a6f9e8e429a291c9", "score": "0.6387975", "text": "def create\n @meeting = Meeting.new(params[:meeting])\n\n if @meeting.start > @meeting.finish\n @meeting.finish = @meeting.start\n end\n\n respond_to do |format|\n if @meeting.save\n clean_up_data\n format.html { redirect_to(@meeting, :notice => '<p>You just added a new meeting.</p>') }\n format.xml { render :xml => @meeting, :status => :created, :location => @meeting }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @meeting.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c17416fcc6b74211ecc2aa392b837c85", "score": "0.6387024", "text": "def create\n @meeting = Meeting.new(params[:meeting])\n\n respond_to do |format|\n if @meeting.save\n format.html { redirect_to meetings_path, notice: 'Meeting was successfully created.' }\n format.json { render json: @meeting, status: :created, location: @meeting }\n else\n format.html { render action: \"new\" }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c17416fcc6b74211ecc2aa392b837c85", "score": "0.6386094", "text": "def create\n @meeting = Meeting.new(params[:meeting])\n\n respond_to do |format|\n if @meeting.save\n format.html { redirect_to meetings_path, notice: 'Meeting was successfully created.' }\n format.json { render json: @meeting, status: :created, location: @meeting }\n else\n format.html { render action: \"new\" }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "43fa8e31f6d49b38405cd4ff94fd36fe", "score": "0.6375271", "text": "def create\n @meeting = Meeting.new(meeting_params)\n @meeting.creator = Creator.find_by(user: current_user)\n respond_to do |format|\n if @meeting.save\n current_user.meetings << @meeting\n current_user.save\n format.html { redirect_to @meeting, notice: 'Встреча бы успешно создана!' }\n format.json { render :show, status: :created, location: @meeting }\n else\n format.html { render :new }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3e13e9b29392562c1aa8a6ea53061efe", "score": "0.63715273", "text": "def create\n @meeting = current_user.meetings.build(params[:meeting])\n respond_to do |format|\n if @meeting.save\n format.html { redirect_to @meeting, notice: 'Meeting was successfully created.' }\n format.json { render json: @meeting, status: :created, location: @meeting }\n else\n format.html { render action: \"new\" }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "84a6ef4b85f5a9828ba5b2e43d073852", "score": "0.6364373", "text": "def create\n @meeting = @user.meetings.create(meeting_params)\n\n respond_to do |format|\n if @meeting.save\n format.html { redirect_to current_user, notice: 'Meeting was successfully created.' }\n \n else\n format.html { render :new }\n \n end\n end\n end", "title": "" }, { "docid": "b329059ffbc128aea39ee408225bf594", "score": "0.63595456", "text": "def meetings\n end", "title": "" }, { "docid": "cf73924a10ba7d007ea9571bddfa4b58", "score": "0.6334331", "text": "def index\n @meetings = @section.meetings.all\n \n unless @meetings.size > 0\n\t \[email protected]_meetings\n\t \t@meetings = @section.meetings.all \n\t end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @meetings }\n end\n end", "title": "" }, { "docid": "93bbed4f9bddfa753b6b65563e122763", "score": "0.63073224", "text": "def meetings\n @current_tab = \"Clubs\"\n \n sess = Patron::Session.new\n sess.base_url = \"http://online.equipe.com/\"\n #http://online.equipe.com/api/v1/clubs/####/meetings.json\n response = sess.get \"api/v1/clubs/\" + params[:id].to_s + \"/meetings.json\"\n @meetings = JSON.parse response.body\n \n \n \n respond_to do |format|\n format.html # meetings.html.erb\n format.xml { render :xml => @meetings }\n end\n \n end", "title": "" }, { "docid": "8f107fc80abdd7af1b368fce98620340", "score": "0.6298348", "text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @meetings }\n end\n end", "title": "" }, { "docid": "12216e44a4c6f7f24af6fd3e1c63d3d4", "score": "0.62927055", "text": "def create\n @meetup = Meetup.new(meetup_params)\n authorize @meetup\n respond_to do |format|\n if @meetup.save\n @meetup.holdings.create(user_id: current_user.id)\n format.html { redirect_to meetup_path(@meetup) }\n format.json do\n render :show,\n status: :created, location: @meetup\n end\n else\n format.html { render :new }\n format.json do\n render json: @meetup.errors,\n status: :unprocessable_entity\n end\n end\n end\n end", "title": "" }, { "docid": "8e82dbf13f2f431216a26af960791df7", "score": "0.6266509", "text": "def create\r\n @meeting = Meeting.new(params[:meeting])\r\n @meeting.society_id = current_user.society_id\r\n respond_to do |format|\r\n if @meeting.save\r\n track_activity @meeting\r\n format.html { redirect_to @meeting, only_path: true , notice: 'Meeting was successfully created.' }\r\n format.json { render json: @meeting, status: :created, location: @meeting }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "9e07c59166f5d6afecf06b6083decdaf", "score": "0.6263716", "text": "def to_xml\n raise WebexXmlApi::NotEnoughArguments,\n 'Meeting::CreateMeeting' unless valid?\n create_xml_request(@security_context.to_xml, REQUEST_TYPE, @meeting)\n end", "title": "" }, { "docid": "eac0ac46d0646f7887e2bd4f89578683", "score": "0.6262468", "text": "def create\n meeting = Meeting.new({\n meeting_type: MeetingType.find(meeting_member_params[:meeting_type]),\n met: meeting_member_params[:date]\n })\n\n meeting.save\n memberIds = meeting_member_params[:members]\n\n memberIds.each do |memId|\n member = Member.find(memId)\n\n if member\n mm = MeetingMember.new({\n meeting: meeting,\n member: member,\n belt: member.belt,\n })\n\n mm.save\n end\n end\n\n @meeting_member = MeetingMember.new(meeting_member_params)\n\n respond_to do |format|\n if @meeting_member.save\n format.html { redirect_to @meeting_member, notice: 'Meeting member was successfully created.' }\n format.json { render :show, status: :created, location: @meeting_member }\n else\n format.html { render :new }\n format.json { render json: @meeting_member.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e8696edee2665380ebeceac4754fb74f", "score": "0.62550706", "text": "def create\n @meeting = Meeting.new(params[:meeting])\n\n respond_to do |format|\n if @meeting.save\n format.html { redirect_to @meeting, notice: 'Meeting was successfully created.' }\n format.json { render json: @meeting, status: :created, location: @meeting }\n else\n format.html { render action: \"new\" }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e8696edee2665380ebeceac4754fb74f", "score": "0.62550706", "text": "def create\n @meeting = Meeting.new(params[:meeting])\n\n respond_to do |format|\n if @meeting.save\n format.html { redirect_to @meeting, notice: 'Meeting was successfully created.' }\n format.json { render json: @meeting, status: :created, location: @meeting }\n else\n format.html { render action: \"new\" }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "acec0cd81489c2b820808f07a2e8b35f", "score": "0.62500966", "text": "def create\n @meeting = Meeting.new(params[:meeting])\n @creator = Person.new(params[:meeting][:creator_attributes])\n @creator.save\n @meeting.creator_id = @creator.id\n begin\n @meeting.date = (DateTime.strptime(params[:meeting][:date], '%m/%d/%Y %H:%M ')).to_datetime\n rescue Exception=>e\n @meeting.date = nil\n end\n @meeting.state = 'A'\n respond_to do |format|\n if @meeting.save\n @meeting.topics.each do |topic|\n if topic.name == nil or topic.name.size == 0\n @meeting.topics.delete(topic)\n end\n end\n flash[:notice] = \"An email was sent to you with the meeting management. If you want, you can use the following tool to easily invite them:\"\n @meeting.management_url = SecureRandom.base64(8).gsub(\"/\",\"_\").gsub(/=+$/,\"\")[email protected]_s\n @meeting.participants = [] \n @meeting.save\n url = (Rails.env.development?) ? \"http://localhost:3000/manage/\" : \"http://quickplan.heroku.com/manage/\"\n url = url + @meeting.management_url\n begin\n Notifier.management_email(@meeting, url).deliver\n rescue Exception=>e \n end \n format.html { redirect_to edit_meeting_path(:id => @meeting.management_url, :step => \"invites\")}\n format.js { redirect_to edit_meeting_path(:id => @meeting.management_url, :step => \"invites\")}\n format.json { render json: @meeting, status: :created, location: @meeting }\n else\n format.html { render action: :new }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "17005d1857d352264c4dba2880f1cda8", "score": "0.62484324", "text": "def create\n @meeting = Meeting.new(meeting_params)\n respond_to do |format|\n if @meeting.save\n format.html { redirect_to @meeting, notice: 'Meeting was successfully created.' }\n format.json { render :show, status: :created, location: @meeting }\n else\n format.html { render :new }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "55b258b8ae61accd89787f09d6298604", "score": "0.6228099", "text": "def create\n @meeting = Meeting.new(meeting_params)\n\n respond_to do |format|\n if @meeting.save\n format.html { redirect_to @meeting, notice: 'Meeting was successfully created.' }\n format.json { render :show, status: :created, location: @meeting }\n else\n format.html { render :new }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "082448a67da371f83238f4c2bba44208", "score": "0.62222993", "text": "def new\n @backend_meeting = Backend::Meeting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @backend_meeting }\n end\n end", "title": "" }, { "docid": "8505e1f019b92e52df15a083a77e10f9", "score": "0.62006223", "text": "def create\n @meeting = Meeting.new(params[:meeting])\n @meeting.user = current_user\n\n respond_to do |format|\n if @meeting.save\n format.html { redirect_to(@meeting, :notice => 'Meeting was successfully created.') }\n format.xml { render :xml => @meeting, :status => :created, :location => @meeting }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @meeting.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cfbd2702c1d3fd25bf2c42709ea09b70", "score": "0.61867785", "text": "def create\n @meeting = Meeting.new(meeting_params)\n\n respond_to do |format|\n if @meeting.save\n format.html { redirect_to @meeting, notice: 'Meeting was successfully created.' }\n format.json { render action: 'show', status: :created, location: @meeting }\n else\n format.html { render action: 'new' }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cfbd2702c1d3fd25bf2c42709ea09b70", "score": "0.61867785", "text": "def create\n @meeting = Meeting.new(meeting_params)\n\n respond_to do |format|\n if @meeting.save\n format.html { redirect_to @meeting, notice: 'Meeting was successfully created.' }\n format.json { render action: 'show', status: :created, location: @meeting }\n else\n format.html { render action: 'new' }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cfbd2702c1d3fd25bf2c42709ea09b70", "score": "0.61867785", "text": "def create\n @meeting = Meeting.new(meeting_params)\n\n respond_to do |format|\n if @meeting.save\n format.html { redirect_to @meeting, notice: 'Meeting was successfully created.' }\n format.json { render action: 'show', status: :created, location: @meeting }\n else\n format.html { render action: 'new' }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e79a98afa3f38ea3c38b6c0b21e50a20", "score": "0.61688155", "text": "def create\n @user = get_user\n @meeting = Meeting.new(params[:meeting])\n @attendees = Usermeeting.find_all_by_meeting_id_and_is_attending(@meeting, 1)\n @actual = []\n for attendee in @attendees\n @actual << User.find_by_id(attendee.user_id)\n end\n respond_to do |format|\n if @meeting.save\n flash[:notice] = 'Meeting was successfully created.'\n \n Usermeeting.create(:user_id => @user.id, :meeting_id => @meeting.id, :is_host => 1, :is_attending => 1)\n \n #*************************************************************\n for attendee in @actual\n Meetingmailer.deliver_meeting_notification(attendee,@meeting)\n end\n #*************************************************************\n format.html { redirect_to(@meeting) }\n format.xml { render :xml => @meeting, :status => :created, :location => @meeting }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @meeting.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "29f0c128933cb1a4ea13c7ebb47c39d7", "score": "0.6166699", "text": "def create\n @athletes_events_meet = AthletesEventsMeet.new(athletes_events_meet_params)\n\n respond_to do |format|\n if @athletes_events_meet.save\n format.html { redirect_to @athletes_events_meet, notice: 'Athletes Events Meet was successfully created.' }\n format.json { render :show, status: :created, location: @athletes_events_meet }\n else\n format.html { render :new }\n format.json { render json: @athletes_events_meet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f0c7ffd432d878b31f1fd87d592bf17b", "score": "0.61653864", "text": "def createMeeting()\n #Delete meeting if exist\n deleteMeetingIfExist(\"Automation Meeting\")\n #Click on meeting\n clickOnMeetingButton()\n #Enter meeting name\n enterMeetingName()\n #Enter Host Name\n enterHostName()\n #click on messaging tab\n clickOnMessagingTab()\n checkTwitterCheckBox()\n checkEmailCheckBox()\n #Click on Date tab\n clickOnDatesTab()\n #Set the start date\n setStartDate(\"2014\", \"October\", \"10\" )\n #Set the end date\n setEndDate(\"2014\", \"October\", \"17\" )\n #click on features tab\n clickOnFeaturesTab()\n #check the check box of Attendees select team\n checkAttendeesTeamCheckBox()\n #Click on create meeting\n clickOnCreateMeeting()\n #verify meeting is created\n #verifyMeetingCreated()\n #get attendees url\n #getAttendeesURL()\n #write data into the file\n writeAttendeesUrl(\"Automation Meeting\")\n end", "title": "" }, { "docid": "7d204db3b1a4fb78c533887322446d1a", "score": "0.6154072", "text": "def index\n @meetings = Meeting.all\n\n render json: @meetings\n end", "title": "" }, { "docid": "d9f800db51a88a071115509767a10f05", "score": "0.6149098", "text": "def create\n @meet_up = MeetUp.new(params[:meet_up])\n @meet_up.owner_id = current_user.id\n @meet_up.conference_confirm = current_conference\n\n if @meet_up.save\n flash[:notice] = \"Successfully created Yoruzemi\"\n ks_cache_invalidate [meet_ups_path(:date => @meet_up.starts_at.strftime('%Y-%m-%d'))]\n else\n flash[:error] = \"Failed to create Yoruzemi\"\n end\n respond_with @meet_up\n end", "title": "" }, { "docid": "f951f9286f44ba724b98cc03f8a26218", "score": "0.6137788", "text": "def meetings\n # byebug\n facility = session[:facility]\n all_lists = WeeklyNote.get_pat_lists(params, facility)\n @all_done = all_lists[:pat_all_done]\n @all_to_do = all_lists[:pat_all_to_do]\n @chosen_date = all_lists[:meeting_date]\n\n respond_to do |format|\n format.html {}\n format.js {}\n end\n end", "title": "" }, { "docid": "56a0b8ec745caebddd240d291e459c02", "score": "0.61269623", "text": "def create\n @meeting = Meeting.new(params[:meeting])\n\n respond_to do |format|\n if @meeting.save\n format.html { redirect_to @meeting, notice: '作成が完了しました!' }\n format.json { render json: @meeting, status: :created, location: @meeting }\n else\n format.html { render action: \"new\" }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0fc1b622c40a01ea1526e573de5d92f9", "score": "0.6109756", "text": "def create\n if params[:create_meeting_with_attendee].to_s.to_boolean(false) || ChimeSdk.config.create_meeting_with_attendee\n create_meeting_with_attendee\n else\n create_meeting\n end\n respond_to do |format|\n format.html { redirect_to meeting_resource_path(meeting_id), notice: \"Meeting <#{meeting_id}> was successfully created.\" }\n format.json { render status: 201, json: @meeting.merge(@attendee || {}) }\n end\n end", "title": "" }, { "docid": "b76c092e76c900ed924db447c8a91ef6", "score": "0.61025137", "text": "def create\n @meeting_participant = MeetingParticipant.new(params[:meeting_participant])\n\n respond_to do |format|\n if developer?\n if @meeting_participant.save\n flash[:notice] = 'MeetingParticipant was successfully created.'\n format.xml { render :xml => @meeting_participant, :status => :created, :location => @meeting_participant }\n else\n format.xml { render :xml => @meeting_participant.errors, :status => :unprocessable_entity }\n end\n else\n format.xml { render :xml => XML_ERRORS[:not_authorized] }\n end\n end\n end", "title": "" }, { "docid": "b39bf8dfdddc6085c9edef61e3f2da8d", "score": "0.60705656", "text": "def create\n @horary = Horary.new(params[:horary])\n @horary.day=\"#{@horary.startTime.year}-#{@horary.startTime.month}-#{@horary.startTime.day}\"\n respond_to do |format|\n if @horary.save and Horary.create_meetings(@horary)\n format.html { redirect_to(@horary, :notice => 'Horary was successfully created.') }\n format.xml { render :xml => @horary, :status => :created, :location => @horary }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @horary.errors, :status => :unprocessable_entity }\n end \n end\n end", "title": "" }, { "docid": "4fc1efcde36fbba907fd6364cc18da8a", "score": "0.606764", "text": "def get_meetings\n prepare()\n @api.get_meetings()\n end", "title": "" }, { "docid": "e5e1f08e813bbd4dd67c3b0023085909", "score": "0.6062623", "text": "def get_meetings\n prepare\n @api.get_meetings\n end", "title": "" }, { "docid": "b005185ae035a32788b4ecbed35850a8", "score": "0.6062303", "text": "def add_meetings(config, http_client)\n\tmeeting_page_document = get_meeting_page_document(config, http_client)\n\tgroup_id = get_group_id(meeting_page_document)\n\trepeat_dates = get_repeat_dates(config)\n\trepeat_dates.each do |meeting_date|\n\t\tdisplay_date = meeting_date.strftime(DISPLAY_DATE_FORMAT)\n\t\tif get_meeting_date_found(config, meeting_page_document, meeting_date)\n\t\t\tputs \"Meeting for #{display_date} already found.\"\n\t\telse\n\t\t\tputs \"Adding #{display_date} meeting…\"\n\t\t\tstart_date_string = get_ch_input_date(config, meeting_date, 'start_time')\n\t\t\tend_date_string = get_ch_input_date(config, meeting_date, 'end_time')\n\t\t\targs = { 'runnum' => '2', 'rm' => 'scheduleeditor', 'groupid' => group_id, 'eventid' => '', 'startdate' => start_date_string, 'enddate' => end_date_string, 'location' => config['location_string'], 'latitude' => config['latitude'], 'longitude' => config['longitude'], 'locationdetails' => config['meeting_details'], 'newmeeting' => 'Create New Meeting...' } \n\t\t\tresponse = http_client.post(URL, args)\n\t\t\tresponse_document = Oga.parse_html response.content\n\t\t\tif !get_meeting_date_found(config, response_document, meeting_date) \n\t\t\t\tputs \"Should have added a meeting for #{display_date} but did not find one in the resulting document. Stopping.\"\n\t\t\t\texit\n\t\t\tend\n\t\tend\n\tend\nend", "title": "" }, { "docid": "02df1852dd6db37e99132d09308ab5e6", "score": "0.60499316", "text": "def index\n @meetings = Meeting.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @meetings }\n end\n end", "title": "" }, { "docid": "a547376d41b49d21806758f7975ddb14", "score": "0.60476744", "text": "def create\n @meetup = Meetup.new(meetup_params)\n\n respond_to do |format|\n if @meetup.save\n format.html { redirect_to @meetup, notice: 'Meetup was successfully created.' }\n format.json { render :show, status: :created, location: @meetup }\n else\n format.html { render :new }\n format.json { render json: @meetup.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a547376d41b49d21806758f7975ddb14", "score": "0.60476744", "text": "def create\n @meetup = Meetup.new(meetup_params)\n\n respond_to do |format|\n if @meetup.save\n format.html { redirect_to @meetup, notice: 'Meetup was successfully created.' }\n format.json { render :show, status: :created, location: @meetup }\n else\n format.html { render :new }\n format.json { render json: @meetup.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b274970dd551d94d71d67f91a1d7dbc6", "score": "0.6037336", "text": "def create\n @off_meeting = OffMeeting.new(off_meeting_params)\n\n respond_to do |format|\n if @off_meeting.save\n format.html { redirect_to @off_meeting, notice: 'オフ会を登録しました。' }\n format.json { render :show, status: :created, location: @off_meeting }\n else\n format.html { render :new }\n format.json { render json: @off_meeting.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3574a34d1da04f7dd2f67cbc2cfb08c4", "score": "0.6027981", "text": "def create\r\n @usermeeting = Usermeeting.new(params[:usermeeting])\r\n\r\n respond_to do |format|\r\n if @usermeeting.save\r\n flash[:notice] = 'Your RSVP was successfully recorded.'\r\n format.html { redirect_to(@usermeeting) }\r\n format.xml { render :xml => @usermeeting, :status => :created, :location => @usermeeting }\r\n else\r\n format.html { render :action => \"new\" }\r\n format.xml { render :xml => @usermeeting.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "4cab1150bd488d3595df1a30925bc24e", "score": "0.6013792", "text": "def create\n @meeting = Meeting.find(params[:meeting_id])\n @talk = @meeting.talks.new(params[:talk])\n\n respond_to do |format|\n if @talk.save\n format.html { redirect_to meeting_talk_url(@meeting,@talk), notice: 'Talk was successfully created.' }\n format.json { render json: @talk, status: :created, location: meeting_talk_url(@meeting,@talk) }\n else\n format.html { render action: \"new\" }\n format.json { render json: @talk.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "878427711906f4f1c43d56f04cb1ef7c", "score": "0.60048497", "text": "def create\n \t@meeting = current_user.meetings.build(meeting_params)\n #Check possible overlap\n\n @meetingsRD = Meeting.where(\"day = ? and room = ?\", @meeting.day, @meeting.room)\n\n \t# Check fields\n respond_to do |format|\n \t if @meeting.save\n \t format.html { redirect_to user_meetings_path, notice: 'Meeting sucesfully added!' + @meetingsRD.size().to_s }\n else\n #format.html { redirect_to user_meetings_path, notice: 'Errors creating meeting' }\n format.html { render action: 'edit' }\n end\n end\n end", "title": "" }, { "docid": "9360831e73f5ef6569b1ee69c10e6d8a", "score": "0.5983058", "text": "def meet_params\n params.require(:meet).permit(:name, :date, :start_time, :end_time, :event_id, :speaker_id)\n end", "title": "" }, { "docid": "3e948804f87ca881d3893ab313391cd6", "score": "0.5982088", "text": "def create\n\n @initial_days = @meeting.calc_tentative_days()\n respond_to do |format|\n if @meeting.save\n flash[:notice] = 'Meeting was successfully created.'\n format.html { redirect_to(meetings_path()) }\n format.xml { render :xml => @meeting, :status => :created, :location => @meeting }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @meeting.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "700d16cd4a86d8020a257ec8d4f0d581", "score": "0.5980737", "text": "def create\n response = EventSourced::Meeting.schedule(schedule_meeting_params.to_h.symbolize_keys)\n\n if response.success?\n render :json => { :meeting => response.data }\n else\n render :json => { :errors => response.errors }\n end\n end", "title": "" }, { "docid": "bdf55a672bacf114d6581fe17dfa8495", "score": "0.5962113", "text": "def create\n @join_meet = JoinMeet.new(params[:join_meet])\n @join_meet.user_id = session[:user_id]\n respond_to do |format|\n if @join_meet.save\n format.html { redirect_to @join_meet, notice: 'Join meet was successfully created.' }\n format.json { render json: @join_meet, status: :created, location: @join_meet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @join_meet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6c956d6354714fc57a87c42910ddea86", "score": "0.59487414", "text": "def create\n @event = current_user.events.new(event_params)\n @day = @event.due_date.strftime('%F')\n @meetings = current_user.events.on_this_day(@day)\n respond_to do |format|\n if @event.save\n format.json { render :show, status: :created, location: @event }\n format.js\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n format.js { render :file => \"app/views/events/event_error.js.erb\" }\n end\n end\n end", "title": "" }, { "docid": "7221f83a635671cfe746de0f4abe8473", "score": "0.59316766", "text": "def to_xml\n raise WebexXmlApi::NotEnoughArguments,\n 'Meeting::GetMeeting' unless valid?\n body_content = {}\n PARAMETER_MAPPING.each_pair do |k, v|\n body_content[v] = send(k) if send(k)\n end\n create_xml_request(@security_context.to_xml, REQUEST_TYPE,\n body_content)\n end", "title": "" }, { "docid": "fe9e282f94a07a61a5862a2aa44b21e4", "score": "0.59302324", "text": "def index\n @meetings = (current_user.meetings + current_user.invited_meetings).sort_by(&:start_time)\n json_response(@meetings)\n end", "title": "" }, { "docid": "1686dfc1c9b86c184e40621a11895e0f", "score": "0.59259", "text": "def index\n @meetings = Meeting.all\n end", "title": "" }, { "docid": "1686dfc1c9b86c184e40621a11895e0f", "score": "0.59259", "text": "def index\n @meetings = Meeting.all\n end", "title": "" }, { "docid": "1686dfc1c9b86c184e40621a11895e0f", "score": "0.59259", "text": "def index\n @meetings = Meeting.all\n end", "title": "" }, { "docid": "1686dfc1c9b86c184e40621a11895e0f", "score": "0.59259", "text": "def index\n @meetings = Meeting.all\n end", "title": "" }, { "docid": "1686dfc1c9b86c184e40621a11895e0f", "score": "0.59259", "text": "def index\n @meetings = Meeting.all\n end", "title": "" }, { "docid": "1686dfc1c9b86c184e40621a11895e0f", "score": "0.59259", "text": "def index\n @meetings = Meeting.all\n end", "title": "" }, { "docid": "1686dfc1c9b86c184e40621a11895e0f", "score": "0.59259", "text": "def index\n @meetings = Meeting.all\n end", "title": "" }, { "docid": "1686dfc1c9b86c184e40621a11895e0f", "score": "0.59259", "text": "def index\n @meetings = Meeting.all\n end", "title": "" }, { "docid": "1686dfc1c9b86c184e40621a11895e0f", "score": "0.59259", "text": "def index\n @meetings = Meeting.all\n end", "title": "" }, { "docid": "9d610a6df5bf8eabc50508f5e854dae7", "score": "0.5923661", "text": "def newMeeting\n #@meeting = Meeting.new(meeting_params)\n p params\n p 'CREATE MAGIC--------------------'\n p meeting_params\n pass = true\n\n course_id = meeting_params[:course_id]\n name = meeting_params[:name]\n location = meeting_params[:location]\n description = meeting_params[:description]\n start_date = meeting_params[:start_date]\n start_time = meeting_params[:start_time]\n duration_minutes = meeting_params[:duration_minutes]\n\n p name\n p course_id\n\n p start_date\n start_date.gsub! '/', '-'\n p start_date\n members = Array.new\n meeting_params.keys.each do |key|\n if key.include?('member')\n members << meeting_params[key]\n meeting_params.delete(key) \n end\n #p key\n end \n p members\n begin\n p \"are we ok?\"\n response = RestClient.post 'https://gtcollab.herokuapp.com/api/meetings/', { :name => name, course: course_id, :location => location,\n :description => description, :start_date => start_date, :start_time => start_time, :duration_minutes => duration_minutes, members: members }, {authorization: $token}\n \n p \"are we ok?\"\n objArray = JSON.parse(response.body)\n p objArray\n p \"are we ok?\"\n\n rescue => e\n p \"are we not ok?\"\n p e.response.body\n end\n\n #puts response.body\n # IF success\n # group_path(id) ##### NEEDS TO BE CREATED FIRST\n # else\n redirect_to course_path(:id => course_id)\n # end\n\n\n # respond_to do |format|\n # if @meeting.save\n # format.html { redirect_to @meeting, notice: 'Meeting was successfully created.' }\n # format.json { render :show, status: :created, location: @meeting }\n # else\n # format.html { render :new }\n # format.json { render json: @meeting.errors, status: :unprocessable_entity }\n # end\n # end\n end", "title": "" }, { "docid": "7c0c0b78bcd78c1faad84773a35af57c", "score": "0.59055567", "text": "def new\n @meeting_participant = MeetingParticipant.new\n\n respond_to do |format|\n format.xml { render :xml => @meeting_participant }\n end\n end", "title": "" }, { "docid": "e85163b78c4497f1e629ea2e9eced4fb", "score": "0.590441", "text": "def create\n # create new meeting\n @meeting = current_user.meetings.new(meeting_params)\n # new meeting status as unconfirmed\n @meeting.confirm = false\n # add date and time from params to ruby datetime format\n @meeting.time = (meeting_params[:meetingdate] + \" \" + @meeting.time.hour.to_s + \":\" [email protected]_s + \":00\").to_datetime\n # create new join table record\n @usermeetings = Usermeeting.new\n @usermeetings.user_id = current_user.id\n @usermeetings.owner = true\n # create new post\n @post = Post.new\n @post.description = meeting_params[:description]\n @post.user_id = current_user.id\n\n respond_to do |format|\n if @meeting.save\n @usermeetings.meeting_id = @meeting.id\n @usermeetings.save\n @post.meeting_id = @meeting.id\n @post.save\n\n format.html { redirect_to @meeting, notice: 'Meeting was successfully created.' }\n format.json { render :show, status: :created, location: @meeting }\n else\n format.html { render :new }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "05d1e24d9affe4f6a423d31655594a95", "score": "0.5899043", "text": "def create\n @user = current_user\n @meeting = @user.meetings.new(meeting_params)\n @meeting.user_id = current_user.id\n if @meeting.save\n redirect_to @meeting, notice: 'Meeting was successfully created.'\n else\n render :new\n end\n end", "title": "" }, { "docid": "b8fb4a2daf6c486c53595b9db068a8f5", "score": "0.58880705", "text": "def create_meeting(user_id:, params:)\n parse(JSON.parse(connection.post(\"users/#{user_id}/meetings\", params.to_json).body))\n end", "title": "" }, { "docid": "7469bdd21911fabcabfada1e3442cec4", "score": "0.5887618", "text": "def new\n @meeting = Meeting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @meeting }\n end\n end", "title": "" }, { "docid": "7469bdd21911fabcabfada1e3442cec4", "score": "0.5887618", "text": "def new\n @meeting = Meeting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @meeting }\n end\n end", "title": "" }, { "docid": "7469bdd21911fabcabfada1e3442cec4", "score": "0.5887618", "text": "def new\n @meeting = Meeting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @meeting }\n end\n end", "title": "" }, { "docid": "7469bdd21911fabcabfada1e3442cec4", "score": "0.5887618", "text": "def new\n @meeting = Meeting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @meeting }\n end\n end", "title": "" }, { "docid": "b32b32f25600ae8080f7ccffa77b317d", "score": "0.587114", "text": "def create\n @atendee = Atendee.new(atendee_params)\n respond_to do |format|\n if @atendee.save\n format.html { redirect_to @atendee, notice: 'Atendee was successfully created.' }\n format.json { render :show, status: :created, location: @atendee }\n else\n @users = User.all\n @meetings = Meeting.all\n format.html { render :new }\n format.json { render json: @atendee.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6ad58cb1e13e9c8bb4dd99752600b363", "score": "0.5843011", "text": "def index\n @meetings = Meeting.all\nend", "title": "" }, { "docid": "18dd90dd4e18d4bb28f9a1599f0efe2f", "score": "0.5841399", "text": "def create\n @meeting_task = MeetingTask.new(params[:meeting_task])\n\n respond_to do |format|\n if @meeting_task.save\n format.html { redirect_to @meeting_task, notice: 'Meeting task was successfully created.' }\n format.json { render json: @meeting_task, status: :created, location: @meeting_task }\n else\n format.html { render action: \"new\" }\n format.json { render json: @meeting_task.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1faa0ead740cb847890369fa391fa43d", "score": "0.58267796", "text": "def start_new_meeting(body = { \"startWithPersonalUrl\": false })\n payload = @options.dup\n payload[:body] = body.to_json\n self.class.post('/meetings/start', payload)\n end", "title": "" }, { "docid": "b86789518f07428b451652dca7eab0b0", "score": "0.5819306", "text": "def create\n @meeting = Meeting.new(meeting_params)\n build_dates_attributes\n respond_to do |format|\n if @meeting.save\n format.js { render js: 'window.location.reload()' }\n format.json { render :show, status: :created, location: @meeting }\n else\n format.js {\n }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e90bdb9e0e817cb04a8fe4c002711cf3", "score": "0.58149123", "text": "def meeting_params\n params.require(:meeting).permit(:name, :description, :location, :start, :finish, :required, :verified)\n end", "title": "" }, { "docid": "0205e371f3ca52ac40d513a99e830ae7", "score": "0.5814804", "text": "def create\n @group_meeting = GroupMeeting.new(group_meeting_params)\n\n respond_to do |format|\n if @group_meeting.save\n format.html { redirect_to @group_meeting, notice: 'Group meeting was successfully created.' }\n format.json { render :show, status: :created, location: @group_meeting }\n else\n format.html { render :new }\n format.json { render json: @group_meeting.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b08de449b27734faf688c370625bed3a", "score": "0.58063126", "text": "def create\n @hack_meet = HackMeet.new(hack_meet_params)\n\n respond_to do |format|\n if @hack_meet.save\n format.html { redirect_to hack_meets_url, notice: 'Hack meet was successfully created.' }\n format.json { render action: 'show', status: :created, location: @hack_meet }\n else\n format.html { render action: 'new' }\n format.json { render json: @hack_meet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fcf946f7ddca8f8576d0b5ba4a6574b0", "score": "0.5792087", "text": "def create\n @meetings_topic = MeetingsTopic.new(meetings_topic_params)\n\n respond_to do |format|\n if @meetings_topic.save\n format.html { redirect_to @meetings_topic, notice: 'Meetings topic was successfully created.' }\n format.json { render :show, status: :created, location: @meetings_topic }\n else\n format.html { render :new }\n format.json { render json: @meetings_topic.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fd8ad0d0788d3f5f2e6542c9351929d6", "score": "0.57810074", "text": "def create\n @meetup_event = MeetupEvent.new(meetup_event_params)\n\n respond_to do |format|\n if @meetup_event.save\n format.html { redirect_to @meetup_event, notice: 'Meetup event was successfully created.' }\n format.json { render :show, status: :created, location: @meetup_event }\n else\n format.html { render :new }\n format.json { render json: @meetup_event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1cabf5febfb546ed682466e33b00d256", "score": "0.5771909", "text": "def fetch_meetings\n response = self.api.get_meetings\n\n # updates the information in the rooms that are currently in BBB\n @meetings = []\n response[:meetings].each do |attr|\n room = OnlineMeetingRoom.find_by_server_id_and_meetingid(self.id, attr[:meetingID])\n if room.nil?\n room = OnlineMeetingRoom.create(:server => self, :meetingid => attr[:meetingID],\n :name => attr[:meetingID], :attendee_password => attr[:attendeePW],\n :moderator_password => attr[:moderatorPW], :external => true,\n :randomize_meetingid => false)\n else\n room.update_attributes(:attendee_password => attr[:attendeePW],\n :moderator_password => attr[:moderatorPW])\n end\n room.running = attr[:running]\n\n # TODO What if the update/save above fails?\n\n @meetings << room\n end\n end", "title": "" }, { "docid": "87d61f5eb08f4c76374014adad2bcc4d", "score": "0.57675356", "text": "def create\n @swim_meet = SwimMeet.new(swim_meet_params)\n\n respond_to do |format|\n if @swim_meet.save\n format.html { redirect_to @swim_meet, notice: 'Swim meet was successfully created.' }\n format.json { render action: 'show', status: :created, location: @swim_meet }\n else\n format.html { render action: 'new' }\n format.json { render json: @swim_meet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8bde5841d84c3126de88dffd50cc7500", "score": "0.576695", "text": "def create\n @instance = Instance.find(params[:meeting][:instance_id])\n @meeting = Meeting.new(meeting_params)\n @groups = @instance.available_groups\n if @meeting.save\n flash[:notice] = \"New meeting successfully added.\"\n @object = @meeting.instance\n end\n respond_with( @meeting, layout: !request.xhr? )\n end", "title": "" }, { "docid": "4ea0a441bf1b1013ed718561c7566cf6", "score": "0.5759882", "text": "def create\n @meetup_event = MeetupEvent.new(params[:meetup_event])\n\n respond_to do |format|\n if @meetup_event.save\n format.html { redirect_to @meetup_event, notice: 'Meetup event was successfully created.' }\n format.json { render json: @meetup_event, status: :created, location: @meetup_event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @meetup_event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4ea0a441bf1b1013ed718561c7566cf6", "score": "0.5759882", "text": "def create\n @meetup_event = MeetupEvent.new(params[:meetup_event])\n\n respond_to do |format|\n if @meetup_event.save\n format.html { redirect_to @meetup_event, notice: 'Meetup event was successfully created.' }\n format.json { render json: @meetup_event, status: :created, location: @meetup_event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @meetup_event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2673d7aadf0925893ccc0772b153ed5e", "score": "0.57564396", "text": "def create\n respond_to do |format|\n if @talk_attendee.save\n flash[:notice] = 'Successfully signed up to talk.'\n format.html { redirect_to(@talk.conference) }\n format.xml { render :xml => @talk_attendee, :status => :created, :location => @talk }\n else\n flash[:error] = 'Error signing up to talk.'\n format.html { redirect_to(@talk.conference) }\n format.xml { render :xml => @talk_attendee.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4d99e043f54c090721ce0f39837084fc", "score": "0.5755802", "text": "def create\n @user_meeting = UserMeeting.new(params[:user_meeting])\n\n respond_to do |format|\n if @user_meeting.save\n format.html { redirect_to @user_meeting, notice: 'User meeting was successfully created.' }\n format.json { render json: @user_meeting, status: :created, location: @user_meeting }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user_meeting.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "65c07564875066a1f0ae37488cdd2ea1", "score": "0.57514936", "text": "def meet_params\n params[:meet].permit(:name, :start_date, :end_date, :race_days)\n end", "title": "" }, { "docid": "7cc9afd64635ebcf1292336f98968bc4", "score": "0.5749284", "text": "def meeting_params\n params.require(:meeting).permit(:title, :meetDate, :isVirtual, :client_id, :user_ids)\n end", "title": "" }, { "docid": "dfc85538ba282dd13a5e560bf50fea88", "score": "0.5749099", "text": "def index\n @meetings = @grade.meetings.all\n \n respond_with(@institution, @grade, @meetings)\n end", "title": "" }, { "docid": "520eaf3905aa4269196ced2e58c12854", "score": "0.57318634", "text": "def create\n @weekly_meeting = WeeklyMeeting.new(weekly_meeting_params)\n\n respond_to do |format|\n if @weekly_meeting.save\n format.html { redirect_to @weekly_meeting, notice: 'Weekly meeting was successfully created.' }\n format.json { render json: @weekly_meeting, status: :created, location: @weekly_meeting }\n else\n format.html { render action: \"new\" }\n format.json { render json: @weekly_meeting.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5bf9edba3cd4aa285b82fdd87339c58d", "score": "0.57266223", "text": "def index\n @meetings = Meeting.load\n end", "title": "" }, { "docid": "325401483837d76933d2620c32b33d5b", "score": "0.57239336", "text": "def create\n @meeting_point = MeetingPoint.new(meeting_point_params)\n\n respond_to do |format|\n if @meeting_point.save\n format.html { redirect_to @meeting_point, notice: 'Meeting point was successfully created.' }\n format.json { render :show, status: :created, location: @meeting_point }\n else\n format.html { render :new }\n format.json { render json: @meeting_point.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
9c931dda2554aee40209be0f15241ca4
GET /elements or /elements.json
[ { "docid": "85efa2ad26a903342cb7147fbab7d39f", "score": "0.6146962", "text": "def index\n @elements = Element.all\n end", "title": "" } ]
[ { "docid": "26dbbeff2f146b457c39e36d441cb342", "score": "0.71765834", "text": "def index\n @elements = Element.all\n render json: @elements\n end", "title": "" }, { "docid": "a8e7de780f2dc583406d52b8d450f5d4", "score": "0.7044289", "text": "def index\n @elements = Element.all\n\n render json: @elements\n end", "title": "" }, { "docid": "8ad61d96fbd88981f7e22b7f23a14016", "score": "0.69210535", "text": "def index\n @elements = @template.elements.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @elements }\n end\n end", "title": "" }, { "docid": "8003443a2be992aee20e7e508a38c0bc", "score": "0.68661755", "text": "def index\n #Element.all is fine for small sets of data, for larger sets pagination would be best\n @elements = data_cache(\"page-#{params[:page_id]}-elements\", 10.minutes) do\n Element.all\n end\n respond_to do |format|\n format.json { render action: 'index', status: :ok, location: api_page_elements_url(@elements) }\n format.xml { render xml: @elements, location: api_page_elements_url(@elements) }\n end\n end", "title": "" }, { "docid": "78e0ed84b4a65e1e3ebd3cc8c8e23bfc", "score": "0.67236644", "text": "def show\n @element = Element.find(params[:id])\n render json: @element\n end", "title": "" }, { "docid": "6515aa4861c08081bbcd12fa7f6e50e8", "score": "0.6712077", "text": "def index\n @elements = @post.elements.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @elements }\n end\n end", "title": "" }, { "docid": "b4c1fd8245724a64545f48f9d69d8217", "score": "0.6696125", "text": "def show\n #Elements are likely to change more frequently than pages so 10 min should be good\n @element = data_cache(\"element-#{@element.id}\", 10.minutes) do\n Element.find(params[:id])\n end\n respond_to do |format|\n format.json { render action: 'show', status: :ok, location: api_page_element_url(params[:page_id], @element) }\n format.xml { render xml: @element, location: api_page_element_url(params[:page_id], @element) }\n end\n end", "title": "" }, { "docid": "695d78b68dc5105e6dda8d02f34fc19a", "score": "0.6666998", "text": "def show\n @element = Element.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @element }\n end\n end", "title": "" }, { "docid": "695d78b68dc5105e6dda8d02f34fc19a", "score": "0.6666998", "text": "def show\n @element = Element.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @element }\n end\n end", "title": "" }, { "docid": "5909ec19b760f62d0ce6e042d7f38586", "score": "0.6633995", "text": "def index\n # @elements = Element.all\n elements_json = ElementSerializer.new(Sketch.elements).serialized_json\n render json: elements_json\n end", "title": "" }, { "docid": "27bedd91419d898145fd86ef9280f609", "score": "0.66152006", "text": "def index\n @elements = Element.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @elements }\n end\n end", "title": "" }, { "docid": "9c659cdc16d80120e89d598feef0a3d4", "score": "0.6474966", "text": "def a_get_elements(path, query: nil)\n config = Symplectic::Elements::Api.config\n \n a_request(:get, config[:api_root] + path)\n .with(query: query, basic_auth: [config[:username], config[:password]],\n headers: { 'Accept'=>'*/*', 'User-Agent'=>'Faraday v0.9.2' })\nend", "title": "" }, { "docid": "d5911aabe4aaaa261ab2d64bda50b81b", "score": "0.6465986", "text": "def show\n @elemento = Elemento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @elemento }\n end\n end", "title": "" }, { "docid": "b54a7beab6a9192b4a690c75a130c5f8", "score": "0.63570166", "text": "def index\n @elements = Element.all\n end", "title": "" }, { "docid": "852c63e82f5be16f8a45d0fa6fee5a05", "score": "0.6307617", "text": "def show\n @element = @post.elements.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @element }\n end\n end", "title": "" }, { "docid": "1401368fad4a64ef6a59fd3b72e8b0e4", "score": "0.62871546", "text": "def element_read type='all'\n case type\n when 'all'\n render :content => { :data => { 'page_not_found' => ElementRead.new(@env).all } }\n end\n end", "title": "" }, { "docid": "2ebfac825dc452db759fe83fd29961c4", "score": "0.62615424", "text": "def show\n @element = Element.where(id: params[:id]).includes(*element_includes).first\n authorize! :show, @element\n respond_with @element\n end", "title": "" }, { "docid": "d185bd5bf67d92870f0c72dcf7f811a0", "score": "0.6243805", "text": "def show\n @page = @element.page\n @options = params[:options]\n\n respond_to do |format|\n format.html\n format.js { @container_id = params[:container_id] }\n format.json do\n render json: @element.to_json(\n only: [:id, :name, :updated_at],\n methods: [:tag_list],\n include: {\n contents: {\n only: [:id, :name, :updated_at, :essence_type],\n methods: [:ingredient],\n include: {\n essence: {\n except: [:created_at, :creator_id, :do_not_index, :public, :updater_id]\n }\n }\n }\n }\n )\n end\n end\n end", "title": "" }, { "docid": "1630e37ada30b42942c00bccb3a5e5ce", "score": "0.62360424", "text": "def show\n @page = @element.page\n @options = params[:options]\n\n respond_to do |format|\n format.html\n format.js { @container_id = params[:container_id] }\n format.json do\n render json: @element.to_json(\n only: [:id, :name, :updated_at],\n methods: [:tag_list],\n include: {\n contents: {\n only: [:id, :name, :updated_at, :essence_type],\n methods: [:ingredient],\n include: {\n essence: {\n except: [:created_at, :creator_id, :public, :updater_id]\n }\n }\n }\n }\n )\n end\n end\n end", "title": "" }, { "docid": "aa67f8e0e754369ad83125d911020ffe", "score": "0.61779326", "text": "def all\n get @endpoint\n end", "title": "" }, { "docid": "bee835f3455f6cde17cd94fbe9ae0f83", "score": "0.61746037", "text": "def show\n render json: @element\n end", "title": "" }, { "docid": "6e2b50488e56334c66d4d865c2dd15b9", "score": "0.61133754", "text": "def index\n @element_types = ElementType.all\n\n render json: @element_types\n end", "title": "" }, { "docid": "2fec6fc3d1ded67eb23b74ade07ac479", "score": "0.6080635", "text": "def show\n @page_element = PageElement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @page_element }\n end\n end", "title": "" }, { "docid": "8fd94f7f9896aae20efc5a76d192ad6d", "score": "0.60733986", "text": "def all\n get @endpoint\n end", "title": "" }, { "docid": "8fd94f7f9896aae20efc5a76d192ad6d", "score": "0.60733986", "text": "def all\n get @endpoint\n end", "title": "" }, { "docid": "8fd94f7f9896aae20efc5a76d192ad6d", "score": "0.60733986", "text": "def all\n get @endpoint\n end", "title": "" }, { "docid": "1e68023fdbbfb5460201bb29e7b959b2", "score": "0.60684687", "text": "def show\n render json: @element_type\n end", "title": "" }, { "docid": "769a6e0ea07292cb5714e6a90826d9da", "score": "0.6068078", "text": "def list\n get('/')\n end", "title": "" }, { "docid": "b89e1cd893b51c5fb34cc3d3b1a80464", "score": "0.60605085", "text": "def index\n @elems = Elem.all\n end", "title": "" }, { "docid": "6143f22d20c50abeb21d1742357e63ca", "score": "0.6036247", "text": "def show\n @element = @view.elements.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @element }\n end\n end", "title": "" }, { "docid": "53924a21dc6554a2a681d9707e8fb79f", "score": "0.60310185", "text": "def index\n @material = Material.find(params[:material_id])\n @material_elements = @material.material_elements.all\n\n respond_to do |format|\n format.html # index.html.erb\n @material_elemens = []\n format.json do\n @material_elements = @material_elements.select do |element|\n elemend = {}\n element.attributes.each do |key, value|\n elemend[key] = value\n end\n elemend[:element_name] = CommonActions.linkable(element_path(element.element), element.element.element_name)\n elemend[:element_symbol] = element.element.element_symbol\n\n if can? :edit, MaterialElement\n\n elemend[:links] = CommonActions.object_crud_paths(material_material_element_path(@material, element),\n edit_material_material_element_path(@material, element),\n material_material_element_path(@material, element))\n else\n elemend[:links] = CommonActions.object_crud_paths(material_material_element_path(@material, element),\n nil,\n nil)\n end\n @material_elemens.push(elemend)\n end\n render json: { aaData: @material_elemens }\n end\n end\n end", "title": "" }, { "docid": "d0c2d8c0cf292f54bdd0b90502b2a0dc", "score": "0.5958415", "text": "def show\n @element_type = ElementType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @element_type }\n end\n end", "title": "" }, { "docid": "02a7542e8d4e2349a0752851bc9bdcfe", "score": "0.5955783", "text": "def show\n @element_experiment = ElementExperiment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @element_experiment }\n end\n end", "title": "" }, { "docid": "fe73c79e69563bc2345dd25437f194c1", "score": "0.5945982", "text": "def show\n @scraping_element = ScrapingElement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @scraping_element }\n end\n end", "title": "" }, { "docid": "46e8fe8efd00c93deb21ac3440e0851f", "score": "0.59268415", "text": "def read\n url = @url_helper.entity_collection_url(with_query: true)\n request(:get, url)\n end", "title": "" }, { "docid": "c2c6c7fb0c49180e9474b8eff2409fd5", "score": "0.5878682", "text": "def lists\n\tget('/lists.json')\nend", "title": "" }, { "docid": "bee4686c50abf14ca2e08a6847589dae", "score": "0.5853636", "text": "def index\n @elementos = Elemento.all\n end", "title": "" }, { "docid": "41fb399ea7ede8ed6e962af148d228b8", "score": "0.58455807", "text": "def get\n client.get(url)\n end", "title": "" }, { "docid": "b7ec33e3866a751b3a0497b5ececd592", "score": "0.5816109", "text": "def index ## Search\n @elements = Element.search(params[:search])\n @element = Element.new() if @elements.empty?\n logger.debug \">>> element = #{@element.attributes} # in 'index' of 'ElementsController'\" if @elements.empty?\n \n render 'pages/index'\n end", "title": "" }, { "docid": "8fe2d6ec8a1d47ca8c318cf923eb35b7", "score": "0.5803748", "text": "def orders\n client.get \"orders\"\n end", "title": "" }, { "docid": "9c1d3157b4e68ece441309e39130e1b0", "score": "0.5784997", "text": "def show\n @context_element = ContextElement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @context_element }\n end\n end", "title": "" }, { "docid": "3fd56edd39c6942b87ee243dd8f04cbc", "score": "0.5740895", "text": "def nodes\n get 'nodes'\n end", "title": "" }, { "docid": "a03773236ee2254a5a7e595edc7504e3", "score": "0.573836", "text": "def index\n @content_elements = Page.find(params[:page_id]).content_elements\n \n respond_to do |format|\n format.json { render :json => @content_elements }\n format.xml { render :xml => @content_elements }\n end\n end", "title": "" }, { "docid": "6f9c08e7f8bae206f89112f227c7d503", "score": "0.5735265", "text": "def index\n @title = \"All Edges\"\n @edges = Edge.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @edges }\n end\n end", "title": "" }, { "docid": "0018a9a547b20cd7a770a6e2cd109f33", "score": "0.57090956", "text": "def orders\n get(\"orders\")\n end", "title": "" }, { "docid": "12110cd241fdbe68ecee9aa4dae7d8a5", "score": "0.5706962", "text": "def get\n client.get(endpoint_url)\n end", "title": "" }, { "docid": "12110cd241fdbe68ecee9aa4dae7d8a5", "score": "0.5706962", "text": "def get\n client.get(endpoint_url)\n end", "title": "" }, { "docid": "bda122b471b21e439d9785f7d57fb5f3", "score": "0.57065743", "text": "def show\n respond_to do |format|\n format.json { render :json => @content_element }\n format.xml { render :xml => @content_element }\n end\n end", "title": "" }, { "docid": "ab181c97cc1fec10ed6688d229ddad19", "score": "0.5698806", "text": "def index\n @thingies = Thingie.all\n respond_to do |format|\n format.html\n format.json { render json: @thingies}\n format.xml { render xml: @thingies}\n end\n end", "title": "" }, { "docid": "86ae27f3b20736650d265864465a8968", "score": "0.56968945", "text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @complexes }\n format.json { render :text => get_json }\n end\n end", "title": "" }, { "docid": "3b97b13eaf1e5dd27f1a04d64ef558af", "score": "0.5693536", "text": "def index\r\n @edges = Edge.all\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @edges }\r\n end\r\n end", "title": "" }, { "docid": "ea1160ccde70c59a50822c01aa8e24e2", "score": "0.5680113", "text": "def index\n @explorers = Explorer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @explorers }\n end\n end", "title": "" }, { "docid": "e7c72511d2a1bbd83dc1e20ee93ed16c", "score": "0.56800604", "text": "def index(parameters = nil)\n return @client.get(add_parameters_to_uri(@resource_uri, parameters))\n end", "title": "" }, { "docid": "3dcc074999a0b89cb946c5b0a1b901ce", "score": "0.5674287", "text": "def entities\n perform_get('/entities')\n end", "title": "" }, { "docid": "34d5e212ced05b20683d44801c163719", "score": "0.56738454", "text": "def rest\n episodes = Episode.visible.offset(params[:offset] || DEFAULT_PER_PAGE).all\n list = render_to_string partial: \"episodes/mixed\", collection: episodes\n\n render json: { episodes: list }\n end", "title": "" }, { "docid": "7a2ce0c5eaf1cbad7f138cbabed96792", "score": "0.5665111", "text": "def get(path, options={}); self.class.get(path, options).parsed_response end", "title": "" }, { "docid": "87d2e89fd7b40ecdf349e105e4893b5d", "score": "0.56609815", "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": "6c8b2d6488928caa5148db7b2bc05c84", "score": "0.5652342", "text": "def show\n @elemento = Elemento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @elemento }\n end\n end", "title": "" }, { "docid": "765eaf3771d1036dc77addc858496e0b", "score": "0.5640767", "text": "def index()\n method_url = @resource\n return self.get(method_url)\n end", "title": "" }, { "docid": "765eaf3771d1036dc77addc858496e0b", "score": "0.5640767", "text": "def index()\n method_url = @resource\n return self.get(method_url)\n end", "title": "" }, { "docid": "f9a186f34ae00cbc2e5b3bdcfeab0d81", "score": "0.56323624", "text": "def index\n @pm_elements = PmElement.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pm_elements }\n end\n end", "title": "" }, { "docid": "ccac957d7b26d00c816f54dfeb4d6f33", "score": "0.5631313", "text": "def show\n @ep = Ep.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ep }\n end\n end", "title": "" }, { "docid": "bb518d422e16d000ef051c45557bb5b0", "score": "0.5623241", "text": "def index\n @tees = Tee.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tees }\n end\n end", "title": "" }, { "docid": "c25aabf91532b47eda4117fb7d2fcaaf", "score": "0.5619553", "text": "def listing(options={})\n path = \"\"\n options= {:query =>options}\n OodleResponse.from_xml(get(path, options))\n end", "title": "" }, { "docid": "cd708aa99c1333dd0c57a0c917997ee6", "score": "0.5618076", "text": "def show\n @mostsmallelement = Mostsmallelement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mostsmallelement }\n end\n end", "title": "" }, { "docid": "502e0b74d540fda6175e0828d6baa3eb", "score": "0.56168944", "text": "def show\n if params[:id]\n @content = Content.where(id: params[:id]).includes(:essence).first\n elsif params[:element_id] && params[:name]\n @content = Content.where(\n element_id: params[:element_id],\n name: params[:name],\n ).includes(*content_includes).first || raise(ActiveRecord::RecordNotFound)\n end\n authorize! :show, @content\n respond_with @content\n end", "title": "" }, { "docid": "9dbd6f5600bc7fd2552a1193b2a124cf", "score": "0.56139195", "text": "def get(url, options={})\n resp = RestClient.get url, get_options(options)\n Representation.new hal_client: self, parsed_json: MultiJson.load(resp)\n end", "title": "" }, { "docid": "39c3a72235c2898e12c89280da207ab3", "score": "0.5610108", "text": "def get(path='')\n \t Element.get(@element, path)\n end", "title": "" }, { "docid": "ab78e1e430014eb3b1b2898d82df8cc0", "score": "0.5607593", "text": "def index\n puts params.inspect\n @digital_objects = JSON[access_token.get(\"/api/v1/digital_objects/my\").body]\n @tags_obj = JSON[access_token.get(\"/api/v1/tags\").body]\n @contacts = JSON[access_token.get(\"/api/v1/contacts\").body]\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @digital_objects }\n end\n end", "title": "" }, { "docid": "62c41299f3dd7071176edde163ba7818", "score": "0.56051725", "text": "def list_floor_plans \n get(\"/files.json/floorplan/images\")\nend", "title": "" }, { "docid": "654975a799fec411113504e18e827633", "score": "0.56002605", "text": "def index\n @equipment = Equipment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @equipment }\n end\n end", "title": "" }, { "docid": "654975a799fec411113504e18e827633", "score": "0.56002605", "text": "def index\n @equipment = Equipment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @equipment }\n end\n end", "title": "" }, { "docid": "90da0a38cfe63cc3f5b801116b106804", "score": "0.5593206", "text": "def get(*args); self.resource.get(*args) end", "title": "" }, { "docid": "792ae75e3bbf73c4108df9f9a2c23ee4", "score": "0.55850655", "text": "def get_response_body(element_url)\n response = RestClient.get(element_url)\n JSON.parse(response)\nend", "title": "" }, { "docid": "8d8d5df75e5310866d1a16583b82b708", "score": "0.5576391", "text": "def get(path='')\n Element.get(@element, path)\n end", "title": "" }, { "docid": "881fc56bbc9f3a8485bd025f2619fce5", "score": "0.55755925", "text": "def get_alert_summary \n get(\"/alerts.json/summary\")\nend", "title": "" }, { "docid": "37165a6dd63bcfd6eec7422e3769fb3d", "score": "0.5572784", "text": "def all\n get(all_path)\n end", "title": "" }, { "docid": "b6b93dc022ed0d53ef0d20859d99112b", "score": "0.55621946", "text": "def entries opts = {}\n get :entry, opts\n end", "title": "" }, { "docid": "addbbf8f58dcaf9f4a245bed4e34ecc1", "score": "0.5562097", "text": "def get(endpoint)\n client.get(endpoint)\n end", "title": "" }, { "docid": "addbbf8f58dcaf9f4a245bed4e34ecc1", "score": "0.5562097", "text": "def get(endpoint)\n client.get(endpoint)\n end", "title": "" }, { "docid": "70d9d8a86d229835c7d8fb51685c69e5", "score": "0.55514246", "text": "def index\n @nodes = Node.all\n respond_with(@nodes) do |format|\n format.json { render :json => @nodes.as_json }\n end\n end", "title": "" }, { "docid": "77a1d3e486268772863d6922fb51ab9a", "score": "0.55499053", "text": "def list\n JSON.parse get(\"list/json\")\n end", "title": "" }, { "docid": "3094ebcfb3ddde7cc9d156225bcab0d1", "score": "0.5548543", "text": "def get(options = {})\n self.get_all(options)\n end", "title": "" }, { "docid": "82ffd3e0671164a2beab1fa68f1ba57f", "score": "0.5547626", "text": "def list\n url = @uri + \"?api-version=#{api_version}\"\n url\n end", "title": "" }, { "docid": "068461f912e8021968c95f90458db1f9", "score": "0.5545879", "text": "def index\n @examples = Example.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @examples }\n end\n end", "title": "" }, { "docid": "1625d9b494921428054537515df68ddd", "score": "0.55449414", "text": "def read\n Seaweed::HTTP.get url\n end", "title": "" }, { "docid": "c2e4bb4a9223be7e0e4fa85cde60015c", "score": "0.5539112", "text": "def index\n @devices = Device.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @devices }\n end\n end", "title": "" }, { "docid": "968191986418b456770b6f6644ebf9d9", "score": "0.55380946", "text": "def get(path)\n api :get, path\n end", "title": "" }, { "docid": "1ad0d7f998b74701f98eae6bda4fa0e1", "score": "0.5533874", "text": "def index\n\n # @celebs = Celeb.page params[:page]\n\n #respond_to do |format|\n # format.html # index.html.erb\n # format.json { render json: @celebs }\n #end\n end", "title": "" }, { "docid": "d025d0a2d51a7dffbddc2d41d310f1a9", "score": "0.5532846", "text": "def children\n id = params[:id]\n if id == \"\"||id.nil?\n @elements = Element.roots\n else\n @elements = (Element.exists?(id)) ? Element.find(id).children : nil\n end\n respond_to do |format|\n format.json\n end\n end", "title": "" }, { "docid": "26e0a35a3fdd3997f7e63bb7844b4310", "score": "0.55286336", "text": "def list(*args)\n options = args.last.is_a?(Hash) ? args.pop : {}\n id = args.first\n response = get \"#{ENDPOINT}/#{id}/\", options\n response.body\n end", "title": "" }, { "docid": "a9314a43697b21f2e7adb43b04996065", "score": "0.5521208", "text": "def index\n @articles = Article.all_detailed\n render_json_for_api @articles\n end", "title": "" }, { "docid": "78ee0b4ee909d0e612fffa492b8b9a77", "score": "0.55182475", "text": "def index\n respond_to do |format|\n format.html \n format.json { render :text => get_json }\n end\n end", "title": "" }, { "docid": "1d07f3d6710389b46ede0fb792825a17", "score": "0.5513722", "text": "def index\n api_method = 'products'\n path = Rails.configuration.MprProductsAPI.to_s + api_method.to_s\n @products = ActiveSupport::JSON.decode http_get(path).body\n @images = @products['images']\n @products = @products['product']\n # render json: @products\n\tend", "title": "" }, { "docid": "76bdca2846ac0334ebc6d4ec01927d8e", "score": "0.5513306", "text": "def index\n respond_with(collection) do |format|\n format.json { render :json => collection_as_json }\n end\n end", "title": "" }, { "docid": "3208821ad490795a4f067ad2aeacec93", "score": "0.5510289", "text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @majors }\n format.json { render :text => get_json }\n end\n end", "title": "" }, { "docid": "2b569184b9b50b46e2ae0935da6dfd36", "score": "0.5501731", "text": "def index\n respond_to do |format|\n format.html\n format.json\n format.json_api { render({ json: @nodes }.merge(api_collection_properties)) }\n end\n end", "title": "" }, { "docid": "0966a7f717101d4b4a36e2977ca0da13", "score": "0.55004805", "text": "def index\n @efectividads = Efectividad.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @efectividads }\n end\n end", "title": "" }, { "docid": "80d5984ff106d3b5a2e580233b568769", "score": "0.5500219", "text": "def head; get; end", "title": "" }, { "docid": "87480a7d0588c112e0e759a5b08b1053", "score": "0.5496764", "text": "def index\n @nodes = Node.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @nodes }\n end\n end", "title": "" } ]
35ebd59de1ec41deec7b9f44b672dbea
begin Gets the job departemnt using CSS selectors for the given page
[ { "docid": "752b27999683022ddafd7014c9c9c683", "score": "0.7430633", "text": "def get_department(page)\n page.css(WebScraper::JOB_INFO_SELECTOR)[WebScraper::JOB_DEPT_POS].content.strip\n end", "title": "" } ]
[ { "docid": "36eef9b886296b7002970de7a2a85865", "score": "0.6563119", "text": "def get_department_pages\n return [Nokogiri::HTML(open('https://www.sis.hawaii.edu/uhdad/avail.classes?i=MAN&t=201430&s=ICS')).css(\".listOfClasses\").to_s,\n Nokogiri::HTML(open('https://www.sis.hawaii.edu/uhdad/avail.classes?i=MAN&t=201430&s=MATH')).css(\".listOfClasses\").to_s,\n Nokogiri::HTML(open('https://www.sis.hawaii.edu/uhdad/avail.classes?i=MAN&t=201430&s=PSY')).css(\".listOfClasses\").to_s]\n end", "title": "" }, { "docid": "174fa55e295f23716171f37be07c869f", "score": "0.6309034", "text": "def scraper\n\turl = \"https://www.indeed.com/jobs?q=Ruby%20on%20Rails&l&vjk=ac03f2f61f05d2b8\"\n\tunparsed_page = HTTParty.get(url) if url\n\n\tparsed_page = Nokogiri::HTML(unparsed_page.body)\n\tjobs = Array.new\n\tjob_listings = parsed_page.css('td.resultContent')\n\t\n\t# starting page\n\tpage = 1\n\t# Get # of listings per page\n\tper_page =job_listings.size\n\t# Get total listings. \tsuper fragile clean up of the total\n\ttotalListings = parsed_page.css('div#searchCountPages').text.split(' ')[3].gsub(',','').to_i\n\tlast_page = (totalListings.to_f / per_page).round\n\n\t# Loop through pages see https://www.youtube.com/watch?v=b3CLEUBdWwQ&t=385s 26:30\n\tjob_listings.each do |job_listing|\n\t\tjob = {\n\t\t\ttitle: job_listing.css('div.singleLineTitle').text,\n\t\t\tcompany: job_listing.css('span.companyName').text,\n\t\t\tlocation: job_listing.css('div.companyLocation').text,\n\t\t\trating: job_listing.css('span.ratingsDisplay').text,\n\t\t\tsalary: job_listing.css('.salary-snippet-container').text\n\t\t}\n\t\tjobs << job\n\tend\n\tbyebug\nend", "title": "" }, { "docid": "e17277ad30538bdec56a163fcb200ed2", "score": "0.63053066", "text": "def get_course_page(department)\n puts Nokogiri::HTML(open(department[1])).css('table.listOfClasses')\n return Nokogiri::HTML(open(department[1])).css('table.listOfClasses')\n end", "title": "" }, { "docid": "3a804967865efdc941e5fabe3e918b3c", "score": "0.62378234", "text": "def printJobList(html)\n\n\tjobs = html.css('.job-item.job-item-posting')\n\n\tjobs.each do |job|\n\t \n\t #position title \n\t puts \"Position Title: #{job.at_css('td:first-child').text.strip}\"\n\n\t #working title\n\t puts \"Working Title: #{job.at_css('td:nth-child(2)').text.strip}\"\n\n\t #department\n\t puts \"Department: #{job.at_css('td:nth-child(3)').text.strip}\"\n\n\t #application deadline\n\t puts \"Application Deadline: #{job.at_css('td:nth-child(4)').text.strip}\"\n\t \n\t #target salary\n\t puts \"Salary: #{job.at_css('td:nth-child(6)').text.strip}\"\n\n\t #job description\n\t puts \"Description: #{job.at_css('.job-description').text.strip}\"\n\n\t #spacing\n\t puts \"\"\n\t puts \"------------------------------------------------------------\"\n\t puts \"\"\n\tend\n\nend", "title": "" }, { "docid": "15921bf3160870c43cce9134fa9f5b83", "score": "0.60583675", "text": "def get_des_qualifications(page)\n page.css(WebScraper::JOB_DETAILS_SELECTOR)[WebScraper::JOB_DES_QUAL_POS].content.strip\n end", "title": "" }, { "docid": "15e97e575a6665871b125b15d2d92433", "score": "0.5995277", "text": "def get_courses\n self.get_page.css(\".post\")\n end", "title": "" }, { "docid": "c22ca39a3c334988663452b7a455312f", "score": "0.5966547", "text": "def get_courses\n #use the method we created, and extract all info\n self.get_page.css(\".post\")\n end", "title": "" }, { "docid": "6f76fc1b1a07568bbe6d243e6c75a3c3", "score": "0.5954893", "text": "def get_departments(semester)\n departments = []\n doc = Nokogiri::HTML(open(semester[1]))\n doc.css('a').each do |a|\n departments.push([a.content,\n 'https://www.sis.hawaii.edu/uhdad/' +\n a.get_attribute('href')]) if a.get_attribute('href').include?(\"&s=\")\n end\n \n return departments\n end", "title": "" }, { "docid": "f3e53a84edd9f67b30b4390419f66579", "score": "0.5926305", "text": "def get_url\n page = Nokogiri::HTML(open(\"http://www2.assemblee-nationale.fr/deputes/liste/alphabetique\"))\n url_deputy = page.css(\"ul.col3 a\")\nend", "title": "" }, { "docid": "a6119a6271fb97d2defcc023c87f4cc4", "score": "0.5904508", "text": "def get_all_das_in_page(page)\n\n # Todo: For each element of the page that contains the Development Application, get Development Application Summary.\n\n # For example:\n\n page.search('table.ContentPanel tr[class$=ContentPanel]').each do |da_container|\n\n get_development_application(page, da_container)\n\n end\n\n \n\nend", "title": "" }, { "docid": "a6119a6271fb97d2defcc023c87f4cc4", "score": "0.5904508", "text": "def get_all_das_in_page(page)\n\n # Todo: For each element of the page that contains the Development Application, get Development Application Summary.\n\n # For example:\n\n page.search('table.ContentPanel tr[class$=ContentPanel]').each do |da_container|\n\n get_development_application(page, da_container)\n\n end\n\n \n\nend", "title": "" }, { "docid": "963664df8595834ea0e5c25636b17420", "score": "0.5858385", "text": "def parse_job(listing)\n\n # binding.pry\n\n title = listing.search('a.dice-btn-link')[0].text\n @employer_name = listing.search('li.employer .dice-btn-link')[0].text\n location = listing.search('li.location').text\n \n job_link = listing.search('a.dice-btn-link')[0].attributes[\"href\"].value.to_s\n\n relative_date = listing.search('li.posted').text\n date = parse_absolute_date(relative_date)\n \n employer_id = job_link.split('/')[-2]\n job_id = job_link.split('/')[-1]\n\n [\n date,\n title,\n @employer_name,\n location,\n job_link,\n employer_id,\n job_id\n ].map! { |text| text.gsub(/\\s+/, ' ').strip }\n end", "title": "" }, { "docid": "b078dadb3c8b597393a8be4b48611e52", "score": "0.58043665", "text": "def pull_data\n\tmechanize = Mechanize.new\n\n\tpage = mechanize.get('http://workinstartups.com/job-board/jobs/interns/')\n\tpage.search(\"ul.job-list li\").each do |x|\n str = x.to_s\n job = Job.new\n\n job.company = str[/at\\s(.*?)\\sin/m, 1]\n job.url = URI.extract(str).first\n job.role = x.at_css('a').text\n\n job.save\n end\nend", "title": "" }, { "docid": "1a66e7640f3f229b80a333f20cccbe58", "score": "0.5804114", "text": "def get_category(page)\n page.css(WebScraper::JOB_DETAILS_SELECTOR)[WebScraper::JOB_CAT_POS].content.strip\n end", "title": "" }, { "docid": "fff813adbe0f68e4960b89e1c19f917f", "score": "0.5768279", "text": "def fill_job_fields(page)\n job = WebScraper::Job.new\n get_basic_fields(page, job)\n url_ext = page.css(WebScraper::JOB_ACTIONS_SELECTOR)[WebScraper::FIRST][WebScraper::LINK_ATT]\n detail_page = @agent.get \"#{WebScraper::BASE_URL}#{url_ext}\"\n get_detailed_fields(detail_page, job)\n job\n end", "title": "" }, { "docid": "3366af733a92f13613023067ffc401ba", "score": "0.57550895", "text": "def get_courses_in_page(url)\n courses = []\n page = Nokogiri::HTML(open(url))\n course = ''\n section = ''\n department = url[url.rindex('=') + 1 ... url.length]\n \n page.css('td').each do |td|\n case td.content\n when /^#{department} \\d{3}.?$/\n course = td.content\n when /^\\d{3}$/\n section = td.content\n else \n end\n \n if !course.empty? && !section.empty?\n courses.push \"#{course}-#{section}\"\n course = ''\n section = ''\n end\n end\n \n return courses\n end", "title": "" }, { "docid": "5a1f3dec23e9116ed1b6ef83308a661f", "score": "0.5731848", "text": "def job_data\n fetch_data('https://www.themuse.com/api/public/jobs?&category=Engineering&category=Project+%26+Product+Management&level=Mid+Level&level=Entry+Level&location=Boston%2C+MA&location=New+York%2C+NY&location=San+Francisco%2C+CA&page=1&descending=true')[\"results\"]\nend", "title": "" }, { "docid": "5a04f335824d021a55ad1bf52fab3aa7", "score": "0.57013047", "text": "def find_jobs(agent, page)\n search_count = 0\n\n loop do\n # Strip html tags\n links = page.search \"//div//h3//a\"\n\n # Print jobs and links\n output_jobs(links) if links.length > 0\n\n # Update cumulative number of jobs\n search_count += links.length\n\n # Look to see if there are multiple pages\n nodes = page.xpath('//a[contains(@class, \"next_page\")]')\n\n break if nodes.empty?\n\n # Go to next page\n path = nodes.first['href']\n page = agent.get(\"https://www.jobsatosu.com#{path}\")\n sleep 1\n end\n search_count\nend", "title": "" }, { "docid": "9c790ef2e3918ce883e5b6ec9a2df513", "score": "0.56503236", "text": "def get_deputes_name\n\n deputes_name_array = []\n # Régister URL of the needed website\n page_url_deputes = \"http://www2.assemblee-nationale.fr/deputes/liste/alphabetique\"\n\n depute_page = Nokogiri::HTML(open(page_url_deputes))\n\n # From the website, get an array of the city name, convert it to string, put in downcase and replace \" \" to \"-\" if any space\n return deputes_name_array = depute_page.xpath(\"//*[contains(@id, 'deputes-list')]/div/ul/li/a/text()\").map {|x| x.to_s }\nend", "title": "" }, { "docid": "28a41cb9179d49fbefa61818a1d7d140", "score": "0.5623473", "text": "def get_city_list\r\n url = \r\n page = Nokogiri::HTML(URI.open('http://annuaire-des-mairies.com/val-d-oise.html'))\r\n citys = page.css('a.lientxt[href]').each {|city| @citys_list << city.text.downcase.gsub(' ', '-')}\r\nend", "title": "" }, { "docid": "5e0669eff75f3662cd6b1d3138e06909", "score": "0.5617661", "text": "def scrape_job_listings\n queries = [\"Rails+Developer\", \"front+end+Developer\", \"ruby+developer\", \"junior+web+Developer\", \"javascript+Developer\"]\n locations = [\"San+Francisco\"]\n\n locations.each do |location|\n queries.each do |query|\n scrape_indeed(query, location)\n scrape_github(query, location)\n # scrape_glassdoor(query, location)\n ; scrape_careerbuilder(query, location)\n end\n end\nend", "title": "" }, { "docid": "36a259f43242c9b65f1ab8582e6cbea6", "score": "0.55962795", "text": "def get_the_email_of_a_townhal_from_its_webpage(page , lien, n_ville)\n\tv_lien = \"\"\n\tpage.css('a[class = lientxt]').each{|y| v_lien = lien.slice(0..30) + y['href'].slice(1..(y['href'].to_s.length)) if y.text == n_ville}\n\tpage_2 = Nokogiri::HTML(open(v_lien))\n \tpage_2.css('td')[7].text\nend", "title": "" }, { "docid": "9a8f21ef584ec23e9ecf469201ce93db", "score": "0.55886954", "text": "def get_full_part(page)\n page.css(WebScraper::JOB_DETAILS_SELECTOR)[WebScraper::JOB_FULL_PART_POS].content.strip\n end", "title": "" }, { "docid": "2b6a51f45723855355580c2851a9b233", "score": "0.5573543", "text": "def get_all_das_in_page(page)\n # Todo: For each element of the page that contains the Development Application, get Development Application Summary.\n # For example:\n result = true\n page.search('table.ContentPanel tr[class$=ContentPanel]').each do |da_container|\n result = get_development_application(page, da_container)\n if !result\n return result\n end\n end\n return result\nend", "title": "" }, { "docid": "2b6a51f45723855355580c2851a9b233", "score": "0.5573543", "text": "def get_all_das_in_page(page)\n # Todo: For each element of the page that contains the Development Application, get Development Application Summary.\n # For example:\n result = true\n page.search('table.ContentPanel tr[class$=ContentPanel]').each do |da_container|\n result = get_development_application(page, da_container)\n if !result\n return result\n end\n end\n return result\nend", "title": "" }, { "docid": "6d8aa61ee5d80b68fc083f770ea15cec", "score": "0.55475676", "text": "def get_the_email_of_a_townhal_from_its_webpage\n emails = \"\"\n tab_url = Nokogiri::HTML(open('http://annuaire-des-mairies.com/95/vaureal.html'))\n tab_url.each do |url_commune|\n pages = Nokogiri::HTML(open(url_commune))\n email = pages.css(\".txt-primary\")[3].text.split(\" \")\n email = email[2]\n emails += email\n end\n return emails\nend", "title": "" }, { "docid": "d0651215cef2b81c406799ca66efed3e", "score": "0.55462176", "text": "def get_courses(page, info)\n page.search(\"#WebPartWPQ1\").each do |node|\n\n info[:period] = 0\n\n # För varje rad i tabellen:\n node.search(\"./div/div/table[3]//td\").each do |node|\n \n # Måste kolla efter läsperiod\n if node.text =~ /läsperiod/i\n info[:period] = node.text.match(/\\d/).to_s.to_i\n end\n \n # Vi kanske har en länk, isåfall vill vi spara kurshemsidan:\n node.search(\".//a\").each do |node|\n # Hämta kurshemsidan\n course_page = fetch_coursepage(make_absolute(node['href']))\n # Spara i databasen\n save_coursepage(node.text, course_page, info)\n end\n end\n end\nend", "title": "" }, { "docid": "cba96a7410731181104cbf69eac53f20", "score": "0.5546084", "text": "def get_prisoner_by_din(year, letter, sequence)\n visit \"/\"\n fill_in \"M00_DIN_FLD1I\", :with => year.to_s\n fill_in \"M00_DIN_FLD2I\", :with => letter.to_s\n fill_in \"M00_DIN_FLD3I\", :with => sequence.to_s\n click_button \"Submit\" \n\n # Did we hit an error page?\n error = page.all(\"p.err\").first\n raise ContentError, error.text if error.text.length > 0\n \n store = {} # A hash of data.\n\n tables = page.find(\"#content\").all(\"table\")\n\n # ID + Location info\n store.merge!(Hash[tables[0].all(\"th\").map { |x| x.text }.zip(tables[0].all(\"td\").map { |x| x.text })])\n\n # Sentence Terms and Release Dates\n store.merge!(Hash[tables[2].all(\"th\").map { |x| x.text }.zip(tables[2].all(\"td\").map { |x| x.text })])\n\n # Crimes of Conviction\n crimes = { \"crimes\" => {} }\n crimes[\"crimes\"] = Hash[tables[1].all(\"td[headers=crime]\").map { |x| x.text }.zip(tables[1].all(\"td[headers=class]\").map { |x| x.text })]\n store.merge!(crimes) \n \n return store\n end", "title": "" }, { "docid": "70cf9cebc5e1aa8bb0dd43f543e626d6", "score": "0.55455005", "text": "def get_cities\n cities = {}\n doc = nil\n retry_if_exception do\n doc = Nokogiri::HTML( easy_curl(@host_url) )\n end\n return [] if not doc\n a_cities = doc.css(\"ul[class='s-dropdown afh-dd-city'] li a\")\n a_cities.each do |city|\n city_name = city.text\n city_code = city['href'].scan(/\\w+(?=\\/changecity)/).pop\n next if not city_code\n cities[city_code] = city_name\n end\n cities\nend", "title": "" }, { "docid": "9545db2efba4d2c5e1a357dbc50dd11c", "score": "0.55435544", "text": "def available_jobs\n details.at('#filmography').css(\"div[data-category$='Movie']\").map{ |job| job['data-category'].gsub('Movie', '') }\n end", "title": "" }, { "docid": "3c7d52687a813891e3fef5097dbce5f0", "score": "0.54951054", "text": "def get_second_job_description()\n return @driver.find_element(:xpath => '//*[@id=\"job-details-slider\"]/div/div/visitor-job-details/ng-transclude/div[1]/div/div/section[2]/div/div').text \n end", "title": "" }, { "docid": "1cf97574e9de5c7095eed3cb1daf4f08", "score": "0.54893076", "text": "def get_email(x)\n lien = x.css('td[1]/a/@href').text\n page = Nokogiri::HTML(URI.open(\"http://www2.assemblee-nationale.fr#{lien}\"))\n email = page.css('.deputes-liste-attributs > dd:nth-child(8) > ul:nth-child(1) > li:nth-child(2) > a:nth-child(1)').text\nend", "title": "" }, { "docid": "f744c9ded8daca5440d6d27b44931f55", "score": "0.54881805", "text": "def get_schedule_url_postfixes( city, category )\n dates = []\n schedule_dates_url = [@host_url, city, \"schedule_#{category}\\/\"].join('/')\n doc = nil\n retry_if_exception do\n doc = Nokogiri::HTML( easy_curl(schedule_dates_url) )\n end\n return [] if not doc\n a_dates = doc.xpath(\"//div[@id='content']//div[@class='m-schedule-top-mrg'][1]//select[contains(@id, 'DateNavigator')][1]/option\")\n a_dates.each do |a_date|\n dates.push( a_date['value'] )\n end\n dates\nend", "title": "" }, { "docid": "8fb44593be99999a0fbe16d18ff8ce9e", "score": "0.5480652", "text": "def find_party(response, selector)\n return nil unless response.css(\"#{selector} > p.partia\")[0]\n\n response.css(\"#{selector} > p.partia\")[0].text\nend", "title": "" }, { "docid": "02ec945430905d5240da1faf472e006c", "score": "0.54799885", "text": "def page_element_contents(base, url, css_query, reftype)\n Mechanize.html_parser = Nokogiri::HTML\n a = Mechanize.new { |agent|\n agent.user_agent_alias = 'Mac Safari'\n }\n\n auth_user = @bot.config['redmine_urls.auth_user']\n auth_pass = @bot.config['redmine_urls.auth_pass']\n\n if auth_user && auth_pass\n host = base + '/login/'\n login = a.get(host).forms[1]\n login.username = auth_user\n login.password = auth_pass\n login = a.submit(login, login.buttons.first)\n end\n\n @page = a.get(url)\n\n raise InvalidRedmineUrl.new(\"#{url} returned redirect to #{page.header['Location']}\") if @page.code == '302'\n raise InvalidRedmineUrl.new(\"#{url} returned response code #{page.code}.\") unless @page.code == '200'\n\n elem = @page.search(css_query).first\n\t\tunless elem\n\t\t\twarning(\"Didn't find '#{css_query}' in page.\")\n\t\t\treturn\n\t\tend\n\n elem = elem.inner_text.gsub(\"\\n\", ' ').gsub(/\\s+/, ' ').strip\n debug(\"Found '#{elem}' with '#{css_query}'\")\n\n if reftype == :ticket && @bot.config['redmine_urls.extra_issue_information'] == true\n assigned = @page.search('//td[@class = \"assigned-to\"]').first.inner_text\n assigned = \"Unassigned\" if assigned.nil?\n status = @page.search('//td[@class = \"status\"]').first.inner_text\n debug(\"Found issue has a status of #{status} and is assigned to #{assigned}\")\n end\n\n if assigned && status\n elem = elem.gsub(/^(.+\\-.+)\\s\\-\\s.+$/, '\\1. ') + \"It has a status of #{status} and is assigned to #{assigned}\"\n else\n elem\n end\n end", "title": "" }, { "docid": "bd4074128b7311f2616e5e6e4dfb7aa7", "score": "0.54741883", "text": "def get_the_name_of_val_doise_townhalls(url)\n page = Nokogiri::HTML(open(url))\n commune = []\n news_links = page.css(\"a\").select{|link| link['class'] == \"lientxt\"}\n news_links.each do |communes|\n commune << communes.text\n end\n return commune\nend", "title": "" }, { "docid": "817b967f95d2bfdc967b543f81b1a39d", "score": "0.54658836", "text": "def parse_dailydev_page\n start = Time.now\n items = @page.search('.ddinfo')\n if items.any?\n items.each do |item|\n desc = item.search('.foot').empty\n desc = item.inner_text.strip\n link_el = item.search('a').select { |item| /\\/deviation\\// === item.attributes['href'] }.first\n link = link_el.attributes['href']\n title = link_el.inner_text\n @daily_data << { :title => title, :desc => desc, :link => link }\n end\n end\n Time.now - start\n end", "title": "" }, { "docid": "1fbc36278044010c0d6f2a8994f985d5", "score": "0.54651725", "text": "def debuty\n pages = Nokogiri::HTML(URI.open('http://www2.assemblee-nationale.fr/deputes/liste/tableau'))\n tmp = pages.css('//table/tbody/tr')\n debutyname = tmp[0..10].map { |x| { \"first_name\" => get_first(x), \"last_name\" => get_last(x), \"email\" => get_email(x) } }\nend", "title": "" }, { "docid": "7097cb4e70328d7023a675ee279ea525", "score": "0.54460555", "text": "def route_de_la_mairie\n page = Nokogiri::HTML(open(\"http://annuaire-des-mairies.com/val-d-oise.html\")) \n puts \"nata\"\n #page.xpath('/html/body/table/tbody/tr[3]/td/table/tbody/tr/td[2]/p[2]/object/table/tbody/tr[2]/td/table/tbody/tr/td[2]/p/a').each do |link|\n page.css('html body table tbody tr td table tbody tr td p object#voyance-par-telephone table tbody tr td table.Style20 tbody tr td p a.lientxt').each do |link|\n #page.css('html body table tbody').css('tr')[2].css('td table tbody tr').css('td')[1].css('p')[1].css('object table tbody').css('tr')[1].css('td table tbody tr').css('td')[2].css('p a').each do |link| \n puts link['href']\n puts link.text\n end\nend", "title": "" }, { "docid": "eaa9aaa1a69eb6e09c513f53dca21d2d", "score": "0.5414037", "text": "def get_duties_summary(page)\n page.css(WebScraper::JOB_DETAILS_SELECTOR)[WebScraper::JOB_DUTIES_SUM_POS].content.strip\n end", "title": "" }, { "docid": "5f7f10e17f2880e11b53e0c7498953e4", "score": "0.54111844", "text": "def get_courses(department)\n courses = []\n \n# puts \"Department: #{department}\"\n\n doc = Nokogiri::HTML(open(department[1]))\n \n # Parse header to find the course column\n course_column = 0\n current_column = 0\n doc.css('th').each do |th|\n course_column = current_column if th.content != 'Course'\n current_column += 1\n end\n \n return courses\n end", "title": "" }, { "docid": "6fa51f3849287fe576483d247bc36ee9", "score": "0.5404939", "text": "def gets_name\n page = Nokogiri::HTML(URI.open('http://www2.assemblee-nationale.fr/deputes/liste/alphabetique'))\n name = []\n\n page.css('div.col-container > ul > li > a').each do |fetch|\n name.push(fetch.content)\n end\n\n name\nend", "title": "" }, { "docid": "909ee48c6463ee4ae3edd7132d8334ca", "score": "0.53878194", "text": "def scrape\n\t\tnames = Array.new\n\t\tcontents = Array.new\n\t\teachmenus = ''\n\t\ttime = ''\n\t\tprice = ''\n\t\t\n\t\t#Mon ~ Fri\n\t\t(0..4).each do |day|\n parsed_data = Nokogiri::HTML(open(@urls[day]))\n target = parsed_data.css('table.sk01TBL')[1]\n\n #Store names\n target.css('tr p').each do |tmp|\n if (tmp.text == \"승학 캠퍼스\" || tmp.text == \" \")\n next\n else\n names << tmp.text\n end\n end\n\n #Store contents\n target.css('tr')[9].css('td.sk01TD').each do |tmp|\n if tmp.text.strip == \" \"\n next\n else\n contents << tmp.text.strip.gsub(\"\\n\\n\",\"\\n\").gsub(\"\\n\\n\",\"\\n\").gsub(\"\\n\",\",\")\n end\n end\n\n #Breakfast ~ Dinner\n (0..3).each do |part|\n \t\n \tif contents[part] == \" \"\t#콘텐츠에 문제가 있으면 Skip\n\t\t\t\t\tnext\n end\n\n #교수회관\n if names[part] == \"교수회관\"\n \teachmenus = JSON.generate({:name => contents[part], :price => price})\n \tDiet.create(\n\t :univ_id => 6,\n\t :name => names[part],\n\t :location => '',\n\t :date => @default_dates[day],\n\t :time => 'lunch',\n\t :diet => ArrJson(eachmenus),\n\t :extra => nil\n\t\t )\n \tDiet.create(\n\t :univ_id => 6,\n\t :name => names[part],\n\t :location => '',\n\t :date => @default_dates[day],\n\t :time => 'dinner',\n\t :diet => ArrJson(eachmenus),\n\t :extra => nil\n\t\t )\n end\n\n\t\t\t\t#학생회관, 도서관\n\t\t\t\tif names[part] == \"학생회관\" || names[part] == \"도서관\"\n \teachmenus = JSON.generate({:name => contents[part], :price => price})\n \tDiet.create(\n\t :univ_id => 6,\n\t :name => names[part],\n\t :location => '',\n\t :date => @default_dates[day],\n\t :time => 'breakfast',\n\t :diet => ArrJson(eachmenus),\n\t :extra => nil\n\t \t)\n \tDiet.create(\n\t :univ_id => 6,\n\t :name => names[part],\n\t :location => '',\n\t :date => @default_dates[day],\n\t :time => 'lunch',\n\t :diet => ArrJson(eachmenus),\n\t :extra => nil\n\t \t)\n \tDiet.create(\n\t :univ_id => 6,\n\t :name => names[part],\n\t :location => '',\n\t :date => @default_dates[day],\n\t :time => 'dinner',\n\t :diet => ArrJson(eachmenus),\n\t :extra => nil\n\t \t)\n end\n end #Breakfast ~ Dinner end\n\t\tend\t#Mon ~ Fri end\n\tend", "title": "" }, { "docid": "99af3724369f4c5f5539e616f7921850", "score": "0.5344113", "text": "def scrape(para)\n # need SECTION & PLACENAME from para\n # need to follow embedded href to get DESCRIPTION\n links = para.css(\"a\")\n # puts links.length\n # puts links.text\n\n # grabs href from anchor elements\n links.each{|links| puts links['href']}\n #grabs title from anchor elements\n links.each{|links| puts links['title']}\nend", "title": "" }, { "docid": "99af3724369f4c5f5539e616f7921850", "score": "0.5344113", "text": "def scrape(para)\n # need SECTION & PLACENAME from para\n # need to follow embedded href to get DESCRIPTION\n links = para.css(\"a\")\n # puts links.length\n # puts links.text\n\n # grabs href from anchor elements\n links.each{|links| puts links['href']}\n #grabs title from anchor elements\n links.each{|links| puts links['title']}\nend", "title": "" }, { "docid": "9f2e25055c8b913632498e15c7588319", "score": "0.5324516", "text": "def getJobIDs(jobsinfo_xml)\n jobs = {}\n doc = Nokogiri::XML(jobsinfo_xml)\n doc.css('//job').each do |job|\n job_id = job.at_css('@id').content\n job_name = job.at_css('/name').content\n jobs.store(job_id,job_name)\nend\n return jobs\nend", "title": "" }, { "docid": "6c560c037ed89bc6c6f5b53a82f3aaf4", "score": "0.53221375", "text": "def get_all_the_urls_of_val_doise_townhalls(page_url)\n tab = []\n doc = Nokogiri::HTML(open(page_url))\n tab_lien = doc.css(\"a\").select{|link| link['class']==\"lientxt\"}\n lien =\"http://annuaire-des-mairies.com/\"\n tab_lien.each{|link| tab.push(lien+link['href'])}\n tab\nend", "title": "" }, { "docid": "73faa423d9f72c783e7b85b5e3b4e485", "score": "0.53211254", "text": "def job_data(cont, col, class_container, class_name)\n (0...6).each do |i|\n li = @doc.at_css \"div[@class='row #{class_container}']//\"\\\n \"div[@class='#{class_name} col-#{col} d-flex justify-content-center']//ul//li#{[i + 1]}\"\n li.content = cont[i]\n end\n end", "title": "" }, { "docid": "cf073bab5e96394e7eda087ddbbab7cc", "score": "0.53158826", "text": "def get_depute_infos(url)\n doc = Nokogiri::HTML(open(url))\n\n email = doc.xpath('/html/body/div/div[3]/div/div/div/section[1]/div/article/div[3]/div/dl/dd[4]/ul/li[2]/a').text\n full_name = doc.xpath('/html/body/div/div[3]/div/div/div/section[1]/div/article/div[2]/h1').text.split(\" \")\n first_name = full_name[1]\n last_name = full_name[2..-1].join(\" \") \n\n return {\n \"first_name\" => first_name,\n \"last_name\" => last_name,\n \"email\" => email\n }\nend", "title": "" }, { "docid": "dcc072b317599ab1e2bf0f5adcb522b9", "score": "0.5290888", "text": "def page(agent, page)\n url = \"https://www.planningportal.nsw.gov.au/planning-panel?field_status_value=2&page=#{page}\"\n\n page = agent.get(url)\n block = page.at(\".page__content .grid__row\")\n return 0 if block.nil?\n urls = block.element_children.map do |application|\n (page.uri + application.at('a')[\"href\"]).to_s\n end\n\n urls.each do |url|\n page = agent.get(url)\n v = page.at(\".project__details\").search(\".row\").map do |row|\n label = row.at(\"b\").inner_text.squish\n value = row.at(\"div\").inner_text.squish\n [label, value]\n end\n fields = Hash[v]\n\n yield(\n \"council_reference\" => fields[\"Planning panel reference number\"],\n \"address\" => fields[\"Project Address\"] + \", NSW\",\n \"description\" => page.at(\".field-field-project-description\").inner_text.squish,\n \"info_url\" => url,\n \"date_scraped\" => Date.today.to_s,\n \"date_received\" => convert_date(fields[\"Referral date\"])\n )\n end\n\n # Return number of applications found\n urls.count\nend", "title": "" }, { "docid": "f0f1096603b7922d2fdee8b25c823e11", "score": "0.52880174", "text": "def get_all_the_urls_of_val_doise_townhalls (web_list)\npage = Nokogiri::HTML(RestClient.get(web_list))#recupere le code html du site\npage.css(\"a.lientxt\").each do |note|\nnote['href'] = note['href'][1..-1]#donne les urls de chaque commune en retirant le premier caractaire c-a-d \".\"\nweb_page = \"http://annuaire-des-mairies.com\" + note['href']\nputs web_page\nget_the_email_of_a_townhal_from_its_webpage(web_page)#rappel la fonction get_the_email_of_a_townhal_from_its_webpage pour recuperer les adresses emails grace aux liens (fonctions recurssive)\nend\nend", "title": "" }, { "docid": "e3937343be7b7927d06f82ca987b6b7f", "score": "0.5278983", "text": "def get_student_job_listings\n # Processing user filter choices\n url = 'https://sfa.osu.edu/jobs/job-board'\n puts 'Scraping ' + url + '...'\n a = Mechanize.new { |agent| agent.user_agent_alias = 'Windows Firefox' }\n search_page = a.get(url)\n search_form = search_page.forms.last\n data = filter\n i = 0\n search_form.search = data[0]\n data.shift # Unshifitng to get rid of keywords index\n\n search_form.checkboxes.map do |box|\n box.click if data[i]\n i += 1\n\n end\n unparsed_job_list = a.submit(search_form, search_form.buttons.first)\n parsed_job_list = Nokogiri::HTML(unparsed_job_list.body)\n\n # Filling out array of hash listings with individualized job info\n puts 'This may take a while...'\n jobs = []\n parsed_job_list.css('ol li').each do |job|\n # Summary information insertion\n info = Hash.new('N/A')\n info[:title] = job.css('h4')[0].text\n info[:employer] = job.css('h4')[1].text\n info[:desc] = job.css('p')[0].text\n info[:link] = 'https://sfa.osu.edu/jobs/' + job.css('a')[0]['href']\n get_specific_listing_info a, info\n jobs << info\n end\n jobs\nend", "title": "" }, { "docid": "1cf81f97fc6db1733a93669cf4375c62", "score": "0.52755386", "text": "def get_townhall_urls(url)\n urls_department = []\n\n doc = Nokogiri::HTML(open(url))\n\n# Extraire le texte et mettre ça dans un hash \n\n doc.xpath(\"//a[@class=\\\"lientxt\\\"]\").each do |node|\n urls_department << { name: node.text, url: \"http://annuaire-des-mairies.com\" + node[:href][1, node[:href].size - 1]}\n end\n\n urls_department\nend", "title": "" }, { "docid": "476190fc6d432ef0f87e9a5c6ecaff8e", "score": "0.5269605", "text": "def get_salary_range(page)\n page.css(WebScraper::JOB_INFO_SELECTOR)[WebScraper::JOB_SALARY_POS].content.strip\n end", "title": "" }, { "docid": "a25db63bd27dadce2bf58bc8c780fa23", "score": "0.52518886", "text": "def printcat(cat)\n list = $page.css('.oneRes').select{|play| play.css('.detail li a')[1].text == cat}\n list.each do |play|\n puts \"#{play.css('.eventTitle').text}---#{play.css('.detail li a')[0].text}\"\n end\nend", "title": "" }, { "docid": "ffea13ef8beee4415712461b0cc7b19a", "score": "0.52509135", "text": "def pull_offers(keyword, indeed_offers)\n puts \"Pulling result cards from the \\\"#{keyword}\\\" search\"\n domain = 'https://www.indeed.com.mx/'\n url = \"trabajo?q=#{keyword}&remotejob=032b3046-06a3-4876-8dfd-474eb5e7ed11\"\n html_content = open(domain + url).read\n doc = Nokogiri::HTML(html_content)\n # This var verifies if there are multiple pages of results\n next_page_button = doc.search('path')\n next_page_button = next_page_button.search('*[d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6-6-6z\"]').text\n unless next_page_button.empty?\n # If there are multiple pages it will iterate though all of the result pages\n gather_offers_per_page(doc, indeed_offers)\n current_page = 1\n while next_page_button.empty? == true\n next_page = \"&start=#{current_page}0\"\n html_content = open(domain + url + next_page).read\n doc = Nokogiri::HTML(html_content)\n # This var verifies if there are multiple pages of results\n gather_offers_per_page(doc, indeed_offers)\n current_page += 1\n next_page_button = doc.search('path')\n next_page_button = next_page_button.search('*[d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6-6-6z\"]')\n end\n else\n gather_offers_per_page(doc, indeed_offers)\n end\n end", "title": "" }, { "docid": "8a9e77e5af3b9dff8de1f684541f33ec", "score": "0.52488726", "text": "def extract_data(link)\n page = link.click.link_with(text: 'Comisiones').click\n subj_title = page.css('div.tab-panel')[0].css('span')\n print \"#{subj_title[0].text} - #{subj_title[1].text}\\n\"\n dt = DataExtractor.new(Subject.new(subj_title[0].text, subj_title[1].text))\n begin\n page.css('div.tab-panel')[0].xpath('//text()').each do |tag|\n txt = tag.text.strip\n dt.handle_event(:comision, txt) if /^[A-Z]+$/.match(txt)\n if /(Lunes|Martes|Miércoles|Jueves|Viernes|Sábado|Domingo)/.match(txt)\n dt.handle_event(:dia, txt)\n end\n dt.handle_event(:hora, txt) if /^[0-9]+:[0-9]+$/.match(txt)\n end\n return dt.subject\n rescue StandardError\n return Subject.new(subj_title[0].text, subj_title[1].text)\n end\nend", "title": "" }, { "docid": "ba6f2c23ab6314dca7da3d9937b7482a", "score": "0.52408606", "text": "def get_city\n page = Nokogiri::HTML(open(\"http://annuaire-des-mairies.com/val-d-oise.html\"))\n villes =[]\n page.xpath('//*[@class=\"lientxt\"]').each do |ville|\n villes << ville.text\n end\n return villes\n end", "title": "" }, { "docid": "33ddc24172cdcea343af02abfe7baddc", "score": "0.5228359", "text": "def printcre(criteria, target)\n list = $page.css(\"a[#{criteria} = #{target}]\")\n list.each do |item|\n puts item['href']\n end\nend", "title": "" }, { "docid": "51d6dd0fd36dd27c5f16decdd78a1761", "score": "0.52133757", "text": "def search_for_selectors(search, expectedCount)\n # get all links for current page\n links = get_position_links\n # count used to put all information for 1 position in 1 array\n count = 1\n # link_index used to add the appropriate links to array\n link_index= 0\n # Sub array that will hold the information of 1 position\n job_content = []\n # Super array that holds information of all positions\n job_array = []\n @page.search(search).each do |selector|\n job_content << selector.text.strip\n if count % expectedCount == 0\n job_content << links[link_index]\n link_index += 1\n job_array << job_content\n job_content = []\n end\n count += 1\n end\n # Return super array\n job_array\n end", "title": "" }, { "docid": "0913dda38c15c712d2857ed41198dee9", "score": "0.5212983", "text": "def get_fte(page)\n page.css(WebScraper::JOB_DETAILS_SELECTOR)[WebScraper::JOB_FTE_POS].content.strip.to_i\n end", "title": "" }, { "docid": "53a06567a5df63fed169a875dc188e98", "score": "0.5208164", "text": "def get_nom(url)\n tab = []\n doc = Nokogiri::HTML(open(\"http://annuaire-des-mairies.com/\"))\n tab_lien = doc.css(\"a\").select{|link| link['class']==\"lientxt\"}\n tab_lien.each{|link| tab.push(link.text)}\n tab\n end", "title": "" }, { "docid": "faca3e1ca32c3325a08d1fe5321f0f30", "score": "0.5196608", "text": "def extract_interviewee(detail_page)\n interviewee_selector = '.episode_sub_title span'\n detail_page.search(interviewee_selector).text.strip\nend", "title": "" }, { "docid": "92a7121bd728a76af92a0417991b189c", "score": "0.51905704", "text": "def get_listing_data\n listing_data = []\n # get_pages.each do |page|\n local_pages.each do |page|\n listing_data << page.css('div[@class = \"item\"]')\n end\n listing_data\n end", "title": "" }, { "docid": "85b65506844dd621b8ae0ea47c373a50", "score": "0.51871747", "text": "def get_the_email_of_a_townhal_from_all_webpage\n emails = []\n url_commune = get_all_the_urls_of_val_doise_townhalls(\"http://annuaire-des-mairies.com/val-d-oise.html\")\n url_commune.each do |url|\n pages = Nokogiri::HTML(open(url))\n email = pages.css(\".txt-primary\")[3].text.split(\" \")\n email = email[2]\n emails << email\n end\n return emails\nend", "title": "" }, { "docid": "0caea91ecaea5925a4ba1ebbe0ae0793", "score": "0.51849306", "text": "def get_cities_names\n name_of_cities = []\n\n doc = Nokogiri::HTML(open(\"http://annuaire-des-mairies.com/val-d-oise.html\"))\n doc.xpath('//p/a').each do |town|\n name_of_cities << town.text\n end\n\n name_of_cities\nend", "title": "" }, { "docid": "f25e3479d4629325a52c3353fd23292d", "score": "0.5172513", "text": "def find_grade(response, selector)\n return nil unless response.css(selector.to_s)[0]\n\n response.css(selector)[0].text.strip!\nend", "title": "" }, { "docid": "e1beb69fd44390b574aa6d61a995753b", "score": "0.5161901", "text": "def select_employment(employment)\n page.find(:xpath, \"//span[text()='#{employment}']//../parent::li\")\n end", "title": "" }, { "docid": "adf905c40db3c51328bd79afa976cf7a", "score": "0.5157113", "text": "def get_townhall_urls(url)\n urls_department = []\n \n doc = Nokogiri::HTML(open(url))\n \n # Extraire le texte et mettre ça dans un hash \n \n doc.xpath(\"//a[@class=\\\"lientxt\\\"]\").each do |node|\n urls_department << { name: node.text, url: \"http://annuaire-des-mairies.com\" + node[:href][1, node[:href].size - 1]}\n end\n urls_department\n end", "title": "" }, { "docid": "6741cd7f6b91068710f322c656abcbb7", "score": "0.5149335", "text": "def extract_badgecriteria()\n@badgecriteria_array = []\n file = File.open('app/assets/post.html')\n doc = Nokogiri::HTML(file)\n doc.search('.mb_div a').map do |element|\n criteria_url = \"http://www.boyscouttrail.com/boy-scouts/\" + element['href']\n @badgecriteria_array << criteria_url\n end\n return @badgecriteria_array\nend", "title": "" }, { "docid": "5c779d81038b0e4092841109d90f9ab2", "score": "0.5148514", "text": "def flightglobal \n fg_output= {}\n source = \"Flightglobal\"\n url = \"https://www.flightglobal.com/searchresults?qkeyword=&PageSize=10&parametrics=WVPUBDATE%7C%5BNOW-1DAY%20TO%20NOW%5D&SortOrder=2\"\n page = Nokogiri::HTML(open(url))\n\n elements = page.css(\"li\").each_with_index {|line, index|\n title = line.css(\"h3\").text\n paragraph = line.css(\"p\").text\n date = paragraph.slice(0,10)\n description = paragraph[20..]\n link = line.css(\"h3>a>@href\").text\n #puts title\n #puts link\n if title.length > 2\n fg_output[index] = {\n :title => title,\n :description => description,\n :link => link,\n :source => source\n }\n end\n }\n fg_output\nend", "title": "" }, { "docid": "c6e6fbab10fddd077092948476aacc24", "score": "0.5143511", "text": "def scrap_trip_pages\n \n mp_trip_pages.each do |mp, trip_page|\n printf \"mp - #{mp}\\n\"\n doc = utf_page(trip_page)\n t = Time.now\n komandiruotes = (doc/\"//a[text()='Komandiruotės']\").first\n mp_business_trip(mp, denormalize( komandiruotes.attributes['href'] ) ) if komandiruotes\n printf \"Laikas: #{Time.now - t}\\n\"\n #sleep 3\n end\n \n end", "title": "" }, { "docid": "9f34777479f1ce89e8a2be6ddd485492", "score": "0.51432854", "text": "def get_all_the_urls_of_val_doise_townhalls(page_url)\n doc = Nokogiri::HTML(open(page_url))\n urls = []\n#on recupere le css a[class=lientxt]\n get_urls = doc.css(\"a[class=lientxt]\")\n get_urls.each{|link| urls.push(\"http://annuaire-des-mairies.com\"+link['href'][1...link['href'].length])}\n urls\nend", "title": "" }, { "docid": "a4d5b8e0318b19fce7322cd345ece142", "score": "0.51383674", "text": "def listings\n @listings ||= page.parser.css('.listing-findcar')\n end", "title": "" }, { "docid": "5df32d81861d7a08053d05b74ffd1c69", "score": "0.5135098", "text": "def get_name(url)\n page = open(url).read\n nokogiri_object = Nokogiri::HTML(page)\n name_depute = nokogiri_object.css(\"span.list_nom\")\n array = name_depute.to_a\n array.map! {|name| name.text.strip} #enleve les espaces avant & apres string\n return array[0..20] #ne montre que les 20 premiers elements\nend", "title": "" }, { "docid": "0fa347bd8a75e3643ab59f6e9c93ed97", "score": "0.5124759", "text": "def get_da_detail_page(page, da_container)\n\n tds = da_container.search('td')\n\n href = tds[0].at('a')['href']\n\n detail_page = page.link_with(:href => \"#{href}\").click\n\n \n\n return detail_page\n\nend", "title": "" }, { "docid": "0fa347bd8a75e3643ab59f6e9c93ed97", "score": "0.5124759", "text": "def get_da_detail_page(page, da_container)\n\n tds = da_container.search('td')\n\n href = tds[0].at('a')['href']\n\n detail_page = page.link_with(:href => \"#{href}\").click\n\n \n\n return detail_page\n\nend", "title": "" }, { "docid": "c7f8328e844630e2f4360532ce4051ce", "score": "0.5115642", "text": "def get_da_detail_page(page, da_container)\n tds = da_container.search('td')\n href = tds[0].at('a')['href']\n detail_page = page.link_with(:href => \"#{href}\").click\n \n return detail_page\nend", "title": "" }, { "docid": "c7f8328e844630e2f4360532ce4051ce", "score": "0.5115642", "text": "def get_da_detail_page(page, da_container)\n tds = da_container.search('td')\n href = tds[0].at('a')['href']\n detail_page = page.link_with(:href => \"#{href}\").click\n \n return detail_page\nend", "title": "" }, { "docid": "46b26226a881b52f67f14ca557732434", "score": "0.5108936", "text": "def parse(site, tag, i)\n parsing = page(site)\n parsing.css(tag)[i].to_s\nend", "title": "" }, { "docid": "31db352e30ef5d5b14f77c87e7d7e2c6", "score": "0.51076007", "text": "def scrape\n\t\teachmenus = ''\n\t\tcontent = ''\n\t\tprice = ''\n\t\tcurrentDate = 0\n\t \n #프랜들리\n target = @parsed_data.css('table.table-a tbody td')\n check = 0\n\n @default_dates.each do |dat|\n \teachmenus = \"\"\n target.each do |t|\n if check == 0\n content = t.text\n check = 1\n else\n price = t.text\n if eachmenus == \"\"\n #첫 번째 메뉴면, 콤마없이\n eachmenus += JSON.generate({:name => content, :price => price})\n else\n #하나 이상 메뉴면 콤마 추가\n eachmenus += (',' + JSON.generate({:name => content, :price => price}))\n end\n check = 0\n end\n end\n\t\t #조/중/석이 같은 메뉴입니다. \n\t\t Diet.create(\n :univ_id => 5,\n :name => \"프랜들리\",\n :location => \"바율관1층\",\n :date => dat,\n :time => 'breakfast',\n :diet => ArrJson(eachmenus),\n :extra => nil\n )\n Diet.create(\n :univ_id => 5,\n :name => \"프랜들리\",\n :location => \"바율관1층\",\n :date => dat,\n :time => 'lunch',\n :diet => ArrJson(eachmenus),\n :extra => nil\n )\n Diet.create(\n :univ_id => 5,\n :name => \"프랜들리\",\n :location => \"바율관1층\",\n :date => dat,\n :time => 'dinner',\n :diet => ArrJson(eachmenus),\n :extra => nil\n )\n end\n\n\t\t#파인하우스\n\t\tpinehouse = Array.new\n pinehouse << JSON.generate({:name => \"비빔밥\", :price => \"2,700\"})\n pinehouse << JSON.generate({:name => \"비빔밥(잡곡)\", :price => \"3,200\"})\n pinehouse << JSON.generate({:name => \"돌솥비빔밥\", :price => \"2,700\"})\n pinehouse << JSON.generate({:name => \"돌솥비빔밥(잡곡)\", :price => \"3,500\"})\n pinehouse << JSON.generate({:name => \"치즈돌솥비빔밥\", :price => \"3,200\"})\n pinehouse << JSON.generate({:name => \"청국장\", :price => \"3,000\"})\n pinehouse << JSON.generate({:name => \"육개장\", :price => \"2,700\"})\n pinehouse << JSON.generate({:name => \"찌개(된장/순두부/콩비지/김치)\", :price => \"2,700\"})\n pinehouse << JSON.generate({:name => \"부대찌개\", :price => \"3,000\"})\n pinehouse << JSON.generate({:name => \"김치덮밥\", :price => \"2,700\"})\n pinehouse << JSON.generate({:name => \"덮밥(잡채/마파두부/버섯)\", :price => \"3,200\"})\n pinehouse << JSON.generate({:name => \"들깨순두부\", :price => \"3,000\"})\n pinehouse << JSON.generate({:name => \"공기밥\", :price => \"500\"})\n pinehouse << JSON.generate({:name => \"현미밥\", :price => \"1,000\"})\n pinehouse << JSON.generate({:name => \"버섯두부전골\", :price => \"10,000\"})\n pinehouse << JSON.generate({:name => \"만두전공\", :price => \"10,000\"})\n pinehouse << JSON.generate({:name => \"김치주먹밥\", :price => \"1,300\"})\n pinehouse << JSON.generate({:name => \"샌드위치(사과/야채)\", :price => \"1,500\"})\n pinehouse << JSON.generate({:name => \"베지버거\", :price => \"2,000\"})\n pinehouse << JSON.generate({:name => \"야채김밥\", :price => \"1,700\"})\n pinehouse << JSON.generate({:name => \"치즈김밥/구프랑김밥\", :price => \"2,000\"})\n pinehouse << JSON.generate({:name => \"떡만두국\", :price => \"3,000\"})\n pinehouse << JSON.generate({:name => \"라면\", :price => \"1,700\"})\n pinehouse << JSON.generate({:name => \"치즈라면/만두라면\", :price => \"2,000\"})\n pinehouse << JSON.generate({:name => \"김치떡라면\", :price => \"2,000\"})\n pinehouse << JSON.generate({:name => \"채식라면\", :price => \"2,300\"})\n pinehouse << JSON.generate({:name => \"잔치국수/칼국수\", :price => \"2,500\"})\n pinehouse << JSON.generate({:name => \"토마토스파게티\", :price => \"3,000\"})\n pinehouse << JSON.generate({:name => \"수제비\", :price => \"2,300\"})\n pinehouse << JSON.generate({:name => \"들깨수제비\", :price => \"2,800\"})\n pinehouse << JSON.generate({:name => \"칼국수(들깨/만두/버섯)\", :price => \"3,000\"})\n pinehouse << JSON.generate({:name => \"떡볶이\", :price => \"2,500\"})\n pinehouse << JSON.generate({:name => \"부대떡볶이\", :price => \"5,000\"})\n pinehouse << JSON.generate({:name => \"치즈떡볶이\", :price => \"6,000\"})\n pinehouse << JSON.generate({:name => \"유부초밥\", :price => \"2,500\"})\n pinehouse << JSON.generate({:name => \"우동\", :price => \"1,800\"})\n pinehouse << JSON.generate({:name => \"우동(곱)\", :price => \"2,300\"})\n pinehouse << JSON.generate({:name => \"짜장면\", :price => \"2,300\"})\n pinehouse << JSON.generate({:name => \"짜장면(곱)\", :price => \"2,800\"})\n pinehouse << JSON.generate({:name => \"짬뽕\", :price => \"2,500\"})\n pinehouse << JSON.generate({:name => \"쩜뽕(곱)\", :price => \"3,000\"})\n pinehouse << JSON.generate({:name => \"간짜장\", :price => \"3,000\"})\n pinehouse << JSON.generate({:name => \"간짜장(곱)\", :price => \"3,500\"})\n pinehouse << JSON.generate({:name => \"볶음밥\", :price => \"2,700\"})\n pinehouse << JSON.generate({:name => \"쟁반짜장\", :price => \"6,000\"})\n pinehouse << JSON.generate({:name => \"쟁반짬뽕\", :price => \"7,000\"})\n pinehouse << JSON.generate({:name => \"쟁반쫄면\", :price => \"6,500\"})\n pinehouse << JSON.generate({:name => \"버섯탕수육(2인기준)\", :price => \"8,000\"})\n pinehouse << JSON.generate({:name => \"냉면\", :price => \"2,500\"})\n pinehouse << JSON.generate({:name => \"냉면(곱)\", :price => \"3,000\"})\n pinehouse << JSON.generate({:name => \"냉모밀(2인기준)\", :price => \"5,000\"})\n\n eachmenus = \"\"\n pinehouse.each do |p|\n \tif eachmenus == \"\"\n #첫 번째 메뉴면, 콤마없이\n eachmenus += p\n else\n #하나 이상 메뉴면 콤마 추가\n eachmenus += (',' + p)\n end\n end\n\n #조/중/석이 같은 메뉴입니다.\n @default_dates.each do |dat|\n Diet.create(\n :univ_id => 5,\n :name => \"파인하우스\",\n :location => \"학생회관1층\",\n :date => dat,\n :time => 'breakfast',\n :diet => ArrJson(eachmenus),\n :extra => nil\n )\n Diet.create(\n :univ_id => 5,\n :name => \"파인하우스\",\n :location => \"학생회관1층\",\n :date => dat,\n :time => 'lunch',\n :diet => ArrJson(eachmenus),\n :extra => nil\n )\n Diet.create(\n :univ_id => 5,\n :name => \"파인하우스\",\n :location => \"학생회관1층\",\n :date => dat,\n :time => 'dinner',\n :diet => ArrJson(eachmenus),\n :extra => nil\n )\n end\n\n\tend", "title": "" }, { "docid": "7c85318ab11be2668f0e7adbaae960c0", "score": "0.5104645", "text": "def get_mail(get_url)\n page = open(get_url).read\n nokogiri_object = Nokogiri::HTML(page)\n mail_depute = nokogiri_object.xpath(\"//*[@id='b1']/ul[2]/li[1]/ul/li[1]/a\")\n return mail_depute.text\nend", "title": "" }, { "docid": "2667e73959e009a9325238aee197d967", "score": "0.51011443", "text": "def get_the_email_of_a_townhal_from_its_webpage(lien)\n doc = Nokogiri::HTML(open(\"#{lien}\"))\n email = doc.css('html body tr[4] td.style27 p.Style22 font')[1]\nend", "title": "" }, { "docid": "2bd319e867e4befc6d5c73bcfc47d1d4", "score": "0.5099319", "text": "def search_find_job_and_get_status(job)\n\t click_on('Filter Jobs')\n\t wait_for_ajax\n\t fill_in('users-id-search', :with => \"\") #clear Recruiter field\n\t fill_in('requisition.title_id', :with => \"#{job}\")\n\t click_on('search-btn-id')\n\t wait_for_ajax\n\t search_job_get_status(job)\n\tend", "title": "" }, { "docid": "e7a31679f119fc1d2033677156613c54", "score": "0.50968575", "text": "def parse_page_ccmc(url, agent, depth)\n hospital_name = \"Connecticut Children's Medical Center\".titleize\n base = \"http://www.connecticutchildrens.org/physicians/\"\n page = agent.get(url)\n if depth == 0\n items = page.search(\".letters-wrap .letter\")\n items[0..(items.length - 1)].each do |li|\n link = base + li.search(\"a\").first[\"href\"]\n parse_page_ccmc(link, agent, depth + 1)\n end\n else\n items = page.search(\".phys-search-content\")\n items[0..(items.length - 1)].each do |li|\n name = li.search(\"h2 a\").text.titleize\n spec = li.search(\".phsy-search-spec a\").first\n spec = spec.text.titleize unless spec.nil?\n print \"......Parsing #{name} #{spec}\"\n hospital = Hospital.find_by_name(hospital_name)\n hid = hospital.id.to_s\n provider = Provider.create(name: name, hospital_id: hid)\n pid = provider.id.to_s\n specialty = Specialty.create(name: spec, provider_id: pid)\n print \"...DONE\\n\"\n end\n print \"...DONE\\n\"\n end \nend", "title": "" }, { "docid": "db3bb734473cb44815585ce9ab907fc1", "score": "0.5095918", "text": "def scrape_individual_offer(offer_object, url)\n puts \"Pulling details from posting #{url}\"\n domain = 'https://www.indeed.com.mx/'\n html_content = open(domain + url).read\n doc = Nokogiri::HTML(html_content)\n description = doc.search('.jobsearch-jobDescriptionText')\n offer_object[:description] = description # unrefined but workable\n collect_posting_date(doc, offer_object)\n collect_job_type(description.text.downcase, offer_object)\n collect_tags_indeed(description.text.downcase, offer_object)\n sleep 0.7\n end", "title": "" }, { "docid": "997039ef8b6ec9ff585d1982421c6957", "score": "0.5095509", "text": "def get_results(url) #pass url in as argument\n scraper = make_scraper\n url=\"https://www.dice.com/jobs?q=rails&l=Washington%2C+DC&searchid=7137101740189\"\n page = scraper.get(url)\n end", "title": "" }, { "docid": "16a4a5710e8b4399fe66460aac6a1358", "score": "0.5092145", "text": "def crawler_items\n crawler_data.css('.sresult')\n end", "title": "" }, { "docid": "07cdf1bb0d6ea23bdf7239d568905ff5", "score": "0.50850385", "text": "def scraper(url2)\n dataUrl = Nokogiri::HTML(open(url2))\n linksUrl = dataUrl.css('div#leftContainer')\n \n linksUrl.each do |review|\n arr = []\n # name\n arr << review.css('span.fn').text.strip\n # neighborhood\n #arr << review.css('span.neighborhood').text.strip\n # street-address\n arr << review.css('div.h5').first.text.strip.split(\"Send\").first\n # street-address\n #arr << review.css('span.locality').text.strip\n # price rating\n arr << review.css('span.pricerange').text.strip\n # rating\n arr << review.css('span.value').text.strip\n #blurb\n arr << review.css('span#blurb').text.strip\n\n return arr\n end \nend", "title": "" }, { "docid": "ec125715f8638f14b7896fddb72eddc9", "score": "0.50814974", "text": "def get_decision(detail_page)\n decison_tr = detail_page.search('tr.ContentPanel')[1]\n decison_td = (decison_tr != nil) ? decison_tr.search('td')[0].inner_text : \"\"\n \n return clean_whitespace(decison_td)\nend", "title": "" }, { "docid": "ec125715f8638f14b7896fddb72eddc9", "score": "0.50814974", "text": "def get_decision(detail_page)\n decison_tr = detail_page.search('tr.ContentPanel')[1]\n decison_td = (decison_tr != nil) ? decison_tr.search('td')[0].inner_text : \"\"\n \n return clean_whitespace(decison_td)\nend", "title": "" }, { "docid": "da14d4e5673cd1f8f045ab79eb393381", "score": "0.5080247", "text": "def get_all_the_urls_of_val_doise_townhalls(x)\n doc = Nokogiri::HTML(open(x))\n doc.css('.lientxt').each do |url|\n Tab_url.push(\"http://annuaire-des-mairies.com\" + (url[\"href\"][1..-1]))\n end\n Tab_url\nend", "title": "" }, { "docid": "4bda16f920c46ba6fbfe342bffb38f3f", "score": "0.5074848", "text": "def gets_urls\n page = Nokogiri::HTML(URI.open('http://www2.assemblee-nationale.fr/deputes/liste/alphabetique'))\n urls = []\n\n page.css('div.col-container > ul > li > a').each do |fetch|\n urls.push('http://www2.assemblee-nationale.fr' + fetch['href'])\n end\n\n urls\nend", "title": "" }, { "docid": "165ec98ec02566bdc4966c9a42266478", "score": "0.507465", "text": "def get_decision(detail_page)\n decision_array = []\n first_table = detail_page.search('div#ctl00_MainBodyContent_group_21 table.ContentPanel')\n \n if first_table != nil\n list_tr = first_table.search('tr')\n for i in 1..list_tr.length-1\n list_td = list_tr[i].search('td')\n decision_obj = {}\n decision_obj[:decision] = clean_whitespace(list_td[0].inner_text)\n decision_obj[:decision_date] = clean_whitespace(list_td[1].inner_text)\n decision_obj[:effective_date] = clean_whitespace(list_td[2].inner_text)\n decision_obj[:decision_authority] = clean_whitespace(list_td[3].inner_text)\n decision_obj[:under_appeal] = clean_whitespace((list_td[4] != nil) ? list_td[4].inner_text : \"\")\n decision_array << decision_obj\n end\n else\n return \"\"\n end\n return decision_array\nend", "title": "" }, { "docid": "165ec98ec02566bdc4966c9a42266478", "score": "0.507465", "text": "def get_decision(detail_page)\n decision_array = []\n first_table = detail_page.search('div#ctl00_MainBodyContent_group_21 table.ContentPanel')\n \n if first_table != nil\n list_tr = first_table.search('tr')\n for i in 1..list_tr.length-1\n list_td = list_tr[i].search('td')\n decision_obj = {}\n decision_obj[:decision] = clean_whitespace(list_td[0].inner_text)\n decision_obj[:decision_date] = clean_whitespace(list_td[1].inner_text)\n decision_obj[:effective_date] = clean_whitespace(list_td[2].inner_text)\n decision_obj[:decision_authority] = clean_whitespace(list_td[3].inner_text)\n decision_obj[:under_appeal] = clean_whitespace((list_td[4] != nil) ? list_td[4].inner_text : \"\")\n decision_array << decision_obj\n end\n else\n return \"\"\n end\n return decision_array\nend", "title": "" }, { "docid": "d145e5166fa69de170fd100dd7fec2df", "score": "0.5071532", "text": "def get_specific_listing_info a, info\n parsed_listing = Nokogiri::HTML(a.get(info[:link]).body)\n additional_info = parsed_listing.css('dl').text.split(\"\\n\")\n additional_info.each_with_index do |element, i|\n # Searches for pay, duration, and hours within each job page, filtering accordingly\n if /Pay/.match?(element)\n info[:pay] = additional_info[i + 2].strip\n info[:pay] = 'N/A' if info[:pay].nil? || info[:pay].empty?\n info[:pay] = info[:pay].slice(0...67) + '...' if info[:pay].length > 70\n elsif /Job Duration/.match?(element)\n info[:duration] = additional_info[i + 2].strip\n info[:duration] = 'N/A' if info[:duration].nil? || info[:duration].empty?\n info[:duration] = info[:duration].slice(0...67) + '...' if info[:duration].length > 70\n elsif /Hours/.match?(element)\n info[:hours] = additional_info[i + 2].strip\n info[:hours] = 'N/A' if info[:hours].nil? || info[:hours].empty?\n info[:hours] = info[:hours].slice(0...67) + '...' if info[:hours].length > 70\n end\n end\nend", "title": "" }, { "docid": "ee1034bf098a075a9e640675ff7823b8", "score": "0.5060011", "text": "def scrape_page(page, url)\n # clean up page so valid enough for Nokogiri to parse\n page.gsub!('<p />','</p><p>')\n page.sub!('<hr />','<p>')\n page.gsub!('<hr ','</p><hr ')\n doc = Nokogiri.HTML(page)\n doc.search('a[@href*=\"getHRGHTML\"]').each do |a|\n save_company_from_element(a.parent)\n end\nrescue Exception => e\n puts \"Exception (#{e.inspect}) raised while getting or parsing data (source url=#{url}). Data: #{page.to_s}\\n\\nBacktrace:\\n#{e.backtrace}\"\nend", "title": "" }, { "docid": "ee1034bf098a075a9e640675ff7823b8", "score": "0.5060011", "text": "def scrape_page(page, url)\n # clean up page so valid enough for Nokogiri to parse\n page.gsub!('<p />','</p><p>')\n page.sub!('<hr />','<p>')\n page.gsub!('<hr ','</p><hr ')\n doc = Nokogiri.HTML(page)\n doc.search('a[@href*=\"getHRGHTML\"]').each do |a|\n save_company_from_element(a.parent)\n end\nrescue Exception => e\n puts \"Exception (#{e.inspect}) raised while getting or parsing data (source url=#{url}). Data: #{page.to_s}\\n\\nBacktrace:\\n#{e.backtrace}\"\nend", "title": "" }, { "docid": "93e48cd2dbedfeaec6d8174f05452ac9", "score": "0.50498", "text": "def project_name(pid)\n Nokogiri::HTML(pivotal_tracker(project_url(pid)).content).css('project > name').text.split(' ').join\nend", "title": "" }, { "docid": "ffcdd7cae82cfcbe5991ae3e38508aa0", "score": "0.5047615", "text": "def parse_single_page(page)\n rows = page.search(\"form[name='search'] table > tr > td > table > tr\")\n \n dentist_name = ''\n company_name = ''\n address = ''\n \n rows.each do |row|\n plain = row.text.gsub(/\\s*\\302\\240\\302\\240/, '').gsub(/\\s\\s/, '').strip\n if plain.start_with?(\"Name\")\n dentist_name = plain.gsub(/Name/, '')\n end\n if plain.start_with?(\"Primary Practice Place\")\n company_name = plain.gsub(/Primary Practice Place/, '')\n end\n if plain.start_with?(\"Practice Address\")\n address = row.text.gsub(/\\s\\s/, '').gsub(/\\302\\240\\302\\240/, ' ').gsub(/Practice Address/, '').strip\n end\n end\n p [dentist_name, company_name, address]\n\n RESULT_COLL.insert(:contact => [dentist_name, company_name, address])\nend", "title": "" } ]
f4e6222cd59951a8319953baa3f924c5
GET /sport_levels/1 GET /sport_levels/1.json
[ { "docid": "f66b28a24cbd1e211a3cf24d8171c0e5", "score": "0.63104224", "text": "def show\n @sport_level = SportLevel.find(params[:id])\n render :layout => nil\n end", "title": "" } ]
[ { "docid": "de00b958a8794eb8efbd79ded80c02b7", "score": "0.75219893", "text": "def sport_level_list\n @sport_levels = SportLevel.find_by_user(current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @sport_levels }\n end\n end", "title": "" }, { "docid": "6c03c6334f06f24abf4f313d8cf4b904", "score": "0.6611574", "text": "def index\n @sport_levels = SportLevel.all\n render :layout => nil\n end", "title": "" }, { "docid": "ecc9d45da691388007f0fc7bb8ad9dbf", "score": "0.66009706", "text": "def index\n @game = Game.find(params[:game_id])\n @levels = @game.levels\n end", "title": "" }, { "docid": "ecc9d45da691388007f0fc7bb8ad9dbf", "score": "0.66009706", "text": "def index\n @game = Game.find(params[:game_id])\n @levels = @game.levels\n end", "title": "" }, { "docid": "ecc9d45da691388007f0fc7bb8ad9dbf", "score": "0.66009706", "text": "def index\n @game = Game.find(params[:game_id])\n @levels = @game.levels\n end", "title": "" }, { "docid": "43cc44561b1d35d6977c1c989aa16b6a", "score": "0.6489144", "text": "def get_game_levels\n\t\tlevels = Level.order(\"points DESC\").all\n\t\trender :json => levels.map{|level| level.as_json(:only=>[:id,:name,:points],:methods => :image)}.to_json\n\tend", "title": "" }, { "docid": "9c83c38a0e384c893a89111625f114fb", "score": "0.64478135", "text": "def show\n @competency_level = CompetencyLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @competency_level }\n end\n end", "title": "" }, { "docid": "082bba4217dd49859ba4d40c78129c82", "score": "0.6403779", "text": "def show\n @level = Level.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @level }\n end\n end", "title": "" }, { "docid": "662810e4c68e32b5631b9d5e175cb8c4", "score": "0.64015007", "text": "def get_levels_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: GamificationLevelingApi.get_levels ...\"\n end\n # resource path\n local_var_path = \"/leveling\"\n\n # query parameters\n query_params = {}\n query_params[:'filter_name'] = opts[:'filter_name'] if !opts[:'filter_name'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PageResourceLevelingResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: GamificationLevelingApi#get_levels\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "f80d7b693de7cf06b348061390dca6e9", "score": "0.6373728", "text": "def show\n @competetion_level = CompetetionLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @competetion_level }\n end\n end", "title": "" }, { "docid": "64914545c92efcedbfe1231e43d55a4c", "score": "0.6335313", "text": "def index\n @servicelevels = Servicelevel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @servicelevels }\n end\n end", "title": "" }, { "docid": "3b952a2001f68528b206a9db136d2cfc", "score": "0.6328236", "text": "def level\n nodes = EasyLevel.all\n inodes = IntermediateLevel.all\n dnodes = DifficultLevel.all\n cnodes = ChallengeLevel.all\n respond_to do |format|\n format.html { render :level, locals: { nodes: nodes, inodes: inodes, dnodes: dnodes, cnodes: cnodes} }\n end\n end", "title": "" }, { "docid": "34a6ccbdbd80f2155883808348a5934f", "score": "0.62668914", "text": "def index\n @gst_levels = GstLevel.where(hotel_src_id: current_user.hotel_src_id).page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @gst_levels }\n end\n end", "title": "" }, { "docid": "2e9d457a74fbd09067b9afe4b1010d68", "score": "0.625367", "text": "def index\n @game_levels = @game.game_levels\n end", "title": "" }, { "docid": "7e81194c1765ab2c0c7b1c576b83abe3", "score": "0.62463313", "text": "def index\n @levels = Level.all\n end", "title": "" }, { "docid": "7e81194c1765ab2c0c7b1c576b83abe3", "score": "0.62463313", "text": "def index\n @levels = Level.all\n end", "title": "" }, { "docid": "7e81194c1765ab2c0c7b1c576b83abe3", "score": "0.62463313", "text": "def index\n @levels = Level.all\n end", "title": "" }, { "docid": "7e81194c1765ab2c0c7b1c576b83abe3", "score": "0.62463313", "text": "def index\n @levels = Level.all\n end", "title": "" }, { "docid": "7e81194c1765ab2c0c7b1c576b83abe3", "score": "0.62463313", "text": "def index\n @levels = Level.all\n end", "title": "" }, { "docid": "a18b0206a932cd61e13b4d0082b799a0", "score": "0.62079656", "text": "def show\n @servicelevel = Servicelevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @servicelevel }\n end\n end", "title": "" }, { "docid": "737653b5dfbe4a42357274411f96e9d4", "score": "0.6200792", "text": "def guidence\n @sport_level = SportLevel.find(params[:sport_level_id])\n end", "title": "" }, { "docid": "2c0cab2c8151f4a79c92206574b258a7", "score": "0.614545", "text": "def index\n @course_levels = CourseLevel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @course_levels }\n end\n end", "title": "" }, { "docid": "b2ec300327b76fabb59319239900da21", "score": "0.6088715", "text": "def create\n @sport_level = SportLevel.new(params[:sport_level])\n\n respond_to do |format|\n if @sport_level.save\n format.html { redirect_to @sport_level, :notice => 'Sport level was successfully created.' }\n format.json { render :json => @sport_level, :status => :created, :location => @sport_level }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @sport_level.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b444aa2bca0efbd1f4cd029bcb37d2cb", "score": "0.6085394", "text": "def levels\n self.dig_for_integer(\"levels\")\n end", "title": "" }, { "docid": "5bb6eac3f8a42618e700bda45ddcb5e3", "score": "0.60704947", "text": "def new\r\n @levels = session[:kingdom].levels\r\n end", "title": "" }, { "docid": "f0dc6864dd8dfcdaaba93dc48c16d468", "score": "0.60626405", "text": "def show\n @course_level = CourseLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course_level }\n end\n end", "title": "" }, { "docid": "f6fad5703731f9f61fa44983d2ad2eba", "score": "0.60608846", "text": "def level\n level = params[:id]\n numItems = params[:number]\n # Don't try to return more than 10 items (performance)\n if numItems.to_i > 10 || numItems.to_i < 1\n render json: {error: \"Max 10 Items, Min 5 items\", status: 403}.to_json\n return\n end\n # Load items by level and limit to request < 10\n puts \"Level: #{level}, numItems: #{numItems}\"\n @items = Item.where(level_id: level).limit(numItems);\n # Ensure enough items exists\n if @items.empty?\n render json: {error: \"No items available\", status: 400}.to_json\n return\n # Everything is checked, return array of items\n end\n render json: @items.to_json\n end", "title": "" }, { "docid": "01f59b8641fd2d4f4b01e6f000490a80", "score": "0.605096", "text": "def show\n @production_level = ProductionLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @production_level }\n end\n end", "title": "" }, { "docid": "1132812283f8adfd0994670f9722860a", "score": "0.603196", "text": "def home\n @sport_level_id = params[:sport_level_id]\n end", "title": "" }, { "docid": "4b7f951e7921a857d4cb24ea4c6a0a26", "score": "0.6024309", "text": "def index\n @level_plays = LevelPlay.all\n render json: @level_plays, root: false \n end", "title": "" }, { "docid": "05dc1fa7bc3fadaebda85a8196a11bdf", "score": "0.602209", "text": "def index\n @auth_levels = AuthLevel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @auth_levels }\n end\n end", "title": "" }, { "docid": "3542aa491c412f7525f4c4741bd14e24", "score": "0.5997555", "text": "def index\n @playerlevels = @player.playerlevels.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @playerlevels }\n end\n end", "title": "" }, { "docid": "014e36a74f2aedeae30300ef8028454c", "score": "0.595796", "text": "def index\n @activity_levels = ActivityLevel.all\n end", "title": "" }, { "docid": "7d792e766c1f596ab096b4618758ec14", "score": "0.59511065", "text": "def level\n @json['level'].to_sym\n end", "title": "" }, { "docid": "04a695389a695526416ef68b96fe8a28", "score": "0.59472364", "text": "def level\n response[\"level\"]\n end", "title": "" }, { "docid": "7bd5f801d8321131758b6ea0994362b2", "score": "0.59256864", "text": "def index\n @monster_levels = MonsterLevel.all\n end", "title": "" }, { "docid": "bb30df8042e4aa4fe1c7138f1c2e7f97", "score": "0.59205", "text": "def index\n @memberlevels = Memberlevel.all\n end", "title": "" }, { "docid": "027c4bc5bbb8c6a7121c6517089c344d", "score": "0.5903577", "text": "def index\n @roast_levels = RoastLevel.all\n end", "title": "" }, { "docid": "bafd017691c981afa13ed0d50ea5f14d", "score": "0.58953375", "text": "def update_steam_level\n data = WebApi.json 'IPlayerService', 'GetSteamLevel', 1, steamid: @steam_id64\n @steam_level = data[:response][:player_level]\n end", "title": "" }, { "docid": "f2f41181027178bdda20525a6cf97dcd", "score": "0.5889967", "text": "def index\n @pain_levels = PainLevel.all\n respond_to do |format|\n format.html\n format.json { render json: @pain_levels }\n end\n end", "title": "" }, { "docid": "f0fda7d491648d447aff4e4fe01c4e6b", "score": "0.5888444", "text": "def show\n @community_level = CommunityLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @community_level }\n end\n end", "title": "" }, { "docid": "688efa7b35bc3c1a5b994acf0a486a9e", "score": "0.58741647", "text": "def index\n @structure_levels = StructureLevel.all\n end", "title": "" }, { "docid": "765d2b3b7856123ca90bd475da1430b1", "score": "0.5871216", "text": "def index\n @sponsorship_levels = @event.sponsorship_levels\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sponsorship_levels }\n end\n end", "title": "" }, { "docid": "73ca59b6135fc3e9def9e6833cb6cd3b", "score": "0.5851832", "text": "def show\n @experience_level = ExperienceLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @experience_level }\n end\n end", "title": "" }, { "docid": "a8bdfde7d8509fdf2c7b7fd9ddbc9ca2", "score": "0.58514667", "text": "def show\n render json: @level_play, root: false \n end", "title": "" }, { "docid": "b9c4272c49d4d69f0898fcfec17301e0", "score": "0.58469254", "text": "def show\n @auth_level = AuthLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @auth_level }\n end\n end", "title": "" }, { "docid": "a7413dd202168943c8675f23fb61f407", "score": "0.58434355", "text": "def index\n @level = Level.find_by_level_identifier(params[:level_id])\n @scores = @level.scores.order('steps ASC')\n render :json => @scores\n end", "title": "" }, { "docid": "ae1f2b35df221c77f79616aee54d86eb", "score": "0.5836085", "text": "def index\n @stagelevels = Stagelevel.all\n end", "title": "" }, { "docid": "ad72ccdd6342698dac20e921bdc4e039", "score": "0.5813973", "text": "def show\n @glevel = Glevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @glevel }\n end\n end", "title": "" }, { "docid": "d292ebcbab87b6a03d8cf609917e39c7", "score": "0.5799633", "text": "def index\n @puzzles = Puzzle.all\n @levels = @puzzles.group_by(&:level).sort_by { |a| a[0] }\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @puzzles }\n end\n end", "title": "" }, { "docid": "cc1351a8a17f738123cc88cfde4033a8", "score": "0.57940036", "text": "def index\n @challengelevels = Challengelevel.all\n end", "title": "" }, { "docid": "872aa650114a16ba32a5260a1fe0fb7d", "score": "0.57917327", "text": "def get_levels(opts = {})\n data, _status_code, _headers = get_levels_with_http_info(opts)\n return data\n end", "title": "" }, { "docid": "8817e552c6f4ef141a9ece0bed103d13", "score": "0.5781505", "text": "def get_swarm_levels html\n @profile.protoss_swarm_level = get_swarm_level :protoss, html\n @profile.terran_swarm_level = get_swarm_level :terran, html\n @profile.zerg_swarm_level = get_swarm_level :zerg, html\n end", "title": "" }, { "docid": "d2d5e03232a5f57171ac2b69ea3d8d11", "score": "0.5770769", "text": "def show\n if params[:activity_id]\n @level = Activity.find(params[:activity_id]).level\n else\n @level = Level.find(params[:id])\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @level }\n end\n end", "title": "" }, { "docid": "b9c3f2114c7afe488b5991d4cda703a9", "score": "0.57552916", "text": "def index\n @userlevels = Userlevel.all\n end", "title": "" }, { "docid": "3baea9088b4fb6fc59dbd018d4940499", "score": "0.5749741", "text": "def show\n @playerlevel = @player.playerlevels.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @playerlevel }\n end\n end", "title": "" }, { "docid": "fc6d7184b051fda87ad1d18bdf36b102", "score": "0.57449126", "text": "def show_level_name\n\t\trecords = Degree.where(['level like ? and name = ?', \"#{params[:level]}%\", params[:name]])\n\t\tdegrees = Array.new\n\n\t\trecords.each do |record|\n\t\t\tcents_rating = RatesMajor.find_by_sql [\n\t\t\t\t'SELECT avg(rating) AS average\n\t\t\t\tFROM rates_majors\n\t\t\t\tWHERE degree_id = ?',\n\t\t\t\trecord.id\n\t\t\t]\n\t\t\trecord = record.as_json\n\t\t\trecord[:average_rating] = cents_rating[0][:average].to_f\n\t\t\tdegrees << record.except('created_at', 'updated_at')\n\t\tend\n\n\t\tif degrees.present?\n\t\t\treturn render json: degrees, status: 200\n\t\telse\n\t\t\treturn render json: [], status: 404\n\t\tend\n\tend", "title": "" }, { "docid": "33268fb50505611e603d653ae25a913d", "score": "0.574051", "text": "def show\n @sport_facility = SportFacility.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sport_facility }\n end\n end", "title": "" }, { "docid": "0e819ac34d1ace6a5f9f9d8303de5946", "score": "0.57404006", "text": "def team_skills\n respond_to do |format|\n format.json { render json: @skill_category_service.get_hierarchy_checked(params[:team_id], SkillCategoryService::SKILL_SET_TYPES[:team_skills]) }\n end\n end", "title": "" }, { "docid": "f536822012b847a61d75600cb1d6cf3a", "score": "0.5737845", "text": "def index\n @sport = Sport.find(params[:sport_id])\n @teams = @sport.teams\n # @teams = Team.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end", "title": "" }, { "docid": "38a05cdbc4895889261ddd8a79385cac", "score": "0.5712219", "text": "def show\n @sport_level = SportLevel.find(\n :first,\n :conditions => {:user_id => current_user.id , :id => params[:id]}\n )\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @sport_level }\n end\n end", "title": "" }, { "docid": "1d0fad1c3f0759d648f502a1bad53865", "score": "0.5710508", "text": "def index\n monsters = {}\n Monster.all.each do |monster|\n all_levels = []\n monster.levels.each do |level|\n all_levels << level\n end\n monsters[monster.name] =\n {\n :levels => all_levels,\n :id => monster.id\n }\n end\n respond_to do |format|\n format.json { render json: monsters, status: :created }\n end\n end", "title": "" }, { "docid": "8dde58dce5a6169ab5b8008cbb0fb307", "score": "0.5705654", "text": "def show\n @positionlevel = Positionlevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @positionlevel }\n end\n end", "title": "" }, { "docid": "bc0a20c47c441e1d26d93dd6a5aed1b5", "score": "0.57033014", "text": "def new\n @sport_level = SportLevel.new\n \n respond_to do | format|\n format.html # new.html.erb\n format.xml { render :xml => @sport_level }\n end\n end", "title": "" }, { "docid": "6ba7fcddf8311cf1fa4a4195bb1ca95d", "score": "0.57006323", "text": "def show\n @gameName = params[\"gameName\"]\n @levelNames = Level.where(@gameName+'.levelname'=>{\"$exists\"=>true}).to_a.map {|x| x[@gameName][\"levelname\"]}\n if @levelNames.length==0\n @levelNames = Level.where(@gameName+'.levelName'=>{\"$exists\"=>true}).to_a.map {|x| x[@gameName][\"levelName\"]}\n end\n end", "title": "" }, { "docid": "d062fdd035f66e5c19c7c4a542ff0974", "score": "0.57004035", "text": "def show\n monster = {}\n monster[@monster.name] = @monster.levels\n monster[:id] = @monster.id\n respond_to do |format|\n format.json { render json: monster, status: :created }\n end\n end", "title": "" }, { "docid": "3909c9802364b21d906ffdd23b9d0d14", "score": "0.56969196", "text": "def index\n\t\tlevel = params[:level]\n\t\tparentId = params[:parentId]\n\n\t\tif level == nil\n\t\t\t@localities = Locality.all\n\t\telsif level == \"5\"\n\t\t\tRails.logger.info \"*******ok + level********\"\n\t\t\tparentId = parentId + \"%\"\n\t\t\t@localities = Locality.where(\"level = ? AND parentId like ?\", level, parentId).all\n\t\telse\n#\t@localities = Locality.select(:code, :parentId ,:name).where(level: level).all\n\t\t\tif parentId == nil\n\t\t\t\t@localities = Locality.where(level: level).all\n\t\t\telse\n\t\t\t\t@localities = Locality.where(\"level = ? AND parentId = ?\", level, parentId).all\n\t\t\tend\n\t\tend\n\t\trespond_with @localities\n end", "title": "" }, { "docid": "567c1cecf6a30d2ab1030163b1407217", "score": "0.56732893", "text": "def index\n @english_levels = EnglishLevel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @english_levels }\n end\n end", "title": "" }, { "docid": "24371a44829448b4c989d42bf987c13e", "score": "0.5664943", "text": "def index\n @complexitylevels = Complexitylevel.all\n end", "title": "" }, { "docid": "d9a91ca003af54a62344a23464ce2665", "score": "0.56552565", "text": "def show\n @gst_level = GstLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gst_level }\n end\n end", "title": "" }, { "docid": "f94950885b9af90bffe643c303f0168e", "score": "0.565184", "text": "def show\n @level_description = LevelDescription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @level_description }\n end\n end", "title": "" }, { "docid": "fe3de582a2724fa75c179201df447ec3", "score": "0.5651599", "text": "def load_levels\n @levels = @course.numbered_levels\n end", "title": "" }, { "docid": "fa9048c7fd1c54b45eed1cd5266e2d6d", "score": "0.564605", "text": "def find_level\n @level = Warp::Level.find_by user_id: @warp_user.id, code: params[:level_code]\n\tend", "title": "" }, { "docid": "637b8f7a569948696e9ba99f438d4464", "score": "0.5645042", "text": "def new\n @level = Level.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @level }\n end\n end", "title": "" }, { "docid": "9c818201a44bbe0546fe34f080200c15", "score": "0.56272256", "text": "def index\n @levels = Level.find_all_by_user_id(current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.js # index.html.erb\n format.xml { render :xml => @levels }\n end\n end", "title": "" }, { "docid": "996d96472a557ba475e2b3cc27e892e3", "score": "0.5623696", "text": "def index\n @vip_levels = @current_shop.vip_levels\n end", "title": "" }, { "docid": "66802374ab69058b6abc517aacfdf548", "score": "0.56218094", "text": "def index\n @training_levels = TrainingLevel.all\n end", "title": "" }, { "docid": "f151e9c2e8898b5fcd2e1f185e88a41e", "score": "0.56204385", "text": "def show\n @english_level = EnglishLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @english_level }\n end\n end", "title": "" }, { "docid": "5c2a7bee459b0a8ddbdb77af09eb4f3d", "score": "0.56162256", "text": "def update\n @sport_level = SportLevel.find(params[:id])\n\n respond_to do |format|\n if @sport_level.update_attributes(params[:sport_level])\n format.html { redirect_to @sport_level, :notice => 'Sport level was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @sport_level.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f05274fcb72b03cc2b8e9f040375f9a3", "score": "0.55955845", "text": "def get_games_with_sport_id\n @game = Game.where(sport_id: params[:id])\n render json: @game\n end", "title": "" }, { "docid": "354b281eaf88cb57f7c8e88f7df9d658", "score": "0.55952966", "text": "def create\n params[:sport_level][:user_id] = current_user.id\n @sport_level = SportLevel.new(params[:sport_level])\n \n respond_to do |format|\n if @sport_level.save\n format.html { redirect_to(sport_levels_url, :notice => 'Sport level was successfully created.') }\n format.xml { render :xml => @sport_level, :status => :created, :location => @sport_level }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @sport_level.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "310b5ef390c0d334d35ba09c57ac2c49", "score": "0.5592206", "text": "def new\n @servicelevel = Servicelevel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @servicelevel }\n end\n end", "title": "" }, { "docid": "1a1c05954bccc4ae1ea6a6097daf9158", "score": "0.5587392", "text": "def show\n render json: @league\n end", "title": "" }, { "docid": "ea5347fb244fd3a9464e81a165a7d5c6", "score": "0.5584657", "text": "def get_level endpoint\n\t\t\t\t@endpoints[endpoint.downcase][:Level]\n\t\t\tend", "title": "" }, { "docid": "d05d1ecba6df885c49ec8e08613ce38c", "score": "0.55838996", "text": "def get_level_with_http_info(name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: GamificationLevelingApi.get_level ...\"\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 GamificationLevelingApi.get_level\"\n end\n # resource path\n local_var_path = \"/leveling/{name}\".sub('{' + 'name' + '}', name.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'LevelingResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: GamificationLevelingApi#get_level\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "4cf8c0aadad553d5ef88871d60aa2a1f", "score": "0.5580013", "text": "def index\n level = params[:level]\n @items = Item.all\n respond_to do |format|\n format.html { render :index}\n format.json {render json: @items}\n end\n end", "title": "" }, { "docid": "edff68434ab3e187f135a0eebf5b2b2e", "score": "0.5578405", "text": "def index\n @trainer_levels = TrainerLevel.all\n end", "title": "" }, { "docid": "8b9d70e381132112b3711c6135398100", "score": "0.5576273", "text": "def show\n @card_level = CardLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @card_level }\n end\n end", "title": "" }, { "docid": "9742fdd68e335a6d414da91e548af6a8", "score": "0.557411", "text": "def level\n value = get :level\n value.nil? ? 0 : value\n end", "title": "" }, { "docid": "040bf597c1d165c6927799b45064fa42", "score": "0.5571237", "text": "def index\n @level_data_items = LevelDataItem(:user_id => current_user)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @level_data_items }\n end\n end", "title": "" }, { "docid": "a2feb9956eac7a257d97e3fd3f16e048", "score": "0.5570574", "text": "def show\n @question_level = QuestionLevel.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @question_level }\n end\n end", "title": "" }, { "docid": "49796ebb689f952437044e42c49a31d9", "score": "0.5570086", "text": "def show\n\t\trender json: @league\n\tend", "title": "" }, { "docid": "f59153998106fb5cdd173d0baa092e8f", "score": "0.5556046", "text": "def show\n @exam_level = ExamLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exam_level }\n end\n end", "title": "" }, { "docid": "1ff15c89a7fa8a3d692c068765af24da", "score": "0.5554799", "text": "def index\n @urgency_levels = UrgencyLevel.all\n end", "title": "" }, { "docid": "afb267658957f944ba9da371a26f1c03", "score": "0.55485225", "text": "def level\n case @level\n when 'collection', 'discipline'\n @level.to_sym\n when 'user'\n { user: @user }\n else\n { user_type: @level.downcase.to_sym }\n end\n end", "title": "" }, { "docid": "bb03276aa7ecdc12838db540b8a1a4a4", "score": "0.5543851", "text": "def index\n league = get_league\n @teams = league.teams\n render json: @teams, status: 201\n end", "title": "" }, { "docid": "8edfd596da43656cf90adc865a05a2cf", "score": "0.55409193", "text": "def show\n @workout_level = WorkoutLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @workout_level }\n end\n end", "title": "" }, { "docid": "f5ca2214ddf9763bdbb166d2beabeed4", "score": "0.5535439", "text": "def index\n @registry_levels = Registry::Level.paginate(:page => params[:page])\n end", "title": "" }, { "docid": "0f3f5e4bc2ed98619c47ad4bf8d3256a", "score": "0.5522603", "text": "def index\n respond_to do |format|\n format.html\n format.json { render json: @skill_category_service.get_hierarchy }\n end\n end", "title": "" }, { "docid": "cc24bd39f29c9be8e2a16f592a721bde", "score": "0.55210674", "text": "def index\n @levels = Level.where(category_id: params[:category_id])\n last_roadmap_id = params[:last_roadmap_id]\n @user_categories = UserCategory.get_more_roadmaps(session[:user_id], last_roadmap_id)\n @total_roadmaps = UserCategory.where(user_id: session[:user_id]).count()\n end", "title": "" } ]
ca7efa6f10efaa878a61c3033a62e1e6
GET /internship_instances/1 GET /internship_instances/1.xml
[ { "docid": "c817bef0b10e88075fd1caf5bab2c5a9", "score": "0.72875386", "text": "def show\n @internship_instance = InternshipInstance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @internship_instance }\n end\n end", "title": "" } ]
[ { "docid": "8ac30b00adc7f80efe49d4e06f030df2", "score": "0.72478193", "text": "def index\n @internship_instances = InternshipInstance.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @internship_instances }\n end\n end", "title": "" }, { "docid": "97450ad5c61e558d9e4652059e065701", "score": "0.6764131", "text": "def show\n @internship = Internship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @internship }\n end\n end", "title": "" }, { "docid": "0d7a6c1607e09e1f280e8603e7d50ca5", "score": "0.66659784", "text": "def new\n @internship_instance = InternshipInstance.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @internship_instance }\n end\n end", "title": "" }, { "docid": "fce2d28cf5be31c2dea400bdbca66a13", "score": "0.6241827", "text": "def index\n @internships = Internship.all\n end", "title": "" }, { "docid": "ac324549fcc39374568f63f16f714a35", "score": "0.6232404", "text": "def create\n @internship_instance = InternshipInstance.new(params[:internship_instance])\n\n respond_to do |format|\n if @internship_instance.save\n format.html { redirect_to(@internship_instance, :notice => 'Internship instance was successfully created.') }\n format.xml { render :xml => @internship_instance, :status => :created, :location => @internship_instance }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @internship_instance.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "58a157194d796595df0d823424c7a5ac", "score": "0.59911734", "text": "def show\n @internship = Internship.find(params[:id])\n @tasks = @internship.tasks.find_all\n @users = @internship.users\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @internship }\n end\n end", "title": "" }, { "docid": "58a157194d796595df0d823424c7a5ac", "score": "0.59911734", "text": "def show\n @internship = Internship.find(params[:id])\n @tasks = @internship.tasks.find_all\n @users = @internship.users\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @internship }\n end\n end", "title": "" }, { "docid": "fe805fc63834ad2a29f3b4c680a78dfa", "score": "0.59769475", "text": "def get_instances()\n @client.describe_instances({:layer_id => @layer[:layer_id]})[:instances]\n end", "title": "" }, { "docid": "9c40e242817070f8d826b2b75fbe2d2a", "score": "0.59581053", "text": "def index\n @active_internships = Internship.active\n @expired_internships = Internship.expired\n @my_internships = current_user.internships\n end", "title": "" }, { "docid": "2293a7b25bfe5b9fae465e3b4ac89742", "score": "0.589018", "text": "def instances\n get_json(instances_endpoint)\n end", "title": "" }, { "docid": "55372e750a68188c0bf406ca1deb9f5d", "score": "0.5876747", "text": "def destroy\n @internship_instance = InternshipInstance.find(params[:id])\n @internship_instance.destroy\n\n respond_to do |format|\n format.html { redirect_to(internship_instances_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "7cf808eb3dd64873099a815851c1ef54", "score": "0.5769835", "text": "def instance_list()\n\t\treturn return_reply('instance/list')\n\tend", "title": "" }, { "docid": "85fb077aa0181e9daf73532397844595", "score": "0.5736941", "text": "def instance_get_req(name)\n { :api_method => @compute.instances.get,\n :parameters => { 'project' => @options[:gce_project], 'zone' => DEFAULT_ZONE_NAME, 'instance' => name } }\n end", "title": "" }, { "docid": "4168f838839df3e658fadcb4b0d39aea", "score": "0.5731824", "text": "def set_internship\n @internship = Internship.find(params[:id])\n end", "title": "" }, { "docid": "4168f838839df3e658fadcb4b0d39aea", "score": "0.5731824", "text": "def set_internship\n @internship = Internship.find(params[:id])\n end", "title": "" }, { "docid": "4168f838839df3e658fadcb4b0d39aea", "score": "0.5731824", "text": "def set_internship\n @internship = Internship.find(params[:id])\n end", "title": "" }, { "docid": "4168f838839df3e658fadcb4b0d39aea", "score": "0.5731824", "text": "def set_internship\n @internship = Internship.find(params[:id])\n end", "title": "" }, { "docid": "5eeb9b4c6cd359a575fb42046865c83d", "score": "0.57056963", "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": "e44b4a417129d4191764b2f50cad97d0", "score": "0.5700156", "text": "def new\n @internship = Internship.new\n @user = current_user if current_user\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @internship }\n end\n end", "title": "" }, { "docid": "f3bbf8184dddf3f1d953f71cd70abaa1", "score": "0.567832", "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": "aa236c6fe0d5c88dd31c83a9c975e961", "score": "0.56653434", "text": "def show\n @instance_kind = InstanceKind.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @instance_kind }\n end\n end", "title": "" }, { "docid": "15548e01b9b278134b0d91cea28a206c", "score": "0.5642385", "text": "def index\n @instance_kinds = InstanceKind.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @instance_kinds }\n end\n end", "title": "" }, { "docid": "08301a59367c7c3abfb7ce94a1ac43fc", "score": "0.56352895", "text": "def show\r\n @internship_location = InternshipLocation.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @internship_location }\r\n end\r\n end", "title": "" }, { "docid": "49e091dd631bff0ac7c3d923dbddf7ce", "score": "0.5593852", "text": "def query_instances\n instances_by_href = {}\n if (instances_by_href = @instance_cache.get) == nil\n @log.info \"Querying instances from RightScale API (might take a few minutes)...\"\n instances = instance_helper.get_unmanaged_instances\n instances_by_href = instances.inject({}) {|new_hash, instance| instance.show ; new_hash[instance.href] = existing_name(instance); new_hash}\n @instance_cache.set(instances_by_href)\n end\n @log.debug \"instances_by_href: #{instances_by_href.inspect}\"\n instances_by_href\n end", "title": "" }, { "docid": "e0fbbb9be8c88f206ca852d74cdfb55a", "score": "0.55883235", "text": "def list\n instances = swirl.call(\"DescribeInstances\")\n\n lookup = {}\n instances[\"reservationSet\"].each {|r| r[\"instancesSet\"].each { |i| lookup[i[\"imageId\"]] = nil } }\n amis = swirl.call(\"DescribeImages\", \"ImageId\" => lookup.keys)[\"imagesSet\"]\n\n amis.each do |ami|\n name = ami[\"name\"] || ami[\"imageId\"]\n if !ami[\"description\"] || ami[\"description\"][0..1] != \"%%\"\n # only truncate ugly names from other people (never truncate ours)\n name.gsub!(/^(.{8}).+(.{8})/) { $1 + \"...\" + $2 }\n name = \"(foreign) \" + name\n end\n lookup[ami[\"imageId\"]] = name\n end\n\n instances[\"reservationSet\"].each do |r|\n r[\"instancesSet\"].each do |i|\n name = lookup[i[\"imageId\"]]\n puts \"%-15s %-15s %-15s %s\" % [ i[\"instanceId\"], i[\"ipAddress\"] || \"no ip\", i[\"instanceState\"][\"name\"], name ? name : i[\"imageId\"]]\n end\n end\n end", "title": "" }, { "docid": "b9e4a0d23e92422d7841805be8496a60", "score": "0.5573674", "text": "def show\n @contato_interno = ContatoInterno.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @contato_interno }\n end\n end", "title": "" }, { "docid": "dcf22bfb6ce500bc27dc109082ca59f9", "score": "0.5558718", "text": "def show\n @network_allocation = NetworkAllocation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @network_allocation }\n end\n end", "title": "" }, { "docid": "c5936161be6d992ef33b94c8baf95da7", "score": "0.5555193", "text": "def show\n @instancetype = Instancetype.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @instancetype }\n end\n end", "title": "" }, { "docid": "d49ed44011e27ca3682731a15b70119f", "score": "0.55539626", "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": "9f126018ffbfc286b600ac1dfcf943f1", "score": "0.5551486", "text": "def index\n @instances = Instance.all\n end", "title": "" }, { "docid": "9f126018ffbfc286b600ac1dfcf943f1", "score": "0.5551486", "text": "def index\n @instances = Instance.all\n end", "title": "" }, { "docid": "fc713acc13cef9c684d24d5c82b1eaec", "score": "0.55390877", "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": "0a9135dd0ffef41ce797f70560796950", "score": "0.5537073", "text": "def cabot_instance_get(name)\n instances = JSON.parse(get_request(\"instances/\").body)\n instance = instances.find {|h1| h1['name']==\"#{name}\"}\n\n return instance\nend", "title": "" }, { "docid": "3c6d2c8e48cb8ac2bb8f584a2f82068a", "score": "0.5535529", "text": "def index\n @ship_classes = ShipClass.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ship_classes }\n end\n end", "title": "" }, { "docid": "8043489a213f505116e687a982c18d8e", "score": "0.5534852", "text": "def index\n @project_instances = ProjectInstance.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @project_instances }\n end\n end", "title": "" }, { "docid": "5bf9cf469139c45d6fffe66775200900", "score": "0.55309296", "text": "def show\n @server = Server.accessible_by(current_ability).find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @server }\n end\n end", "title": "" }, { "docid": "dee41160c1cd9449c9fdfbab080046d6", "score": "0.5529042", "text": "def get_instances\n @resp.reservations.each do |i|\n @stopped_instances.push(i.instances[0][:instance_id])\n end\nend", "title": "" }, { "docid": "87a620e295542b8ebbc477c2adc55a84", "score": "0.5518814", "text": "def index\r\n\r\n @instances = Instance.all\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @instances }\r\n end\r\n end", "title": "" }, { "docid": "7d1113efa7c291aaf3fc685f678aed8b", "score": "0.5510317", "text": "def index\n #Wenn Schiffe existieren\n @ship = Ship.find(params[:ship_id])\n @ships_stations = @ship.ships_stations\n end", "title": "" }, { "docid": "5a7ce4d77c72ab6d37e016b616a19568", "score": "0.5509609", "text": "def show\n @ship_class = ShipClass.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ship_class }\n end\n end", "title": "" }, { "docid": "37312283e2500b6f7830efc08d4e004c", "score": "0.54966384", "text": "def get_instances\n logger.info \"getting instances for #{@hostname}\"\n compute_url=\"#{@compute_url}/servers/detail?all_tenants=true\"\n response_raw=RestClient::Request.execute(method: :get, :url => compute_url, headers: {\"X-Auth-Token\" => @token}, :verify_ssl => false)\n json_data = JSON.parse(response_raw.body)[\"servers\"]\n logger.info \"recieved #{json_data.count} instances from #{@hostname}\"\n json_data\n end", "title": "" }, { "docid": "068126006e29ebbad4862fcadde441e1", "score": "0.547136", "text": "def index\n @internship_applications = InternshipApplication.all\n end", "title": "" }, { "docid": "1fff9df9e004479584363e270349c084", "score": "0.54701865", "text": "def update\n @internship_instance = InternshipInstance.find(params[:id])\n\n respond_to do |format|\n if @internship_instance.update_attributes(params[:internship_instance])\n format.html { redirect_to(@internship_instance, :notice => 'Internship instance was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @internship_instance.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "29bd76b707c63800f5290ab04f36168b", "score": "0.5470073", "text": "def instance_list_req\n { :api_method => @compute.instances.list,\n :parameters => { 'project' => @options[:gce_project], 'zone' => DEFAULT_ZONE_NAME } }\n end", "title": "" }, { "docid": "cfeaecf1da272b77e4bd0f649e78569d", "score": "0.5464911", "text": "def show\n @gossip = Gossip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gossip }\n end\n end", "title": "" }, { "docid": "f74b238658cb4f3911335a47f295ec39", "score": "0.54589623", "text": "def get_instances\n\t\t\[email protected]()\n\t\tend", "title": "" }, { "docid": "f933dc1d2725d72be5ffcb7df1a77d94", "score": "0.545774", "text": "def instance_info(id=0)\n\t\treturn return_reply('instance/info', { 'id' => id })\n\tend", "title": "" }, { "docid": "43682b8390135ddd2574302bd280d5bb", "score": "0.54490906", "text": "def show\r\n @intern_request = InternRequest.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @intern_request }\r\n end\r\n end", "title": "" }, { "docid": "05c38e3a073c1a189bab54ee0f3eb34d", "score": "0.5445039", "text": "def index\n @instances = current_account.instances.all(:order => \"aws_image_id asc\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @instances }\n end\n end", "title": "" }, { "docid": "b592938580ab967220bca1c22fad206b", "score": "0.54427403", "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": "eca254ca966e57eee13641489c7f4a19", "score": "0.54414594", "text": "def list_instance(optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'GET'\n\t\targs[:query]['Action'] = 'ListInstance'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tself.run(args)\n\tend", "title": "" }, { "docid": "eca254ca966e57eee13641489c7f4a19", "score": "0.54414594", "text": "def list_instance(optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'GET'\n\t\targs[:query]['Action'] = 'ListInstance'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tself.run(args)\n\tend", "title": "" }, { "docid": "ab03b3c1fda4d37f1d0abe6227083fa1", "score": "0.5438275", "text": "def show\n @iteration = Iteration.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @iteration }\n end\n end", "title": "" }, { "docid": "ab03b3c1fda4d37f1d0abe6227083fa1", "score": "0.5438275", "text": "def show\n @iteration = Iteration.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @iteration }\n end\n end", "title": "" }, { "docid": "ab03b3c1fda4d37f1d0abe6227083fa1", "score": "0.5438275", "text": "def show\n @iteration = Iteration.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @iteration }\n end\n end", "title": "" }, { "docid": "ab03b3c1fda4d37f1d0abe6227083fa1", "score": "0.5438275", "text": "def show\n @iteration = Iteration.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @iteration }\n end\n end", "title": "" }, { "docid": "db87dbbb3a9040cb833f5f8ad8bfb0f7", "score": "0.54333764", "text": "def show\n @cluster = Cluster.find(params[:id])\n\t\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @cluster }\n end\n end", "title": "" }, { "docid": "ce37142bb7aaa8598c538021824c03ca", "score": "0.5418835", "text": "def show\n @hostship = Hostship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @hostship }\n end\n end", "title": "" }, { "docid": "361ee43c4b7e0db40fe0a07b8f221555", "score": "0.54184026", "text": "def find instance_id\n params = {\n \"InstanceId.1\" => instance_id\n }\n\n response = @client.action \"DescribeInstances\", params\n\n Response::Compute.new response.body['DescribeInstancesResponse']['reservationSet']['item']\n end", "title": "" }, { "docid": "8b1332582b89e9733e6f6dee1914ba52", "score": "0.54116094", "text": "def show\n intern = Intern.find_by(id: params[:id])\n\n render json: InternSerializer.new(intern).serialized_json\n end", "title": "" }, { "docid": "4637dac5a3b5afed886330c5bd0a2f08", "score": "0.5411007", "text": "def show\n @ship_attribute = ShipAttribute.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ship_attribute }\n end\n end", "title": "" }, { "docid": "c1c394d513a94e911dce0c71d653127d", "score": "0.54063815", "text": "def index\n @reservable_instances = ReservableInstance.all\n end", "title": "" }, { "docid": "98233f4a26631bb7af1d70b644eddfcf", "score": "0.54063", "text": "def show\n @internships = @intern.internships.order('data_inicio')\n end", "title": "" }, { "docid": "71ed8f40c16eb5d968beb62ccc1a56d5", "score": "0.53976184", "text": "def show\n @pool = Pool.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @pool }\n end\n end", "title": "" }, { "docid": "19484edadb4a55c471f77e186085dd36", "score": "0.538437", "text": "def show\n @incident_request = Icm::IncidentRequest.list_all.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @incident_request }\n end\n end", "title": "" }, { "docid": "c99b364b8847dfef5e292b93c873d41a", "score": "0.53795344", "text": "def show\n @ship_type = ShipType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ship_type }\n end\n end", "title": "" }, { "docid": "ffbe2e505a01b4df975a71cab6ea5f18", "score": "0.53763735", "text": "def index\n @interns = Intern.all\n end", "title": "" }, { "docid": "2e5b8c5323d9db50ad88add8e1338982", "score": "0.536744", "text": "def create\n @internship = Internship.new(params[:internship])\n @internship.user_id = current_user.id\n\n respond_to do |format|\n if @internship.save\n format.html { redirect_to(internships_path, :notice => 'Internship was successfully created.') }\n format.xml { render :xml => @internship, :status => :created, :location => @internship }\n else\n flash[:error] = @internship.errors.full_messages.join(\"<br>\")\n format.html { render :action => \"new\" }\n format.xml { render :xml => @internship.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1185b57c3847a37aa02f13deec9ad397", "score": "0.53541434", "text": "def show\n @internships_task = InternshipsTask.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @internships_task }\n end\n end", "title": "" }, { "docid": "53047c36be1a5446d411148ee1a5995b", "score": "0.5353999", "text": "def create\n @internship = current_user.internships.new(internship_params)\n\n respond_to do |format|\n if @internship.save\n format.html { redirect_to internships_url, notice: 'Internship was successfully created.' }\n else\n format.html { render action: 'new' }\n format.json { render json: @internship.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "393bcf6daf50a719a437d2b48aa9fce4", "score": "0.53469175", "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": "cf6788888979ee514cad39fc2647c3ad", "score": "0.5320237", "text": "def index\n if current_user.activeShip == nil\n redirect_to :controller => 'ships', :action => 'new'\n return\n end\n @unit_instances = UnitInstance.all\n end", "title": "" }, { "docid": "58c927c0dcd7bc8a0e078c6c75e443e0", "score": "0.5316756", "text": "def show\n @host = Host.find(params[:id])\n @stages = @host.stages.uniq.sort_by{|x| x.project.name}\n @ips = @host.content.split\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @host.to_xml }\n end\n end", "title": "" }, { "docid": "daa9719967f549c8f66e996aaa680b17", "score": "0.5313527", "text": "def fetch_info(id)\n ii = InstanceInfo.new(id)\n end", "title": "" }, { "docid": "8928eebf71133bf8bbfef10bf79a5d76", "score": "0.53038275", "text": "def new\n @internship = Internship.new\n @companies = Company.all\n @situations = Situation.all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @internship }\n end\n end", "title": "" }, { "docid": "afd77e3ffbd9db8eb77f889503fd27f2", "score": "0.53031754", "text": "def index\n interns = Intern.all\n \n render json: InternSerializer.new(interns).serialized_json\n end", "title": "" }, { "docid": "57c2f3745c087cf4429489cc7d48155b", "score": "0.52951425", "text": "def show\n @backup_server = BackupServer.accessible_by(current_ability).find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @backup_server }\n end\n end", "title": "" }, { "docid": "d13a63b064d5f86af3268ee14a9a29fd", "score": "0.52911174", "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": "04691c59ee22007229684d54288aac5a", "score": "0.528432", "text": "def index\n @interns = Intern.all\n render_json_serializer(@interns)\n end", "title": "" }, { "docid": "0eb809381d474f639e60b318a303a57c", "score": "0.5280426", "text": "def show\n @server = Server.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @server }\n end\n end", "title": "" }, { "docid": "6d345c3b08d30038cb9b619f5c6a2684", "score": "0.5279851", "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": "feb096a4259061f424dc1b5d5d8dcc3a", "score": "0.5277611", "text": "def index\n @invites = Invite.all\n\n respond_to do |format|\n format.html\n format.xml { render xml: @invites }\n end\n end", "title": "" }, { "docid": "ef1452e307c3d5346574cd48f01ef44b", "score": "0.52747273", "text": "def list_instance_infos(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'ListInstanceInfos'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :event_type\n\t\t\targs[:query]['EventType'] = optional[:event_type]\n\t\tend\n\t\tif optional.key? :instance_ids\n\t\t\targs[:query]['InstanceIds'] = optional[:instance_ids]\n\t\tend\n\t\tif optional.key? :instance_name\n\t\t\targs[:query]['InstanceName'] = optional[:instance_name]\n\t\tend\n\t\tif optional.key? :instance_type\n\t\t\targs[:query]['InstanceType'] = optional[:instance_type]\n\t\tend\n\t\tif optional.key? :jst_owner_id\n\t\t\targs[:query]['JstOwnerId'] = optional[:jst_owner_id]\n\t\tend\n\t\tif optional.key? :page_number\n\t\t\targs[:query]['PageNumber'] = optional[:page_number]\n\t\tend\n\t\tif optional.key? :page_size\n\t\t\targs[:query]['PageSize'] = optional[:page_size]\n\t\tend\n\t\tif optional.key? :region\n\t\t\targs[:query]['Region'] = optional[:region]\n\t\tend\n\t\tself.run(args)\n\tend", "title": "" }, { "docid": "b2a8234e0d49e1d1194a523651634f4d", "score": "0.5267204", "text": "def show\n @user = User.find(params[:id])\n @instances = @user.instances\n end", "title": "" }, { "docid": "c5479c93c3f9df4d03819843ea5c971d", "score": "0.5264409", "text": "def show\n @ship_item = ShipItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ship_item }\n end\n end", "title": "" }, { "docid": "bcafa25590077ec25f67bb74e72b594d", "score": "0.526066", "text": "def input_instance_id\n client.clouds(:id => cloud_id).show.instances.index[1].show.href.split('/')[-1]\nend", "title": "" }, { "docid": "89b4fcccbbc49f12fab8a51141ca0700", "score": "0.5259402", "text": "def show\n @occurrence = Occurrence.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @occurrence }\n end\n end", "title": "" }, { "docid": "84f37183e8415c56ebe9cf5ba83b6f61", "score": "0.5253547", "text": "def index\n #Wenn Schiffe existieren\n @ship = Ship.find(current_user.activeShip)\n @ships_stations = @ship.ships_stations\n end", "title": "" }, { "docid": "90fb23a00b2ab4e0335c9c4a1d10ff0d", "score": "0.5252862", "text": "def show\n @rack_node_assignment = RackNodeAssignment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @rack_node_assignment.to_xml(:dasherize => false) }\n end\n end", "title": "" }, { "docid": "4b05f741b040a21fcd7b64495054458f", "score": "0.52523905", "text": "def show\n @assigned_ship = AssignedShip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @assigned_ship }\n end\n end", "title": "" }, { "docid": "321bfc3ecff5a54697f072cd8a2c9ebe", "score": "0.5248796", "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": "79f0cbed1631672b2b3fcea363f9c310", "score": "0.52462023", "text": "def index\n if current_user.activeShip == nil \n redirect_to :controller => 'ships', :action => 'new'\n return\n end\n @facility_instances = FacilityInstance.all\n end", "title": "" }, { "docid": "47c7e89b8f8cf9a71280e04f1ab3d29c", "score": "0.52446324", "text": "def show\n @lookup_cogstatus = LookupCogstatus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lookup_cogstatus }\n end\n end", "title": "" }, { "docid": "767ea7b83f155650bc0483001f92de9f", "score": "0.52435696", "text": "def instance(instance_name)\n get_json(instance_endpoint(instance_name))\n end", "title": "" }, { "docid": "b0790741141ab542d25ad6cce7e81b98", "score": "0.5243182", "text": "def show\n @catalogo_institucion = CatalogoInstitucion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @catalogo_institucion }\n end\n end", "title": "" }, { "docid": "dfb5b4fbb6b4175e25de8935118f0bcb", "score": "0.52383494", "text": "def list_instances_information(ec2_client)\n result = ec2_client.describe_instances\n result.reservations.each do |reservation|\n if reservation.instances.count.positive?\n reservation.instances.each do |instance|\n puts \"-\" * 12\n puts \"Instance ID: #{instance.instance_id}\"\n puts \"State: #{instance.state.name}\"\n puts \"Image ID: #{instance.image_id}\"\n puts \"Instance type: #{instance.instance_type}\"\n puts \"Architecture: #{instance.architecture}\"\n puts \"IAM instance profile ARN: #{instance.iam_instance_profile.arn}\"\n puts \"Key name: #{instance.key_name}\"\n puts \"Launch time: #{instance.launch_time}\"\n puts \"Detailed monitoring state: #{instance.monitoring.state}\"\n puts \"Public IP address: #{instance.public_ip_address}\"\n puts \"Public DNS name: #{instance.public_dns_name}\"\n puts \"VPC ID: #{instance.vpc_id}\"\n puts \"Subnet ID: #{instance.subnet_id}\"\n if instance.tags.count.positive?\n puts \"Tags:\"\n instance.tags.each do |tag|\n puts \" #{tag.key}/#{tag.value}\"\n end\n end\n end\n end\n end\nend", "title": "" }, { "docid": "d443e38721dd9b0d2222300554c59fea", "score": "0.5238159", "text": "def instance_resource\n self.class.resource[\"#{self.id}\"]\n end", "title": "" }, { "docid": "d443e38721dd9b0d2222300554c59fea", "score": "0.5238159", "text": "def instance_resource\n self.class.resource[\"#{self.id}\"]\n end", "title": "" }, { "docid": "7104e7e0c74839283f487264c8618a68", "score": "0.52321273", "text": "def show\n @server_service = subdomain.servers.find(params[:server_id]).server_services.where('id = ?', params[:id])\n render :xml => @server_service \n end", "title": "" }, { "docid": "58cb46b34f9012aae12fd31bf156f9e9", "score": "0.5228778", "text": "def show_instances(list = [])\n instances = make_request(\"#{self.web_api}/api/instances\",Net::HTTP::Get,account, list)\n build_instances_hash(instances,account)\n end", "title": "" } ]
c9d41fe6817c0a0c484ed7e88bc47db6
GET /ad_matrix_categories/1 GET /ad_matrix_categories/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "9d86d42f292b4988e517f6b03d747383", "score": "0.7484336", "text": "def index\n @ad_matrix_categories = AdMatrixCategory.all\n end", "title": "" }, { "docid": "04779fc6a7223751fb3e79f2b7a6f82c", "score": "0.6854937", "text": "def get_categories\r\n categories = Taxonomy.get_categories\r\n render json: categories, root: 'categories', adapter: :json, status: :ok\r\n end", "title": "" }, { "docid": "400a06e2e7ace49ddcf6e9af9859f28f", "score": "0.67647564", "text": "def categories\n\t\trender :json => {:status => 1, :categories => {\"1\" => \"Apparel & Accessories\", \"2\" => \"Arts and Crafts\", \"3\" => \"Electronics\", \n\t\t\t\"4\" => \"Home Appliances\", \"5\" => \"Kids & Baby\", \"6\" => \"Movies, Music, Books & Games\", \"7\" => \"Motor Vehicles\", \n\t\t\t\"8\" => \"Office & Education\", \"9\" => \"Parties & Events\", \"10\" => \"Spaces & Venues\", \"11\" => \"Sports & Outdoors\", \"12\" => \"Tools & Gardening\", \"13\" => \"Other\"}}, :status => 200\n\t\treturn\n\tend", "title": "" }, { "docid": "dcbe8f43b83b52609a14701b97c10598", "score": "0.67556995", "text": "def index\n @mcategories = Mcategory.all\n end", "title": "" }, { "docid": "5764a0170d2f7500c118bf40f6e4a5d2", "score": "0.66192794", "text": "def categories\n\t\tbegin\n\t\t\t@categories = Category.select(:id, :name)\n\t\t\trender json: @categories\n\t\trescue Exception => e\n\t\t\terror_handling_bad_request(e)\n\t\tend\n\tend", "title": "" }, { "docid": "853d4de10e9fe85b609a6b8caae5a670", "score": "0.65953416", "text": "def set_ad_matrix_category\n @ad_matrix_category = AdMatrixCategory.find(params[:id])\n end", "title": "" }, { "docid": "ec462c117b73b6e0345659e5fb666eb4", "score": "0.6588796", "text": "def index\n @ad_matrix_category_headlines = AdMatrixCategoryHeadline.all\n end", "title": "" }, { "docid": "70e46f66e9ceeea7ffedf9a2a8c90515", "score": "0.6549075", "text": "def index\n @incidentcategories = Incidentcategory.all\n json_response(@incidentcategories)\n end", "title": "" }, { "docid": "6ac2d485c5584634e7f0ecc5e41bd346", "score": "0.650846", "text": "def index\n categories = @vertical.catgories.order('created_at DESC');\n render json: {status: 'SUCCESS', message:'Loaded categories', data:categories},status: :ok\n end", "title": "" }, { "docid": "3bdc95e2d702c7f51598a7c0d16c0894", "score": "0.6428558", "text": "def getCategoryAll()\n params = Hash.new\n return doCurl(\"get\",\"/category/all\",params)\n end", "title": "" }, { "docid": "ae939484b2c3a1f4b3216a4613476d97", "score": "0.6427396", "text": "def index\n categories = Category.all\n render json:categories\n end", "title": "" }, { "docid": "f0e4e07e981197a2110703b3489a2ba3", "score": "0.64252436", "text": "def get_category_list\n ret_hash = Rails.cache.fetch(\"zaim_api/category\", expired_in: 1.day) do\n json_categories = self.zaim_api.category\n tmp_ret_hash = {}\n json_categories['categories'].each do |value|\n tmp_ret_hash[value['id']] = value['name']\n end\n tmp_ret_hash\n end\n ret_hash\n end", "title": "" }, { "docid": "c8982d55f0b7a7c28de2076a26b64cdf", "score": "0.6332221", "text": "def index\n @mk_categories = MkCategoria.all\n end", "title": "" }, { "docid": "bfd63dcb51352b74e78c8601d76e8e0d", "score": "0.62494457", "text": "def GetCategory id\n\n APICall(path: \"categories/#{id}.json\")\n\n end", "title": "" }, { "docid": "b4003aac13a70ea843b56ff6b5a0bd3d", "score": "0.61926675", "text": "def categories\n\t\t\t@cat_cache ||= @db.js('musicthoughts.all_categories()').map {|c| c.merge(category: c[@lang]) }\n\t\t\t@cat_cache\n\t\tend", "title": "" }, { "docid": "f4d78fa3d3dd5aa58d7909d8c8de5c46", "score": "0.61853", "text": "def categories\n # @categories = Category.get_categories(@user.id)\n #@categories =Category.all.select(:id).select(:name).select(:description).select(:logo_url)\n @categories =Category.all\n user_cat= @user.categories.collect(&:id)\n categories = []\n @categories.each do |cat|\n cat_attr = cat.attributes\n user_cat.include?(cat.id) ? cat_attr.merge!('user_category' => true) : cat_attr.merge!('user_category' => false)\n categories << cat_attr\n end\n @categories = categories\n\n respond_to do |format|\n if @categories.blank?\n format.json {render json:{:success => false, :status_code => 404, :message => \"No category found\"}}\n format.xml {render xml:{:success => false, :status_code => 404, :message => \"No category found\"}}\n format.html {render json: {:success => false, :status_code => 404, :message => \"No category found\"}}\n else\n format.html {render json: {:success => true, :status_code => 200, :categories => @categories}}\n format.json {render json: {:success => true, :status_code => 200, :categories => @categories}}\n format.xml {render xml: {:success => true, :status_code => 200, :categories => @categories}}\n end\n end\n end", "title": "" }, { "docid": "a5c456f2ebb23b954b45f333d3a689a6", "score": "0.6180287", "text": "def getcategories\n category_size = RequirementCategory.all.length\n current_offset = (params[:payload][:pagenumber] - 1)*10\n direction = params[:payload][:direction]\n\n respond_to do |format|\n format.json {\n\n \tif current_offset + direction < category_size && current_offset + direction >= 0\n offset = current_offset + direction\n \t@categories = RequirementCategory.all.offset(offset).take(10) \n \trender :json => @categories\n else\n \trender :nothing => true, :status => 200, :content_type => 'text/html'\n end\n }\n end\n\n\tend", "title": "" }, { "docid": "2f69acd227ffe56eb4fda169499e1975", "score": "0.6179668", "text": "def index\n\n\n @categories = Category.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": "ca7e5727f53d99e1ce3ccc9eff969f26", "score": "0.61761355", "text": "def index\n @moment_categories = MomentCategory.all\n end", "title": "" }, { "docid": "3be7e52b77971a7b986b18c705b2a38c", "score": "0.6172606", "text": "def get_categories\n cats = []\n params.each do |k,v|\n if k.starts_with? \"category\"\n name = v\n num = cat_number(k) \n cats << [name,num]\n end\n end\n return cats\n end", "title": "" }, { "docid": "6c15126f62ed2e5c5817941289121a55", "score": "0.61633766", "text": "def categories(query_object)\n\t\tdata = do_get_json(CATEGORIES_ENDPOINT, query_object)\n\tend", "title": "" }, { "docid": "99f556cf1cee45bb926693bc0797098f", "score": "0.6148852", "text": "def getCategories(_, _, _)\n @db.categories\n end", "title": "" }, { "docid": "8fb11c432a8bb2c5fc11d5fb6181b5b5", "score": "0.61458737", "text": "def get_categories\n body = build_request(2935, 1501, \"ACTIVEHEADINGS\")\n response = send_to_localeze(body)\n xml_doc = respond_with_hash(Nokogiri::XML(response.to_xml).text)\n end", "title": "" }, { "docid": "578b1796ea286daee854bf0506a326c8", "score": "0.61448914", "text": "def show\n @mat_category = MatCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mat_category }\n end\n end", "title": "" }, { "docid": "79833803e9ec25fdf3752444bbb1420f", "score": "0.61436576", "text": "def index\n @categories = Category.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": "79833803e9ec25fdf3752444bbb1420f", "score": "0.6142712", "text": "def index\n @categories = Category.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": "79833803e9ec25fdf3752444bbb1420f", "score": "0.6142712", "text": "def index\n @categories = Category.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": "29135d9f9af52385cea31b59601fc85b", "score": "0.6132693", "text": "def index\n @categories = Category.all \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "title": "" }, { "docid": "ba972d2983e7117f6a5b8f7e60d47cf5", "score": "0.6122655", "text": "def category\n client.categories.find(data[\"categoryId\"])\n end", "title": "" }, { "docid": "35802ecc80da3ace95df8f771700702b", "score": "0.61218065", "text": "def GetCategories params = {}\n\n params = params.merge(path: 'categories.json')\n APICall(params)\n\n end", "title": "" }, { "docid": "c716f6acd884044467a80d395fab5c9a", "score": "0.6115685", "text": "def create\n @ad_matrix_category = AdMatrixCategory.new(ad_matrix_category_params)\n\n respond_to do |format|\n if @ad_matrix_category.save\n format.html { redirect_to @ad_matrix_category, notice: 'Ad matrix category was successfully created.' }\n format.json { render :show, status: :created, location: @ad_matrix_category }\n else\n format.html { render :new }\n format.json { render json: @ad_matrix_category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8bfa28feedd3792c91188eb9debf0f56", "score": "0.6110076", "text": "def all_categories\n end", "title": "" }, { "docid": "7d96fd1c55b7dccedb79c4802d5d3620", "score": "0.61093223", "text": "def get_categories(add_params = nil)\n params = {\n }\n api_call('/global/categories(.:format)',:get,params,add_params)\n end", "title": "" }, { "docid": "aa647e6050d34d4a9bd837dac34cba1e", "score": "0.6091523", "text": "def index\n @activity_categories = ActivityCategory.all\n end", "title": "" }, { "docid": "d2ccd09beeb6945eef0e5bdf63e6698b", "score": "0.608919", "text": "def index\n @all_categories = CateItem.all\n end", "title": "" }, { "docid": "031b4300228ecbb649f05386445b4552", "score": "0.60865754", "text": "def index\n @material_categories = MaterialCategory.all\n \n end", "title": "" }, { "docid": "c612a48830c29b0871322576e05501cd", "score": "0.60793525", "text": "def index\n\t @categories = Category.all\n\n\t respond_to do |format|\n\t\tformat.html # index.html.erb\n\t\tformat.json { render json: @categories }\n\t end\n\tend", "title": "" }, { "docid": "39e0107bb2069e4f165e636511c1ac9a", "score": "0.6075307", "text": "def index\n @forum_categories = ForumCategory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @forum_categories }\n end\n end", "title": "" }, { "docid": "faff6c84121ca31c60eb296fb52a51aa", "score": "0.60709244", "text": "def show\n @category = current_mall.categories.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "title": "" }, { "docid": "352f54a8efdae7ca90879f0271ece761", "score": "0.6067293", "text": "def get_category\n json_response({ message: 'NOT IMPLEMENTED' })\n end", "title": "" }, { "docid": "a949e7c5d87430e1f2da989dc6915741", "score": "0.6066211", "text": "def index\n @hive_categories = HiveInformation.all\n end", "title": "" }, { "docid": "00e199f645daad66b9f83738b0674d46", "score": "0.6052239", "text": "def categories\n parsed_json['data']\n end", "title": "" }, { "docid": "ce1428c71cd866b370d5fe139c430ddd", "score": "0.603159", "text": "def get_category id\n\t\t\t\t\tFreshdesk::Api::Client.convert_to_hash( @connection.get CATEGORIES, id )\n\t\t\t\tend", "title": "" }, { "docid": "922b9f725ef1e840599bf0395d9a5119", "score": "0.6030916", "text": "def index\n @categories = CategoryService.index\n end", "title": "" }, { "docid": "fc8500b141bddcc2149490a1693eb553", "score": "0.6015957", "text": "def categories(options = {})\n fetch_categories.at('categories').children_of_type('category').inject([]){ |r, i| r << parse_single_category_xml(i) }\n\tend", "title": "" }, { "docid": "d7e8cb818a2c50d3e0291f95ee7443b4", "score": "0.6014034", "text": "def index\n @accessory_categories = AccessoryCategory.all.order(\"updated_at DESC\").order(\"created_at DESC\")\n\n render json: @accessory_categories\n end", "title": "" }, { "docid": "43f40c3e49c6f285e6422876b0501f1c", "score": "0.5999194", "text": "def index\n categories = {\n \"categoryId\": params[:ids]\n }\n auction_categories = Auction::Category.list categories\n if auction_categories[:comm][:code] == \"200\"\n render json: {status: auction_categories[:comm][:code].to_i, msg: auction_categories[:comm][:msg], data: {auction_categories: auction_categories[:data]}}\n else\n render json: {status: auction_categories[:comm][:code].to_i, msg: auction_categories[:comm][:msg], data: {}}\n end\n end", "title": "" }, { "docid": "2c699e821d924a55e3b474af78def75b", "score": "0.5994329", "text": "def index\n @categories = collections_config.values\n end", "title": "" }, { "docid": "d33a8d3dcdfcc54551fcdaef51116b7c", "score": "0.59827036", "text": "def index\n\t@categories = Category.all\n\tend", "title": "" }, { "docid": "d1bd2d15ce909cef202fdeb37c04b531", "score": "0.5979834", "text": "def index\n @categories = Category.all\n @categories.each do |category|\n authorize! :read, category\n end\n render json: @categories\n end", "title": "" }, { "docid": "47c632e85e09046221e937d668437e77", "score": "0.59759986", "text": "def get_categories\n @categories = Category.all\n end", "title": "" }, { "docid": "2c1edb45ac1b043d62f39be939803df8", "score": "0.5975413", "text": "def get_categories()\n\t\tzomoato_categories_url = @base_uri + \"categories\"\n\t\tresponse = HTTParty.get(zomoato_categories_url, headers: @headers)\n\t\tif response.success?\n\t\t\t@categories = response.parsed_response\n\t\telse\n\t\t\traise response.response\n\t\tend\n\t\treturn @categories\n\tend", "title": "" }, { "docid": "97c67a6eae6c21eb58fa2fb05d55185f", "score": "0.59727806", "text": "def fetch_categories(count = ENV['DEFAULT_CATEGORY_COUNT'].to_i)\n max_category = 18418\n uri = \"http://jservice.io/api/categories?count=#{count}&offset=#{1+rand(max_category/count.to_f)}\"\n request = HTTParty.get(uri)\n data = JSON.parse(request.body)\nend", "title": "" }, { "docid": "3f54008ad1b157dbe1b3754917250700", "score": "0.5971122", "text": "def get_subcategories\r\n sub_categories = Taxonomy.get_subcategories\r\n render json: sub_categories, root: 'categories', adapter: :json, status: :ok\r\n end", "title": "" }, { "docid": "7659e0e2ef72a446ad5a9c065c624e78", "score": "0.59696734", "text": "def index\n @api_v1_group_categories = Api::V1::GroupCategory.all\n end", "title": "" }, { "docid": "c432ab9a5bc207d8baa2bc0ccddad91f", "score": "0.59559345", "text": "def getCategories\n @categories = []\n @categories << Category.new(name: \"All\", id: -1)\n @categories += Category.all\n end", "title": "" }, { "docid": "e8d9742b448f03e54cb22a2daad20714", "score": "0.5952808", "text": "def index\n @medium_categories = MediumCategory.all\n end", "title": "" }, { "docid": "b0745b066af7dacd61317054ea30728f", "score": "0.59454626", "text": "def get_categories\n @cards.each do |card|\n if [email protected]?(card.category)\n @categories << card.category\n end\n end\n @categories\n end", "title": "" }, { "docid": "6ff3dad6581e6c756cbccbd31507ce24", "score": "0.5943212", "text": "def index\n @talk_categories = TalkCategory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @talk_categories }\n end\n end", "title": "" }, { "docid": "3027d6442f2877fdf7dfe86d245ccbe4", "score": "0.594273", "text": "def index\n\t\t@categories = Category.all\n\tend", "title": "" }, { "docid": "a01f4a4692ab9441b0055c0d5e72a0f1", "score": "0.59414685", "text": "def meal_categories\n # API EXAMPLE: https://www.themealdb.com/api/json/v1/1/list.php?c=list\n content = api_call('list.php?c=list')\n validate(content)\n content\n end", "title": "" }, { "docid": "693f52d557d089f2f18e255142ed994b", "score": "0.5935611", "text": "def category\n # only returns first category currently\n if self.categories.empty?\n 1\n else\n self.categories[0] unless self.categories.empty?\n end\n end", "title": "" }, { "docid": "c60233d535a398f4d864ca7694d54aeb", "score": "0.5926528", "text": "def destroy\n @ad_matrix_category.destroy\n respond_to do |format|\n format.html { redirect_to ad_matrix_categories_url, notice: 'Ad matrix category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5f5f7e7600697a4c3da23f93f3df798f", "score": "0.59248936", "text": "def index\n @matrix = CourseMatrix.find(params[:course_matrix_id])\n @matrix_disciplines = MatrixDiscipline.where(:matrix_id => @matrix.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @matrix_disciplines }\n end\n end", "title": "" }, { "docid": "7dbe27f41f4e4b9f14f27de015fc90d5", "score": "0.5923985", "text": "def get_menu_category\n require \"rest_client\"\n require \"json\"\n\n self.categories.update_all(still_present: false)\n response = RestClient.get(\"https://api.omnivore.io/0.1/locations/#{self.omnivore_id}/menu/categories\", {:content_type => :json, :'Api-Key' => Setting.first.app_api_key})\n res = JSON.parse(response)\n res[\"_embedded\"][\"categories\"].each do |category|\n cat = self.categories.where(omnivore_id: category[\"id\"]).first_or_create\n cat.name = category[\"name\"]\n cat.still_present = true\n cat.save\n end\n\n self.categories.where(still_present: false).destroy_all\n end", "title": "" }, { "docid": "6ff13a86b30f83e31955f737ab3c6113", "score": "0.5913298", "text": "def index\n @adcategories = Adcategory.all\n end", "title": "" }, { "docid": "6bb7b7274339e01631776997086ff6c4", "score": "0.59076035", "text": "def index\n @categories = Category.all\n render :json => @categories, :except => [:created_at, :updated_at]\n end", "title": "" }, { "docid": "4049b8916f6826e3d573f8e66e5297ad", "score": "0.5901249", "text": "def index\n @matter_categories = MatterCategory.all\n end", "title": "" }, { "docid": "6dccdc9f4c6abaa43d5c7e7b47f83683", "score": "0.58937746", "text": "def index\n @question_categories = QuestionCategory.with_questions()\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @question_categories }\n end\n end", "title": "" }, { "docid": "dc85329eb0b9e99af6118cb9a6b02a5d", "score": "0.5890459", "text": "def index\n @categories = Category.all\n end", "title": "" }, { "docid": "dc85329eb0b9e99af6118cb9a6b02a5d", "score": "0.5890459", "text": "def index\n @categories = Category.all\n end", "title": "" }, { "docid": "dc85329eb0b9e99af6118cb9a6b02a5d", "score": "0.5890459", "text": "def index\n @categories = Category.all\n end", "title": "" }, { "docid": "dc85329eb0b9e99af6118cb9a6b02a5d", "score": "0.5890459", "text": "def index\n @categories = Category.all\n end", "title": "" }, { "docid": "dc85329eb0b9e99af6118cb9a6b02a5d", "score": "0.5890459", "text": "def index\n @categories = Category.all\n end", "title": "" }, { "docid": "dc85329eb0b9e99af6118cb9a6b02a5d", "score": "0.5890459", "text": "def index\n @categories = Category.all\n end", "title": "" }, { "docid": "dc85329eb0b9e99af6118cb9a6b02a5d", "score": "0.5890459", "text": "def index\n @categories = Category.all\n end", "title": "" }, { "docid": "dc85329eb0b9e99af6118cb9a6b02a5d", "score": "0.5890459", "text": "def index\n @categories = Category.all\n end", "title": "" }, { "docid": "dc85329eb0b9e99af6118cb9a6b02a5d", "score": "0.5890459", "text": "def index\n @categories = Category.all\n end", "title": "" }, { "docid": "dc85329eb0b9e99af6118cb9a6b02a5d", "score": "0.5890459", "text": "def index\n @categories = Category.all\n end", "title": "" }, { "docid": "dc85329eb0b9e99af6118cb9a6b02a5d", "score": "0.5890459", "text": "def index\n @categories = Category.all\n end", "title": "" }, { "docid": "dc85329eb0b9e99af6118cb9a6b02a5d", "score": "0.5890459", "text": "def index\n @categories = Category.all\n end", "title": "" }, { "docid": "dc85329eb0b9e99af6118cb9a6b02a5d", "score": "0.5890459", "text": "def index\n @categories = Category.all\n end", "title": "" }, { "docid": "dc85329eb0b9e99af6118cb9a6b02a5d", "score": "0.5890459", "text": "def index\n @categories = Category.all\n end", "title": "" }, { "docid": "dc85329eb0b9e99af6118cb9a6b02a5d", "score": "0.5890459", "text": "def index\n @categories = Category.all\n end", "title": "" }, { "docid": "dc85329eb0b9e99af6118cb9a6b02a5d", "score": "0.5890459", "text": "def index\n @categories = Category.all\n end", "title": "" }, { "docid": "dc85329eb0b9e99af6118cb9a6b02a5d", "score": "0.5890459", "text": "def index\n @categories = Category.all\n end", "title": "" }, { "docid": "dc85329eb0b9e99af6118cb9a6b02a5d", "score": "0.5890459", "text": "def index\n @categories = Category.all\n end", "title": "" }, { "docid": "dc85329eb0b9e99af6118cb9a6b02a5d", "score": "0.5890459", "text": "def index\n @categories = Category.all\n end", "title": "" }, { "docid": "dc85329eb0b9e99af6118cb9a6b02a5d", "score": "0.5890459", "text": "def index\n @categories = Category.all\n end", "title": "" }, { "docid": "dc85329eb0b9e99af6118cb9a6b02a5d", "score": "0.5890459", "text": "def index\n @categories = Category.all\n end", "title": "" }, { "docid": "dc85329eb0b9e99af6118cb9a6b02a5d", "score": "0.5890459", "text": "def index\n @categories = Category.all\n end", "title": "" }, { "docid": "dc85329eb0b9e99af6118cb9a6b02a5d", "score": "0.5890459", "text": "def index\n @categories = Category.all\n end", "title": "" }, { "docid": "dc85329eb0b9e99af6118cb9a6b02a5d", "score": "0.5890459", "text": "def index\n @categories = Category.all\n end", "title": "" }, { "docid": "291c3ac012820b20ee940e983fbcd6be", "score": "0.58895034", "text": "def categories\n category\n end", "title": "" }, { "docid": "4c40219c3305940002b5acdba762c94f", "score": "0.58892876", "text": "def get_categories_list\n args = receive_should_validate?\n get('redtube.Categories.getCategoriesList', {}, [], args[:should_validate])\n end", "title": "" }, { "docid": "2aee50874e20972de4574a9c5c699f6c", "score": "0.5886446", "text": "def budget_categories_data\n # @budget.budget_items.collect { |budget_item| budget_item.category.name.to_s }.to_json\n categories = Category.for_budget.to_a\n categories << Category.find_by_name(\"Miscellaneous\")\n return categories.collect { |category| category.name.to_s }.to_json\n end", "title": "" }, { "docid": "508c77fa84938129b6568aa9b26c02cc", "score": "0.58827186", "text": "def get_categories\n @redis.smembers category_collection_key\n end", "title": "" }, { "docid": "7744b5a215fd33f0e0f46e22fa171b8b", "score": "0.58812547", "text": "def index\n @brand_categories = BrandCategory.all\n\n render json: @brand_categories\n end", "title": "" }, { "docid": "c44b6948d384330cbe94372ba5377842", "score": "0.5879159", "text": "def index\n @small_categories = SmallCategory.category_tree\n end", "title": "" }, { "docid": "d5c5725f149696c86c58ccbde495c83d", "score": "0.5867229", "text": "def index\n @measurement_categories = MeasurementCategory.all\n end", "title": "" }, { "docid": "3a6208c54693af5dd73c4ac7ebb9656e", "score": "0.5864323", "text": "def category\n data['category']\n end", "title": "" } ]
930332ee9fc3c426cf5c64b955540e4c
Join all the category strings into a commaseparated string.
[ { "docid": "489ca05860cab08edb19591ed8b14340", "score": "0.7067317", "text": "def join_categories(categories)\n categories.reduce([]) { |union, category| union | category.values.map(&:downcase) }.join(\",\")\nend", "title": "" } ]
[ { "docid": "54b211a7a1cb504299340e704cd4d317", "score": "0.6974244", "text": "def get_some_category_name\n result = ''\n i = 0\n curriculum_categories.each do |category|\n if i.eql?0\n result += category.category_name\n else\n result += ','+category.category_name\n end\n i +=1\n if i.eql?CATEGORIES_PER_ITEM\n result += '...'\n break\n end\n end\n result\n end", "title": "" }, { "docid": "907ff742fad105bb16c69337a4d663ff", "score": "0.6936297", "text": "def category\n return '' if self.categories.empty?\n self.categories.join(', ')\n end", "title": "" }, { "docid": "4d30fc9389adb43da8e0c01445d309f7", "score": "0.6820614", "text": "def category\n return '' if self.categories.empty?\n self.categories.join(', ')\n end", "title": "" }, { "docid": "4d30fc9389adb43da8e0c01445d309f7", "score": "0.6820614", "text": "def category\n return '' if self.categories.empty?\n self.categories.join(', ')\n end", "title": "" }, { "docid": "a63edc25e756612cfa7525c7d7359a81", "score": "0.673479", "text": "def categories_as_string\n categories.map(&:title).sort.join(', ')\n end", "title": "" }, { "docid": "5a7bbf7c9fe52ffe56d200141715c3c8", "score": "0.6713184", "text": "def categories_as_string\n categories.map(&:title).sort.join(', ')\n\n end", "title": "" }, { "docid": "82452c6ddbb18f7f0452bfe98eef42a4", "score": "0.67017996", "text": "def my_join(separator='')\n string = ''\n self.each.each_with_index do |el, i| \n if i != self.length - 1\n string += el + separator \n else\n string += el\n end\n end\n string\n end", "title": "" }, { "docid": "1a541d5c274e6ecd0d2539f137f5f868", "score": "0.65622115", "text": "def ready_to_go_categories\n cats = self.categories.map(&:name)\n cats.join(' OR ')\n end", "title": "" }, { "docid": "175c30bb45a9aa670b0c73c6523f459e", "score": "0.6561065", "text": "def my_join(separator = \"\")\n joined = \"\"\n self.each { |ele| joined += (ele.to_s + separator) }\n joined.chomp(separator)\n end", "title": "" }, { "docid": "4b8184b212114312eb5a90a4f9278577", "score": "0.6555721", "text": "def get_categories\n if categories.blank?\n \"\"\n else\n categories.uniq.collect(&:name).join(\";\")\n end\n end", "title": "" }, { "docid": "50502a358113822829eb1bd03618bc9e", "score": "0.64901", "text": "def categories_string\n self.categories.pluck(:name).sort.join(\" \").downcase\n end", "title": "" }, { "docid": "c87ae20df07c5cebd15e2c1e610606d6", "score": "0.6451177", "text": "def category_list_of_job(add_spaces = false)\n category_list = ''\n self.categories.each do |cat|\n category_list << cat.name + ','\n category_list << ' ' if add_spaces\n end\n\n if add_spaces\n return category_list[0..(category_list.length - 3)].downcase\n else\n return category_list[0..(category_list.length - 2)].downcase\n end\n end", "title": "" }, { "docid": "37d078f2e89662be8245d2d49d16e139", "score": "0.6436825", "text": "def join_with_commas(before, *words, after)\n before + words.join(', ') + after\n end", "title": "" }, { "docid": "59c9f02c8212f077c63ce7555f56b1c9", "score": "0.64175916", "text": "def category_name\n @category_name ||= @combinations.map(&:category_name).join('|').intern\n end", "title": "" }, { "docid": "67b77f09281daa90856b11263c466c98", "score": "0.64085793", "text": "def my_join(seperator = \"\")\n joined = \"\"\n\n self.length.times do |i|\n joined += self[i]\n joined += seperator if i < self.length - 1\n end\n joined\n end", "title": "" }, { "docid": "9392154d2ab9fc5253ce1a611ea6fa11", "score": "0.64024174", "text": "def join_with_commas(*words)\n words.join(', ')\n end", "title": "" }, { "docid": "26d2e37ad6708389fe1cdb94570edbfe", "score": "0.6388187", "text": "def category_list_of_job(add_spaces = false)\n \tcategory_list = ''\n \tcategories.each do |cat|\n \t\tcategory_list << cat.name + ','\n \t\tif add_spaces: category_list << ' ' end\n \tend\n \t\n \tif add_spaces\n \t return category_list[0..(category_list.length - 3)].downcase\n\t else\n \treturn category_list[0..(category_list.length - 2)].downcase\n \tend\n end", "title": "" }, { "docid": "0e6b9c691bf5cdbb488cecc14cda7e99", "score": "0.636271", "text": "def custJoin(array, delimeter = \"\")\n # take the array and concat its string elements\n # together. Return final string.\n string = \"\" # initialize the return value\n last_index = array.length - 1 # This gets the last array element\n array.each_with_index do |elem, index|\n string << elem # take the element and add to string\n string << delimeter unless index == last_index # unless @ end, add the delimeter\n end\n string # return the final string\nend", "title": "" }, { "docid": "b430401e5ed42b08602cd5f9bc9ec0fd", "score": "0.6357873", "text": "def my_join(str = \"\")\n join = \"\"\n \n (0...self.length).each do |i|\n join += self[i]\n join += str unless i == self.length - 1\n end\n\n p join\n return join\n end", "title": "" }, { "docid": "541d0cd61c683ffbd45ce61ab7634c22", "score": "0.63498676", "text": "def categories_raw\n self.categories.join(\"|\") if categories.present?# and categories.class != String\n end", "title": "" }, { "docid": "bc89b36064647ecaf5bb86afc6164060", "score": "0.6332346", "text": "def join_with_commas(strings)\n result = \"\"\n strings.each do |string|\n result += \"#{string},\"\n end\n result\nend", "title": "" }, { "docid": "7f925a6f193c64d5affb6937bd59e46e", "score": "0.63297725", "text": "def categories_as_string= (new_categories)\n categories.clear\n\n new_categories.split(/\\s*,\\s*/).each do |title|\n cat = Category.with_title(title).first\n categories << cat if !cat.nil?\n end\n end", "title": "" }, { "docid": "ffa776f48e89481534e2df9e9a27ee4b", "score": "0.62635946", "text": "def my_join(join = '')\n res = ''\n self.each_index do |i|\n res += self[i] \n res += join if i != self.length - 1\n end\n res\n end", "title": "" }, { "docid": "59169c07ff8b0fc6614cb0687b868583", "score": "0.62547404", "text": "def my_join(space = \"\")\n str = \"\"\n\n self.each_with_index do |el, i|\n str += el\n str += space unless i == (self.length - 1)\n end\n str\n end", "title": "" }, { "docid": "6400524f99c5279e2c304d2d5c5c5bd4", "score": "0.6253528", "text": "def my_join(separator = \"\")\n result = \"\"\n\n length.times do |i|\n result << self[i].to_s\n result << separator unless i == length - 1\n end\n\n result\n end", "title": "" }, { "docid": "5b21f77eadd06c0020efa6d23fc55557", "score": "0.6236322", "text": "def my_join(seperator = '')\n joined = []\n\n self.length.times do |i|\n joined << self[i] \n joined << seperator unless i == self.length - 1\n end\n\n joined.join('')\n\tend", "title": "" }, { "docid": "af4c18a1e738e9fb09e2db5e7ed94bbe", "score": "0.62280655", "text": "def join_words(separator: \", \", conjunctive: \"and\", final_separator: nil)\n oxford_comma = final_separator || separator\n\n case words.length\n when 0\n \"\"\n when 1, 2\n words.join(\" #{conjunctive} \").gsub(WHITESPACE_REGEX, \"\\\\1\")\n else\n ((words[0...-1]).join(separator.to_s) +\n \"#{oxford_comma} #{conjunctive} \" + words[-1])\n .gsub(WHITESPACE_REGEX, \"\\\\1\").gsub(/\\s*(,)/, \"\\\\1\")\n end\n end", "title": "" }, { "docid": "b185529e591ee5eeffd75ef940c64947", "score": "0.62164396", "text": "def my_join(filler = \"\")\n ans = \"\"\n self.each {|ele| ans += (ele + filler) }\n ans.chomp(filler)\n end", "title": "" }, { "docid": "e63155b2f7e065332042e3d39de5afa5", "score": "0.62105256", "text": "def cat_strings(strings)\n new_string = \"\"\n strings.each { |string| new_string += string }\n new_string\nend", "title": "" }, { "docid": "e971e2ca9228956adfa66d279cad0882", "score": "0.61987746", "text": "def my_join(spacer = \"\")\n return_str = \"\"\n (0...self.length - 1).each do |idx| \n return_str += (self[idx] + spacer)\n end\n return_str + self[-1]\n end", "title": "" }, { "docid": "829cee8d0dfe8defba77b2ea9976fb4b", "score": "0.6193928", "text": "def join_with_commas(strings)\n result = \"\"\n index = 0\n while index < strings.length\n result += strings[index] + \",\"\n index += 1\n end\n result\nend", "title": "" }, { "docid": "9da37d918885d4e10e9aef0487c42c41", "score": "0.61935645", "text": "def join_tags\n tags.map {|tag| tag}.join(\" \") unless tags.nil? || tags.empty?\n end", "title": "" }, { "docid": "261ce500672f51ed4491113f911946b1", "score": "0.6164269", "text": "def my_join(str = \"\")\n new_str = \"\"\n self.each_with_index do |char, i|\n if i == self.length - 1\n new_str += char\n else\n new_str += char + str\n end\n end\n new_str\n end", "title": "" }, { "docid": "143bc3c908a9609496fa0a8ea538904c", "score": "0.6160375", "text": "def join_strings(name, adjective)\n name + \" is \" + adjective\nend", "title": "" }, { "docid": "8875b084b852a9967a7babb5c4ba0510", "score": "0.616015", "text": "def my_join(arr, separator = \"\")\n acc = \"\"\n arr.each_with_index do |s, i|\n acc += s\n acc += separator unless i == arr.length-1\n end\n acc\n\nend", "title": "" }, { "docid": "7d4494f016f213bfd521f652e8ac3edc", "score": "0.6157848", "text": "def get_formatted_category_field(record)\n record.categories.map do |category|\n category.try(:name)\n end\n .join(DELIMITER)\n end", "title": "" }, { "docid": "dbd20e7ba79f7bceb16f7fe4d36a96dd", "score": "0.6138686", "text": "def my_join(s='')\n \n str = ''\n each do |char|\n str += char + s\n end\n return str\n end", "title": "" }, { "docid": "ee464301f2036017d5f80dcfcc8c39c4", "score": "0.61150926", "text": "def joinTags\n tags = []\n self.tags.each do |tag|\n tags << tag.name\n end\n \n return tags.join(\", \")\n end", "title": "" }, { "docid": "1b7e94514d9ce93da051241e463c3c7b", "score": "0.6109945", "text": "def join_with_commas(*words)\n words.join(', ')\nend", "title": "" }, { "docid": "1b7e94514d9ce93da051241e463c3c7b", "score": "0.6109945", "text": "def join_with_commas(*words)\n words.join(', ')\nend", "title": "" }, { "docid": "84b09d72987a2cbf0ae4b4526048cc12", "score": "0.6104727", "text": "def custom_join(array,delimiter=\"\")\n newWord = \"\"\n array.each_with_index do |ele,i|\n if ele.is_a?(String)\n newWord+=ele #or we can use newWord<<ele<<delimiter\n newWord+=delimiter if i!=array.length-1\n elsif !ele.is_a?(Array)\n newWord+=ele.to_s\n newWord+=delimiter if i!=array.length-1\n end\n end\n return newWord\nend", "title": "" }, { "docid": "5b073f4d90c91e280cee334084bbc6cd", "score": "0.6103402", "text": "def my_join(var = \"\")\n str = \"\"\n self.each do |el|\n str += el + var\n end\n return str[0..-2] if var != \"\"\n str\n end", "title": "" }, { "docid": "d0a794c56d188398fcd0c85fbbe1f0f6", "score": "0.6101108", "text": "def category_list\n categories.map(&:name).join(', ')\n end", "title": "" }, { "docid": "3298754e3484d4eb9989975fe6729af0", "score": "0.607449", "text": "def join_words(word1, word2, word3)\n return \"#{word1} #{word2} #{word3}\"\n end", "title": "" }, { "docid": "07f202136bfe707f982c85a57ca9e9c9", "score": "0.607169", "text": "def my_join(arr, separator = \"\")\n s = \"\"\n arr.each { |ch| s << ch.to_s + separator }\n s.chop\nend", "title": "" }, { "docid": "c61820bed4ea9661cd40f1eacb911846", "score": "0.6037803", "text": "def my_join(arr, separator = \"\")\n new_string = \"\"\n \n arr.each do |item|\n new_string += item + separator\n end\n\n return new_string if separator == \"\"\n new_string[0...-1]\nend", "title": "" }, { "docid": "fd50e4c7f186ef6d3843b94cd201ace6", "score": "0.60374105", "text": "def categories_sentence; self.categories.map(&:name).to_sentence end", "title": "" }, { "docid": "7704694b5be9beecc3db5d3e5ca263d2", "score": "0.6029489", "text": "def collatable_cutter_stuff\n return '' unless cutter?\n collapse_strip(cutter_stuff.gsub('.', ' '))\n end", "title": "" }, { "docid": "314d9572fb7c84faf9b9d5b1c1d41b28", "score": "0.60095155", "text": "def my_join(arr, separator = \"\")\n \n i = 0\n string = \"\"\n while i < arr.length \n string = string + arr[i]\n strign = strign + seperator unless i == arr.length - 1\n i = i + 1 \n end\n return string\n\nend", "title": "" }, { "docid": "018e800b9a89f1df58351b747248f778", "score": "0.6002881", "text": "def categories_full_list\n self.categories.all.map { |c| c.name }.join(', ')\n end", "title": "" }, { "docid": "9ccbfb443d8de2d989058221a0251371", "score": "0.5998778", "text": "def my_join(arr, separator = \"\")\n str = \"\"\n arr.each_with_index do |el,index|\n str += el\n if index < arr.length - 1\n str += separator\n end\n end\n return str\nend", "title": "" }, { "docid": "d25b13290e5a6524dad60b6e82b038ad", "score": "0.59986985", "text": "def my_join(arr, separator = \"\")\n final_str = \"\"\n arr.each_with_index do |element, idx|\n final_str << element\n final_str << separator if idx != arr.length - 1\n end\n return final_str\nend", "title": "" }, { "docid": "125eb27cfd4657483349a626e31b0d8f", "score": "0.59921235", "text": "def custom_join(array, delimiter = '') # we set here a default delimiter\n string = '' # empty string where we will add the elements\n last_index = array.length - 1\n array.each_with_index do |elem, index|\n string << elem # << delimiter # as without delimiter there will bo no dash\n string << delimiter if index != last_index\n end\n string\nend", "title": "" }, { "docid": "b702d08a4d98a82d3e3d54960fba4f9a", "score": "0.5987976", "text": "def custom_join(array, delimiter = \"\") # we set here a default delimiter\n string = \"\" #empty string where we will add the elements\n last_index = array.length - 1\n array.each_with_index do |elem, index|\n string << elem #<< delimiter # as without delimiter there will bo no dash\n string << delimiter if index != last_index\n end\n string\nend", "title": "" }, { "docid": "c73573d256bef9b2984519dfae01c375", "score": "0.5981061", "text": "def my_join(symbol=\"\")\n answer = \"\"\n self.each.with_index do |el, i|\n if i == self.length - 1\n answer += el\n else\n answer += el + symbol\n end\n end\n answer\n end", "title": "" }, { "docid": "ab69754645ca19f76a069754a8b4305a", "score": "0.5975839", "text": "def my_join(arr, separator = \"\")\n\tnewstr = \"\"\n\tarr.each_index do |i|\n\t\tnewstr += arr[i]\n\t\tnewstr += separator unless i == arr.length - 1\n\n\tend\nnewstr\n\nend", "title": "" }, { "docid": "c76e51f6d75457b33c7b5a3155afeeb6", "score": "0.59743035", "text": "def my_join(arr, separator = \"\")\n str = \"\"\n arr.each do |ele|\n if ele != arr[-1]\n joint_string = ele + separator \n str += joint_string\n else \n str += ele\n end\n end\n str \nend", "title": "" }, { "docid": "a99cec23d339c38c753a87be51159a4b", "score": "0.597156", "text": "def make_categories\n \n text = \"categories: [\\n\"\n \n self.keys.each do |key|\n text << \"'#{key}',\\n\"\n end\n \n text << \"]\\n\"\n \n end", "title": "" }, { "docid": "e0e1d57570df1c8147f75c440c019a5f", "score": "0.5969074", "text": "def my_join(arr, separator = \"\")\n new_str = \"\"\n arr.each{|el| new_str << el + separator}\n return separator == \"\" ? new_str : new_str[0...-1]\nend", "title": "" }, { "docid": "83f2909db3a113ab57f0366fd0c619bb", "score": "0.5954351", "text": "def my_join(arr, separator = \"\")\n\n str = ''\n\n arr.each_index do |i|\n str += arr[i]\n\n if i < arr.length - 1\n str += separator\n end\n\n end\n\n str\n\nend", "title": "" }, { "docid": "cb55af9415430a7663e2251251b4cc3c", "score": "0.5951695", "text": "def my_join(arr, separator = \"\")\n str = \"\"\n arr.each_with_index do |ele, idx|\n if idx == 0\n str << ele.to_s\n else\n str << separator + ele.to_s\n end\n end\n return str\nend", "title": "" }, { "docid": "8746e13643fba7b1777300fe73b5e162", "score": "0.5944279", "text": "def my_join(arr, separator = \"\")\n join = \"\"\n i = 0\n\n while i < arr.length\n join = join + arr[i]\n\n if i != arr.length-1 #don't want space at the end\n join = join + separator\n end\n\n i = i + 1\nend\n join\n\nend", "title": "" }, { "docid": "3374f74ec438e19b5d76ebb4eb618d0d", "score": "0.5940679", "text": "def custom_join(array, delimiter = \"\")\n str = \"\"\n last_index = array.length - 1\n array.each_with_index do |word, index|\n str << word\n str << delimiter unless index == last_index\n end\n str\nend", "title": "" }, { "docid": "ee7cc9353c5d73d5ad624e35c2d046e3", "score": "0.593383", "text": "def my_join(arr, separator=\"\")\n # your code goes here\n i = 0 \n result = \"\"\n while i < arr.length\n if i == arr.length - 1\n result = result + arr[i]\n else\n result = result + arr[i] + separator\n end\n i = i + 1\n end\n return result\nend", "title": "" }, { "docid": "902d31abaa622d163cd148b81da9c6f5", "score": "0.5933157", "text": "def to_str\n \"#{@category[0..1].upcase}#{next_serial_number(@category)}\"\n end", "title": "" }, { "docid": "39a5be7a2de66cfdc2b203c178d575b6", "score": "0.593182", "text": "def write_category categories\n\tunless categories\n\t\treturn ''\n\tend\n\n\thtml = '<div class=\"categories\">'\n\n\tcategories.each do |category|\n\t\thtml += '<span class=\"category\">' + category + '</span>'\n\tend\n\n\thtml += '</div>' + \"\\n\"\n\treturn html\nend", "title": "" }, { "docid": "945f8f12decebe89fb33169dec7103fe", "score": "0.5927755", "text": "def category_links(opts = {})\n opts = {:delimiter => ', ', :style_class => nil}.merge(opts)\n categories.reverse.map{|cat| cat.to_link(opts[:style_class]) }.join(opts[:delimiter])\n end", "title": "" }, { "docid": "924cd933915997fae7021d9a17cdbf44", "score": "0.59216607", "text": "def my_join(arr, separator = \"\")\n str = \"\"\n arr.each {|e| e == arr.last ? str += e.to_s : str += e.to_s + separator}\n str\nend", "title": "" }, { "docid": "5b1c24e4911b1fd547c9a20ea2dd1258", "score": "0.5910662", "text": "def my_join(arr, separator = \"\")\n str = ''\n arr.each_index do |idx|\n if str.length < arr.length\n str << arr[idx] + separator\n else\n str << arr[idx]\n end\n end\n str\nend", "title": "" }, { "docid": "98b8ef3b483bc2cffee7b5b3927e23d9", "score": "0.5905355", "text": "def english_join(conjunction = 'and', separator = ', ', oxford_comma = true)\n len = self.length\n return '' if len == 0\n return self[0].to_s if len == 1\n return \"#{self[0].to_s} #{conjunction} #{self[1].to_s}\" if len == 2\n join_str = ''\n self.each_with_index{|ele, i|\n str = if !oxford_comma && i == len - 2\n \"#{ele} #{conjunction} \"\n elsif i == len - 2\n \"#{ele}#{separator}#{conjunction} \"\n elsif i == len - 1\n \"#{ele}\"\n else\n \"#{ele}#{separator}\"\n end\n join_str << str\n }\n join_str\n end", "title": "" }, { "docid": "7c8fc75a064c37a3a1885e2112975c50", "score": "0.59006304", "text": "def my_join(arr, separator = \"\")\n result = \"\"\n arr.each_with_index do |el, idx| \n result += separator if idx != 0\n result += el\n end\n result\nend", "title": "" }, { "docid": "d9145d9f3388f1a6b2f33d286c1eea40", "score": "0.588814", "text": "def custom_join(array, delimiter = \"--\")\n new_string = array.join(delimiter)\n return new_string\nend", "title": "" }, { "docid": "66e0bf68dd7bfd96f8362febdb9ebabf", "score": "0.58866376", "text": "def __joinStrings\n # called from generated code\n str = ''\n n = 0\n siz = self.size\n while n < siz \n str << self.__at(n).to_s\n n += 1\n end\n str\n end", "title": "" }, { "docid": "9b366730dfda097feda9e0a8d300e7d7", "score": "0.5874041", "text": "def my_join(separator = \"\")\n new_str = \"\"\n self.length.times do |idx|\n new_str += self[idx]\n new_str += separator if idx != self.length - 1\n end\n new_str\nend", "title": "" }, { "docid": "ca8e3d6daec612a1eafd20e84c229bc7", "score": "0.5870599", "text": "def category_list_of_user(add_spaces = false)\r\n \tcategory_list = ''\r\n \tcategories.each do |cat|\r\n \t\tcategory_list << cat.name + ','\r\n \t\tif add_spaces: category_list << ' ' end\r\n \tend\r\n \t\r\n \tif add_spaces\r\n \t return category_list[0..(category_list.length - 3)].downcase\r\n\t else\r\n \treturn category_list[0..(category_list.length - 2)].downcase\r\n \tend\r\n end", "title": "" }, { "docid": "da027ed707fe653cf704948522a19915", "score": "0.5866877", "text": "def join_words(input)\n return input.join(\" \")\n end", "title": "" }, { "docid": "d4ecdb7ca2dc7e1feb229ac2df520160", "score": "0.5861229", "text": "def join\n\t\tif items.length == 1\n\t\t\treturn items[0]\n\t\telsif items.length == 2\n\t\t\treturn \"#{items[0]} and #{items[1]}\"\n\t\tend\n\n\t\tlast_item = \"and #{items.last}\" #add the word \"and\" before the last item\n\t\tother_items = items.slice(0, items.length - 1).join(', ') # take the first through second-to-last items and join them with commas\n\t\t\"#{other_items}, #{last_item}\" # return the whole thing as one string\n\tend", "title": "" }, { "docid": "3665fd59c90c71f672495ca56bde0b2f", "score": "0.5849326", "text": "def my_join(arr, separator=\"\")\n\n join = \"\"\n\n i = 0\n while i < arr.length\n join += arr[i]\n join += separator unless i == arr.length - 1\n i += 1\n end\n\n return join\nend", "title": "" }, { "docid": "488dc4138e3c9d58d100bb7fee6b0445", "score": "0.58409405", "text": "def my_join(arr, separator = \"\")\n str=\"\"\n arr.each_with_index do |el,idx|\n str << el\n next if idx==arr.length-1\n str << separator\n end\n str\nend", "title": "" }, { "docid": "9b80e66aacd6391d3f8dc48ad851d8a3", "score": "0.5840625", "text": "def categories_as_string=(new_categories)\n categories.clear\n\n new_categories.split(/\\s*, \\s*/).each do |title|\n cat = Category.where('LOWER(title) = ?', title.downcase).first\n categories << cat if !cat.nil?\n #if !cat.nil?\n # categories << cat\n\n end\n end", "title": "" }, { "docid": "18744f9348c9d7faea56fd9906b575f7", "score": "0.5837122", "text": "def my_join(arr, separator = \"\")\n joined_str = \"\"\n arr.each_index do |idx|\n joined_str << arr[idx]\n joined_str << separator unless idx == arr.length - 1\n end\n joined_str\nend", "title": "" }, { "docid": "3d974352edf50c9c2eff3ab0d85ddee4", "score": "0.5836834", "text": "def get_categories\n @categories.uniq.join(', ')\n end", "title": "" }, { "docid": "83a490d6a7d70c3be8f5985036c16eda", "score": "0.5833875", "text": "def category\n string = Array(@page_data['categories'])[0]\n return '' if string.to_s.empty?\n\n string.split('/').map { |c|\n Ruhoh::StringFormat.clean_slug_and_escape(c)\n }.join('/')\n end", "title": "" }, { "docid": "31e94fc91b9b9d427ecfb2d7adef4644", "score": "0.5833046", "text": "def my_join(arr, separator = \"\")\n if arr.length == 0\n return \"\"\n else\n str = \"\"\n arr.each do |el|\n str += el.to_s + separator\n end\n end\n str.chars.take(str.length - separator.length).join\nend", "title": "" }, { "docid": "46519c49b353d3fd19cc25a66e9e34c4", "score": "0.58279717", "text": "def category_s\n CATEGORY[category]\n end", "title": "" }, { "docid": "1034e17d3b53785761b3a6b024dc591f", "score": "0.5826892", "text": "def smart_join(a, delim=', ', final=nil)\n values = a.collect{|x| (x || '').to_s.strip}.delete_if{|x| x.blank?}\n if values.many? && final # Need to put in the final \"and\" or whatever\n values[0..-2].join(delim) + \" #{final} \" + values.last\n else\n values.join(delim)\n end\n end", "title": "" }, { "docid": "562abb5418a83922212a966c199a176c", "score": "0.582611", "text": "def to_category_subcategory_s\n return marketing_category.abbreviation+\" - \"+abbreviation\n end", "title": "" }, { "docid": "cb69ea2cb970dabb27346f7d2622cab4", "score": "0.5825484", "text": "def to_s\n join\n end", "title": "" }, { "docid": "06d5930cb788365d0914a16c1791b40c", "score": "0.5812703", "text": "def join\n\t\t@option[:string].downcase!\n\t\t@option[:string] = @option[:string].split('') \n\t\t@option[:string].delete(\" \") unless !@option[:string].include?(\" \")\n\t\t@option[:string] = @option[:string].join unless @option[:string].class != Array\t\t\n\t\tself\n\tend", "title": "" }, { "docid": "7e8db131c5febd8b68b1a0bd59f58660", "score": "0.58092505", "text": "def join(*pieces)\n pieces.flatten!\n pieces.join(SEPARATOR)\n end", "title": "" }, { "docid": "50a50975c7104407bbf20b79779f0270", "score": "0.58007675", "text": "def my_join(separador = \"\")\n join = \"\"\n\n self.length.times do |i|\n join += self[i]\n join += separador unless i == self.length - 1\n end\n\n join\n end", "title": "" }, { "docid": "931f116b56b8d257170a83bd3c78b7dd", "score": "0.5799067", "text": "def split_tag_list_text(category_list: TagCategory.categorized_list)\n category_list.map do |category|\n tags_for_category(category).map(&:name).join(\" \")\n end.reject(&:blank?).join(\" \\n\")\n end", "title": "" }, { "docid": "554844a607eb81000c9d1792fab282b4", "score": "0.57975197", "text": "def my_join(arr, separator = \"\")\n\nresult = \"\"\n\nidx = 0\nwhile idx < arr.length\n\n if idx != arr.length - 1\n result += arr[idx] + separator\n else\n result += arr[idx]\n end\n\nidx += 1\nend\n\nreturn result\n\nend", "title": "" }, { "docid": "718633af148208f1b4c207b195f3bc5a", "score": "0.5794917", "text": "def join_strings(carmake, carmodel)\n carmake + carmodel\nend", "title": "" }, { "docid": "688d2be72d119953effe2e406726bc40", "score": "0.57906556", "text": "def join_with_space(content)\n return content.join(' ') if content.is_a?(Array)\n\n content\n end", "title": "" }, { "docid": "c857a0fd8c0c0643bfa3def0ea8d7f50", "score": "0.5786812", "text": "def join_terms(seperator = :and, delimiter: ', ', encapsulate: nil)\n elements = (encapsulate ? map { |element| element.to_s.encapsulate(encapsulate) } : self)\n return elements.join(delimiter) if size <= 1\n return elements.join(\" #{seperator} \") if size == 2\n [elements[0..-2].join(delimiter), elements.last].join(\" #{seperator} \")\n end", "title": "" }, { "docid": "7dee3285c8d89d09af7d54cb16cee154", "score": "0.5780269", "text": "def concatenate\n\tpolluted = [\"waters\", \"too\", \"polluted\", \"with\", \"germs\"]\n\tputs polluted.join(\" \")\nend", "title": "" }, { "docid": "e423f5bbbbb293a085ce9c6554d8fed1", "score": "0.57693684", "text": "def join_with_extra_last(join_string_common, join_string_last)\n\t\tresult = \"\"\n\t\tself.each_with_index do |item, index|\n\t\t\tresult += join_string_common.to_s if index != 0 && index < self.length-1\n\t\t\tresult += join_string_last.to_s if index != 0 && index >= self.length-1\n\t\t\tresult += item.to_s\n\t\tend\n\t\treturn result\n\tend", "title": "" }, { "docid": "2a11ed01920de549a31c35ffc8e43ee1", "score": "0.57615864", "text": "def join(sep) # = nil)\n join_str = \"\"\n size = self.size\n sep = sep.to_s\n self.each do |item|\n if !join_str.empty?\n join_str << sep\n end\n join_str << item.to_s\n end\n join_str\n end", "title": "" }, { "docid": "b286c7dcbde1a15e1fe1188069c51666", "score": "0.57598484", "text": "def my_join(arr, separator=\"\")\n result = \"\"\n arr.each do |el|\n result << el + separator\n end\n return result if separator == \"\"\n result[0...-1]\nend", "title": "" } ]
aafceaf62c80943ebfb857ab072d661a
Perform an atomic $pullAll operation on the matching documents.
[ { "docid": "1c9195804ffb5e8db09213610d814c67", "score": "0.7500418", "text": "def pull_all(pulls)\n view.update_many(\"$pullAll\" => collect_operations(pulls))\n end", "title": "" } ]
[ { "docid": "2eb491a8df03e961d28767117b74ceb9", "score": "0.8113981", "text": "def delete_all\n atomically(:$pull) do\n set_collection\n count.tap do\n filter.each { |doc| doc.delete }\n end\n end\n end", "title": "" }, { "docid": "576f0cc94c88100f6eec7f53a4f9bcc5", "score": "0.78918034", "text": "def destroy_all\n atomically(:$pull) do\n set_collection\n count.tap do\n filter.each { |doc| doc.destroy }\n end\n end\n end", "title": "" }, { "docid": "b71daae4dea358cf7b2bfbf6bb3667b7", "score": "0.6780677", "text": "def pull(pulls)\n view.update_many(\"$pull\" => collect_operations(pulls))\n end", "title": "" }, { "docid": "a118c941035c2ad376218f57394cec01", "score": "0.67047477", "text": "def pull_all(field, values)\n query.update_all(\"$pullAll\" => { database_field_name(field) => values })\n end", "title": "" }, { "docid": "931a1ca51ae115e737927d3e9a6c0fc1", "score": "0.6425734", "text": "def pull_alls\n self[\"$pullAll\"] ||= {}\n end", "title": "" }, { "docid": "ec1ab3a83e2cf774dae8838c746d8108", "score": "0.6389014", "text": "def pull_all\n repositories.map(&method(:pull)).reduce(:+)\n end", "title": "" }, { "docid": "de76bdbeb9e495caed509498f1cbfabd", "score": "0.62835747", "text": "def delete_all\n documents['rows'].each do |doc|\n CouchSpring.delete( \"#{uri}/#{CGI.escape( doc['id'])}?rev=#{doc['value']['rev']}\" ) #rescue nil\n end\n end", "title": "" }, { "docid": "11d91bc2ba13a8b0854eeb7336d49bab", "score": "0.6264815", "text": "def delete\n deleted = count\n removed = map do |doc|\n prepare_remove(doc)\n doc.as_document\n end\n unless removed.empty?\n collection.find(selector).update(\n positionally(selector, \"$pullAll\" => { path => removed })\n )\n end\n deleted\n end", "title": "" }, { "docid": "1f7fef655e0a376112405d3a46c42e0f", "score": "0.6185064", "text": "def delete\n deleted = count\n removed = map do |doc|\n prepare_remove(doc)\n doc.send(:as_attributes)\n end\n unless removed.empty?\n collection.find(selector).update_one(\n positionally(selector, \"$pullAll\" => { path => removed }),\n session: _session\n )\n end\n deleted\n end", "title": "" }, { "docid": "f5a080f8cdb192f26588656f74fa962a", "score": "0.60869145", "text": "def remove_all\n session.with(consistency: :strong) do |session|\n session.context.remove(\n operation.database,\n operation.collection,\n operation.basic_selector\n )\n end\n end", "title": "" }, { "docid": "0305cf303b998b3bfc76e586c191651a", "score": "0.60709643", "text": "def delete_all\n # Do each delete so any on_delete and\n # cascades are called, then empty the\n # collection and compact the array.\n bulk_update { collection.pop.delete until collection.empty? }\n _reset_next_id\n end", "title": "" }, { "docid": "ae70a991c6d62b938d4e5ce14d268c21", "score": "0.60457104", "text": "def pull_collection\n @service.set_contexts(@contexts)\n collection = @service.list(object_name)\n @service.clear_contexts\n collection.each_with_index do |remote_object_hash, index|\n remote_id = remote_object_hash.delete(\"id\")\n local_object = @factory.with_remote_id(remote_id)\n unless local_object\n local_object = @factory.new\n local_object.update_remote_id(remote_id)\n end\n local_object.before_pull(self) if local_object.respond_to?(:before_pull)\n local_object._collection_order = index\n fields = configuration.synchronizable_for_pull\n fields.each do |field|\n value = remote_object_hash[field.to_s]\n local_object.send(\"#{field}=\", value)\n end\n local_object.after_pull(self) if local_object.respond_to?(:after_pull)\n local_object.save\n end\n collection.count\n end", "title": "" }, { "docid": "a356422dfd0ebc102673000ce425cc08", "score": "0.6014064", "text": "def delete_all!\n each do |item|\n raise \"Some (all?) items in list do not contain _rev properties in their values\" unless item['value']['_rev']\n end\n \n request = { docs: map { |item|\n { _id: item['value']['_id'] || item['id'], _rev: item['value']['_rev'], _deleted: true }\n } }\n \n response = JSON.parse @database.http(\"_bulk_docs\").post(request.to_json)\n raise \"Error: #{response['error']} - #{response['reason']}\" if response.is_a? Hash and response['error']\n \n return ChillDB::IndifferentHash.new.replace response\n end", "title": "" }, { "docid": "51be83dea54e8a2c26638d785613052b", "score": "0.5977577", "text": "def delete_all\n documents['rows'].each do |doc|\n CouchDB.delete( \"#{uri}/#{CGI.escape( doc['id'])}?rev=#{doc['value']['rev']}\" ) #rescue nil\n end \n end", "title": "" }, { "docid": "5165b50cc7a64100beb280039ef92d7a", "score": "0.5914623", "text": "def pull_all(field, value, options = {})\n PullAll.new(self, field, value, options).persist\n end", "title": "" }, { "docid": "5165b50cc7a64100beb280039ef92d7a", "score": "0.5914623", "text": "def pull_all(field, value, options = {})\n PullAll.new(self, field, value, options).persist\n end", "title": "" }, { "docid": "ee2f210247919a790a7e5a4cd5182a36", "score": "0.58891904", "text": "def update_all\n uri = format(\"/%s/_bulk_docs\", @dbname)\n json = { \"docs\" => self }\n res = @couch.post(uri,json)\n $stderr.puts \"[debug] res=#{res}\" if @debug\n self.clear\n failed_list = self.clone\n if res.kind_of?(Net::HTTPSuccess)\n JSON.parse(res.body).each do |doc|\n if doc.has_key?(\"error\")\n failed_list << doc\n $stderr.puts \"[debug] error_doc=#{doc}\" if @debug\n end\n end\n else\n begin\n json = JSON.parse(res.body)\n failed_list << json\n rescue\n failed_list << res.body\n end\n end\n return failed_list\n end", "title": "" }, { "docid": "4af04428188100c8a7817934c424307f", "score": "0.5855938", "text": "def delete_all\n # Do each delete so any on_delete and\n # cascades are called, then empty the\n # collection and compact the array.\n bulk_update do\n collection.each{|item| item.delete}\n end\n @collection = []\n @_next_id = 1\n end", "title": "" }, { "docid": "30f8fa9998cc3378db6f176ca0a5ddca", "score": "0.5792437", "text": "def pulls\n wrap(@inner.select(&:pull?))\n end", "title": "" }, { "docid": "fe436ac91f56642c209822c92f418969", "score": "0.5759115", "text": "def nuke_all_cargo\n CargoDocument.delete_all\n end", "title": "" }, { "docid": "cef7c15baab2ae22d7d9bca36d8f1341", "score": "0.5754601", "text": "def purge_all\n fetcher.client.post(\"#{Service.get_path(id)}/purge_all\")\n end", "title": "" }, { "docid": "d2e79a6fbb0e8185314b397f0cfdf17e", "score": "0.5724464", "text": "def delete_all!()\n delete_by_query(\"*:*\")\n end", "title": "" }, { "docid": "f9725e32ce1c846dbb463877811649ea", "score": "0.5724179", "text": "def pulls\n self[\"$pull\"] ||= {}\n end", "title": "" }, { "docid": "a5ca228b91f5d1cddff114db60ae11ac", "score": "0.5692584", "text": "def clear_facility_jobs\n Job.collection.update({\"facility_ids\" => id}, {\"$pull\" => { \"facility_ids\" => id }}, :multi => true)\n end", "title": "" }, { "docid": "4bc5bcac53e68dd8070a258c9f2d619e", "score": "0.56711763", "text": "def pull(field, value)\n klass.collection.update(\n selector,\n { \"$pull\" => { field => value } },\n :multi => true\n )\n end", "title": "" }, { "docid": "0026b22c474a963aa5f59a049617d3e3", "score": "0.56604326", "text": "def delete_all!\n @repo.clear\n end", "title": "" }, { "docid": "e35ced1f204cabca8cb1010da7d2afc3", "score": "0.5652594", "text": "def clear_docs\n @@client[:documents].delete_many({}).n\n end", "title": "" }, { "docid": "e35ced1f204cabca8cb1010da7d2afc3", "score": "0.5652594", "text": "def clear_docs\n @@client[:documents].delete_many({}).n\n end", "title": "" }, { "docid": "9103dc56d248a3688d64d2fa98fe6338", "score": "0.56139636", "text": "def remove_all(collection)\n coll = @db_client[collection]\n coll.remove\n end", "title": "" }, { "docid": "d8d9e898f7e7a6aeda3a2d7528e9c3bc", "score": "0.55887145", "text": "def delete_all\n @collection.clear # TODO: Handle cascading or let GC take care of it.\n end", "title": "" }, { "docid": "4a33405b50e3421116cd5525dab4f458", "score": "0.5533567", "text": "def pull(field, value)\n query.update_all(\"$pull\" => { database_field_name(field) => value })\n end", "title": "" }, { "docid": "9ba807d22de54f2bf179b7f6cd5d2f76", "score": "0.5528381", "text": "def pull_all(options = {})\n ensure_clean!\n remotes = options[:remote] ? options[:remote].split(',') : config[:remotes]\n remotes.each do |remote|\n indent 'remote', remote do\n pull(remote, options)\n end\n end\n end", "title": "" }, { "docid": "6682dcd09c7d18547e1a5d874acc154d", "score": "0.547362", "text": "def object_doc_get_all(collection_name)\n collection_by_name(collection_name).create_index(\"@version\") #ensure index on version\n logger.debug \"Get all documents from collection (#{collection_name})\"\n objects_set = Set.new # Set to hold uuid's for version checking. Using a Set for speed reasons.\n old_objects = [] # outdated versions of objects\n objects_array = [] # objects to return\n this = collection_by_name(collection_name).find().sort(\"@version\", -1).to_a\n this.each do\n |object|\n if objects_set.add?(object['@uuid'])\n objects_array << object\n else\n old_objects << object\n end\n end\n cleanup_old_docs(old_objects, collection_name) if old_objects.count > 0 # only run clean if we need to\n remove_mongo_keys(objects_array)\n end", "title": "" }, { "docid": "6682dcd09c7d18547e1a5d874acc154d", "score": "0.5472427", "text": "def object_doc_get_all(collection_name)\n collection_by_name(collection_name).create_index(\"@version\") #ensure index on version\n logger.debug \"Get all documents from collection (#{collection_name})\"\n objects_set = Set.new # Set to hold uuid's for version checking. Using a Set for speed reasons.\n old_objects = [] # outdated versions of objects\n objects_array = [] # objects to return\n this = collection_by_name(collection_name).find().sort(\"@version\", -1).to_a\n this.each do\n |object|\n if objects_set.add?(object['@uuid'])\n objects_array << object\n else\n old_objects << object\n end\n end\n cleanup_old_docs(old_objects, collection_name) if old_objects.count > 0 # only run clean if we need to\n remove_mongo_keys(objects_array)\n end", "title": "" }, { "docid": "0c9eedaa5f05f98efa6db9cb4fcec16c", "score": "0.54656315", "text": "def git_repo_pull_all_content(options)\n RepositorySet.new(Repositext::PARENT_DIR).git_pull(:all_content_repos)\n end", "title": "" }, { "docid": "1e62ff75f342e282a1613764ef55c354", "score": "0.54630584", "text": "def drop_documents\n self.coll.remove()\n end", "title": "" }, { "docid": "1e62ff75f342e282a1613764ef55c354", "score": "0.54630584", "text": "def drop_documents\n self.coll.remove()\n end", "title": "" }, { "docid": "46f60583f33d3db5a326a6f57cc02f4b", "score": "0.54536366", "text": "def update_all(attributes = {})\n klass.collection.update(\n selector,\n { \"$set\" => attributes },\n Safety.merge_safety_options(:multi => true)\n ).tap do\n Threaded.clear_options!\n end\n end", "title": "" }, { "docid": "08a54afad3436c2afd7281715955d6b7", "score": "0.5412497", "text": "def letgo(object, collection_name = 'objects', *a)\n\t\t\t\treturn if !self.has?(object, collection_name)\n\t\t\t\tsym = \"@#{collection_name}\".to_sym\n\t\t\t\tobjs(sym).delete_if {|o| o.id.id == object.id.id}\n\t\t\t\tdb_update({}, {'$pull' => { collection_name => { id: object.id.id }}})\n\t\t\tend", "title": "" }, { "docid": "40dca9c3f3624f5274065e939dd440df", "score": "0.5409461", "text": "def everything\n list = ChillDB::List.load(JSON.parse(@@database.http('_all_docs?include_docs=true').get.body))\n list.database = @@database\n return list\n end", "title": "" }, { "docid": "f7017131472d5019db1c74552280248e", "score": "0.5399499", "text": "def all!\n self.query!(nil)\n end", "title": "" }, { "docid": "5dc2dda2ce1cb10994b17adee1882cec", "score": "0.53776836", "text": "def reload\n clear\n query_collection_objects\n end", "title": "" }, { "docid": "5dc2dda2ce1cb10994b17adee1882cec", "score": "0.53776836", "text": "def reload\n clear\n query_collection_objects\n end", "title": "" }, { "docid": "dfb190bed3e3893f6bbaa50f0293a7d0", "score": "0.5377114", "text": "def get_bulk(ids)\n all_docs(:keys => ids, :include_docs => true)\n end", "title": "" }, { "docid": "736ca215ff54c31cef68ab90e208256c", "score": "0.5369844", "text": "def unsubscribe_all!\n @subscriptions_all.clear\n @subscriptions_regexp.clear\n @subscriptions_val.clear\n end", "title": "" }, { "docid": "8edc5111f63dc2575b2b15570f0dcf9a", "score": "0.5367397", "text": "def unsubscribe_all\n @sub_tracker.unsubscribe_all\n end", "title": "" }, { "docid": "59d3557e9c25cd33ab4aac6dcb277c53", "score": "0.53490376", "text": "def unpublish_all\n all.update_all(published: false)\n end", "title": "" }, { "docid": "c09b8a2d90a23da156c97b8fe329be67", "score": "0.53474516", "text": "def object_doc_remove_all(collection_name)\n raise NotImplementedError\n end", "title": "" }, { "docid": "2785ea7d54fb8548cd2510b866c8afa3", "score": "0.5346231", "text": "def all(*args)\n find(:all, *args)\n end", "title": "" }, { "docid": "2785ea7d54fb8548cd2510b866c8afa3", "score": "0.5346231", "text": "def all(*args)\n find(:all, *args)\n end", "title": "" }, { "docid": "568d1a69e55acb40d307c750b26a0351", "score": "0.5341842", "text": "def clear_facility_contacts\n Contact.collection.update({\"facility_ids\" => id}, {\"$pull\" => { \"facility_ids\" => id }}, :multi => true)\n end", "title": "" }, { "docid": "a36f6373275eb0b4d942e3eb8233d038", "score": "0.5339419", "text": "def all_docs_by_ids(db_name, params)\n request.method = :post\n request.uri = \"#{db_name}/_all_docs\"\n request.params = params\n Couchdbtools.execute(request)\n end", "title": "" }, { "docid": "4cc3730205408d43a3d3b72fe0899df1", "score": "0.5339324", "text": "def all(*args)\n find(:all, *args)\n end", "title": "" }, { "docid": "4cc3730205408d43a3d3b72fe0899df1", "score": "0.5339324", "text": "def all(*args)\n find(:all, *args)\n end", "title": "" }, { "docid": "4cc3730205408d43a3d3b72fe0899df1", "score": "0.5339324", "text": "def all(*args)\n find(:all, *args)\n end", "title": "" }, { "docid": "4cc3730205408d43a3d3b72fe0899df1", "score": "0.5339324", "text": "def all(*args)\n find(:all, *args)\n end", "title": "" }, { "docid": "4cc3730205408d43a3d3b72fe0899df1", "score": "0.5337938", "text": "def all(*args)\n find(:all, *args)\n end", "title": "" }, { "docid": "6bfcb5a556afd5a42da2d384cec3d9c5", "score": "0.5279857", "text": "def all\n find\n end", "title": "" }, { "docid": "95d73c41fb03d5a6378a11c9d450435f", "score": "0.5276302", "text": "def unsubscribe_all\n @registry.unsubscribe_all\n end", "title": "" }, { "docid": "52dd17bee054262c3e83db7c54db1514", "score": "0.52756834", "text": "def delete_all\n self.each do |i|\n i[\"_deleted\"] = true\n end\n update_all\n end", "title": "" }, { "docid": "2629dfd139a42819934e2d6266f013e4", "score": "0.5271146", "text": "def delete_all(db)\n db.documents['rows'].each do |row|\n unless row['id'] =~ /^_design/ # Don't delete the design document.\n db.delete_doc({ '_id' => row['id'], '_rev' => row['value']['rev'] }, true)\n end\n end\n db.bulk_delete\n\n # Verify that everything except the design document was deleted.\n result_set = db.documents\n result_set['total_rows'] == 1 or raise \"Expected all documents to be deleted, got #{result_set.inspect}\"\nend", "title": "" }, { "docid": "6048bc5ca58985195c7fb48c6944fc85", "score": "0.5269694", "text": "def _remover\n embedded? ? (_index ? \"$pull\" : \"$unset\") : nil\n end", "title": "" }, { "docid": "41e8ec4948577cd4ccfcea67694147ce", "score": "0.52593786", "text": "def destroy_bulk(list_of_native_records)\n #TODO: Investigate why mutiple ids may be returned for the same record\n #Answer Database Corruption\n list_of_native_records.uniq!\n #puts \"List of all records: #{list_of_native_records.map{|r| r['_id']}.inspect}\"\n list_of_native_records.each do |r|\n begin\n att_doc_id = r['_id'] + CouchrestAttachment::AttachmentID\n #puts \"Node ID: #{r['_id'].inspect}\"\n #puts \"DB: #{@db.all.inspect}\"\n @db.delete_doc(r)\n begin\n att_doc = @db.get(att_doc_id)\n rescue\n att_doc = nil\n end\n @db.delete_doc(att_doc) if att_doc\n rescue RestClient::RequestFailed\n puts \"Warning:: Failed to delete document?\"\n end\n end\n nil #TODO ok to return nil if all docs destroyed? also, not verifying\n end", "title": "" }, { "docid": "917622c00280287c77dd9ec635d53437", "score": "0.5257773", "text": "def purge!\n\n docs = @couch.all(:include_docs => false, :include_design_docs => false)\n @couch.bulk_delete(docs)\n end", "title": "" }, { "docid": "90be58ad1d1d9175f4605397b91ac509", "score": "0.52551657", "text": "def clear_all\n Cloudenvoy::Backend::MemoryPubSub.clear_all\n end", "title": "" }, { "docid": "c5b7413fcdbda826a41b1c88771293ad", "score": "0.52508", "text": "def purge_all\n collection.drop\n reopen\n create_indexes\n end", "title": "" }, { "docid": "77e4bb504614c46f03b5d457223c2ee2", "score": "0.5249536", "text": "def object_doc_remove_all(collection_name)\n logger.debug \"Remove all documents in collection (#{collection_name})\"\n ensure_table_exists(collection_name)\n @session.execute(\"DELETE from #{collection_name}\")\n true\n end", "title": "" }, { "docid": "4de7f8ba2e7ee70972ed6fb1b0c975e5", "score": "0.5240222", "text": "def all(params=nil)\n if params\n where(params)\n else\n Database.all_docs(_table).map{|bson| _new(bson)}\n end\n end", "title": "" }, { "docid": "17946cf672f70b49a04d3acc915e8f83", "score": "0.5228904", "text": "def fetch!\n collection.fetch_objects!\n end", "title": "" }, { "docid": "17946cf672f70b49a04d3acc915e8f83", "score": "0.5228904", "text": "def fetch!\n collection.fetch_objects!\n end", "title": "" }, { "docid": "3b01816ec9e5eeb16d540261da755c3b", "score": "0.5222673", "text": "def reset_all\n self.all.clear\n end", "title": "" }, { "docid": "6a30e13ad1edba9ec42651b410da5695", "score": "0.52214223", "text": "def all()\n find({})\n end", "title": "" }, { "docid": "9cd612219669e10d5fbf29e37220d294", "score": "0.52188176", "text": "def all(opts={})\n\n opts = opts.dup\n # don't touch the original\n\n path = adjust('_all_docs')\n\n opts[:include_docs] = true if opts[:include_docs].nil?\n\n adjust_params(opts)\n\n keys = opts.delete(:keys)\n\n return [] if keys && keys.empty?\n\n res = if keys\n opts[:cache] = :with_body if opts[:cache].nil?\n @http.post(path, { 'keys' => keys }, opts)\n else\n @http.get(path, opts)\n end\n\n rows = res['rows']\n\n docs = if opts[:params][:include_docs]\n rows.map { |row| row['doc'] }\n else\n rows.map { |row| { '_id' => row['id'], '_rev' => row['value']['rev'] } }\n end\n\n if opts[:include_design_docs] == false\n docs = docs.reject { |doc| DESIGN_PATH_REGEX.match(doc['_id']) }\n end\n\n docs\n end", "title": "" }, { "docid": "1eb603f122fb8e53bb7cc70dd590d21d", "score": "0.5204833", "text": "def unsubscribe_all\n send_action('unsubscribe_all')\n end", "title": "" }, { "docid": "e6780b7235c1938f7623ab854eaaf850", "score": "0.5195039", "text": "def object_doc_remove_all(collection_name)\n @collections[collection_name].values.each do |object_doc|\n object_doc_remove(object_doc,collection_name)\n end\n true\n end", "title": "" }, { "docid": "e307b72abf99884c6afa8b203e6601f1", "score": "0.51927483", "text": "def all(collection)\n _synchronize do\n read(collection)\n super\n end\n end", "title": "" }, { "docid": "5577146a0525e81e98b5c5732b414f13", "score": "0.5189075", "text": "def all(options = {})\n find(options)\n end", "title": "" }, { "docid": "649eb9e01e861db59329755d122d49b8", "score": "0.51877755", "text": "def purge_all\n collection.drop\n @collection = nil\n create_indexes\n end", "title": "" }, { "docid": "302a0600854f869a0b3f44241b0cb1f5", "score": "0.51870555", "text": "def all\n collection.find().sort(:created_at)\n end", "title": "" }, { "docid": "f7d6c0ebd4f72e907ee987a22245f6c6", "score": "0.5186436", "text": "def update_all(attributes = nil)\n update_documents(attributes, entries)\n end", "title": "" }, { "docid": "f7d6c0ebd4f72e907ee987a22245f6c6", "score": "0.5186436", "text": "def update_all(attributes = nil)\n update_documents(attributes, entries)\n end", "title": "" }, { "docid": "063ea75b012b3dd3b4054191a14cc3d3", "score": "0.51731175", "text": "def pulls(repo, options = T.unsafe(nil)); end", "title": "" }, { "docid": "03176b109df81afe3d98fa0b40ba2a51", "score": "0.51688737", "text": "def all_docs(options = {})\n as_opal_promise(`#{@native}.allDocs(#{options.to_n})`) { |response|\n AllDocuments.new(response)\n }\n end", "title": "" }, { "docid": "9f5ed8b18f3e81fa5ddd0f8906b5d8f5", "score": "0.51591706", "text": "def delete_all(document_ids)\n raise NotImplementedError\n end", "title": "" }, { "docid": "35349b8223d08d1bed70af2e592afb49", "score": "0.51558614", "text": "def delete_all\n !! api_request(:delete, \"/subscribers.xml\")\n end", "title": "" }, { "docid": "63c1cbee85114fba4526b65f169e61e8", "score": "0.51556987", "text": "def destroy_all\n records.dup.each {|r| r.destroy }\n end", "title": "" }, { "docid": "7f0bb23e45407ae7d27c7d6ca15e86d2", "score": "0.5152693", "text": "def all\n find\n end", "title": "" }, { "docid": "63e7b2cde4226b94357e4842b212d87b", "score": "0.51396084", "text": "def nuke_all_locations\n LocationDocument.delete_all\n end", "title": "" }, { "docid": "6d064704deb77c1ae2ec51e018fdb572", "score": "0.51394445", "text": "def delete_all\n all.each { |obj| obj.delete }\n end", "title": "" }, { "docid": "5fcd66a4763eb28fb4964c35348b7a16", "score": "0.51331127", "text": "def delete_all\n # TODO: load_target causes extra loads. Can't we just send delete requests?\n # See https://github.com/samvera/active_fedora/issues/1341\n delete(load_target).tap do\n reset\n loaded!\n end\n end", "title": "" }, { "docid": "3f1b33e3bb6f9a4148296531b71a2bcc", "score": "0.5130315", "text": "def all_docs(options = {})\n # Create a new Collection with the response code, body and connection.\n Collection.new(*@hookup.get([\"_all_docs\"], options), self)\n end", "title": "" }, { "docid": "71f7ffe71f4f013a57e58a1b76fed099", "score": "0.5126682", "text": "def retrieve_all\n call(:get, path)\n end", "title": "" }, { "docid": "d85874a428bb17fdcd1632bb203f130a", "score": "0.51201475", "text": "def cleanup_old_docs(old_object_doc_array, collection_name)\n logger.debug \"Clean up old documents\"\n # iterate over each old doc\n old_object_doc_array.each do\n |old_object_doc|\n # Remove it from MongoDB by referencing '_id' key\n collection_by_name(collection_name).remove({ \"_id\" => old_object_doc[\"_id\"] })\n end\n end", "title": "" }, { "docid": "d85874a428bb17fdcd1632bb203f130a", "score": "0.51195663", "text": "def cleanup_old_docs(old_object_doc_array, collection_name)\n logger.debug \"Clean up old documents\"\n # iterate over each old doc\n old_object_doc_array.each do\n |old_object_doc|\n # Remove it from MongoDB by referencing '_id' key\n collection_by_name(collection_name).remove({ \"_id\" => old_object_doc[\"_id\"] })\n end\n end", "title": "" }, { "docid": "e598d4ce10db736825982129fdc3b5fd", "score": "0.5115734", "text": "def all(options={})\n find(:all, options)\n end", "title": "" }, { "docid": "4848964d1c37038193999f9dbfa84cd5", "score": "0.5114412", "text": "def pull_all(options = {})\n load_vendorfile\n\n ensure_clean!\n remotes = options[:remote] ? options[:remote].split(',') : config[:remotes]\n remotes.each do |remote|\n indent :default, 'remote', remote do\n pull(remote, options)\n end\n end\n end", "title": "" }, { "docid": "dcce0b5e4e435a2de91824207dec4ad6", "score": "0.51141196", "text": "def _remover\n @_remover ||= (embedded? ? (_index ? \"$pull\" : \"$unset\") : nil)\n end", "title": "" }, { "docid": "1b40b1e51ac57f394d9109368a0e096d", "score": "0.51135355", "text": "def get_bulk(ids, db = database)\n get_bulk!(ids, db) { nil }\n end", "title": "" }, { "docid": "34b13bb8cf137fe1b7e2a53753688ba4", "score": "0.5111372", "text": "def delete_all\n all.each(&:delete)\n end", "title": "" }, { "docid": "c38ce1cc6e1a35dde7d5548e45d0571f", "score": "0.5109697", "text": "def clear_all\n clear\n clear_stored_requests\n end", "title": "" } ]
c9955336af4d6c29b053f7cfacc5bf7a
returns the distance between two cells
[ { "docid": "0bd743fc5582450feb30505fbdd74122", "score": "0.6142092", "text": "def manhattan_distance(start_row, start_col, end_row, end_col)\n (end_row - start_row).abs + (end_col - start_col).abs\n end", "title": "" } ]
[ { "docid": "d0ddeee1b88eebde4cec8c5982d47965", "score": "0.8572944", "text": "def find_distance_between(cell1, cell2)\n if cell1.nil? || cell2.nil?\n return 0\n end\n\n if cell1.col == cell2.col || cell1.row == cell2.row\n return ((cell1.row - cell2.row) + (cell1.col - cell2.col)).abs\n end\n\n 0\n end", "title": "" }, { "docid": "184a2c3e0d18acaf28b4f1d7c833603f", "score": "0.82609206", "text": "def distance_to(cell)\n (@x - cell.x).abs + (@y - cell.y).abs\n end", "title": "" }, { "docid": "82707d486a8ae1dd1708ccf8d93c5021", "score": "0.72406673", "text": "def distance x1, y1, x2, y2\n ((x1-x2)**2+(y1-y2)**2)**0.5\nend", "title": "" }, { "docid": "8f6e92d73d8ba535433230137678f979", "score": "0.71936417", "text": "def distance(a, b)\n (a.x - b.x).abs + (a.y - b.y).abs\n end", "title": "" }, { "docid": "6fa71a4fc98c8ea7810ccca683fe7d37", "score": "0.7119821", "text": "def dist other\n case other\n when Atom\n pos = other.pos(false)\n when Surface\n return other.dist(self)\n else\n pos = pos.to_v \n end\n if @units == :angstrom\n (@pos - pos).magnitude\n else\n @cell.dist(self, other)\n end\n end", "title": "" }, { "docid": "fe6d4dad86aa51fd29586afe31f5c62a", "score": "0.70832145", "text": "def distance a, b\n (a[0] - b[0]).abs + (a[1] - b[1]).abs\n end", "title": "" }, { "docid": "b8f40c082330c9bdcc61fdc56dea3ed1", "score": "0.70713997", "text": "def distance(a, b)\n Math.sqrt(((a.x - b.x) ** 2) + ((a.y - b.y) ** 2).abs)\n end", "title": "" }, { "docid": "666378ac0b2d999f9ae7d22cd8e82716", "score": "0.698899", "text": "def distance(x1,y1,x2,y2)\n return ((x2 - x1)**2 + (y2 - y1)**2)**0.5\nend", "title": "" }, { "docid": "b2af95e2f40d514c29ede7fb24be2bcf", "score": "0.6987101", "text": "def distance(x1, y1, x2, y2)\n Math.sqrt((y2 - y1)**2 + (x2 - x1)**2)\n end", "title": "" }, { "docid": "884a79d77fbf8c2a6190ecf148c36198", "score": "0.69723266", "text": "def distance(a, b)\n Integer(Math.sqrt(((b[0] - a[0])**2 + (b[1] - a[1])**2)))\n end", "title": "" }, { "docid": "aac9974a5823181c185e31902db0c6a7", "score": "0.69510853", "text": "def dist (x1, y1, x2, y2)\n return (x1 - x2) ** 2 + (y1 - y2) ** 2\nend", "title": "" }, { "docid": "479f2e0e70046d7093dfbada98112a20", "score": "0.68507564", "text": "def distance(node1, node2)\n distance = 0\n self.each_edge_in_path(node1, node2) do |source, target, edge|\n distance += get_edge_distance(edge)\n end\n distance\n end", "title": "" }, { "docid": "5cc21642e27ae253ca4af8861967e5e4", "score": "0.68343574", "text": "def calculateDistance(r1,c1,r2,c2)\r\n\treturn Math.sqrt(((c1-c2) ** 2 + (r1 -r2) ** 2))\r\nend", "title": "" }, { "docid": "70fbe058e74d4ff12f8ff61727b2b85b", "score": "0.68003327", "text": "def distance(x1,x2,y1,y2)\r\n xdistance = x2-x1\r\n ydistance = y2-y1\r\n distance = ydistance + xdistance\r\n return distance\r\n end", "title": "" }, { "docid": "4e75699dde8fc0a9d19e7fbe60b2b2e6", "score": "0.67953116", "text": "def distance(a,b)\n\t(a-b).abs\nend", "title": "" }, { "docid": "9b2e6fdd768b75f96a40ebbc7ddd1b88", "score": "0.6789126", "text": "def distance_to(other)\n pyth(self.x, self.y, other.x, other.y)\n \n# Math.sqrt((other.x - self.x) ** 2 + (other.y - self.y) ** 2)\n end", "title": "" }, { "docid": "23f164b0ad3bc171330995f59ca95bf2", "score": "0.67505795", "text": "def distance_to(other)\n Math.sqrt((0..(self.dimension_count-1)).map {|d| (other.value(d) - self.value(d)) ** 2 }.reduce(&:+))\n end", "title": "" }, { "docid": "eca3c678fe6ec9db172f2ec59193b85c", "score": "0.67376494", "text": "def distance(p1, p2)\n\t\tc = p1.count\n\t\tt = 0\n\t\tc.times do \t|n|\n\t\t\te = (p1[n] - p2[n]) ** 2\n\t\t\tt = t + e\t\t\n\t\tend\t\n\t\tt = Math.sqrt(t)\n\tend", "title": "" }, { "docid": "9d10a47078e4b4cd3d253846c7af5a6f", "score": "0.6724952", "text": "def distance(m1, m2)\n n = m1.size\n sum = 0.0\n n.times do |i|\n n.times do |j|\n dif = m2[i][j] - m1[i][j]\n sum += dif * dif\n end\n end\n sum\nend", "title": "" }, { "docid": "6ed5177d8bb1830876673cbcf26d5ca5", "score": "0.6712103", "text": "def dist(r1, c1, r2, c2)\r\n return Math.sqrt((c1-c2)**2 + (r1-r2)**2)\r\nend", "title": "" }, { "docid": "e99cd2598e82faf4d8dc6b9926a0800e", "score": "0.6686986", "text": "def distance_from(char)\n return distance_x_from(char.x).abs + distance_y_from(char.y).abs\n end", "title": "" }, { "docid": "bdda368b65c9ac3e8598aced52f41921", "score": "0.6678365", "text": "def dist first, second\n first = first.is_a? Atom ? frac(first.pos(false)) : first.to_v\n second = second.is_a? Atom ? frac(second.pos(false)) : second.to_v\n real((first - second).map{|v| v = v % 1; v > 0.5 ? 1 - v : v}).magnitude\n end", "title": "" }, { "docid": "4487d03b54d74ec7d74860eb34d50b6b", "score": "0.66411483", "text": "def distance(c1,c2)\n x = c1[0] - c2[0]\n y = c1[1] - c2[1]\n y = y <= -180 ? y + 360 : y\n y = y >= 180 ? y - 360 : y\n return Math.sqrt(x*x+y*y)\n end", "title": "" }, { "docid": "fbf47ae83841b3cf72e0d68508487921", "score": "0.6640543", "text": "def distance_between(city_1, city_2)\n Math.hypot(city_2.x - city_1.x, city_2.y - city_1.y)\nend", "title": "" }, { "docid": "d9a3bea4830e220b8ceface1c9bac30b", "score": "0.6616441", "text": "def distance_to(x, y)\n return Math.hypot(x - @x, y - @y)\n end", "title": "" }, { "docid": "8a71d4137e1f699fc9bbd6ab8a7dc5e7", "score": "0.6604836", "text": "def distance_between(p1, p2)\n Math.sqrt((p1[0] - p2[0]) ** 2 + (p1[1] - p2[1]) ** 2)\n end", "title": "" }, { "docid": "0eea48cb9ff0657fb79d212f4033bfd2", "score": "0.66035354", "text": "def distance(point2)\n end", "title": "" }, { "docid": "102051566f15e4916743908f881f92da", "score": "0.6575291", "text": "def distance(p1,p2)\ndelta_x = p1[0] - p2[0]\ndelta_y = p1[1] - p2[1]\n\nMath.sqrt(delta_x ** 2 + delta_y **2)\n\nend", "title": "" }, { "docid": "7bcfa60865270c5ab39e40aacf02801c", "score": "0.6572585", "text": "def distance_between_points(a, b)\n Math.sqrt( (b.x - a.x)**2 + (b.y - a.y)**2 ).round(6)\nend", "title": "" }, { "docid": "fbf1b92d294c5770dd01be876ad34a6c", "score": "0.65594804", "text": "def distance(a, b)\n return @distance_function.call(a, b) if @distance_function\n return euclidean_distance(a, b)\n end", "title": "" }, { "docid": "1e2f13bc06180d9370a14c4ff8d12448", "score": "0.6558718", "text": "def manhattan_distance(other_grid)\n man_distance = 0\n self.each do |block|\n x, y = @block_to_loc[block] \n other_x, other_y = other_grid.block_to_loc(block)\n man_distance += (x - other_x).abs + (y - other_y).abs\n end\n man_distance\n end", "title": "" }, { "docid": "8b89d707d6e697294ac8f5c8e4ad5733", "score": "0.65501827", "text": "def dist(a, b)\n ax, ay, _ = a\n bx, by, _ = b\n\n (ax-bx).abs + (ay-by).abs\nend", "title": "" }, { "docid": "2369cfa7999438ea83b3d3a620ccdab7", "score": "0.6530783", "text": "def distance(other)\n\t\treturn ((other.x-@x).abs + (other.y-@y).abs + (other.z-@z).abs)/2\n\tend", "title": "" }, { "docid": "4016bc3a30e5c2a317ae579759287056", "score": "0.6520483", "text": "def distCalc(point1, point2)\n first = ((point2[:x] - point1[:x]) **2)\n second = ((point2[:y] - point1[:y]) **2)\n sum = (first + second)\n dist = Math.sqrt(sum)\n return dist\nend", "title": "" }, { "docid": "1c805169dbba4f8a2c6fc49303d5bbde", "score": "0.65182805", "text": "def distance(pos2)\n return $game_map.distance(self, pos2)\n end", "title": "" }, { "docid": "81ca7ff0ac4a3dd129e19d045d7a0f9f", "score": "0.6512058", "text": "def linear_distance(tile_a, tile_b)\n x1, y1 = tile_a.x, tile_a.y\n x2, y2 = tile_b.x, tile_b.y\n Math.sqrt((x2 - x1)**2 + (y2 - y1)**2).abs\n end", "title": "" }, { "docid": "e37dc0768a7355530cb44169bdbc6a0d", "score": "0.6493964", "text": "def distance(v1, v2)\n sum_squares = node_count.times.reduce(0.0) do |sum, i|\n d = v1[i] - v2[i]\n sum + d * d\n end\n Math.sqrt(sum_squares)\n end", "title": "" }, { "docid": "7ec7e000bf32f81781c81bfdbf4379a9", "score": "0.6480732", "text": "def distance\n diff_longitude = @longitude_b - @longitude_a\n diff_latitude = @latitude_b - @latitude_a\n\n angle_a = (Math.sin(radius_to_degree(diff_latitude)/2.0)) ** 2 +\n Math.cos(radius_to_degree(@latitude_a)) *\n Math.cos(radius_to_degree(@latitude_b)) *\n (Math.sin(radius_to_degree(diff_longitude)/2.0)) ** 2\n angle_c = 2 * Math.atan2(Math.sqrt(angle_a), Math.sqrt(1-angle_a))\n\n (EARTH_RADIUS * angle_c) / 1000 # Returns the distance in kilometers\n end", "title": "" }, { "docid": "20fedd7b33a6d613170a8e9ca2bd0a87", "score": "0.64667475", "text": "def calc_distance(hasha, hashb)\n\t\t\treturn hash_as_num(hasha) ^ hash_as_num(hashb) \n\t\tend", "title": "" }, { "docid": "17295e5d30f14a1c9a1aaeadf0c8b99e", "score": "0.6457624", "text": "def manhattan_distance(x1, y1, row_index, column_index)\n\t\t(x1 - row_index).abs + (y1 - column_index).abs\n\tend", "title": "" }, { "docid": "1211144499cf12975dfbc3183738a793", "score": "0.6455262", "text": "def distance_metric(product1, product2) (get_value(product1) - get_value(product2)).abs end", "title": "" }, { "docid": "11fefcc834e06e23d9939dae3ac7377b", "score": "0.6454576", "text": "def dist(a1, a2)\n Math.sqrt(a1.zip(a2).map { |x| (x[1] - x[0])**2 }.reduce(:+))\n end", "title": "" }, { "docid": "d002cc3d564ef77efdf1a42e998fcd3d", "score": "0.64429015", "text": "def point_point_distance(a, b)\n (((a.x - b.x) ** 2 + (a.y - b.y) ** 2) ** 0.5).abs\n end", "title": "" }, { "docid": "dca83fdff3c5f250d5470826ce0a236b", "score": "0.6434188", "text": "def dist_to(other)\n (other - self).length\n end", "title": "" }, { "docid": "13e60d5f3cd779c8c9d0d8d8a7edbbea", "score": "0.6430371", "text": "def get_distance(atomid1, atomid2)\n # calculate distance matrix on request\n if not @distance_matrix\n calculate_distancematrix\n end\n\n return @distance_matrix.get_value(atomid1, atomid2)\n end", "title": "" }, { "docid": "4778ab6bd382f93a99b5459e3bd7a5f8", "score": "0.64222527", "text": "def distance(other_point)\n ((self.x - other_point.x) ** 2 + (self.y - other_point.y) ** 2) ** 0.5\n end", "title": "" }, { "docid": "334cc5c1036b6cd71ecd23b2b5c0799e", "score": "0.6420403", "text": "def distance_to(other)\n point.distance_to(other)\n end", "title": "" }, { "docid": "95250e22abe6b628e0efb7d7f53240c9", "score": "0.6419205", "text": "def distance(value1, value2)\n n1_path = path(value1)\n return -1 if n1_path.empty?\n n2_path = path(value2)\n return -1 if n2_path.empty?\n lca = n1_path & n2_path\n return -1 if lca.empty?\n n1_path.length + n2_path.length - (2* lca.length)\n end", "title": "" }, { "docid": "8728d0812072826fcb62a43d837ffb14", "score": "0.6414562", "text": "def calc_distance(hasha, hashb)\n\t\treturn hash_as_num(hasha) ^ hash_as_num(hashb) \n\tend", "title": "" }, { "docid": "e2afb50cad784912582559601aacd04d", "score": "0.6409127", "text": "def distance(other_node)\n raise ArgumentError, \"A Node must be given as input.\\n Received a #{other_node.class}\" unless other_node.is_a? Node\n\n return (\n (@x - other_node.x) ** 2 +\n (@y - other_node.y) ** 2\n ) ** (0.5)\n end", "title": "" }, { "docid": "f7a01c84939f0eb273bf7d43bd81191b", "score": "0.6404227", "text": "def offset_distance(x1, y1, x2, y2)\n ac = offset_to_cube(x1, y1)\n bc = offset_to_cube(x2, y2)\n cube_distance(ac, bc)\nend", "title": "" }, { "docid": "d3789152dda628e07c422d64543080ba", "score": "0.6383486", "text": "def jaro_distance(s1, s2)\n result = C::jaro_distance(s1, s2)\n raise(\"memory allocation error\") if result < 0.0\n result\n end", "title": "" }, { "docid": "3aafafcce3d364fd14cd064ebefc95f9", "score": "0.6365009", "text": "def getGeoDistance(c1,c2)\n # atan2 raises domain error.\n if equalCoordinates?(c1,c2)\n return 0.0\n end\n ca = getCentralAngle(c1,c2)\n dist = EARTH_RADIUS_FEET * ca\n return abs(dist)\n end", "title": "" }, { "docid": "72fc51e42ef307dfe4c6d90e432eed43", "score": "0.6362804", "text": "def distance_preceding_character\r\r\n sx = distance_x_from(@preceding_character.x)\r\r\n sy = distance_y_from(@preceding_character.y)\r\r\n return Math.hypot(sx, sy)\r\r\n end", "title": "" }, { "docid": "3223aa411193cde907e64e6c1a572abb", "score": "0.6355629", "text": "def euclidean_dist(c1,c2)\n Math.sqrt(c1.zip(c2).map{|p| (p[1]-p[0])**2}.reduce(:+))\n end", "title": "" }, { "docid": "d6784052b7ad00b53386a6f72e6f6719", "score": "0.6355262", "text": "def distance(other_point)\n\t\t((@x - other_point.x)**2 + (@y - other_point.y)**2)**0.5\n\tend", "title": "" }, { "docid": "dfd6af9dcd0e6bdd8db148a77fc6d9b8", "score": "0.63549656", "text": "def distanceToCoord(startXPosition, startYPosition, endXPosition, endYPosition)\n if startXPosition == endXPosition and startYPosition == endYPosition\n return 0\n end\n \n return (startXPosition - endXPosition).abs + (startYPosition - endYPosition).abs\nend", "title": "" }, { "docid": "e4516953a050b845e4dc775955e194e4", "score": "0.6354623", "text": "def line_distance(node_one, node_two)\n\t\tx_one = node_one.position[0]\n\t\tx_two = node_two.position[0]\n\n\t\ty_one = node_one.position[1]\n\t\ty_two = node_two.position[1]\n\n\t\tMath.hypot(x_one - x_two, y_one - y_two)\n\tend", "title": "" }, { "docid": "9c1134e70c750c4cffe2333e687d5200", "score": "0.63443553", "text": "def distance(g0, g1)\n Math::sqrt( ((g1.lat-g0.lat).abs**2) + ((g1.lon-g0.lon).abs**2) )\n end", "title": "" }, { "docid": "f8bec174afb2f6ffffa6a5787b142ef1", "score": "0.632958", "text": "def calculate_distance(vals1, vals2)\n vals1_sum = vals1.inject(:+)\n vals2_sum = vals2.inject(:+)\n\n (0..11).map { |i| ((vals1[i].to_f/vals1_sum)-(vals2[i].to_f/vals2_sum))**2 }.inject(:+)\nend", "title": "" }, { "docid": "1ef07d8be19daaa0b17bce3ab1a26c1a", "score": "0.6328838", "text": "def distance(color1, color2)\n\tdist = (color1[0]-color2[0]).abs + (color1[1]-color2[1]).abs + (color1[2]-color2[2]).abs\n\tputs \"distance between #{color1.inspect} and #{color2.inspect} is #{dist}\" if DEBUG\n\treturn dist\nend", "title": "" }, { "docid": "518f00e964bb93c8c5730affe3d31e21", "score": "0.6323991", "text": "def distance\n distance_and_arc[:distance]\n end", "title": "" }, { "docid": "518f00e964bb93c8c5730affe3d31e21", "score": "0.6323991", "text": "def distance\n distance_and_arc[:distance]\n end", "title": "" }, { "docid": "a0e923f557569d5aecc32251a6299712", "score": "0.63197327", "text": "def distance\n return nil unless @locations.size > 1\n locations.each_cons(2).reduce(0) do |acc, (loc1, loc2)|\n acc + loc1.distance_to(loc2)\n end\n end", "title": "" }, { "docid": "fe9bf647010d2dd6e6181134610e48a8", "score": "0.6314549", "text": "def distance(p0, p1)\n a = factory.point(p0.x, p0.y)\n b = factory.point(p1.x, p1.y)\n\n a.distance(b) / 1000.0\n end", "title": "" }, { "docid": "674d64d6bf9a05315a6e839315bc8fa2", "score": "0.63124627", "text": "def distance(point1, point2)\n # square root of (x2-x1) squared + (y2-y1) squared\n Math.sqrt(((point2[0]-point1[0])**2)+((point2[1]-point1[1])**2))\nend", "title": "" }, { "docid": "21867886e30196fd547e64ee5a9ab5a2", "score": "0.63115525", "text": "def distance(p1, p2)\n dx = ED * (p1['lat']-p2['lat'])\n dy = ED * Math::cos(Math::PI*p1['lat']/180)*(p1['lon']-p2['lon'])\n return (dx**2 + dy**2)**0.5\nend", "title": "" }, { "docid": "09976112e7b564d0bf9c1169098457ab", "score": "0.63058364", "text": "def get_distance(lat1, long1, lat2, long2)\n\tdistance = 0\n\tdistance = Math.sqrt((lat2 - lat1)**2 + (long2-long1)**2)\n\treturn distance\nend", "title": "" }, { "docid": "7cbef104cfe9cb3736e76e9aa9b5570f", "score": "0.63051176", "text": "def distance(node)\n return (\n (@x - node.x) ** 2 +\n (@y - node.y) ** 2\n ) ** (0.5)\n end", "title": "" }, { "docid": "c768d84a13b4b36fe6e06ad661afec78", "score": "0.6304522", "text": "def euclidean_distance(a, b)\n Math.sqrt ( a.zip(b).map { |n| n.reduce(:-) }.map { |n| n**2 }.reduce(:+) )\nend", "title": "" }, { "docid": "268fe484001984bb09cde204b66b035a", "score": "0.6295066", "text": "def distance_to(other)\n self.to_i ^ other.to_i\n end", "title": "" }, { "docid": "01852082959b08eea3cb27775c12d6a6", "score": "0.6286222", "text": "def distance(sample1, sample2)\n index1 = @sample_names.find_index{|n| n==sample1}\n index2 = @sample_names.find_index{|n| n==sample2}\n raise \"error extracting the EBD distance between #{sample1.inspect} and #{sample2.inspect}\" unless index1 and index2 and index2 != index1\n if index1 > index2\n return @distance_matrix[index1][index2]\n else\n return @distance_matrix[index2][index1]\n end\n end", "title": "" }, { "docid": "2d122244f16a525cfc0eff1c5c897198", "score": "0.6278663", "text": "def distance(other)\n (other - self).magnitude.abs\n end", "title": "" }, { "docid": "525479be651fcf25ce58ba8ad9bddad6", "score": "0.62558466", "text": "def distance( origin, destination )\n return @graph[origin][destination]\n end", "title": "" }, { "docid": "72d8369f23bd6e123a72a50d0670758e", "score": "0.62478423", "text": "def jaro_distance( s1, s2 )\n jaro_distance_internal( Input.new( s1, s2 ) )\n end", "title": "" }, { "docid": "50ef0ebe11b874106fdb5aea6d473073", "score": "0.62149286", "text": "def distance( h )\n to_cube.distance(h.to_cube)\n end", "title": "" }, { "docid": "50ef0ebe11b874106fdb5aea6d473073", "score": "0.62149286", "text": "def distance( h )\n to_cube.distance(h.to_cube)\n end", "title": "" }, { "docid": "93e00f33c98ce28a5a012e609ce6ec8b", "score": "0.62131983", "text": "def distance_between(src, tar)\n @edges.each do |edge|\n return edge.distance if edge.src == src and edge.tar == tar\n end\n nil\n end", "title": "" }, { "docid": "d9d2ff204a311d3bedb61fd27e1ba74d", "score": "0.6208227", "text": "def distance obj\n\t\t\ta = obj.x-@x\n\t\t\tb = obj.y-@y\n\t\t\tc = Math.sqrt(a**2 + b**2)\t\n\t\tend", "title": "" }, { "docid": "0675a07dfbc60360e925a500baa7cf40", "score": "0.61948377", "text": "def distance_to(key)\n p1 = {\n x: (row_offset.to_f*unit_width)+((width(as: :mm))/2),\n y: (row.number.to_f*unit_height)-((height(as: :mm))/2)+(height(as: :mm))\n }\n\n p2 = {\n x: (key.row_offset.to_f*unit_width)+((key.width(as: :mm))/2),\n y: (key.row.number.to_f*unit_height)-((key.height(as: :mm))/2)+(key.height(as: :mm))\n }\n\n Math.sqrt( ((p1[:x]-p2[:x])**2) + ((p1[:y]-p2[:y])**2) ).round(2)\n end", "title": "" }, { "docid": "4c88d65b4f9e46598be2cca159bef323", "score": "0.6184967", "text": "def distance\n distance = 0\n (@path.size - 1).times { |i| distance += Vertex.euclidean_distance(@path[i], @path[i+1]) }\n return distance\n end", "title": "" }, { "docid": "0a1fc4c69d7130d3fcefe0c6049d7af0", "score": "0.61792666", "text": "def distance\n distance = 0\n @solution.each { |route| distance += route.distance }\n return distance\n end", "title": "" }, { "docid": "48eed7ed4640dfb6d1bb535952ede84c", "score": "0.61597663", "text": "def euclidian_distance array1, array2\n Math.sqrt(array1.zip(array2).inject(0){|a,(v1,v2)| a+(v2-v1)**2})\nend", "title": "" }, { "docid": "fbdd87386b6b79279c155351fdd37888", "score": "0.6156754", "text": "def calc_distance(x1,y1, x2,y2)\r\n# - - - - - - - - - - - - - - - - - - - -\r\n if (x1 == x2) && (y1 == y2)\r\n c = 0\r\n else\r\n a = (x1 - x2).abs * 1.0\r\n b = (y1 - y2).abs * 1.0\r\n csqd = (a*a) + (b * b)\r\n c = Math.sqrt(csqd)\r\n end # else\r\n return c\r\nend", "title": "" }, { "docid": "17a2d7204d21e41eca7339b9cac065f9", "score": "0.61561805", "text": "def compute_distance\n if exercise_rows\n exercise_rows.sort_by_part_order.inject(0) do |sum, row|\n actual_row_distance = row.compute_displayable_distance(distance).to_i\n actual_row_distance = distance if actual_row_distance == 0\n sum + actual_row_distance\n end\n else\n distance\n end\n end", "title": "" }, { "docid": "e7d6d13ff27957d35680ac9900bc43b1", "score": "0.61349696", "text": "def gmaps_distance(row, index)\n row[:elements][index] ? row[:elements][index][:distance][:value] : 0\n end", "title": "" }, { "docid": "b9c99121af61506b3efa7509d0ffc4b1", "score": "0.61149216", "text": "def distance(p1, p2)\n if p1[0] == p2[0]\n distance(p1[1..-1], p2[1..-1])\n else\n # pp p1\n # pp p2\n p1.length + p2.length - 2\n end\nend", "title": "" }, { "docid": "678a071b2947b4cacdd99f4dcfc4cb40", "score": "0.61128724", "text": "def points_distance(x1, y1, x2, y2)\n Math.sqrt((x1 - x2).abs2 + (y1 - y2).abs2)\n end", "title": "" }, { "docid": "b4271cc4f01d222ab3df41d0435f1fac", "score": "0.6111879", "text": "def euclidean_distance(other)\n # Create an array of pairs by merging each element of self with the corresponding element from other,\n # calculate (a - b) ^ 2 for all pairs, where a is the first element and b is the second element,\n # add the results together and return the square root of the result\n Math.sqrt zip(other).map { |a, b| (a - b) ** 2 }.sum\n end", "title": "" }, { "docid": "ea9a18f83cf86e6c0ed2b98f2e4d48e9", "score": "0.6105758", "text": "def distance_between\n # convert to coord arrays\n point1 = extract_coords([user.current_latitude, user.current_longitude])\n point2 = extract_coords([connection.current_latitude, connection.current_longitude])\n\n # convert degrees to radians\n point1 = to_radians(point1)\n point2 = to_radians(point2)\n\n # compute deltas\n dlat = point2[0] - point1[0]\n dlon = point2[1] - point1[1]\n\n a = (Math.sin(dlat / 2)) ** 2 + Math.cos(point1[0]) *\n (Math.sin(dlon / 2)) ** 2 * Math.cos(point2[0])\n c = 2 * Math.atan2( Math.sqrt(a), Math.sqrt(1-a))\n c * earth_radius\n end", "title": "" }, { "docid": "353c7220edfbd6c5743e3dec0ffaf95a", "score": "0.6101118", "text": "def distance(n)\n raise ArgumentError,\n \"A Node must be given as input.\\n\" +\n \"Received a #{n.class}\" unless n.is_a? Node\n return (\n (@r - n.r) ** 2 +\n (@c - n.c) ** 2\n ) ** (0.5)\n end", "title": "" }, { "docid": "93a33e7a5b32c0079a638ded568b8957", "score": "0.6098299", "text": "def distance\n self.distance_from(@origin) * 1.609344\n end", "title": "" }, { "docid": "f8c8b08f152623923e35708cbe365243", "score": "0.60957015", "text": "def distance(vector2)\n Math.sqrt(distance_sq(vector2))\n end", "title": "" }, { "docid": "9593513cd31dd203a39ce2f89250f762", "score": "0.6090338", "text": "def distance\n self.distance_to(current_knocker)\n end", "title": "" }, { "docid": "05c1252f0965a928312cd5efa3d04537", "score": "0.60859054", "text": "def calculate_distance_between(target)\n Math.sqrt((target.x - x)**2 + (target.y - y)**2)\n end", "title": "" }, { "docid": "9fa9542c5207c709b19ba2049e5af610", "score": "0.60722303", "text": "def distance_calculator(starting_position, ending_position)\n x_change = (starting_position[0] - ending_position[0])\n y_change = (starting_position[1] - ending_position[1])\n Math.sqrt(x_change*x_change + y_change*y_change)\n end", "title": "" }, { "docid": "a1776e308472e03baf001bf852b3b46f", "score": "0.60702574", "text": "def distance(loc1, loc2)\n\n lat1 = loc1[0].to_f\n lon1 = loc1[1].to_f\n\n lat2 = loc2[0].to_f\n lon2 = loc2[1].to_f\n\n dLat = conv_deg_rad(lat2 - lat1)\n dLon = conv_deg_rad(lon2 - lon1)\n\n a = Math.sin(dLat/2) * Math.sin(dLat/2) +\n Math.cos(lat1/180 * Math::PI) * Math.cos(lat2/180 * Math::PI) *\n Math.sin(dLon/2) * Math.sin(dLon/2)\n\n c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a))\n\n d = 6371e3 * c #meters\n\n return d\n end", "title": "" }, { "docid": "76e07643473873469556a36bf9199065", "score": "0.6065434", "text": "def distance()\n return @length\n end", "title": "" }, { "docid": "4d9cdfc9a99b9f06ae19ec6dd073b9b4", "score": "0.60630614", "text": "def distance(a, b)\n if a.is_a?(String) && b.is_a?(String)\n Twins::Utilities.string_distance(a, b) * -1\n elsif a.is_a?(Numeric) && b.is_a?(Numeric)\n Twins::Utilities.numeric_distance(a, b)\n else\n raise StandardError, \"Distance can only be determined between two elements of kind 'String' or 'Numeric'\"\n end\n end", "title": "" }, { "docid": "7e4f1c70278c6a4b6234211c6b20262e", "score": "0.6062278", "text": "def euclideanDistance(obj1, obj2)\r\n\teuc = 0\r\n\tfor d in 0...obj1.length\r\n\t\teuc += (obj1[d] - obj2[d])**2\r\n\tend\r\n\tMath.sqrt(euc)\r\nend", "title": "" } ]
87a9396f4ea1ebc74e5fbbdf0fb2d439
register a remove event action
[ { "docid": "a7fcbe82fa5607ea8e59d249e25c147e", "score": "0.6766247", "text": "def remove(trigger, action)\n trigger.java_send :registerAction, [Java::com::eventswarm::RemoveEventAction.java_class], java_object(action)\n end", "title": "" } ]
[ { "docid": "a36dfbcbf8c9309efdbf083ea8be5b68", "score": "0.79986686", "text": "def on_remove\n\n end", "title": "" }, { "docid": "74e72460d6b6720fd8830c7c1ec284ff", "score": "0.79901206", "text": "def on_remove\n #override if you want to do something on this event\n end", "title": "" }, { "docid": "74e72460d6b6720fd8830c7c1ec284ff", "score": "0.79901206", "text": "def on_remove\n #override if you want to do something on this event\n end", "title": "" }, { "docid": "b589a8d73d29515dd543d239caf60bbe", "score": "0.77835476", "text": "def remove_event(event); end", "title": "" }, { "docid": "7f6bf122964e3229e8132871bada2248", "score": "0.698088", "text": "def remove!(event)\n backend.remove!(user, event)\n end", "title": "" }, { "docid": "025c7ac7b290cb29c88d57d30ec4712d", "score": "0.68630314", "text": "def deleteRemovedEvents()\n end", "title": "" }, { "docid": "c604bd5bbcc29373a1b00105829a21f7", "score": "0.6850526", "text": "def on_remove\n _clear(:callbacks => false)\n end", "title": "" }, { "docid": "87843499c4a9c4c8235e5ff7772d2776", "score": "0.68465203", "text": "def on_remove(space, entity)\n\t\twarn \"#{self.class}#on_remove is not defined\"\n\tend", "title": "" }, { "docid": "fb37bbd84a76da5411b1fd4d52709702", "score": "0.67508364", "text": "def del_event(event)\n @hooks.delete(event) \n end", "title": "" }, { "docid": "fb37bbd84a76da5411b1fd4d52709702", "score": "0.67508364", "text": "def del_event(event)\n @hooks.delete(event) \n end", "title": "" }, { "docid": "3da973f5e5f917331268920da36b1209", "score": "0.6715792", "text": "def remove\n add \"remove()\"\n end", "title": "" }, { "docid": "a72f2a5dd45693465e004af69177d681", "score": "0.66845906", "text": "def remove_callback(action)\n\t\[email protected](action)\n\tend", "title": "" }, { "docid": "827cb4784daaab59caa3368b9579ce9e", "score": "0.6658633", "text": "def remove\n invoke ['remove']\n end", "title": "" }, { "docid": "d6b7e034382d9607b46f2147674f1cfd", "score": "0.66425073", "text": "def remove\n end", "title": "" }, { "docid": "d6b7e034382d9607b46f2147674f1cfd", "score": "0.66425073", "text": "def remove\n end", "title": "" }, { "docid": "14aa441653ebc9e2ef6a862452d09df7", "score": "0.66347003", "text": "def after_remove(*_args, &_block)\n self.set_callback :remove, :after, *_args, &_block\n end", "title": "" }, { "docid": "78910034099a8b86f11f684a685f36fa", "score": "0.66326237", "text": "def remove\n self.alive = false\n react_to :remove\n emit :remove_me\n end", "title": "" }, { "docid": "fc39a7dd3ed5100318efa752a776a98f", "score": "0.66132295", "text": "def remove\n end", "title": "" }, { "docid": "04495d94750f0a9afd3c44501482353e", "score": "0.6590365", "text": "def destroy\n event.destroy\n end", "title": "" }, { "docid": "cf469d015840667eee18366c7bb6ab08", "score": "0.65888655", "text": "def remove; end", "title": "" }, { "docid": "cf469d015840667eee18366c7bb6ab08", "score": "0.65888655", "text": "def remove; end", "title": "" }, { "docid": "cf469d015840667eee18366c7bb6ab08", "score": "0.65888655", "text": "def remove; end", "title": "" }, { "docid": "cf469d015840667eee18366c7bb6ab08", "score": "0.65888655", "text": "def remove; end", "title": "" }, { "docid": "cf469d015840667eee18366c7bb6ab08", "score": "0.65888655", "text": "def remove; end", "title": "" }, { "docid": "4ffbfc125757633f26243347d937095d", "score": "0.65805495", "text": "def un_remove(trigger, action)\n trigger.java_send :unregisterAction, [Java::com::eventswarm::RemoveEventAction.java_class], java_object(action)\n end", "title": "" }, { "docid": "b738dfab21dd5df60f9ece234a9d6381", "score": "0.655833", "text": "def reaction_remove(attributes = {}, &block)\n register_event(ReactionRemoveEvent, attributes, block)\n end", "title": "" }, { "docid": "5f35470c15903798b3c5c4dff0ed8a19", "score": "0.6533448", "text": "def before_remove(*_args, &_block)\n self.set_callback :remove, :before, *_args, &_block\n end", "title": "" }, { "docid": "c8f9f180e0a427797a10e1611701d4ab", "score": "0.6492079", "text": "def add_remove(trigger, action)\n add(trigger, action)\n remove(trigger, action)\n end", "title": "" }, { "docid": "a14870734605bb29726bca0282722a6d", "score": "0.6487458", "text": "def on_delete_event\n\t\tif @event\n\t\t\[email protected](@event)\n\t\t\t\n\t\t\tannounce(:event_remove_succ, @event.id)\n\t\tend\n\t\t\n\t\t@event = nil\n\t\t\n\t\tcancel\n\tend", "title": "" }, { "docid": "ca684a71772ae47c3f2aeb582723e10f", "score": "0.64828855", "text": "def remove\n @page.events.remove(@event_name, self)\n end", "title": "" }, { "docid": "e790f9b871f55339257d8b7924908456", "score": "0.6461634", "text": "def remove!; end", "title": "" }, { "docid": "bc60d60f9af1c7f0aa11fc2d07fd7f56", "score": "0.64442897", "text": "def broadcast_remove\n broadcast_remove_to self\n end", "title": "" }, { "docid": "8142eba65a6b678dcb853fad119d54d3", "score": "0.6443317", "text": "def remove\n \n end", "title": "" }, { "docid": "e4d50d04eb84f3a2ae34cdd73582769b", "score": "0.6418121", "text": "def on_removing_entry(state, event, *event_args)\n super\n\n # TODO: simulation - remove\n if simulating\n # From UploadController#delete:\n # ids = Upload.expand_ids(@item_id)\n __debug_sim('CODE') do\n args = \"id=#{submission.id.inspect}\"\n \"@items = Upload.expand_ids(#{args})\"\n end\n submission.items << submission.id\n end\n\n unless simulating\n wf_list_items(*event_args)\n end\n\n # TODO: simulation - remove\n __debug_sim('System shows the list of item(s) to be removed.')\n if submission&.auto_cancel\n __debug_sim('[auto_remove_cancel: true]')\n __debug_sim('USER decides not to delete item(s).')\n cancel! # NOTE: => :canceled\n elsif submission&.auto_submit\n __debug_sim('[auto_remove_submit: true]')\n __debug_sim('USER confirms the intent to delete item(s).')\n submit! # NOTE: => :removed\n else\n __debug_sim('USER must `cancel!` or `submit!` to advance...')\n end\n\n self\n end", "title": "" }, { "docid": "a98bd8f99008aaa641cd202ce15e7235", "score": "0.6411064", "text": "def remove(ref)\n @event.remove(target_ref(ref))\n end", "title": "" }, { "docid": "d466589c68afca589c70051c5135053e", "score": "0.6402848", "text": "def unregister\n Neo4j.event_handler.remove(self)\n end", "title": "" }, { "docid": "d466589c68afca589c70051c5135053e", "score": "0.6402848", "text": "def unregister\n Neo4j.event_handler.remove(self)\n end", "title": "" }, { "docid": "a1e80177de243f271ad5bdb32d1f33b7", "score": "0.63897586", "text": "def removeCallback( id, mthd )\n\t\t\t\tKesh::ArgTest::type( \"id\", id, Symbol )\n\t\t\t\tKesh::ArgTest::type( \"mthd\", mthd, Method )\n\t\t\t\t\n\t\t\t\tremoved = false\n\t\t\t\t\n\t\t\t\[email protected] {\t\t\n\t\t\t\t\tremoved = @events[ id ].remove( mthd ) if ( @events[ id ] != nil )\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn removed\n\t\t\tend", "title": "" }, { "docid": "9e91601156761f75a2e0480b4e015c45", "score": "0.63888305", "text": "def un_add(trigger, action)\n trigger.java_send :unregisterAction, [Java::com::eventswarm::AddEventAction.java_class], java_object(action)\n end", "title": "" }, { "docid": "e7383e5c146a1e11af9f763e97c571a0", "score": "0.638386", "text": "def removed!; end", "title": "" }, { "docid": "412826ed6ace63c14ce8b6661cb9a472", "score": "0.6366774", "text": "def remove\n super\n end", "title": "" }, { "docid": "2a7de96af265d84f7dfbbc9a181ca78c", "score": "0.63411206", "text": "def unregister &callable\n [email protected]! do |stored|\n stored.last.object == callable\n end\n @handlers << [events, callable]\n end", "title": "" }, { "docid": "ad1d39453fa2f1a67be94a39ea7604ad", "score": "0.6340576", "text": "def remove\n @actions << Rewriter::RemoveAction.new(self)\n end", "title": "" }, { "docid": "3042eed34c2413b92d70b5813416f8df", "score": "0.63307005", "text": "def unregister_event(command)\n self.class.remove_event(command)\n end", "title": "" }, { "docid": "08fdf0a89cfaf81c65fc46f86ab7c1a5", "score": "0.6309122", "text": "def remove_event(event)\n event = event.to_s.to_sym()\n\n if @@events.has_key?(event)\n @@events.delete(event)\n emit_event(:event_removed, event)\n end\n\n return event\n end", "title": "" }, { "docid": "723d43d8ed2378dc723b2cc76a631269", "score": "0.63034654", "text": "def on_delete &b\n \n end", "title": "" }, { "docid": "723d43d8ed2378dc723b2cc76a631269", "score": "0.63034654", "text": "def on_delete &b\n \n end", "title": "" }, { "docid": "ae6f4e94db66a643a8f01b28f8be4fbf", "score": "0.6299947", "text": "def remove\n delete(:remove)\n end", "title": "" }, { "docid": "43ed0dd2b0092cda669b791f2535424a", "score": "0.62377536", "text": "def remove(target)\n action :remove, target, allow_inferred_rendering: false\n end", "title": "" }, { "docid": "00952aff3288235024df87dd7b52524b", "score": "0.62365746", "text": "def remove_custom_event(id)\n if id != nil\n if @events.include?(id)\n @events.delete(id)\n end\n @need_refresh = true\n end\n end", "title": "" }, { "docid": "00952aff3288235024df87dd7b52524b", "score": "0.62365746", "text": "def remove_custom_event(id)\n if id != nil\n if @events.include?(id)\n @events.delete(id)\n end\n @need_refresh = true\n end\n end", "title": "" }, { "docid": "928d16af40144bee7dda94caf4be3d8d", "score": "0.6230433", "text": "def removed; end", "title": "" }, { "docid": "5c9b72b31de541e1af8882d4cb768cdf", "score": "0.6228595", "text": "def undelete\n collection << self\n self.class.issue_notification(self, :action => 'add')\n end", "title": "" }, { "docid": "9fb512d86de88d45ba31eedf506d1792", "score": "0.62156063", "text": "def removeEvent (eventKey, eventProc)\n @Calls[eventKey].delete(eventProc)\n end", "title": "" }, { "docid": "1d746039f2440edfa3c81c6633a708dc", "score": "0.62024474", "text": "def un_add_remove(trigger, action)\n un_add(trigger, action)\n un_remove(trigger, action)\n end", "title": "" }, { "docid": "3ac9a28f0cd54c28efbe31eb2fed89bd", "score": "0.61984843", "text": "def unregister; end", "title": "" }, { "docid": "f60a224d0a1019a5b44f0cc391c88cf6", "score": "0.6197621", "text": "def remove\n self.state = 'removed'\n end", "title": "" }, { "docid": "786bac996c9e5463a15bccf766bd408d", "score": "0.61933655", "text": "def remove(*)\n super.tap do\n __debug_sim('USER initiates removal of an existing entry or entries.')\n end\n end", "title": "" }, { "docid": "8fcaf2cf844f9804a9c327c66d1f28d5", "score": "0.61819834", "text": "def action_remove\n user = new_resource.user\n group = new_resource.group || new_resource.user\n home = new_resource.home || \"/home/#{user}\"\n\n converge_by(\"remove resource #{new_resource.name}\") do\n notifying_block do\n user user do\n home home\n action :remove\n end\n\n group group do\n members user\n action :remove\n end\n end\n end\n end", "title": "" }, { "docid": "e13c39ad98e9d68af72093d7566effcb", "score": "0.6163986", "text": "def remove_event(r_event)\r\n\t\[email protected] do\r\n\t\t\tid = r_event[@options[:id_field]]\r\n\t\t\tif @active.include?(id)\r\n\t\t\t\tevent.__send__ :on_interrupt\r\n\t\t\t\[email protected](id)\r\n\t\t\tend\r\n\t\t\[email protected](id)\r\n\t\tend\r\n\tend", "title": "" }, { "docid": "909186377f73d64862206592c9cac4f5", "score": "0.6157138", "text": "def del_event_hook(event)\n check_supported_event(event)\n @hooks.delete(event)\n end", "title": "" }, { "docid": "276175ed297b36b655fe7a86a6ac069e", "score": "0.61560094", "text": "def remove(toremove)\n \n end", "title": "" }, { "docid": "9600690f062623b6e115f1ec87aded78", "score": "0.61301214", "text": "def on_room_remove\n\t\[email protected]_room\n\t\tannounce(:room_remove, @assembly.cursor[1..2])\n\t\t\n\t\tcancel\n\tend", "title": "" }, { "docid": "39fdf3a426d231fcc65376a89e0e8af5", "score": "0.6123568", "text": "def remove\n destroy\n end", "title": "" }, { "docid": "91e57ebc7eeb84058a43132315ed59d0", "score": "0.611989", "text": "def destroy\n @event.destroy\n end", "title": "" }, { "docid": "91e57ebc7eeb84058a43132315ed59d0", "score": "0.611989", "text": "def destroy\n @event.destroy\n end", "title": "" }, { "docid": "91e57ebc7eeb84058a43132315ed59d0", "score": "0.611989", "text": "def destroy\n @event.destroy\n end", "title": "" }, { "docid": "feadba35d14f02a0edaa0404561a6bcc", "score": "0.6116536", "text": "def delete_event ev\n @@game.events.delete ev\n @@game.current_state.events.delete ev\n end", "title": "" }, { "docid": "9aa7458ca63ef7e6ec5f344f78a4e803", "score": "0.6114109", "text": "def before_remove rel, callback\n a = reflect_on_association(rel)\n send(a.macro, rel, a.options.merge(:before_remove => callback))\n end", "title": "" }, { "docid": "4e891102036d4aef63511d86cb803401", "score": "0.61040807", "text": "def undelete\n collection << self\n issue_notification(:action => 'add')\n end", "title": "" }, { "docid": "03327ace6ba0dcd2d85b98d0efa81ad8", "score": "0.6079005", "text": "def deregister(_arg0); end", "title": "" }, { "docid": "9331592d6fa5aaa20d269fbe63967a06", "score": "0.6077171", "text": "def remove_event(event)\n return false unless @handlers[event]&.event?\n\n @handers.delete event\n true\n end", "title": "" }, { "docid": "ee84daabfc08a4db43257a341adbefb7", "score": "0.60760754", "text": "def unregister_action(event, window=self)\n unless window.is_a?(Rubydraw::Window)\n raise ArgumentError, \"window must be a Rubydraw::Window\"\n end\n window.registered_actions[event].delete(self)\n end", "title": "" }, { "docid": "63b1a77a47cb78a76671000696a48acc", "score": "0.6058026", "text": "def remove( _uid )\n # TODO\n end", "title": "" }, { "docid": "fc6f18fab453ea26c912907c5e6ecc03", "score": "0.6050376", "text": "def remove_dish_from_event(event)\n self.events.destroy(event)\n self.save\n end", "title": "" }, { "docid": "130209b2c609ab8daa1a52e26f72c585", "score": "0.6047099", "text": "def delete(name)\n @event.delete_if { |event| event[:listener_name].to_s == name.to_s }\n end", "title": "" }, { "docid": "9d2f279c31dab22c9569a2add62357f0", "score": "0.60286367", "text": "def remove\n # puts \"Remove Each\"\n @added_listener.remove\n @added_listener = nil\n\n @changed_listener.remove\n @changed_listener = nil\n\n @removed_listener.remove\n @removed_listener = nil\n\n @templates.each(&:remove)\n @templates = nil\n\n super\n end", "title": "" }, { "docid": "6f8aba4278e59b31345c47fb0a753766", "score": "0.60163206", "text": "def destroy\n @registry_date_event.destroy\n end", "title": "" }, { "docid": "7568e8842b9759222f0cb870b783f802", "score": "0.60110205", "text": "def delete\n protocol.events.delete(self) if protocol\n end", "title": "" }, { "docid": "4e5a33adf344976743b94b6374e8e235", "score": "0.60004437", "text": "def remove_event_listener(object, event, callback_object)\r\n if @reload\r\n return\r\n end\r\n if !object\r\n log (\"Trying to remove event for nil object. #{event} #{callback_object.name}\")\r\n end\r\n key = object.uuid\r\n if @responders.dig(key, event)\r\n @responders[key][event].reject!{ |t| t[0] == callback_object }\r\n else\r\n log (\"Trying to remove event not registered in Game. #{object.name}, #{event}, #{callback_object.name}\")\r\n end\r\n if @responders.dig(key, event) && @responders.dig(key, event).empty?\r\n @responders[key].delete(event)\r\n end\r\n if @responders.dig(key) && @responders.dig(key).empty?\r\n @responders.delete(key)\r\n end\r\n end", "title": "" }, { "docid": "eafebd675388533b22f1c3397b9e00a9", "score": "0.5983174", "text": "def remove(entry); end", "title": "" }, { "docid": "c3ebe6f5e6d0d670e070d2932080b8b0", "score": "0.59764475", "text": "def remove_event(position)\r\n @script.delete_at(position)\r\n @modified = true\r\n end", "title": "" }, { "docid": "ae2923ba314b92f467505002348b421d", "score": "0.5960209", "text": "def auto_remove_callback\n @auto_remove_callback ||= (configuration_from_key('auto_remove_callback') || 'after_destroy')\n end", "title": "" }, { "docid": "26129f1b11036b7685fab4e4aa47fbef", "score": "0.5957744", "text": "def remove\n # do nothing by default\n end", "title": "" }, { "docid": "f7450bb7df22403a8e8b2da1e8e3f90a", "score": "0.5948054", "text": "def _trigger_destroy_callback; end", "title": "" }, { "docid": "79af230b220619140d38950137948891", "score": "0.59472096", "text": "def delete_event(event_id = 1)\r\n # Return if event not present\r\n return unless @events.has_key?(event_id)\r\n # Removes event from spriteset\r\n if $scene.is_a?(Scene_Map) && $scene.spriteset.is_a?(Spriteset_Map)\r\n $scene.spriteset.delete_character(@events[event_id])\r\n end\r\n # Deletes event from events list\r\n @events.delete(event_id)\r\n end", "title": "" }, { "docid": "20ccfdae77a5669fac777ab9760e99ed", "score": "0.5942647", "text": "def destroy\n #@event_event.destroy\n @event_event.deleted = true\n dest = @event_event.id\n type = 7 #event_notifications_code\n Notification.clear_notifications(type,dest)\n @event_event.save\n User.find(current_user.id).remove_event\n respond_to do |format|\n format.html { redirect_to event_events_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2bb875032dc733567b1d6804ad63ebe7", "score": "0.59343106", "text": "def event_removed(event, last, last_for_event)\n # Remove listener where there are no more events on this model\n @listener_event_counter.remove if last\n end", "title": "" }, { "docid": "f539f7626b4a6b40283058d2ae523842", "score": "0.59305716", "text": "def remove item\n end", "title": "" }, { "docid": "091d89f698815201206878ac4713fd2d", "score": "0.5917239", "text": "def remove_event(event)\n if @event_counts[event]\n count = @event_counts[event] -= 1\n\n if count == 0\n @event_chain.each_pair do |chain_listener,listeners|\n listeners[event].remove# if listeners[event]\n listeners.delete(event)\n end\n\n # Also remove the event count\n @event_counts.delete(event)\n end\n end\n end", "title": "" }, { "docid": "b455bda590764769706695672c50d099", "score": "0.59132046", "text": "def destroy\n @event.destroy\n head :ok\n end", "title": "" }, { "docid": "e6d61f5ce4dccd27bc7900dbca23be0a", "score": "0.5903123", "text": "def remove\n @added_listener.remove\n @added_listener = nil\n\n @changed_listener.remove\n @changed_listener = nil\n\n @removed_listener.remove\n @removed_listener = nil\n\n if @templates\n @templates.compact.each(&:remove)\n @templates = nil\n end\n\n super\n end", "title": "" }, { "docid": "9f37c944d10b57ac35b9073eeb3b4243", "score": "0.5897976", "text": "def remove(*args)\n end", "title": "" }, { "docid": "76da12806959e06f1272da40ea6e2df5", "score": "0.58926743", "text": "def event_removed(event, last, last_for_event)\n @persistor.event_removed(event, last, last_for_event) if @persistor\n end", "title": "" }, { "docid": "740c3f04d680405a1a4e2ffed5beb09f", "score": "0.5886579", "text": "def remove(type); end", "title": "" }, { "docid": "740c3f04d680405a1a4e2ffed5beb09f", "score": "0.5886579", "text": "def remove(type); end", "title": "" }, { "docid": "effc84d90daf84e6ecc4c54c19125aac", "score": "0.58839744", "text": "def delete_event\n\t\tcal_event = Event.find_by(script_tag: self.id)\n\t\tcal_event.destroy if cal_event\n\tend", "title": "" }, { "docid": "ad6a188fc8ae0f29feb773828807ae57", "score": "0.5877263", "text": "def remove_observer(observer)\n end", "title": "" }, { "docid": "ad6a188fc8ae0f29feb773828807ae57", "score": "0.5877263", "text": "def remove_observer(observer)\n end", "title": "" }, { "docid": "ad6a188fc8ae0f29feb773828807ae57", "score": "0.5877263", "text": "def remove_observer(observer)\n end", "title": "" } ]
c70fffdf12d341bcf1b29d000c3702df
GET /events/1 GET /events/1.json
[ { "docid": "66513fb4ef7b7a451803b7424d989324", "score": "0.0", "text": "def show\n if params[:format] == \"img\"\n @img_url = EventBanner.find(params[:banner_id]).file.path\n if Rails.env == \"development\"\n send_file @img_url, :type => 'image/jpeg', :disposition => 'attachment'\n else\n send_file Rails.root+\"/\"+@img_url, :type => 'image/jpeg', :disposition => 'attachment'\n end\n else\n @banners = @event.event_banners\n @interaction = Interaction.new\n @add_event_user = EventUser.new\n if !params[:q].nil?\n @other_users = User.where(\"name like ?\", \"%#{params[:q]}%\")\n else\n @other_users = User.find(:all, :conditions=>[\"id != ?\", current_user.id] ) if user_signed_in?\n end\n @event = Event.find(params[:id])\n @speakers = @event.event_users.find_all_by_event_type(\"Speaker\")\n @partners = @event.event_users.find_all_by_event_type(\"Partner\")\n @attendee = @event.event_users.find_all_by_event_type(\"Attendee\")\n @venue = @event.event_users.find_all_by_event_type(\"Venue\")\n @event_user = @event.user\n respond_to do |format|\n format.html\n format.json { render :json => @other_users }\n end\n end\n end", "title": "" } ]
[ { "docid": "2d5580b43c7c18bcd8a06713fa4be0f1", "score": "0.75926495", "text": "def show\n\t\tevent_id = params[:id]\n\t\tif event_id.present?\n\t\t\t@event = Com::Nbos::Events::Event.active_events.where(:id => event_id)\n\t\t\trender :json => @event\n\t\telse\n\t\t\trender :json => {status: 400, message: \"Bad Request\"}, status: 400\n\t\tend\n\tend", "title": "" }, { "docid": "ef3b9fa4fcf4cc779afcdcc77f6f94b2", "score": "0.7470553", "text": "def show\n @event = Event.find(params[:id])\n render json: @event, status: 200\n end", "title": "" }, { "docid": "a6f17cb2e0c0bf15dafb24e485b6f80d", "score": "0.7444542", "text": "def show\n\t\t@events = Event.find(params[:id])\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": "3b34aa351459656af1ea987c26bdcb1b", "score": "0.744193", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "3b34aa351459656af1ea987c26bdcb1b", "score": "0.744193", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "32f1c45b802c8eb963b57bd19c7021bc", "score": "0.74406016", "text": "def show \n @event = Event.find params[:id]\n render json: @event, status: :ok\n end", "title": "" }, { "docid": "59fd8e27453bd20f76931164769ca4a8", "score": "0.74241066", "text": "def show\n @event = Event.find_by(id: params[:id])\n render json: @event\n end", "title": "" }, { "docid": "23b081913c4095ba481ca20c0017c37a", "score": "0.7424073", "text": "def show\n \n @event = Event.find(params[:id])\n \n\n respond_to do |format|\n format.html # events_path\n format.json { render json: events_path }\n end\n end", "title": "" }, { "docid": "470317defe83e35951c6c122d1f185b0", "score": "0.73936605", "text": "def show\n render json: @event, status: 200\n end", "title": "" }, { "docid": "877c162a18ff6baee8f083e383d2ad98", "score": "0.7383787", "text": "def show\n \t@event = Event.find(params[:id])\n \trender json: @event\n \t\n end", "title": "" }, { "docid": "da5a9d883b89e5e96507ec12f9e0aa14", "score": "0.73572993", "text": "def event\n begin\n JSON.parse(@omegle.post('/events', \"id=#{@id}\").body)\n rescue\n end\n end", "title": "" }, { "docid": "39720392e6631a437f629bf51500afb9", "score": "0.73560303", "text": "def show\n render json: @event.to_json, status: 200\n end", "title": "" }, { "docid": "53f346e7133fc3a8dd0297a45e606186", "score": "0.7343874", "text": "def show\n @simple_event = SimpleEvent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @simple_event }\n end\n end", "title": "" }, { "docid": "483079b80dfb97ee802273ad3849fa6b", "score": "0.7329677", "text": "def events\n @page = 'events'\n respond_to do |format|\n format.html {\n @events = Event.find(:all)\n }\n format.json {}\n end\n end", "title": "" }, { "docid": "50fda9b8c4c7883bb7aef1c21d64535d", "score": "0.7296473", "text": "def show\n @event = Event.find(params[:event_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": "26631fa7d741f63dc0de4ebc0ce1e053", "score": "0.72901815", "text": "def index\n render json: { \n status: 200, \n events: Event.get_ongoing_events.as_json(\n only: [\n :id, \n :event_name, \n :reward_item, \n :event_start_time, \n :event_end_time\n ] \n )\n }\n end", "title": "" }, { "docid": "93e221f52a1fb29f9fa66aa41392b614", "score": "0.72677374", "text": "def index\n json_response(@calendar.events)\n end", "title": "" }, { "docid": "72c923bebff9a490f37ce18ecc3c9c3f", "score": "0.72532594", "text": "def index\n @events = Event.all\n\n render json:{status: 200, events: @events}, status: :ok\n end", "title": "" }, { "docid": "6b0594a368be5468d07ec6b6adda204f", "score": "0.7244934", "text": "def show\n @event = Event.find(params[:id])\n render json: @event, serializer: EventSerializer\n end", "title": "" }, { "docid": "43a32e9b14935754f5350879e1afed4b", "score": "0.7244453", "text": "def get(event_id)\n request 'get', :e_id => event_id\n end", "title": "" }, { "docid": "37a406a970f90d1bbcbc7811263a0334", "score": "0.7243571", "text": "def show\n \t@event = Event.find(params[:id])\n respond_to do |format|\n format.json { render json: @event, status: :ok }\t\n end \t \t\n end", "title": "" }, { "docid": "905af5b22530fb3991afcfb14e6c4358", "score": "0.7241864", "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.to_api_hash }\n end\n end", "title": "" }, { "docid": "febcc91647b65e8ccc5954b1cf77ecf7", "score": "0.7237047", "text": "def show\n render json: @event, status: :ok\n end", "title": "" }, { "docid": "c1413f5ad65b767ef61afdd4893b8b7f", "score": "0.7231732", "text": "def show\n ##\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { respond_event @event }\n end\n end", "title": "" }, { "docid": "286c133d90e3577bef6bb7ce8998890f", "score": "0.7223309", "text": "def show\n @event = Calendar.find(params[:id])\n render json: @event\n end", "title": "" }, { "docid": "a069e984b7364b889a975fb865b92e2e", "score": "0.7219172", "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.7219172", "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": "04cc950e605be71e9988faad209e5239", "score": "0.7215904", "text": "def show\n @event = Event.find(params[:id])\nlogger.info @event.to_json\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end", "title": "" }, { "docid": "a304667961121c67ccaa3df021b1d564", "score": "0.72146964", "text": "def retrieve(id)\n @client.make_request(:get, \"events/#{id}\", MODEL_CLASS)\n end", "title": "" }, { "docid": "66cec9200352931dc624c60aa268ea93", "score": "0.7204848", "text": "def index\n @events = Event.all\n render json: @events\n end", "title": "" }, { "docid": "5afd9c217db582ab4e1d31c633a112c3", "score": "0.7201678", "text": "def index\n @events = Event.get_events(params)\n end", "title": "" }, { "docid": "a85255d083e155277c7206a8fbe1dc67", "score": "0.7193262", "text": "def events\n @events = Event.find(:all)\n\t respond_to do |format|\n\t\tformat.html # show.html.erb\n\t\tformat.json { render :json => @events }\n\t end\nend", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7192214", "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.7190171", "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": "53f03fe240698fa4821da04fd48001bd", "score": "0.7190171", "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": "0bd25cda8f89493807a725bdf88743c8", "score": "0.7185553", "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": "ffba32a75db83cfe33fbadcd45ea8758", "score": "0.71788853", "text": "def show\n\t@event = Event.find(params[:id])\n\n\trespond_to do |format|\n\t format.html # show.html.erb\n\t format.json { render json: @event }\n\tend\n end", "title": "" }, { "docid": "9f3479ee0d84bb4c759aa1ad3851528c", "score": "0.7176304", "text": "def show\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html { render :show }\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "5d778e810a29178b1727eb24697e4654", "score": "0.7166417", "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": "ce4ca83790dbd6603d50dfea9eaba5d6", "score": "0.716499", "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": "ce4ca83790dbd6603d50dfea9eaba5d6", "score": "0.716499", "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": "269ca140e2c57ccf3c31608aca7982ba", "score": "0.7163602", "text": "def show\n @event = Event.find(params[:id])\n respond_with @event.as_json\n end", "title": "" }, { "docid": "df721db38838316d4629530c6877bdf3", "score": "0.71610856", "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": "df721db38838316d4629530c6877bdf3", "score": "0.71610856", "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": "df721db38838316d4629530c6877bdf3", "score": "0.71610856", "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": "df721db38838316d4629530c6877bdf3", "score": "0.71610856", "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": "df721db38838316d4629530c6877bdf3", "score": "0.71610856", "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": "" } ]
c088202dc0c45c55dc47438e2d249804
Agrega alumnos al grupo, que esten sin grupo, se pueden filtrar con la busqueda
[ { "docid": "82c946167ced9d06abbcec9e5997fa91", "score": "0.54103947", "text": "def agregar_alumnos\n @grupo = Grupo.find(params[:id])\n if request.get?\n @alumnos = Alumno.alumnos_sin_grupo(params[:buscar])\n end\n if request.put?\n unless params[:alumno_ids].nil?\n @alumnos = Alumno.find(params[:alumno_ids])\n for a in @alumnos\n @grupo.alumnos << a\n end\n flash[:notice] = \"Se agregaron los alumnos al grupo\" if @grupo.save\n end\n redirect_to grupo_path(@grupo)\n end\n end", "title": "" } ]
[ { "docid": "b80b693a211f648a27ce402f2828bdf5", "score": "0.6321125", "text": "def mostrar_palabras_clave_grupos \n \n puts \"Esta operación puede tardar un poco, le rogamos tenga paciencia por favor.\"\n puts\n puts\n coleccion = @hemeroteca.palabras_clave_grupos \n coleccion.each_index do |i|\n puts \"Grupo #{i+1}:\" \n puts \"---------\"\n puts coleccion[i].join(\", \")\n puts \n puts \n end\n if coleccion.empty? then\n puts \"Lo sentimos, no se han encontrado noticias.\" \n puts\n puts\n end \n \n end", "title": "" }, { "docid": "a4091f24a3f99ecd0c8366f352bfb669", "score": "0.5762422", "text": "def index\n @usuario = User.where(:id => current_user.id).pluck(:id).first\n @registros = Registro.where(:grupo_id => params[:clave]).paginate(:page => params[:page]).order('id DESC')\n @name = Grupo.where(:clave => params[:clave]).pluck(:nombre).first\n @grupos = Grupo.all\n @grupo = Grupo.new\n end", "title": "" }, { "docid": "7e74a2170c50b77449eb3128455f9c24", "score": "0.55846435", "text": "def procesa_grupo(minitemnum, maxitemnum, grupof=[], grupoe=[])\n conecta_onbase\n if [email protected]?\n @client.close\n end\n @client = TinyTds::Client.new(@@hbase)\n @client.execute(\"USE OnBase\").do;\n \n # Ya estan todos\n if grupof.length == 0 && grupoe.length > 0\n puts \"No faltan\"\n return\n end\n if grupof.length > 0\n cadestan = \"AND itemdata.itemnum IN (\" + grupof.join(', ') + \")\"\n# else\n# consestan = \"SELECT onbase_itemnum FROM sal7711_gen_articulo \n# WHERE onbase_itemnum < #{maxitemnum}\n# AND onbase_itemnum >= #{minitemnum} ORDER BY 1\"\n# estan = ActiveRecord::Base.connection.select_all consestan\n# cadestan = estan.to_a.map {|v| v['onbase_itemnum']}.join(', ')\n#\n# if cadestan.length > 0\n# cadestan = \"AND itemdata.itemnum NOT IN (\" + cadestan + \")\"\n# end\n end\n fbuenos = \"FROM itemdata \n JOIN itemdatapage ON itemdata.itemnum=itemdatapage.itemnum \n JOIN keyitem103 ON keyitem103.itemnum=itemdata.itemnum \n JOIN keyxitem101 ON keyxitem101.itemnum = itemdata.itemnum\n JOIN keytable101 ON keyxitem101.keywordnum = keytable101.keywordnum \n JOIN keyxitem104 ON keyxitem104.itemnum = itemdata.itemnum\n JOIN keytable104 ON keyxitem104.keywordnum = keytable104.keywordnum \n LEFT JOIN keyxitem112 ON keyxitem112.itemnum = itemdata.itemnum\n LEFT JOIN keytable112 ON keyxitem112.keywordnum = keytable112.keywordnum \n LEFT JOIN keyxitem108 ON keyxitem108.itemnum = itemdata.itemnum\n LEFT JOIN keytable108 ON \n keyxitem108.keywordnum = keytable108.keywordnum \n LEFT JOIN keyxitem110 ON keyxitem110.itemnum = itemdata.itemnum\n LEFT JOIN keytable110 ON \n keyxitem110.keywordnum = keytable110.keywordnum \n LEFT JOIN keyxitem113 ON keyxitem113.itemnum = itemdata.itemnum\n LEFT JOIN keytable113 ON \n keyxitem113.keywordnum = keytable113.keywordnum \n LEFT JOIN keyxitem114 ON keyxitem114.itemnum = itemdata.itemnum\n LEFT JOIN keytable114 ON \n keyxitem114.keywordnum = keytable114.keywordnum \n LEFT JOIN archivedqueue ON\n itemdata.batchnum = archivedqueue.batchnum \n WHERE keyitem103.keyvaluedate >= '1960-01-01'\n AND keyitem103.keyvaluedate <= '#{Time.now.strftime(\"%Y-%m-%d\")}'\n AND itemname LIKE 'Prensa Cinep%' \"\n\n c=\"SELECT itemdata.itemnum AS itemnum, itemdata.itemname AS itemname,\n itemdata.batchnum AS batchnum,\n itemdatapage.filepath AS filepath,\n keyitem103.keyvaluedate AS fecha,\n keytable101.keyvaluechar AS fuenteprensa,\n keytable104.keyvaluechar AS pagina,\n keytable108.keyvaluechar AS departamento,\n keytable110.keyvaluechar AS municipio,\n keytable112.keyvaluechar AS cat1,\n keytable113.keyvaluechar AS cat2,\n keytable114.keyvaluechar AS cat3,\n archivedqueue.batchname AS batchname\n #{fbuenos}\n AND itemdata.itemnum < #{maxitemnum}\n AND itemdata.itemnum >= #{minitemnum}\n #{cadestan}\n ORDER BY itemnum \"\n puts \"OJO q=#{c}\"\n numreg = 0\n # Resultado a colchon en memoria\n colchon = []\n result = @client.execute(c)\n result.try(:each) do |fila|\n colchon << fila\n end\n result.cancel\n @client.close\n\n if colchon.length == 0\n puts \"De los que faltan en base local no hay registros completos en remota\"\n return\n end\n puts \"Procesando colchon\"\n # Se procesa colchon\n colchon.each do |fila|\n numreg += 1\n itemnum = fila['itemnum']\n puts \"numreg=#{numreg}, itemnum=#{itemnum}\"\n if grupoe.index(itemnum).nil?\n itemname = fila['itemname']\n puts \"itemname #{itemname}\"\n nart = Sal7711Gen::Articulo.new\n if !nart\n @cprob += \"<br>No pudo crearse articulo\"\n next\n end\n nart.onbase_itemnum = itemnum\n nart.adjunto_descripcion = itemname\n nart.fecha = fila['fecha']\n # Lote\n nlote = fila['batchnum'] \n if nlote \n if !Lote.exists?(nlote.to_i)\n l = Lote.new\n l.id = nlote.to_i\n l.usuario_id = current_usuario.id\n logger.info \"OJO current_usuario.id=#{current_usuario.id}\"\n l.nombre = fila['batchname']\n l.save!\n end\n nart.lote_id = nlote\n end\n\n # Departamento\n # #byebug\n dep = fila[\"departamento\"]\n if dep && dep.strip != ''\n nart.departamento = Sip::Departamento.where(\n \"SUBSTRING(nombre FROM 1 FOR 45) = ?\", dep.strip).first\n # Municipio\n mun=fila[\"municipio\"]\n if mun && mun.strip != ''\n nart.municipio = Sip::Municipio.where(\n id_departamento: nart.departamento_id).where(\n \"SUBSTRING(nombre FROM 1 FOR 45) = ?\", mun.strip).first\n end\n end\n\n # Fuente de prensa\n f = fila['fuenteprensa']\n if !f || f.strip == ''\n @cprob += \"<br>Elemento #{itemnum} no tiene fuente (saltando)\"\n incregprob(itemnum)\n next\n end\n nart.fuenteprensa = Sip::Fuenteprensa.where(\n \"SUBSTRING(nombre FROM 1 FOR 45) = ?\", f.strip).first\n if nart.fuenteprensa.nil?\n @cprob += \"<br>Elemento #{itemnum} tiene fuente errada #{f} (saltando)\"\n incregprob(itemnum)\n next\n end\n\n # Pagina\n p = fila['pagina']\n if !p || p.strip == ''\n @cprob += \"<br>Elemento #{itemnum} no tiene página (saltando)\"\n incregprob(itemnum)\n next\n end\n nart.pagina = p\n\n # Adjunto\n nart.created_at = nart.fecha\n nart.updated_at = Time.now\n\n nart.adjunto_file_name = \"J\"\n nart.adjunto_content_type = \"J\"\n nart.adjunto_file_size = 0\n nart.adjunto_updated_at = Time.now\n nart.save\n\n prefijoruta = Rails.root.join(\n 'public', Rails.application.config.x.url_colchon)\n rlocal = descarga_onbase(fila['filepath'].rstrip,\n prefijoruta.to_s + \"/\")\n\n if !File.exists?(rlocal)\n @cprob += \"<br>No pudo descargarse archivo #{rlocal}\"\n next\n end\n File.open(rlocal, \"r\") do |arc|\n nart.adjunto = arc\n nart.save\n end\n\n # Categorias\n (1..3).each do |ncat|\n ccat = fila['cat' + ncat.to_s]\n if !ccat || ccat.strip == ''\n if ncat == 1\n @cprob += \"<br>Elemento #{itemnum} no tiene categoria 1\"\n incregprob(itemnum)\n end\n else\n ccat.strip!\n cat = Sal7711Gen::Categoriaprensa.where(codigo: ccat).first\n if !cat\n @cprob += \"<br>Elemento #{itemnum} tiene categoria #{ncat} \" +\n \"errada: #{ccat} (ignorando)\"\n incregprob(itemnum)\n else\n cp = Sal7711Gen::ArticuloCategoriaprensa.new(\n articulo_id: nart.id, categoriaprensa_id: cat.id, orden: ncat)\n cp.save\n end\n end\n end\n\n nart.adjunto_descripcion = \n Sal7711Gen::ArticulosController.gen_descripcion_bd(nart)\n nart.save\n\n @sinc << itemname\n @procesados += 1\n end\n @examinados += 1\n end\n #conecta_onbase\n end", "title": "" }, { "docid": "4d34104c294e9b2763b9f013a9a62544", "score": "0.54804814", "text": "def index\n @grupos = Grupo.all\n end", "title": "" }, { "docid": "4d34104c294e9b2763b9f013a9a62544", "score": "0.54804814", "text": "def index\n @grupos = Grupo.all\n end", "title": "" }, { "docid": "847a2279fcaa6f712b48418b8e828783", "score": "0.53933114", "text": "def busquedaLaboratoriosAgregados\n nombre = params[:laboratorio_id]\n id = session[:farmacia_id]\n sql = \"Select laboratorios.nombre, laboratorios.descripcion, laboratorios.id, lab_fars.activo from lab_fars, laboratorios where lab_fars.farmacium_id = #{id} and lab_fars.laboratorio_id = laboratorios.id and LOWER(laboratorios.nombre) like LOWER('%#{nombre}%') order by nombre\"\n @laboratorios = Laboratorio.paginate_by_sql(sql, :page => params[:page], :per_page => 7)\n render :template => \"lab_fars/laboratoriosfarmacia\"\n end", "title": "" }, { "docid": "8cd60fbb7ab5a2c069fbe06a11c0d4a0", "score": "0.53852195", "text": "def groupes_libres\n Regroupement.filter(:etablissement => self, :type_regroupement_id => TYP_REG_LBR).all \n end", "title": "" }, { "docid": "e3153979e09f88063c8999a4aaf19b46", "score": "0.5371395", "text": "def busqueda(g, d, h, nro_nodos, nodos_visitados, nro_nodos_en_caminos)\r\n #Luego, en esta variable dependiendo de si estamos en un objeto DFS o BFS, se definira el orden\r\n #en el que se seleccionaran los nodos para la busqueda. Ademas, esta variable tendra los elementos\r\n #adyacentes del nodo d ya sea en una pila o en una cola. \r\n pila_o_cola = self.orden_nodos(g,d)\r\n\r\n #pila_o_cola.estructura.each {|elem| puts elem}\r\n\r\n #Verificamos si la pila o cola, de adyacentes, incluye a \"h\"\r\n if pila_o_cola.estructura.include? h \r\n\r\n #De ser asi, se incluye el numero de nodos del recorrido que llevo a \"h\"\r\n nro_nodos_en_caminos << nro_nodos\r\n\r\n #Si la pila o cola no incluye a \"h\"\r\n else\r\n\r\n #Entonces mientras no este vacia, se recorre la estructura\r\n while not(pila_o_cola.vacio)\r\n\r\n #Luego se remueve un nodo de la estructura, que sera el siguiente que se usara\r\n #como \"inicio\" de la busqueda\r\n siguiente_nodo = pila_o_cola.remover\r\n\r\n #Si el nodo en cuestion no ha sido visitado\r\n if not(nodos_visitados.include? siguiente_nodo)\r\n #Lo agregamos al arreglo de visitados\r\n nodos_visitados << siguiente_nodo\r\n #Y hacemos una llamada recursiva al metodo busqueda pero esta vez partiendo\r\n #del nodo antes tomado. En esta llamada aumentamos el numero de nodos (nro_nodos)\r\n #en 1\r\n busqueda(g, siguiente_nodo, h , nro_nodos + 1 , nodos_visitados, nro_nodos_en_caminos)\r\n end\r\n end\r\n end\r\n\r\n #Luego de que acaba todo el procesamiento verificamos si en el arreglo \"nro_nodos_en_caminos\"\r\n #esta vacio, si es asi entonces significa que el nodo \"h\" no fue alcanzado entonces\r\n if nro_nodos_en_caminos.empty?\r\n #retornamos -1\r\n return -1\r\n end\r\n\r\n #Finalmente, si sobrevivimos todo lo anterior, llegados a este punto retornamos el numero de nodos que\r\n #fueron recorridos de \"d\" a \"h\". Recordamos que el arreglo \"nro_nodos_en_caminos\" contiene para todos los\r\n #caminos de \"d\" a \"h\", el numero de nodos recorridos.\r\n\r\n ## OJO: En este caso se retornara el nro de nodos recorridos del camino mas corto. ##\r\n\r\n #Sin embargo, si se quisiera el nro de nodos de solo el primer camino por el que se metio y encontro a \"h\"\r\n #bastaria con solo retornar \"nro_nodos_en_caminos[0]\".\r\n #Por otra parte, si se quisiera para cada camino el nro de nodos recorridos entonces basta con retornar\r\n #el arreglo completo, etc.\r\n \r\n return \"#{nro_nodos_en_caminos.min} nodos recorridos.\"\r\n end", "title": "" }, { "docid": "c2203ec6bf9e96247fbe68828c06ee6f", "score": "0.53664243", "text": "def modelo_carne_build_data_right(doc, boleto, colunas, linhas)\n # LOGOTIPO do BANCO\n doc.image boleto.logotipo, x: (colunas[2] - 0.11), y: linhas[0]\n\n # Numero do banco\n doc.moveto x: colunas[4], y: linhas[0]\n doc.show \"#{boleto.banco}-#{boleto.banco_dv}\", tag: :grande\n\n # linha digitavel\n doc.moveto x: colunas[6], y: linhas[0]\n doc.show boleto.codigo_barras.linha_digitavel, tag: :media\n\n # local de pagamento\n doc.moveto x: colunas[2], y: linhas[1]\n doc.show boleto.local_pagamento\n\n # vencimento\n doc.moveto x: colunas[11], y: linhas[1]\n doc.show boleto.data_vencimento.to_s_br\n\n # cedente\n doc.moveto x: colunas[2], y: linhas[2]\n doc.show boleto.cedente\n\n # agencia/codigo cedente\n doc.moveto x: colunas[11], y: linhas[2]\n doc.show boleto.agencia_conta_boleto\n\n # data do documento\n doc.moveto x: colunas[2], y: linhas[3]\n doc.show boleto.data_documento.to_s_br if boleto.data_documento\n\n # numero documento\n doc.moveto x: colunas[3], y: linhas[3]\n doc.show boleto.documento_numero\n\n # especie doc.\n doc.moveto x: colunas[8], y: linhas[3]\n doc.show boleto.especie_documento\n\n # aceite\n doc.moveto x: colunas[9], y: linhas[3]\n doc.show boleto.aceite\n\n # dt processamento\n doc.moveto x: colunas[10], y: linhas[3]\n doc.show boleto.data_processamento.to_s_br if boleto.data_processamento\n\n # nosso numero\n doc.moveto x: colunas[11], y: linhas[3]\n doc.show boleto.nosso_numero_boleto\n\n # uso do banco\n ## nada...\n\n # carteira\n doc.moveto x: colunas[3], y: linhas[4]\n doc.show boleto.carteira\n\n # especie\n doc.moveto x: colunas[5], y: linhas[4]\n doc.show boleto.especie\n\n # quantidade\n doc.moveto x: colunas[7], y: linhas[4]\n doc.show boleto.quantidade\n\n # valor documento\n doc.moveto x: colunas[8], y: linhas[4]\n doc.show boleto.valor_documento.to_currency\n\n # valor do documento\n doc.moveto x: colunas[11], y: linhas[4]\n doc.show boleto.valor_documento.to_currency\n\n # Instruções\n doc.moveto x: colunas[2], y: linhas[5]\n doc.show boleto.instrucao1\n doc.moveto x: colunas[2], y: linhas[6]\n doc.show boleto.instrucao2\n doc.moveto x: colunas[2], y: linhas[7]\n doc.show boleto.instrucao3\n doc.moveto x: colunas[2], y: linhas[8]\n doc.show boleto.instrucao4\n doc.moveto x: colunas[2], y: linhas[9]\n doc.show boleto.instrucao5\n doc.moveto x: colunas[2], y: linhas[10]\n doc.show boleto.instrucao6\n\n # Sacado\n doc.moveto x: colunas[2], y: linhas[11]\n if boleto.sacado && boleto.sacado_documento\n doc.show \"#{boleto.sacado} - #{boleto.sacado_documento.formata_documento}\"\n end\n\n # Sacado endereço\n doc.moveto x: colunas[2], y: linhas[12]\n doc.show boleto.sacado_endereco.to_s\n\n # codigo de barras\n # Gerando codigo de barra com rghost_barcode\n if boleto.codigo_barras\n doc.barcode_interleaved2of5(boleto.codigo_barras, width: '10.3 cm', height: '1.2 cm', x: colunas[2],\n y: linhas[14])\n end\n end", "title": "" }, { "docid": "5e82a01b096fcf6c0ef53af180f03806", "score": "0.5301792", "text": "def filtros_iniciales\n @reinos = Especie.select_grupos_iconicos.where(nombre_cientifico: Busqueda::GRUPOS_REINOS)\n @animales = Especie.select_grupos_iconicos.where(nombre_cientifico: Busqueda::GRUPOS_ANIMALES)\n @plantas = Especie.select_grupos_iconicos.where(nombre_cientifico: Busqueda::GRUPOS_PLANTAS)\n @nom_cites_iucn_todos = Catalogo.nom_cites_iucn_todos\n @distribuciones = TipoDistribucion.distribuciones(I18n.locale.to_s == 'es-cientifico')\n end", "title": "" }, { "docid": "f2a6efe0b7c1575e1b1dc2000eab784b", "score": "0.526436", "text": "def ldap_busca_grupos_usuario_como_admin(uid, gidnumber, prob)\n grupos = []\n opcon = {\n host: Rails.application.config.x.jn316_servidor,\n port: Rails.application.config.x.jn316_puerto,\n auth: {\n method: :simple, \n username: Rails.application.config.x.jn316_admin,\n password: ENV['JN316_CLAVE']\n }\n }.merge(Rails.application.config.x.jn316_opcon)\n filter = Net::LDAP::Filter.eq( \"objectClass\", 'posixGroup')\n ldap_conadmin = Net::LDAP.new( opcon )\n lgrupos = ldap_conadmin.search(\n base: Rails.application.config.x.jn316_basegrupos, \n filter: filter \n )\n if lgrupos.nil?\n prob << 'No se pudieron cargar grupos: '+\n ldap_conadmin.get_operation_result.code.to_s +\n ' - ' + ldap_conadmin.get_operation_result.message \n return nil\n end\n lgrupos.each do |entry|\n if (entry.gidnumber && gidnumber && \n entry.gidnumber[0] == gidnumber) || \n (uid && entry[:memberuid].include?(uid))\n puts \"OJO gidnumber=#{entry.gidnumber}, cn=#{entry.cn}\"\n g = crear_actualizar_grupo(entry, prob)\n if (g.nil?)\n return nil\n end\n grupos << g.id\n end\n end\n return grupos\n rescue Exception => exception\n prob << 'Problema conectando a servidor LDAP '+\n '(ldap_busca_grupos_usuario_como_admin). Excepción: ' + exception.to_s\n puts prob\n return nil\n end", "title": "" }, { "docid": "ca414ff0150d2c9bfa275ef6e28e1026", "score": "0.5258845", "text": "def busca\n\t\t@anuncios = Anuncio.where(\"descricao LIKE :filtro OR titulo LIKE :filtro OR categoria LIKE :filtro\", {:filtro => \"%#{params[:filtro]}%\"})\n\tend", "title": "" }, { "docid": "5a685fa4172b5459b261ef19ac97ee22", "score": "0.52235407", "text": "def groupes_eleves\n Regroupement.filter(:etablissement => self, :type_regroupement_id => TYP_REG_GRP).all\n end", "title": "" }, { "docid": "d7d9821a67d29cccdf88c64597ca4e3a", "score": "0.5206443", "text": "def almenos_uno\n\n valid_form = Array.new\n group_ids = Array.new\n\n documentos.each do |documento|\n if documento.documento_requisito.almenos_uno\n index = group_ids.index( documento.grupo_documentos_uno.id)\n if index.nil?\n group_ids << documento.grupo_documentos_uno.id\n valid_form << false\n index = group_ids.length - 1\n end\n\n unless documento.doc.blank?\n valid_form[index] = true\n end\n end\n end\n\n valid_form.each_with_index do |item,i|\n unless item\n grupo_almenos_uno = GrupoDocumentosUno.find_by(id:group_ids[i])\n self.errors[:base] << grupo_almenos_uno.mensaje\n end\n end\n end", "title": "" }, { "docid": "21d6deeef1c0a313f844b1267baba5c9", "score": "0.51735437", "text": "def index\n @grupopermissaos = Grupopermissao.all\n end", "title": "" }, { "docid": "ece5065a50a35d15ea1087ac9ba93650", "score": "0.51664656", "text": "def busqueda\n @pago = Pago.new\n nombre = params[:laboratorio_id]\n id = session[:farmacia_id]\n @cant_lab = Farmacium.find_by_sql(\"select cant_lab from farmacia where id = #{id} \").first\n sql = \"Select * from laboratorios where not exists (select * from lab_fars where lab_fars.laboratorio_id = laboratorios.id and lab_fars.farmacium_id = #{id} ) and laboratorios.activo = true and LOWER(laboratorios.nombre) like LOWER('%#{nombre}%') order by nombre\"\n @laboratorios = Laboratorio.paginate_by_sql(sql, :page => params[:page], :per_page => 5)\n render :template => \"lab_fars/index\"\n end", "title": "" }, { "docid": "c4e865f08c1a05213e0bcd60152fd896", "score": "0.51653403", "text": "def suma_gramos\n\t\t\t@proteinas + @carbohidratos + @lipidos\n\t\tend", "title": "" }, { "docid": "be17789db7943738941b1b6756e0b9ae", "score": "0.5124695", "text": "def especies_filtros\n return unless tiene_filtros?\n self.taxones = Especie.select(:id).select(\"#{Scat.attribute_alias(:catalogo_id)} AS catalogo_id\").joins(:scat).distinct\n por_especie_id\n por_nombre\n #estatus\n #solo_publicos\n estado_conservacion\n tipo_distribucion\n uso\n formas_crecimiento\n ambiente\n\n #return unless por_id_o_nombre\n #categoria_por_nivel\n end", "title": "" }, { "docid": "600972d648d5067d58a5432741102f45", "score": "0.5122083", "text": "def modelo_carne_build_data_left(doc, boleto, colunas, linhas)\n # LOGOTIPO do BANCO\n doc.image boleto.logotipo, x: (colunas[0] - 0.11), y: linhas[0]\n\n # Dados\n\n # Numero do banco\n doc.moveto x: colunas[1], y: linhas[0]\n doc.show \"#{boleto.banco}-#{boleto.banco_dv}\"\n\n # vencimento\n doc.moveto x: colunas[0], y: linhas[1]\n doc.show boleto.data_vencimento.to_s_br\n\n # agencia/codigo cedente\n doc.moveto x: colunas[0], y: linhas[2]\n doc.show boleto.agencia_conta_boleto\n\n # nosso numero\n doc.moveto x: colunas[0], y: linhas[3]\n doc.show boleto.nosso_numero_boleto\n\n # valor do documento\n doc.moveto x: colunas[0], y: linhas[4]\n doc.show boleto.valor_documento.to_currency\n\n # numero documento\n doc.moveto x: colunas[0], y: linhas[11]\n doc.show boleto.documento_numero\n\n # sacado\n doc.moveto x: colunas[0], y: linhas[13]\n doc.show boleto.sacado.to_s\n end", "title": "" }, { "docid": "d88936d74e5bf7a159749e8bcfe22d7d", "score": "0.50812393", "text": "def index\n @grupo_analises = GrupoAnalise.all\n end", "title": "" }, { "docid": "57bd932f1a91782f516678eeb4e20abf", "score": "0.5063372", "text": "def index\n @alumnos = Alumno.all\n\n \n #@alumnos = Alumno.where(grado: '1', grupo: 'A')\n end", "title": "" }, { "docid": "9d400ce535a41a0c6bfa98dbbc587c80", "score": "0.5057837", "text": "def ldap_agrega_membresia(ldap, nusuario, grupos, prob)\n grupos.each do |g|\n dn=\"cn=#{g},#{Rails.application.config.x.jn316_basegrupos}\"\n unless ldap.add_attribute(dn, 'memberUid', nusuario)\n prob << ldap.get_operation_result.code.to_s +\n ' - ' + ldap.get_operation_result.message \n return nil\n end\n end\n return grupos\n end", "title": "" }, { "docid": "675156fc6748f0f4ed17284961d6af9e", "score": "0.50503504", "text": "def index\n @products_grupos = ProductsGrupo.all\n end", "title": "" }, { "docid": "2b47e95c67649a3389e201ffcd3a3fbb", "score": "0.50470924", "text": "def index \n @t_unidad = TUnidad.all\n @organigrama = TUnidad.select(:nCodUni, :nCodUniPadre, :cDenominacion, :nIdArea, :ancestry, :norder).all.arrange({:order => 'norder'}) \n end", "title": "" }, { "docid": "49d0f561a3ee8545d1d0218e03de7250", "score": "0.50363415", "text": "def index\n @grupo_usuarios = GrupoUsuario.all\n end", "title": "" }, { "docid": "ef1a08b24efe7319664f5a74dfc972d0", "score": "0.5027444", "text": "def busca_receitas_por_nome(nome_busca)\n nome_busca = nome_busca.upcase\n receitas_encontradas = []\n\n receitas_encontradas = $receitas.select do |receita|\n receita.nome.upcase.include? nome_busca \n end\n\n receitas_encontradas\nend", "title": "" }, { "docid": "71508ef3edcfa9f46e377e196919f2c2", "score": "0.50234836", "text": "def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_title\n #a project has many pledges. u have to sum the pledges up\n #there are many ways to get a solution right but u need to make sure it's right for many occasions. like colliding titles, names. note how i group by pledges.project_id. those are unique. earlier i grouped by project title. mostl ikely unique but u never know.\n \"SELECT projects.title, SUM(pledges.amount) FROM pledges INNER JOIN projects ON pledges.project_id = projects.id GROUP BY pledges.project_id ORDER BY title;\"\nend", "title": "" }, { "docid": "da40a16ebfd8cba88df0f9b5734f841a", "score": "0.5018637", "text": "def grupo_params\n params.require(:grupo).permit(:nombre, :descripcion, :codigo)\n end", "title": "" }, { "docid": "0308aacbab0154d3eb2082c2b1720769", "score": "0.5001987", "text": "def index\n @grupos = Grupo.find(:all).sort_by {|p| p.asignatura.curso.codigo }\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @grupos }\n end\n end", "title": "" }, { "docid": "a0e247793b581995f27e2abe6219660f", "score": "0.49936077", "text": "def groupable_columns_options(query, columns)\n columns_options = columns.collect do |column|\n #######################\n # Smile specific #245965 Rapport : critères, indication type champ personnalisé\n # Smile specific : New hook\n criteria_order = nil\n column_label = column.caption\n\n criteria_order_hook, column_label_hook = Query.column_label_and_order_hook(query, column)\n\n if criteria_order_hook\n criteria_order = criteria_order_hook\n column_label = column_label_hook\n end\n # END -- Smile specific #245965 Rapport : critères, indication type champ personnalisé\n #######################\n\n ################\n # Smile specific #245965 Rapport : critères, indication type champ personnalisé\n # Smile specific : column.caption -> column_label\n # Smile specific : added third value in array for order\n [column_label, column.name, criteria_order]\n end\n\n ################\n # Smile specific #245965 Rapport : critères, indication type champ personnalisé\n # Smile specific : sort with criteria order\n sort_options_by_label_and_order!(columns_options)\n\n ################\n # Smile specific #245965 Rapport : critères, indication type champ personnalisé\n # Smile specific : remove last element used to sort => will remain [column_label, column.name]\n columns_options = columns_options.collect{|k| [k[0], k[1]]}\n end", "title": "" }, { "docid": "548d96f4c95b5f3b5f4b9c715e0feb30", "score": "0.49895763", "text": "def index\n @titulo = \"Todos los proveedores\"\n unless params[:filtro].nil?\n proveedores = []\n if FiltroListaProveedores::FILTROS.include?(params[:filtro]) and not params[:valor].nil?\n case params[:filtro]\n when \"categoria\"\n @categoria = Categoria.find(params[:valor])\n proveedores = @categoria.nil? ? [] : @categoria.proveedores\n @cant_resultados = proveedores.size\n @titulo = @categoria.nombre\n when \"tipo\"\n existe_tipo = Proveedor::TIPO_EMPRESA.include?(params[:valor])\n @tipo = existe_tipo ? params[:valor].to_s.humanize : nil\n proveedores = existe_tipo ? Proveedor.where(:tipo_proveedor => params[:valor]) : []\n @cant_resultados = proveedores.size\n @titulo = existe_tipo ? @tipo : \"Por tipo\"\n when \"ubicacion\"\n @ubicacion = UbicacionGeografica.find(params[:valor])\n unless @ubicacion.nil? or @ubicacion.tipo != 'estado'\n #case @ubicacion.tipo\n #when 'pais'\n # proveedores = @ubicacion.proveedores_de_pais\n #when 'estado'\n proveedores = @ubicacion.proveedores\n #when 'municipio'\n # proveedores = @ubicacion.proveedores_de_municipio\n #when 'localidad'\n # proveedores = @ubicacion.proveedores_de_localidad\n #end\n end\n @cant_resultados = proveedores.size\n @titulo = @ubicacion.tipo.humanize+\" \"[email protected]\n end\n end\n else\n proveedores = Proveedor.order('created_at DESC')\n end\n @cant_resultados = proveedores.size\n @proveedores = proveedores.includes(:localidad,:municipio,:estado).order('created_at DESC').page(params[:p])\n @titulo += \" (\"+@cant_resultados.to_s+\")\"\n add_breadcrumb :index, :proveedores_path\n @categorias = Categoria.con_proveedores\n @categorias_meta = \"\"\n for c in @categorias\n @categorias_meta += c.nombre+\", \"\n end\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @proveedores }\n end\n end", "title": "" }, { "docid": "48f178c3a20e1941acbddc3f6423365f", "score": "0.4980387", "text": "def asignaturas_peda_por(profe)\n # per = Horario.where('professor_id = ?', profe.id).joins(:asignatura).where('lectiva=true')\n per = Horario.where('professor_id = ?', profe.id).joins(:asignatura)\n .where('asignaturas.lectiva=TRUE').order('asignaturas.orden')\n a = per.map do |h|\n [\"#{h.asignatura.name} #{h.curso.name} \", \"#{h.horas}\"]\n end\n\n end", "title": "" }, { "docid": "ab552bd88da693b4b7ffb3fcb5851cc9", "score": "0.49777985", "text": "def primeiro_grupo_ativo_com_fila_ativa\n filas = self.grupos\\\n .where(ativo: true)\\\n .where.not(fila: nil)\\\n .order(prioridade: :asc).all\n \n filas_ativas = filas.to_a.select { |f| f.ativo }\n\n filas_ativas[0]\n end", "title": "" }, { "docid": "48ceb243ba2c9bbd3c551b49e2143d3e", "score": "0.49768078", "text": "def registros_ordenados(conditions = {})\n Registro.find_usuario_entre_fechas(self.id, conditions).group_by{|f| f.created_at.to_date }\n end", "title": "" }, { "docid": "d6bdf1f2148fd7c9964c049733c37837", "score": "0.49303955", "text": "def index\n @sous_groupes = SousGroupe.all\n end", "title": "" }, { "docid": "c0ad8afcc319fcdf1fe3f3aebaf69cdc", "score": "0.49252415", "text": "def cargarMenuPrincipal\n @opcionesMenu = Administrator::MenuNivel0.all\n @opcionesSubMenu = {}\n\n @opcionesMenu.each do |opcion|\n enlace = opcion.enlace\n @valores = Administrator::MenuNivel0::MenuNivel1.where(administrator_menu_nivel0_id: opcion.id).order('posicion asc') \n @opcionesSubMenu.merge!(enlace => @valores )\n end \nend", "title": "" }, { "docid": "4b1d3f86f84e1038d516455f3c1ff7cf", "score": "0.49245822", "text": "def grupo_params\n params.require(:grupo).permit(:nombre, :descripcion)\n end", "title": "" }, { "docid": "5d94319d14724cbb834fec379ddcf1cf", "score": "0.4923801", "text": "def load_Obj\n @grupos = Grupo.all\n @nivels = Nivel.select(:id, :nombre).where(\"nombre != ?\", \"CAPITULO\" )\n# @papa = Catalogo.select(:id, :codigo, :nombre).where(\"estransaccional = ? AND activo = ? \", false, true) \n @ajuste = Catalogo.select(:id, :codigo, :nombre).where(\"estransaccional = ? AND activo = ?\", true, true )\n @laux = Libroauxiliar.select(:id, :descripcion).where(\"activo = ?\", true)\n end", "title": "" }, { "docid": "74d532a8bbcf5b08185d7e6cf198c9c0", "score": "0.49090075", "text": "def categoria_por_nivel\n if taxon.present? && params[:cat].present? && params[:nivel].present?\n # Aplica el query para los descendientes\n self.taxones = taxones.where(\"#{Especie.attribute_alias(:ancestry_ascendente_directo)} LIKE '%,#{taxon.id},%'\")\n\n # Se limita la busqueda al rango de categorias taxonomicas de acuerdo al nivel\n self.taxones = taxones.nivel_categoria(params[:nivel], params[:cat])\n end\n end", "title": "" }, { "docid": "2e617e2bb30731c0dfd8fb8d3bb2d3d2", "score": "0.49067235", "text": "def jogo\n @estilo.jogo(@grupo)\n end", "title": "" }, { "docid": "b1b2bfb52bc77dce67c62fa9a746c9d8", "score": "0.49019715", "text": "def select_tiposdocumemto\n [\n [\"CARTAS DE PROPIETARIOS SOLICITANDO LA VIVIENDA\",\"CARTAS DE PROPIETARIOS SOLICITANDO LA VIVIENDA\"],\n [\"CARTAS PARA CAMBIO DE VIVIENDA\",\"CARTAS PARA CAMBIO DE VIVIENDA\"],\n [\"CARTAS RECIBIDAS PARA SOLICITUD DE AUMENTO DE CANON\",\"CARTAS RECIBIDAS PARA SOLICITUD DE AUMENTO DE CANON\"],\n [\"DOCUMENTACION DE TENENCIA DE VIVIENDA EVACUADA\",\"DOCUMENTACION DE TENENCIA DE VIVIENDA EVACUADA\"],\n [\"DOCUMENTACION DE VIVIENDA PARA ARRENDAR POR PRIMERA VEZ\",\"DOCUMENTACION DE VIVIENDA PARA ARRENDAR POR PRIMERA VEZ\"],\n [\"DOCUMENTACION DE VIVIENDAS DISPONIBLES\",\"DOCUMENTACION DE VIVIENDAS DISPONIBLES\"],\n [\"DOCUMENTACION PARA CAMBIO DE VIVIENDA\",\"DOCUMENTACION PARA CAMBIO DE VIVIENDA\"],\n [\"DOCUMENTOS SOPORTES DE INGRESOS FAMILIARES\",\"DOCUMENTOS SOPORTES DE INGRESOS FAMILIARES\"],\n [\"DOCUMENTOS DE IDENTIDAD DEL GRUPO FAMILIAR\",\"DOCUMENTOS DE IDENTIDAD DEL GRUPO FAMILIAR\"],\n [\"OTROS DOCUMENTOS\",\"OTROS DOCUMENTOS\"],\n [\"PAZ Y SALVOS RECIBIDOS\",\"PAZ Y SALVOS RECIBIDOS\"]\n ]\n end", "title": "" }, { "docid": "6ee1190d467d91e8b275ca3310975fb3", "score": "0.48823673", "text": "def index\n @pergunta_subgrupos = QuestaoSubgrupo.all\n end", "title": "" }, { "docid": "ab71a4da1f125a43627ed6bf83308067", "score": "0.4877135", "text": "def set_grupo\n @grupo = Grupo.find(params[:id])\n end", "title": "" }, { "docid": "ab71a4da1f125a43627ed6bf83308067", "score": "0.4877135", "text": "def set_grupo\n @grupo = Grupo.find(params[:id])\n end", "title": "" }, { "docid": "ab71a4da1f125a43627ed6bf83308067", "score": "0.4877135", "text": "def set_grupo\n @grupo = Grupo.find(params[:id])\n end", "title": "" }, { "docid": "13d84eccfe8b0c0c2fd7ba0b63fc946c", "score": "0.48683113", "text": "def cartas_por_valor\n @valores = []\n @valores = @mi_mano.group_by{|k, v| v[:valor]}.map{|k, v| [k, v.count]}\n end", "title": "" }, { "docid": "87df428e647a23bc1d0e9420b0ac645b", "score": "0.48530522", "text": "def index\n @grupo_permissaos = GrupoPermissao.all\n end", "title": "" }, { "docid": "eb5f60ea3a0acfaaec96d077236125a9", "score": "0.4846372", "text": "def busca\n palavras = params[:pesquisar][:palavras_texto].split\n sql = \"\"\n palavras.each do |p|\n if (p.size > 2 && !%w(para com um uma por pela pelo for).include?(p))\n sql = sql + \"upper(nome) LIKE '%#{p.upcase}%' OR upper(presenteados) LIKE '%#{p.upcase}%' OR \"\n end\n end\n sql.empty? ? sql = \"\" : sql = sql[0..-5] + \" AND publicada = '1'\"\n @listas = Lista.where(sql).order(\"dt_fechamento DESC\", \"created_at DESC\")\n\n respond_to do |format|\n if ([email protected]?)\n format.html { render \"busca\" }\n format.json { render json: @listas }\n else\n format.html { redirect_to home_index_path, notice: \"Nenhuma lista encontrada\" }\n end\n end\n end", "title": "" }, { "docid": "3404fef1463ca9008928161cacadc6f5", "score": "0.48385674", "text": "def pro_farmBusqueda\n id = session[:farmacia_id]\n laboratorio = params[:laboratorio]\n nombre = params[:producto_id]\n @lab = Laboratorio.find_by_sql(\"select id, nombre from laboratorios where id = #{laboratorio} \").first\n sql = \"select * from pro_fars, productos, disponibilidads where pro_fars.producto_id = productos.id and disponibilidads.id =pro_fars.disponibilidad_id and productos.laboratorio_id = #{laboratorio} and pro_fars.farmacium_id = #{id} and LOWER(productos.nombre) like LOWER('%#{nombre}%') order by productos.nombre\"\n @productos = ProFar.paginate_by_sql(sql, :page => params[:page], :per_page => 7)\n render :template => \"pro_fars/productosfarmacia\"\n end", "title": "" }, { "docid": "c7d43694753785e6078c0ec259499932", "score": "0.48238188", "text": "def procesa_filtrosm(que1, tablas1, where1, que3, \n tablas3, where3)\n @estfiltrosm.each do |e, r|\n if (params[:filtro] && params[:filtro][r[:nomfiltro]] && \n params[:filtro][r[:nomfiltro]] != '') \n if r[:metodo_id] == :id\n ids = r[:coleccion].where(\n id: params[:filtro][r[:nomfiltro]].select{|x| x!= ''}.\n map(&:to_i)\n ).pluck(:id)\n else # e.g sexo\n ids = r[:coleccion].map(&:last).select {|id| \n id && id.to_s != '' && params[:filtro][r[:nomfiltro]].\n map(&:to_s).include?(id.to_s)\n }\n end\n if ids.count == 0\n where1 = ampliar_where_sinap(where1, 'TRUE', 'FALSE', '=')\n else\n where1 = procesa_un_filtrom(where1, r, ids)\n end\n end\n\n end\n\n return [que1, tablas1, where1, que3, tablas3, where3]\n end", "title": "" }, { "docid": "a87bb1622c38673ce9dd9f17027df75d", "score": "0.4823454", "text": "def cargar_comandos_jugadas_repetir_otro_sorteo(ticket, sorteo_origen , sorteo_destino)\n #Buscar todos los comandos de todas las jugadaslots de ese ticket con ese sorteo de origen.\n @array_jugadas_de_ese_sorteo_en_ese_ticket = Jugadalot.where(:ticket_id => ticket, :sorteot => Sorteot.where(:sigla => sorteo_origen.to_s).first.id)\n \n @comando_jugadas =[] # Defino el array que trenda todos los comando de las jugadas de este sorteo de ese ticket\n\n @array_jugadas_de_ese_sorteo_en_ese_ticket.each do |jugadalot|\n @comando_jugadas << jugadalot.comandojugada\n end\n \n #Hacer un solo string con todos los comando_jugadas.join(\"*\") unidos por caracter especial \"*\" ok. ted.\n @comando_jugadas = @comando_jugadas.join(\"*\")\n\n #Hacer un string.replace pattern .01 a .02 (sorteo_origen, sorteo_destino)\n sorteo_origen = \".\" + sorteo_origen\n sorteo_destino = \".\" + sorteo_destino\n\n @comando_jugadas.gsub(sorteo_origen, sorteo_destino)\n #dejar que siga evaluando hacia abajo... ok ted. Bloque de codigo guardar jugadas.\n \n end", "title": "" }, { "docid": "3b0eb559526475d10b2a7446a8719f09", "score": "0.4823237", "text": "def index\n\t\t# si rol mayor a desarrollador, listar todos los grupos \n \tif has_role_with_hierarchy?(:administrador) \n\t\t\t@groups = Group.all\n\t\t# si rol es desarrollador, listar solo sus grupos\n\t\telse\n\t\t\t@groups = Group.all :conditions => { :user_id, current_user.id }\n\t\tend\n end", "title": "" }, { "docid": "ccc6a7629973e26babcf2c669e9b6803", "score": "0.48225886", "text": "def index\n @grupos_diplomados = GruposDiplomado.all\n end", "title": "" }, { "docid": "b46e95ff177431c9e68a41e6dc6aa62f", "score": "0.4822119", "text": "def grupo_params\n params.require(:grupo).permit(:nome_grupo)\n end", "title": "" }, { "docid": "ce43ce31713eda05e8b72303bb90394f", "score": "0.48171094", "text": "def conteo_por_grupo\n br = BusquedaRegion.new\n br.params = params\n br.cache_conteo_por_grupo\n\n render json: br.resp\n end", "title": "" }, { "docid": "a0eccf3334f8631b05185f64086f6ae2", "score": "0.48164865", "text": "def organizar(produtos)\n array = []\n produtos.each do |produto|\n array.concat(produto.factories) \n array.concat(produto.sales)\n end\n array.sort_by(&:created_at)\n end", "title": "" }, { "docid": "d15cbd2952bed16d8bffc1ba30d94e1a", "score": "0.47884217", "text": "def index\n add_breadcrumb 'Início', dashboard_path\n add_breadcrumb 'Textos', batale_texts_path\n\n project = { '$project': { numero_estrato: '$numero_estrato' } }\n group = { '$group': { '_id': { numero_estrato: '$numero_estrato' }, count: { '$sum': 1 } } }\n sort = { \"$sort\": { \"_id.numero_estrato\": 1 } }\n @estratos = []\n Batale::Text.collection.aggregate([project, group, sort]).to_a.each do |elem|\n estrato = elem['_id']['numero_estrato']\n @estratos << { numero_estrato: estrato, count: elem['count'] } if estrato != ''\n end\n @estratos = Kaminari.paginate_array(@estratos).page(params[:page]).per(12)\n @model_estratos = Batale::Stratum.all\n puts @estratos\n end", "title": "" }, { "docid": "b1a9a7de2aa560d3a8572672283c9898", "score": "0.47777793", "text": "def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n\"SELECT title , SUM(amount) FROM pledges, projects WHERE pledges.project_id = projects.id GROUP BY(title);\"\nend", "title": "" }, { "docid": "37b13e106cc97bf9631bf62ff856c125", "score": "0.47629488", "text": "def agregar_profesor\n @grupo = Grupo.find(params[:id])\n if request.get?\n @profesores = Profesor.search(params[:buscar])\n end\n if request.put?\n @profesor = Profesor.find(params[:profesor_id])\n @grupo.profesor = @profesor\n flash[:notice] = \"Se modificó el profesor al grupo #{@grupo.nombre_completo}\" if @grupo.save\n redirect_to grupo_path(@grupo)\n end\n end", "title": "" }, { "docid": "69b8d319bfa81e2d268ddd9f3ec942a5", "score": "0.47625944", "text": "def set_empresa_buscar\n campo = params[:campo]\n valor = params[:valor]\n if @campo == 'id'\n @empresa = Empresa.find(valor)\n else\n @empresa = Empresa.where(\"#{campo} LIKE '%#{valor}%'\")\n end\n @empresa = [*@empresa]\n end", "title": "" }, { "docid": "6c812bbff8608d03007d1bbf69b982d6", "score": "0.47573856", "text": "def grupopermissao_params\n params.require(:grupopermissao).permit(:nome)\n end", "title": "" }, { "docid": "7034896eebb718a08cabd7a6dfe335da", "score": "0.4739494", "text": "def index\n @grupo_email = GrupoEmail.all\n end", "title": "" }, { "docid": "ab5bfca5ce3baf808e60a9a267e0ace5", "score": "0.47382706", "text": "def set_grupopermissao\n @grupopermissao = Grupopermissao.find(params[:id])\n end", "title": "" }, { "docid": "cde9e5d743aa90d2223925fa09042a92", "score": "0.47343126", "text": "def set_barrio_buscar\n campo = params[:campo]\n valor = params[:valor]\n if campo == 'id'\n @barrio = Barrio.find(valor)\n elsif campo == 'zona'\n @barrio = Barrio.where(zona_id: valor)\n else\n @barrio = Barrio.where(\"nombre LIKE '%#{valor}%'\")\n end\n @barrio = [*@barrio]\n end", "title": "" }, { "docid": "1046c3ae040915156aad7dff29f3e9e8", "score": "0.47266215", "text": "def docentes\n\t\t@seccion = \"Docentes\"\n @titulo = \"Docentes\"\n\n if Docente.all().size > 0\n \t\tif params[:orden]\n \t\t\t@orden = params[:orden]\n \t\telse\n \t\t\t@orden = \"Cédula\"\n \t\tend\n\n \t\t#Guardo todos los docentes\n \t\tcase @orden\n \t\twhen \"Cédula\"\n \t\t\t@usuarios = Usuario.order('cedula').where(:id => Docente.all)\n \t\twhen \"Nombre\"\n \t\t\t@usuarios = Usuario.order('nombre').where(:id => Docente.all)\n \t\twhen \"Apellido\"\n \t\t\t@usuarios = Usuario.order('apellido').where(:id => Docente.all)\n \t\twhen \"Correo\"\n \t\t\t@usuarios = Usuario.order('correo').where(:id => Docente.all)\n \t\tend\n\n end\n\t\t\n\t\t @categorias = ['Cédula', 'Nombre', 'Apellido', 'Correo'] #Este es el orden que se mostrará en el select de la vista\n\n \t\t@docente_datos = [] #En este arreglo se guardan los pares \"Cedula - Nombre Apellido\" de cada usuario para mostrar en el campo de busqueda\n \t\tUsuario.order('nombre').where(:id => Docente.all).each do |usuario|\n \t\t\t#En este foro se agregan uno a uno los valores de cada docente al arreglo de la manera indicada arriba\n \t\t\t@docente_datos << usuario.cedula.to_s + \" - \" + usuario.nombre_y_apellido.to_s\n \t\tend\n\tend", "title": "" }, { "docid": "155355ec43e4da7b514efb6fa6fed6b2", "score": "0.4723975", "text": "def index\n #@gruas = Grua.where([\"numero_serie = ?\", params[:search].to_i])\n @gruas = Grua.all.order('numero_serie ASC')\n tipo = params[:tipo]\n if tipo == \"Gas\"\n @gruas = @gruas.where(\"tipo = 'Gas'\").order('numero_serie ASC')\n elsif tipo == \"Electricas\"\n @gruas = @gruas.where(\"tipo = 'Eléctrica'\").order('numero_serie ASC')\n elsif tipo == \"Apiladores\"\n @gruas = @gruas.where(\"tipo = 'Apilador'\").order('numero_serie ASC')\n end\n @numero = params[:search]\n if @numero\n if @gruas.exists?(@numero)\n @gruas = [@gruas.find(@numero)]\n else\n @gruas = []\n end\n end\n end", "title": "" }, { "docid": "c3687bc5ecfeb814c3a22183f1007353", "score": "0.47238478", "text": "def cargar_resultados\n preguntas.each do |pregunta|\n pregunta.respuestas.each do |respuesta|\n # resultados = ResultadoPregunta.where(recorrido: recorrido.id, pregunta: pregunta, respuesta: respuesta).count\n sql = \"select count(1)\n from resultado_preguntas r_preg join resultado_recorridos r_rec on r_preg.resultado_recorrido_id = r_rec.id join\n recorridos recorrido on r_rec.recorrido_id = recorrido.id\n where recorrido.id = #{recorrido.id} and r_preg.pregunta_id = #{pregunta.id} and r_preg.respuesta_id = #{respuesta.id}\"\n respuesta.cantidad_elegida = ActiveRecord::Base.connection.execute(sql)[0][\"count\"].to_i\n # respuesta.cantidad_elegida = resultados\n end\n end\n end", "title": "" }, { "docid": "5ce6d87054b7c25693f1c54509480b7f", "score": "0.47189623", "text": "def metodos_con(letras,*clase) # puede ser metodos de una clase, una lista de clases, o una lista de metodos\n if not clase.none? # si no hay parametros busca en los metodos_observados\n self.get_metodos_de(clase) # aca los setea en @metodos_observados\n end\n @metodos_observados.select{|metodo| metodo[0..letras.size].include? letras}\n end", "title": "" }, { "docid": "c384e014f257a65267868ab50e6fe4fa", "score": "0.47125924", "text": "def resultados_basica\n paginado_y_offset\n estatus\n solo_publicos\n solo_categoria\n\n return unless por_id_o_nombre\n\n conteo_por_categoria_taxonomica\n dame_totales\n resultados\n\n resultados_fuzzy_match if totales == 0 && pagina == 1 && params[:solo_categoria].blank?\n end", "title": "" }, { "docid": "4c53d085c24c5a6176bfe7ece5860439", "score": "0.47085017", "text": "def filter_pedido_atestado(acesso)\n @curso = params[:curso]\n # @curso_busca = Curso.where(\"id in #{params[:curso_id]}\")\n @nivel = params[:nivel]\n @situacao = params[:situacao_id]\n @situacao_busca = Situacao.where(\"id in #{acesso}\")\n \n if @situacao.to_s != \"\"\n filtro = \"situacao_id = #{@situacao}\"\n else\n filtro = \"situacao_id in #{acesso}\"\n end\n\n if @curso.to_s != \"\"\n filtro += \" and curso_id = '\" + @curso.to_s + \"'\"\n end\n\n if @nivel.to_s != \"\"\n idCurso = \"\"\n cursos = Curso.where(nivelEscolaridade: @nivel)\n cursos.each do |curso|\n idCurso = idCurso + curso.id.to_s + \",\"\n end\n idCurso = idCurso[0..(idCurso.length-2)]\n filtro += \" and curso_id in (\" + idCurso + \")\"\n end\n\n @pedido_atestados = PedidoAtestado.where(filtro).order(\"created_at\")\n end", "title": "" }, { "docid": "7f7d44ee6e79329ca88426bc055731b1", "score": "0.47061998", "text": "def campos_filtro1_gen\n campos_filtro1\n end", "title": "" }, { "docid": "4476155323e24c728b16984295690af2", "score": "0.4692859", "text": "def index\n if params[:search]\n @negocios = Negocio.where(\"nombre_empresa LIKE ?\", \"%#{params[:search]}%\").includes(:user).where(verificado: 1)\n elsif params[:order]\n @negocios = Negocio.all.includes(:user).order(:fecha_registro).where(verificado: 1)\n elsif params[:basico]\n @negocios = Negocio.where(\"membresia_id LIKE 1\", \"%#{params[:search]}%\").includes(:user).where(verificado: 1)\n elsif params[:gratis]\n @negocios = Negocio.where(\"membresia_id LIKE 2\", \"%#{params[:search]}%\").includes(:user).where(verificado: 1)\n elsif params[:premium]\n @negocios = Negocio.where(\"membresia_id LIKE 3\", \"%#{params[:search]}%\").includes(:user).where(verificado: 1)\n else\n @negocios = Negocio.all.includes(:user).where(verificado: 1)\n end\n\n\n #cambiar al directorio /public\n Dir.chdir \"#{Rails.root.join('public')}\"\n\n #iteración de todos los usuarios en el arreglo @usuarios\n @negocios.each do |n|\n # creamos una variable que va a crear en string el nombre de la foto que se va a guardar\n # ej. user_image_23.png para el usuario con id 23\n saveName = \"business_image_#{n.id}.png\"\n\n # abrimos el filestream para escritura con el nombre de la variable saveName\n fotoNegocio = File.open(saveName, 'wb') do |f|\n\n # el begin y rescue es el clásico try/catch\n begin\n # intentamos convertir los bytes que se reciben de la base de datos en encoding BASE64\n # y lo escribimos en el filestream usando decode64. Se guardaría en /public/user_image_23.png\n f.write(Base64.urlsafe_decode64(n.imagen))\n\n # cambiamos el contenido de la propiedad foto para que no sea el arreglo de bytes sino el\n # nombre con el que quedó guardado en /public/\n n.imagen=saveName\n\n # cerramos el stream\n f.close\n\n # si escribir la foto falla por algún motivo...\n rescue => ex\n # ignoramos lo que se haya jalado de la base de datos y ponemos de nombre una imagen genérica\n # esta imagen debe estar guardada eb /public/\n n.imagen=\"default_user_image.png\"\n end\n end\n end\n\n end", "title": "" }, { "docid": "773581d30d2a48468026dc03d6e463aa", "score": "0.46918112", "text": "def ordenar_create( tabla, params )\n order = ''\n \n if (params[:g_g] && (params[:g_g]==tabla))\n (params[:g_o] && params[:g_o]!='') ? order = params[:g_o] : order = 'asc'\n (params[:g_f] && params[:g_f]!='') ? order = params[:g_f]+' '+order : order = ''\n else\n (params[:order] && params[:order]!='') ? order = params[:order] : order = 'asc'\n (params[:field] && params[:field]!='') ? order = params[:field]+' '+order : order = ''\n end\n\n #(order=='asc') ? order='desc' : order='asc'\n return ' ORDER BY '+order if (order != '')\n return ''\n end", "title": "" }, { "docid": "f374fb15e483438003874ce38f6f9688", "score": "0.4687462", "text": "def grupo_analise_params \n params.require(:grupo_analise).permit(:title, :description, :user_id )\n end", "title": "" }, { "docid": "0d69e11ace226cb094cfa76e5b1ebe52", "score": "0.46869788", "text": "def addGroupsToSearchContext(key, value)\n begin\n owner = User.find_by_username(key)\n if owner == nil\n puts \"Couldn't find owner of the group\"\n return\n end\n # Split the value, if multiple values\n values = value.split(' ')\n values.each do |x|\n \n # Find the group and users in it\n group = Group.find_by_name(x)\n if group != nil\n group.users.each do |u|\n addUsersToSearchContext(u.username)\n end\n addUsersToSearchContext(owner.username)\n end \n end\n rescue => e\n puts \"Problem adding group to search context. E: #{e}\"\n end\n end", "title": "" }, { "docid": "be8efb3ca4532f6565a4926d0fa880c5", "score": "0.46857238", "text": "def ObtenerHijos(menu,padreid)\n\t totaldeRegistros1 = self.ContarHijos(menu,padreid)\n\t if totaldeRegistros1>0\n\t @tira = @tira+\" children: [ \"\n\t @opcionMenus = OpcionMenu.where(\"menu_id = ? AND padre_id = ?\", menu.id.to_s, padreid).order(orden: :asc)\n\t i=0\n\t @opcionMenus.each do |arbol|\n if arbol.hijos.length >0\n @tira = @tira+\" { text: ' <i class= \\\" \" + arbol.icono.to_s + \"\\\" ></i> <span class= \\\"no-padding\\\"> \" + arbol.nombre + \" </span>', cls:'no-padding waves-effect',id: '\" + arbol.id.to_s + \"', href: '', \"\n else\n @tira = @tira+\" { text: ' <i class= \\\" \" + arbol.icono.to_s + \"\\\" ></i> <span class= \\\"no-padding\\\"> \" + arbol.nombre + \" </span>', cls:'no-padding waves-effect',id: '\" + arbol.id.to_s + \"', href: '\" + arbol.url.to_s + \"', \"\n end\n\t self.ObtenerHijos(menu,arbol.id)\n\t i=i+1\n if i<totaldeRegistros1\n @tira = @tira+\" }, \"\n else\n @tira = @tira+\" } ] \"\n\t end\n\t end\n\t else\n\t @tira = @tira+\" leaf: true \"\n\t end\n end", "title": "" }, { "docid": "b15dfd2fbf45aba709894375e2415639", "score": "0.4684876", "text": "def find_user_groups\r\n user_group = Group.where(\"id IN (SELECT gu.group_id FROM groups_users gu WHERE gu.user_id = ?)\", User.current.id).all\r\n group_names = []\r\n user_group.each do |group|\r\n group_names << group.lastname\r\n end\r\n return group_names\r\n end", "title": "" }, { "docid": "ac94caed65cb42d981b01379d579c9e8", "score": "0.46808308", "text": "def consulta\n paginado_y_offset\n proyectos_propios?\n\n self.proyectos = proyectos.where('nombre_proyecto REGEXP ?', params[:proyecto]) if params[:proyecto].present?\n self.proyectos = proyectos.where('nombre_institucion REGEXP ?', params[:institucion]) if params[:institucion].present?\n self.proyectos = proyectos.where(tipo_monitoreo: params[:tipo_monitoreo]) if params[:tipo_monitoreo].present?\n self.proyectos = proyectos.where('autor REGEXP ?', params[:autor]) if params[:autor].present?\n self.proyectos = proyectos.where('titulo_compilacion REGEXP ?', params[:titulo_compilacion]) if params[:titulo_compilacion].present?\n self.proyectos = proyectos.where('campo_investigacion=?', params[:campo_investigacion]) if params[:campo_investigacion].present?\n self.proyectos = proyectos.where('nombre_region=?', params[:nombre_region]) if params[:nombre_region].present?\n self.proyectos = proyectos.where('nombre_zona=?', params[:nombre_zona]) if params[:nombre_zona].present?\n\n if params[:especie_id].present?\n self.proyectos = proyectos.where('especies_estudiadas.especie_id=?', params[:especie_id]).left_joins({especies: [:especie, :adicional]})\n elsif params[:nombre].present?\n self.proyectos = proyectos.where('especies_estudiadas.nombre_cientifico REGEXP ? OR nombre_proyecto REGEXP ? OR titulo_compilacion REGEXP ?', params[:nombre], params[:nombre], params[:nombre]).left_joins({especies: [:especie, :adicional]})\n end\n\n self.totales = proyectos.count('proyectos.id')\n self.proyectos = proyectos.offset(offset).limit(por_pagina) unless self.sin_limit\n\n end", "title": "" }, { "docid": "b92a9c1b97b0e6382f86571a6809f75f", "score": "0.46675208", "text": "def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n<<-SQL\n SELECT DISTINCT title ,SUM(amount) FROM projects INNER JOIN pledges ON projects.id = pledges.project_id\n GROUP BY projects.title\n SQL\nend", "title": "" }, { "docid": "9471b12d1f6536e7d7a716ffaba6a08b", "score": "0.46650633", "text": "def questionsDuGroupe(id_groupe)\n\n # array contient la liste des questions\n questions = Array.new\n\n # récupérer la liste des id_question\n # et traiter chaque id_question\n Groupe.where(etat: false, id_groupe: id_groupe).order('id_question ASC').find_each do |id_question|\n \n questions << QuestionService.instance.afficherQuestionParId(id_question.id_question)\n \n end\n \n questionsDuGroupe = questions\n\n\n end", "title": "" }, { "docid": "34c3f8de9072d3d22e7074af808c4274", "score": "0.4663796", "text": "def index\n @buscar = params[:buscar].to_s\n @ventas_agrupador_clientes = Ventas::AgrupadorCliente.all.order(:nombre)\n @ventas_agrupador_clientes = @ventas_agrupador_clientes.where('nombre ilike ?', '%' + @buscar + '%') unless @buscar.blank?\n end", "title": "" }, { "docid": "ee4f214054b1e955bd098963826c253d", "score": "0.46633828", "text": "def index\n #@user_groupe_users = UserGroupeUser.all\n end", "title": "" }, { "docid": "02a53630e7ae2d7baf43689b562d2742", "score": "0.4662893", "text": "def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_title\n # group pledge sum by title\n # return titles\n # order by\n \"SELECT projects.title, \n SUM(pledges.amount) \n FROM projects \n JOIN pledges ON projects.id=pledges.project_id \n GROUP BY projects.title \n ORDER BY projects.title;\"\nend", "title": "" }, { "docid": "f2ddf0443681712c7bb88d2a3b85950b", "score": "0.46562248", "text": "def obtener\narray = Tarea.all\n \n @@tareas = Array.new\n array.each{|x| @@tareas.push(x) if /#{@@usuario}/.match(x[\"title\"])}\n\n @@tareas.each do |x|\nstring = x[\"title\"].split\n string.pop\nx[\"title\"] = string.join(\" \")\n\n\n end\n #esto es para que no quede una tarea vacia al principio, la cual es la correspondiente login\n@@tareas.shift\n @@tareas\n\nend", "title": "" }, { "docid": "3d772291b58a7efcb1dee99e7e1b2284", "score": "0.46519628", "text": "def agregarMetodos unaClase\n self.metodos.each do |metodo|\n self.agregar_metodo(unaClase,metodo[0],&metodo[1])\n end\n end", "title": "" }, { "docid": "891788b9b295ed48e1bd9960b32cfd6c", "score": "0.46489698", "text": "def showBusqueda\n id = session[:farmacia_id]\n laboratorio = params[:laboratorio]\n nombre = params[:producto_id]\n @lab = Laboratorio.find_by_sql(\"select nombre, id from laboratorios where id = #{laboratorio} \").first \n sql = \"Select * from productos where not exists (select * from pro_fars where pro_fars.producto_id = productos.id and pro_fars.farmacium_id = #{id}) and laboratorio_id = #{laboratorio} and LOWER(nombre) like LOWER('%#{nombre}%') order by nombre\"\n @productos = Producto.paginate_by_sql(sql, :page => params[:page], :per_page => 8)\n\n @pro_far = ProFar.new\n render :template => \"pro_fars/index\"\n end", "title": "" }, { "docid": "f10102e721130135047ffe775f779195", "score": "0.46487346", "text": "def reune_dados\n crs = []\n @dados_aluno.each do |k, v|\n crs << (Aluno.new(k, v).retorna_dados)\n end\n cursos = []\n @dados_cursos_matricula.each do |k, v|\n #usei o flatten e o uniq para remover as matriculas repetidas para que cada CR fosse unico\n cursos << (Curso.new(k, v.flatten.uniq).retorna_dados)\n end\n formata_dados(crs, cursos)\n end", "title": "" }, { "docid": "27cd164f886f3f59a8d79724dc264386", "score": "0.46448016", "text": "def add_group_by(field)\n @group_by.push(field)\n end", "title": "" }, { "docid": "0d0530699764ab0f6c42dcdbbd542c1d", "score": "0.46417385", "text": "def crear_actualizar_grupo(ldapgr, prob)\n cn = ldapgr.cn[0]\n d = ldapgr.respond_to?(:description) ? ldapgr.description[0] : cn\n grupo = Msip::Grupo.where(cn: cn).take\n if grupo.nil?\n grupo = Msip::Grupo.new(fechacreacion: Date.today)\n if grupo.nil?\n prob << 'No pudo crear grupo: ' + prob\n return nil\n end\n end\n grupo.cn = cn\n grupo.nombre = d\n grupo.gidNumber = valor_campo_ldap(ldapgr, :gidNumber)\n grupo.ultimasincldap = Date.today\n grupo.fechadeshabilitacion = nil\n grupo.save\n if (grupo.errors.messages.length > 0)\n prob << grupo.errors.messages.to_s\n return nil\n end\n return grupo\n end", "title": "" }, { "docid": "7f0a9f7f8d8bd1ffda53d6f049dfecd1", "score": "0.46404737", "text": "def selects_the_titles_of_all_projects_and_their_pledge_amounts_alphabetized_by_name\n #SELECT title, SUM(quantity) FROM groceries GROUP BY aisle ORDER BY SUM(quantity);\n\n \"SELECT projects.title, sum( pledges.amount)\nFROM projects\nJOIN pledges\nwhere projects.id=pledges.project_id\ngroup by projects.title order by projects.title\n;\"\n\nend", "title": "" }, { "docid": "5679bc06d9b1d084b6e87ab2e1feb3e6", "score": "0.4637064", "text": "def minimizar_servicios_basicos(fecha)\n \"select sum(montodetalle) as monto from gestioncondominio.detalles inner join\n (select DISTINCT(proveedorxservicios.idproveedorxservicio) from \n gestioncondominio.proveedorxservicios, \n gestioncondominio.servicios, \n gestioncondominio.proveedorxcondominios,\n gestioncondominio.comprobantedepagos\n where\n proveedorxcondominios.idproveedorxcondominio = \n comprobantedepagos.idproveedorxcondominiocomprobantedepago\n and proveedorxcondominios.idproveedorxcondominio = \n proveedorxservicios.idproveedorxcondominioproveedorxservicio\n and servicios.idservicio = proveedorxservicios.idservicioproveedorxservicio\n and proveedorxcondominios.idcondominioproveedorxcondominio = #{id_condominio}\n and (servicios.descripcionservicio='Agua'\n or servicios.descripcionservicio='Luz'\n or servicios.descripcionservicio='Gas'))\n as calculo2 on detalles.idproveedorxserviciodetalle =\n calculo2.idproveedorxservicio\"\n \tend", "title": "" }, { "docid": "7815c86d4a4eeb6c8d615a0a47186c82", "score": "0.46317527", "text": "def index\n @q = Repuesto.search(params[:q])\n @repuestos = @q.result.order('codigo ASC')\n\n tipo = params[:tipo]\n if tipo == \"Insumo\"\n @repuestos = @repuestos.where(\"familia = 'Insumo'\")\n elsif tipo == \"Lubricante\"\n @repuestos = @repuestos.where(\"familia = 'Lubricante'\")\n elsif tipo == \"Neumatico\"\n @repuestos = @repuestos.where(\"familia = 'Neumáticos'\")\n elsif tipo == \"Pintura\"\n @repuestos = @repuestos.where(\"familia = 'Pintura'\")\n elsif tipo == \"Repuesto\"\n @repuestos = @repuestos.where(\"familia = 'Repuesto'\")\n elsif tipo == \"Seguridad\"\n @repuestos = @repuestos.where(\"familia = 'Seguridad'\")\n elsif tipo == \"Faltantes\"\n @repuestos = @repuestos.where(\"stock < stock_minimo\")\n end\n end", "title": "" }, { "docid": "1eac77c361b25308b0e3186eb0cddfe5", "score": "0.4618013", "text": "def aprobados(arr = [])\n aprobados = ''\n arr.each do |alumno|\n if alumno.promedios > 7\n aprobados += \"#{alumno.nombre} aprueba con nota #{alumno.promedios}\\n\"\n end\n end\n aprobados\nend", "title": "" }, { "docid": "fc6cca8515c061e85300e136a7c89ff8", "score": "0.46097052", "text": "def simulacion\n @ordenes = Orden.where(:estado => \"Recolectada\")\n end", "title": "" }, { "docid": "edbb1ffcf107d2010916981bc85ec65a", "score": "0.45966232", "text": "def empleados\n @personas = Persona.where(:empleados_id => [2,3,1]).order(:empleados_id)\n end", "title": "" }, { "docid": "73d97c99045d9dd05f3d349d4ceb3fb6", "score": "0.45953366", "text": "def set_grupo_analise\n @grupo_analise = GrupoAnalise.find(params[:id])\n end", "title": "" }, { "docid": "573009bec3b1d7fe503e311007cca929", "score": "0.45907912", "text": "def exercise1\n @content = ActiveRecord::Base.connection.execute(\"\n SELECT\n u.name as user_name,\n COUNT(gr.name) as groups_count,\n CONCAT('[', COALESCE(STRING_AGG(gr.name, ', ' ), ''),']') as groups\n FROM ((users as u\n LEFT JOIN groups_users as gu ON u.id=gu.user_id)\n LEFT JOIN groups as gr ON gr.id = gu.group_id)\n GROUP BY user_name\n ORDER BY groups_count;\");\n\n @results1 = []\n\n index = 0\n @content.each do |r|\n @results1[index] = Result1.new r\n index = index + 1;\n end\n\n return @results1\n end", "title": "" }, { "docid": "2e893175b1e36bc1250351bc77f618fb", "score": "0.4589494", "text": "def seleccionarCromosomas()\n #p \"--- Empieza el torneo:\"\n seleccion = []\n @tamMatingPool.times do\n competidor1 = @poblacion[Random.rand(@tamPoblacion)]\n competidor2 = @poblacion[Random.rand(@tamPoblacion)]\n evaluarCromosoma(competidor1)\n evaluarCromosoma(competidor2)\n ganador = competidor1.aptitud > competidor2.aptitud ? \n competidor1 : competidor2\n #p \"--- Ganador: #{ganador.genes}\"\n seleccion.push(ganador)\n end\n return seleccion\n end", "title": "" }, { "docid": "6021b0e0cc9d7edcf9bf03925a5acfd7", "score": "0.45885545", "text": "def por_nombre\n return unless (params[:nombre].present? && params[:especie_id].blank?)\n self.taxones = taxones.caso_nombre_comun_y_cientifico(params[:nombre].strip).left_joins(:nombres_comunes)\n end", "title": "" }, { "docid": "b51b3c83e4d279bb900c416223815422", "score": "0.45873013", "text": "def index\n @from = \"#{params['from']}\".to_date rescue nil\n @to = \"#{params['to']}\".to_date rescue nil\n @estado = \"#{params['estado']}\"\n\n p \"filtering by from: #{@from} & to: #{@to} & estado: #{@estado}\"\n \n @pedidos = Pedido.all\n @pedidos = @pedidos.where(\"fecha_entrega >= (?)\", @from) if @from\n @pedidos = @pedidos.where(\"fecha_entrega <= (?)\", @to) if @to\n @pedidos = @pedidos.where(\"estado ilike ? \", \"%#{@estado}%\") if @estado\n @pedidos = @pedidos.order(fecha: :desc, id: :desc)\n\n @estados = Pedido.select('distinct lower(estado) estado').map(&:estado)\n @estados = @estados.select{|e| !e.include?('pagado paypal')}\n @estados.push('pagado paypal')\n \n end", "title": "" } ]
36f93107654312f503fc37c63dffe8ab
PATCH/PUT /datos_usuarios/1 PATCH/PUT /datos_usuarios/1.json
[ { "docid": "34fcbc609d39dd2a80ea8b75caf219b8", "score": "0.6692051", "text": "def update\n respond_to do |format|\n if @datos_usuario.update(datos_usuario_params)\n format.html { redirect_to @datos_usuario, notice: 'Datos usuario was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @datos_usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "9d91fe8ffe79c0ce9f854a7339dc24d6", "score": "0.7016392", "text": "def update\n #response.headers['Content-Type'] = 'application/json'\n\n if Usuario.exists?(params[:id])\n usuario = Usuario.find(params[:id])\n n_param = JSON.parse(request.body.read)\n\n #request.request_parameters\n if n_param[\"id\"]\n render json: {\"error\": \"id no es modificable\"}, status: 400\n elsif n_param.size > 1\n render json: {\"error\": \"La modificación ha fallado, solo puedes ingresar un parametro para modificar\"}, status: 500\n elsif usuario.update(usuario_params) && n_param.size == 1\n if [\"usuario\", \"nombre\", \"apellido\", \"twitter\"].include?(n_param.keys[0])\n render json: usuario, status: 200\n else\n render json: {\"error\": \"La modificación ha fallado, el atributo entregado no es válido\"}, status: 500\n end\n else\n render json: {\"error\": \"La modificación ha fallado\"}, status: 500\n end\n else\n render json: {\"error\": \"Usuario no encontrado\"}, status: 404\n end\n end", "title": "" }, { "docid": "8a3601d5bfa4b1fb24290c9d4c096ffd", "score": "0.6950575", "text": "def update\n @usuario = User.find(params[:id])\n \n respond_to do |format|\n if (@usuario.update_attributes(params[:usuario]))\n \n # format.json { render :json => { :success => true, :usuario_id => @usuario.id, :perguntas => new_perguntas, :respostas => new_respostas }, :status => :created, :location => @usuario }\n\n format.html { redirect_to @usuario, :notice => 'Usuario was successfully updated.' }\n else\n render :edit\n end\n end\n end", "title": "" }, { "docid": "4f267b60d628b7329078cf6589da6ef2", "score": "0.6905528", "text": "def update\n @usuario = Usuario.find(params[:id])\n\n respond_to do |format|\n if @usuario.update_attributes(params[:usuario])\n format.html { redirect_to [:admin, @usuario], :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @usuario.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0d212a8a912069418b404c2704de42f2", "score": "0.6826749", "text": "def update\n @apodos_usuario = ApodosUsuario.find(params[:id])\n\n respond_to do |format|\n if @apodos_usuario.update_attributes(params[:apodos_usuario])\n format.html { redirect_to @apodos_usuario, notice: 'Apodos usuario was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @apodos_usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66852f068b3a7f5fda1fe31da8b356fb", "score": "0.6786277", "text": "def update\n @usuario = Usuario.find(params[:id])\n\n respond_to do |format|\n if @usuario.update_attributes(params[:usuario])\n format.html { redirect_to @usuario }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0b02abd9f77fb3bf48fd565930427494", "score": "0.6783863", "text": "def update\n puts '###########################'\n puts request.raw_post\n\n if @usuario != nil\n if @usuario.update(user_params)\n render json: @usuario, status: :ok\n return\n else\n message = {'error' => 'La modificación ha fallado'}.to_json\n render :json => message, status: :internal_server_error\n return\n end\n else\n message = {'error' => 'Usuario no encontrado'}.to_json\n render :json => message, status: :not_found\n return\n end\n\n if params[:id] != nil\n message = {'error' => 'id no es modificable'}.to_json\n render :json => message, status: :bad_request\n return\n end\n end", "title": "" }, { "docid": "2fca44e60d17c28f63bce7e4768a457f", "score": "0.6753344", "text": "def update\n #cancan @usuario = Usuario.find(params[:id])\n #unauthorized! if cannot? :update, @usuario\n respond_to do |format|\n if @usuario.update_attributes(params[:usuario])\n format.html { redirect_to @usuario, notice: 'Usuario foi alterado com sucesso' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ff105e88e62d38bed7982f1f18eaeed1", "score": "0.6749843", "text": "def update\n tokenUser = @_request.headers[\"X-Usuario-Token\"]\n user = Usuario.where(:authentication_token => tokenUser)\n\n if user[0].perfil_id === \"5fa1b6b64debe72ed41388ac\" || user[0].id === params[:id]\n if @usuario.update(usuario_params)\n render json: @usuario\n else\n render json: @usuario.errors, status: :unprocessable_entity\n end\n else\n render json: {\n messages: \"You don't have necessary authorization\",\n is_success: false,\n data: {}\n }, status: :unauthorized\n end\n\n # if @usuario.update(usuario_params)\n # render json: @usuario\n # else\n # render json: @usuario.errors, status: :unprocessable_entity\n # end\n end", "title": "" }, { "docid": "abb101855c6db2178230b603cf69f155", "score": "0.6735431", "text": "def update\n @usuario = Usuario.find(params[:id])\n\n respond_to do |format|\n if @usuario.update_attributes(params[:usuario])\n format.html { redirect_to @usuario, notice: 'Usuario was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ec18af87ad3d2e3a9b12e8cf1e325d97", "score": "0.6726325", "text": "def update\n @usuario = Usuario.find(params[:id])\n\n respond_to do |format|\n if @usuario.update_attributes(params[:usuario])\n format.html { redirect_to @usuario, notice: 'Usuario fue actualizado existosamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9d358e1ad81d946cd6d9ff50f3d97df8", "score": "0.6677708", "text": "def update\r\n @usuario = Usuario.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @usuario.update_attributes(params[:usuario])\r\n format.html { redirect_to @usuario, notice: 'Usuario 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: @usuario.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "e9a8722d1d20859b862bb13ae36de08b", "score": "0.66744435", "text": "def update\n respond_to do |format|\n if @usuario_especie.update(usuario_especie_params)\n format.html { redirect_to @usuario_especie, notice: 'Usuario especie was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @usuario_especie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3d58c07cba1e9d5763271f2f5ad64625", "score": "0.66679096", "text": "def update\n begin\n @usuario = Usuario.find(params[:id])\n if @usuario.update(usuario_params)\n #json con el usuario nuevo\n else\n render json:{error: \"hubo un error interno y no se pudo nomás, sorry, shao loh vimoh\"}, status: 500, content_type: \"application/json\"\n end\n rescue\n render json: {error: \"Usuario no encontrado\"}, status: 404, content_type: \"application/json\"\n end \n end", "title": "" }, { "docid": "e7aa7a88d19c9b7ce1b51a9c07ae01b9", "score": "0.66013545", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params)\n format.html { redirect_to root_path, notice: 'Usuario alterado com sucesso.' }\n format.json { render :show, status: :ok, location: @usuario }\n else\n format.html { render :edit }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "da8cc6133b5cd4b62cde6a7b71ddb4ca", "score": "0.6589422", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params)\n format.html { redirect_to @usuario, notice: 'Usuario was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "da8cc6133b5cd4b62cde6a7b71ddb4ca", "score": "0.6589422", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params)\n format.html { redirect_to @usuario, notice: 'Usuario was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "da8cc6133b5cd4b62cde6a7b71ddb4ca", "score": "0.6589422", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params)\n format.html { redirect_to @usuario, notice: 'Usuario was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a0b6bbebf5b7e85646629fc54d24285f", "score": "0.65687186", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params)\n format.html { redirect_to admin_usuario_path(@usuario), notice: I18n.t('messages.atualizado_sucesso') }\n format.json { render :show, status: :ok, location: @usuario }\n else\n format.html { render :edit }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7dbc73e03e357ecd19f35a6f00cdd417", "score": "0.65596926", "text": "def update\n respond_to do |format|\n if @usuariocompleto.update(usuariocompleto)\n format.html { redirect_to @usuariocompleto, notice: 'Usuário was successfully updated.' }\n format.json { render :show, status: :ok, location: @usuariocompleto }\n else\n format.html { render :edit }\n format.json { render json: @usuariocompleto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bd536c2d2c114b82a728d5bb5afe583a", "score": "0.65555644", "text": "def update #IGNORE\n #TODO: verificar esta parte Asumir que no se marco nada\n unless params[:usuario][:vacaciones_negociadas]\n modulos_permitidos=current_user.submodulos.map(&:nombre)\n {:perfil_ids=>\"Perfiles\",:predefinido_ids=>\"Datos Administrativos\",\n :hobbie_ids=>\"Pasatiempos\",:talento_ids=>\"Pasatiempos\"}.each do |key,value|\n params[:usuario][key]||=[] if modulos_permitidos.include?(value)\n end\n else\n params[:usuario][:fecha_negociada]=Date.today\n end\n\n @usuario = Usuario.find(params[:id])\n #[email protected]_id\n respond_to do |format|\n if @usuario.update_attributes(params[:usuario])\n Solicitud.responder(current_user,@usuario)\n #TODO: Al cambiar de cargo, se crea un nuevo contrato..CONSIDERAR ESTA FUNCIONALIDAD?\n# unless params[:usuario][:cargo_id].nil?\n# @usuario.actualizar_historico_laboral(params[:usuario]) if cargo_actual_id != params[:usuario][:cargo_id].to_i\n# end\n format.html {\n flash[:notice] = 'Usuario actualizado correctamente.'\n redirect_to(cuenta(@usuario)) }\n format.xml { head :ok }\n format.js {\n render :update do |page|\n page.replace_html :vacaciones, :partial=>\"usuarios/datos_laborales/modulo_vacaciones.html\",:locals=>{:usuario=>@usuario}\n page << \"makeColorBox()\"\n end\n }\n else\n format.html {\n draw_map(true)\n render :action => \"edit\"\n }\n format.xml { render :xml => @usuario.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f0686f191a0def3b6c3ad6edfbcf2f03", "score": "0.6538707", "text": "def update_user(email)\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/users/2.json'\n ).to_s\n\n puts RestClient.patch(\n url,\n { user: { email: email } }\n )\n end", "title": "" }, { "docid": "0489fceaf79fbfece06572cb6bc79717", "score": "0.6533998", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params)\n format.html { redirect_to @usuario, notice: 'Usuario actualizado exitosamente.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cdc2576bc782f97128c77bee49b6afac", "score": "0.65202594", "text": "def update\n respond_to do |format|\n if @usuario_seguro.update(usuario_seguro_params)\n format.html { redirect_to @usuario_seguro, notice: 'Usuario seguro was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @usuario_seguro.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a15a97242af897c8abd16bad431c48fe", "score": "0.65184546", "text": "def update\n @usuario = Usuario.find(params[:id])\n\n\n respond_to do |format|\n if @usuario.update_attributes(params[:usuario])\n flash[:notice] = \"Usuario #{@usuario.username} modificado exitosamente\"\n format.html { redirect_to action: :index }\n format.json { head :no_content }\n else\n flash[:error] = \"No se pudo modificar el usuario #{@usuario.username}\"\n format.html { render action: \"edit\" }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b5182769d8b1964ac0060dd902c5d9dc", "score": "0.65016764", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params)\n format.html { redirect_to @usuario, notice: 'Usuário foi alterado com sucesso.' }\n format.json { render :show, status: :ok, location: @usuario }\n else\n format.html { render :edit }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a4cacb7e5ccdd16184fb20c7d2ccb8c", "score": "0.6482837", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params)\n format.html { redirect_to usuarios_url, notice: 'Usuario actualizado.' }\n format.json { render :show, status: :ok, location: @usuario }\n else\n format.html { render :edit }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cfe8dfe2e20a4677784ed850c447f8d7", "score": "0.6480327", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params)\n format.html { render :show}\n format.json { render :show, status: :ok, location: @usuario }\n else\n format.html { render :edit }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "47b02eae668e38a5bcfc0695b237a1e6", "score": "0.6476674", "text": "def update\n\t\n if params[:todos]\n\tparams[:notificacao][:ginasio_id] = nil\n end\n\n @notificacao = Notificacao.find(params[:id])\n\n respond_to do |format|\n if @notificacao.update_attributes(params[:notificacao])\n format.html { redirect_to @notificacao, :flash => { :success => \"Notificacao alterada com sucesso.\" } }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @notificacao.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a9a62d32c5ad516f430ebf5fac18d98a", "score": "0.6472341", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params)\n format.html { redirect_to usuarios_path, notice: 'El usuario se actualizó correctamente.' }\n format.json { render :show, status: :ok, location: @usuario }\n else\n format.html { render :edit }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4d1018e99faac5a02b2f4793e7747484", "score": "0.64700097", "text": "def update\n respond_to do |format|\n if @tipo_usuario.update(tipo_de_usuario_params)\n format.html { redirect_to @tipo_usuario, notice: 'Tipo de usuario was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tipo_usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab77a9b546dac658a4b934abc085aa48", "score": "0.64690894", "text": "def update\n # Proteccion, borrar todos los parametros en caso de que se creen de otra forma\n [:pass, :pass_confirmation, :login, :tipo].each{ |v| params[:usuario].delete(v) }\n\n @usuario = Usuario.find(params[:id])\n\n respond_to do |format|\n if @usuario.update_attributes(params[:usuario])\n flash[:notice] = 'Usuario was successfully updated.'\n format.html { redirect_to(@usuario) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @usuario.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7e6fabc7fb743e92eea5274dbba946f2", "score": "0.6459501", "text": "def update\n @usuario = Usuario.find(params[:id])\n respond_to do |format|\n if @usuario.update(usuario_params)\n flash[:success] = \"Perfil correctamente actualizado\"\n sig_in @usuario\n format.html { redirect_to @usuario}\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "23938c68ef9abf0f7f952b2be1a5b0e8", "score": "0.64467365", "text": "def update\n @pelicula = Pelicula.find(params[:id])\n @pelicula.update(update_params)\n render json: @pelicula, status: :ok\n end", "title": "" }, { "docid": "b2560d8bcdffc9f16886efc6a348a8f1", "score": "0.64451176", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params)\n format.html { redirect_to @usuario, notice: 'Tu cuenta ha sido actualizada exitosamente.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f6c9c9a6a53c4b3de4c0c462112d1c8e", "score": "0.6441979", "text": "def activo_update\n respond_to do |format|\n activo = params[:sustancium][:activo]\n id = params[:id]\n Sustancium.where(id: id).update_all(activo: activo )\n msg = { :status => \"ok\", :message => \"Actualizado!\" }\n format.json { render :json => msg }\n end\n end", "title": "" }, { "docid": "8748a3bb3fbed772393063061fe35575", "score": "0.64399123", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params)\n format.html { redirect_to @usuario, notice: 'Usuário atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @usuario }\n else\n format.html { render :edit }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0de11dd05368c3b767a4c6d70997d13c", "score": "0.64375687", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params)\n if @usuario.tipo != \"Diretor\"\n if [email protected]?\n @usuario.tipo = \"Gerente\"\n @usuario.save\n addlog(\"Editou um usuario\")\n end\n end\n\n format.html { redirect_to @usuario, notice: 'Usuario atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @usuario }\n else\n format.html { render :edit }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dea89914d7e0f0a509abfa6db9c16870", "score": "0.6429352", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params)\n format.html { redirect_to @usuario, notice: 'Usuario foi atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @usuario }\n else\n format.html { render :edit }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f5b2fddcbb574753018179bcfafb8f7e", "score": "0.64288044", "text": "def update\n @telefone = Telefone.find(params[:id])\n\n respond_to do |format|\n if @telefone.update_attributes(params[:telefone])\n if @telefone.telefonavel_type == 'Usuario'\n format.html { redirect_to [:admin, Usuario.find(@telefone.telefonavel_id)], :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { redirect_to [:admin, Cliente.find(@telefone.telefonavel_id)], :notice => 'Exemplo was successfully created.' }\n format.json { render :json => @telefone, :status => :created, :location => @telefone }\n end\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @telefone.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "df0b926d8563d8227149b6a21b97f8cb", "score": "0.6417597", "text": "def update\r\n @user = User.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @user.update_attributes(params[:user])\r\n\r\n if params[:user][:convidados_attributes] != nil\r\n params[:user][:convidados_attributes].each do |attr_name, attr_value|\r\n @convidado = Convidado.find(attr_value[:id])\r\n @convidado.update_attributes(attr_value)\r\n end\r\n end \r\n format.html { redirect_to @user, :notice => 'User was successfully updated.' }\r\n format.json { head :ok }\r\n else\r\n format.html { render :action => \"edit\" }\r\n format.json { render :json => @user.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "8cf5582be869fc5b155331c1d0f7a490", "score": "0.6416935", "text": "def update\n @oferta = Oferta.find(params[:id])\n\n respond_to do |format|\n if @oferta.update_attributes(params[:oferta])\n format.html { redirect_to @oferta, :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @oferta.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1fafb20b52a70aa867598f33796c4274", "score": "0.6416533", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params)\n format.html { redirect_to @usuario, notice: 'Usuario was successfully updated.' }\n format.json { render :show, status: :ok, location: @usuario }\n else\n format.html { render :edit }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f4d8b0f6af9ac593831b51c742d9f535", "score": "0.64156604", "text": "def update\n respond_to do |format|\n if @recursousuario.update(recursousuario_params)\n format.html { redirect_to @recursousuario, notice: 'Recursousuario was successfully updated.' }\n format.json { render :show, status: :ok, location: @recursousuario }\n else\n format.html { render :edit }\n format.json { render json: @recursousuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6f417da5eb0577f921c5110d27735f6b", "score": "0.6411975", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params)\n format.html { redirect_to @usuario, notice: 'Usuario was successfully updated.' }\n format.json { render :show, status: :ok, location: @usuario }\n else\n format.html { render :edit }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6f417da5eb0577f921c5110d27735f6b", "score": "0.6411975", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params)\n format.html { redirect_to @usuario, notice: 'Usuario was successfully updated.' }\n format.json { render :show, status: :ok, location: @usuario }\n else\n format.html { render :edit }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6f417da5eb0577f921c5110d27735f6b", "score": "0.6411975", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params)\n format.html { redirect_to @usuario, notice: 'Usuario was successfully updated.' }\n format.json { render :show, status: :ok, location: @usuario }\n else\n format.html { render :edit }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6f417da5eb0577f921c5110d27735f6b", "score": "0.6411975", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params)\n format.html { redirect_to @usuario, notice: 'Usuario was successfully updated.' }\n format.json { render :show, status: :ok, location: @usuario }\n else\n format.html { render :edit }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6f417da5eb0577f921c5110d27735f6b", "score": "0.6411975", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params)\n format.html { redirect_to @usuario, notice: 'Usuario was successfully updated.' }\n format.json { render :show, status: :ok, location: @usuario }\n else\n format.html { render :edit }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6f417da5eb0577f921c5110d27735f6b", "score": "0.6411975", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params)\n format.html { redirect_to @usuario, notice: 'Usuario was successfully updated.' }\n format.json { render :show, status: :ok, location: @usuario }\n else\n format.html { render :edit }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6f417da5eb0577f921c5110d27735f6b", "score": "0.6411975", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params)\n format.html { redirect_to @usuario, notice: 'Usuario was successfully updated.' }\n format.json { render :show, status: :ok, location: @usuario }\n else\n format.html { render :edit }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6f417da5eb0577f921c5110d27735f6b", "score": "0.6411975", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params)\n format.html { redirect_to @usuario, notice: 'Usuario was successfully updated.' }\n format.json { render :show, status: :ok, location: @usuario }\n else\n format.html { render :edit }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6f417da5eb0577f921c5110d27735f6b", "score": "0.6411975", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params)\n format.html { redirect_to @usuario, notice: 'Usuario was successfully updated.' }\n format.json { render :show, status: :ok, location: @usuario }\n else\n format.html { render :edit }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "340005eaf8c7e1b435526c9401dddd8b", "score": "0.64105237", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params)\n format.html { redirect_to productos_url, notice: 'Usuario modificado exitosamente..' }\n format.json { render :show, status: :ok, location: productos_url }\n else\n format.html { render :edit }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2b1f9f8a904a2c2978d083d2707e4a2b", "score": "0.64026", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params)\n format.html { redirect_to @usuario, notice: 'Usuario actualizado.' }\n format.json { render :show, status: :ok, location: @usuario }\n else\n format.html { render :edit }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8030b6a3a618d66537d0f1f7e1a4175e", "score": "0.6401115", "text": "def update\n @oficio = Oficio.find(params[:id])\n\n respond_to do |format|\n if @oficio.update_attributes(params[:oficio])\n format.html { redirect_to @oficio, notice: 'Oficio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @oficio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "00bfe114fe023185fd84125bc107d752", "score": "0.63958466", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params)\n update_nombre_rol\n format.html { redirect_to info_cambiada_path, notice: \"Usuario #{@usuario.email} fue actualizado exitosamente.\" }\n format.json { render :show, status: :ok, location: @usuario }\n else\n format.html { render :edit }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f434164e905002738e14ade82e6213b5", "score": "0.6395225", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params)\n format.html { redirect_to @usuario, notice: 'Usuario actualizado existosamente.' }\n format.json { render :show, status: :ok, location: @usuario }\n else\n format.html { render :edit }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3d98331a7c794ae4567dcacce2fd64f5", "score": "0.6385314", "text": "def update\n respond_to do |format|\n if @proyecto_usuario.update(proyecto_usuario_params)\n format.html { redirect_to @proyecto_usuario, notice: 'Proyecto usuario was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @proyecto_usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cd65172b07306038abd9af1d3884afc5", "score": "0.6379989", "text": "def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client]) and \n @client.usuario.update_attributes(params[:client][:usuario_attributes])\n format.html { redirect_to [:admin, @client], notice: 'Client was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e0b4a9652c56d6084855210f76d8b4ee", "score": "0.6373447", "text": "def update\n respond_to do |format|\n begin\n if request.raw_post.include? \"id\"\n @message = \"id no es modificable\"\n format.html { render :new }\n format.json { render \"error\", status: :bad_request }\n else\n if params[:usuario]\n @user.usuario = params[:usuario]\n end\n if params[:nombre]\n @user.nombre = params[:nombre]\n end\n if params[:apellido]\n @user.apellido = params[:apellido]\n end\n if params[:twitter]\n @user.twitter = params[:twitter]\n end\n @user.save\n format.html { redirect_to @user, notice: 'User was successfully created.' }\n format.json { render :show, status: :ok }\n end\n rescue\n @message = \"La modificación ha fallado\"\n format.html { render :new }\n format.json { render json: \"error\", status: :internal_server_error }\n end\n end\n end", "title": "" }, { "docid": "c94c5a94a7c97b50aefa4ff8ec9aecbe", "score": "0.6373365", "text": "def update\r\n respond_to do |format|\r\n if @usuario_sitio.update(usuario_sitio_params)\r\n format.html { redirect_to @usuario_sitio, notice: 'Usuario sitio 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: @usuario_sitio.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "51e0337cb50272740164941a0e6aaa35", "score": "0.6366441", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params)\n format.html { redirect_to @usuario, notice: 'Se ha actualizado el Usuario.' }\n format.json { render :show, status: :ok, location: @usuario }\n else\n format.html { render :edit }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end \n end\n end", "title": "" }, { "docid": "f873f5ef526b1fe6b02cfe4032c6f144", "score": "0.6366109", "text": "def update\n @usuario = User.find(params[:id])\n\n respond_to do |format|\n if @usuario.update_attributes(user_params)\n flash[:notice] = \"Usuario atualizado com sucesso\"\n format.html { redirect_to usuarios_url }\n format.json { head :no_content }\n else\n \t@pessoa = @usuario.pessoa\n flash[:error] = \"Erro ao atualizar o usuario\"\n format.html { render action: \"edit\" }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "452dd9355376b7e6d3dfb2024a76aa45", "score": "0.6351824", "text": "def update\n Usuario.find(params[:funcionario][:usuario]).update(nome: params[:funcionario][:nome])\n \n respond_to do |format|\n if @funcionario.update(funcionario_params)\n format.html { redirect_to @funcionario, notice: 'Funcionário alterado com sucesso' }\n format.json { render :show, status: :ok, location: @funcionario }\n else\n format.html { render :edit }\n format.json { render json: @funcionario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "644c5dad5867186557f6d3865d9e3789", "score": "0.6334592", "text": "def update_usuario\n @usuario = Usuario.find(params[:id])\n\n respond_to do |format|\n if @usuario.update_attributes(params[:usuario])\n format.html { redirect_to(@usuario, :notice => 'Datos del usuario fueron actualizados de forma correcta.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @usuario.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5bd76a24a644f6b72838892241b0bd36", "score": "0.63188046", "text": "def update\n @telefono = Telefono.find(params[:id])\n\n respond_to do |format|\n if @telefono.update_attributes(params[:telefono])\n format.html { redirect_to @telefono, notice: 'Telefono was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @telefono.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "74b5fed3975d7bffe23a128e46a76ad1", "score": "0.63100237", "text": "def update\n respond_to do |format|\n if @servicio.update(servicio_params)\n format.html { redirect_to @servicio, notice: 'Servicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @servicio }\n else\n format.html { render :edit }\n format.json { render json: @servicio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cdcf76ce6c0ceadbb18c9c954b01d9a9", "score": "0.6306539", "text": "def changeUser\n @usuario = Fdusuario.find(params[:id])\n if @usuario.update_attributes(user_update_params)\n render json: @usuario, include: []\n else\n render json: @usuario.errors\n end\n #if current_fdusuario.update(user_update_params)\n # render json: current_fdusuario, include: []\n #else\n # render json: current_fdusuario.errors\n #end\n end", "title": "" }, { "docid": "2ed52a5c0bf2b64592e74e74f4170431", "score": "0.63025206", "text": "def update\n @usuario = Usuario.find(params[:id])\n\n respond_to do |format|\n if @usuario.update_attributes(params[:usuario])\n format.html { redirect_to(usuarios_url, :notice => '') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @usuario.errors, :status => :unprocessable_entity }\n end\n end \n end", "title": "" }, { "docid": "60ca955f2989d8093ee8e8930b225cf2", "score": "0.6294137", "text": "def update\n @usuario = Usuario.find(params[:id]) \n\n respond_to do |format|\n if @usuario.update_attributes(params[:usuario])\n format.html { redirect_to usuarios_url }\n flash[:notice] = \"Usuário alterado com sucesso!\"\n else\n format.html { render action: \"edit\" }\n flash[:error] = \"Ocorreu um erro e o usuário não foi alterado!\"\n end\n end\n end", "title": "" }, { "docid": "cd023481909eb43ddcd475c2215b770f", "score": "0.62906986", "text": "def update\n @punto_servicio = PuntoServicio.find(params[:id])\n\n respond_to do |format|\n if @punto_servicio.update_attributes(params[:punto_servicio])\n format.html { redirect_to @punto_servicio, notice: 'Punto servicio was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @punto_servicio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e410b08331dc40fde29f992ebdd48d61", "score": "0.6289642", "text": "def update\n respond_to do |format|\n if @servico_passeio.update(servico_passeio_params)\n format.html { redirect_to @servico_passeio, notice: 'Passeio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @servico_passeio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e471f2d4a85107c2f37143c6a416ee12", "score": "0.62882555", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params_update)\n format.html { redirect_to edit_usuario_path(@usuario), notice: 'Guardado Correctamente' }\n format.json { render :show, status: :ok, location: @usuario }\n else\n format.html { render :edit }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e471f2d4a85107c2f37143c6a416ee12", "score": "0.62882555", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params_update)\n format.html { redirect_to edit_usuario_path(@usuario), notice: 'Guardado Correctamente' }\n format.json { render :show, status: :ok, location: @usuario }\n else\n format.html { render :edit }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "61a5cb04ddf30e39acd99c912e789d71", "score": "0.6278395", "text": "def update\n @admin = Admin.find(params[:id])\n\n respond_to do |format|\n if @admin.update_attributes(params[:admin]) and\n @admin.usuario.update_attributes(params[:admin][:usuario_attributes])\n format.html { redirect_to [:admin, @admin], notice: 'Admin was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "26648e7139f89b42ff8143f0896ea17b", "score": "0.6273356", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params)\n flash[:success] = \"Perfil editado com sucesso!\"\n format.html { redirect_to @usuario }\n format.json { render :show, status: :ok, location: @usuario }\n else\n flash.now[:danger] = \"Perfil não foi editado!!!\"\n format.html { render :edit }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dc987805db221132b11244853dd1f5a2", "score": "0.62720186", "text": "def update\n @usuario = Usuario.find(params[:id])\n\n respond_to do |format|\n if @usuario.update_attributes(params[:usuario])\n format.html { redirect_to(usuarios_path, notice: 'usuario was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render action: \"edit\" }\n format.xml { render xml: @usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4e67bbebe06004980d1d76cdb1cfdee5", "score": "0.62704456", "text": "def activo_update\n respond_to do |format|\n activo = params[:plan_paciente][:activo]\n id = params[:id]\n PlanPaciente.where(id: id).update_all(activo: activo )\n msg = { :status => \"ok\", :message => \"Actualizado!\" }\n format.json { render :json => msg }\n end\n end", "title": "" }, { "docid": "ce14ce7151a3d659c74085841d708525", "score": "0.6265221", "text": "def update\n @comentarios_admin = ComentariosAdmin.find(params[:id])\n\n respond_to do |format|\n if @comentarios_admin.update_attributes(params[:comentarios_admin])\n format.html { redirect_to @comentarios_admin, notice: 'Comentarios admin was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @comentarios_admin.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cf63ca6298156736dc3c695cfe8dae1d", "score": "0.6262489", "text": "def update\n respond_to do |format|\n if @servico.update(servico_params)\n format.html { redirect_to admin_pessoa_servicos_path(@pessoa), notice: 'Serviço foi atualizada com sucesso.' }\n format.json { head :no_content }\n else\n get_dependencies\n format.html { render action: 'edit' }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4615f9cda840a6520a2a376068ac1280", "score": "0.62564445", "text": "def update\n @usuario_perfil = UsuarioPerfil.find(params[:id])\n\n respond_to do |format|\n if @usuario_perfil.update_attributes(params[:usuario_perfil])\n format.html { redirect_to @usuario_perfil, :notice => 'Usuario perfil was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @usuario_perfil.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a8c831b801b627bd20b5d07fcd71e41", "score": "0.6256144", "text": "def update\n # Busca al usuario por el email\n @user = User.where(email: params[:email])\n valid_params = ['name', 'nickname', 'password', 'puntuacion', 'categoria']\n update_params = {}\n # Se agregan los atributos para actualizar\n params.each do |k,v|\n if valid_params.include? k\n update_params[k] = v\n end\n end\n if @user.update_all(update_params)\n render :json => {:status => :ok, :message => 'Usuario actualizado'}\n else\n render :json => {:status => :error, :message => 'Error al actualizar'}\n end\n end", "title": "" }, { "docid": "ad1d17233af2c3c7a9ba526ce08b94a3", "score": "0.6254212", "text": "def update\n respond_to do |format|\n if @tusuario.update(tusuario_params)\n format.html { redirect_to @tusuario, notice: 'Tusuario was successfully updated.' }\n format.json { render :show, status: :ok, location: @tusuario }\n else\n format.html { render :edit }\n format.json { render json: @tusuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eb3770a77c7f27325d86e360415e0673", "score": "0.6250374", "text": "def update\n respond_to do |format|\n if @usuario.update(usuario_params)\n flash[:success] = @@msgs\n format.html { redirect_to usuarios_url, notice: @@msgs }\n format.json { render :show, status: :ok, location: @usuario }\n format.js {}\n else\n format.html { render :edit }\n format.json { render json: @usuario.errors, status: :unprocessable_entity }\n format.js { render :edit, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8d2dcd0d0f9c448835b0aa704ce6f516", "score": "0.6244342", "text": "def update\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n if @cliente.update_attributes(params[:cliente])\n format.html { redirect_to [:admin, @cliente], :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @cliente.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "10515feb4bbf952534156179641733d7", "score": "0.62354815", "text": "def update\n @user.update(user_params)\n render json: { notice: 'Usuario actualizado exitosamente' }\n end", "title": "" }, { "docid": "dad1793db1d40a2930f36a69da84df71", "score": "0.62348026", "text": "def update\n respond_to do |format|\n if @usuario_cargo.update(usuario_cargo_params)\n format.html { redirect_to @usuario_cargo, notice: \"Usuario cargo was successfully updated.\" }\n format.json { render :show, status: :ok, location: @usuario_cargo }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @usuario_cargo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9939d104cc69ee0603b44e21eac25e30", "score": "0.6234208", "text": "def update\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n if @servico.update_attributes(params[:servico])\n format.html { redirect_to @servico, notice: 'Servico foi atualiazado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cd7539c711e0a317046bcfd544c8cc5a", "score": "0.6233201", "text": "def update\n respond_to do |format|\n if @user_unidad.update(user_unidad_params)\n format.html { redirect_to @user_unidad, notice: 'User unidad was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user_unidad.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e01036e4cfe953d9b0b40f87b89379c9", "score": "0.62325865", "text": "def update\n respond_to do |format|\n if @objeto.update(campo_params)\n set_redireccion\n format.html { redirect_to @redireccion, notice: 'Campo was successfully updated.' }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d37c83055515be8308b2e6a1dfa7f72b", "score": "0.6231923", "text": "def update\n respond_to do |format|\n if @orgao_sistema.update(orgao_sistema_params)\n format.html { redirect_to @orgao_sistema, notice: 'Órgão sistema atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @orgao_sistema.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "57176387d35e818c95dd8ceb73bffc9c", "score": "0.6229276", "text": "def update\n respond_to do |format|\n if @usuario_tipo.update(usuario_tipo_params)\n format.html { redirect_to @usuario_tipo, notice: 'Usuario tipo was successfully updated.' }\n format.json { render :show, status: :ok, location: @usuario_tipo }\n else\n format.html { render :edit }\n format.json { render json: @usuario_tipo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "619e050fc8962cdb74ad12a6315bb6ce", "score": "0.62281203", "text": "def update\n if current_user.nil?\n redirect_to(log_in_path) and return\n end\n \n @usuario_seccion = UsuarioSeccion.find(params[:id])\n\n respond_to do |format|\n if @usuario_seccion.update_attributes(params[:usuario_seccion])\n format.html { redirect_to @usuario_seccion, notice: 'Usuario seccion was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @usuario_seccion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "498068cd82a66a6af64b1c266ff069c1", "score": "0.62231064", "text": "def update\n @client = Client.find(params[:id])\n usuario = Usuario.find_by_auth_token( cookies[:auth_token])\n if @client.usuario_id == usuario.id\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to [:cliente, @client], notice: 'Client was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "title": "" }, { "docid": "b9ef5fdb20b4511ab1e54e1efe9b5626", "score": "0.6220554", "text": "def update\n respond_to do |format|\n if @servico_cruzeiro.update(servico_cruzeiro_params)\n format.html { redirect_to @servico_cruzeiro, notice: 'Cruzeiro was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @servico_cruzeiro.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "274e5b7b2f4be160e1bfe5d1b6d545d8", "score": "0.6219774", "text": "def update\n @formulario = Formulario.find(params[:id])\n\n respond_to do |format|\n if @formulario.update_attributes(params[:formulario])\n format.html { redirect_to formularios_path }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @formulario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8243291cc49132470364ccc4b43851df", "score": "0.62168044", "text": "def update\n # render text: params.inspect\n respond_to do |format|\n if @funcionario.update(funcionario_params)\n @funcionario.usuario.update_attributes(tipo: params[:funcionario][:usuarios][:tipo], nome: @funcionario.apelido)\n format.html { redirect_to area_funcionarios_path(@funcionario.area), notice: 'O Funcionário foi atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @funcionario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b8dcd2491b197c0c62a8f6716a37c05a", "score": "0.6213976", "text": "def update\n # Atualiza as informações o usuário\n \tif @user.update(users_params) \n \t\trender json: :success, status: 200\n \telse\n \t\trender json: @user.errors, status: :unprocessable_entity\n \tend\n end", "title": "" }, { "docid": "626af91271495ade9fd5601fc2a240fe", "score": "0.62124914", "text": "def update\n @orden_servicio = OrdenServicio.find(params[:id])\n\n respond_to do |format|\n if @orden_servicio.update_attributes(params[:orden_servicio])\n format.html { redirect_to @orden_servicio, notice: 'Orden servicio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @orden_servicio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a57ed7f9d30336e2c0c31e52fca5db3c", "score": "0.6210356", "text": "def update\n respond_to do |format|\n if @datos_registro.update(datos_registro_params)\n format.html { redirect_to root_path, notice: 'Datos registro was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @datos_registro.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
127b6d49303193712445ca650caca596
Return name of file system
[ { "docid": "77af067b5d3bad0f48cc2e6372ce50c9", "score": "0.651003", "text": "def get_filesystem\n @@current_fake ? @@current_fake[:filesystem] : ''\n end", "title": "" } ]
[ { "docid": "1f54005691dd72574fb6267221f5f7ba", "score": "0.767065", "text": "def name\n\t\t\"Stdapi: File system\"\n\tend", "title": "" }, { "docid": "cf0b14a6809d1818ec78e82e088d5193", "score": "0.6864035", "text": "def name\n File.basename(@root)\n end", "title": "" }, { "docid": "f757fe3eaa7121ce27a91a5fee25a019", "score": "0.6856462", "text": "def name\n filename\n end", "title": "" }, { "docid": "f757fe3eaa7121ce27a91a5fee25a019", "score": "0.6856462", "text": "def name\n filename\n end", "title": "" }, { "docid": "292cc38d9b29003c2c0758643284fa3b", "score": "0.6827116", "text": "def file_name\n @file_name ||= File.basename tree\n end", "title": "" }, { "docid": "037fc15f3c86109782bb60aff57759df", "score": "0.6808022", "text": "def name\n name = nil\n if root?\n name = path.to_s\n else\n name = @path.basename.to_s\n end\n return name\n end", "title": "" }, { "docid": "2ed4ba1309f0ee0238b5bb2aac9ada42", "score": "0.67861384", "text": "def name\n @name ||= ::File.basename(@path)\n end", "title": "" }, { "docid": "a4cd4eece147c06001592f3e4777f3e7", "score": "0.67695856", "text": "def file_name\n File.basename @path\n end", "title": "" }, { "docid": "165ec4e21c80d6a24b7d575ecff121df", "score": "0.67361045", "text": "def file_name\n name.underscore\n end", "title": "" }, { "docid": "c463dbf2e219b35aae9ca7d009772380", "score": "0.6733147", "text": "def name\n @name ||= File.basename(path)\n end", "title": "" }, { "docid": "c463dbf2e219b35aae9ca7d009772380", "score": "0.6733147", "text": "def name\n @name ||= File.basename(path)\n end", "title": "" }, { "docid": "cf9a6be7a35820be78dc83bee068b69e", "score": "0.6707189", "text": "def name\n ::File.basename(path)\n end", "title": "" }, { "docid": "193e6fd530486c9ca9cff22acbd29276", "score": "0.6704208", "text": "def name\n @name ||= File.basename(path)\n end", "title": "" }, { "docid": "b5e1017708c26cc3d911e1cc499df871", "score": "0.6684292", "text": "def name\n file.partition(base).last.gsub(/[_\\/]/, \" \").strip\n end", "title": "" }, { "docid": "29a418527ac5c1be242b567f3f7bdb44", "score": "0.6675857", "text": "def name\n File.basename(@path)\n end", "title": "" }, { "docid": "29a418527ac5c1be242b567f3f7bdb44", "score": "0.6675857", "text": "def name\n File.basename(@path)\n end", "title": "" }, { "docid": "29a418527ac5c1be242b567f3f7bdb44", "score": "0.6675857", "text": "def name\n File.basename(@path)\n end", "title": "" }, { "docid": "707a126cfe9718d123e4574befee35d8", "score": "0.66694725", "text": "def name()\n basename.to_s\n end", "title": "" }, { "docid": "d1b3fb53c64bc361f6335fb9f2f4df9b", "score": "0.6653423", "text": "def name\n @name ||= File.basename(Dir.pwd)\n end", "title": "" }, { "docid": "308f8c350be46d49920a6584624027e0", "score": "0.66271526", "text": "def name\n system_name\n end", "title": "" }, { "docid": "c85e5e7d42a45ad5d0dd5a52919986b8", "score": "0.6586067", "text": "def file_name\n\t\treturn 'st' + student_id.to_s + 'pr' + problem_id.to_s + 'so' + id.to_s\n\tend", "title": "" }, { "docid": "f0ee12e22fdaebd4439c1ae0ffca1002", "score": "0.65842336", "text": "def access_file_name\n end", "title": "" }, { "docid": "b6e37c86e0bb26eb73835b32729b4ecc", "score": "0.658227", "text": "def file_name\n \"/\" + current_file.path.split('/').pop\n end", "title": "" }, { "docid": "6cef7b274425262f244a900cd127c5bf", "score": "0.6575014", "text": "def name\n @name ||= path.split('/').last\n end", "title": "" }, { "docid": "96dd0ae73ad61c7060e6beac97826984", "score": "0.6561798", "text": "def name\n File.basename(path)\n end", "title": "" }, { "docid": "d87404c0cf93acce9062413844f1f2d6", "score": "0.6556596", "text": "def name\n File.basename(self.path)\n end", "title": "" }, { "docid": "05720a6aa46f8d2e50f570a9a6228c5e", "score": "0.6545187", "text": "def file_name\n File.basename(file_path)\n end", "title": "" }, { "docid": "948dd63fb1afdf1bf72ecb9c7e037208", "score": "0.6512401", "text": "def name\n File.join(\"/dev/\",@device.gsub(/!/, \"/\"))\n end", "title": "" }, { "docid": "bd68853e8e48b671ba1ce4a255332e25", "score": "0.6436667", "text": "def name() @filename end", "title": "" }, { "docid": "f5a9f960966a9187ec0c6a8533f69d69", "score": "0.64282155", "text": "def path()\n return ::File.join(@root, @name)\n end", "title": "" }, { "docid": "20f5c513a8f340a7508b60fdcff8bef2", "score": "0.6424758", "text": "def full_filename(for_file)\n #[remote_process!, for_file].join(\".\")\n for_file\n end", "title": "" }, { "docid": "4369115a26ac98a3ff872abc9b0e7500", "score": "0.6409624", "text": "def file_name\n return unless @file\n\n @file.absolute_name\n end", "title": "" }, { "docid": "0cd1f1518c2dfbd6192812464ac7402b", "score": "0.6395807", "text": "def root_fs\n\t\t\t\tfind_root[2].to_s\n\t\t\tend", "title": "" }, { "docid": "fb9c8ac4eebb5643a573894961ec6a5f", "score": "0.63894206", "text": "def fs(path)\n OodAppkit.files.url(path: path).to_s\n end", "title": "" }, { "docid": "d4e22a198b87c69cc550a1a3d727d5ba", "score": "0.63878906", "text": "def name\n @name ||= filename.split(\".\").first.sub(/^_/, \"\")\n end", "title": "" }, { "docid": "33354c9ffc5f219bdbe40ea79557bd83", "score": "0.637957", "text": "def format_file_system_item_short(fsi)\n return \"\" unless fsi\n \"#{fsi.name}\" \n end", "title": "" }, { "docid": "9f5e5ae44bef984bfe409a38fa3a3d07", "score": "0.6334693", "text": "def file_name\n \"images/#{@name}.msf\"\n end", "title": "" }, { "docid": "fecd9764255dd548505dba3075dc7a06", "score": "0.6318108", "text": "def filesystem\n platform_service(:filesystem)\n end", "title": "" }, { "docid": "3c9758e79ffff97a533021df43aeab1e", "score": "0.62967163", "text": "def directory_name\n return @directory_name.to_s if @directory_name\n return local_path.basename.to_s if exist?\n return name\n end", "title": "" }, { "docid": "e183c72d684ca2e3e2a1675c445de178", "score": "0.62937135", "text": "def name\n @name ||= File.basename(file).chomp(File.extname(file))\n end", "title": "" }, { "docid": "23b0cc9a560bd39a6867991dedc48f33", "score": "0.6293257", "text": "def filename\n path.split(File::Separator).join(\"_\")\n end", "title": "" }, { "docid": "1342b77de7eb7e93f76b98dbb0dee105", "score": "0.62868917", "text": "def daemon_name\n File.basename(self.path)\n end", "title": "" }, { "docid": "e58d7b8fa1d09c3710fff376138cc361", "score": "0.6278731", "text": "def filesystem_safe_name\n name.\n gsub(ReservedCharacters) {|sub| '%%%02X' % sub.ord }.\n gsub(ReservedFilenameRegexp) {|sub| sub.gsub(/[^.]/) {|c| '%%%02X' % c.ord } }\n end", "title": "" }, { "docid": "61a4a496d8eea743db9a250ae35ce60c", "score": "0.6256308", "text": "def file_name\n \"#{@file_name}.#{extension}\"\n end", "title": "" }, { "docid": "5ee5f860ef0d1318d3608eaf39d2210f", "score": "0.6251714", "text": "def path\n name.split(\"::\").join(\"/\").downcase\n end", "title": "" }, { "docid": "a9a5e7238266db00b837568c6655a827", "score": "0.6243764", "text": "def file_name name\n File.basename(name).sub(/\\.[^\\.]*/, '')\n end", "title": "" }, { "docid": "a9a5e7238266db00b837568c6655a827", "score": "0.6243764", "text": "def file_name name\n File.basename(name).sub(/\\.[^\\.]*/, '')\n end", "title": "" }, { "docid": "512a500a1abe30189ac36e8c03064cb0", "score": "0.6235817", "text": "def name\n\t\t\tself.nice_folder_name\n\t\tend", "title": "" }, { "docid": "8ffdc784e52473c2800f7d3a0b7c1edf", "score": "0.62320626", "text": "def file_or_folder_name\n return @file_or_folder_name\n end", "title": "" }, { "docid": "553cab53f3d40f37efe5d99b80cd2f3a", "score": "0.62233335", "text": "def name_on_disk\n self.class.library_directory_name(@name)\n end", "title": "" }, { "docid": "3929cebd087a9e93675a6a30d409de55", "score": "0.62065756", "text": "def path_name\n str = name.dup\n str << '/' if is_dir\n str = parent.path_name + str if parent\n str\n end", "title": "" }, { "docid": "7eb234a2cf9dd52b2700bc79179b2dde", "score": "0.6201992", "text": "def full_filename\n File.join(path, self.disk_filename)\n end", "title": "" }, { "docid": "d1fc950c26bbe274c24ab42c97c43475", "score": "0.6199114", "text": "def default_name\n path.dirname.basename.to_s\n end", "title": "" }, { "docid": "92e5e2409c1079d67182ad2a4a6b1812", "score": "0.6192433", "text": "def filename\n File.basename(path)\n end", "title": "" }, { "docid": "3b3d17e4b3b027e2859b32210987737a", "score": "0.6189672", "text": "def file_name\n return @file_name\n end", "title": "" }, { "docid": "3b3d17e4b3b027e2859b32210987737a", "score": "0.6189672", "text": "def file_name\n return @file_name\n end", "title": "" }, { "docid": "1c72e8eebce9feab3173da90b95256f0", "score": "0.61841583", "text": "def file_name\n # file = full_name\n # file = file.gsub('::', '/')\n # file = file.gsub('#' , '/')\n # file = file.gsub('.' , '-')\n # #file = File.join(output, file + '.html')\n # file\n WebRI.entry_to_path(full_name)\n end", "title": "" }, { "docid": "52682bb738bae12b680f635f7bb8f467", "score": "0.6182605", "text": "def name\n path.gsub(/\\./,'_').gsub(%r{/}, '.').gsub(%r{(^\\.|\\.$)},'')\n end", "title": "" }, { "docid": "65b757a23e0234c8fc91fc61ae013f2d", "score": "0.617815", "text": "def filename\n @file.basename.to_s\n end", "title": "" }, { "docid": "3c1c27889e9955ae9850855f16191e05", "score": "0.6175089", "text": "def file_name(dir: T.unsafe(nil), name: T.unsafe(nil), ext: T.unsafe(nil), directory_separator: T.unsafe(nil)); end", "title": "" }, { "docid": "459cca6f2fab160ca7df7c97bc66bdb0", "score": "0.617447", "text": "def filename\n \"#{folder_id}#{File.extname(super)}\"\n end", "title": "" }, { "docid": "3e7e112fa0ebefc24a7bf6e5afc3a73a", "score": "0.61610246", "text": "def folder_name\n\t\treturn 'st' + student_id.to_s + 'pr' + problem_id.to_s + 'so' + id.to_s + '/'\n\tend", "title": "" }, { "docid": "c7cb0f33242ecfe9a2fcb764b856eb28", "score": "0.6149064", "text": "def path\n File.join(@base, @name)\n end", "title": "" }, { "docid": "e31ff0c9c6d791f0ea3154b0d9cbabc6", "score": "0.613803", "text": "def path\n name + extension\n end", "title": "" }, { "docid": "8a93184f2d19030c30aa8a4e0f0066f1", "score": "0.61218625", "text": "def filesystem_file(host)\n case host['platform']\n when %r{aix}\n '/etc/filesystems'\n when %r{el-|centos|fedora|sles|debian|ubuntu}\n '/etc/fstab'\n else\n # TODO: Add Solaris and OSX support, as per PUP-5201 and PUP-4823\n fail_test(\"Unable to determine filesystem table file location for #{host['platform']}\")\n end\n end", "title": "" }, { "docid": "1dc5fc522ae3ae5f372522bac82abc34", "score": "0.61206794", "text": "def file_name\n \"#{Time.current.to_i}-#{@file.original_filename}\"\n end", "title": "" }, { "docid": "dd01f41d90d408e704fc8fd0fc1beb42", "score": "0.61201125", "text": "def fedora_name\n 'image_file'\n end", "title": "" }, { "docid": "53cf61811f533ce3bb3f9367844a00b6", "score": "0.61166614", "text": "def localname\n @localname ||= ::File.join(filename + (extension || ''))\n end", "title": "" }, { "docid": "678af283e279e253a133157c82dac292", "score": "0.611562", "text": "def path\n File.join(@base, @name)\n end", "title": "" }, { "docid": "a47ba7a1327a7c9b580eda343ff7170a", "score": "0.6110201", "text": "def file_name\n @file_name\n end", "title": "" }, { "docid": "5683c9d2c979fd01ebe42a3464fe3574", "score": "0.61084896", "text": "def file_name\n self.file_file_name\n end", "title": "" }, { "docid": "7c64521cf74bb3561869301b03210a4e", "score": "0.610834", "text": "def file_name(name)\n name.to_s.gsub(/-/, \"_\").underscore\n end", "title": "" }, { "docid": "8a69bc9d4fa80290e644e0fa9a1d7cf5", "score": "0.6105538", "text": "def file_name\n file_name = (\"./tmp/database_doings/doing_uniques/uniques_done.txt\")\n end", "title": "" }, { "docid": "d0b69c5eb15927e3be3fe312bf2bc4d7", "score": "0.6097703", "text": "def maildir_getfilename dir\n time=Time.now.to_f\n counter=0\n hostname=Socket::gethostname\n filename=nil\n loop do\n filename=File.join(dir,sprintf(\"%.4f.%d_%d.%s\",\n time,$$,counter,hostname))\n break if not File.exist?(filename)\n counter+=1\n end\n return filename\n end", "title": "" }, { "docid": "0577be1231c86e6c743f95c7145b127a", "score": "0.60975796", "text": "def file_name(token)\n FileHelper.file_cache_name(file_cache_dir, token)\n end", "title": "" }, { "docid": "86f2121248dfc57ea3726e91e5b6bf96", "score": "0.6074393", "text": "def name\n @name ||= begin \n ioctl(EVIOCGNAME(len = 256), out_name = \" \" * len)\n out_name.rstrip\n end\n end", "title": "" }, { "docid": "b2fff67dfecb30236b688546625f0adf", "score": "0.60722435", "text": "def name\n file.basename('.rb').to_s if file\n end", "title": "" }, { "docid": "b2fff67dfecb30236b688546625f0adf", "score": "0.60722435", "text": "def name\n file.basename('.rb').to_s if file\n end", "title": "" }, { "docid": "d5419d7b35d00333c2b9f06bcdc2ce1c", "score": "0.60720277", "text": "def name\n @name ||= @project.dir.path.match(/.*\\/(.*)$/).nil? ? \"unknown\" : $1\n end", "title": "" }, { "docid": "bc16db539bc7cf10a4f686d8850e367f", "score": "0.6069933", "text": "def file\n @pathname.to_s\n end", "title": "" }, { "docid": "857ddaa93fd69a6ca59161a11afb1386", "score": "0.6067556", "text": "def file_namespace\n name\n end", "title": "" }, { "docid": "abb33a441e60faf93dd7502d1cc59109", "score": "0.6065881", "text": "def filename\n return @filename if @filename\n name.downcase.gsub(/\\W/, '_').squeeze('_')\n end", "title": "" }, { "docid": "a26f0116832c5cf604df7979e7cd47f4", "score": "0.60631543", "text": "def filename\n if super.present?\n @name ||= Digest::MD5.hexdigest(File.dirname(current_path))\n \"#{@name}#{File.extname(original_filename).downcase}\"\n end\n end", "title": "" }, { "docid": "a26f0116832c5cf604df7979e7cd47f4", "score": "0.60631543", "text": "def filename\n if super.present?\n @name ||= Digest::MD5.hexdigest(File.dirname(current_path))\n \"#{@name}#{File.extname(original_filename).downcase}\"\n end\n end", "title": "" }, { "docid": "63af2fcde4ccdcc397eb3026a55efe15", "score": "0.6052128", "text": "def system_name\n self.name\n end", "title": "" }, { "docid": "bd50a0d44ec19300443e5255508f28bb", "score": "0.6040466", "text": "def name\n @name ||= @data_files.map(&:name).join(\",\")\n end", "title": "" }, { "docid": "4c8f34909d0682e3707bbcd00f13691a", "score": "0.60379624", "text": "def base_name\n File.basename(file_name)\n end", "title": "" }, { "docid": "38be344fd5aa55ae483820265dc51064", "score": "0.6033905", "text": "def get_filename (file)\n\t\tif file.is_a? File\n\t\t\tfile = file.path\n\t\tend\n\t\treturn file\n\tend", "title": "" }, { "docid": "5ad4d0c262c633d2a302358f523d38e3", "score": "0.60300887", "text": "def get_os_name\n\t\t\t\treturn SystemDetector.get_os_name\n\t\t\tend", "title": "" }, { "docid": "b0afa4b2166e41589aacb664720f6c7b", "score": "0.6028891", "text": "def displayname\n path\n end", "title": "" }, { "docid": "15e36c555e12f4ad0a496a7b79233929", "score": "0.60207874", "text": "def name\n self.filename\n end", "title": "" }, { "docid": "399bd44706225c71f85986c7cacf46ef", "score": "0.6019616", "text": "def awful_file_name\n (((0x00..0x7f).to_a - [0x00, 0x0a, 0x2b, 0x2f]).map { |n| n.chr }).join + '.txt'\n end", "title": "" }, { "docid": "f7a4eb61d8e605e7ee9027732cdc2718", "score": "0.6017901", "text": "def kernel_name\n uname('-s')\n end", "title": "" }, { "docid": "689c5eca6b1e100d30578201cc2dee0a", "score": "0.601662", "text": "def inspect\n File.basename @__path\n end", "title": "" }, { "docid": "22bf831068d4f51dd22d07c7bb34c4b9", "score": "0.6000071", "text": "def main_name(path)\n File.basename(path).sub(/\\.[^\\.]+$/,'')\n end", "title": "" }, { "docid": "76ff5e4c0d84f1476054e7fe0010671f", "score": "0.59996414", "text": "def filename\n return Pathname.new(@file_object.io.path) if @file_object.io.respond_to?(:path) && File.exist?(@file_object.io.path)\n end", "title": "" }, { "docid": "76ff5e4c0d84f1476054e7fe0010671f", "score": "0.59996414", "text": "def filename\n return Pathname.new(@file_object.io.path) if @file_object.io.respond_to?(:path) && File.exist?(@file_object.io.path)\n end", "title": "" }, { "docid": "12db8f6f18d20a628d82c5cc50a0a5a8", "score": "0.59959346", "text": "def file_name\n @file_name ||= stream.file_name\n end", "title": "" }, { "docid": "870b91209f42ccba7ed1445ab6a1a751", "score": "0.59901565", "text": "def name\n @name || path_name\n end", "title": "" }, { "docid": "88aef30866911f79dea3f22caec3989c", "score": "0.5988922", "text": "def logName(fullPath); \"#{fullPath.chomp(File.extname(fullPath))}.log\" end", "title": "" } ]
d02274ed4a248342ae22e4722b7a7cf5
Return true if the hand is a bust
[ { "docid": "927228cfff8a76ee20d6fa2ee9543ce8", "score": "0.6693988", "text": "def is_bust\n self.update_points\n if @points > 21\n return true\n else\n return false\n end\n end", "title": "" } ]
[ { "docid": "cd6cbb8721ef876fc2d812a409f74c8d", "score": "0.8509246", "text": "def busted?\n self.hand.busted?\n end", "title": "" }, { "docid": "dc8b062427d41efa26f08306cf396951", "score": "0.8430949", "text": "def bust?(hand)\n hand.total > 21\n # From Demetra: this will return true if a hand you pass in is over 21\n # Consider using this to either initially check for a bust (when hands are first dealt) or to check for a bust during the player and dealer turns\n end", "title": "" }, { "docid": "b8ee105cb095c4e7fcc1c6da3b45577d", "score": "0.842531", "text": "def is_bust_hand(hand)\n return hand.is_bust\n end", "title": "" }, { "docid": "d4adc24c0c6c91fdd54586e32ac527df", "score": "0.8404608", "text": "def is_bust\n return @hand.is_bust\n end", "title": "" }, { "docid": "8ee0992cf8d60fc0a5a966c478f4b94e", "score": "0.83259755", "text": "def bust?\n hand_total > BLACKJACK_AMOUNT\n end", "title": "" }, { "docid": "0705c798b716cfb697f7031993b9a017", "score": "0.8212419", "text": "def bust?\n hand_total > 21\n end", "title": "" }, { "docid": "a7eeff39e1186fcc270e9b9afedaf41b", "score": "0.7802339", "text": "def is_bust()\n hand_value() > 21\n end", "title": "" }, { "docid": "0b6cb6143f001720b96939f9b3324f13", "score": "0.7529694", "text": "def isBusted(handIndex=0)\n\t\treturn @hands[handIndex].isBusted\n\tend", "title": "" }, { "docid": "e010f5fc1e4eb1677306aa6f86ab3e94", "score": "0.7480416", "text": "def bust?(hand, plyr, bet, name)\n if hand_score(hand) > 21\n p \"#{name} is busted!\"\n plyr.money -= bet\n end\n end", "title": "" }, { "docid": "c49525e8263f9685a396b1dea4922f2e", "score": "0.7479621", "text": "def is_bust\r\n # Because bust values are not valid, they are removed from hand_score\r\n # If a hand contains no valid values, it must be a bust.\r\n return hand_score.empty? \r\n end", "title": "" }, { "docid": "6a5c985589e976237be450ca42c16173", "score": "0.7420199", "text": "def busted\n return @handVal > 21\n end", "title": "" }, { "docid": "0ec9de98a97126c1a8bd10a7eda0e8e4", "score": "0.73624617", "text": "def is_busted?\n\t\ttotal > Blackjack::BLACKJACK_BUST\n\tend", "title": "" }, { "docid": "57d84cb244caa3bf23c6c4266591198a", "score": "0.7322142", "text": "def hit?\n return self.total.select{|value| value <= BJ_HAND} != [] && @status != HandStatus::STAND\n end", "title": "" }, { "docid": "7e0ce7d8eff3b1920c387169bd0d4ca4", "score": "0.73069155", "text": "def hitMe?\n\tif (hand.isSoft?)\n\t\treturn hand.value <= 17\n\telse\n\t\treturn hand.value < 17\n\tend\n end", "title": "" }, { "docid": "e8903a7112956d22622379a4914bc1cf", "score": "0.72403485", "text": "def hitMe?\n\treturn hand.value < 14\n end", "title": "" }, { "docid": "1beda20ba65c422d58633e28ccf0ddb9", "score": "0.7233295", "text": "def is_bust\n return point != \"Blackjack\" && point > 21\n end", "title": "" }, { "docid": "f6b094758fbede4b54c8298466da579a", "score": "0.71709454", "text": "def check_busted (hand)\n if hand.is_busted?\n puts \"Busted!\" \n self.lose_bet(hand)\n hand.end_play!\n wait_for_newline\n end\n end", "title": "" }, { "docid": "f8d418fab9a53c98976d7cc1619cc1cb", "score": "0.71372515", "text": "def is_busted?\n total > Blackjack::BLACKJACK_AMOUNT\n end", "title": "" }, { "docid": "8d43047b148f479dd1274e7eb4322774", "score": "0.7072497", "text": "def is_blackjack\n return @hand.is_blackjack\n end", "title": "" }, { "docid": "b7b4d6520fdebbb071a0c1aaf2a8ffc4", "score": "0.70583224", "text": "def full_house?\n type == HandType::FULL_HOUSE\n end", "title": "" }, { "docid": "968efdda5ef4a41a30a7bce97a60b07d", "score": "0.7047893", "text": "def goes_bust the_chosen\n if session[the_chosen].hand_value > 21\n session[:results] += \"#{ session[the_chosen].name } goes bust.<br>\"\n true\n else\n false\n end\n end", "title": "" }, { "docid": "44786a56067b5ff416b2e8890feb26f8", "score": "0.6987378", "text": "def is_blackjack_hand(hand)\n return hand.is_blackjack\n end", "title": "" }, { "docid": "b854327dc324e9e4c11c80d492549848", "score": "0.6971035", "text": "def bj?\n return self.max_hand == BJ_HAND && !@ace_split\n end", "title": "" }, { "docid": "d1d3d1c1c582e7f187491b87408dde95", "score": "0.69376093", "text": "def burn?\n return @status == GameData::States::BURN\n end", "title": "" }, { "docid": "f84fed3dac69ab5fa235e90e7480412d", "score": "0.6933875", "text": "def has_bide_effect?\n return @bide > 0\n end", "title": "" }, { "docid": "c8a872c8f88031dfcdd1cb32fa6a29ee", "score": "0.6924388", "text": "def hungry?\n\t\t@stuff_in_belly <= 2\n\tend", "title": "" }, { "docid": "124f71ac83f52128ef0c17425c63625d", "score": "0.69199014", "text": "def is_hungry?\n\t\tif @energy <= @hunger_point \n\t\t\ttrue\n\t\telse\n\t\t\t@is_hungry = false\n\t\t false\n\t\tend\t \n\tend", "title": "" }, { "docid": "3152eeeca9f3fc9ba43c6f9bba1e2696", "score": "0.69069606", "text": "def can_be_burn?\n return false if @status != 0 or type_fire?\n return true\n end", "title": "" }, { "docid": "c2e0fd537f6ef60f3bc633f0dda2f887", "score": "0.69052124", "text": "def hungry?\n\t\t@full_belly <=2\n\tend", "title": "" }, { "docid": "db34834d6c035a8c3c82eee5a6133bdd", "score": "0.69001687", "text": "def hungry?\n @stuff_in_belly <= 2\n end", "title": "" }, { "docid": "db34834d6c035a8c3c82eee5a6133bdd", "score": "0.69001687", "text": "def hungry?\n @stuff_in_belly <= 2\n end", "title": "" }, { "docid": "be2d85eaf38638678ca15e4d11dcc396", "score": "0.68948454", "text": "def royal_flush?\n straight_flush? && hand.any? { |card| card.value == \"14\"}\n end", "title": "" }, { "docid": "422a825838f0f8f9489b890ea3e1ef9e", "score": "0.68714863", "text": "def straight?\n type == HandType::STRAIGHT\n end", "title": "" }, { "docid": "2ddf574ecbdddfd5289c220d7aa59bea", "score": "0.68357503", "text": "def weapon?\n return true\n end", "title": "" }, { "docid": "00e16f2553ee543d3eb6f5cb98c5e72e", "score": "0.68355995", "text": "def sticking?\n hand_total.between?(18,21)\n end", "title": "" }, { "docid": "ebd424f205a0038ac6018d845ebbbd86", "score": "0.68310845", "text": "def busted?\n total == :bust\n end", "title": "" }, { "docid": "0e36de5fc10a66dfe91bc885a50f2fd9", "score": "0.6814676", "text": "def weapon?\n return false\n end", "title": "" }, { "docid": "0e36de5fc10a66dfe91bc885a50f2fd9", "score": "0.6814676", "text": "def weapon?\n return false\n end", "title": "" }, { "docid": "0e36de5fc10a66dfe91bc885a50f2fd9", "score": "0.6814676", "text": "def weapon?\n return false\n end", "title": "" }, { "docid": "0e36de5fc10a66dfe91bc885a50f2fd9", "score": "0.6814676", "text": "def weapon?\n return false\n end", "title": "" }, { "docid": "62b29badf13803557d954fd4fb899026", "score": "0.6801569", "text": "def bust?\n\t\tself.total_points > 21\n\tend", "title": "" }, { "docid": "386ddd95bc2e1c5cf0ed1a06ece189df", "score": "0.67993414", "text": "def lost_blu?\n :blu == winner\n end", "title": "" }, { "docid": "33d99bfc533eb1b4529407238f505f0d", "score": "0.67939067", "text": "def check_bust(hand, its_players_turn)\n\n if hand > 21\n if its_players_turn\n puts \"You bust! Game over, try again!\"\n exit\n else\n puts \"Dealer busts! You win!\"\n exit\n end\n end\n end", "title": "" }, { "docid": "5f0e8f86e2fca5b305dbd646bef6a29f", "score": "0.67906463", "text": "def blackjack?\n hand_total == BLACKJACK_AMOUNT\n end", "title": "" }, { "docid": "343e4043d9c724fe8cad30bf92d00794", "score": "0.67289925", "text": "def hungry?\n @stuff_in_belly <=2\n end", "title": "" }, { "docid": "3120a0cdf8c7a89fdca74482df85b09a", "score": "0.6696911", "text": "def is_broke?\n @chips <= 0\n end", "title": "" }, { "docid": "f3a1398514f5d57f110147e0575bfac5", "score": "0.66763526", "text": "def take_a_hit?\n if(!@turn_over)\n return count_hand < 17\n end\n end", "title": "" }, { "docid": "69aae1a7a94a6745d5d03f326fb04ffc", "score": "0.66678923", "text": "def is_cuffed?\n return weapon_id == 33\n end", "title": "" }, { "docid": "4e5299bfb27d45ee5fba2a9f783f25cf", "score": "0.6664969", "text": "def hungry?\n @stuff_in_belly <= 2\n end", "title": "" }, { "docid": "4e5299bfb27d45ee5fba2a9f783f25cf", "score": "0.6664969", "text": "def hungry?\n @stuff_in_belly <= 2\n end", "title": "" }, { "docid": "4e5299bfb27d45ee5fba2a9f783f25cf", "score": "0.6664969", "text": "def hungry?\n @stuff_in_belly <= 2\n end", "title": "" }, { "docid": "4e5299bfb27d45ee5fba2a9f783f25cf", "score": "0.6664969", "text": "def hungry?\n @stuff_in_belly <= 2\n end", "title": "" }, { "docid": "488e39dbd6f797c9f4d5e451d7134462", "score": "0.66475326", "text": "def thundering?\n isThundering\n end", "title": "" }, { "docid": "451517acf337d7f02cd97d466d3a822b", "score": "0.66471237", "text": "def hungry?\n @belly <= 2\n end", "title": "" }, { "docid": "e317023d3661fdccbd774717e32ed350", "score": "0.66316664", "text": "def holds?\n false\n end", "title": "" }, { "docid": "56ab66f1bc994fb4cf9ca4fbd8bec221", "score": "0.66316485", "text": "def hungry?\n @fullness <= 2\n end", "title": "" }, { "docid": "b765c974a2fc66fb088a90bab3d13ceb", "score": "0.6627657", "text": "def straight_flush?\n type == HandType::STRAIGHT_FLUSH\n end", "title": "" }, { "docid": "c3a0f93f5febdc26b51e4e4cdd166b05", "score": "0.66143006", "text": "def win?( hand )\n # Dealer busts and Player did not bust\n (hand.busted? && !busted?) ||\n\n # Dealer does not have blackjack and Player does\n (!hand.blackjack? && blackjack?) ||\n\n # Dealer does not have blackjack, neither Player nor Dealer busted, and\n # Player total is greater than Dealer total\n (!hand.blackjack? && !hand.busted? && !busted? && total > hand.total)\n end", "title": "" }, { "docid": "4a9c9eedd49d74fec1847f7f9aced69d", "score": "0.6601508", "text": "def helping_hand?\n @helping_hand\n end", "title": "" }, { "docid": "b5276724b40dabcc52b021cc89ddd73a", "score": "0.6572298", "text": "def bidded?\n bidded == 'true'\n end", "title": "" }, { "docid": "2c8f4181e56aaf5a64fb50d7afa3f655", "score": "0.65699387", "text": "def attack_can_use?\n # if Tons is there and using HP/SP Crush and actor\n if $tons_version != nil && $tons_version >= 6.4 &&\n $game_system.HP_SP_CRUSH && self.is_a?(Map_Actor)\n # can it be used\n return @battler.attack_can_use?\n end\n # can be used\n return true\n end", "title": "" }, { "docid": "1230aa59d3722da7cfdf10e4920cf509", "score": "0.6551614", "text": "def cannonmastery_check?\n if shootingblind<3\n return true\n end\n end", "title": "" }, { "docid": "c40e92d7d554ff7f3e48b03b212022c8", "score": "0.65320283", "text": "def can_drag_under?\n return self.stats[:strength] - second_weakest.stats[:defense] / 2 > gap(second_weakest)\n end", "title": "" }, { "docid": "a5e884eeac9a99cb27febe311011db45", "score": "0.65243053", "text": "def hungary?\n @stuffInBelly <=2\n end", "title": "" }, { "docid": "f2fac5d0865ed89d712e14a9c1ee0930", "score": "0.6513881", "text": "def battling?\n \t if @type =~ /monster/\n \t @battling == true\n \t else\n \t return false\n \t end\n \tend", "title": "" }, { "docid": "c4c0e4d16486002f3dc7c0ff21e7f272", "score": "0.6502944", "text": "def hungry?\n\t\t\t@health < @world.options[:af]/2\n\t\tend", "title": "" }, { "docid": "84952dab41fc96f07dad2ac0b4ee0842", "score": "0.6501068", "text": "def from_battle? ; @battles and @battles > 0 end", "title": "" }, { "docid": "96f73cbf50c81b80d383cedecaa5ea11", "score": "0.6492016", "text": "def is_round_over?\n users.find { |u| value(u.hand(self)) >= 21 } || (users.find { |u| u.has_stood == true }) != nil\n end", "title": "" }, { "docid": "bbc419d588a9ffd0465b849da1415d9f", "score": "0.6490555", "text": "def checkweap(weapon)\n\tif (weapon == 'rock' or weapon == 'paper' or weapon == 'scissors')\n\t\treturn true\n\telse\n\t\treturn false\n\tend\nend", "title": "" }, { "docid": "e43ec14e74939d61f700b99963310271", "score": "0.6490277", "text": "def high_card?\n true # Every hand has a high card.\n end", "title": "" }, { "docid": "63ea76325d2491ba01f41d4f92a15082", "score": "0.6489377", "text": "def hungry?\n @stuffInBelly <= 2\n end", "title": "" }, { "docid": "4306852f8c6614da9402ee1b686b59b9", "score": "0.6483084", "text": "def wild_royal?\n sh[0].face - wilds <= 10 && flush? && straight? && wilds >= 1\n end", "title": "" }, { "docid": "6f9faa80cb71488db83a6f067cbbd713", "score": "0.6473627", "text": "def has_powered_up?\r\n if Gosu.distance(@player.get_x, @player.get_y, @insect.get_x, @insect.get_y)< 35 && @has_been_eaten == false\r\n @player.speed 1\r\n @bug.play(1,1,false)\r\n\r\n @insect.eaten\r\n @has_been_eaten = true\r\n end\r\n end", "title": "" }, { "docid": "fdeed4660f12edcc9f8403aec6458a52", "score": "0.6470052", "text": "def canSurrender\n if @hands.length == 1\n true\n end\n end", "title": "" }, { "docid": "13226795a7805d7f0b6c5f7694c4a96a", "score": "0.64605814", "text": "def biggun?(weapon)\n [:lascannon, :heavybolter, :krakmissle].include?(weapon.type.to_sym)\n end", "title": "" }, { "docid": "203c4ddb6aa9c1858463713061a0c5e7", "score": "0.6446325", "text": "def in_boat?\r\n @vehicle_type == :boat\r\n end", "title": "" }, { "docid": "e19880c125bb23d09212cad2ef363339", "score": "0.6442776", "text": "def check_for_tobolon(hand)\r\n count = 0\r\n set_den = false\r\n hand.each do |card|\r\n if @deck_information.get_card_segno(card) == :S\r\n count += 1\r\n end\r\n if @deck_information.get_card_logical_symb(card) == :set and \r\n @deck_information.get_card_segno(card) == :D\r\n set_den = true\r\n end\r\n end\r\n if count == 10 and hand.size > 20 and set_den\r\n # onori e 10 spade: tobolon\r\n return true\r\n end\r\n return false\r\n end", "title": "" }, { "docid": "7a4d8455c9bfd4226991dd83f0e09dd4", "score": "0.6438859", "text": "def has_appropriate_weapon?; end", "title": "" }, { "docid": "1c6817d82f4557e759d4eed41f0870a0", "score": "0.64369494", "text": "def dealer_blackjack?\n self.dealer_hand.sum == 21\n end", "title": "" }, { "docid": "6006e8b3fce467953bf87f5d14322b82", "score": "0.64285564", "text": "def can_go?\n @available_bike_stands > 0 and not @available_bike_stands # test si nil quand pas de velo\n end", "title": "" }, { "docid": "125780859b42aa4df81dc955331fe447", "score": "0.6427736", "text": "def royal_flush?\n straight? and flush? and self.cards[0] == TEN\n end", "title": "" }, { "docid": "88e97182403523e6c05728782170cb25", "score": "0.6419501", "text": "def battler?\n return true\n end", "title": "" }, { "docid": "b9321137dfed370ea0c28bb7cb6c3a73", "score": "0.6414298", "text": "def blackjack?\n @hand.length == 2 && value == 21\n end", "title": "" }, { "docid": "a8cde403dfc45c5d2550a3f75fcd9c03", "score": "0.6412932", "text": "def busy?\n BusyPhases.any? {|phase| battle_phase == phase }\n end", "title": "" }, { "docid": "a8cde403dfc45c5d2550a3f75fcd9c03", "score": "0.6412932", "text": "def busy?\n BusyPhases.any? {|phase| battle_phase == phase }\n end", "title": "" }, { "docid": "0dee94edc1fb6fe4a07e75c05e1e1039", "score": "0.641084", "text": "def high_card?\n type == HandType::HIGH_CARD\n end", "title": "" }, { "docid": "9f00f703e9ea3e95829f5cb7dbd62d1c", "score": "0.64050186", "text": "def dealer_blackjack\n @dealers_hand.value == 21\n end", "title": "" }, { "docid": "1d61abbc16272a8ab49124df55f68a2e", "score": "0.6397336", "text": "def two_hands_legal?\n if weapons[0] != nil and weapons[0].two_handed\n return false if @armor1_id != 0\n end\n if weapons[1] != nil and weapons[1].two_handed\n return false if @weapon_id != 0\n end\n return true\n end", "title": "" }, { "docid": "be9e345304b307b860bd85b00148b02c", "score": "0.6388313", "text": "def strong?\r\n @health > 100\r\n end", "title": "" }, { "docid": "5d8a45f35e0e6ba123758e26ca9c961b", "score": "0.6387114", "text": "def bulge?\n !hairpin? && !internal_loop? && base_pair_part? && @bases.any?\n end", "title": "" }, { "docid": "a422c02772e32606d4e3ac3045888910", "score": "0.638445", "text": "def battler?\n return false\n end", "title": "" }, { "docid": "a422c02772e32606d4e3ac3045888910", "score": "0.638445", "text": "def battler?\n return false\n end", "title": "" }, { "docid": "a422c02772e32606d4e3ac3045888910", "score": "0.638445", "text": "def battler?\n return false\n end", "title": "" }, { "docid": "a422c02772e32606d4e3ac3045888910", "score": "0.638445", "text": "def battler?\n return false\n end", "title": "" }, { "docid": "6977f08143cc2aeea534fa6a8f753992", "score": "0.6383524", "text": "def canConsumeBerry?\r\n return false if @battle.pbCheckOpposingAbility(:UNNERVE,@index)\r\n return false if @battle.pbCheckOpposingAbility(:ASONEICE,@index)\r\n return false if @battle.pbCheckOpposingAbility(:ASONEGHOST,@index)\r\n return true\r\n end", "title": "" }, { "docid": "f177627d99cfb3d13350ad14aeca13b2", "score": "0.6378354", "text": "def is_cheating?\n return true if @wealth <= 0\n false\n end", "title": "" }, { "docid": "cc33182846078c66073b0986e961d4a8", "score": "0.63704157", "text": "def weapon?\n melee_weapon? or ranged_weapon?\n end", "title": "" }, { "docid": "afccb586ba18080c042385976d1859fc", "score": "0.6368957", "text": "def dealer_bj?\n cards[1].face = 'up'\n puts say(\"The face down card is #{cards[1].suit} #{cards[1].value}\")\n if points.include?(21)\n true\n else\n false\n end\n end", "title": "" }, { "docid": "6c79a79d7e224fe41eb98f8da40a22d3", "score": "0.6360193", "text": "def can_dbl_down?(hand)\r\n\t\treturn true if hand.hand_value == 9 || hand.hand_value == 10 || hand.hand_value == 11\r\n\tend", "title": "" }, { "docid": "97afd786d9440b91116c41fbff87a045", "score": "0.635108", "text": "def hard?\n @cards.include_suit?(:ace)\n end", "title": "" } ]
d538f3af74c937906ea9449464b493f8
POST /cotizaciones POST /cotizaciones.json
[ { "docid": "9bbc45fca79da2d36828649f6a341286", "score": "0.6722342", "text": "def create\n @cotizacione = Cotizacione.new(cotizacione_params)\n\n respond_to do |format|\n if @cotizacione.save\n format.html { redirect_to @cotizacione, notice: 'Cotizacione was successfully created.' }\n format.json { render :show, status: :created, location: @cotizacione }\n else\n format.html { render :new }\n format.json { render json: @cotizacione.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "52f3f6d2cd935e511c15b789adecb251", "score": "0.6617825", "text": "def cotizacione_params\n params.require(:cotizacione).permit(:token, :paqueteria, :producto, :precio)\n end", "title": "" }, { "docid": "ee226da0ece4da26429fb1e43fbb7624", "score": "0.6404725", "text": "def create\n @congresso = Congresso.new(congresso_params)\n\n respond_to do |format|\n if @congresso.save\n format.html { redirect_to @congresso, notice: 'Congresso was successfully created.' }\n format.json { render :show, status: :created, location: @congresso }\n else\n format.html { render :new }\n format.json { render json: @congresso.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0b6cb1787082d34904df80be597471ca", "score": "0.63236785", "text": "def create\n @taco = Taco.new(taco_params)\n\n respond_to do |format|\n if @taco.save\n format.html { redirect_to @taco, notice: 'Taco was successfully created.' }\n format.json { render :show, status: :created, location: @taco }\n else\n format.html { render :new }\n format.json { render json: @taco.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "970494429dd5d85e4ba7a46af37c123b", "score": "0.62964344", "text": "def tecnicos_postulados\n coleccion = []\n self.request.each do |request|\n info = {}\n info[:id] = request.id\n info[:article] = request.article\n info[:servicio] = request.service.description\n info[:tecnicos] = request.proposal\n coleccion.append(info)\n end\n coleccion\n end", "title": "" }, { "docid": "74a25ecbbf105955fb2014b97be35575", "score": "0.62950236", "text": "def troca\n @remetente = Sobrevivente.where(id: params[:de]).first\n @destinatario = Sobrevivente.where(id: params[:para]).first\n\n enviar = {agua: 1, comida: 2, medicamento: 3, municao: 4}\n receber = {agua: 0, comida: 2, medicamento: 3, municao: 8}\n\n trocou = @remetente.troca(@destinatario, enviar, receber)\n\n render json: { status: trocou }\n end", "title": "" }, { "docid": "52c969aeb9a94412ef02d3a06a45cf51", "score": "0.62934774", "text": "def create\n @intranet_financeiro_tipos_cobanca = Intranet::FinanceiroTiposCobanca.new(intranet_financeiro_tipos_cobanca_params)\n\n respond_to do |format|\n if @intranet_financeiro_tipos_cobanca.save\n format.html { redirect_to @intranet_financeiro_tipos_cobanca, notice: \"Financeiro tipos cobanca was successfully created.\" }\n format.json { render :show, status: :created, location: @intranet_financeiro_tipos_cobanca }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @intranet_financeiro_tipos_cobanca.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a6ddfb641b23c7b46a9b9f578b01f085", "score": "0.62357837", "text": "def create\n @pagos_servicio = PagosServicio.new(pagos_servicio_params)\n respond_to do |format|\n if @pagos_servicio.save\n @caja = Caja.where(estado: 0).last\n @mov_caja = MovCaja.create!(caja_id: @caja.id, concepto: @pagos_servicio.servicio, ingreso: 0, egreso: @pagos_servicio.monto, saldo: @caja.cierre.to_i - @pagos_servicio.monto.to_i)\n @caja.update(cierre: @caja.cierre.to_i - @pagos_servicio.monto.to_i, salida: @caja.salida.to_i + @pagos_servicio.monto.to_i)\n format.html { redirect_to @pagos_servicio, notice: 'Se ha registrado el pago correctamente.' }\n format.json { render :show, status: :created, location: @pagos_servicio }\n else\n format.html { render :new }\n format.json { render json: @pagos_servicio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3300483a255bab0bdbc85ed5aac41b2c", "score": "0.6228839", "text": "def create\n @tecnico = Tecnico.new(params[:tecnico])\n\n respond_to do |format|\n if @tecnico.save\n format.html { redirect_to @tecnico, :notice => 'Tecnico was successfully created.' }\n format.json { render :json => @tecnico, :status => :created, :location => @tecnico }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @tecnico.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4d5176dcd540b61ba9cc58deba954e30", "score": "0.6182835", "text": "def create\n @consorciot = Consorciot.new(consorciot_params)\n\n respond_to do |format|\n if @consorciot.save\n format.html { redirect_to @consorciot, notice: 'Consorciot was successfully created.' }\n format.json { render :show, status: :created, location: @consorciot }\n else\n format.html { render :new }\n format.json { render json: @consorciot.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9a152b135c03391e4dee14f311588327", "score": "0.6165782", "text": "def create\n @cotact = Cotact.new(cotact_params)\n\n respond_to do |format|\n if @cotact.save\n format.html { redirect_to @cotact, notice: 'Cotact was successfully created.' }\n format.json { render :show, status: :created, location: @cotact }\n else\n format.html { render :new }\n format.json { render json: @cotact.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f57fded358fd50ccfcf8b1cba07553ce", "score": "0.61295444", "text": "def create\n @centro_costo = CentroCosto.new(centro_costo_params)\n\n respond_to do |format|\n if @centro_costo.save\n format.html { redirect_to centro_costos_path, notice: 'Centro de Costo creado exitosamente' }\n format.json { render :show, status: :created, location: @centro_costo }\n else\n format.html { render :new }\n format.json { render json: @centro_costo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "61f40dc7b83891e05cd94e785df96f66", "score": "0.61171657", "text": "def create\n @servico_pacote = Servico::Pacote.new(servico_pacote_params)\n\n respond_to do |format|\n if @servico_pacote.save\n format.html { redirect_to @servico_pacote, notice: 'Pacote was successfully created.' }\n format.json { render action: 'show', status: :created, location: @servico_pacote }\n else\n format.html { render action: 'new' }\n format.json { render json: @servico_pacote.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fd04a4562573aae3104797c15f7bad37", "score": "0.61066896", "text": "def create\n @conta = Conta.new(conta_params)\n\n # @conta.correntista = Correntista.find(params[:id])\n respond_to do |format|\n if @conta.save\n format.html { redirect_to correntista_conta_index_path, notice: 'Conta was successfully created.' }\n format.json { render :show, status: :created, location: @conta }\n else\n format.html { render :new }\n format.json { render json: @conta.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e6e06288b6236545ca207ec2d170fa37", "score": "0.61017174", "text": "def create\n @copropietario = Copropietario.new(copropietario_params)\n\n respond_to do |format|\n if @copropietario.save\n format.html { redirect_to @copropietario, notice: 'Copropietario was successfully created.' }\n format.json { render :show, status: :created, location: @copropietario }\n else\n format.html { render :new }\n format.json { render json: @copropietario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ce508a0e3a1d5bea514c5541e7649ed4", "score": "0.60914356", "text": "def create\n @tecnico = Tecnico.new(params[:tecnico])\n\n respond_to do |format|\n if @tecnico.save\n format.html { redirect_to @tecnico, notice: 'Tecnico criado com sucesso.' }\n format.json { render json: @tecnico, status: :created, location: @tecnico }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tecnico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "656d3edff51461c59d3068f4f39d96b9", "score": "0.6082947", "text": "def create\n @ccosto = Ccosto.new(ccosto_params)\n\n respond_to do |format|\n if @ccosto.save\n format.html { redirect_to @ccosto, notice: 'Ccosto was successfully created.' }\n format.json { render :show, status: :created, location: @ccosto }\n else\n format.html { render :new }\n format.json { render json: @ccosto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6603684665de7672711be94e8f72906c", "score": "0.60797864", "text": "def asignar_curso\n render :json => Profesor.asignar_curso(params)\n end", "title": "" }, { "docid": "5c099a828d1b89904c77f79cbd537130", "score": "0.6075788", "text": "def create\n @comentario = @comentavel.comentarios.create(comentario_params)\n @comentario.usuario = current_user\n respond_to do |format|\n if @comentario.save\n response_successfully(format, produto, 'Comentario was successfully created.', :show, :created)\n else\n response_unsuccessfully(format, :new, @comentario, :unprocessable_entity)\n end\n end\n end", "title": "" }, { "docid": "42d7a532f1d6503179689661ab34b193", "score": "0.6067353", "text": "def contato_params\n params.require(:contato).permit(:nome, :email, :idade, :estado_id, :cargo)\n end", "title": "" }, { "docid": "cbaeb13a1edbd962dc90f9f633e8ecba", "score": "0.6058591", "text": "def create\n @contract = Contrato.new(contract_params)\n\n respond_to do |format|\n if @contract.save\n format.html { redirect_to @contract, notice: 'Contract was successfully created.' }\n format.json { render :show, status: :created, location: @contract }\n else\n format.html { render :new }\n format.json { render json: @contract.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5a1f17553125e027c3bb6b1ae89900c8", "score": "0.6049459", "text": "def create\n @consumo = Consumo.new(params[:consumo])\n\n respond_to do |format|\n if @consumo.save\n format.html { redirect_to @consumo.cliente, :notice => 'Consumo adicionado com sucesso.' }\n format.json { render :json => @consumo, :status => :created, :location => @consumo }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @consumo.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e77f3f9efe952a9419cc1c1e4c45b999", "score": "0.6049214", "text": "def create\n @cegreso = Cegreso.new(cegreso_params)\n\n respond_to do |format|\n if @cegreso.save\n format.html { redirect_to @cegreso, notice: 'Cegreso was successfully created.' }\n format.json { render :show, status: :created, location: @cegreso }\n else\n format.html { render :new }\n format.json { render json: @cegreso.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "80397f58ed3b945292c70365181dc2a0", "score": "0.60339105", "text": "def create\n @tipo_comunicacao = TipoComunicacao.new(tipo_comunicacao_params)\n\n respond_to do |format|\n if @tipo_comunicacao.save\n format.html { redirect_to @tipo_comunicacao, notice: 'Tipo comunicacao was successfully created.' }\n format.json { render :show, status: :created, location: @tipo_comunicacao }\n else\n format.html { render :new }\n format.json { render json: @tipo_comunicacao.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "86bfe3482be36e20e5f569aef638480b", "score": "0.6020393", "text": "def create\n @cta_cte = CtaCte.new(cta_cte_params)\n\n respond_to do |format|\n if @cta_cte.save\n format.html { redirect_to @cta_cte, notice: 'Se creo correctamente.' }\n format.json { render :show, status: :created, location: @cta_cte }\n else\n format.html { render :new }\n format.json { render json: @cta_cte.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "44cfa8b7b1569f32910f170261be955b", "score": "0.6013261", "text": "def create\n @caso = Caso.new(caso_params)\n\n respond_to do |format|\n if @caso.save\n format.html { redirect_to @caso, notice: 'Caso creado con éxito.' }\n format.json { render action: 'show', status: :created, location: @caso }\n else\n format.html { render action: 'new' }\n format.json { render json: @caso.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "659eebbdddca82b3703328cdf3350232", "score": "0.59898233", "text": "def create\n @cto = Cto.new(cto_params)\n\n respond_to do |format|\n if @cto.save\n format.html { redirect_to @cto, notice: 'Cto was successfully created.' }\n format.json { render action: 'show', status: :created, location: @cto }\n else\n format.html { render action: 'new' }\n format.json { render json: @cto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "75bbf387bf913bd859407addd79bfdf5", "score": "0.59866595", "text": "def create\n @caso = Caso.new(caso_params)\n\n respond_to do |format|\n if @caso.save\n format.html { redirect_to @caso, notice: 'Caso was successfully created.' }\n format.json { render :show, status: :created, location: @caso }\n else\n format.html { render :new }\n format.json { render json: @caso.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b686af8991a24415f364a0c2d70b7736", "score": "0.598323", "text": "def create\n @colegiatura = Colegiatura.new(params[:colegiatura])\n\n respond_to do |format|\n if @colegiatura.save\n format.html { redirect_to @colegiatura, notice: 'Colegiatura was successfully created.' }\n format.json { render json: @colegiatura, status: :created, location: @colegiatura }\n else\n format.html { render action: \"new\" }\n format.json { render json: @colegiatura.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "841dad482b86cf5d0fe34682edef4d9a", "score": "0.5979217", "text": "def create\n @anteproyecto_observacion = AnteproyectoObservacion.new(anteproyecto_observacion_params)\n\n respond_to do |format|\n if @anteproyecto_observacion.save\n format.html { redirect_to @anteproyecto_observacion, notice: 'Anteproyecto observacion was successfully created.' }\n format.json { render :show, status: :created, location: @anteproyecto_observacion }\n else\n format.html { render :new }\n format.json { render json: @anteproyecto_observacion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5d98d1347435fc0c72343819ad25d41f", "score": "0.59750384", "text": "def create\n @objeto = Cita.new(cita_params)\n\n respond_to do |format|\n if @objeto.save\n format.html { redirect_to @objeto, notice: \"Cita was successfully created.\" }\n format.json { render :show, status: :created, location: @objeto }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2dd3fb2b49fd42aa9909f4bc05a9fe31", "score": "0.5971299", "text": "def putFactura(oc)\n\n facturax= JSON.parse(HTTP.headers(:\"Content-Type\" => \"application/json\").put(\"http://\"+ $url +\"/facturas/\", :json => {:oc => oc}).to_s, :symbolize_names => true)\n return facturax\n end", "title": "" }, { "docid": "3f465e100e93158f70ca5b3ce55ea4d3", "score": "0.59689647", "text": "def create\n @secco = @curso.seccos.build(secco_params)\n\n respond_to do |format|\n if @secco.save\n format.html { redirect_to curso_secco_path(@curso, @secco), notice: 'Seccao was successfully created.' }\n format.json { render :show, status: :created, location: @secco }\n else\n format.html { render :new }\n format.json { render json: @secco.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "86886106bc5360e3c08f5d9d95e5f556", "score": "0.5968094", "text": "def create\n @cooco = Cooco.new(cooco_params)\n\n respond_to do |format|\n if @cooco.save\n format.html { redirect_to @cooco, notice: 'Cooco was successfully created.' }\n format.json { render :show, status: :created, location: @cooco }\n else\n format.html { render :new }\n format.json { render json: @cooco.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "525fc3e2932eb799bcad2565f6990a54", "score": "0.5967748", "text": "def contato_params\n params.require(:contato).permit(:nome, :cargo, :telefone, :celular, :email, :facebook, :linkedin, :googleplus, :cliente_potencial_id)\n end", "title": "" }, { "docid": "46f6256947eb7d046eccd64531e34c5a", "score": "0.5960843", "text": "def create \n pai = params[:pai] ? Conta.find_by_id(params[:pai]): nil\n @conta = Conta.new(nome: params[:nome], status: params[:status])\n @conta.pai = pai\n @conta.data_criacao = Time.now\n \n respond_to do |format|\n if @conta.save\n #format.html { redirect_to @conta, notice: 'Conta was successfully created.' }\n #format.json { render :show, status: :created, location: @conta }\n format.json { render json: @conta.to_json, status: :created }\n #@conta.to_json\n else\n #format.html { render :new }\n format.json { render json: @conta.errors, status: :unprocessable_entity } \n end\n end\n end", "title": "" }, { "docid": "b733ccdc7613d0722abee746c5e15ede", "score": "0.5959679", "text": "def create\n @tecido = Tecido.new(tecido_params)\n\n respond_to do |format|\n if @tecido.save\n format.html { redirect_to @tecido, notice: 'Tecido was successfully created.' }\n format.json { render :show, status: :created, location: @tecido }\n else\n format.html { render :new }\n format.json { render json: @tecido.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f3695dd46f87e9631ee6677e3ab712b9", "score": "0.5959223", "text": "def create\n @contato = Contato.new(contato_params)\n\n respond_to do |format|\n if @contato.save\n format.html { redirect_to @contato, flash: { success: 'Contato was successfully created.' } }\n format.json { render :show, status: :created, location: @contato }\n else\n format.html { render :new }\n format.json { render json: @contato.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "40628862abd30c04a6ec89d5a803491c", "score": "0.5955346", "text": "def create\n @curso = Curso.new(curso_params)\n\n respond_to do |format|\n if @curso.save\n format.json { render json: \"Curso Creado\", status: :created }\n else\n format.json { render json: @curso.errors}\n end\n end\n end", "title": "" }, { "docid": "98fa58a0d3edb19f8ec3501cd445d4ec", "score": "0.595509", "text": "def create\n @tapioca = Tapioca.new(tapioca_params)\n\n respond_to do |format|\n if @tapioca.save\n format.html { redirect_to @tapioca, notice: 'Tapioca was successfully created.' }\n format.json { render action: 'show', status: :created, location: @tapioca }\n else\n format.html { render action: 'new' }\n format.json { render json: @tapioca.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fb4b03ae53f285a850b01f440664e3dd", "score": "0.5950599", "text": "def create\n @comentario = Comentario.new(comentario_params)\n\n respond_to do |format|\n if @comentario.save\n format.html { redirect_to restaurante_comentarios_path(@comentario), notice: 'Plato was successfully created.' }\n format.json { render :show, status: :created, location: @restaurante }\n else\n format.html { render :new }\n format.json { render json: @comentario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f0d1e572e71315a39e509a33cc56a77c", "score": "0.59475607", "text": "def create\n @contatos_cliente = ContatosCliente.new(contatos_cliente_params)\n\n respond_to do |format|\n if @contatos_cliente.save\n format.html { redirect_to @contatos_cliente, notice: 'Contatos cliente was successfully created.' }\n format.json { render :show, status: :created, location: @contatos_cliente }\n else\n format.html { render :new }\n format.json { render json: @contatos_cliente.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3d949886afc808c6cd9cd2a53452969c", "score": "0.5944646", "text": "def create\n @tipos_contato = TiposContato.new(tipos_contato_params)\n\n respond_to do |format|\n if @tipos_contato.save\n format.html { redirect_to @tipos_contato, notice: 'Tipos contato was successfully created.' }\n format.json { render :show, status: :created, location: @tipos_contato }\n else\n format.html { render :new }\n format.json { render json: @tipos_contato.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "795488080d7bf78d42acd600bd3843b9", "score": "0.594398", "text": "def create\n if params[:get]\n @plato = Plato.where(\"soda_id = ?\", params[:soda_id])\n\n #if [email protected]?\n # render json: @plato.as_json(only: [:id, :nombre, :precio, :categoria, :tipo, :calificaciones, :total, :soda_id], include: [comentario:{only: [:id]}])\n #else\n render json: @plato.as_json(only: [:id, :nombre, :precio, :categoria, :tipo, :calificaciones, :total, :soda_id])\n #end\n\n else\n @plato = Plato.new(plato_params)\n\n if @plato.save\n render json: @plato, status: :created, location: @plato\n else\n render json: @plato.errors, status: :unprocessable_entity\n end\n end\n\n end", "title": "" }, { "docid": "a39ba850ccb9cc0530ddbf7e09989f66", "score": "0.5942521", "text": "def confirmer_cart\n _user = current_client\n _confirmation = rand(36**10).to_s(36)\n _cart = Commande.new()\n _cart.client_id = _user.id\n if params[:addr_id] != '-1'\n _cart.adresse_id = params[:addr_id]\n else\n _cart.adresse_id = client_adresse.id \n end\n _cart.no_confirmation = _confirmation\n _cart.date_de_commande = params[:date_de_commande]\n _cart.heure_de_commande = params[:heure_de_commande]\n _cart.prix_total = params[:prix_total]\n _cart.status_pret = false\n _cart.save\n render json: _cart\n end", "title": "" }, { "docid": "bc6796db82efb3dd44c32de9d3147fa5", "score": "0.5930921", "text": "def create\n @cta = Cta.new(cta_params)\n\n respond_to do |format|\n if @cta.save\n format.html { redirect_to @cta, notice: 'cta was successfully created.' }\n format.json { render action: 'show', status: :created, location: @cta }\n else\n format.html { render action: 'new' }\n format.json { render json: @cta.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "006905f42efb9f06cdbe3ad4d6d28c18", "score": "0.5925851", "text": "def create\n @tipocosto = Tipocosto.new(tipocosto_params)\n\n respond_to do |format|\n if @tipocosto.save\n format.html { redirect_to @tipocosto, notice: 'Tipocosto was successfully created.' }\n format.json { render :show, status: :created, location: @tipocosto }\n else\n format.html { render :new }\n format.json { render json: @tipocosto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "24cea2079b18bb253d9ca35f601c7208", "score": "0.5923566", "text": "def create\n @cuota_curso = CuotaCurso.new(cuota_curso_params)\n\n respond_to do |format|\n if @cuota_curso.save\n format.html { redirect_to @cuota_curso, notice: 'La cuota del curso se creó correctamente.' }\n format.json { render :show, status: :created, location: @cuota_curso }\n else\n format.html { render :new }\n format.json { render json: @cuota_curso.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ad1792f4944004c67108cfb79e650eac", "score": "0.5922545", "text": "def create\n @comentario = current_user.comentarios.build(params[:comentario]) # Asigna solo si comentario asociado a current_user\n\n respond_to do |format|\n if @comentario.save\n format.html { redirect_to @comentario.site, notice: 'Comentario was successfully created.' }\n format.json { render json: @comentario.site, status: :created, location: @comentario }\n else\n format.html { render action: \"new\" }\n format.json { render json: @comentario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3cfe5d07b9cf6e09ad56ad99219b8a43", "score": "0.59159607", "text": "def create\n @cotiz_clo_mul = CotizCloMul.new(cotiz_clo_mul_params)\n\n respond_to do |format|\n if @cotiz_clo_mul.save\n GeneradorCorreoMailer.confirmarCotizCloMul(@cotiz_clo_mul).deliver_now\n format.html { redirect_to @cotiz_clo_mul, notice: 'Cotiz clo mul was successfully created.' }\n format.json { render :show, status: :created, location: @cotiz_clo_mul }\n else\n format.html { render :new }\n format.json { render json: @cotiz_clo_mul.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a95c17798974f8c915a766e1b39fe5e7", "score": "0.5915266", "text": "def create\n @concurso = Concurso.new(params[:concurso])\n\n respond_to do |format|\n if @concurso.save\n format.html { redirect_to @concurso, notice: 'Concurso criado com sucesso.' }\n format.json { render json: @concurso, status: :created, location: @concurso }\n else\n format.html { render action: \"new\" }\n format.json { render json: @concurso.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "47e7913551272f0eaf9bb1a59223d352", "score": "0.5907816", "text": "def create\n @concurso = Concurso.new(concurso_params)\n\n respond_to do |format|\n if @concurso.save\n format.html { redirect_to @concurso, notice: 'Concurso ha sido creado correctamente.' }\n format.json { render :show, status: :created, location: @concurso }\n else\n format.html { render :new }\n format.json { render json: @concurso.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3dedf943682d91da7dc655c71f60716f", "score": "0.59005296", "text": "def recibir\n #obtener la orden de compra con el id que nos envía el otro grupo.\n id = params[:id]\n id_store_reception = JSON.parse(request.body.read.to_s)\n id_store_reception = id_store_reception[\"id_store_reception\"]\n @result = HTTParty.get(OC_URI + 'obtener/' + id, :query => {}, :header => OPT)\n puts @result\n #Reviso si el id ingresado es valido para que oc no tire error\n if !@result[0]['created_at'].nil? then\n oc = @result[0]\n cliente = oc[\"cliente\"]\n cliente = IDS[cliente].to_s\n #una vez recibida la orden de compra hay que ver si la aceptamos o no\n #de momento no me preocuparía de ver si podemos comprar otras materias primas para producir y cumplir ordenes de comora\n if accept_general?(oc)\n accept(id, cliente)#esto le avisa a la api del profe y al otro grupo que aceptamos la oc\n @purchase_order = PurchaseOrder.new(oc) #si aceptamos la OC la guardamos en nuestro modelo.\n @purchase_order.save\n fact = createInvoice(oc[\"_id\"])\n #se le manda al grupo comprador la factura que acabamos de crear y nuestra cuenta de banco\n HTTParty.put(GURI + cliente + \".ing.puc.cl/invoices/\" + fact[0][\"_id\"], headers: GOPT, body:{\"bank_account\" => CTA})\n #poner en cola\n order = Order.new(oc:oc['_id'], total:Integer(oc['cantidad']), sku:oc['sku'], due_date:oc['fechaEntrega'], client:oc['cliente'], price:Integer(oc['precioUnitario']), destination: id_store_reception, state:\"accepted\")\n order.save\n render json: {'Message': \"Orden creada, aceptada y facturada\"}\n\n else\n reject(id, '', cliente)\n render json: {'Message': \"Orden rechazada\"}\n end\n else\n render status: 500, json:{\n Message: 'Declined: failed to process order, we need more details'\n }\n end\n end", "title": "" }, { "docid": "cfca103cb882c020385d18753b2f69d6", "score": "0.5894801", "text": "def create\n \n respond_to do |format|\n \n if @citum.save\n format.html { redirect_to @citum, notice: 'Cita creada exitosamente.' }\n format.json { render :show, status: :created, location: @citum }\n else\n format.html { render :new }\n format.json { render json: @citum.errors, status: :unprocessable_entity }\n end \n \n end\n end", "title": "" }, { "docid": "00dbc9eccf1f770b8ef859e3c0938d08", "score": "0.5890658", "text": "def create\n @cuenta = Cuenta.new(cuenta_params)\n\n respond_to do |format|\n if @cuenta.save\n format.html { redirect_to @cuenta, notice: 'Cuenta was successfully created.' }\n format.json { render :show, status: :created, location: @cuenta }\n else\n format.html { render :new }\n format.json { render json: @cuenta.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "67e6cb08d173b17cb492b4eebc6596ae", "score": "0.5889215", "text": "def crear_cuotas\n case params[:adquisicion][:tipo_pago].to_s\n when TIPOS_PAGO[:unico].to_s\n @adquisicion.cuotas.destroy_all\n cuotas = params[:cant_cuotas]\n monto_cuota = @adquisicion.precio / cuotas.to_d\n cuotas.to_i.times do |i|\n @adquisicion.cuotas.create(monto: monto_cuota, concepto: \"Cuota #{i}\")\n end\n when TIPOS_PAGO[:recurrente].to_s\n @adquisicion.cuotas.destroy_all\n meses = params[:cant_meses]\n hoy = Time.zone.today\n dia = params[:dia_del_mes]\n mes = Time.zone.today.month\n ano = Time.zone.today.year\n fecha = Date.new(ano, mes, dia.to_i)\n hoy > fecha ? fecha += 1.month : nil\n meses.to_i.times do |i|\n @adquisicion.cuotas.create(concepto: \"Cuota #{i + 1}\", fecha_vencimiento: fecha, monto: params[:adquisicion][:precio])\n fecha += 1.month\n # mes += 1\n end\n end\n # params[:adquisicion].delete(:cuotas_attributes)\n end", "title": "" }, { "docid": "e7c0c9ba8a952a9b128465da5219c10b", "score": "0.588895", "text": "def conta_params\n params.require(:conta).permit(:correntista_id, :flag_ativo, :created_at, :updated_at, :saldo, :saldoProvisorio)\n end", "title": "" }, { "docid": "b6019c927c11613a175bce848096dc6a", "score": "0.5883007", "text": "def create\n #Parámetros permitidos.\n pago_params\n\n #Asignación de variables.\n fact = params[:pago][:factura_id]\n fecha = params[:pago][:fechapago]\n factura = Factura.find_by(id: fact)\n\n #Editar pago.\n @pago = Pago.new\n @pago.factura_id = fact\n @pago.fechapago = fecha\n @pago.monto = factura.total\n\n respond_to do |format|\n if @pago.save\n #Inserción en la cuenta corriente cliente por el haber.\n ctactecli = Ctactecli.find_by(cliente_id: factura.cliente_id)\n detallectactecli = Detallectactecli.new\n detallectactecli.ctactecli_id = factura.cliente_id\n detallectactecli.fechadetalle = Date.today\n detallectactecli.tipodetalle = 'Crédito por factura'\n detallectactecli.haber = factura.total\n detallectactecli.save\n ctactecli.saldo = ctactecli.saldo - factura.total\n ctactecli.save\n\n format.json { render :show, status: :created, location: @pago }\n puts'Pago guardado'\n #format.html { redirect_to @pago, notice: 'Pago was successfully created.' }\n else\n format.json { render json: @pago.errors, status: :unprocessable_entity }\n puts'Pago no guardado'\n #format.html { render :new }\n end\n end\n end", "title": "" }, { "docid": "58acc692414d3e3b1e89d3f61722f55b", "score": "0.58775234", "text": "def create\n @tema_curso = TemaCurso.new(tema_curso_params)\n\n respond_to do |format|\n if @tema_curso.save\n format.html { redirect_to @tema_curso, notice: 'Tema do curso criado com sucesso!' }\n format.json { render :show, status: :created, location: @tema_curso }\n else\n format.html { render :new }\n format.json { render json: @tema_curso.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2b778e639ade184358473be5f8c8cb6c", "score": "0.58697075", "text": "def create\n @tobacco = Tobacco.new(tobacco_params)\n\n respond_to do |format|\n if @tobacco.save\n format.html { redirect_to @tobacco, notice: 'Tobacco was successfully created.' }\n format.json { render :show, status: :created, location: @tobacco }\n else\n format.html { render :new }\n format.json { render json: @tobacco.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9eac7ad36c7447de1df30c44e0666424", "score": "0.5868099", "text": "def create\n @prod_coti = ProdCoti.new(prod_coti_params)\n\n respond_to do |format|\n if @prod_coti.save\n format.html { redirect_to @prod_coti, notice: 'Prod coti was successfully created.' }\n format.json { render :show, status: :created, location: @prod_coti }\n else\n format.html { render :new }\n format.json { render json: @prod_coti.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aa18e2325220b194f521d251a67b8b71", "score": "0.5863744", "text": "def create\n @inventario_cosa = InventarioCosa.new(inventario_cosa_params)\n\n respond_to do |format|\n if @inventario_cosa.save\n format.html { redirect_to @inventario_cosa, notice: 'Inventario cosa was successfully created.' }\n format.json { render :show, status: :created, location: @inventario_cosa }\n else\n format.html { render :new }\n format.json { render json: @inventario_cosa.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "52f32e5f7995ab153232169f5b42c390", "score": "0.58577555", "text": "def create\n @respuesta = Respuesta.new(params[:respuesta])\n\n if @respuesta.save\n render json: @respuesta, status: :created, location: @respuesta\n else\n render json: @respuesta.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "60205e751d107503a51c9bf6fb9087d4", "score": "0.5847815", "text": "def create\n @asiento_de_servicio = AsientoDeServicio.new(asiento_de_servicio_params)\n\n respond_to do |format|\n if @asiento_de_servicio.save\n format.html { redirect_to @asiento_de_servicio, notice: 'Asiento de servicio was successfully created.' }\n format.json { render :show, status: :created, location: @asiento_de_servicio }\n else\n format.html { render :new }\n format.json { render json: @asiento_de_servicio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "901c0b44630ae0c0f6b82af3a4986c9a", "score": "0.5846616", "text": "def create\n @payment = Payment.new(payment_params)\n url = 'http://localhost/servicio/Despachador.php'\n parametros = {params: {\n \"servicio\" => 8,\n \"numtarjeta\" => payment_params[:card_number],\n \"cedtitular\" => \"V#{payment_params[:identification]}\",\n \"mesexpiracion\" => payment_params[:expiration_month],\n \"annoexpiracion\" => payment_params[:expiration_year],\n \"codseguridad\" => payment_params[:security_code],\n \"monto\" => payment_params[:amount]\n }}\n\n # \"servicio\" => 4,\n # \"numtarjeta\" => 1234567898765432,\n # \"cedtitular\" => 20296530,\n # \"mesexpiracion\" => 8,\n # \"annoexpiracion\" => 17,\n # \"codseguridad\" => 301,\n # \"monto\" => 3000\n # }}\n resultado = ActiveSupport::JSON.decode(RestClient.get(url, parametros))\n respond_to do |format|\n if resultado[\"exito\"] == \"true\"\n\n if @payment.save\n puts \"entro al save\"\n format.html { redirect_to new_organization_path, notice: 'Su pago ha sido procesado satisfactoriamente' }\n format.json { render :show, status: :created, location: @payment }\n else\n format.html { render :new }\n format.json { render json: @payment.errors, status: :unprocessable_entity }\n end\n\n else\n format.html { render :new , notice: 'Hubo un problema con su solicitud, consulte a su banco para mas informacion'}\n format.json { render json: @payment.errors, status: :unprocessable_entity }\n end\n end\n\n end", "title": "" }, { "docid": "42c28a9343d9ef4ce96878f6ee309f72", "score": "0.58455956", "text": "def create\n @tangazo = Tangazo.new(tangazo_params)\n\n respond_to do |format|\n if @tangazo.save\n format.html { redirect_to @tangazo, notice: 'Tangazo was successfully created.' }\n format.json { render :show, status: :created, location: @tangazo }\n else\n format.html { render :new }\n format.json { render json: @tangazo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7e436d22c0d4993fe7164202646eff56", "score": "0.5843355", "text": "def citacao_params\n params.require(:citacao).permit(:trecho, :pagina_inicial, :palavras_chave, :livro_id)\n end", "title": "" }, { "docid": "a4d5d68c5785e2b43e937395e05efc4f", "score": "0.5842568", "text": "def create\n @troca_produto = TrocaProduto.new(troca_produto_params)\n\n respond_to do |format|\n if @troca_produto.save\n format.html { redirect_to @troca_produto, notice: \"Troca produto was successfully created.\" }\n format.json { render :show, status: :created, location: @troca_produto }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @troca_produto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "39cb7d603702528f18f85def62d8fcfd", "score": "0.5830017", "text": "def create\n @contrato = Contrato.new(contrato_params)\n\n respond_to do |format|\n if @contrato.save\n @contrato.anadir_conceptosdepago(@contrato.fecha_inicio, @contrato.fecha_fin)\n format.html { redirect_to @contrato, notice: 'Contrato fue creado exitosamente.' }\n format.json { render :show, status: :created, location: @contrato }\n else\n format.html { render :new }\n format.json { render json: @contrato.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5e86c25f34d902c8fde7276ffafe2b96", "score": "0.5826298", "text": "def create\n @t_nota_credito = TNotaCredito.new(t_nota_credito_params)\n\n respond_to do |format|\n if @t_nota_credito.save\n format.html { redirect_to @t_nota_credito, notice: 'T nota credito was successfully created.' }\n format.json { render :show, status: :created, location: @t_nota_credito }\n else\n format.html { render :new }\n format.json { render json: @t_nota_credito.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "32dc59de77b5d8a8002c38c9930bbc17", "score": "0.58259445", "text": "def create\n @colegio = Colegio.new(params[:colegio])\n\n respond_to do |format|\n if @colegio.save\n format.html { redirect_to @colegio, notice: 'El colegio fue creado satisfactoriamente.' }\n format.json { render json: @colegio, status: :created, location: @colegio }\n else\n format.html { render action: \"new\" }\n format.json { render json: @colegio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bbcb19c32c60c2d71d3b9fc4806f2978", "score": "0.58250743", "text": "def create\n @tecnico = Tecnico.new(params[:tecnico])\n @tecnico.user = current_user\n\n respond_to do |format|\n if @tecnico.save\n format.html { redirect_to @tecnico, notice: 'Técnico foi criado com sucesso.' }\n format.json { render json: @tecnico, status: :created, location: @tecnico }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tecnico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9678dded8fb39f059b0b601c64728f22", "score": "0.5814336", "text": "def create\n @ocupacion = Ocupacion.new(ocupacion_params)\n\n respond_to do |format|\n if @ocupacion.save\n format.html { redirect_to @ocupacion, notice: 'Ocupacion was successfully created.' }\n format.json { render :show, status: :created, location: @ocupacion }\n else\n format.html { render :new }\n format.json { render json: @ocupacion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1dc25d5f3a594dbd1f8ac83905394df1", "score": "0.58010787", "text": "def create\n @citacao = Citacao.new(citacao_params)\n\n respond_to do |format|\n if @citacao.save\n format.html { redirect_to @citacao, notice: 'Citacao was successfully created.' }\n format.json { render action: 'show', status: :created, location: @citacao }\n else\n format.html { render action: 'new' }\n format.json { render json: @citacao.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a0fff6f1a2c47d982c93fb3037be403d", "score": "0.5798124", "text": "def create\n @conta = Conta.new(conta_params)\n\n respond_to do |format|\n if @conta.save\n format.html { redirect_to contas_path, notice: @@titulo + t('msg.salva')}\n format.json { render :index, status: :created, location: @conta }\n else\n format.html { redirect_to contas_path, alert: @conta.errors.messages }\n format.json { render json: @conta.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b4ae122996e3ad2d92974870443cc588", "score": "0.57970375", "text": "def create\n @asiento = Asiento.new(params[:asiento])\n\n respond_to do |format|\n if @asiento.save\n format.html { redirect_to @asiento, :notice => 'El apunte fue creado.' }\n format.json { render :json => @asiento, :status => :created, :location => @asiento }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @asiento.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a1b8ea993cdce276e26e77de3514cd84", "score": "0.5793344", "text": "def create\n @cooperativa = Cooperativa.new(params[:cooperativa])\n\n respond_to do |format|\n if @cooperativa.save\n format.html { redirect_to [:admin, @cooperativa], :notice => 'Exemplo was successfully created.' }\n format.json { render :json => @cooperativa, :status => :created, :location => @cooperativa }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @cooperativa.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "49f285e8417b6114f4c4788337c59764", "score": "0.57854766", "text": "def create\n ActiveRecord::Base.transaction do\n @cuenca = Cuenca.new(cuenca_params)\n\n respond_to do |format|\n if @cuenca.save\n format.html { redirect_to @cuenca, notice: 'La Cuenca se cre&oacute; exitosamente.' }\n format.json { render :show, status: :created, location: @cuenca }\n else\n format.html { render :new }\n format.json { render json: @cuenca.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "title": "" }, { "docid": "d31f8969e2098dc5c5abb2d9616e1f1c", "score": "0.57845753", "text": "def create\n @contato = Contato.new(contato_params)\n\n respond_to do |format|\n if @contato.save\n format.html { redirect_to @contato, notice: 'Contato was successfully created.' }\n format.json { render :show, status: :created, location: @contato }\n else\n format.html { render :new }\n format.json { render json: @contato.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "18e6fdedf5dafe18b68d638ea0ffd884", "score": "0.57828325", "text": "def create\n @cuerpo = Cuerpo.new(params[:cuerpo])\n\n respond_to do |format|\n if @cuerpo.save\n format.html { redirect_to @cuerpo, notice: 'Cuerpo was successfully created.' }\n format.json { render json: @cuerpo, status: :created, location: @cuerpo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cuerpo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e7a06af77f0de33567d94602692cfde7", "score": "0.5780727", "text": "def create\n @parte_cuerpo = ParteCuerpo.new(parte_cuerpo_params)\n\n respond_to do |format|\n if @parte_cuerpo.save\n format.html { redirect_to @parte_cuerpo, notice: 'Parte cuerpo was successfully created.' }\n format.json { render :show, status: :created, location: @parte_cuerpo }\n else\n format.html { render :new }\n format.json { render json: @parte_cuerpo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6670d898129fe868a273fec5ba5f58be", "score": "0.57737", "text": "def create\n @nota_credito = NotaCredito.new(nota_credito_params)\n\n respond_to do |format|\n if @nota_credito.save\n format.html { redirect_to @nota_credito, notice: 'Nota credito was successfully created.' }\n format.json { render :show, status: :created, location: @nota_credito }\n else\n format.html { render :new }\n format.json { render json: @nota_credito.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "278c14672bb94a1be6cac4dc0485652a", "score": "0.57730854", "text": "def create\n @caixa = Caixa.new(params[:caixa])\n\n respond_to do |format|\n if @caixa.save\n format.html { redirect_to @caixa, notice: 'Caixa was successfully created.' }\n format.json { render json: @caixa, status: :created, location: @caixa }\n else\n format.html { render action: \"new\" }\n format.json { render json: @caixa.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fc16bd219f63f2d6cae5c7d5bd841c54", "score": "0.57689923", "text": "def create\n @fornecedor_custo = FornecedorCusto.new(params[:fornecedor_custo])\n\n respond_to do |format|\n if @fornecedor_custo.save\n format.html { redirect_to @fornecedor_custo, notice: 'Fornecedor custo was successfully created.' }\n format.json { render json: @fornecedor_custo, status: :created, location: @fornecedor_custo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @fornecedor_custo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8616eafd1860d3be3f37462a48e261de", "score": "0.576685", "text": "def create\n @cio = Cio.new(cio_params)\n\n respond_to do |format|\n if @cio.save\n format.html { redirect_to @cio, notice: 'Cio cadastrado com sucesso.' }\n format.json { render :show, status: :created, location: @cio }\n else\n format.html { render :new }\n format.json { render json: @cio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "36343d17e1d1886f3a13f57b29fbf2d9", "score": "0.57594645", "text": "def create\n @daw_curso_comunicado = DawCursoComunicado.new(daw_curso_comunicado_params)\n\n respond_to do |format|\n if @daw_curso_comunicado.save\n format.html { redirect_to @daw_curso_comunicado, notice: 'Daw curso comunicado was successfully created.' }\n format.json { render :show, status: :created, location: @daw_curso_comunicado }\n else\n format.html { render :new }\n format.json { render json: @daw_curso_comunicado.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3620854390aab61c7bca7a89ec35ed86", "score": "0.5759146", "text": "def create \n\t\t@tienda_cliente = @cliente.tiendas_clientes.build(tienda_cliente_params)\n\n respond_to do |format|\n if @tienda_cliente.save\n format.html { redirect_to @tienda_cliente, notice: 'La tienda se creó exitosamente.' }\n format.json { render :show, status: :created, location: @tienda_cliente }\n else\n format.html { render :new }\n format.json { render json: @tienda_cliente.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "587cb9302b0743bed407f6284a8ed9ac", "score": "0.57519895", "text": "def create\n @seguimiento = Seguimiento.new(seguimiento_params)\n\n respond_to do |format|\n if @seguimiento.save\n format.html { redirect_to @seguimiento.caso, notice: \"Seguimiento creado.\" }\n format.json { render :show, status: :created, location: @seguimiento }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @seguimiento.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "81e20824304f01cff39d9843a018b19d", "score": "0.57516044", "text": "def create\n @tropa = Tropa.new(tropa_params)\n\n respond_to do |format|\n if @tropa.save\n format.html { redirect_to @tropa, notice: 'Tropa was successfully created.' }\n format.json { render :show, status: :created, location: @tropa }\n else\n format.html { render :new }\n format.json { render json: @tropa.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eeb23141afd27079466ef01df3b9c5d2", "score": "0.5751054", "text": "def create\n @comentariox = Comentariox.new(params[:comentariox])\n\n respond_to do |format|\n if @comentariox.save\n format.html { redirect_to @comentariox, notice: 'Comentariox was successfully created.' }\n format.json { render json: @comentariox, status: :created, location: @comentariox }\n else\n format.html { render action: \"new\" }\n format.json { render json: @comentariox.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cf79617102391e2a8c62c425a079d70f", "score": "0.574375", "text": "def create\n @convidado = Convidado.new(convidado_params)\n\n respond_to do |format|\n if @convidado.save\n format.html { redirect_to @convidado, notice: 'Convidado was successfully created.' }\n format.json { render :show, status: :created, location: @convidado }\n else\n format.html { render :new }\n format.json { render json: @convidado.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0e9753ce17109cb2900d626e4553d12c", "score": "0.57432336", "text": "def cuenta_params\n params.require(:cuenta).permit(:cliente_id, :nombre, :dirpostal_id, :tpago_id, :timpagado_id, :tvencimiento_id, :tenvio_id)\n end", "title": "" }, { "docid": "ad89c07b2db8fb951e296bce90809d41", "score": "0.57379717", "text": "def create\n @c_depo = CDepo.new(c_depo_params)\n\n respond_to do |format|\n if @c_depo.save\n format.html { redirect_to @c_depo, notice: 'C depo was successfully created.' }\n format.json { render :show, status: :created, location: @c_depo }\n else\n format.html { render :new }\n format.json { render json: @c_depo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e53c3dd5a524f1da4978510eb2594f87", "score": "0.5734189", "text": "def create\n @cet = Cet.new(cet_params)\n\n respond_to do |format|\n if @cet.save\n format.html { redirect_to @cet, notice: 'Cet was successfully created.' }\n format.json { render :show, status: :created, location: @cet }\n else\n format.html { render :new }\n format.json { render json: @cet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8aadb624bc8908f3d04d56cc17ba5b4e", "score": "0.57340026", "text": "def create\n @centro_de_treinamento = CentroDeTreinamento.new(centro_de_treinamento_params)\n\n respond_to do |format|\n if @centro_de_treinamento.save\n format.html { redirect_to @centro_de_treinamento, notice: 'Centro de treinamento was successfully created.' }\n format.json { render :show, status: :created, location: @centro_de_treinamento }\n else\n format.html { render :new }\n format.json { render json: @centro_de_treinamento.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b8e2171cbaec9e535ef5dd21e85d2e3c", "score": "0.5732225", "text": "def create\n @consumo = Consumo.new(consumo_params)\n\n respond_to do |format|\n if @consumo.save\n format.html { redirect_to @consumo, notice: 'Consumo was successfully created.' }\n format.json { render :show, status: :created, location: @consumo }\n else\n format.html { render :new }\n format.json { render json: @consumo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7921a15d29e2402f939d25fae9a88380", "score": "0.57285786", "text": "def create\n @tipo_cancha = TipoCancha.new(tipo_cancha_params)\n\n respond_to do |format|\n if @tipo_cancha.save\n format.html { redirect_to @tipo_cancha, notice: 'Tipo cancha was successfully created.' }\n format.json { render :show, status: :created, location: @tipo_cancha }\n else\n format.html { render :new }\n format.json { render json: @tipo_cancha.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7f76e2c99cdd99693e6f001d45a88dc7", "score": "0.5726561", "text": "def create\n @comentario_autenticado = ComentarioAutenticado.new(comentario_autenticado_params)\n #@comentario_autenticado.autor = current_user.nome_completo\n #@comentario_autenticado.usuario = current_user\n\n respond_to do |format|\n if @comentario_autenticado.save\n format.html { redirect_to @comentario_autenticado, notice: 'Comentario autenticado was successfully created.' }\n format.json { render :show, status: :created, location: @comentario_autenticado }\n else\n format.html { render :new }\n format.json { render json: @comentario_autenticado.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4d5dbbd9a450b34d15580581c84ded68", "score": "0.5724953", "text": "def create\n @tipo_de_servicio = TipoDeServicio.new(tipo_de_servicio_params)\n\n respond_to do |format|\n if @tipo_de_servicio.save\n format.html { redirect_to @tipo_de_servicio, notice: 'Tipo de servicio was successfully created.' }\n format.json { render :show, status: :created, location: @tipo_de_servicio }\n else\n format.html { render :new }\n format.json { render json: @tipo_de_servicio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ee4ca2e9c15b3c51b47a0d1f0f8aeca2", "score": "0.5716925", "text": "def pedido_cotizacion_params\n params.require(:pedido_cotizacion).permit(:numero, :proveedor_id, :estado, :fecha_generado, :fecha_cotizado, :user_id, :pedido_compra_id,\n pedido_cotizacion_detalles_attributes: [:id, :cantidad_cotizada, :costo_unitario])\n end", "title": "" }, { "docid": "4686b38fa33dea86e7aec9953f6da64e", "score": "0.5711768", "text": "def create\n @paciente = Paciente.new(params[:paciente])\n\n paciente = @paciente\n respond_to do |format|\n if @paciente.save\n\n enviar_correo_nuevo_paciente paciente\n\n format.html { redirect_to @paciente, notice: 'Paciente was successfully created.' }\n format.json { render json: @paciente, status: :created, location: @paciente }\n else\n format.html { render action: \"new\" }\n format.json { render json: @paciente.errors, status: :unprocessable_entity }\n end\n end\n\n\n\n end", "title": "" } ]
bcaad86c06c182c98e94d76b636c0a94
these should be moved to a helper function or maybe be an extension of the String class
[ { "docid": "1edda59bcbfb615a67d68c3dac6bd208", "score": "0.0", "text": "def float_val?(val)\n !!(val =~ /\\A[-+]?\\d+(\\.\\d+)?\\z/)\n end", "title": "" } ]
[ { "docid": "325ffadb3e3b7a5846f3c5804435e216", "score": "0.7012156", "text": "def string(str); end", "title": "" }, { "docid": "3125932334f0c2647ed666cf211b57cb", "score": "0.68459797", "text": "def str(str); end", "title": "" }, { "docid": "3125932334f0c2647ed666cf211b57cb", "score": "0.68459797", "text": "def str(str); end", "title": "" }, { "docid": "06fafe27b800eaa798d42b6e9d5f747c", "score": "0.6333499", "text": "def str2; end", "title": "" }, { "docid": "06fafe27b800eaa798d42b6e9d5f747c", "score": "0.6333499", "text": "def str2; end", "title": "" }, { "docid": "741c3b654c4053415b3492ad051ca079", "score": "0.6324265", "text": "def substrings(string)\r\n \r\nend", "title": "" }, { "docid": "9ad67eda6e5ea10971af34c516f1e1a9", "score": "0.6317561", "text": "def double_metaphone(str); end", "title": "" }, { "docid": "71390b09f40ee4b2589038ef6c0dd4ad", "score": "0.6227315", "text": "def characters(string); end", "title": "" }, { "docid": "71390b09f40ee4b2589038ef6c0dd4ad", "score": "0.6227315", "text": "def characters(string); end", "title": "" }, { "docid": "248190ccb8c08045c202f6731b33bbfc", "score": "0.619872", "text": "def substrings(string)\n\nend", "title": "" }, { "docid": "d3b7c83c908193a032466ef56e6227d2", "score": "0.6184137", "text": "def String(p0) end", "title": "" }, { "docid": "9afff75c9e2b01befe59328152c073d6", "score": "0.61310416", "text": "def missing_letters(string)\nend", "title": "" }, { "docid": "7905bc4cb2cd12a8459dc01592328fa9", "score": "0.6074405", "text": "def crunch(string)\n str_result = ''\n string.chars.each do |char|\n str_result << char unless char == str_result[-1]\n end\n str_result\nend", "title": "" }, { "docid": "9609b2fb2284a34c92c3477b146f5f22", "score": "0.60075635", "text": "def character_by_character(string)\nend", "title": "" }, { "docid": "6909340e110ded10c456995d23dfd091", "score": "0.5975889", "text": "def decompose_safe(str)\n raise NotImplementedError\n end", "title": "" }, { "docid": "ba770e35e5ff6024048a2d49d2b3eb86", "score": "0.5975551", "text": "def strip(str); end", "title": "" }, { "docid": "4a3b0fa84b2a1112cea62dc85a54fc6a", "score": "0.5969704", "text": "def make_string(s)\n s.split.map(&:chr).join\nend", "title": "" }, { "docid": "01b81e01fd99910217586e818f59238f", "score": "0.5966565", "text": "def string_compression(str)\n\nend", "title": "" }, { "docid": "70077021abc1ef3b8d4373bb9e3b3741", "score": "0.5948419", "text": "def spec\n string_match_operator\n string_element_reference_regexp\n string_byteslice\n string_scan\n string_unary_minus\n string_reverse\n string_tr\n\n true\nend", "title": "" }, { "docid": "7b9d909de13915bc19c38ced0866b765", "score": "0.59352857", "text": "def strings; end", "title": "" }, { "docid": "58840c100d1b1e1eec20fe9f3fb59210", "score": "0.59267324", "text": "def crunch(string)\n final = ''\n string.chars.each { |chr| final << chr unless final[-1] == chr }\n final\nend", "title": "" }, { "docid": "d969f187561d7e4ce1a7d6ffb3d539c6", "score": "0.5922673", "text": "def string(*) end", "title": "" }, { "docid": "4ab10013d3c1fe07c2d07c798fea2298", "score": "0.5914985", "text": "def str1; end", "title": "" }, { "docid": "4ab10013d3c1fe07c2d07c798fea2298", "score": "0.5914985", "text": "def str1; end", "title": "" }, { "docid": "f8c0bc1efd456ab740b1ea91c7973908", "score": "0.5899917", "text": "def strip_nongsm_chars!(replacement = \"\")\n # Should this be a patch to String?\n\n # keeping them here in canse I need them\n # basic alpha\n # '@','£','$','¥','è','é','ù','ì','ò','Ç',\"\\n\",'Ø','ø',\"\\r\",'Å','å',\n # 'Δ','_','Φ','Γ','Λ','Ω','Π','Ψ','Σ','Θ','Ξ','Æ','æ','ß','É',' ',\n # '!','\"','#','¤','%','&','\\'','(',')','*','+',',','-','.','/','0',\n # '1','2','3','4','5','6','7','8','9',':',';','<','=','>','?','¡',\n # 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P',\n # 'Q','R','S','T','U','V','W','X','Y','Z','Ä','Ö','Ñ','Ü','§','¿',\n # 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p',\n # 'q','r','s','t','u','v','w','x','y','z','ä','ö','ñ','ü','à'\n #\n # extended alpha\n # '|','^','€','{','}','[',']','~','\\\\'\n\n allowed = '@£$¥èéùìòÇ'+\"\\n\"+'Øø'+\"\\r\"+'ÅåΔ_ΦΓΛΩΠΨΣΘΞÆæßÉ'+' '+Regexp.escape('!\"#¤%&\\'()*+,-.')+'\\/'+Regexp.escape('0123456789:;<=>?¡ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÑܧ¿abcdefghijklmnopqrstuvwxyzäöñüà|^€{}[]~\\\\')\n\n map = {\n /á|â|ã/ => \"a\",\n /ê|ẽ|ë/ => \"e\",\n /í|î|ï/ => \"i\",\n /ó|ô|õ/ => \"o\",\n /ú|ů|û/ => \"u\",\n /ç/ => \"Ç\"\n }\n\n map.each do |key, value|\n self.gsub!(key, value)\n end\n\n pattern = Regexp.new( \"[^\"+allowed+\"]\" )\n self.gsub!(pattern,\"\")\n end", "title": "" }, { "docid": "368d08ac725e9dc40243972d6e5caec4", "score": "0.5881151", "text": "def make_string(s)\n s.split.map { |str| str.chars.first}.join\nend", "title": "" }, { "docid": "6cf6e954c4141b6af3fdb2774ef2e2b9", "score": "0.58808976", "text": "def ruby_test(str)\n if(str[1,4] == \"Ruby\")\n return (str[5, str.length()]);\n else\n return str;\n end\n end", "title": "" }, { "docid": "a8d11ac78c8398eede8c93e259ef0b8c", "score": "0.58768713", "text": "def crunch(str)\n single_str = ''\n\n str.each_char do |character|\n single_str << character unless character == single_str[-1]\n end\n single_str\nend", "title": "" }, { "docid": "2f13e704fd94626d42921a166dfb67ef", "score": "0.5864815", "text": "def crunch(str)\n crunched_string = ''\n str.each_char do |chr|\n crunched_string << chr unless crunched_string[-1] == chr\n end\n crunched_string\nend", "title": "" }, { "docid": "52815f8c6d06f2f4e98c2f73f4322f13", "score": "0.58620685", "text": "def normalize(str) return str end", "title": "" }, { "docid": "4a70524dec598b773c5b167e07efd823", "score": "0.5852879", "text": "def custom_squeeze(string)\n final = \"\"\n chars = string.split(\"\")\n chars.each_with_index { |char, index| char == chars[index + 1] ? next : final << char }\n final\nend", "title": "" }, { "docid": "81b399e577e3de78b512324c67971c2e", "score": "0.5843633", "text": "def normalize(string); end", "title": "" }, { "docid": "af83182e8ffb2b5c158e2ee29b79e715", "score": "0.58365136", "text": "def custom_squeeze(string)\n final = ''\n chars = string.split('') # string chars\n chars.each_with_index do |char, index|\n char == chars[index + 1] ? next : final << char\n end\n final\nend", "title": "" }, { "docid": "a6db3eb9605ec56aa32482d9268ac48f", "score": "0.58329326", "text": "def crunch(string)\n new_string = ''\n string.each_char { |char| new_string += char if new_string[-1] != char}\n new_string\nend", "title": "" }, { "docid": "a13e896f3545e8d167fcde0abc754180", "score": "0.5828648", "text": "def processString(s=@orig_string) \n # All LaTeX Macron codes begin with an '=' token. Scan for that using a \n # RegEx. The value is set to firstSlash. \n \n firstSlash = s =~ /(\\\\=.*?\\})/\n return s if $1.nil?\n \n testChar = $1\n \n # In the event that the first character is macron-bearing follow this \n # case. \n if firstSlash == 0\n return processChar(testChar).to_s +\n processString(s[firstSlash+testChar.length..s.length])\n end\n \n # In the more general case, we take the original string up to the first\n # macron-beginning-slash. We return that + running processChar on the\n # remainder of the string, that is return part_ok +\n # processString(the_rest).\n \n return s[0..firstSlash-1] + processChar(testChar).to_s +\n processString(s[firstSlash+testChar.length..s.length])\n end", "title": "" }, { "docid": "d2325a185dea3c88329aa8bb24f56fe4", "score": "0.58255863", "text": "def custom_squeeze(string)\n final=\"\"\n characters_array= string.split(\"\")\n characters_array.each_with_index do |char, index|\n unless index >= 0 && characters_array[index - 1] == char\n final += char\n end\n end\n p final\nend", "title": "" }, { "docid": "9d8c0fa91ba4bf23d5bd770dfd7da47d", "score": "0.58248246", "text": "def cutinfo(string)\n inf=/\\024/=~string1\n inf=inf+2\n trans=string1[inf..-1]\nend", "title": "" }, { "docid": "c0d6105402ef20e728c3d4bb570371f7", "score": "0.58200353", "text": "def norm_string(s)\n s.chars.sort!\nend", "title": "" }, { "docid": "10c2ecf5314a0321e8d18773eac6de0d", "score": "0.5813003", "text": "def diff_string(string1, string2); end", "title": "" }, { "docid": "010dddde78fc66a2a3ce3ba370e33220", "score": "0.5811309", "text": "def double_characters(string)\n doubled_string = ''\n string.chars.each do |char|\n doubled_string << char * 2\n end\n doubled_string\nend", "title": "" }, { "docid": "84d293c5a03697410ec2f00acac5f040", "score": "0.58084935", "text": "def string() end", "title": "" }, { "docid": "3bbb1f58ac7790b988f97587ec18699e", "score": "0.5808111", "text": "def encode_string_ex; end", "title": "" }, { "docid": "1e9f786f9ac516e203a68b7b5389af12", "score": "0.57993764", "text": "def string_compression(str)\n new_str = ''\n current_letter = nil\n current_letter_count = 0\n\n str.split('').each do |char|\n if char != current_letter\n if !current_letter.nil?\n new_str += current_letter + current_letter_count.to_s\n end\n current_letter = char\n current_letter_count = 1\n else\n current_letter_count += 1\n end\n end\n\n new_str += current_letter + current_letter_count.to_s\n\n new_str\nend", "title": "" }, { "docid": "aba61c31f6667b9495e0c06b765484e9", "score": "0.57830447", "text": "def convert_string string\n return string unless @in_b or @in_em\n chars = if @in_b then\n string.chars.map do |char| \"#{char}\\b#{char}\" end\n elsif @in_em then\n string.chars.map do |char| \"_\\b#{char}\" end\n end\n\n chars.join\n end", "title": "" }, { "docid": "19333347929fda381151155a09d55201", "score": "0.57825357", "text": "def str1\n 'from string'\nend", "title": "" }, { "docid": "2a198204a22e47864484f51be62decfb", "score": "0.57738465", "text": "def string_replacements\nend", "title": "" }, { "docid": "f0b912690a9b5804a4369bf81963ce37", "score": "0.57716775", "text": "def missingChars(str)\n\t\n\t# A boolean array to store characters\n\t# present in string.\t\n\n alfabeto = 'abcdefghijklmnopqrstuvxyz' \n arr = alfabeto.split('');\n\n arrstr = str.split('');\n arrmissing = [] \n \n \n\t# Traverse string and mark characters\n\t# present in string.\n\tfor i in 0..arr.length() - 1 do\n if (arrstr.include?(arr[i].downcase) == false) and (arrstr.include?(arr[i].upcase) == false)\n arrmissing.push(arr[i].downcase) \n end \n end \n \n return arrmissing.join();\n\n \n\n\t# Store missing characters in alphabetic\n\t# order.\n\t\nend", "title": "" }, { "docid": "1a6adfc89d7ca1ae115bd1bf33a24fd3", "score": "0.576236", "text": "def stringWithPercentsAgainEfficient(string_parameter)\n\n\tstring_parameter.chars.map do |character|\n\t\tif character == \" \"\n\t\t \tcharacter = \"%20\"\n\t\telse\n\t\t\tcharacter\n\t\tend\n\tend.join\n\nend", "title": "" }, { "docid": "6146ba0b242db65018e9a1d5a980a26f", "score": "0.5761126", "text": "def energetic_encoding(str, hash)\n str.chars.map! do |char| \n if char == \" \"\n char\n elsif hash[char].nil?\n \"?\"\n else\n hash[char]\n end\n end.join(\"\")\nend", "title": "" }, { "docid": "152ef85d439fc418694e508f991e9d89", "score": "0.5760919", "text": "def custom_squeeze(string)\n final = \"\"\n chars = string.split(\"\")\n chars.each_with_index { |char, index| char == chars[index + 1] ? next : final << char }\n final\nend", "title": "" }, { "docid": "752fa6f3cb4c541636ac4f4af852bfe2", "score": "0.5758437", "text": "def crunch(string)\n clean_string = ''\n string.each_char do |letter|\n clean_string << letter unless letter == clean_string[-1]\n end\n clean_string\nend", "title": "" }, { "docid": "6a29b47f1a62d1548bce602314a57fc0", "score": "0.57515603", "text": "def processString(s) \n unless s.nil?\n unless s.rest.empty?\n return processChar(s.first) + processString(s.rest) \n else\n return processChar(s.first)\n end\n end\n end", "title": "" }, { "docid": "1a45a8431e53d1bb3a89da26aa60b3b0", "score": "0.57503724", "text": "def crunch(str)\n new_str = ''\n prev = ''\n str.chars.each do |c|\n next if prev == c\n new_str << c\n prev = c\n end\n new_str\nend", "title": "" }, { "docid": "20fc2fbe97a017ec302094360cca1b92", "score": "0.5744095", "text": "def unify_string str\n\t\t\t@strings_dictionary[str] ||= str\n\t\tend", "title": "" }, { "docid": "4b9b5e0765e1cb2e982f01d217c127e8", "score": "0.5737088", "text": "def energetic_encoding(str, hsh)\n new_str = str.split(\"\").map do |char| \n if hsh.key?(char)\n hsh[char] \n elsif char != \" \"\n \"?\"\n else\n char\n end\n end\n\n new_str.join(\"\")\nend", "title": "" }, { "docid": "fcad88f1738be19a423f032d5643d006", "score": "0.5722169", "text": "def crunch(str)\n current_char = nil\n new_str = ''\n str.each_char do |char| \n if current_char != char\n new_str << char \n current_char = char\n end\n end\n new_str\nend", "title": "" }, { "docid": "eb6a99382608f0531259c45472668fcd", "score": "0.5717196", "text": "def chars_until(str); end", "title": "" }, { "docid": "ebe5b048808b83ca5ebb6f535dc775de", "score": "0.571106", "text": "def soundex_str(str); end", "title": "" }, { "docid": "ebe5b048808b83ca5ebb6f535dc775de", "score": "0.571106", "text": "def soundex_str(str); end", "title": "" }, { "docid": "0eba9cf6a477522d490b602470287519", "score": "0.5699709", "text": "def concat_without_endcaps(string1, string2)\n return nil if !string1 and !string2\n return string1 if string2.nil?\n return string2 if string1.nil?\n s1 = string1[-1] == ?$ ? string1[0..-2] : string1\n s2 = string2[0] == ?^ ? string2[1..-1] : string2\n s1 + s2\n end", "title": "" }, { "docid": "fb7a313a05cdad68497766bad2325cd1", "score": "0.567761", "text": "def supports_standard_conforming_strings?\n true\n end", "title": "" }, { "docid": "2733edd0fed501bbec51a71e3a5e000c", "score": "0.5671546", "text": "def sanity(str)\n str.chomp('/')+'/'\n end", "title": "" }, { "docid": "2733edd0fed501bbec51a71e3a5e000c", "score": "0.56707084", "text": "def sanity(str)\n str.chomp('/')+'/'\n end", "title": "" }, { "docid": "34862aecabb1e82362166f33b2dd5602", "score": "0.56680673", "text": "def crunch(double_string)\n current_character = ''\n new_string = ''\n double_string.each_char do |character|\n if character != current_character\n new_string += character\n current_character = character\n end\n end\n new_string\nend", "title": "" }, { "docid": "cebfa12e547ee0e6dfe4d19c81cd60ed", "score": "0.5667869", "text": "def str3; end", "title": "" }, { "docid": "cebfa12e547ee0e6dfe4d19c81cd60ed", "score": "0.5667869", "text": "def str3; end", "title": "" }, { "docid": "76402eae37d64f6172c5fd25e935ad04", "score": "0.56673026", "text": "def crunch(string)\n last_char_used = []\n new_string = ''\n string.each_char do |char|\n new_string << char if char != last_char_used.last\n last_char_used << char\n end\n new_string\nend", "title": "" }, { "docid": "65b11df8c8d2cbc739693a720316a59b", "score": "0.56537783", "text": "def hello_world (str)\n return 'hola mundo' if str == \"es\"\n return 'hallo welt' if str == \"de\"\n return 'hello world'\nend", "title": "" }, { "docid": "368e09c61ec8a1d4a972acef6a420bd8", "score": "0.5651811", "text": "def best_practice_solution(str)\n result = []\n chars = str.downcase.chars\n chars.each_with_index do |char, idx|\n next if char == \" \"\n result << str[0...idx] + char.upcase + str[idx+1..-1]\n end\n result\nend", "title": "" }, { "docid": "e43fa3671275207366c3e3959cf1044b", "score": "0.5650313", "text": "def custome_squeeze(string)\n final = \"\"\n chars = string.split(\"\")\n chars.each_with_index do |char, index|\n char == chars[index + 1] ? next : final << char\n end\n return final\nend", "title": "" }, { "docid": "4c0831157329d550e37add8bf5814312", "score": "0.5648924", "text": "def cleanup(string)\n new_string = ''\n\n string.chars.each_with_index do |char, index|\n char_alphanumeric = char.match(/[a-z0-9]/)\n if index == 0\n prior_char_alphanumeric = true\n else\n prior_char_alphanumeric = string[index - 1].match(/[a-z0-9]/)\n end\n\n\n # p [char_alphanumeric, prior_char_alphanumeric]\n\n if char_alphanumeric\n new_string << char\n elsif prior_char_alphanumeric\n new_string << ' '\n end\n end\n\n new_string\nend", "title": "" }, { "docid": "09aefbb99f5341b43cc84395fe10c30d", "score": "0.5644083", "text": "def str; end", "title": "" }, { "docid": "09aefbb99f5341b43cc84395fe10c30d", "score": "0.5644083", "text": "def str; end", "title": "" }, { "docid": "daecf16e1badaea30cbab60d8c13d78e", "score": "0.5642363", "text": "def normalised(string)\n return unless string\n\n # single quotes\n string = string.gsub(/'/, '’')\n # double quotes\n string = string.gsub(/\"/, '“')\n # ellipsis\n string = string.gsub(/\\.\\.\\./, '…')\n # em-dash\n string = string.gsub(/---/, '—')\n # en-dash\n string = string.gsub(/--/, '–')\n # left guillemet\n string = string.gsub(/<</, '«')\n # right guillemet\n string = string.gsub(/>>/, '»')\n\n string\n end", "title": "" }, { "docid": "ccc85109d346f5ca0f6ce26a835fa715", "score": "0.56401175", "text": "def string(st)\n if st.length > 10\n puts st.upcase\n else\n puts st\nend\nend", "title": "" }, { "docid": "5e3a6819f923e35161744f4034871505", "score": "0.5634519", "text": "def string_edit(string1, string2)\n\nreturn true of string1==string2\nreturn false if (string1.length=string2.length).abs>1\n if string1.length<string2.length\n short_string=string1\n long_string=string2\n else \n short_string=string2 \n long_string=string1\n end\n long_string_hash={}\n \n long_string.each_char do |char|\n long_string_hash[char]||=0\n long_string_hash[char]+1\n end\n \n if short_string.length<long_string.length \n short_string.each_char do |char|\n return false if !!long_string_hash[char]\n long_string_hash[char]-=1\n return false if long_string_hash[char]<0\n end\n return true\n end \n diff_letts=0\n short_string.each_char do |char|\n diff_letts+=1 if !!long_string_hash[char]\n return false if diff_letts>1\n end\n return true\n \n \n end", "title": "" }, { "docid": "f1e98de9bd154929a2a9ec4eff864551", "score": "0.56206447", "text": "def crunch(str)\n counter = 0\n result = ''\n while counter < str.length\n result << str[counter] unless str[counter] == result[-1]\n counter += 1\n end\n result\nend", "title": "" }, { "docid": "bcf9679e748ee7cfa399ee06856b00b9", "score": "0.5619602", "text": "def crunch(string)\n string == '' ? new_str = '' : new_str = string[0]\n string.each_char do |char|\n char == new_str[-1] ? next : new_str = new_str + char\n end\n new_str\nend", "title": "" }, { "docid": "aecae2f36be60ac805bd7c95e1eb3ef2", "score": "0.5605439", "text": "def reverse_string(str)\nend", "title": "" }, { "docid": "0c7fc86c99bc917898a730b81d571f80", "score": "0.56035906", "text": "def hipsterfy(string)\r\n\r\nend", "title": "" }, { "docid": "f97cea3082887e7b4a851554863a56f3", "score": "0.56030476", "text": "def crunch(string)\n output = []\n string.chars.each { output << char unless output.last == char }\n output.join\nend", "title": "" }, { "docid": "66dbcc7244f898a4563cfb8705706b9c", "score": "0.55981624", "text": "def string(string)\n string.gsub(/\\A(.)(.+?)(.?)\\z/) do |s|\n [\n $1,\n '*' * ($2 ? $2.length : 0),\n $3\n ].join\n end\n end", "title": "" }, { "docid": "a91778ed99eb735f9962951ffe210a93", "score": "0.5594849", "text": "def crunch(string)\n string_arr = string.chars\n return_arr = []\n string_arr.select do |current_char|\n next if return_arr[-1] == current_char\n return_arr << current_char\n end\n return_arr.join\nend", "title": "" }, { "docid": "29c20ca15f76c46ad40f54515e1103ec", "score": "0.5593538", "text": "def string_replace_chars_with_asterisks(s)\n\n\ts_array = s.chars\n\ts_asterisks = []\n\n\t# TODO: check if array is > 1\n\n\t# get first value and store\n\tfirst_char = s_array[0]\n\ts_asterisks << first_char\n\t# start from 2nd value and check if == first_char and replace with '*'\n\ts_array[1..-1].each do |i|\n\t\tif i == first_char\n\t\t\ti = \"*\"\n\t\tend\n\t\ts_asterisks << i\n\tend\n\n\treturn s_asterisks.join\n\nend", "title": "" }, { "docid": "621b90e98fdf62ca2963a136c3d1c1b0", "score": "0.5592083", "text": "def concat(string); end", "title": "" }, { "docid": "0b38f867578d4c3fce990ade6aa48765", "score": "0.5591603", "text": "def stringWithPerecentsAgain (string_parameter)\n\tarray_returned = []\n\tstring_parameter.each_char do |char_value|\n\t\tif (char_value == \" \")\n\t\t\tchar_value = \"%20\"\n\t\tend\n\t\tarray_returned << char_value\n\tend\n\tarray_returned.join\nend", "title": "" }, { "docid": "a7e5bf8a2fd71cdd4a7f2b9b7c7d71c8", "score": "0.55899704", "text": "def up_case_long_strings (str) \n str.length > 10 ? str.upcase : str\nend", "title": "" }, { "docid": "31ad6071ee4892233007c75d721479b7", "score": "0.5588854", "text": "def weirdFixString(str)\n idx = str.index(\"\\000\\000\")\n idx.nil? ? str : str[0..idx]\n end", "title": "" }, { "docid": "65946e1293bcf98d19abf34d8b4bbe1b", "score": "0.5587665", "text": "def clean_string(s)\n s.lstrip! if s\n s.rstrip! if s\n s\n end", "title": "" }, { "docid": "f70397dde4c36465b314389adbe94443", "score": "0.5583653", "text": "def leading_substrings(str)\n running_str = ''\n sub_strings = []\n str.each_char { |chr| sub_strings << running_str += chr }\n sub_strings\nend", "title": "" }, { "docid": "2894b6e31e0d8d8513f68ec74af0c2e3", "score": "0.55766773", "text": "def pincrement_string(str)\n chars = str.chars\n last = chars[-1]\n if last == last.to_i.to_s\n last = (last.to_i + 1).to_s\n end\n chars\nend", "title": "" }, { "docid": "536482fbe127a51cce72480a21697a09", "score": "0.55756634", "text": "def destructive_uppercase(str)\n my_str = \"\"\n str.chars{|ch| my_str += ch if ch.upcase == ch}\n my_str\nend", "title": "" }, { "docid": "d3fcc4c3e65f026359f56bd30fa87b59", "score": "0.55755717", "text": "def string_behavior (strings)\n\n strings.each do |str|\n if not str =~ /[A-Z]/ and str.length > 4\n puts \"long and lowercase\"\n elsif not str =~ /[A-Z]/\n puts \"lowercase\"\n elsif str.length > 4\n puts \"long\"\n\n else\n puts str\n end\n end\n end", "title": "" }, { "docid": "ba0cbb894f5ff5724a653a52a9dce1f9", "score": "0.55644166", "text": "def longer_string(str1, str2)\n # Write your code here\nend", "title": "" }, { "docid": "ca665d68978bc8925deb145e100b7338", "score": "0.5561581", "text": "def do_magic(str)\n str.gsub!(/[^A-Z]/, '').to_s #delete small leters and uprinted sumbols\n str.downcase.to_s #make all leters small\nend", "title": "" }, { "docid": "9c63590dc7d6f0204ba0fcd9abefd082", "score": "0.556024", "text": "def text(str); end", "title": "" }, { "docid": "c59d8a4df79241d59e854cb34f2148c2", "score": "0.5554309", "text": "def upcase_string(str)\n return unless str.respond_to?(:upcase) #Does str have the method :upcase?\n str.upcase\nend", "title": "" }, { "docid": "d771ee8048bee09611448c50e888cf07", "score": "0.5543507", "text": "def pirates_say_arrrrrrrrr(string)\n newstring = ''\n string.downcase!\n string.length.times do |index|\n newstring += string[index + 1] if char_is_r(string, index) && next_char_not_nil(string, index)\n end\n newstring\nend", "title": "" }, { "docid": "1d6661bf45297a03693e90c69f64357d", "score": "0.55416745", "text": "def constantize(string)\n return string.downcase.gsub(/[^a-z]/i, '') \n end", "title": "" }, { "docid": "2d572b6c0155dc11678c84e01166f3f0", "score": "0.55402476", "text": "def space_separated(str: raise)\n\tfirst_index = 0\n\tlast_index = 0\n\tresults = []\n\n\tstr.size.times do\n\t\tcheck_string = str[first_index..last_index]\n\t\tif DICTIONARY[check_string]\n\t\t\tresults << check_string\n\t\t\tfirst_index = last_index += 1\n\t\t\tlast_index = first_index\n\t\telse\n\t\t\tlast_index += 1\n\t\tend\n\tend\n\n\tputs results.join(\" \")\nend", "title": "" }, { "docid": "ff87e280bc4c9b8f84cfc952555a57a8", "score": "0.5539349", "text": "def may_inicial(string)\n puts \"#{string.upcase!}#{string[1..-1]}\"\nend", "title": "" } ]
a7b38b802e9595749ff07cce26e250ef
Method to set up a binary tree with an array of data and display the tree
[ { "docid": "a06226ee8d883c488597381ffe1a3b6e", "score": "0.7623716", "text": "def set_next_binary_tree(tree, arr)\n puts \"\\n=======================================================================\"\n puts \"=======================================================================\"\n puts \"=======================================================================\"\n puts \"\\nNext Test Array: \\n \"\n p arr\n tree.build_tree(arr)\n tree.show_binary_tree\n puts \"\\n=======================================================================\\n \"\nend", "title": "" } ]
[ { "docid": "ae0e39c49226840903fcbb1980610c18", "score": "0.7529211", "text": "def build_tree(array)\n @root = Node.new(array.shift)\n array.each do |i|\n insert(@root,i)\n end\n end", "title": "" }, { "docid": "8cfe532992c2714865acf32e325366ab", "score": "0.74616355", "text": "def build_tree(array)\n #Assign first value (at 0 index) as root node, shift removes the first element, so array is shorten by 1\n @root = Node.new(array.shift) if @root.nil?\n # Take each remaining element and make it into an object of class Node\n array.each do |element|\n node = Node.new(element)\n # call upon the insert method to map out the binary tree\n insert_node(node)\n end\n end", "title": "" }, { "docid": "76d29d5d641370484fe09c881a2ad9b3", "score": "0.7422164", "text": "def build_tree(array)\n\troot = BinaryTree::Node.new(array[0])\n\tarray.each_index do |i|\n\t\troot.insert(array[i]) unless i==0\n\tend\n\troot\n\t\nend", "title": "" }, { "docid": "238897c8a0dbbdb3ca0ea53c6f0f7f70", "score": "0.72790736", "text": "def build_tree(array)\n array.each do |node|\n if @root.nil?\n @root = Node.new(node) # assigns root the initial node.\n else\n add_node(node, @root) # then add nodes to the correct place in tree(parent, child)\n end\n end\n end", "title": "" }, { "docid": "cb995e31707de3cbdd0d312c6bd6f18f", "score": "0.7272432", "text": "def build_tree(array)\n\t\tarray.each do |i|\n\t\t\tif @tree.empty?\n\t\t\t\t@tree << Node.new(i)\n\t\t\telse\n\t\t\t\t@tree << Node.new(i)\n\t\t\t\troot = @tree[0]\n\t\t\t\twhile @tree[-1].parent == nil\n\t\t\t\t\tif i < root.value\n\t\t\t\t\t\t(root.left_child = @tree[-1] and @tree[-1].parent = root) if root.left_child == nil\n\t\t\t\t\t\troot = root.left_child\n\t\t\t\t\telsif i > root.value\n\t\t\t\t\t\t(root.right_child = @tree[-1] and @tree[-1].parent = root) if root.right_child == nil\n\t\t\t\t\t\troot = root.right_child\n\t\t\t\t\telse\n\t\t\t\t\t\tif i < @tree[0].value\n\t\t\t\t\t\t\t(@tree[0].right_child = @tree[-1] and @tree[-1].parent = @tree[0]) if @tree[0].right_child == nil\n\t\t\t\t\t\t\troot = @tree[0].right_child\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t(@tree[0].left_child = @tree[-1] and @tree[-1].parent = @tree[0]) if @tree[0].left_child == nil\n\t\t\t\t\t\t\troot = @tree[0].left_child\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\t@tree\n\tend", "title": "" }, { "docid": "7c933bb8da3fbdae25f75b17368417a3", "score": "0.71772397", "text": "def build_tree(arr)\n arr.each do |n|\n if defined? @tree\n @tree.add(n)\n else\n @tree = Node.new(n)\n puts @tree.value\n end\n end\n @tree\nend", "title": "" }, { "docid": "2711ca89267c01f8fd98df104538de96", "score": "0.7139515", "text": "def build_tree(array)\n array = array.sort.uniq\n define_node(array)\n end", "title": "" }, { "docid": "f735da4031ea5e2feaa0e626fec54553", "score": "0.71378577", "text": "def build_sorted_tree(array)\n tree = BinaryTree.new(nil, nil, nil)\n array.each do |item|\n tree.insert(item)\n end\n tree\nend", "title": "" }, { "docid": "19bcec9ba1fd3303ab2f7858cd31c3df", "score": "0.71055907", "text": "def build_tree(array, left=0, right=array.length-1)\n\t\treturn if left > right\n\n\t\tarray.sort!\n\n\t\tindex_mid = left + (right-left) / 2\t\n\t\tnode = Node.new(array[index_mid])\t\t\t\n\t\t\t\n\t\tnode.left_child = build_tree(array, left, index_mid-1)\t\t\t\n\t\tnode.right_child = build_tree(array, index_mid+1, right)\t\t\n\n\t\t@tree = node\n\t\t@tree\n\tend", "title": "" }, { "docid": "cd20fb2794e2b569fc39e796027b0321", "score": "0.70761156", "text": "def build_tree(arr)\n\t\t@tree_array = []\n\t\tarr.each do |x|\n\t\t\tnode = Node.new\n\t\t\tnode.value = x\n\t\t\tif @root.nil?\n\t\t\t\t@root = node\n\t\t\telse\n\t\t\t\tadd_node(node,@root)\n\t\t\tend\n\t\t\t@tree_array << node\n\t\tend\n\tend", "title": "" }, { "docid": "60ef2ef6fff6f585e0ac7a77e31ca8a0", "score": "0.7035871", "text": "def build_tree(array)\n return nil if array.empty?\n\n mid = (array.length - 1) / 2\n root = Node.new(array[mid])\n\n root.left = build_tree(array[0...mid])\n root.right = build_tree(array[mid+1..-1])\n\n root\n end", "title": "" }, { "docid": "6d38477c206f84d2102aa47bd976fbce", "score": "0.6973648", "text": "def initialize( treeData )\n \n# Initialize the node variables. By default, we are going\n# to treat this node as the root node (unless the incoming\n# tree data only has one top-level key, in which case that\n# will be the root node).\n \n@name = \"root\";\n@childNodes = [];\n \n# Check to see how many top-level keys the tree data has.\n# If it only has one, we can use it to define this tree\n# node; if it has more than one, will have to treat it as\n# the child data of the \"root\" node.\n \nif (treeData.size() == 1)\n \n# We only have one top-level key. We can use that to\n# define this tree node.\n \n@name = treeData.keys()[ 0 ];\n \n# Convert the sub-level tree data into the chile nodes\n# of this tree node.\n \ntreeData[ @name ].each{ |key, value| @childNodes.push(Tree.new( { key => value } )); };\n \nelse\n \n# We have more than one top-level key. We need to\n# create a root node to house multiple nodes.\n \ntreeData.each{ |key, value| @childNodes.push(Tree.new( { key => value } )); };\n \nend\n \nend", "title": "" }, { "docid": "625573b3631c13be532378a00befb160", "score": "0.6969317", "text": "def initialize(array)\n\n\t\t# First value in the array becomes the root of the new tree\n\t\t@root = Node.new(array[0], nil, nil, nil)\n\n\t\t# Loops through the rest of the array, adding the values to the correct spot in the binary tree in the order that they come up in the array\n\t\t(array.length - 1).times do |i|\n\t\t\tadd(array[i + 1])\n\t\tend\n\tend", "title": "" }, { "docid": "4d1983a81e979470ea9f5aeffa997cea", "score": "0.6964934", "text": "def build_tree\n\t\tdata_set[1..-1].each { |value| place(Node.new(value)) }\n\tend", "title": "" }, { "docid": "a2020a125d0d629b2327b0ba9f211ca1", "score": "0.6928627", "text": "def initialize data\n build_tree(data)\n end", "title": "" }, { "docid": "3bd4c59256560fc2c6383ec92e1cb573", "score": "0.6907543", "text": "def build_tree(array = @array)\n return Node.new(array[0]) if array.length == 1 # [two blocks]\n return Node.new(array[0],nil,Node.new(array[1])) if array.length == 2\n\n node = Node.new\n middle = (array.length-1)/2.floor # [recursion]\n node.value = array[middle]\n node.left_child = build_tree(array[0..middle-1])\n node.right_child = build_tree(array[middle+1..-1])\n return node # [final answer]\n end", "title": "" }, { "docid": "689862fd8c2b11698902a174effed983", "score": "0.6899381", "text": "def build_explicit_rb_tree(array)\n if array.length == 0\n nil\n else\n node = RedBlackNode.new(array[0])\n node.color = array[1]\n if array.length > 2\n node.add_left_child(build_explicit_rb_tree(array[2]))\n node.add_right_child(build_explicit_rb_tree(array[3]))\n end\n end\n node\nend", "title": "" }, { "docid": "6270486fed17ce8f675c64986bab3156", "score": "0.6878338", "text": "def build_tree(arr)\n\t\t@root = Node.new(arr[(arr.size/2)]) # Set a random element from the mid of the array as the @root.\n\t\tarr.delete_at(arr.size/2) # and delete that element from the array \n\n\t# Iterate through the array until both l_child and r_child has been set for the @root.\n\t\tuntil @root.l_child != nil && @root.r_child != nil\n\t\t\tarr.each_with_index do |value, index|\n\t\t\t\tif value < @root.value && @root.l_child == nil\n\t\t\t\t\tnode = Node.new(value)\n\t\t\t\t\[email protected]_child = node\n\t\t\t\t\tnode.parent = @root\n\t\t\t\t\tarr.delete_at(index) # And eliminate those elements from the array when choosen.\n\t\t\t\telsif value > @root.value && @root.r_child == nil\n\t\t\t\t\tnode = Node.new(value)\n\t\t\t\t\[email protected]_child = node\n\t\t\t\t\tnode.parent = @root\n\t\t\t\t\tarr.delete_at(index)\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\tinsert_nodes(arr)\n\tend", "title": "" }, { "docid": "8afed5218d65aa2596d78e3669f9326d", "score": "0.6876312", "text": "def build_tree(data_array)\n #children = n * 2 + 1 and + 2\n node_array = []\n \n # Convert all data into Nodes\n data_array.each do |element|\n to_add = Node.new\n to_add.value = element\n node_array += Array(to_add)\n end\n \n temp_array = node_array.dup\n sorted_array = []\n \n # Extract the smallest node and push it into sorted_array\n # The tree will be sorted by default\n while(temp_array.length != 0)\n min_val = 999_999_999\n min_index = -1\n \n # Find the smallest node\n temp_array.each_with_index do |node, index|\n if(node.value < min_val)\n min_val = node.value\n min_index = index\n end\n end\n \n # Remove it and push it into sorted_array\n sorted_array += Array(temp_array[min_index])\n temp_array.delete_at(min_index)\n end\n \n node_array = sorted_array\n \n # Link the nodes together\n node_array.each_with_index do |node, index|\n for i in (1..2) do\n if(node_array[index * 2 + i] != nil)\n node.left = node_array[index * 2 + i] if(i == 1)\n node.right = node_array[index * 2 + i] if(i == 2)\n node_array[index * 2 + i].parent = node\n end\n end\n end\n \n return node_array[0]\n #return node_array\nend", "title": "" }, { "docid": "bcbc1777be5d80a4c19974c067dc0c5b", "score": "0.6859044", "text": "def show_tree(array)\n puts \"\"\n array.each do |x|\n puts \"#{x} value #{x.value if !x.nil?} #{x.left.value if !x.left.nil?} #{x.right.value if !x.right.nil?}\"\n end\nend", "title": "" }, { "docid": "6bce4e8a366b3258f42f7df3e54786e7", "score": "0.68443304", "text": "def build_tree(ary)\n index = 0\n @root = Node.new(ary[index])\n index += 1\n while index < ary.length\n insert(ary[index], @root)\n index += 1\n end\n end", "title": "" }, { "docid": "836b3ddbc7d95a71ddbbaddc313debbb", "score": "0.6821225", "text": "def display_tree\n puts \" #{@root.value}\"\n puts \" / \\\\\"\n puts \" / \\\\\"\n puts \" #{@root.left_child.value} #{@root.right_child.value}\"\n puts \" / \\\\ / \\\\ \"\n puts \" #{@root.left_child.left_child.value} #{@root.left_child.right_child.value} #{@root.right_child.left_child.value} #{@root.right_child.right_child.value}\"\n puts \" / \\\\ \\\\\"\n puts \" #{@root.right_child.left_child.left_child.value} #{@root.right_child.left_child.right_child.value} #{@root.right_child.right_child.right_child.value}\"\n puts \" /\"\n puts \" #{@root.right_child.right_child.right_child.left_child.value}\"\n puts \" / \\\\\"\n puts \" #{@root.right_child.right_child.right_child.left_child.left_child.value} #{@root.right_child.right_child.right_child.left_child.left_child.value}\"\n \n end", "title": "" }, { "docid": "90fddbb00e77a599b856e042fa42ef00", "score": "0.6794298", "text": "def build_tree(ary)\n #root is a random ary element (deleted after declaration)\n root = Node.new(ary.delete_at(rand(ary.length)))\n while ary.size > 0\n child = Node.new(ary.shift)\n attach_child_to_node(root, child)\n end\n\n print_tree(root)\n puts breadth_first_search(root, 7)\n puts dfs_rec(root, 7)\n puts depth_first_search(root, 7)\nend", "title": "" }, { "docid": "ec9748169ad63cc5c82b98c761123127", "score": "0.67799586", "text": "def build_tree(dataSet)\r\n\t\tdataSet.each do |value|\r\n\t\t\tmake_branch(value)\r\n\t\tend\r\n\tend", "title": "" }, { "docid": "7173f63fd121e0adb835b630f2a7170c", "score": "0.6768786", "text": "def build_tree(array = @array)\n return Node.new(array[0]) if array.length == 1 # [two blocks]\n return Node.new(array[0],nil,Node.new(array[1])) if array.length == 2\n # two blocks because [0..middle-1] on length 2 returns length 2.\n\n node = Node.new\n middle = (array.length-1)/2.floor # [recursion]\n node.value = array[middle]\n node.left_child = build_tree(array[0..middle-1])\n node.right_child = build_tree(array[middle+1..-1])\n return node # [final answer]\n end", "title": "" }, { "docid": "9af2e4adccb32e56a48a4040c207b638", "score": "0.67685395", "text": "def make_binary_tree(sorted_array, parent)\n if sorted_array.length == 0\n return nil\n elsif sorted_array.length == 1\n return TreeNode.new(sorted_array[0], parent)\n end\n divide_index = sorted_array.length / 2\n tree_node = TreeNode.new(sorted_array[divide_index], parent)\n tree_node.left = make_binary_tree(sorted_array[0..divide_index-1], tree_node)\n tree_node.right = make_binary_tree(sorted_array[divide_index+1..sorted_array.length-1], tree_node)\n return tree_node\nend", "title": "" }, { "docid": "f75e8c192bc8b3011e7b76daef55cfe1", "score": "0.6755047", "text": "def build_tree(array)\n if array.empty? then return nil end\n\n tree = Node.new(array[0])\n lesser_array = array[1..-1].select { |element| element <= array[0] }\n greater_array = array[1..-1].select { |element| element > array[0] }\n\n tree.left_child = build_tree(lesser_array)\n tree.left_child.parent = tree if not tree.left_child.nil?\n tree.right_child = build_tree(greater_array)\n tree.right_child.parent = tree if not tree.right_child.nil?\n\n return tree\nend", "title": "" }, { "docid": "7cebcc0ff9ecf3224dd5da2fb843ad78", "score": "0.6752238", "text": "def make_binary_tree(sorted_array)\n if sorted_array.length == 0\n return nil\n elsif sorted_array.length == 1\n return TreeNode.new(sorted_array[0])\n end\n divide_index = sorted_array.length / 2\n tree_node = TreeNode.new(sorted_array[divide_index])\n tree_node.left = make_binary_tree(sorted_array[0..divide_index-1])\n tree_node.right = make_binary_tree(sorted_array[divide_index+1..sorted_array.length-1])\n return tree_node\nend", "title": "" }, { "docid": "7cebcc0ff9ecf3224dd5da2fb843ad78", "score": "0.6752238", "text": "def make_binary_tree(sorted_array)\n if sorted_array.length == 0\n return nil\n elsif sorted_array.length == 1\n return TreeNode.new(sorted_array[0])\n end\n divide_index = sorted_array.length / 2\n tree_node = TreeNode.new(sorted_array[divide_index])\n tree_node.left = make_binary_tree(sorted_array[0..divide_index-1])\n tree_node.right = make_binary_tree(sorted_array[divide_index+1..sorted_array.length-1])\n return tree_node\nend", "title": "" }, { "docid": "7cebcc0ff9ecf3224dd5da2fb843ad78", "score": "0.6752238", "text": "def make_binary_tree(sorted_array)\n if sorted_array.length == 0\n return nil\n elsif sorted_array.length == 1\n return TreeNode.new(sorted_array[0])\n end\n divide_index = sorted_array.length / 2\n tree_node = TreeNode.new(sorted_array[divide_index])\n tree_node.left = make_binary_tree(sorted_array[0..divide_index-1])\n tree_node.right = make_binary_tree(sorted_array[divide_index+1..sorted_array.length-1])\n return tree_node\nend", "title": "" }, { "docid": "1ec6bc58978a9abd4d91d1d912631562", "score": "0.67310965", "text": "def tree; end", "title": "" }, { "docid": "1ec6bc58978a9abd4d91d1d912631562", "score": "0.67310965", "text": "def tree; end", "title": "" }, { "docid": "491cbfa98c5d7901d3fb0f484ee409e9", "score": "0.67293525", "text": "def build_tree(arr)\n return nil if arr.empty?\n\n mid = (arr.length - 1)/2\n\n root = Node.new(arr[mid])\n root.left = build_tree(arr[0...mid])\n root.right = build_tree(arr[mid + 1..-1])\n root\n end", "title": "" }, { "docid": "926a90d833a58b05ee852e0e54fd27c4", "score": "0.6723651", "text": "def build_tree(array, start = 0, array_end = array.length - 1)\n return nil if start > array_end\n\n middle = (start + array_end) / 2\n node = Node.new(array[middle])\n node.left = build_tree(array, start, middle - 1)\n node.right = build_tree(array, middle + 1, array_end)\n node\n end", "title": "" }, { "docid": "eaefd30dd28a66bde137c26e42528e09", "score": "0.67180663", "text": "def make_tree(arr)\n # randomize the order of the input to avoid situations where the height of the tree will be close to its number of elements\n arr.shuffle! \n root = Node.new arr[-1]\n arr.pop\n arr.each {|num| root.insert(num)}\n root\nend", "title": "" }, { "docid": "1fb723283f8d7636c27fea7508553521", "score": "0.67159593", "text": "def build_tree(arr)\n nd_arr = clean_arr(arr)\n\n return nil if 0 > nd_arr.length - 1\n\n middle = nd_arr.length / 2\n\n node = Node.new(nd_arr[middle])\n\n node.left = build_tree(nd_arr.slice(0...middle))\n\n node.right = build_tree(nd_arr.slice((middle + 1)...nd_arr.length))\n\n node\n end", "title": "" }, { "docid": "a07683da901e18d93a637a79f14ec3c1", "score": "0.6700029", "text": "def test_build_tree\n\tarr = []\n\t20.times do\n\t\tarr << rand(50)\n\tend\n\ttree = BinarySearchTree.new(arr)\n\t#just for visualisation\n\ttree_array = tree.tree_array\n\tputs tree_array[0].left_child\n\ti = 0\n\ttree_array.each do |x|\n\t\tif i ==0\n\t\t\tputs \" <left = #{x.check_left}><value = #{x.value}>\t<parent = #{x.check_parent}><right = #{x.check_right}>\"\n\t\t\ti +=1\n\t\telse\n\t\t\tunless x.parent.nil? \n\t\t\t\tputs \" <left = #{x.check_left}>\t\t\t\t\t<#{x.value}>\t<parent = #{x.check_parent}>\t\t\t\t\t<right = #{x.check_right}>\"\n\t\t\tend\n\t\tend\n\tend\n\tvalue = rand(50)\n\tunless tree.dfs_rec(value,tree.root)\n\t\tputs \"#{value} not found\"\n\tend\n\t\nend", "title": "" }, { "docid": "2ba68d0cbfc592e5309ff0e700cc4acc", "score": "0.66994506", "text": "def build_tree(ary)\n ary.each do |element|\n add element\n end\n end", "title": "" }, { "docid": "71a9df419651cdb23479e8cd9168ac86", "score": "0.6692087", "text": "def build_tree(arr)\n @root = Node.new(arr[0])\n for index in (1...arr.length)\n temp_root_node = @root\n new_node = Node.new(arr[index])\n while temp_root_node.left_child != nil || temp_root_node.right_child != nil\n if temp_root_node.value < new_node.value # If new value is bigger than current\n if temp_root_node.right_child == nil\n new_node.parent = temp_root_node\n temp_root_node.right_child = new_node\n break\n else\n temp_root_node = temp_root_node.right_child\n end\n elsif temp_root_node.value > new_node.value # If new value is smaller than current\n if temp_root_node.left_child == nil\n new_node.parent = temp_root_node\n temp_root_node.left_child = new_node\n break\n else\n temp_root_node = temp_root_node.left_child\n end\n end # End of temp_root_node.value < new_node.value\n end # End of while loop\n\n # In the case that the current node is a leaf node\n if temp_root_node.left_child.nil? && temp_root_node.right_child.nil?\n new_node.parent = temp_root_node\n temp_root_node.value > new_node.value ? temp_root_node.left_child = new_node : temp_root_node.right_child = new_node\n end\n end # End of for loop\n\n end", "title": "" }, { "docid": "2eb4c6a0a08c826e2ce5c943566b5280", "score": "0.6685209", "text": "def build_tree_sorted(array, left=0, right=array.length-1, parent=nil)\n return if left > right\n mid = (left + right)/ 2 \n node = Node.new(array[mid], nil, nil, nil)\n\n node.left = build_tree_sorted(array, left, mid-1, array[mid])\n node.right = build_tree_sorted(array, mid+1, right, array[mid])\n node.parent = parent unless parent.nil?\n\n node\nend", "title": "" }, { "docid": "2455503e12435d6642a5010449612bae", "score": "0.6679011", "text": "def build_tree(ary)\n @root = Node.new(ary[0])\n temp_root = @root\n ary[1..-1].each do |elem|\n insert(temp_root, elem)\n end\n root\n end", "title": "" }, { "docid": "b8865660115373a3165b7ee380391bbd", "score": "0.6678771", "text": "def arrayToTree(ar, i)\n\n # this if statement actually is done last (at the bottom of the tree)\n if(i >= ar.length || ar[i]==0)\n return nil\n end\n\n node = Node.new(ar[i])\n node.left = arrayToTree(ar, 2*i+1)\n node.right = arrayToTree(ar, 2*i+2)\n return node\nend", "title": "" }, { "docid": "f21c29368a8be6bb8f38ba9b58350c4d", "score": "0.6665293", "text": "def build_tree(arr)\n return nil if arr.empty?\n\n mid = (arr.length - 1) / 2\n\n root = Node.new(arr[mid])\n \n root.left = build_tree(arr[0...mid])\n\n root.right = build_tree(arr[(mid + 1)..-1])\n\n return root\n end", "title": "" }, { "docid": "721af444422a64ad49e9870b331b9117", "score": "0.6655481", "text": "def build_tree_from_sorted(ary)\n root = Node.new(ary.shift)\n current_node = root\n\n while ary.size > 0\n child = Node.new(ary.shift)\n attach_child_to_node(current_node, child)\n puts \"node #{current_node.value} with child #{current_node.right_child.value}\"\n current_node = child\n end\nend", "title": "" }, { "docid": "d4ee07961ab69d3ee3bb8e38c407b7e1", "score": "0.6628593", "text": "def build_tree(data)\n @root.value = data[0] unless data.empty?\n data[1..-1].each do |value|\n new_node = Node.new(value)\n node = @root\n saved_node = nil\n until node == nil\n if value >= node.value\n saved_node = node\n node = node.right_child\n else\n saved_node = node\n node = node.left_child\n end\n end\n if value >= saved_node.value\n saved_node.right_child = new_node\n new_node.parent = saved_node\n else\n saved_node.left_child = new_node\n new_node.parent = saved_node\n end\n end\n end", "title": "" }, { "docid": "edf5c804d302cb310727a2192b730abe", "score": "0.6620985", "text": "def create_BST(array)\n mid = (array.length - 1)/2\n tree = Node.new({:value => array[mid]})\n\n if array.length > 1\n left = array[0..mid-1]\n right = array[mid+1..array.length-1]\n tree.left = create_BST(left)\n tree.right = create_BST(right)\n end\n tree\nend", "title": "" }, { "docid": "12697661406331d08fb47021c1b99bc7", "score": "0.66180634", "text": "def build_tree(preorder, inorder)\n\nend", "title": "" }, { "docid": "153d206b89b00743169de2e75bc4a84b", "score": "0.66172343", "text": "def createTree\n #size = depth of tree? \n #self.parent = data[0]\n #get pairs from rest? [-1,-1] or [1,2]\n #self.right = \nend", "title": "" }, { "docid": "ee3cfc16213046448050d2e95b28fac2", "score": "0.66068995", "text": "def build_tree(arr, first = 0, last = arr.length - 1)\n return nil if first > last\n \n middle = (first + last) / 2 \n root = Node.new(arr[middle])\nroot.left_child = build_tree(arr, first, middle-1)\nroot.right_child = build_tree(arr, middle+1, last)\nroot\n end", "title": "" }, { "docid": "78b224b2476e7add66b8645ff601850a", "score": "0.66015154", "text": "def initialize(array)\n @arr = array.sort.uniq\n @root = build_tree(@arr)\n end", "title": "" }, { "docid": "1b2267ac134447f1e719113b615e5f4d", "score": "0.6598244", "text": "def print_tree\n num = 9\n @all_levels.each do |arr|\n spaces = ' ' * num\n p arr.join(spaces).center(50)\n num -= 2\n end\n end", "title": "" }, { "docid": "6c2a6c86111f0fad2b3af29e9175a497", "score": "0.6594918", "text": "def get_tree(data)\n # get basic info about attributes and classes\n basic_info = {}\n basic_info[:attr] = [] # possible values of each attribute\n basic_info[:class] = [] # possible classes of data\n\n data.each do |row|\n row.first.each_with_index do |value, index|\n basic_info[:attr][index] = [] if basic_info[:attr][index].nil?\n basic_info[:attr][index].append(value) unless basic_info[:attr][index].include? value\n end\n\n basic_info[:class].append(row.last) unless basic_info[:class].include? row.last\n end\n\n # create tree\n tree = get_node(basic_info, data, [])\n\n # top node -> entire tree\n tree.type = 'tree'\n tree\nend", "title": "" }, { "docid": "9e44ff2257b01598d49e8cafbb4849b2", "score": "0.65946585", "text": "def build_tree(array = @array, start = 0, final = array.length)\n if start > final\n return nil\n else\n mid = (start + final) / 2\n root = Node.new(array[mid])\n root.left = build_tree(array, start, (mid - 1))\n root.right = build_tree(array, (mid + 1), final)\n @root = root\n return root\n end\n end", "title": "" }, { "docid": "822d34f1467e45dc10f100ba6dfd8cf4", "score": "0.6584409", "text": "def driver\n array = Array.new(25) { rand(1..100) }\n tree = Tree.new(array)\n tree.build_tree\n tree.pretty_print\n p tree.balanced?\n tree.insert(101)\n tree.insert(105)\n tree.insert(106)\n tree.insert(109)\n tree.pretty_print\n p tree.balanced?\n tree.rebalance\n tree.pretty_print\n p tree.balanced?\n p tree.preorder\n p tree.inorder\n p tree.postorder\nend", "title": "" }, { "docid": "572fc38425b1ff46c3abaead0a05198e", "score": "0.65730745", "text": "def build_tree(arr)\n arr.sort!.uniq!\n \n return Node.new(nil) if arr.empty?\n return Node.new(arr[0]) if arr.length == 1\n med = arr.length / 2\n return Node.new(arr[med], build_tree(arr[0...med]), build_tree(arr[(med+1)..]))\n end", "title": "" }, { "docid": "7c698fb40eff4f562d9de7d603a33be6", "score": "0.65717465", "text": "def display_tree()\t\t\t\t\t\t\n\t\tlist = []\n\t\tyield @tree.value\n\t\tleft_child = @tree.left_child\n\t\tright_child = @tree.right_child\n\n\t\tlist << left_child if left_child != nil\n\t\tlist << right_child if right_child != nil\n\n\t\tloop do\n\t\t\tbreak if list.empty?\n\t\t\tnode = list.shift\n\t\t\tyield node.value\n\t\t\tlist << node.left_child if node.left_child != nil\n\t\t\tlist << node.right_child if node.right_child != nil\n\t\tend\n\tend", "title": "" }, { "docid": "348c84676428c512a63941a3f615648b", "score": "0.6560064", "text": "def build_tree_sorted(array, tree=[])\n\t\tif tree.length == 1\n\t\t\ttree[0].parent.left_child ||= tree[0] or tree[0].parent.right_child ||= tree[0]\n\t\tend\n\n\t\ttree if array.empty? and tree.empty?\n\t\tarray.sort!.each { |i| tree << Node.new(i) } unless array.empty?\n\n\t\tleft = tree.slice(0, (tree.length)/2)\n\t\tright = tree.slice((tree.length/2+1)..-1)\n\n\t\tlc = left.length/2\n\t\trc = right.length/2\n\t\tpar = tree.length/2\n\n\t\tunless left.empty?\n\t\t\tleft[lc].parent = tree[par]\n\t\t\ttree[par].left_child = left[lc]\n\t\t\tbuild_tree_sorted([], left)\n\t\tend\n\n\t\tunless right.empty?\n\t\t\tright[rc].parent = tree[par]\n\t\t\ttree[par].right_child = right[rc]\n\t\t\tbuild_tree_sorted([], right) \n\t\tend\n\n\t\t@tree = tree\n\t\t@tree\n\tend", "title": "" }, { "docid": "c19f527fa1ed38cfb2d7cf9dfb6fed43", "score": "0.6559989", "text": "def build_tree(array)\n btsArray = []\n \n array.each_with_index do |e, index|\n if index == 0\n btsArray.push(node = Node.new(e))\n else\n parentNode = compare(btsArray[0], e)\n btsArray.push(node = Node.new(e, parentNode))\n puts parentNode.class\n puts \"Value being pushed is #{e}\"\n if parentNode.class != nil\n if parentNode.value > e\n parentNode.left_child = btsArray[btsArray.length - 1]\n elsif parentNode.value < e\n parentNode.right_child = btsArray[btsArray.length - 1]\n #puts \"This is the set: #{btsArray[btsArray.length - 1].value}\"\n end\n end\n end\n end\n \n return btsArray\n #array[array.length/2]\nend", "title": "" }, { "docid": "2a36030bcba02572a1a8630ec2fe933f", "score": "0.6539178", "text": "def print_tree\n tree.each { |row| puts row }\n nil\n end", "title": "" }, { "docid": "deb1511b1dbbd79550d9e24af94615b4", "score": "0.6534914", "text": "def initialize(arr)\n\t\t@root = nil\n\t\tbuild_tree(arr)\n\tend", "title": "" }, { "docid": "26e5811235c2ea9004f65eae4c352f07", "score": "0.6502743", "text": "def testing\n array = [1, 7, 4, 23, 8, 9, 4, 3, 5, 7, 9, 67, 6345, 324]\n # array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]\n # array = Array.new(25) { rand(1..100) }\n tree = Tree.new(array)\n print \"\\n#{array.sort.uniq}, length = #{array.sort.uniq.length}\\n\\n\"\n tree.pretty_print\n puts\n print \"find(7) = #{tree.find(7)}\\n\\n\"\n print \"insert(66) = #{tree.insert(66)}\\n\\n\"\n tree.pretty_print\n puts\n print \"delete(67) = #{tree.delete(67)}\\n\\n\"\n tree.pretty_print\n puts\n print \"delete(66) = #{tree.delete(66)}\\n\\n\"\n tree.pretty_print\n puts\n print \"delete(1) = #{tree.delete(1)}\\n\\n\"\n tree.pretty_print\n puts\n print \"delete(8) = #{tree.delete(8)}\\n\\n\"\n tree.pretty_print\n puts\n print \"Level Order: #{tree.level_order}\\n\\n\"\n tree.rebalance\n tree.pretty_print\n puts\n print \"Preorder: #{tree.preorder}\\n\\n\"\n print \"Inorder: #{tree.inorder}\\n\\n\"\n print \"Postorder: #{tree.postorder}\\n\\n\"\n print \"Depth(6345): #{tree.depth(tree.find(6345))}\\n\\n\"\n print \"Depth(9): #{tree.depth(tree.find(9))}\\n\\n\"\n print \"Depth(4): #{tree.depth(tree.find(4))}\\n\\n\"\n print \"Depth(7): #{tree.depth(tree.find(7))}\\n\\n\"\n\n print \"Height(7): #{tree.height(tree.find(7))}\\n\\n\"\n print \"Height(23): #{tree.height(tree.find(23))}\\n\\n\"\n print \"Height(3): #{tree.height(tree.find(3))}\\n\\n\"\n\n print \"Balanced?: #{tree.balanced?}\\n\\n\"\n print \"delete(3) = #{tree.delete(3)}\\n\\n\"\n print \"delete(5) = #{tree.delete(5)}\\n\\n\"\n print \"Balanced?: #{tree.balanced?}\\n\\n\"\n tree.pretty_print\n puts\n tree.rebalance\n tree.pretty_print\n puts\n print \"Balanced?: #{tree.balanced?}\\n\\n\"\nend", "title": "" }, { "docid": "1af43de893a25dc399a3e8e0871180e6", "score": "0.6496431", "text": "def build_tree(arr)\n return nil if arr.empty?\n return Node.new(arr[0]) if arr.length < 2\n\n arr.sort.uniq\n mid = arr.length / 2\n node = Node.new(arr[mid]) # At first iteration this will be the root of the entire tree\n node.left = build_tree(arr[0..mid - 1]) # Get the left subtree\n node.right = build_tree(arr[mid + 1..-1]) # Get the right subtree\n node\n end", "title": "" }, { "docid": "0e38440552c844da07d41f0c0d5796ae", "score": "0.6496368", "text": "def initialize(array)\n @array = array\n @root = Node.new(nil)\n end", "title": "" }, { "docid": "fa8ddc23f26c2e76e698a01b208ab603", "score": "0.64933264", "text": "def build_tree(array)\n n = array.size\n parent = Node.new(array[n/2])\n array.delete_at(n/2)\n until array.size == 0\n n = array.size\n child = Node.new(array[n/2])\n array.delete_at(n/2)\n parent.child_assign(child)\n end\n parent\nend", "title": "" }, { "docid": "0717f25be65693d546b904b93f8bdc6b", "score": "0.6482672", "text": "def print_tree(node)\r\n return CATEGORY_NOT_FOUND unless node\r\n \r\n result, = print_rec(node) # grab the ASCII string from the array\r\n result.shift # remove the extra vertical bar\r\n puts result.join(\"\\n\") # print the result\r\n end", "title": "" }, { "docid": "0a78e8ec8c2755eb1942ae76d9052f7f", "score": "0.64688236", "text": "def create_binary_tree\n tree = []\n\n # initialize the tree\n @data_selected_from.each_with_index do |data, index|\n weight = @data_weights[index]\n\n tree << Hashie::Mash.new(:data => data, :weight => weight, :total_weight => weight, :node_index => index)\n end\n\n # populate the total_weight\n (tree.size - 1).downto(0).each_with_index do |node_index|\n node = tree[node_index]\n left_index = left_node_index(node_index)\n right_index = right_node_index(node_index)\n\n node.total_weight += tree[left_index].total_weight if left_index < tree.size\n node.total_weight += tree[right_index].total_weight if right_index < tree.size\n end\n\n tree\n end", "title": "" }, { "docid": "724623c69456e55f0c3418b6d83ab6d7", "score": "0.6464425", "text": "def buildTree()\n root = BabelTest::Node.new\n root.i32 = 0\n root.b = false\n \n n1_L = BabelTest::Node.new\n n1_L.i32 = 1\n n1_L.b = true\n \n n1_R = BabelTest::Node.new\n n1_R.i32 = 2\n n1_R.b = false\n\n n2_L_L = BabelTest::Node.new\n n2_L_L.i32 = 3\n n2_L_L.b = true\n \n n2_L_R = BabelTest::Node.new\n n2_L_R.i32 = 4\n n2_L_R.b = false\n\n n2_R_L = BabelTest::Node.new\n n2_R_L.i32 = 5\n n2_R_L.b = true\n\n n2_R_R = BabelTest::Node.new\n n2_R_R.i32 = 6\n n2_R_R.b = false\n\n root.next_node = [n1_L, n1_R]\n n1_L.next_node = [n2_L_L, n2_L_R]\n n1_R.next_node = [n2_R_L, n2_R_R]\n \n bt = BabelTest::BinaryTree.new\n bt.root_node = [root]\n bt\n end", "title": "" }, { "docid": "cc4bf721b5d78980acd1188d35290501", "score": "0.6439937", "text": "def construct_tree(arr)\n root = TreeNode.new(arr.shift)\n xtd = [root]\n while !xtd.empty? && !arr.empty?\n cur_node = xtd.shift\n a, b = arr.shift(2) # doesn't matter if arr.size < 2. in this case, a, b might be nil\n cur_node.left = a.nil? ? nil : TreeNode.new(a)\n cur_node.right = b.nil? ? nil : TreeNode.new(b)\n xtd << cur_node.left unless cur_node.left.nil?\n xtd << cur_node.right unless cur_node.right.nil?\n end\n root\nend", "title": "" }, { "docid": "238d1cf653e6a1ff27b63cad5a757940", "score": "0.6428698", "text": "def buildTree\n\t\t# call build method\n\t\t@root = build(@records, @attributes)\n\tend", "title": "" }, { "docid": "87a6d942b341419ae7e2d83ab12a6fd7", "score": "0.64260375", "text": "def build_tree\n root = Node.new(@arr.shift, nil, nil, 0)\n\n @arr.each do |element|\n depth = 1\n current_node = root\n direction = determine_branch(current_node, element) \n\n while !!check_for_child(current_node, direction)\n current_node = check_for_child(current_node, direction)\n direction = determine_branch(current_node, element)\n depth += 1\n end\n \n place_child(current_node, element, direction, depth)\n end\n \n root\n end", "title": "" }, { "docid": "dce35a2d952a54b2ee379cd6c32c018c", "score": "0.6413596", "text": "def make_tree(arr, start_point = 0, end_point = arr.length)\n return nil if start_point > end_point\n\n middle_point = (start_point + end_point).div(2)\n node = Node.new(arr[middle_point])\n\n node.left = make_tree(arr, start_point, middle_point - 1)\n node.right = make_tree(arr, middle_point + 1, end_point)\n\n node.left = nil if !node.left.nil? && node.left.data.nil?\n node.right = nil if !node.right.nil? && node.right.data.nil?\n node\n end", "title": "" }, { "docid": "02cff19e2a7441234edf9627ebfa1fca", "score": "0.6402047", "text": "def build_tree_sorted(ary)\n return Node.new(ary[0]) if ary.length == 1\n return nil if ary.empty?\n root = Node.new(midpoint(ary))\n branch1, branch2 = branches(ary)\n root.left_child = build_tree(branch1)\n root.right_child = build_tree(branch2)\n return root\nend", "title": "" }, { "docid": "e2afa106a910d6c1eeb4d5bef16418f2", "score": "0.63968045", "text": "def do_tree(*a)\n return if $debugmode == false\n \n STDOUT.puts get_root\n end", "title": "" }, { "docid": "8b735c78150eb7a1ae288b6de7835043", "score": "0.63964367", "text": "def printf\n return if !@root\n elements = []\n elements << @root\n while(elements[0])\n elements << elements[0].left if elements[0].left\n elements << elements[0].right if elements[0].right\n puts \"Data: #{elements[0].data}; Parent: #{elements[0].parent.data if elements[0].parent}\"\n elements.shift\n end\n end", "title": "" }, { "docid": "a0f4ea6feaabbd2e6c054b53427cd1d9", "score": "0.6393871", "text": "def build_tree(array, start, finish)\n #base case\n return nil if start > finish\n\n mid = (start + finish) / 2\n root = Node.new(array[mid])\n\n root.left = build_tree(array, start, mid-1)\n root.right = build_tree(array, mid+1, finish)\n\n return root\n end", "title": "" }, { "docid": "aa148ad3ed719d5c51d51399f201aa49", "score": "0.63898665", "text": "def driver_script\n array = Array.new(25) { rand(1..100) }\n tree = Tree.new(array)\n print_tree(tree)\n print \" Balanced?: #{tree.balanced?}\\n\\n\"\n print \"Level Order: #{tree.level_order}\\n\\n\"\n print \" PreOrder: #{tree.preorder}\\n\\n\"\n print \" InOrder: #{tree.inorder}\\n\\n\"\n print \" PostOrder: #{tree.postorder}\\n\\n\"\n print \"Insert(330): #{tree.insert(330)}\\n\\n\"\n print \"Insert(440): #{tree.insert(440)}\\n\\n\"\n print \"Insert(220): #{tree.insert(220)}\\n\\n\"\n print \"Insert(110): #{tree.insert(110)}\\n\\n\"\n print_tree(tree)\n print \" Balanced?: #{tree.balanced?}\\n\\n\"\n print \" Rebalance: #{tree.rebalance}\\n\\n\"\n print_tree(tree)\n print \" Balanced?: #{tree.balanced?}\\n\\n\"\n print \"Level Order: #{tree.level_order}\\n\\n\"\n print \" PreOrder: #{tree.preorder}\\n\\n\"\n print \" InOrder: #{tree.inorder}\\n\\n\"\n print \" PostOrder: #{tree.postorder}\\n\\n\"\nend", "title": "" }, { "docid": "8066fe1b167b7238c8612f4f642d239f", "score": "0.6389239", "text": "def make_tree\n # this is where the levels of the merk tree will be stored\n layer = @raw.clone\n size = 99\n d = Digest::SHA256.new\n @tree = []\n @tree << @raw.collect do |r|\n d.reset\n d << r.to_s\n d.hexdigest\n end\n\n while size > 1\n layer2 = hash_all(layer)\n\n @tree << layer2.clone\n layer = layer2.clone\n size = layer.size\n end\n\n # but doing this gives you the raw data at the top and the single-node apex at the bottom\n # this is confusing so the tree needs to be flipped upside down.\n @tree.reverse!\n end", "title": "" }, { "docid": "dea3e27a17a44dbac20a10749960aaaf", "score": "0.6377805", "text": "def build_tree(tree_size, input)\n nodes = Array.new(tree_size) { Node.new(nil, nil, nil) }\n\n tree_size.times do |i|\n line = input.next\n val, left, right = line.chomp.split.map(&:to_i)\n nodes[i].val = val\n nodes[i].left = nodes[left] unless left == -1\n nodes[i].right = nodes[right] unless right == -1\n end\n \n nodes.first\nend", "title": "" }, { "docid": "dea3e27a17a44dbac20a10749960aaaf", "score": "0.6377805", "text": "def build_tree(tree_size, input)\n nodes = Array.new(tree_size) { Node.new(nil, nil, nil) }\n\n tree_size.times do |i|\n line = input.next\n val, left, right = line.chomp.split.map(&:to_i)\n nodes[i].val = val\n nodes[i].left = nodes[left] unless left == -1\n nodes[i].right = nodes[right] unless right == -1\n end\n \n nodes.first\nend", "title": "" }, { "docid": "588bb586cf5a2fd0873b57722d148103", "score": "0.6358369", "text": "def build_tree(arr)\n arr = sort(arr)\n arr = arr.uniq\n make_tree(arr)\n end", "title": "" }, { "docid": "e4a98f643966588afd00606dbe055077", "score": "0.63555956", "text": "def build_tree(array,parent=nil)\n root_value = array[array.length/2]\n left_values = array[0..array.length/2-1]\n right_values = array[array.length/2+1..-1]\n\n # Creates a Node object with the root value and assign the parent Node if\n # there is one.\n root = Node.new(root_value,parent)\n @root = root if @root == nil\n\n # If there's only one value left in the left array, creates a Node object\n # with it. Else, calls build_tree recursively.\n if left_values.length == 1\n root.left = Node.new(left_values[0],root)\n elsif left_values.length > 1\n root.left = build_tree(left_values,root)\n end\n\n # Does the same as before with the right side.\n if right_values.length == 1\n root.right = Node.new(right_values[0],root)\n elsif right_values.length > 1\n root.right = build_tree(right_values,root)\n end\n\n return root\n end", "title": "" }, { "docid": "8eb15447f7c5acb6d6aecd950995ff8e", "score": "0.63382447", "text": "def to_bst(array)\n mid_index = array.length / 2\n # Create node from middle value\n node = Tree::Node.new(array[mid_index])\n if array.length > 1\n left_array = array[0..mid_index - 1]\n right_array = array[mid_index + 1..array.length - 1]\n\n # Create subtrees\n node.left = to_bst(left_array) if left_array.length > 0\n node.right = to_bst(right_array) if right_array.length > 0\n end\n node\nend", "title": "" }, { "docid": "5b9a3ecc3c9e23081e9eb05811268ba8", "score": "0.6335985", "text": "def createTree(height)\n\n #puts \"\\n\\n#{@code}\\n\\n\"\n current_node = nil\n\n if @code[0] == \"0\"\n\n #damos por hecho el nodo es una rama y generamos los dos hijos\n data = Information.new(\"father\",height)\n current_node = Node.new(data)\n\n @code = @code[[email protected]]\n\n ##Comemos la cadena validada con\n current_node.setLeft( createTree(height - 1 ) )\n\n current_node.setRight( createTree(height + 1) )\n\n return current_node\n\n elsif @code[0] == \"1\"\n\n #Obtenemos la inofacion del codigo\n caracter = [@code[1..8].join]\n\n data = Information.new(caracter.pack('B*'),height)\n current_node = Node.new(data)\n @code = @code[[email protected]]\n\n return current_node\n end\n end", "title": "" }, { "docid": "d2e5c7878ff6ac939c7425c75d02c24a", "score": "0.6317494", "text": "def init_tree\n #Removes all the columns from the tree view.\n @treeview.columns.each {|col| @treeview.remove_column(col)}\n \n #Add the data to the @treestore model.\n unless @doc == nil\n root = @doc.root\n @treestore = Gtk::TreeStore.new(String, String)\n parent = @treestore.append(nil)\n parent[0] = root.attributes['name']\n parent[1] = nil\n\n root.elements.each do |element|\n iter = @treestore.append(parent)\n iter[0] = element.name\n iter[1] = nil\n \n if element.name == 'PrinceText' && element.has_attributes?\n iter2 = @treestore.append(iter)\n iter2[0] = element.attributes['name']\n iter2[1] = element.attributes['path']\n else\n element.elements.each do |element2|\n iter2 = @treestore.append(iter)\n iter2[0] = element2.attributes['name']\n iter2[1] = element2.attributes['path']\n end\n end\n end\n end\n \n #Adds the renderer to the tree view.\n @treeview.model = @treestore\n renderer = Gtk::CellRendererText.new\n col = Gtk::TreeViewColumn.new(\"Project\", renderer, :text => 0)\n @treeview.append_column(col)\n end", "title": "" }, { "docid": "26d22e61649892025d2acba0a82cc04e", "score": "0.63022846", "text": "def create_tree\n\t\tqueue = [@head]\n\t\twhile !queue.empty?\n\t\t\tcurrent_node = queue.pop\n\t\t\tif has_children?(current_node.text)\n\t\t\t\tcurrent_node.children = []\n\t\t\t\tcreate_children(current_node, queue)\n\t\t\telse\n\t\t\t\tcurrent_node.text = current_node.text.strip\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "e68fb9ef39a42b40063410f96730ab53", "score": "0.629104", "text": "def build_tree\n @string_array = html_string_array\n generate_node_tree\n @document = @parsed[0] #set root node\n end", "title": "" }, { "docid": "e55d07924821d16b6c58e06d54cc5b8c", "score": "0.62888515", "text": "def make_bst_from_array(arr)\n return nil unless arr.any?\n\n mid = arr[arr.length / 2]\n\n root = TreeNode.new(arr[mid])\n root.left = arr[0..arr.length / 2 - 1]\n root.right = arr[arr.length / 2 + 1..-1]\n root\nend", "title": "" }, { "docid": "21e9cc6c98dc85f54e9d18ac1563a537", "score": "0.62832856", "text": "def tree(connection, *args)\n commit(connection, \"tree\", *args)\n end", "title": "" }, { "docid": "6951a77fe93ac2511fc58ae425cb0ee7", "score": "0.627461", "text": "def built_tree(arr = @arr)\n \n if arr.length == 1\n return root = Node.new(arr[0])\n elsif arr.length == 0\n return nil\n else\n # Finds midpoint\n mid = arr.length / 2\n\n # creates the midpoint as the root\n root = Node.new(arr[mid])\n\n root.left = built_tree(arr[0..(mid - 1)])\n \n root.right = built_tree(arr[(mid + 1)..-1])\n \n return root\n end\n end", "title": "" }, { "docid": "3b0c80ef14bb3fbf5c813105a0976d6f", "score": "0.6268779", "text": "def show_tree(tree)\n Tree.new(tree).show \n end", "title": "" }, { "docid": "98c673705079c8f586615a664e2dfd05", "score": "0.6267967", "text": "def build_tree\n #create root node\n \t@root=Node.new('document',nil,nil,nil,[],nil)\n #set initial pointer to root\n \t@pointer=@root\n \t@num_nodes=1\n #for each line, create a node at a certain level depending on the html\n \[email protected] do |line|\n \t create_nodes(line)\n \t end\n end", "title": "" }, { "docid": "6c1bafe58d6e13e4767e8edb653813f0", "score": "0.62644994", "text": "def build_tree_unsorted(array)\n # Since we can't sort the array, there's no way to know what's the\n # median of the values. So we're gonna choose a random input for the root.\n @root = Node.new(array[array.length/2])\n array.delete_at(array.length/2)\n # Calls the method to add each value to the binary tree. We're gonna let\n # the method decide where to put it.\n array.each do |value|\n add_node(value)\n end\n return @root\n end", "title": "" }, { "docid": "eb29ce934583ae176008d57fec516083", "score": "0.62561077", "text": "def printTree\n @data.map {|x| x.to_s}.join(', ')\n end", "title": "" }, { "docid": "862d6f3a8a2c6ba7defeafe2c8cb362f", "score": "0.62515336", "text": "def tree(*args)\n function(:tree, *args)\n end", "title": "" }, { "docid": "11054b4978d08ff4da0707062a7d87dd", "score": "0.62479085", "text": "def build_tree(ary)\n tree = ary.map do |value| # Creates an array of nodes\n Node.new(value)\n end\n tree[1..-1].each do |node|\n root = tree[0]\n until node.has_parent?\n if root.value > node.value\n if root.left_child.nil?\n root.left_child = node\n else\n root = root.left_child\n end\n elsif root.value <= node.value\n if root.right_child.nil?\n root.right_child = node\n else\n root = root.right_child\n end\n end\n end\n end\n return tree\nend", "title": "" }, { "docid": "8eca4beafc495b3506fd2cbefe0487a5", "score": "0.6235958", "text": "def print_tree\n space = 0\n print_tree_helper(@root, space)\n end", "title": "" }, { "docid": "b46562a3f2c48d9a5bcc026e6b1f7254", "score": "0.6230824", "text": "def tree(*args)\n commit(\"tree\", *args)\n end", "title": "" }, { "docid": "22ea017280744880536ca9c37bf70e6f", "score": "0.6224612", "text": "def build_tree\n @tree = {}\n end", "title": "" }, { "docid": "f10eb9f9357a6d4e28d8816ee9fecfa7", "score": "0.62244946", "text": "def build_binary_tree(ary, index=0)\n return nil if ary[index] == nil\n node = {value: ary[index]}\n node[:left] = build_binary_tree(ary, 2 * index + 1)\n node[:right] = build_binary_tree(ary, 2 * index + 2)\n return node\nend", "title": "" }, { "docid": "1d8c280a03275efbc13e70505eb55bc5", "score": "0.6222325", "text": "def create_bst_from_sorted_array(array)\n return nil if array.empty?\n return Bst::Node.new(array[0]) if array.length == 1\n mid = array.length / 2\n root = Bst::Node.new(array[mid])\n root.left = create_bst_from_sorted_array(array[0...mid])\n root.right = create_bst_from_sorted_array(array[mid + 1..array.length])\n root\nend", "title": "" } ]
a25b05b0e24d4dc15026c5773f843da2
Exercise 5 Reverse Write a function reverse(string) that takes in a string and returns it reversed.
[ { "docid": "7aefee03610d3c0b7226f4acd6c69306", "score": "0.0", "text": "def reverse(string)\n return string if string.length <= 1\n reverse(string[1..-1]) + string[0]\nend", "title": "" } ]
[ { "docid": "d14471b5a64486b09658bfff828f2bfa", "score": "0.83787835", "text": "def reverse(string)\n\nend", "title": "" }, { "docid": "d14471b5a64486b09658bfff828f2bfa", "score": "0.83787835", "text": "def reverse(string)\n\nend", "title": "" }, { "docid": "d14471b5a64486b09658bfff828f2bfa", "score": "0.83787835", "text": "def reverse(string)\n\nend", "title": "" }, { "docid": "322c8c8db406a972295707795ed604c7", "score": "0.83674675", "text": "def reverse(string)\nend", "title": "" }, { "docid": "322c8c8db406a972295707795ed604c7", "score": "0.83674675", "text": "def reverse(string)\nend", "title": "" }, { "docid": "6b21ef4528123d99dde7bb86c5cc2f81", "score": "0.8349258", "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": "bdbd5f954233ef5022d39bb87274f0e0", "score": "0.8337398", "text": "def reverse(str)\n return str.reverse()\nend", "title": "" }, { "docid": "bdbd5f954233ef5022d39bb87274f0e0", "score": "0.8337398", "text": "def reverse(str)\n return str.reverse()\nend", "title": "" }, { "docid": "a5c0536f7407e4254171363ac763223f", "score": "0.8279715", "text": "def reverse(string)\n puts string.reverse\nend", "title": "" }, { "docid": "268d7c2c57ffaffc53773bf606b68a8a", "score": "0.82733214", "text": "def reverse(string)\n string.reverse\nend", "title": "" }, { "docid": "268d7c2c57ffaffc53773bf606b68a8a", "score": "0.82733214", "text": "def reverse(string)\n string.reverse\nend", "title": "" }, { "docid": "8c9babbec6f7b0316ca57b1354d8f4bd", "score": "0.826541", "text": "def reverse (string)\n string.reverse\nend", "title": "" }, { "docid": "662042d8c6c05eba9b756f7e29341be6", "score": "0.82440484", "text": "def reverseString(string)\n puts string.reverse\nend", "title": "" }, { "docid": "b264a9e0f370c489ad5cfff1b70c80d0", "score": "0.82251084", "text": "def reverse_string(string)\n return string.reverse\nend", "title": "" }, { "docid": "67afd8ef85e42d74787b7f674e206435", "score": "0.82126474", "text": "def reverse(str)\n return str.reverse\nend", "title": "" }, { "docid": "04e0faf1af9abbe8c941c342c9cccf48", "score": "0.8198962", "text": "def reverseString(s)\n # Ruby has a built-in reverse function\n return s.reverse!\nend", "title": "" }, { "docid": "36d4d0698f28c27ff6eafa2295071c2a", "score": "0.8180797", "text": "def reverse(string)\n \t\tstring.reverse\nend", "title": "" }, { "docid": "6b15c49bb830367682258c93a9c5e7b2", "score": "0.8171276", "text": "def reverse(s)\n\nend", "title": "" }, { "docid": "eb7ba3537446fb5afd15b69f6295223a", "score": "0.8151078", "text": "def reverse(string)\n return \"\" if string == \"\"\n \n string[-1] + reverse(string[0..-2])\nend", "title": "" }, { "docid": "052069d0a4a1f963a1ea6b94e81cd87b", "score": "0.81412894", "text": "def reverse(string)\n return \"\" if string.length == 0\n reverse = string[0]\n reverse(string[1..-1]) + reverse\nend", "title": "" }, { "docid": "196b8fadb1a786ce6df2f79557cf0952", "score": "0.81294185", "text": "def reverse_string(string)\n string.reverse\nend", "title": "" }, { "docid": "196b8fadb1a786ce6df2f79557cf0952", "score": "0.81294185", "text": "def reverse_string(string)\n string.reverse\nend", "title": "" }, { "docid": "196b8fadb1a786ce6df2f79557cf0952", "score": "0.81294185", "text": "def reverse_string(string)\n string.reverse\nend", "title": "" }, { "docid": "9fbfa2d7c3ea640507ed82c559929345", "score": "0.81079066", "text": "def reverse_string string\n return string.reverse\nend", "title": "" }, { "docid": "9fbfa2d7c3ea640507ed82c559929345", "score": "0.81079066", "text": "def reverse_string string\n return string.reverse\nend", "title": "" }, { "docid": "9fbfa2d7c3ea640507ed82c559929345", "score": "0.81079066", "text": "def reverse_string string\n return string.reverse\nend", "title": "" }, { "docid": "8ed3aa2abda7a39fdfbca15e86164b6c", "score": "0.81029624", "text": "def reverse(s)\n # accepts a string and returns the reverse of the string by reversing all letters and all words in the string\n # ex: reverse(\"hello world\") will convert the input string to \"dlrow olleh\"\n if s.length <= 1\n return s \n else\n return s[-1] + reverse(s[1...-1]) + s[0]\n end\n \nend", "title": "" }, { "docid": "da2ae3fd99e740a5dd7db5323ca66ec7", "score": "0.81015867", "text": "def solution(str)\n str.reverse()\nend", "title": "" }, { "docid": "25c9bc326c54dd710b666bae54911822", "score": "0.80993533", "text": "def reverse_string(string)\n\tstring.reverse\nend", "title": "" }, { "docid": "25c9bc326c54dd710b666bae54911822", "score": "0.80993533", "text": "def reverse_string(string)\n\tstring.reverse\nend", "title": "" }, { "docid": "e3e07025523ed36361ec4e838809db81", "score": "0.8096039", "text": "def reverse(string)\n return \"\" if str.empty?\n reverse(string[1..-1] + string[0])\nend", "title": "" }, { "docid": "b1407fd7d32bd94d6618437ac9fda86a", "score": "0.80921286", "text": "def reverse_string(string)\n reverse = string.reverse!\nend", "title": "" }, { "docid": "be25ef935f29a25d97a50692ee1ebdaf", "score": "0.8088539", "text": "def reverse_string (string)\n string.reverse\nend", "title": "" }, { "docid": "102275edc610e91b29b02ad165365820", "score": "0.8078799", "text": "def reverse(string)\n return \"\" if string.empty?\n string[-1]+ reverse(string[0..-2])\nend", "title": "" }, { "docid": "9fc2ef270ead41f15e116997f6699a7d", "score": "0.806646", "text": "def reverse(s)\n if s.length <= 1\n return s\n else\n return rev_str = reverse(s[1..-1]) + s[0]\n end\nend", "title": "" }, { "docid": "1feafff3d6b095effd4f0ce5bef5e686", "score": "0.80592954", "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": "11c5fabd7974f05da2651d752542efd2", "score": "0.8047926", "text": "def reverse(string)\n return \"\" if string.empty?\n reverse(string[1..-1]) + string[0]\nend", "title": "" }, { "docid": "f0faa8f376af70a78f47cb74856e48f2", "score": "0.80459625", "text": "def reverse(s)\n if (s != \"\")\n return s[-1] + reverse(s[0...-1])\n else\n return \"\"\n end\nend", "title": "" }, { "docid": "5070185c3fa45c1719f261eeb28f745c", "score": "0.8041085", "text": "def reverse(str)\n str.reverse\nend", "title": "" }, { "docid": "5070185c3fa45c1719f261eeb28f745c", "score": "0.8041085", "text": "def reverse(str)\n str.reverse\nend", "title": "" }, { "docid": "81bff02da96fec1fbc1be37453c752b3", "score": "0.80380154", "text": "def reverse_string string\n\tstring.reverse\nend", "title": "" }, { "docid": "81bff02da96fec1fbc1be37453c752b3", "score": "0.80380154", "text": "def reverse_string string\n\tstring.reverse\nend", "title": "" }, { "docid": "81bff02da96fec1fbc1be37453c752b3", "score": "0.80380154", "text": "def reverse_string string\n\tstring.reverse\nend", "title": "" }, { "docid": "7c20b3815535e2bbea6a706593689b87", "score": "0.8035706", "text": "def reverse(string)\n return \"\" if string == \"\"\n string[-1] + string[0..-2].reverse\nend", "title": "" }, { "docid": "3d72879faabef7d29c82ed46b9d624a4", "score": "0.8034424", "text": "def reverse(string)\n\treturn string if string.length <= 1\n\n\treverse(string[1..-1]) + string[0]\nend", "title": "" }, { "docid": "a4525e28ef23593b6e43a644084bcc11", "score": "0.802942", "text": "def reverse_string string\n return string.reverse!\nend", "title": "" }, { "docid": "b41a85233589c7b8c146022aae75d526", "score": "0.80268955", "text": "def reverse(string)\n answer = \"\"\n range = string.length-1 \n\n range.downto(0) do |i|\n answer << string[i]\n end\n return answer\nend", "title": "" }, { "docid": "b1f4c9124dbe6c038ba94276d07761ff", "score": "0.8024142", "text": "def reverse(string) \n answer = \"\" #what will be returned. Also holds result during program\n range = string.length-1 #The '-1' is to compensate for array index.\n #Ex: \"abc\".length == 3 HOWEVER,\"abc\"[3] is a nil value. So when take away one you include the whole string.\n\n range.downto(0) do |i| #loop from the end of the string to the beginning of the string.\n answer << string[i] #gets the value, located at the given index, and add it to the empty string.\n end\n return answer #return answer at end\nend", "title": "" }, { "docid": "67abb1048b6d8edc8aa7d315e5986da5", "score": "0.80198926", "text": "def reverse_string(s)\n s.reverse! \nend", "title": "" }, { "docid": "fd343690c276fc2f4caba7933cf0a06b", "score": "0.8018819", "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": "f376e73ba4cb4f6eeae9d53c602368fd", "score": "0.80123806", "text": "def reverse(string)\n return \"\" if string.length == 0\n reverse(string[1..-1]) + string[0]\nend", "title": "" }, { "docid": "6eda566289a1edfd9afd27e51c0a577c", "score": "0.8008126", "text": "def reverse_string string\n\tstring.reverse!\nend", "title": "" }, { "docid": "a084e752b6497b6bb282ef989a22858b", "score": "0.80025226", "text": "def reverse_string string\n string.reverse\nend", "title": "" }, { "docid": "a084e752b6497b6bb282ef989a22858b", "score": "0.80025226", "text": "def reverse_string string\n string.reverse\nend", "title": "" }, { "docid": "615d466bc975d31e802310f8923f4426", "score": "0.7995329", "text": "def reverse(string)\n start_point = 0\n end_point = string.length - 1\n while start_point < end_point\n temp = string[start_point]\n string[start_point] = string[end_point]\n string[end_point] = temp\n start_point += 1\n end_point -= 1\n end\n return string\n end", "title": "" }, { "docid": "ca852be78eedf9ea68ba8d0ad9f077e3", "score": "0.79904956", "text": "def reverse(string)\n if string.length <= 1\n return string\n else \n return string[-1] + reverse(string[0..-2])\n end\nend", "title": "" }, { "docid": "c1839aa6bc3f754c6bd2026e96771d31", "score": "0.7984821", "text": "def reverse(string)\n return '' if string.empty?\n string[1..-1].reverse + string[0]\nend", "title": "" }, { "docid": "e611ee4fed3fe75d4a9596d9ed32e89e", "score": "0.79769737", "text": "def reverse(string)\n return \"\" if string.length == 0\n last = string[-1]\n new_string = string[0...-1]\n last + reverse(new_string)\nend", "title": "" }, { "docid": "2dfd6976a8d2b0c94b1acdc085931791", "score": "0.7971376", "text": "def reverse(string)\n return string if string.empty?\n\n string[-1] + reverse(string[0..-2])\nend", "title": "" }, { "docid": "4a8b8c9a5310bfbd00d48905b5305e59", "score": "0.7970219", "text": "def string_reverse(str)\n str.reverse\nend", "title": "" }, { "docid": "9f666599cb1201564cf9661406fc0f6f", "score": "0.79661757", "text": "def reverse(string)\n return '' if string.length == 0\n return string[0] if string.length == 1\n string[1.. -1] + string[0]\nend", "title": "" }, { "docid": "b2df894081aba60542233ed16be74c68", "score": "0.79617876", "text": "def reverse(s)\n return s if s.length == 0\n\n return \"#{s[-1]}#{reverse(s[0...(s.length-1)])}\"\nend", "title": "" }, { "docid": "20f85eee768ca53200c976566c38b29f", "score": "0.7961312", "text": "def reverse(string)\n return string if string.length < 2\n string[-1] + reverse(string[0...-1])\nend", "title": "" }, { "docid": "230daf520cd69e167f68fc2c4d389c2d", "score": "0.7959732", "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": "7c40e808b619fb487f2e14eeb8e515b0", "score": "0.79509825", "text": "def reverse(string)\n return \"\" if string.empty?\n char = string.slice!(-1)\n char + reverse(string)\nend", "title": "" }, { "docid": "dd6fe1dda03284265eff84b621606fdc", "score": "0.7950774", "text": "def reverse_a_string(string) # Method reverse_string with parameter 'string'.\n loop = string.length # int loop is equal to the string's length.\n word = '' # This is what we will use to output the reversed word.\n while loop > 0 # while loop is greater than 0, subtract loop by 1 and add the string's index of loop to 'word'.\n loop -= 1 # Subtract 1 from loop.\n word += string[loop] # Add the index with the int loop to word.\n end # End while loop.\n return word # Return the reversed word.\nend", "title": "" }, { "docid": "dd8f1abc3446a51c541d3e7cf862e7b2", "score": "0.79439604", "text": "def reverse(s)\n return '' if s.length == 0\n return s[s.length - 1] + reverse(s[0...-1])\nend", "title": "" }, { "docid": "ee19af2d87d365f5ed7ddde86e12c8e4", "score": "0.7935346", "text": "def reverse(s)\n if s == \"\"\n return \"\"\n else\n return s[-1] + reverse(s[0..-2])\n end\nend", "title": "" }, { "docid": "694ecbf590ed5c183f79447c4d0d44ef", "score": "0.7927625", "text": "def solution(str)\n str.reverse\nend", "title": "" }, { "docid": "694ecbf590ed5c183f79447c4d0d44ef", "score": "0.7927625", "text": "def solution(str)\n str.reverse\nend", "title": "" }, { "docid": "694ecbf590ed5c183f79447c4d0d44ef", "score": "0.7927625", "text": "def solution(str)\n str.reverse\nend", "title": "" }, { "docid": "694ecbf590ed5c183f79447c4d0d44ef", "score": "0.7927625", "text": "def solution(str)\n str.reverse\nend", "title": "" }, { "docid": "99519992d78160012f8f25f0e3a07861", "score": "0.7925356", "text": "def reverse(string)\n return string if string.length == 0\n string[-1] + reverse(string[0...-1])\nend", "title": "" }, { "docid": "ad6f0e6a4a9c4703551ccc8e7990e254", "score": "0.7919008", "text": "def reverse(string)\n return string if string.empty?\n string[-1] + reverse(string[0..-2])\nend", "title": "" }, { "docid": "2109705150c3b56747fcd3ad48ffce76", "score": "0.7918668", "text": "def reverse(string)\n return \"\" if string == \"\"\n return string[0] if string.length <= 1\n reverse(string[1..-1]) + string[0]\nend", "title": "" }, { "docid": "cb651e97e918a4ade0b9c589796548b5", "score": "0.7917977", "text": "def reverse(string)\n return string if string.length <= 1\n string[-1] + reverse(string[0...-1])\nend", "title": "" }, { "docid": "cb651e97e918a4ade0b9c589796548b5", "score": "0.7916726", "text": "def reverse(string)\n return string if string.length <= 1\n string[-1] + reverse(string[0...-1])\nend", "title": "" }, { "docid": "265b562b7027327b00d1fd428c28e84c", "score": "0.7916259", "text": "def string_reverse(my_string)\r\n string_reverse_helper(my_string, 0, my_string.length-1)\r\nend", "title": "" }, { "docid": "7a1e94d40b1370f12ca1b12603a9b730", "score": "0.79130995", "text": "def reverse(string)\n acc= \"\"\n rem= string\n while rem != \"\" # invariant: acc = rev(string - rem)\n acc= rem[0] + acc\n rem= rem[1..-1]\n end\n return acc\nend", "title": "" }, { "docid": "fa470daafca1f9c67b95b0ef5332a03e", "score": "0.791214", "text": "def reverse(string)\n\n return string if string.length <= 1\n string[-1] + reverse(string[0...-1])\n\nend", "title": "" }, { "docid": "2c6490ed825b2d7e8fb030275a32bdbe", "score": "0.7910076", "text": "def reverse(s)\n return s if s == \"\"\n if s.length == 1\n return s\n else\n return temp = s[-1] + reverse(s[0...-1])\n end\nend", "title": "" }, { "docid": "b539c20eb394e9866ade55fa43c2af59", "score": "0.79093075", "text": "def reverse(string)\n return string if string.length < 2\n string[-1] + reverse(string[0...-1])\nend", "title": "" }, { "docid": "a4e55503ab080650b97a9e0ce0890719", "score": "0.7908834", "text": "def reverse_string x\n\tx.reverse\nend", "title": "" }, { "docid": "bfbd575c7b12aeb64322b5b89849d701", "score": "0.7893155", "text": "def reverse(string) # trivial we've already done this in the lecture videos love it lol\n return string if string.length <= 1\n reverse(string[1..-1]) + string[0]\nend", "title": "" }, { "docid": "050e6f887f0d82253d5dec74f8017683", "score": "0.78931516", "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": "d65edd613b4a13628f284bccbc6fa40f", "score": "0.7888959", "text": "def reverse(string)\n reversed = ''\n loop do\n break if string == ''\n reversed << string[-1]\n string = string[0...-1]\n end\n reversed\nend", "title": "" }, { "docid": "92b4bc9717fae9f07359a0cacfe1f6d6", "score": "0.7887854", "text": "def reverse(string)\n return string if string.length <= 1\n string[-1] + reverse(string.slice(1, string.length - 2)) + string[0]\nend", "title": "" }, { "docid": "f0f19e70831c4316cae150ed4a202b19", "score": "0.7883106", "text": "def reverse(string)\n return string if string.length <= 1\n string[-1] + reverse(string[0..-2])\nend", "title": "" }, { "docid": "f0f19e70831c4316cae150ed4a202b19", "score": "0.7883106", "text": "def reverse(string)\n return string if string.length <= 1\n string[-1] + reverse(string[0..-2])\nend", "title": "" }, { "docid": "f0f19e70831c4316cae150ed4a202b19", "score": "0.7883106", "text": "def reverse(string)\n return string if string.length <= 1\n string[-1] + reverse(string[0..-2])\nend", "title": "" }, { "docid": "c46885faeddd5de76ad4a027f3e1392f", "score": "0.787617", "text": "def reverse(string)\n return string if string.length <= 1\n string[-1] + reverse(string[0...-1])\nend", "title": "" }, { "docid": "c08fbca31cbd9223724037a32637b65a", "score": "0.78736514", "text": "def reverse(s)\n return \"\" if s.length == 0 \n return s[-1] + reverse(s[0..-2])\nend", "title": "" }, { "docid": "dc4d2705e2321425876a054dbb14ad06", "score": "0.78733474", "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": "62082492f992694ee954031b130bc2a5", "score": "0.7871899", "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": "43c7898c988a0ecccf2d3b1a5c91b57a", "score": "0.78712934", "text": "def reverse(string)\n i, output = string.length, \"\"\n while i != 0\n i -= 1\n output = output + string[i]\n end\n output\nend", "title": "" }, { "docid": "8107e511609a02f56a28cbd717d15dbd", "score": "0.7870458", "text": "def reverse(string)\n return string if string.length <= 0\n string[-1] + reverse(string[0..-2])\nend", "title": "" }, { "docid": "1e5113d4d79742386e041587a5e5856e", "score": "0.78661114", "text": "def reverse(string)\n return string if string.length == 1\n reverse(string[1..-1]) + string[0]\nend", "title": "" }, { "docid": "32284807661c37718d2493a3b6d6f72c", "score": "0.78655785", "text": "def reverse(string)\n if string.empty?\n \"\"\n else\n reverse(string[1..-1]) + string[0]\n end\nend", "title": "" }, { "docid": "d1c266dd6fb1cf5fa2e9a48a73b0d8d6", "score": "0.7864819", "text": "def reverse(string)\n result = \"\"\n \n idx=string.length - 1\n while idx >= 0\n #start at string.length - 1 and go down to 0.\n \n result = result + string[idx]\n idx -= 1\n \n end\n \n return result\n \nend", "title": "" }, { "docid": "d05465147227b85b0f8657bcb9e1cffd", "score": "0.7863918", "text": "def reverse(string)\n return string if string.length <= 1\n\n reverse(string[1..-1]) + string[0]\nend", "title": "" }, { "docid": "2439c4275af2e99c9188c419ff4d3bb5", "score": "0.7863889", "text": "def reverse(string)\n return string if string.length == 1 \n string[-1] + reverse(string[0...-1])\nend", "title": "" } ]
4739881ce9f6e462fb26f1cef0e52979
initializes this MDN_OAuthToken with a json hash
[ { "docid": "63f8151859fb9d0988ac9f65d4c1925a", "score": "0.63286537", "text": "def init_jaxb_json_hash(_o)\n if !_o['verifier'].nil?\n _oa = _o['verifier']\n if(_oa.is_a? Hash)\n @verifier = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @verifier = String.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @verifier = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @verifier.push String.from_json(_item)\n else\n @verifier.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @verifier = _oa\n end\n end\n if !_o['token'].nil?\n _oa = _o['token']\n if(_oa.is_a? Hash)\n @token = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @token = String.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @token = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @token.push String.from_json(_item)\n else\n @token.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @token = _oa\n end\n end\n end", "title": "" } ]
[ { "docid": "3c393fcc6ffb9e6794c21c2306676289", "score": "0.7491736", "text": "def initialize(hash = {})\n super(hash)\n\n @action = extract_value(hash, :action)\n @accessToken = extract_value(hash, :accessToken)\n @clientId = extract_integer_value(hash, :clientId)\n @expiresAt = extract_integer_value(hash, :expiresAt)\n @expiresIn = extract_integer_value(hash, :expiresIn)\n @grantType = extract_value(hash, :grantType)\n @properties = extract_array_value(hash, :scopes) do |element|\n Authlete::Model::Property.parse(element)\n end\n @refreshToken = extract_value(hash, :refreshToken)\n @scopes = extract_value(hash, :scopes)\n @subject = extract_value(hash, :subject)\n @tokenType = extract_value(hash, :tokenType)\n end", "title": "" }, { "docid": "f72793c1a0db6ac482cf9b2d7ee811ee", "score": "0.74350816", "text": "def initialize(hash = {})\n super(hash)\n\n @action = extract_value(hash, :action)\n @accessToken = extract_value(hash, :accessToken)\n @accessTokenExpiresAt = extract_integer_value(hash, :accessTokenExpiresAt)\n @properties = extract_array_value(hash, :scopes) do |element|\n Authlete::Model::Property.parse(element)\n end\n @scopes = extract_value(hash, :scopes)\n end", "title": "" }, { "docid": "925e0852847cbeb3b40e4087a1be8206", "score": "0.7393532", "text": "def initialize(hash = {})\n super(hash)\n\n @action = extract_value(hash, :action)\n @responseContent = extract_value(hash, :responseContent)\n @username = extract_value(hash, :username)\n @password = extract_value(hash, :password)\n @ticket = extract_value(hash, :ticket)\n @accessToken = extract_value(hash, :accessToken)\n @accessTokenExpiresAt = extract_integer_value(hash, :accessTokenExpiresAt)\n @accessTokenDuration = extract_integer_value(hash, :accessTokenDuration)\n @refreshToken = extract_value(hash, :refreshToken)\n @refreshTokenExpiresAt = extract_integer_value(hash, :refreshTokenExpiresAt)\n @refreshTokenDuration = extract_integer_value(hash, :refreshTokenDuration)\n @idToken = extract_value(hash, :idToken)\n @grantType = extract_value(hash, :grantType)\n @clientId = extract_integer_value(hash, :clientId)\n @clientIdAlias = extract_value(hash, :clientIdAlias)\n @clientIdAliasUsed = extract_boolean_value(hash, :clientIdAliasUsed)\n @subject = extract_value(hash, :subject)\n @scopes = extract_value(hash, :scopes)\n @properties = extract_array_value(hash, :scopes) do |element|\n Authlete::Model::Property.parse(element)\n end\n end", "title": "" }, { "docid": "4ffd26f7405a6a7f157b686b1cd95311", "score": "0.7377445", "text": "def initialize(token_hash)\n @token_hash = token_hash\n end", "title": "" }, { "docid": "30a52afe661a4c38bef4e20d2da6f3c2", "score": "0.72779894", "text": "def initialize(hash = {})\n super(hash)\n\n @action = extract_value(hash, :action)\n @responseContent = extract_value(hash, :responseContent)\n @accessToken = extract_value(hash, :accessToken)\n @accessTokenExpiresAt = extract_integer_value(hash, :accessTokenExpiresAt)\n @accessTokenDuration = extract_integer_value(hash, :accessTokenDuration)\n @refreshToken = extract_value(hash, :refreshToken)\n @refreshTokenExpiresAt = extract_integer_value(hash, :refreshTokenExpiresAt)\n @refreshTokenDuration = extract_integer_value(hash, :refreshTokenDuration)\n @clientId = extract_integer_value(hash, :clientId)\n @clientIdAlias = extract_value(hash, :clientIdAlias)\n @clientIdAliasUsed = extract_boolean_value(hash, :clientIdAliasUsed)\n @subject = extract_value(hash, :subject)\n @scopes = extract_value(hash, :scopes)\n @properties = extract_array_value(hash, :scopes) do |element|\n Authlete::Model::Property.parse(element)\n end\n end", "title": "" }, { "docid": "b1c29c3b407fd8a76e2287d6a13c8a76", "score": "0.69521075", "text": "def initialize(token)\n @data = {}\n @data[:token] = token\n end", "title": "" }, { "docid": "44efb9947ee65e8b20979ffadd3a0854", "score": "0.6828237", "text": "def initialize(hash={})\n update_from_json(hash)\n end", "title": "" }, { "docid": "51b06ed9d63564cedee4962af4fb06b9", "score": "0.6811437", "text": "def initialize(hash = {})\n @service_api_key = extract_value(hash, :serviceApiKey)\n @client_id = extract_value(hash, :clientId)\n @id = extract_value(hash, :id)\n @password = extract_value(hash, :password)\n @claims = extract_value(hash, :claims)\n @claims_locales = extract_value(hash, :claimsLocales)\n @sns = extract_value(hash, :sns)\n @access_token = extract_value(hash, :accessToken)\n @refresh_token = extract_value(hash, :refreshToken)\n @expires_in = extract_integer_value(hash, :expiresIn)\n @raw_token_response = extract_value(hash, :rawTokenResponse)\n end", "title": "" }, { "docid": "723ef2beb22dd36e0a973e2d5a5380a8", "score": "0.67179835", "text": "def get_token_from_hash(hash)\n access_token = hash.delete('access_token') || hash.delete(:access_token) || hash.delete('oauth_token') || hash.delete(:oauth_token)\n opts = {:expires_at => hash.delete(\"expires\") || hash.delete(:expires),\n :header_format => \"OAuth2 %s\",\n :param_name => \"oauth_token\"}.merge(hash)\n \n @token = OAuth2::AccessToken.new(self, access_token, opts)\n end", "title": "" }, { "docid": "a3da6659112ca8b0bff06444e6dea6f3", "score": "0.66961294", "text": "def initialize(hash)\n\t\t\tset_from_hash(hash)\n\t\tend", "title": "" }, { "docid": "1bf96d5e43d6de6d8b4a530108ba5828", "score": "0.6683335", "text": "def get_token_from_hash(hash)\n access_token = hash.delete('access_token') || hash.delete(:access_token) || hash.delete('oauth_token') || hash.delete(:oauth_token)\n opts = {:expires_at => hash[\"expires\"] || hash[:expires],\n :header_format => \"OAuth2 %s\",\n :param_name => \"access_token\"}\n \n @token = OAuth2::AccessToken.new(self, access_token, opts)\n end", "title": "" }, { "docid": "342c398552a9416e49829843be39ba5f", "score": "0.6660117", "text": "def init_jaxb_json_hash(_o)\n if !_o['token'].nil?\n _oa = _o['token']\n if(_oa.is_a? Hash)\n @token = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @token = String.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @token = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @token.push String.from_json(_item)\n else\n @token.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @token = _oa\n end\n end\n end", "title": "" }, { "docid": "342c398552a9416e49829843be39ba5f", "score": "0.6660117", "text": "def init_jaxb_json_hash(_o)\n if !_o['token'].nil?\n _oa = _o['token']\n if(_oa.is_a? Hash)\n @token = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @token = String.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @token = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @token.push String.from_json(_item)\n else\n @token.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @token = _oa\n end\n end\n end", "title": "" }, { "docid": "342c398552a9416e49829843be39ba5f", "score": "0.6660117", "text": "def init_jaxb_json_hash(_o)\n if !_o['token'].nil?\n _oa = _o['token']\n if(_oa.is_a? Hash)\n @token = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @token = String.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @token = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @token.push String.from_json(_item)\n else\n @token.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @token = _oa\n end\n end\n end", "title": "" }, { "docid": "302e036e6f4b29857dd45307cd3571f2", "score": "0.6632793", "text": "def initialize(token_string)\n @token_b64 = token_string # the token string is in b64, remember it\n @malformed = true and return if token_string.length < 1 # check for empty or too short strings\n\n @token_str = Base64::decode64 token_string # decode the b64-endocded string\n\n begin # check whether its valid JSON and parse it\n content = JSON.parse @token_str, :max_nesting => 3, :symbolize_names => true\n rescue\n @malformed = true and return # not JSON, or nested too deeply\n end\n \n # check for presence of necessary information\n @malformed = true and return unless content.has_key?(:token) && content.has_key?(:signature)\n @malformed = true and return unless content[:token].has_key?(:identifier) \n @malformed = true and return unless content[:token].has_key?(:scope) \n @malformed = true and return unless content[:token].has_key?(:timestamp) \n @malformed = true and return unless content[:token].length == 3\n \n content[:token][:timestamp] = Time.parse(content[:token][:timestamp]) # parse time-string to Time object\n \n Rails.logger.debug(\"Access token identifier: #{content[:token][:identifer]} scope: #{content[:token][:scope]}.\")\n \n @token = content[:token] # store token content\n @signature = content[:signature] # store signature\n end", "title": "" }, { "docid": "490683bb1a0c2284fe51a8fd9842fdad", "score": "0.6612731", "text": "def intialize(response)\n @access_token = response[\"access_token\"]\n @expires_in = response[\"expires_in\"]\n @refresh_token = response[\"refresh_token\"]\n @scope = response[\"scope\"]\n @created_at = response[\"created_at\"]\n @token_type = response[\"token_type\"]\n end", "title": "" }, { "docid": "dece0e4d6df046beac8afdae42d8d426", "score": "0.6593844", "text": "def initialize\r\n response = RestClient.post 'https://api.twitter.com/oauth2/token', {\"grant_type\" => 'client_credentials'}, {\"Authorization\" => \"Basic #{TwitterAPI::BEARER_TOKEN_CREDIENTIAL}\", \"Content-Type\" => \"application/x-www-form-urlencoded;charset=UTF-8\"}\r\n @@access_token = JSON.parse(response)[\"access_token\"]\r\n end", "title": "" }, { "docid": "a30fde1bf701d2f344c7969768e1ed08", "score": "0.65817463", "text": "def initialize(json = nil)\n if json\n @algorithm = json[\"algorithm\"]\n @kms_master_key_id = json[\"kms_master_key_id\"]\n end\n end", "title": "" }, { "docid": "6d2f323956c558e264e2a8769460e0d3", "score": "0.6540691", "text": "def initialize(google_json_response, code, user_id)\n if !google_json_response || google_json_response[\"error\"]\n puts \"somthing went wrong, deal with it! no actually deal with it if it happens\"\n return\n end\n args = Hash.new\n args[:access_token] = google_json_response[\"access_token\"]\n # For now is all bearer. But this might change in the future\n args[:token_type] = google_json_response[\"token_type\"]\n args[:expires] = Time.now.to_i + google_json_response[\"expires_in\"]\n args[:id_token] = google_json_response[\"id_token\"]\n args[:refresh_token] = google_json_response[\"refresh_token\"]\n args[:user_id] = user_id\n args[:code] = code\n super(args)\n end", "title": "" }, { "docid": "4b652fa08afc92992ef45e8352f4246b", "score": "0.6529684", "text": "def initialize(hash = {})\n super(hash)\n\n @action = extract_value(hash, :action)\n @responseContent = extract_value(hash, :responseContent)\n @password = extract_value(hash, :password)\n @ticket = extract_value(hash, :ticket)\n @username = extract_value(hash, :username)\n end", "title": "" }, { "docid": "058a5b609dae4c2c4b051fcad81f32d0", "score": "0.65246403", "text": "def initialize(json)\n super\n end", "title": "" }, { "docid": "4a85e9abdbb5db6836d846839524c3d4", "score": "0.6521672", "text": "def initialize(base64_token)\n @base64_token = base64_token\n end", "title": "" }, { "docid": "5c40e92e16aa8b61af82edb7600c0ec4", "score": "0.6516058", "text": "def initialize()\n\t @access_token = \"EAAQ2dszg6I0BAKf2fXrvIcaBqu95yfyL4ppYOjfWq7s61c6ZBcXyb8tQUuyXsuK02SEq8Nt1bopcceZCrnh2Jxq8mpEZC7BXWBpUwn0JsgV4NVf2WpdjYalWKFocUkZCANtr5S3ODIqw2FzOo6VapLHXxOWsqSVmCXk4G5kMKwZDZD\"\n\t #todo change to tenant_integrations.ordoro_name, tenant_integrations.ordoro_pass\n\t\t# @auth = { username: username, password: password }\n\t @headers = {'Content-Type' => 'application/json' }\n\tend", "title": "" }, { "docid": "efba4e354838c67b1f1acb6588d6b430", "score": "0.6504791", "text": "def initialize(json)\n @json = json\n end", "title": "" }, { "docid": "9772072f11c086f08af66bb35d9494f9", "score": "0.6467043", "text": "def initialize(auth_token)\n @auth_token = auth_token\n end", "title": "" }, { "docid": "2fabc78718e9cb88209fd03cb9a69ba5", "score": "0.6457605", "text": "def initialize(hash) @hash = hash end", "title": "" }, { "docid": "e2226d59fc661c90960b7919b761d425", "score": "0.6434847", "text": "def initialize(hash={})\n @hash = hash\n end", "title": "" }, { "docid": "e4b50480b2989250a4cb84f7de57007d", "score": "0.6430909", "text": "def initialize(json:)\n @raw_json = json\n end", "title": "" }, { "docid": "babca058f017303e9d47c702d4a26b5a", "score": "0.6426045", "text": "def init!\n @defaults = {\n :@token => nil,\n }\n end", "title": "" }, { "docid": "1d42c0c9d6525fd8f35dbb6bf91da6e1", "score": "0.6423256", "text": "def initialize(hash)\n @hash = hash\n end", "title": "" }, { "docid": "1d42c0c9d6525fd8f35dbb6bf91da6e1", "score": "0.6423256", "text": "def initialize(hash)\n @hash = hash\n end", "title": "" }, { "docid": "110367c3bf63e8a567bcb0db8e81d42c", "score": "0.6402463", "text": "def initialize(json)\n @raw_json = json\n end", "title": "" }, { "docid": "4e9ff94f7a16ea5614f30bdbc0dd9dd0", "score": "0.6392364", "text": "def initialize(json)\n @json = json\n end", "title": "" }, { "docid": "4e9ff94f7a16ea5614f30bdbc0dd9dd0", "score": "0.6392364", "text": "def initialize(json)\n @json = json\n end", "title": "" }, { "docid": "db304bee84a4c3fef25d978d8bf1ef85", "score": "0.63918674", "text": "def initialize(access_token)\n @access_token = access_token\n end", "title": "" }, { "docid": "3d05b5490ae0b97800541421e873993b", "score": "0.6389179", "text": "def initialize(hash={})\n @hash = hash\n end", "title": "" }, { "docid": "d5c404879fb9ecd8ec2b901c6d0a8dff", "score": "0.6388387", "text": "def initialize(json)\n super\n @json = json\n end", "title": "" }, { "docid": "d72b0e37718ecb3c6d96e3da51b873c4", "score": "0.6381429", "text": "def initialize(payload)\n @token = payload['token']\n @timestamp = payload['timestamp']\n @signature = payload['signature']\n end", "title": "" }, { "docid": "9cd7f162fb74c090bac885fa443d5550", "score": "0.63750386", "text": "def init_jaxb_json_hash(_o)\n super _o\n @version = Fixnum.from_json(_o['version']) unless _o['version'].nil?\n @accountLocked = Boolean.from_json(_o['accountLocked']) unless _o['accountLocked'].nil?\n @phoneNumber = String.from_json(_o['phoneNumber']) unless _o['phoneNumber'].nil?\n @firstName = String.from_json(_o['firstName']) unless _o['firstName'].nil?\n @lastName = String.from_json(_o['lastName']) unless _o['lastName'].nil?\n @username = String.from_json(_o['username']) unless _o['username'].nil?\n @credentialsExpired = Boolean.from_json(_o['credentialsExpired']) unless _o['credentialsExpired'].nil?\n @address = Org::Appfuse::Model::Address.from_json(_o['address']) unless _o['address'].nil?\n @accountExpired = Boolean.from_json(_o['accountExpired']) unless _o['accountExpired'].nil?\n @enabled = Boolean.from_json(_o['enabled']) unless _o['enabled'].nil?\n @email = String.from_json(_o['email']) unless _o['email'].nil?\n @id = Bignum.from_json(_o['id']) unless _o['id'].nil?\n @website = String.from_json(_o['website']) unless _o['website'].nil?\n if !_o['roles'].nil?\n @roles = Array.new\n _oa = _o['roles']\n _oa.each { | _item | @roles.push Org::Appfuse::Model::Role.from_json(_item) }\n end\n end", "title": "" }, { "docid": "3be77a441b6c105d53bd462836dadf6e", "score": "0.6374134", "text": "def initialize json_data\n @json_data = json_data\n end", "title": "" }, { "docid": "767e05570370a4479da9e16966805bf9", "score": "0.6369414", "text": "def initialize(authToken)\r\n\t\t\t\tsuper(authToken,\"\")\r\n\t\t\tend", "title": "" }, { "docid": "3a342f7f3ae6fb5a706da6ce1f3f187b", "score": "0.63462675", "text": "def initialize(access_token)\n set_authorization_header(access_token)\n end", "title": "" }, { "docid": "5d8c011e564fca55e7842ceb44b3b09d", "score": "0.63442624", "text": "def initialize\n @token_type = 'bearer'\n end", "title": "" }, { "docid": "a1ec647989573335a16bd02b9fcb4118", "score": "0.6338818", "text": "def initialize(token)\n @token = token\n @options = {}\n if token\n @options[:headers] = { \"access_token\" => \"#{@token}\" }\n end\n end", "title": "" }, { "docid": "286c916e997d3c3ddf66461bf6d8aa89", "score": "0.6326467", "text": "def initialize(access_token)\n @token = access_token\n end", "title": "" }, { "docid": "1031a0610e01f2bc5e61043998bbd42d", "score": "0.6291739", "text": "def initialize(is_json, hash)\n @is_json = !!is_json\n @stomp_body = fix_bad_encoding( hash[:stompBody] )\n @body = hash[:body]\n @verb = hash[:verb]\n @params = hash[:parameters] || hash[:params] \n @desc = hash[:description] || hash[:desc]\n\n fill_from_stomp\n\n @body = fix_bad_encoding(@body)\n @verb = fix_bad_encoding(@verb)\n @params = fix_bad_encoding(@params)\n @desc = fix_bad_encoding(@desc)\n end", "title": "" }, { "docid": "d6582c2947456268a52e2f321fbfef0c", "score": "0.62903684", "text": "def initialize(json, root_key: nil)\n params = get_hash_from_json(json)\n params = params[root_key.to_s] unless root_key.nil?\n\n init_attributes(self.class.accessors, params)\n end", "title": "" }, { "docid": "746bebc58ea877695295d2819bb67b3d", "score": "0.6286447", "text": "def initialize(token)\n @token = token\n @base_uri = nil\n end", "title": "" }, { "docid": "8b59083f19bc0166520ce10d6e19bd51", "score": "0.62838614", "text": "def initialize(token, version: nil)\n @bearer = \"Bearer #{token}\"\n @version = '20170307'\n @cache = {}\n end", "title": "" }, { "docid": "bd136f868acca4cd7e1343b8df3d4b2f", "score": "0.62480533", "text": "def initialize(auth_token = nil)\n @auth_token = auth_token\n end", "title": "" }, { "docid": "d70bddff72d9787a1ac2cb70e41d4f5d", "score": "0.62397915", "text": "def initialize(hash = nil)\n end", "title": "" }, { "docid": "55514409d35d39baab0a437b8cbc0e48", "score": "0.62392604", "text": "def initialize\n super()\n @hash = {}\n end", "title": "" }, { "docid": "92752d3eacfb234464c59b0b6e792f1d", "score": "0.6229137", "text": "def initialize(initial_hash = nil)\n from_h!(initial_hash)\n end", "title": "" }, { "docid": "74179537bf975a819e6e44e9e745f3df", "score": "0.6218922", "text": "def initialize(hash = {})\n\t\t\tif (hash.kind_of? TypeSafeHash)\n\t\t\t\t@real_hash = hash.to_hash\n\t\t\telsif (hash.kind_of? Hash)\n\t\t\t\t@real_hash = hash\n\t\t\telse\n\t\t\t\traise ArgumentError, \"TypeSafeHash expects a hash object for its initializer\"\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "4932d271fa7e46c2b572e60930f506a1", "score": "0.62094265", "text": "def initialize(creds_or_raw_token)\n if creds_or_raw_token.class == Hash\n @qop = creds_or_raw_token[:qop]\n @uid = creds_or_raw_token[:uid]\n @timestamp = creds_or_raw_token[:timestamp]\n else \n @raw_token = creds_or_raw_token\n end\n end", "title": "" }, { "docid": "1a248cd6402a51eb5c2e8f9cb0c253cf", "score": "0.62054694", "text": "def get_access_token_from_hash(token, opts = {})\n @access_token = OAuth2::AccessToken.new(oauth_client, token, opts)\n end", "title": "" }, { "docid": "97e7a9eba1d66d0b0663e21463c88b71", "score": "0.62034214", "text": "def initialize(hashOrJson)\n if !hashOrJson.respond_to? :keys\n hashOrJson = JSON.parse hashOrJson\n end\n hashOrJson.keys.each { |name| instance_variable_set \"@\" + name.to_s, hashOrJson[name] }\n end", "title": "" }, { "docid": "4c41844d4a7d406bff4b86eb017a9d63", "score": "0.6194316", "text": "def initialize(user, pass)\n @user = user\n @pass = pass\n auth_token\n end", "title": "" }, { "docid": "18fe46b75a33ca61751661fe2b97381c", "score": "0.6180711", "text": "def get_access_token_from_hash token, opts={}\n @access_token = OAuth2::AccessToken.new(@oauth_client, token, opts)\n end", "title": "" }, { "docid": "ca45526aa467ca7ae4038ab96f7702e0", "score": "0.61790407", "text": "def initialize(token, secret)\n @token, @secret = token, secret\n end", "title": "" }, { "docid": "19fc6d45916d96b8cad2b820314d272d", "score": "0.617608", "text": "def initialize(hash)\n load_hash(hash)\n end", "title": "" }, { "docid": "19fc6d45916d96b8cad2b820314d272d", "score": "0.617608", "text": "def initialize(hash)\n load_hash(hash)\n end", "title": "" }, { "docid": "19fc6d45916d96b8cad2b820314d272d", "score": "0.617608", "text": "def initialize(hash)\n load_hash(hash)\n end", "title": "" }, { "docid": "db30af396798222526ec1c17b3064293", "score": "0.6164797", "text": "def initialize(token = nil)\n if token.respond_to?(:token) && token.respond_to?(:params)\n # token is an OAuth2::AccessToken\n @token = token.token\n @token_type = token.params['token_type']\n @refresh_token = token.params['refresh_token']\n @expires_in = Time.now + token.expires_in unless token.expires_in.nil?\n else\n # token is a String or nil\n @token = token\n end\n end", "title": "" }, { "docid": "d0ff5693d72c38bc993690304446fad9", "score": "0.61470413", "text": "def initialize(access_token)\n @access_token = access_token\n end", "title": "" }, { "docid": "6ec8677fd8e709abb3a35c27a2c789e0", "score": "0.6143707", "text": "def initialize(key, secret, layer = nil)\n @access_token = self.class.get_access_token(key, secret)\n @layer = layer\n end", "title": "" }, { "docid": "1c1c2931d998905df553c7b744ac456d", "score": "0.61425906", "text": "def initialize(options = {})\n fail(ArgumentError, \"Options hash required.\") unless options.is_a?(Hash)\n\n @api_key = options[:api_key] || Goodreads.configuration[:api_key]\n @api_secret = options[:api_secret] || Goodreads.configuration[:api_secret]\n #is this oauth_token actually a HASH?! Yes.\n\t @oauth_token = options[:oauth_token]\n\t \n end", "title": "" }, { "docid": "0dd496fb5afc5c7c2d2ff8629a933a43", "score": "0.6135455", "text": "def initialize(token, response_format: :json)\n raise ArgumentError unless input_valid?(token, response_format)\n\n self.token = token\n self.response_format = response_format\n end", "title": "" }, { "docid": "0dd496fb5afc5c7c2d2ff8629a933a43", "score": "0.6135455", "text": "def initialize(token, response_format: :json)\n raise ArgumentError unless input_valid?(token, response_format)\n\n self.token = token\n self.response_format = response_format\n end", "title": "" }, { "docid": "bc9273705f71abcd8565648741a3c2f3", "score": "0.61350715", "text": "def initialize(options={})\n authenticate options if options[:password]\n @oauth_token = options[:access_token] if options[:access_token]\n @auth = options[:auth] if options[:auth]\n end", "title": "" }, { "docid": "d0783a92b7716df63305761ca0e67fb2", "score": "0.6131688", "text": "def initialize(raw_hash)\n @parsed_hash = parse(raw_hash)\n end", "title": "" }, { "docid": "49e1895da4c1076b31870f8c89524735", "score": "0.6130656", "text": "def build_access_token\n super\n rescue => e\n json = e.message[MATCH_ACCESS_TOKEN_JSON,1]\n hash = Yajl::Parser.parse(json, symbolize_keys: true)\n params = hash.fetch(:value).fetch(:data)\n ::OAuth2::AccessToken.from_hash(client, params)\n end", "title": "" }, { "docid": "e32d2b34e19792daca603e5e4c279f7e", "score": "0.6129793", "text": "def oauth_hash\n {\n :oauth_token => oauth_token,\n :oauth_expires_at => oauth_expires_at\n }\n end", "title": "" }, { "docid": "472dbbe6b8b8c6075baede8eb733958c", "score": "0.61248827", "text": "def initialize(json_hash)\n @title = json_hash[\"title\"]\n @url = json_hash[\"url\"]\n @rss = json_hash[\"rss\"]\n @channel = json_hash[\"channel\"]\n @aliases = (json_hash[\"aliases\"] || []).map do |show_alias|\n show_alias.downcase\n end\n end", "title": "" }, { "docid": "c50bf5538dc0e7d14fbc28eb9460034e", "score": "0.6115114", "text": "def initialize(json:)\n @json = json.freeze\n end", "title": "" }, { "docid": "7d1803f33e1a433e0f9f0455d34e9a0c", "score": "0.6113953", "text": "def initialize(hash = {})\n @hash = hash\n end", "title": "" }, { "docid": "c83e24d835f3e936305e914a6320deb0", "score": "0.61117435", "text": "def initialize(token)\n\t\t@token = token\n\tend", "title": "" }, { "docid": "a3502fa77de486d36a101971e4db23bf", "score": "0.61096394", "text": "def initialize(parameter)\n if parameter.is_a? Hash\n @payload = parameter\n encode\n else\n @token = parameter\n decode\n end\n end", "title": "" }, { "docid": "91ff02ca3c6955d1736362070d03fe3b", "score": "0.6107308", "text": "def initialize(hash = {})\n end", "title": "" }, { "docid": "336fbe1849d249e64cfacb4d14f467b7", "score": "0.6106065", "text": "def initialize(hash = nil)\n @_hash = hash \n end", "title": "" }, { "docid": "8f743597a7129a04ef420ed126b1a94d", "score": "0.61004996", "text": "def initialize(initial_hash = nil)\n super\n from_h!(initial_hash) unless initial_hash.nil?\n self.type = 'response'\n end", "title": "" }, { "docid": "b548d2a3287cd5b22ee765da94f1468f", "score": "0.6094946", "text": "def initialize(hash)\n @ostruct = hash.to_ostruct\n end", "title": "" }, { "docid": "7c79975ff776afc30561db7fca427ea9", "score": "0.609345", "text": "def initialize(oauth_consumer_key, oauth_consumer_secret, oauth_token, oauth_token_secret, api_base)\n\t\t@api_base = api_base # the base of all URIs for this API\n\t\t# Exchange our oauth_token and oauth_token secret for the AccessToken instance\n\t\t@access_token = get_access_token(oauth_consumer_key, oauth_consumer_secret, oauth_token, oauth_token_secret)\n\tend", "title": "" }, { "docid": "2c609f5a3b0652114d643c88a3db4945", "score": "0.60890144", "text": "def initialize(parameters)\n @access_token = parameters[:access_token]\n @refresh_token = parameters[:refresh_token]\n @code = parameters[:code]\n @id_token = parameters[:id_token]\n @expires_in = parameters[:expires_in]\n @expires_at = parameters[:expires_at]\n end", "title": "" }, { "docid": "19b133ec57667033e08695b285dace15", "score": "0.6087408", "text": "def init_jaxb_json_hash(_o)\n if !_o['token'].nil?\n _oa = _o['token']\n if(_oa.is_a? Hash)\n @token = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @token = String.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @token = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @token.push String.from_json(_item)\n else\n @token.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @token = _oa\n end\n end\n if !_o['mail'].nil?\n _oa = _o['mail']\n if(_oa.is_a? Hash)\n @mail = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @mail = String.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @mail = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @mail.push String.from_json(_item)\n else\n @mail.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @mail = _oa\n end\n end\n if !_o['password'].nil?\n _oa = _o['password']\n if(_oa.is_a? Hash)\n @password = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @password = String.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @password = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @password.push String.from_json(_item)\n else\n @password.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @password = _oa\n end\n end\n end", "title": "" }, { "docid": "dac3bbccb4a9cf085042091cfe04a62d", "score": "0.60865724", "text": "def init_token\n self.token = SecureRandom.hex(64) if self.token.blank?\n end", "title": "" }, { "docid": "9566de3951877af483deaefd3269e268", "score": "0.6075662", "text": "def initialize(token = nil)\n if token.respond_to?(:token) && token.respond_to?(:params)\n # token is an OAuth2::AccessToken\n @token = token.token\n @user_id = token.params['user_id']\n @email = token.params['email']\n @expires_at = Time.at(token.expires_at) unless token.expires_at.nil?\n else\n # token is a String or nil\n @token = token\n end\n end", "title": "" }, { "docid": "7c45b706f0a2fa718ce06e66bf0fea6b", "score": "0.6074611", "text": "def initialize(hash = {})\n @id = hash['id']\n @title = hash['title']\n @body = hash['body']\n @user_id = hash['user_id']\n end", "title": "" }, { "docid": "f5a66df4f5a46932801be3b3bcbb5bad", "score": "0.6074002", "text": "def initialize(token) # attr_accessor will create both\n @token = token\n end", "title": "" }, { "docid": "89f7204bd8d4e7c62b6f53dc805670c5", "score": "0.6071147", "text": "def initialize(attrs={})\n @appid = attrs[:appid]\n @secret = attrs[:secret]\n @access_token = attrs[:access_token]\n end", "title": "" }, { "docid": "227851314d460a93a4616997d7f21155", "score": "0.6069091", "text": "def initialize(access_token = nil)\n @access_token = access_token\n end", "title": "" }, { "docid": "227851314d460a93a4616997d7f21155", "score": "0.6069091", "text": "def initialize(access_token = nil)\n @access_token = access_token\n end", "title": "" }, { "docid": "f898dacc67f3a65bf877b7fdf9762d6f", "score": "0.6067434", "text": "def initialize( consumer_key, consumer_secret, access_token, access_secret )\n @oauth_opts = {\n :consumer_key => consumer_key,\n :consumer_secret => consumer_secret,\n :access_token => access_token,\n :access_token_secret => access_secret\n }\n end", "title": "" }, { "docid": "0b1a4c43e6f2e4e7c4e9ce9ea48b516b", "score": "0.6066439", "text": "def init_jaxb_json_hash(_o)\n if !_o['editToken'].nil?\n _oa = _o['editToken']\n if(_oa.is_a? Hash)\n @editToken = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @editToken = Gov::Vha::Isaac::Rest::Api1::Data::RestEditToken.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @editToken = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @editToken.push Gov::Vha::Isaac::Rest::Api1::Data::RestEditToken.from_json(_item)\n else\n @editToken.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @editToken = _oa\n end\n end\n if !_o['uuid'].nil?\n _oa = _o['uuid']\n if(_oa.is_a? Hash)\n @uuid = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @uuid = String.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @uuid = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @uuid.push String.from_json(_item)\n else\n @uuid.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @uuid = _oa\n end\n end\n if !_o['nid'].nil?\n _oa = _o['nid']\n if(_oa.is_a? Hash)\n @nid = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @nid = Fixnum.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @nid = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @nid.push Fixnum.from_json(_item)\n else\n @nid.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @nid = _oa\n end\n end\n if !_o['sequence'].nil?\n _oa = _o['sequence']\n if(_oa.is_a? Hash)\n @sequence = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @sequence = Fixnum.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @sequence = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @sequence.push Fixnum.from_json(_item)\n else\n @sequence.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @sequence = _oa\n end\n end\n if !_o['type'].nil?\n _oa = _o['type']\n if(_oa.is_a? Hash)\n @type = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @type = Gov::Vha::Isaac::Rest::Api1::Data::Enumerations::RestObjectChronologyType.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @type = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @type.push Gov::Vha::Isaac::Rest::Api1::Data::Enumerations::RestObjectChronologyType.from_json(_item)\n else\n @type.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @type = _oa\n end\n end\n if !_o['detail'].nil?\n _oa = _o['detail']\n if(_oa.is_a? Hash)\n @detail = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @detail = String.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @detail = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @detail.push String.from_json(_item)\n else\n @detail.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @detail = _oa\n end\n end\n end", "title": "" }, { "docid": "1b5c27538841a18c18c9251ee353d906", "score": "0.60629505", "text": "def initialize( hash=nil )\n\t\t\thash ||= {}\n\t\t\t@hash = symbolify_keys( hash )\n\t\t\t@dirty = false\n\t\tend", "title": "" }, { "docid": "f1ecfd21a80dbb3694066379057748c3", "score": "0.6053849", "text": "def initialize(hash)\n # copy over values from hash\n self.merge!(hash)\n end", "title": "" }, { "docid": "a1ea81f893b6dec5b7739d13c1caa807", "score": "0.6048014", "text": "def auth_token\n @auth_token ||= JsonWebToken.decode(http_token)\n end", "title": "" }, { "docid": "d66ea03be55d3bd9bf5a14a631b4a923", "score": "0.60424614", "text": "def connect\n @oauth_token_information = Smash.new\n end", "title": "" }, { "docid": "d163978a185840ad600bd49487b6ec8c", "score": "0.6041652", "text": "def auth_token\n @auth_token ||= JsonWebToken.decode(http_token)\n end", "title": "" }, { "docid": "ae1f49a6dbd79337c9d54d6903b7c892", "score": "0.60377514", "text": "def initialize(consumer_token)\n @consumer_token = OAuthToken[*consumer_token]\n end", "title": "" } ]
0106aeb6cf0a242b587ac1997b7a0cc2
This action is to list all the quizzes in our database. We access it with GET request to "/quizzes"
[ { "docid": "217a76d89b2b02311039421c3d0ee7c6", "score": "0.73658705", "text": "def index\n @quiz = Quiz.all\n end", "title": "" } ]
[ { "docid": "7bbb9095b85b33efc257d8d546039af4", "score": "0.8432245", "text": "def index\n @quizzes = Quiz.all\n end", "title": "" }, { "docid": "eaddf9f2c7c4356050fa5a54fb8d3374", "score": "0.84190214", "text": "def index\n @quizzes = Quiz.all\n end", "title": "" }, { "docid": "eaddf9f2c7c4356050fa5a54fb8d3374", "score": "0.84190214", "text": "def index\n @quizzes = Quiz.all\n end", "title": "" }, { "docid": "eaddf9f2c7c4356050fa5a54fb8d3374", "score": "0.84190214", "text": "def index\n @quizzes = Quiz.all\n end", "title": "" }, { "docid": "eaddf9f2c7c4356050fa5a54fb8d3374", "score": "0.84190214", "text": "def index\n @quizzes = Quiz.all\n end", "title": "" }, { "docid": "eaddf9f2c7c4356050fa5a54fb8d3374", "score": "0.84190214", "text": "def index\n @quizzes = Quiz.all\n end", "title": "" }, { "docid": "eaddf9f2c7c4356050fa5a54fb8d3374", "score": "0.84190214", "text": "def index\n @quizzes = Quiz.all\n end", "title": "" }, { "docid": "eaddf9f2c7c4356050fa5a54fb8d3374", "score": "0.84190214", "text": "def index\n @quizzes = Quiz.all\n end", "title": "" }, { "docid": "2c725c93c2244ecbbd75836a465291cd", "score": "0.8406842", "text": "def index\n @quizzs = Quizz.all\n end", "title": "" }, { "docid": "2c725c93c2244ecbbd75836a465291cd", "score": "0.8406842", "text": "def index\n @quizzs = Quizz.all\n end", "title": "" }, { "docid": "2c725c93c2244ecbbd75836a465291cd", "score": "0.8406842", "text": "def index\n @quizzs = Quizz.all\n end", "title": "" }, { "docid": "ebe3240187e8c8c668227fe6befd91cc", "score": "0.8371715", "text": "def index\n\t@quizzs = Quizz.all\n\tend", "title": "" }, { "docid": "95267308cc03270222c62094e37377fe", "score": "0.8296402", "text": "def index\n@quizzes = Quiz.all\nend", "title": "" }, { "docid": "15bdce57d76054c253f018d0a8e0d860", "score": "0.8085724", "text": "def index\n # @quizzes = Quiz.user_quizzes(current_user.id)\n @quizzes = Quiz.viewable_quizzes(current_user.id)\n end", "title": "" }, { "docid": "c4ad558b8601ce2f03b274bd422636de", "score": "0.80407363", "text": "def index\n @quizzes = Quiz.all\n #@questions = Question.all\n end", "title": "" }, { "docid": "af4c6238029d48f1cf257c421d15dc16", "score": "0.79805374", "text": "def index\n \n ####\n # TODO: It might be more efficient to load all the quizzes in memory first\n # and then construct different arrays instead of using multiple queries.\n ####\n @full_quizzes = Quiz.full\n @section_quizzes = Quiz.section\n @category_quizzes = Quiz.category\n @topic_quizzes = Quiz.topic\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @quizzes }\n end\n end", "title": "" }, { "docid": "736c5a50bdd10f262d1217184a3439fb", "score": "0.77979827", "text": "def index\n @quiz_questions = Quiz::Question.where(quizzes_id: params[:quiz_id])\n end", "title": "" }, { "docid": "ac43bd8aff465c458e9e9c10e7d7be0f", "score": "0.77580523", "text": "def show\n @quizzes = Quiz.all\n \n end", "title": "" }, { "docid": "2a1b565f189fb9d8856f28829899e4e3", "score": "0.77357155", "text": "def index\n @pythonquizzes = Pythonquiz.all\n end", "title": "" }, { "docid": "30c67fbf69bc3caab517310c4cacd638", "score": "0.7707825", "text": "def index\n @user_quizzes = UserQuiz.all\n end", "title": "" }, { "docid": "946e7dc82972cc0e28d031cf43a18aa7", "score": "0.76496583", "text": "def index\n @quizzs = Quizz.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @quizzs }\n end\n end", "title": "" }, { "docid": "6afb65e5daf1d19897486f32ee410613", "score": "0.7626011", "text": "def index\n @rubyquizzes = Rubyquiz.all\n end", "title": "" }, { "docid": "4edbed686f350e97ba750f6234edd119", "score": "0.76028347", "text": "def index\n @quizzes = Quiz.all\n\n render json: @quizzes, each_serializer: V1::QuizSerializer, root: nil\n end", "title": "" }, { "docid": "172c4aef2925e24a76dd7f5736079f0e", "score": "0.7549026", "text": "def index\n @learning_quizzes = LearningQuiz.all\n end", "title": "" }, { "docid": "39844e99bddf89f10dc84457032566a3", "score": "0.7540256", "text": "def index\n @quizzes = current_teacher.quizzes\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @quizzes }\n end\n end", "title": "" }, { "docid": "1e935cb7e044b6993931a7a49ca5ce53", "score": "0.75176454", "text": "def index\n @quizzes = Quiz.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @quizzes }\n end\n end", "title": "" }, { "docid": "f8f356b23cadfd31a7dfb216b55fc4fe", "score": "0.7444005", "text": "def index\n @quizzes = Quiz.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @quizzes }\n end\n end", "title": "" }, { "docid": "505adc58e95740905ca3beaf6c46a948", "score": "0.74136883", "text": "def index\n @quiz_questions = QuizQuestion.all\n end", "title": "" }, { "docid": "505adc58e95740905ca3beaf6c46a948", "score": "0.74136883", "text": "def index\n @quiz_questions = QuizQuestion.all\n end", "title": "" }, { "docid": "455fa46815d58eb8864183e8a63698c7", "score": "0.74103713", "text": "def index\n @topic_quizzes = TopicQuiz.all\n end", "title": "" }, { "docid": "ae917026406cb51eb83c694de9b418f7", "score": "0.7392099", "text": "def index\r\n # Instance variables are declared here so that can be used by the view\r\n # Get all quizzes from the database and store them in the @quizzes variable\r\n @quizzes = Quiz.all\r\n # Get all quiz results from the database and store them in @quizresult\r\n @quizresult = QuizResult.all\r\n end", "title": "" }, { "docid": "f2cf07952b3745e196a26336274244c0", "score": "0.73854834", "text": "def index\n @quizzes = Quiz.find(:all)\n @users = User.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @quizzes }\n end\n end", "title": "" }, { "docid": "de7f5be5e070415b63df7505bb428c16", "score": "0.73512566", "text": "def index\n @quizzes = Quiz.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @quizzes }\n end\n end", "title": "" }, { "docid": "de7f5be5e070415b63df7505bb428c16", "score": "0.73512566", "text": "def index\n @quizzes = Quiz.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @quizzes }\n end\n end", "title": "" }, { "docid": "e3c0b901f9558ed32a16a25aac5dc166", "score": "0.73507714", "text": "def index\n @quizquestions = Quizquestion.all\n end", "title": "" }, { "docid": "31776d22358c0291bf38196a3a870c81", "score": "0.7319137", "text": "def index\n @cppquizzes = Cppquiz.all\n end", "title": "" }, { "docid": "4be692be5e768be66503eb918c502a1b", "score": "0.7296577", "text": "def index\n @quiztests = Quiztest.all\n end", "title": "" }, { "docid": "892689590e48a405975b2ce3014fe50d", "score": "0.7264837", "text": "def index\n @questions = Question.where('quiz_id' => params[:quiz_id])\n end", "title": "" }, { "docid": "434ed73c70436cb43748a06790a12a12", "score": "0.7239271", "text": "def admin_index\n @quizzes = Quiz.all\n render :admin_index\n\n end", "title": "" }, { "docid": "eda892210ee3d282ed8a08dace00e091", "score": "0.72312367", "text": "def index\n @quizzes = Quiz.order('finalDifficulty DESC, timestamp DESC').all.paginate(:page => params[:page], :per_page => 20)\n end", "title": "" }, { "docid": "3713df036b06fa53be8914a9b9c3a298", "score": "0.723036", "text": "def index\n @quas = Qua.all\n end", "title": "" }, { "docid": "4615cb2750cb65e8e772889847c9d210", "score": "0.71789443", "text": "def index\n @quiz_runs = QuizRun.all\n @questions = Question.all\n end", "title": "" }, { "docid": "0435032ed5cb935324bdf147c206a5cc", "score": "0.7168023", "text": "def index\n @quiz_results = QuizResult.all\n end", "title": "" }, { "docid": "39b51b14793745410c348d6268fec7b6", "score": "0.7159037", "text": "def index\n if @group\n @quizzes = @quizzes_quizzes = @group.quizzes\n else\n @quizzes_quizzes = Quizzes::Quiz.all\n end\n end", "title": "" }, { "docid": "db46c87614af6bb2cbc91ce1efad6eb2", "score": "0.70801896", "text": "def index\n @qusetions = Qusetion.all\n end", "title": "" }, { "docid": "35ee35f724112a65ab15ab7f646510d0", "score": "0.7072997", "text": "def index\n @quizzes = Quiz.order(:end_time)\n if params.include?(:courseid)\n session[:quiz_list_courseid] = params[:courseid]\n elsif session.include?(:quiz_list_courseid)\n redirect_to admin_quizzes_path(:courseid => session[:quiz_list_courseid])\n else\n redirect_to admin_quizzes_path(:courseid => -1)\n end\n \n @courseid = params[:courseid].to_i\n @courses = Course.unarchived.order(:name)\n if @courseid >= 0\n # Literally: Keep if the courseid is in the students' list of courses\n @quizzes = Array(@quizzes).keep_if { |quiz| quiz.courseid == @courseid }\n end\n end", "title": "" }, { "docid": "8198d889cb797b29419fb01b8216ad20", "score": "0.70711863", "text": "def index\n @quizes = Quize.all\n end", "title": "" }, { "docid": "0e13b8c70a0f7134fff7409ec0c3ad3d", "score": "0.7056166", "text": "def index\n @que_quans = QueQuan.all\n end", "title": "" }, { "docid": "402f236aeecbd79688f4317b00a098aa", "score": "0.701554", "text": "def index\n @user = current_org.users.find_by_name(params[:id])\n @users = current_org.users.all\n @quizzes = current_org.quizzes.all\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end", "title": "" }, { "docid": "1fb9d8b547119b2069bcbea71112bca5", "score": "0.69955814", "text": "def index\n @quinielas = Quiniela.all\n end", "title": "" }, { "docid": "60245308b1634e1a9c3f7493c6275785", "score": "0.6983639", "text": "def index\n if current_user.admin?\n @quizzes = Quiz.all\n else\n @quizzes = Quiz.where(product_id: current_user.products.map(&:id)).all\n end\n \n end", "title": "" }, { "docid": "e55bfaa57c19caed7e590e1ce18e15c8", "score": "0.6963903", "text": "def index\n @quiz_answers = QuizAnswer.all\n end", "title": "" }, { "docid": "e55bfaa57c19caed7e590e1ce18e15c8", "score": "0.6963903", "text": "def index\n @quiz_answers = QuizAnswer.all\n end", "title": "" }, { "docid": "841776772d8528a364e5a37355687c67", "score": "0.69341856", "text": "def set_quizz\n @quizz = Quizz.find(params[:id])\n end", "title": "" }, { "docid": "841776772d8528a364e5a37355687c67", "score": "0.69341856", "text": "def set_quizz\n @quizz = Quizz.find(params[:id])\n end", "title": "" }, { "docid": "841776772d8528a364e5a37355687c67", "score": "0.69341856", "text": "def set_quizz\n @quizz = Quizz.find(params[:id])\n end", "title": "" }, { "docid": "c3a7adb03ddf500906a519e9db32cb28", "score": "0.6930206", "text": "def all_quizzes\n \tarray_of_quiz_ids = self.responses.pluck(:quiz_id).uniq\n \tquizzes = array_of_quiz_ids.map do |id|\n \t Quiz.find(id)\n \tend\n quizzes\n end", "title": "" }, { "docid": "614d01b3dbd8c2de414b81325d481ade", "score": "0.6921398", "text": "def index\n @faqs = Faq.all\n end", "title": "" }, { "docid": "614d01b3dbd8c2de414b81325d481ade", "score": "0.6921398", "text": "def index\n @faqs = Faq.all\n end", "title": "" }, { "docid": "614d01b3dbd8c2de414b81325d481ade", "score": "0.6921398", "text": "def index\n @faqs = Faq.all\n end", "title": "" }, { "docid": "614d01b3dbd8c2de414b81325d481ade", "score": "0.6921398", "text": "def index\n @faqs = Faq.all\n end", "title": "" }, { "docid": "ec0bf344433a0cfacbbfb8a51c777dce", "score": "0.6911813", "text": "def index\n @quizmasters = Quizmaster.all\n end", "title": "" }, { "docid": "534789e897f8c70e98bd2e2131c70924", "score": "0.68929684", "text": "def index\n @quizzes = Quiz.find(:all)\n @quizzes = @quizzes.group_by(&:category)\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @quizzes }\n end\n end", "title": "" }, { "docid": "627be04146567c085c6a1d568d20e2cf", "score": "0.68823844", "text": "def index\n @quiz_questions = @quiz_page.quiz_questions.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @quiz_questions }\n end\n end", "title": "" }, { "docid": "f9c47ba584f9a7cd76bcf16706c7a9dd", "score": "0.68549514", "text": "def index\n @quiz_times = QuizTime.all\n end", "title": "" }, { "docid": "1e890d06cab5da76901cd208d95b08f9", "score": "0.68545306", "text": "def index\n \n if (@title)\n breadcrumbs.add 'TITLES', titles_path\n breadcrumbs.add @title.title.upcase, title_path(@title)\n\n @shelf0 = Quiz.find_all_by_title_id(params[:title_id]).paginate(:page =>params[:page],:per_page=>params[:per_page])\n else\n @shelf0 = Quiz.find(:all, :order => \"id desc\").paginate(:page =>params[:page],:per_page=>params[:per_page])\n end\n breadcrumbs.add 'QUIZZES'\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @quizzes }\n end\n end", "title": "" }, { "docid": "06b351da7a032973c7f0e9111e2c8694", "score": "0.6848314", "text": "def show\n @quizz = Quizz.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @quizz }\n end\n end", "title": "" }, { "docid": "5cc66962d1eceeda06c9a5843ffa554f", "score": "0.68437254", "text": "def quizzes\n all = []\n content_pages.each do |content_page|\n all += content_page.quizzes.to_a\n end\n\n all\n end", "title": "" }, { "docid": "e3d7b2fc490a8ad972e57254d7c9b197", "score": "0.683786", "text": "def index\n @qa_questions = QaQuestion.all\n end", "title": "" }, { "docid": "105bad137756a41166aebcd9ee6e79e0", "score": "0.68358636", "text": "def index\n @quartiers = Quartier.all\n end", "title": "" }, { "docid": "692fc5cf349d260fe52fae9747d579ea", "score": "0.6832454", "text": "def index\n @quizzes = Quiz.all\n # render json: @quizzes\n\n @options = {include: [:questions, :answers]}\n render json: QuizSerializer.new(@quizzes, @options)\n end", "title": "" }, { "docid": "2f0d31be26f0a402231271db37c38952", "score": "0.6802512", "text": "def all_quizzes\n \tarray_of_quiz_ids = self.responses.pluck(:quiz_id).uniq\n \tarray_of_quiz_ids.each do |id|\n \t quiz = Quiz.find(id: id).test_day\n \tend\n \tputs quiz\n end", "title": "" }, { "docid": "b6db6eb98721564b0f7df48657fc2836", "score": "0.6792706", "text": "def index\n @quiz_solutions = QuizSolution.all\n end", "title": "" }, { "docid": "2a802f9b10d6fce7be3e288eab2dd39f", "score": "0.6788988", "text": "def index\n @quotations = Quotation.all\n end", "title": "" }, { "docid": "2a802f9b10d6fce7be3e288eab2dd39f", "score": "0.6788988", "text": "def index\n @quotations = Quotation.all\n end", "title": "" }, { "docid": "2186c4a05c2af51c705d0e2667de2524", "score": "0.67812896", "text": "def index\n @qrs = Qr.all\n end", "title": "" }, { "docid": "c655d5133b4d84d7bee09f078a485bae", "score": "0.6778434", "text": "def set_quizz\n \t@quizz = Quizz.find(params[:id])\n \tend", "title": "" }, { "docid": "a8711b16ebecfa51b3fae75a12ef445a", "score": "0.6770886", "text": "def index\n @qaeods = Qaeod.all\n end", "title": "" }, { "docid": "15479391507d2c5add85fc976782a777", "score": "0.6767093", "text": "def index\n @rcadmin_faqs = Rcadmin::Faq.all\n end", "title": "" }, { "docid": "71d585670cebaf48166c13d74304c1d6", "score": "0.6746935", "text": "def admin_panel_quizzes\n arrResults = Array.new\n\n @q = Quiz.ransack(params[:q])\n @matches = @q.result\n\n @arrResults = @matches.to_a\n\n @quizzes = Quiz.all\n end", "title": "" }, { "docid": "2961b62a727ce95de77c17eb1f576106", "score": "0.67442095", "text": "def show\n @quiz_questions = QuizQuestion.where(:quize_id => @quize.id)\n end", "title": "" }, { "docid": "43c42b850d6f61e143acb65417d341a7", "score": "0.6737504", "text": "def index\n @quiz_attempts = QuizAttempt.all\n end", "title": "" }, { "docid": "43c42b850d6f61e143acb65417d341a7", "score": "0.6737504", "text": "def index\n @quiz_attempts = QuizAttempt.all\n end", "title": "" }, { "docid": "f3719e3548d4602689aceed4f0247efc", "score": "0.6733237", "text": "def index\n @quests = Quest.all\n end", "title": "" }, { "docid": "f3719e3548d4602689aceed4f0247efc", "score": "0.6733237", "text": "def index\n @quests = Quest.all\n end", "title": "" }, { "docid": "f3719e3548d4602689aceed4f0247efc", "score": "0.6733237", "text": "def index\n @quests = Quest.all\n end", "title": "" }, { "docid": "f3719e3548d4602689aceed4f0247efc", "score": "0.6733237", "text": "def index\n @quests = Quest.all\n end", "title": "" }, { "docid": "d0956f1b313a004a2b47914c37c42bc8", "score": "0.66953105", "text": "def index\n @quiz_submissions = QuizSubmission.all\n end", "title": "" }, { "docid": "aafd4bc57042088228cd177c373b7dcc", "score": "0.6670067", "text": "def index\n @publishquizzes = Publishquiz.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @publishquizzes }\n end\n end", "title": "" }, { "docid": "266170dd4a6ff3157c279732ed56d916", "score": "0.6665752", "text": "def show\n @event = Event.find(params[:id])\n \n @quizzes = @event.quizzes.all\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @event }\n end\n end", "title": "" }, { "docid": "5a2b67d9e9ac2c74386b08a8ae2aad73", "score": "0.66631395", "text": "def index\n @faqs = Faq.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @faqs }\n end\n end", "title": "" }, { "docid": "7f533f9a0419b68d3829febdd4570b99", "score": "0.66609013", "text": "def quizzes\n Quiz.joins(:content_page_elements).where('content_page_elements.id' => self.content_page_elements)\n end", "title": "" }, { "docid": "07ca3c70cb02f9c09b64f0cabf637297", "score": "0.66410047", "text": "def index\n @questions = Question.All\n end", "title": "" }, { "docid": "aa4b669b2519282c21a6ff8f0b64d93d", "score": "0.66309035", "text": "def list_quizzes_in_course(course_id,opts={})\n query_param_keys = [\n :search_term\n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"course_id is required\" if course_id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :course_id => course_id\n )\n\n # resource path\n path = path_replace(\"/v1/courses/{course_id}/quizzes\",\n :course_id => course_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, Quiz, path, query_params)\n \n end", "title": "" }, { "docid": "85ce52f041ef1deb16e4f98c7a835e2c", "score": "0.66272056", "text": "def index\n @quarters = Quarter.all\n end", "title": "" }, { "docid": "1d40ea3807de78971e92c54bdd1f4ffe", "score": "0.6626976", "text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @quizzes }\n end\n end", "title": "" }, { "docid": "38bfee9f88c51f652980e1784afcd536", "score": "0.66137123", "text": "def index\n @quiz = Quiz.find(params[:quiz_id])\n @games = @quiz.games\n end", "title": "" }, { "docid": "15857c560baf291bc7410861523b9719", "score": "0.6606989", "text": "def index\n @quizzes = Quiz.all\n @quizzes_per_language = Quiz.group(:language_learning).pluck(:language_learning, Arel.sql(\"count(quizzes.language_learning)\"))\n @specific_users_quizzes = Quiz.where(:user_id == User.find(session[:user_id])).joins(:attempts).group(:quiz_id).pluck(:title, :language_learning, :difficulty_level, Arel.sql(\"count(quizzes.id)\"), Arel.sql(\"avg(attempts.score)\"),:quiz_id)\n @specific_users_stats = Quiz.joins(:attempts).where(\"attempts.user_id=?\", \"#{session[:user_id]}\").group(:quiz_id).pluck(:title, :language_learning, :difficulty_level, Arel.sql(\"count(quizzes.id)\"), Arel.sql(\"avg(attempts.score)\"))\n end", "title": "" }, { "docid": "8013c0edf03722a95c557c6c51fe8f5e", "score": "0.66030234", "text": "def index\n @quest_items = QuestItem.all\n end", "title": "" }, { "docid": "5b100af6154106b8715149aa5c4baa38", "score": "0.6596327", "text": "def index\n @quedas = Queda.all\n end", "title": "" } ]
8e2bdadaf2d911cea23981af4f46ebc9
NOTE: you can't change the region once the bucket is created
[ { "docid": "ff968142268e2a70507e5274d1bbb824", "score": "0.0", "text": "def location=(new_location)\n new_location = 'oss-' + new_location unless new_location.start_with?('oss-')\n @location = new_location\n end", "title": "" } ]
[ { "docid": "a8768b6bdab531d909cdb2a45bb36e02", "score": "0.76994586", "text": "def default_bucket_region(region)\n @cycler.bucket_region = region\n end", "title": "" }, { "docid": "0eb2f2d3457ad542dac2b74447050cb9", "score": "0.7334912", "text": "def create?(region)\n @bucket.create(create_bucket_configuration: { location_constraint: region })\n true\n rescue Aws::Errors::ServiceError => e\n puts \"Couldn't create bucket. Here's why: #{e.message}\"\n false\n end", "title": "" }, { "docid": "e228b7b0daa3518906f81360f2cf5950", "score": "0.7317698", "text": "def bucket\n @resource ||= Aws::S3::Resource.new(client: client)\n\n tenant_id = Account.current ? Account.current.id.to_s : :default\n _bucket = @resource.bucket(\"#{Cenit.aws_s3_bucket_prefix}-tenant-#{tenant_id}\")\n _bucket.create unless _bucket.exists?\n _bucket\n end", "title": "" }, { "docid": "e57ea0dba0c429a169e20dcb2604bbd8", "score": "0.7210297", "text": "def newBucket\n innerNewBucket \n end", "title": "" }, { "docid": "b28496d32a8f527f68366ed0e35a5f16", "score": "0.711479", "text": "def bucket_in_region?(s3_client, bucket_name, region)\r\n location = s3_client.get_bucket_location(bucket: bucket_name).location_constraint\r\n if region == location\r\n return true\r\n else\r\n return false\r\n end\r\nrescue StandardError => e\r\n puts \"Error accessing bucket: #{e.message}\"\r\n return false\r\nend", "title": "" }, { "docid": "b817d333a279f31da4b2037188e1ef3b", "score": "0.70824736", "text": "def bucket\n @s3_bucket ||= begin\n bucket = client.bucket(s3_configuration[:bucket_name])\n unless bucket.exists?\n bucket_config = if s3_configuration[:region] == \"us-east-1\"\n nil\n else\n {\n location_constraint: s3_configuration[:region],\n }\n end\n bucket.create(create_bucket_configuration: bucket_config)\n end\n bucket\n end\n end", "title": "" }, { "docid": "5acdc5a200779b2a925b125769e72e64", "score": "0.70501804", "text": "def bucket(name, region = nil)\n Bucket.send(:new, self, name, region || REGION_DEFAULT)\n end", "title": "" }, { "docid": "efb13f87cd709b75d99c6ac605490873", "score": "0.70114756", "text": "def region\n defined?(super) ? super : \"us-east-1\"\n end", "title": "" }, { "docid": "e02170c99a5aac6ce2210952ceb0c86f", "score": "0.6950512", "text": "def bucket\n PreservationCatalog::S3.configure(\n region: Settings.zip_endpoints.aws_s3_east_1.region,\n access_key_id: Settings.zip_endpoints.aws_s3_east_1.access_key_id,\n secret_access_key: Settings.zip_endpoints.aws_s3_east_1.secret_access_key\n )\n PreservationCatalog::S3.bucket\n end", "title": "" }, { "docid": "01f04cfffc414b6f218e5c96111d9b2d", "score": "0.69479305", "text": "def bucket\n return @bucket if @bucket\n bucket_name = 'kortapositioner.se'\n s3 = Aws::S3::Resource.new(region:'eu-west-1')\n @bucket = s3.bucket(bucket_name)\n end", "title": "" }, { "docid": "7ad0f8f0970f20b8b1a3b92cc1ad4fa3", "score": "0.6918588", "text": "def add_bucket\n puts @bucket_name\n @bucket = @s3.buckets.create(@bucket_name)\n puts \"Created new bucket '#{@bucket_name}' in region '#{@region}'.\"\n configure_bucket\n end", "title": "" }, { "docid": "b31cd58a1f794d3b283484011286e90f", "score": "0.68982226", "text": "def get_bucket(bucket)\n end", "title": "" }, { "docid": "8f116cb7b47e2097ae5ee93410a2e653", "score": "0.68968093", "text": "def create_bucket(bucket_name, location=nil, header={})\n Adapter.put_bucket bucket_name, location, header\n self[bucket_name]\n end", "title": "" }, { "docid": "d8377f302b059af9835e90499ea0994d", "score": "0.68875176", "text": "def s3_service(bucket_name = nil) \n s3 = Aws::S3::Client.new\n if bucket_name\n resp = s3.get_bucket_location({bucket: bucket_name})\n region = resp['location_constraint']\n return Aws::S3::Client.new({region: region}) if !region.empty?\n end\n s3\nend", "title": "" }, { "docid": "9bae015aba662459c67eca4b4a9f1d08", "score": "0.68648094", "text": "def run_me\r\n region = 'us-west-2'\r\n s3_client = Aws::S3::Client.new(region: region)\r\n\r\n list_accessible_buckets_in_region(s3_client, region)\r\nend", "title": "" }, { "docid": "db41e91d53d148d651b46069a2911591", "score": "0.68438065", "text": "def run_me\r\n bucket_name = 'doc-example-bucket'\r\n region = 'us-west-2'\r\n s3_client = Aws::S3::Client.new(region: region)\r\n\r\n if bucket_in_region?(s3_client, bucket_name, region)\r\n puts \"Bucket '#{bucket_name}' exists in Region '#{region}'.\"\r\n else\r\n puts \"Bucket '#{bucket_name}' does not exist, \" \\\r\n \"does not exist in AWS Region '#{region}', \" \\\r\n 'the Region was not specified when the bucket was initially created, ' \\\r\n 'or the bucket is not otherwise accessible to you.'\r\n end\r\nend", "title": "" }, { "docid": "db71b4e2bbcd2d81e488eb7953e199d2", "score": "0.6840765", "text": "def bucket\n storage.bucket(dataset_name, user_project: true) || storage.create_bucket(dataset_name, acl: \"public\", default_acl: \"public\", storage_class: \"standard\", location: \"us-east1\", requester_pays: true, user_project: true)\n end", "title": "" }, { "docid": "4435742b863df6d0b48be2ebda0b4d6d", "score": "0.6804019", "text": "def bucket\n Replication::AwsProvider.new(\n region: Settings.zip_endpoints.aws_s3_east_1.region,\n access_key_id: Settings.zip_endpoints.aws_s3_east_1.access_key_id,\n secret_access_key: Settings.zip_endpoints.aws_s3_east_1.secret_access_key\n ).bucket\n end", "title": "" }, { "docid": "3a117bbead9dbc6b7062e249fc792676", "score": "0.67903084", "text": "def create_bucket\n bucket = @s3_resource.create_bucket(\n bucket: \"doc-example-bucket-#{Random.uuid}\",\n create_bucket_configuration: {\n location_constraint: \"us-east-2\" # Note: only certain regions permitted\n }\n )\n puts(\"Created demo bucket named #{bucket.name}.\")\n rescue Aws::Errors::ServiceError => e\n puts(\"Tried and failed to create demo bucket.\")\n puts(\"\\t#{e.code}: #{e.message}\")\n puts(\"\\nCan't continue the demo without a bucket!\")\n raise\n else\n bucket\n end", "title": "" }, { "docid": "aabf5326f084787edfab4fec2655299b", "score": "0.6758027", "text": "def initialize_bucket(bucket_name)\n connect_to_s3\n bucket = AWS::S3::Bucket.find(bucket_name, :max_keys => 1) \n bucket = AWS::S3::Bucket.create(bucket_name) unless bucket\n bucket\n end", "title": "" }, { "docid": "822e98b05c413cd2dd86fe39c28a8e58", "score": "0.67187685", "text": "def bucket\n PreservationCatalog::Ibm.configure(\n region: Settings.zip_endpoints.ibm_us_south.region,\n access_key_id: Settings.zip_endpoints.ibm_us_south.access_key_id,\n secret_access_key: Settings.zip_endpoints.ibm_us_south.secret_access_key\n )\n PreservationCatalog::Ibm.bucket\n end", "title": "" }, { "docid": "68f31fae43908c4e0ae96d35e562157b", "score": "0.6718403", "text": "def put_bucket(name, location = 'oss-cn-hangzhou')\n bucket = Bucket.new(name: name, location: location)\n request = Aliyun::Oss::OssRequest.new(bucket, '/')\n request.body = <<HERE\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<CreateBucketConfiguration>\n<LocationConstraint>#{location}</LocationConstraint>\n</CreateBucketConfiguration>\nHERE\n request.put\n end", "title": "" }, { "docid": "416ef0f64b173b549baf17d7f3f44fdb", "score": "0.6713317", "text": "def bucket # to ignore :backup\n nil\n end", "title": "" }, { "docid": "7f417aca80763ac144f712e9c110435e", "score": "0.670888", "text": "def region\n GlobalConstant::Aws::Common.region\n end", "title": "" }, { "docid": "7f417aca80763ac144f712e9c110435e", "score": "0.670888", "text": "def region\n GlobalConstant::Aws::Common.region\n end", "title": "" }, { "docid": "e498fdf20be3dedf9407bbe3513ea6ee", "score": "0.67070603", "text": "def bucket(file)\n unless (_bucket = file.instance_variable_get(:@_aws_s3_bucket))\n _bucket = resource.bucket(bucket_name(file))\n _bucket.create unless _bucket.exists?\n end\n _bucket\n end", "title": "" }, { "docid": "65c1fd27306815b00b5a853869e0801a", "score": "0.6704395", "text": "def init_bucket(bucket_name)\n\tbucket = @s3.buckets[bucket_name]\n\tif bucket.exists?\n\t\tputs \"Bucket '#{bucket_name}' already exists. Adding to this bucket.\"\n\telse\n\t\t# create a bucket\n\t\tb = @s3.buckets.create(bucket_name, :acl => :public_read)\n\t\t#b.configure_website do |cfg|\n\t\t # cfg.index_document_suffix = 'index.html'\n\t\t#end\n\t\tputs \"Bucket '#{bucket_name}' created.\"\n\tend\n\t#puts \" \" #blank line for readibility\nend", "title": "" }, { "docid": "e4a3bb60b738251f251f8ad759036fd9", "score": "0.66923416", "text": "def create_bucket(name)\n create_resource :bucket, :name => name\n end", "title": "" }, { "docid": "893c899f91a882ac62492fe728623f5b", "score": "0.6690122", "text": "def region\n aws_region\n end", "title": "" }, { "docid": "63331b7bb2fc97dd5d9486cb29258e96", "score": "0.66798574", "text": "def bucket\n @bucket ||= Riik.client.bucket(bucket_name)\n end", "title": "" }, { "docid": "50d5256134a23bc388beb63ae418af8c", "score": "0.6658455", "text": "def initiate_aws_s3_bucket(options)\n s3 = Aws::S3::Bucket.new(\n :region => options['region'], \n :access_key_id => options['access'],\n :secret_access_key => options['secret']\n )\n return s3\nend", "title": "" }, { "docid": "84cb133736dab77435f9ade378c91ca5", "score": "0.6624982", "text": "def prepare_s3(bucket)\n bucket_new = deep_copy(bucket)\n bucket_old = deep_copy(bucket['Resources']['EncryptedS3Bucket'])\n bucket_name = \"bucket#{rand(1...999)}-${AWS::StackName}-${AWS::AccountId}\"\n\n #assign the values accordingly\n bucket_new['Resources'][\"EncryptedS3Bucket\"][\"Properties\"][\"BucketName\"][\"Fn::Sub\"] = bucket_name\n bucket_new['Resources'].delete(\"myVPC\")\n bucket_new\n end", "title": "" }, { "docid": "8a0c0493a4033c05b43df613ae0d12e7", "score": "0.6592889", "text": "def bucket_arn; \"arn:aws:s3:*:*:#{bucket_name}\" end", "title": "" }, { "docid": "2b9ad41fb93aeb6092b5959895cd9ce5", "score": "0.6583174", "text": "def region\n zfind(:aws_region) || 'us-west-2'\n end", "title": "" }, { "docid": "121d114e7ad6662631ba09e0000b686e", "score": "0.6581594", "text": "def update_region(context, queue_url)\n if queue_region = queue_url.to_s.split('.')[1]\n if queue_region != context.config.region\n config = context.config.dup\n config.region = queue_region\n config.sigv4_region = queue_region\n config.sigv4_signer = Aws::Plugins::SignatureV4.build_signer(config)\n context.config = config\n end\n end\n end", "title": "" }, { "docid": "2a54b8e54ed8140d17b00664e1231907", "score": "0.6580314", "text": "def new_fog_s3_from(region, access_key_id, secret_access_key)\n Fog::Storage.new({\n :provider => 'AWS',\n :region => region,\n :aws_access_key_id => access_key_id,\n :aws_secret_access_key => secret_access_key\n })\n end", "title": "" }, { "docid": "5fdf7b1b93d037f73285f972e294d05e", "score": "0.65649706", "text": "def changeBucket(bucket_name)\n \n bucket = $s3.buckets[bucket_name]\n \n #check if bucket exists\n if bucket.exists?\n puts \"bucket called #{bucket.name} exists!\"\n else\n puts \"creating new bucket\"\t#called #{bucket.name}\"\n bucket = $s3.buckets.create(bucket.name)\n end\n return bucket\nend", "title": "" }, { "docid": "74ca89f41d5cafb7d39d7d449b89f7ee", "score": "0.65418154", "text": "def bucket\n @bucket ||= System.clean(\"#{System.db_credentials['database'].downcase}-ON-#{System.hostname.downcase}\")\n end", "title": "" }, { "docid": "8043a95a4421fb966418d53683ce35b1", "score": "0.65403414", "text": "def create_bucket(bucket, headers={})\n data = nil\n unless headers[:location].blank?\n data = \"<CreateBucketConfiguration><LocationConstraint>#{headers[:location].to_s.upcase}</LocationConstraint></CreateBucketConfiguration>\"\n end\n req_hash = generate_rest_request('PUT', headers.merge(:url=>bucket, :data => data))\n request_info(req_hash, RightHttp2xxParser.new)\n rescue Exception => e\n # if the bucket exists AWS returns an error for the location constraint interface. Drop it\n e.is_a?(RightAws::AwsError) && e.message.include?('BucketAlreadyOwnedByYou') ? true : on_exception\n end", "title": "" }, { "docid": "25b8451831c11f38eae89284a74edee8", "score": "0.6523757", "text": "def update_region(context, queue_url)\n if (queue_region = parse_region(queue_url))\n if queue_region != context.config.region\n config = context.config.dup\n config.region = queue_region\n config.sigv4_region = queue_region\n config.sigv4_signer = Aws::Plugins::SignatureV4.build_signer(config)\n context.config = config\n end\n end\n end", "title": "" }, { "docid": "a9259104f9b71a18e871f51847d11d50", "score": "0.6517691", "text": "def update_region(context, queue_url)\n if queue_region = parse_region(queue_url)\n if queue_region != context.config.region\n config = context.config.dup\n config.region = queue_region\n config.sigv4_region = queue_region\n config.sigv4_signer = Aws::Plugins::SignatureV4.build_signer(config)\n context.config = config\n end\n end\n end", "title": "" }, { "docid": "980df371154970924e9d938a53dfc110", "score": "0.6508207", "text": "def use_bucket(bucket)\n @bucket = bucket\n end", "title": "" }, { "docid": "bc7f9c7ee4df2900f034d78ae3d1cbb0", "score": "0.6501473", "text": "def get bucket=nil\n if bucket\n super [@resource , bucket].join('/') \n else \n super\n end\n end", "title": "" }, { "docid": "ee931d6809fcdeb34d43e4608903e017", "score": "0.6490277", "text": "def create_bucket(client)\n if @bucket.nil?\n bucket_name = System.clean(\"#{System.db_credentials['database'].downcase}-ON-#{System.hostname.downcase}\")\n @bucket = client.buckets[bucket_name]\n @bucket = client.buckets.create(bucket_name) if [email protected]?\n end\n @bucket\n end", "title": "" }, { "docid": "0e3df8cde5f892aa4221a63bdeb2af84", "score": "0.6485876", "text": "def create_bucket(bktname)\n bucket = @s3.bucket(bktname)\n if ! bucket.exists?\n @logger.debug(\"Creating bucket\", :bucket => bktname)\n @s3.create_bucket(:bucket => bktname)\n @logger.debug(\"Created bucket\", :bucket => bktname)\n end\n end", "title": "" }, { "docid": "0e3df8cde5f892aa4221a63bdeb2af84", "score": "0.6485876", "text": "def create_bucket(bktname)\n bucket = @s3.bucket(bktname)\n if ! bucket.exists?\n @logger.debug(\"Creating bucket\", :bucket => bktname)\n @s3.create_bucket(:bucket => bktname)\n @logger.debug(\"Created bucket\", :bucket => bktname)\n end\n end", "title": "" }, { "docid": "96bbc6cd315b9582dbb7bafbeb2c4f4c", "score": "0.6483421", "text": "def existing_bucket\n @existing_bucket ||= storage.buckets.select { |b| b.name == bucket_name }.first\nend", "title": "" }, { "docid": "01cf50ef9522757128440e05be3759ad", "score": "0.64731973", "text": "def run_me\r\n region = 'us-west-2'\r\n s3_client = Aws::S3::Client.new(region: region)\r\n open_buckets = get_open_buckets(s3_client, region)\r\n if open_buckets.count.zero?\r\n puts 'No open buckets among accessible buckets with AWS Region specified ' \\\r\n \"as '#{region}' on initial creation.\"\r\n else\r\n puts 'Open buckets among accessible buckets with AWS Region specified ' \\\r\n \"as '#{region}' on initial creation:\"\r\n open_buckets.each do |open_bucket|\r\n puts open_bucket\r\n end\r\n end\r\nend", "title": "" }, { "docid": "779ad8a62eee7f7295ab23f37fce03ae", "score": "0.646091", "text": "def random_bucket_hash name=random_bucket_name\n {\"kind\"=>\"storage#bucket\",\n \"id\"=>name,\n \"selfLink\"=>\"https://www.googleapis.com/storage/v1/b/#{name}\",\n \"projectNumber\"=>\"1234567890\",\n \"name\"=>name,\n \"timeCreated\"=>::Time.now,\n \"metageneration\"=>\"1\",\n \"owner\"=>{\"entity\"=>\"project-owners-1234567890\"},\n \"location\"=>\"US\",\n \"storageClass\"=>\"STANDARD\",\n \"etag\"=>\"CAE=\" }\n end", "title": "" }, { "docid": "779ad8a62eee7f7295ab23f37fce03ae", "score": "0.646091", "text": "def random_bucket_hash name=random_bucket_name\n {\"kind\"=>\"storage#bucket\",\n \"id\"=>name,\n \"selfLink\"=>\"https://www.googleapis.com/storage/v1/b/#{name}\",\n \"projectNumber\"=>\"1234567890\",\n \"name\"=>name,\n \"timeCreated\"=>::Time.now,\n \"metageneration\"=>\"1\",\n \"owner\"=>{\"entity\"=>\"project-owners-1234567890\"},\n \"location\"=>\"US\",\n \"storageClass\"=>\"STANDARD\",\n \"etag\"=>\"CAE=\" }\n end", "title": "" }, { "docid": "b482e0b7d4d7bd1d1c731ce40c02314e", "score": "0.6459169", "text": "def init_bucket(bucket_name)\n\tbucket = @s3.buckets[bucket_name]\n\tif bucket.exists?\n\t\tputs \"Bucket '#{bucket_name}' already exists. Adding to this bucket.\"\n\telse\n\t\t# create a bucket\n\t\tb = @s3.buckets.create(bucket_name)\n\t\tputs \"Bucket '#{bucket_name}' created.\"\n\tend\n\tputs \" \" #blank line for readibility\nend", "title": "" }, { "docid": "1aab0028b024fde95a402d1e00910428", "score": "0.6455912", "text": "def random_bucket_hash name=random_bucket_name\n {\"kind\"=>\"storage#bucket\",\n \"id\"=>name,\n \"selfLink\"=>\"https://www.googleapis.com/storage/v1/b/#{name}\",\n \"projectNumber\"=>\"1234567890\",\n \"name\"=>name,\n \"timeCreated\"=>Time.now,\n \"metageneration\"=>\"1\",\n \"owner\"=>{\"entity\"=>\"project-owners-1234567890\"},\n \"location\"=>\"US\",\n \"storageClass\"=>\"STANDARD\",\n \"etag\"=>\"CAE=\" }\n end", "title": "" }, { "docid": "0ee7228e3dee886653f1d1cac54fef98", "score": "0.64529544", "text": "def run_me\n bucket_name = 'doc-example-bucket'\n region = 'us-east-1'\n\n s3_client = Aws::S3::Client.new(region: region)\n\n puts \"Creating the bucket '#{bucket_name}'...\"\n\n if bucket_created?(s3_client, bucket_name)\n puts 'The bucket was created.'\n else\n puts 'The bucket was not created. Stopping program.'\n exit 1\n end\nend", "title": "" }, { "docid": "0b475b0593e0a6aa006c9cd0fe65e32d", "score": "0.64513355", "text": "def uri\n \"aws://#{@options[:region]}\"\n end", "title": "" }, { "docid": "56804085f82413398c9cac94b9d419ea", "score": "0.6446734", "text": "def type\n bucket_type\n end", "title": "" }, { "docid": "a0f5ad2be72f84a41b54a412213a2719", "score": "0.6442849", "text": "def bucket\n if @bucket.nil?\n @bucket = client.bucket(Config.s3_bucket)\n end\n @bucket\n end", "title": "" }, { "docid": "d3e2a125a825b1d5b34b470ffc40d927", "score": "0.64369166", "text": "def setup_bucket(params={})\n granting_params = { \n :s3_videos_bucket => params[:bucket],\n :aws_access_key => params[:access_key],\n :aws_secret_key => params[:secret_key]\n }\n\n put(\"/clouds/#{@cloud_id}.json\", granting_params)\n end", "title": "" }, { "docid": "abd2cdd639fe53c1b79f08ececb3dffd", "score": "0.6436555", "text": "def run_me\r\n region = 'us-west-2'\r\n s3_client = Aws::S3::Client.new(region: region)\r\n list_buckets(s3_client, 25)\r\nend", "title": "" }, { "docid": "aa4802e7c1f600bb6b758bb142dfd969", "score": "0.6430115", "text": "def configure_s3_bucket\n connection = Fog::Storage.new(:provider => 'AWS',\n :aws_access_key_id => Constants::S3_ACCESS_KEY_ID,\n :aws_secret_access_key => Constants::S3_SECRET_ACCESS_KEY)\n\n connection.directories.create(:key => Constants::S3_BUCKET_NAME,\n :public => true)\n end", "title": "" }, { "docid": "c43cbc0be1948ba801e038cc79271750", "score": "0.64277893", "text": "def bucket\n self.class.bucket\n end", "title": "" }, { "docid": "42102a72bf26beca3058e8a008045d57", "score": "0.6425577", "text": "def run_me\n bucket_name = 'doc-example-bucket'\n region = 'us-west-2'\n\n s3_client = Aws::S3::Client.new(region: region)\n\n puts \"Creating the bucket '#{bucket_name}'...\"\n\n if bucket_created?(s3_client, bucket_name)\n puts 'The bucket was created.'\n else\n puts 'The bucket was not created. Stopping program.'\n exit 1\n end\nend", "title": "" }, { "docid": "f66a09d71a8aaea95776604c6df911fe", "score": "0.64063895", "text": "def bucket_name\n 'ios-ksr-builds'\nend", "title": "" }, { "docid": "87ff7a65f1bf537aea18fb58121efe27", "score": "0.64006275", "text": "def [](bucket_name)\n self.new bucket_name\n end", "title": "" }, { "docid": "87f2635c35b4f23eadb9fd1c3e7ffb21", "score": "0.6398425", "text": "def create_storage_location\n storage_location = @elasticbeanstalk.create_storage_location\n if storage_location and storage_location.to_h.has_key? :s3_bucket\n storage_location.to_h[:s3_bucket]\n else\n nil\n end\n end", "title": "" }, { "docid": "9c3bcc92ade5c5212e1a0acbc8de8ccc", "score": "0.6396621", "text": "def create_bucket(bucket_name)\n\n begin\n puts 'Creating the bucket now.'\n if AWS::S3::Bucket.create(bucket_name)\n puts \"Good, bucket #{bucket_name} created.\"\n end\n rescue \n puts \"The bucket #{bucket_name} could not be created\"\n return\n end\n\nend", "title": "" }, { "docid": "3b6d25ff385546890ce4c95223656e22", "score": "0.639064", "text": "def gcs_create_bucket(bucket_name)\n\n # Create a bucket\n exec(\"gsutil mb gs://#{bucket_name}\")\n\n # Set the bucket's default ACL to public-read, \n # which enables users to see their uploaded images:\n exec(\"gsutil defacl set public-read gs://#{bucket_name}\")\n\n # Creating Cloud Storage access keys\n # 1. Open the Cloud Storage Settings.\n # 2. In the menu at the top, click Interoperability.\n # 3. Click Create a new key.\n # 4. Note the Access Key and Secret because they will be used in the application configuration.\n\nend", "title": "" }, { "docid": "e8dbf1a7cc5c79443b3023fce0c2d4d9", "score": "0.6389533", "text": "def aws_s3_config\n\n @endpoint_region == 'us-east-1' ? @endpoint_region = 's3.amazonaws.com' : @endpoint_region = 's3-'+@endpoint_region+'.amazonaws.com'\n\n @logger.info(\"Registering s3 output\", :bucket => @bucket, :endpoint_region => @endpoint_region)\n\n AWS.config(\n :access_key_id => @access_key_id,\n :secret_access_key => @secret_access_key,\n :s3_endpoint => @endpoint_region\n )\n @s3 = AWS::S3.new\n\n end", "title": "" }, { "docid": "855406905c5b6803b3143ed2a6fba285", "score": "0.63888377", "text": "def bucket_name\n config[:bucket_name]\n end", "title": "" }, { "docid": "855406905c5b6803b3143ed2a6fba285", "score": "0.63888377", "text": "def bucket_name\n config[:bucket_name]\n end", "title": "" }, { "docid": "072a91cc7d1d4043916a1d882e959fd9", "score": "0.6387826", "text": "def location\n if @bucket.nil?\n \"None. You must create a bucket before you can get it's location!\"\n else\n @bucket.client.get_bucket_location(bucket: @bucket.name).location_constraint\n end\n rescue Aws::Errors::ServiceError => e\n \"Couldn't get the location of #{@bucket.name}. Here's why: #{e.message}\"\n end", "title": "" }, { "docid": "ac944687d7c4429213f58f5c3a0ca8f4", "score": "0.63821477", "text": "def test\n connection = Fog::Storage::Google.new\n\n puts \"Put a bucket...\"\n puts \"----------------\"\n connection.put_bucket(\"fog-smoke-test\", predefined_acl: \"publicReadWrite\")\n\n puts \"Get the bucket...\"\n puts \"-----------------\"\n connection.get_bucket(\"fog-smoke-test\")\n\n puts \"Put a test file...\"\n puts \"---------------\"\n connection.put_object(\"fog-smoke-test\", \"my file\", \"THISISATESTFILE\")\n\n puts \"Delete the test file...\"\n puts \"---------------\"\n connection.delete_object(\"fog-smoke-test\", \"my file\")\n\n puts \"Delete the bucket...\"\n puts \"------------------\"\n connection.delete_bucket(\"fog-smoke-test\")\nend", "title": "" }, { "docid": "b7c777b3452390deca5ccad89deca899", "score": "0.6380713", "text": "def aws_region(region = 'us-east-1')\n @platform.aws_region = region\n end", "title": "" }, { "docid": "e963de7d169930fa396484fd78a5b11f", "score": "0.63799214", "text": "def create_bucket(bucket_name)\n error?(request_put(\"/#{bucket_name}\"))\n @cache.delete(:buckets)\n return get_bucket(bucket_name)\n end", "title": "" }, { "docid": "8330203d88ff9507e2030b27880d9d11", "score": "0.63705677", "text": "def create_bucket(name)\n Bucket.create(name)\n end", "title": "" }, { "docid": "cc02253c29ae6269c78b05d90dd1fe49", "score": "0.6365306", "text": "def bucket_created?(s3_client, bucket_name)\n s3_client.create_bucket(bucket: bucket_name)\nrescue StandardError => e\n puts \"Error while creating the bucket named '#{bucket_name}': #{e.message}\"\nend", "title": "" }, { "docid": "fd777e3ad9522594561d1a168d337ad0", "score": "0.6362419", "text": "def create_bucket(bucketname, s3)\n begin \n s3.create_bucket(bucketname)\n rescue \n puts bucketname + ' bucket already exists...' \n end\nend", "title": "" }, { "docid": "363ad561ba21ba5a6993a3921ce44cd4", "score": "0.63475704", "text": "def location\n @location ||= @s3.interface.bucket_location(@name)\n end", "title": "" }, { "docid": "bd446e32dc03eb9368e600d932e7c79c", "score": "0.6344114", "text": "def content\n s3 = Aws::S3::Resource.new\n bucket = s3.bucket @bucket_name\n fail \"bucket with name #{@bucket_name} not found\" if bucket.nil?\n bucket \n end", "title": "" }, { "docid": "6c2d8be508e2ce4881fb649e47cf6cb1", "score": "0.63341236", "text": "def bucket(name)\n Bucket.send(:new, self, name)\n end", "title": "" }, { "docid": "d046d47fb2d94ecac10e817779c8c220", "score": "0.6326539", "text": "def default_bucket(bucket)\n @bucket = bucket\n end", "title": "" }, { "docid": "f0f7a3323226c55632b18a0a5e00bb3f", "score": "0.6317954", "text": "def create_bucket(bucket_name)\n begin\n puts 'Creating the bucket now.'\n if AWS::S3::Bucket.create(bucket_name)\n puts \"Good, bucket #{bucket_name} created.\"\n end\n rescue \n puts \"The bucket #{bucket_name} could not be created\"\n return\n end\nend", "title": "" }, { "docid": "ae7d7aa8517248c1d4bc17a46b87eb87", "score": "0.63118285", "text": "def bucket\n @bucket ||= Puppet::Type.type(:filebucket).mkdefaultbucket.bucket\n end", "title": "" }, { "docid": "52f74fdb0b684cbb62566aa143dd022c", "score": "0.62961924", "text": "def region_config_section\n region_parts = aws_client_args[:region].split('-')\n \"aws_s3_#{region_parts[1]}_#{region_parts[2]}\"\n end", "title": "" }, { "docid": "1408182ef6e21ac5ea7a1ad3d5d7fb42", "score": "0.62915707", "text": "def return_bucket(bucket_type) \n bucket = YAML.load_file(\"#{::Rails.root.to_s}/config/s3.yml\")[bucket_type]\n end", "title": "" }, { "docid": "6588fedb0f073456ec566c5930b121dd", "score": "0.6285193", "text": "def name\n @bucket\n end", "title": "" }, { "docid": "c18150ee5305c658d88a60626a841f3b", "score": "0.6271974", "text": "def save(location = nil)\n create_bucket_configuration(location)\n true\n end", "title": "" }, { "docid": "dabec2046feb45de6cef845324634812", "score": "0.6271383", "text": "def create_aws_s3_bucket(options)\n s3 = initiate_aws_s3_resource(options)\n if s3.bucket(options['bucket']).exists?\n handle_output(options,\"Information:\\tBucket: #{options['bucket']} already exists\")\n s3 = initiate_aws_s3_client(options['access'],options['secret'],options['region'])\n begin\n s3.head_bucket({ bucket: options['bucket'], })\n rescue\n handle_output(options,\"Warning:\\tDo not have permissions to access bucket: #{options['bucket']}\")\n quit(options)\n end\n else\n handle_output(options,\"Information:\\tCreating S3 bucket: #{options['bucket']}\")\n s3.create_bucket({ acl: options['acl'], bucket: options['bucket'], create_bucket_configuration: { location_constraint: options['region'], }, })\n end\n return s3\nend", "title": "" }, { "docid": "d01b9ab9b164304d4890b418ea9637d9", "score": "0.6269277", "text": "def s3_bucket_enriched?\n require_enrichment if _get_entity_detail('region').nil?\n region = _get_entity_detail('region')\n _log_error 'Bucket does not have a region meaning it does not exist; exiting task.' if region.nil?\n region\n end", "title": "" }, { "docid": "347123ac72c2f737aaa744954ba85851", "score": "0.62642825", "text": "def region=(region)\n @region = region\n Aws.config = { region: @region }\n end", "title": "" }, { "docid": "17b1d9491c940c7245509e198e0cee74", "score": "0.6260855", "text": "def region\n if ENV.include?('REGION')\n ENV['REGION']\n else\n 'us-east-1'\n end\nend", "title": "" }, { "docid": "cf17fd481615a95fd4e6f896a9241db0", "score": "0.6249537", "text": "def arn\n \"arn:\"+(MU::Cloud::AWS.isGovCloud?(@region) ? \"aws-us-gov\" : \"aws\")+\":s3:::\"+@cloud_id\n end", "title": "" }, { "docid": "04bc9c959344d81951a2f1396edd8a04", "score": "0.62345743", "text": "def test\n connection = Fog::Storage::Google.new\n\n puts \"Put a bucket...\"\n puts \"----------------\"\n connection.put_bucket(\"fog-smoke-test\")\n\n puts \"Get the bucket...\"\n puts \"-----------------\"\n connection.get_bucket(\"fog-smoke-test\")\n\n puts \"Put a test file...\"\n puts \"---------------\"\n connection.put_object(\"fog-smoke-test\", \"my file\" ,\"THISISATESTFILE\")\n\n puts \"Delete the test file...\"\n puts \"---------------\"\n connection.delete_object(\"fog-smoke-test\", \"my file\")\n\n puts \"Delete the bucket...\"\n puts \"------------------\"\n connection.delete_bucket(\"fog-smoke-test\")\nend", "title": "" }, { "docid": "581aab1a77243e34cdf114d97de5c526", "score": "0.62313646", "text": "def get_S3Bucket(name, id, key)\n\tbucket = Fog::Storage.new(\n\t\tprovider: \"AWS\",\n\t\taws_access_key_id: id,\n\t\taws_secret_access_key: key,\n\t\tregion: \"eu-central-1\"\n\t).directories.get(name)\nend", "title": "" }, { "docid": "aa7c07a6c9c8a51e06e4846a503a1854", "score": "0.6228821", "text": "def location(bucket)\n l = client.get_bucket_location(bucket: bucket).location_constraint\n l.empty? ? 'us-east-1' : l\n end", "title": "" }, { "docid": "94e6b4dd3f76f4071cd37260cf8936c7", "score": "0.6221706", "text": "def location\n @location ||= @s3.interface.bucket_location(@name)\n end", "title": "" }, { "docid": "fdc19a091e08c2469fb5fe7e1227d964", "score": "0.6167043", "text": "def quickstart bucket_name:\n # Imports the Google Cloud client library\n require \"google/cloud/storage\"\n\n # Instantiates a client\n storage = Google::Cloud::Storage.new\n\n # The ID to give your GCS bucket\n # bucket_name = \"your-unique-bucket-name\"\n\n # Creates the new bucket\n bucket = storage.create_bucket bucket_name\n\n puts \"Bucket #{bucket.name} was created.\"\nend", "title": "" }, { "docid": "9c16bd5b1ed0a357caf3b7f36b0db63e", "score": "0.6167025", "text": "def run\n super\n\n # Make sure the key is set\n api_key = _get_task_config(\"grayhat_warfare_api_key\")\n max_buckets = _get_option(\"max_buckets\")\n\n search_string = _get_entity_name\n search_uri = \"https://buckets.grayhatwarfare.com/api/v1/buckets/0/#{max_buckets}?access_token=#{api_key}&keywords=#{search_string}\"\n\n begin \n \n # get it, make sure we don't have an empty response\n output = JSON.parse(http_get_body(search_uri))\n return unless output \n\n output[\"buckets\"].each do |b|\n # {\"id\":21,\"bucket\":\"0x4e84.test.s3-eu-west-1.amazonaws.com\"}\n _create_entity \"AwsS3Bucket\", { \n \"name\" => \"https://#{b[\"bucket\"]}\",\n \"uri\" => \"https://#{b[\"bucket\"]}\"\n }\n end\n rescue JSON::ParserError => e \n _log_error \"Unable to parse: #{e}\"\n end\n \n end", "title": "" }, { "docid": "d82c02969a44d238d107138842d0ea69", "score": "0.616411", "text": "def upload_to_s3\n\t\t#client = Aws::S3::Client.new(region: 'us-west-1')\n\t\ts3 = Aws::S3::Resource.new(region: 'us-west-1')\n\t\ttenant_name = Tenant.find(Thread.current[:tenant_id]).name\n\t\t#byebug\n\t\tobj = s3.bucket(ENV['S3_BUCKET']).object(\"#{tenant_name}/#{upload.original_filename}\")\n\t\t#obj = s3.bucket(ENV['AWS_S3_BUCKET']).object(\"#{tenant_name}/#{upload.original_filename}\")\n\t\tobj.upload_file(upload.path, acl:'public-read')\n\t\tself.key = obj.public_url\n\tend", "title": "" }, { "docid": "8cb73ab5e408257613673e5259b4faf4", "score": "0.6156105", "text": "def ensure_bucket!(bucket_name)\n begin \n AWS::S3::Bucket.find(bucket_name) \n rescue\n AWS::S3::Bucket.create(bucket_name) \n end\n end", "title": "" }, { "docid": "47c8718a13f9a0eced9cb22de68b86db", "score": "0.6152939", "text": "def get_bucket_region(bucket_name)\n client = get_s3_client(nil)\n options = { bucket: bucket_name, use_accelerate_endpoint: false }\n begin\n resp = client.get_bucket_location(options)\n # Note : if bucket is in us-east-1 => this value is empty string\n if resp.location_constraint && !resp.location_constraint.empty?\n resp.location_constraint\n else\n S3_DEFAULT_REGION\n end\n rescue StandardError\n nil\n end\n end", "title": "" }, { "docid": "44264d6904fa722af668b5ac9b1fa435", "score": "0.6143091", "text": "def s3_bucket(bucket_name)\n S3Bucket.new(bucket_name)\n end", "title": "" } ]
7db1dbfbd4fa715084e8b20b21547124
Returns the value of attribute main_sort_running_order. source://rbzip2//lib/rbzip2/ruby/output_data.rb10
[ { "docid": "b22b3546c20a91573ef3c2c8c18b3a0f", "score": "0.68569183", "text": "def main_sort_running_order; end", "title": "" } ]
[ { "docid": "0e430f1b16e58d6768f7fda8c0b3afd1", "score": "0.6279808", "text": "def value\n requested_sort[:key]\n end", "title": "" }, { "docid": "608c0bd1eb79ce5c614dfa7b3155b749", "score": "0.62518215", "text": "def sort_order\n return @sort_order\n end", "title": "" }, { "docid": "35886b2a4219e67db59d9f02716711fb", "score": "0.6152514", "text": "def execution_order\n attributes.fetch(:executionOrder)\n end", "title": "" }, { "docid": "610a87535add5fb11eab164071b8cbfc", "score": "0.6080906", "text": "def sort_priority\n data.fetch('sortPriority')\n end", "title": "" }, { "docid": "db55c69e53dbd4efeaa68252bde72e89", "score": "0.5973222", "text": "def sort_info\n @data['sort_info'].nil? ? 0 : @data['sort_info'].to_s.to_i\n end", "title": "" }, { "docid": "2d061ed91b7b0ac2412beb22541811cb", "score": "0.593392", "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": "847e8718a022c6c1728fd6e99512bd8b", "score": "0.58609045", "text": "def sort_key\n @code\n end", "title": "" }, { "docid": "69e4a602af34ef580d4468dd4391f112", "score": "0.5811432", "text": "def run_order\n 0\n end", "title": "" }, { "docid": "11da8da835a8149035c7417b5fdc0b56", "score": "0.5786814", "text": "def process_order\n po = read_attribute(:process_order)\n if po == nil\n po = process_order_LUT[name.to_sym]\n self.process_order = po\n save\n end\n return po\n end", "title": "" }, { "docid": "92a5f539b452d67867b1d6a60b4a7dc1", "score": "0.5758873", "text": "def run_order\n -10\n end", "title": "" }, { "docid": "c2c9ff6382f5b300f039977e64b0759b", "score": "0.56134963", "text": "def run_order\n -5\n end", "title": "" }, { "docid": "c2c9ff6382f5b300f039977e64b0759b", "score": "0.56134963", "text": "def run_order\n -5\n end", "title": "" }, { "docid": "8907f9fd34c046d4e53e929c16fac359", "score": "0.56121814", "text": "def order()\n return getValue(:order) - 1 ;\n end", "title": "" }, { "docid": "ebdb22cf17cded6d3266b5f56f3b507a", "score": "0.5594015", "text": "def sort_commandline\n settings[:sort_command]\n end", "title": "" }, { "docid": "a7738fc66213d5de1f88b2de13a0479d", "score": "0.54840326", "text": "def entry_order; end", "title": "" }, { "docid": "59fa6ae44979577590c84ddc71bacaea", "score": "0.547936", "text": "def sort\n return @sort\n end", "title": "" }, { "docid": "195c2f51fad0e4617e475a93fa4c4b43", "score": "0.5473022", "text": "def sort_order\n return @order if @order > -1\n\n @order = 0\n\n if @depends_on\n @depends_on.each do |d|\n dord = d.sort_order\n @order = (dord+1) if dord >= @order\n end\n end\n\n @order\n end", "title": "" }, { "docid": "e6baedabf27a14ab399a99e0f124f7c4", "score": "0.546893", "text": "def actual_operations_order\n IO.read(observe_order_file.path).split(\"\\n\").map(&:strip)\n end", "title": "" }, { "docid": "d9de87e9005fa9d55c7f019957de8d28", "score": "0.5458318", "text": "def sort_key\n # Make sure sequence is at least 6 long to maintain numeric sorting\n @sequence&.rjust(6, '0') || @code\n end", "title": "" }, { "docid": "8bec558d4b762b1dbe0e4d381d1d38e9", "score": "0.5451356", "text": "def sort_perf_test_results(final_perf_results, site_action, run_type = \"Cold Run\")\n sorted_result = []\n h_keys = final_perf_results.keys\n hash_keys = []\n if (run_type == \"Cold Run\")\n hash_keys.push(h_keys[0])\n else\n h_keys.slice!(0)\n hash_keys = h_keys\n end\n s_action = self.translation_hash(site_action)\n hash_keys.each do |k|\n val = final_perf_results[k][s_action]\n sorted_result.push(val)\n end\n Log.logger.info(\"Sorted Results for #{site_action} = #{sorted_result.inspect}\")\n return sorted_result\n end", "title": "" }, { "docid": "f4fc1bda138946f8263a37fa330b8a6f", "score": "0.5394913", "text": "def sort_rank\n @sort_rank ||= (property.property_values.length - property.property_values.index(self))\n end", "title": "" }, { "docid": "2876c54fa9b9ef04ccb17657474a6183", "score": "0.53806674", "text": "def readingOrder; end", "title": "" }, { "docid": "ca6c4c1adf18638ebbcfa503a8d244e0", "score": "0.53369707", "text": "def sort_order\n lft\n end", "title": "" }, { "docid": "c9d3e8a8160f8fcce42ae61c54ad66af", "score": "0.53304887", "text": "def sort_direction\n end", "title": "" }, { "docid": "edcbe5235619c9839cdaf370d4f8adad", "score": "0.53226286", "text": "def order_attr\n qattr(NS_XL, 'order').to_f\n end", "title": "" }, { "docid": "e024c2a7f12e0a3f00c6354e9d715170", "score": "0.5321181", "text": "def sort_text\n attributes.fetch(:sortText)\n end", "title": "" }, { "docid": "e024c2a7f12e0a3f00c6354e9d715170", "score": "0.5321181", "text": "def sort_text\n attributes.fetch(:sortText)\n end", "title": "" }, { "docid": "b66eefef3423b43e3a85240c573376d9", "score": "0.53123015", "text": "def sort_entries; end", "title": "" }, { "docid": "ba71c9c794b6d913b654f0191c8fb305", "score": "0.53001726", "text": "def out_put3(input)\n pipe_file\n sort_name = $big_array.sort {|a,b| a[0] <=> b[0]}.reverse\n\nend", "title": "" }, { "docid": "53bb1ec84030c6690c05b8fce64fed31", "score": "0.52981466", "text": "def sort_order\n -100\n end", "title": "" }, { "docid": "ef518166a708d6422d999565ce4deb3c", "score": "0.52922547", "text": "def order\n return @order\n end", "title": "" }, { "docid": "ef518166a708d6422d999565ce4deb3c", "score": "0.52922547", "text": "def order\n return @order\n end", "title": "" }, { "docid": "41f9f86151287f4905f60d48749324d4", "score": "0.5289414", "text": "def sort_on\n return @sort_on\n end", "title": "" }, { "docid": "85a30624dd10b96481facf01e69f2436", "score": "0.5287081", "text": "def order\n RPM::C.rpmtsOrder(@ptr)\n end", "title": "" }, { "docid": "7e3967c34246512ebe190b0a3fc802ac", "score": "0.5277046", "text": "def order\n @order || 0\n end", "title": "" }, { "docid": "8a0645f587703f37dfc8e7b53310433b", "score": "0.52646995", "text": "def sort_array\n @sort_array ||= \n (\n SORT_COLUMNS.map { | k | send(k).code } +\n [ - self.version ]\n ).freeze\n end", "title": "" }, { "docid": "1105ae4b83addcee9a34060f33ae5a6e", "score": "0.52572614", "text": "def set_sort_order\n previous_max = Room.maximum(\"sort_order\") || 0\n write_attribute(:sort_order, previous_max +1)\n end", "title": "" }, { "docid": "a1be2cc310d99e9fb53eeb41f0f3db07", "score": "0.5251621", "text": "def order\r\n \tobject.order.ordinalize\r\n end", "title": "" }, { "docid": "874827dccfd29b8dfe5bb37f3e2f78e2", "score": "0.5249324", "text": "def sort_order\n @@reverse_order.include?(ordered_sort_field) ? :reversed : :normal\n end", "title": "" }, { "docid": "ca57d15349c533c7be1536379fbaac55", "score": "0.52489424", "text": "def sorted_values\n Array(@values).sort_by { |node| node['usage'] == 'primary' ? 0 : 1 }\n end", "title": "" }, { "docid": "8f08ed8d222e3ab6ec87ae517792e442", "score": "0.5246288", "text": "def command_sort_map\n # because method_added() calls current_list() we assume @listing_index\n @command_sort_map ||= begin\n ordered = listing_index.map{|x| x[:list]}.flatten\n Hash[ * ordered.zip((0..ordered.length-1).to_a).flatten ]\n end\n end", "title": "" }, { "docid": "6f67b95c98d99ad48651e8448c477ad4", "score": "0.5235545", "text": "def current_sort_method\n sort_string_for result.params['sort']\n end", "title": "" }, { "docid": "8b984e6efd4169424233fc73976ae34f", "score": "0.5232968", "text": "def sortedItems\n\t\[email protected]_by { |i| i.done.to_s }\n\tend", "title": "" }, { "docid": "3e33c6486c598db95cc5ad740e01a819", "score": "0.52271193", "text": "def readout\n\t\tlogf(:readout)\n\t\tgenerate_combined_ids\n\t\t@split = @sort && @sort.split(/\\s+/).size > 1 ? @sort.split(/\\s+/)[0].to_sym : nil\n\t\t@split_point = nil\n\t\tstring = @combined_ids.inject(\"\") do |s, id|\n\t\t\trun = @combined_run_list[id]\n\t\t\tif run.status =~ /Complete/ and filter(run) \n\t\t\t\t@new_split_point = @split ? run.send(@split) : nil\n\t\t\t\tsplitter = (@split_point and @split_point != @new_split_point) ? \"\\n\\n\" : \"\"\n\t\t\t\t@split_point = @new_split_point\n\t\t\t\tsplitter = \"\" # comment to put split points back in\n# \t\t\t\tputs s.class, splitter.class, data_string(directory)\n\t\t\t\tdata_string = run.data_string\n\t\t\t\traise CRFatal.new(\"data_string did not return a string\") unless data_string.class == String\n\t\t\t\ts + splitter + data_string \n\t\t\telse \n\t\t\t\ts \n\t\t\tend\n\t\tend\n# \t\tputs @max.inspect\n\n\t\treturn string\n\tend", "title": "" }, { "docid": "41addd2fe3e43efdef49208877b5038e", "score": "0.52150863", "text": "def order\n self[:order]\n end", "title": "" }, { "docid": "acd759373054eaa90136845d73914489", "score": "0.5202176", "text": "def default_sort_value\n default_sort.fetch(:value, nil)\n end", "title": "" }, { "docid": "cd17458e5ff3176cf9fab11d987eb7d5", "score": "0.5188556", "text": "def data_sources_by_last_run\n #data_sources.sort_by(&:last_run)\n data_sources.sort_by { |ds| [ds.priority, ds.last_run] }\n end", "title": "" }, { "docid": "cbc6a8ecb561d94d2aa14ad046533e68", "score": "0.51873094", "text": "def order_value(order)\n order[0].to_f\n end", "title": "" }, { "docid": "47c018313d47e6b54b3cfc4805db8520", "score": "0.5185289", "text": "def sort_key\n @description\n end", "title": "" }, { "docid": "77f7d0e9c0de6dc934c0adc52864a665", "score": "0.5162216", "text": "def secondary_sort\n # This function is empty as it's a placeholder for custom code...\n end", "title": "" }, { "docid": "0ade47a4b7d2ca2d8f6cd07f9f898f5e", "score": "0.5149671", "text": "def sorted_version_data(version_data)\n version_data.keys.sort do |x, y|\n y[1..-1].to_i <=> x[1..-1].to_i\n end\n end", "title": "" }, { "docid": "3130d14544c4c82b9285f69cd57f9082", "score": "0.5148271", "text": "def chosen_direction\n sort_order.direction.to_sym if matching_sort_order?\n end", "title": "" }, { "docid": "2ecdc7beaf7b9b7c5cfbd4d1bfdb79c8", "score": "0.5144844", "text": "def sorted_value\n symbol_format = lambda { |symbol, number| number == 1 ? symbol : (number == -1 ? \"-#{symbol}\" : [number, symbol]) }\n @value.except(1).sort.map(&symbol_format).unshift(@value[1]).reject { |number, symbol| number.is_a?(Numeric) && number.zero? }.presence || [0]\n end", "title": "" }, { "docid": "d2e34790a5f00c7b936666332829e97b", "score": "0.5142601", "text": "def main_sort_copy; end", "title": "" }, { "docid": "61e19a3c6555e01765c2aee357a4e95a", "score": "0.5139754", "text": "def next_sort_mode\n ORDER_BY[@order_by + 1] || ORDER_BY[0]\n end", "title": "" }, { "docid": "0de048ec4b2c2bdaf28c81c60b769766", "score": "0.5138515", "text": "def run_result_task_results(run_result)\n task_results = run_result.task_results\n task_results.sort do |tr1, tr2|\n w1, w2 = tr1.result, tr2.result\n n1 = tr1.task.task_name\n n2 = tr2.task.task_name\n # First sort in descending order of weights.\n # If the weights are equal, sort in ascending order of names.\n w1 != w2 ? w2 <=> w1 : n1 <=> n2\n end\n end", "title": "" }, { "docid": "ba9902de9837577d4ba50f4d3d34bd09", "score": "0.5136431", "text": "def get_tab_sorted\n @tab_files\n end", "title": "" }, { "docid": "c21b18c46717170c26b75288c69b36b3", "score": "0.51300436", "text": "def current_sort\n @current_sort ||= if params[:order] && params[:order] =~ /^([\\w\\_\\.]+)_(desc|asc)$/\n [$1,$2]\n else\n []\n end\n end", "title": "" }, { "docid": "dd6fd6570270e54dc72555ada9dfc1e6", "score": "0.51295704", "text": "def main_sort_big_done; end", "title": "" }, { "docid": "728250058deeffb87d593251fe1184e0", "score": "0.51221216", "text": "def sort_after(data)\n data\n end", "title": "" }, { "docid": "7186d494599d1bd406949e075017f9e2", "score": "0.5120727", "text": "def order\n @order\n end", "title": "" }, { "docid": "7186d494599d1bd406949e075017f9e2", "score": "0.5120727", "text": "def order\n @order\n end", "title": "" }, { "docid": "f1e3192accb569027fad1e56f852160b", "score": "0.5120679", "text": "def reading_order; end", "title": "" }, { "docid": "c95cc08ef8dbe3e5c7c92af56e620582", "score": "0.51203483", "text": "def order_pos\n\t@order_pos\nend", "title": "" }, { "docid": "8178812fd6c899992cebbbf66bca04f2", "score": "0.5117593", "text": "def order()#:Integer\n if(@elem_str.empty?)\n raise WrongOrderError, \"Cannot return order of the root element.\"\n else\n gt_split = @elem_str.split('>')\n return gt_split[gt_split.length-1].to_i \n end\n end", "title": "" }, { "docid": "50a7be6ad92c8214986bba113cab72af", "score": "0.51104057", "text": "def build_main_json_output_data\n if sorted_primary_ids && (data = json_output[\"data\"]).present?\n json_output[\"data\"] = data.sort_by { |d| sorted_primary_ids.index(d[\"id\"]) }\n end\n end", "title": "" }, { "docid": "b8ed6c8ffad46365e723d73eaddd00c5", "score": "0.51096666", "text": "def order_sort_order\n\t\t\tCW::SortOrder.asc( self.table_name + '.' + self.acts_as_ordered_order_attribute_name.to_s )\n\t\tend", "title": "" }, { "docid": "118508ded9d6752c1f3741ec448cb0b7", "score": "0.5108785", "text": "def local_mode_sort_commandline\n 'sort'\n end", "title": "" }, { "docid": "9d8e790097f5e9ef354aa91b71286998", "score": "0.509908", "text": "def flow_order\n @obj['FO']\n end", "title": "" }, { "docid": "68492a37615bd83942f916f5b6024da8", "score": "0.50989777", "text": "def sort_for(change, rev_num)\n return -1 if change[1].copyfrom_path\n return 2 if change[1].action == 'D'\n return 0 if @in_repo.stat(change[0].sub(/\\A\\//, ''), rev_num).file?\n return 1\n end", "title": "" }, { "docid": "52646953aa3072be6b0b9103013fe5d6", "score": "0.50951606", "text": "def priority_sorting_metric\n [-1 * (measurement.priority.presence || (Measurement::MIN_PRIORITY - 1)), open_from]\n end", "title": "" }, { "docid": "b6069800a0f39574486a51180692ead9", "score": "0.50921047", "text": "def calls_sort_option\n column = case params[:iSortCol_0].to_s\n when '1'\n 'number'\n when '2'\n 'line_type'\n when '3'\n 'peak_freq'\n end\n column + ' ' + (params[:sSortDir_0] =~ /^A/i ? 'asc' : 'desc') if column\n end", "title": "" }, { "docid": "e26b145d4f06d3afb2400de2aae3f580", "score": "0.50907576", "text": "def sort_index\n @header_item_index\n end", "title": "" }, { "docid": "a7d19ddaf371dcf127b8503c2ba70e9e", "score": "0.50873053", "text": "def sort_order=(value)\n @sort_order = value\n end", "title": "" }, { "docid": "088734ef83001d33a4880079ebf68219", "score": "0.5086399", "text": "def sort_mode\n @sort_mode ||= set_sort_mode\n end", "title": "" }, { "docid": "37edec65c8243ab647a0591f9668b8c0", "score": "0.5082841", "text": "def get_retailer_sort_order(website)\n begin\n @brand_sort_order ||= online_retailer_link(website).position\n rescue\n return nil\n end\n end", "title": "" }, { "docid": "e42c8b393562f60ae540ebbf457f3264", "score": "0.50731736", "text": "def order() @order || 'ascending' ; end", "title": "" }, { "docid": "388c61b5def7b964b89167ea09e00b19", "score": "0.5065954", "text": "def sort_by\n return @sort_by\n end", "title": "" }, { "docid": "388c61b5def7b964b89167ea09e00b19", "score": "0.5065954", "text": "def sort_by\n return @sort_by\n end", "title": "" }, { "docid": "a64f471021dc9697a59e052f8bcc5752", "score": "0.50625193", "text": "def sort_field\n @sort_field ||= ordered_sort_field.to_s.sub(\"_reversed\", \"\").to_sym\n end", "title": "" }, { "docid": "80a3ecb64b3ae4e2e06981db66361864", "score": "0.5061593", "text": "def current_sort\n sorts.select{|x| x.fetch(:value) == selected_sort_value }.first || default_sort\n end", "title": "" }, { "docid": "daae3b93cb27b60b16d97757145e288b", "score": "0.50559014", "text": "def order_for_sort_key(sort_key)\n current_key, current_order = current_sort\n return \"desc\" unless current_key == sort_key\n current_order == \"desc\" ? \"asc\" : \"desc\"\n end", "title": "" }, { "docid": "5664b215370fb7b96d9d5ee1eb9e687f", "score": "0.5054665", "text": "def order\n @order ||= \"#{order_attribute} #{order_direction}\"\n end", "title": "" }, { "docid": "5b69602a57ab57141b4443056d95e582", "score": "0.50533456", "text": "def sort_entries=(_arg0); end", "title": "" }, { "docid": "681e6a96f277013dcecf82ab0881359a", "score": "0.50504065", "text": "def calls_sort_option\n column = case params[:iSortCol_0].to_s\n when '1'\n 'number'\n when '2'\n 'caller_id'\n when '3'\n 'providers.name'\n when '4'\n 'answered'\n when '5'\n 'busy'\n when '6'\n 'audio_length'\n when '7'\n 'ring_length'\n end\n column + ' ' + (params[:sSortDir_0] =~ /^A/i ? 'asc' : 'desc') if column\n end", "title": "" }, { "docid": "1365c468e9b8865a808a9bcc460daee3", "score": "0.5046162", "text": "def process_order\n # TODO\n end", "title": "" }, { "docid": "e6f19c72b102729e90d18a19f0ea86fb", "score": "0.50235254", "text": "def sort_properties\n return @sort_properties\n end", "title": "" }, { "docid": "9b7d8cc0a4c829902e7a1d526128f32e", "score": "0.5014612", "text": "def sort_obj\n [maglev_specific_gem? ? 1 : 0,\n @name,\n @version,\n @new_platform == Gem::Platform::RUBY ? -1 : 1]\n end", "title": "" }, { "docid": "e5c39aad5e32c156cbaffe7aac564ed3", "score": "0.50110954", "text": "def next_sort_order()\n sql = \"SELECT MAX(sort_order) as max_sort_order FROM #{Fl::Framework::List::ListItem.table_name} WHERE (list_id = #{self.id})\"\n rec = self.class.connection.select_all(sql).first\n if rec['max_sort_order'].nil?\n 1\n else\n rec['max_sort_order'].to_i + 1\n end\n end", "title": "" }, { "docid": "2ebae4cd9201b3871ea7710fe7c6c43d", "score": "0.5010493", "text": "def getOrdered\n sorted = @sourceHash.values.sort_by do |source|\n # when updating a source, it's possible that we have identital \"order\" values.\n # e.g. we think the order is a,b,c, and the user updates that c goes into pos 1.\n # it's not explicitly clear that the \"right\" answer is c,a,b or a,c,b, so we\n # infer that the \"lastest\" update to pos 1 wins.\n [ source.order, -source.updated ]\n end\n\n return sorted\n end", "title": "" }, { "docid": "48a9390550a6275a793d79ccf43c60ee", "score": "0.50073165", "text": "def kanban_order\n\t\tprogress.to_i - expected_progress.to_i\n\tend", "title": "" }, { "docid": "0f33faf524bc34be174a79409aee798c", "score": "0.5005707", "text": "def entry_order=(_arg0); end", "title": "" }, { "docid": "5fc8ff7f37894d4453f640d09d481710", "score": "0.5002102", "text": "def [](i)\n\t\tordering[i]\n\tend", "title": "" }, { "docid": "3b105416266f70c28d2241ad1bf8acdd", "score": "0.4999359", "text": "def value_order\n @content.reduce(0) { |sum, pizza| sum + pizza.price }\n end", "title": "" }, { "docid": "27be2d55068a398e12afe12c094a101e", "score": "0.49986234", "text": "def sort_timestamp\n self.entry_date\n end", "title": "" }, { "docid": "80273ee1363a6196500554af0a92f222", "score": "0.49982175", "text": "def ino_sorted(ino)\n\t\t@ino[ino].to_a.sort_by { |node| node[:version] }\n\tend", "title": "" }, { "docid": "0b4a77198e76f07666615236e287ea10", "score": "0.49928752", "text": "def sort_temp\n File.open(\"../database_runs/temp-sort.txt\", \"r\") do |line|\n line.each_with_index do |i,x|\n puts \"#{x}\" + \"#{i.to_textual}\"\n end\n end\n end", "title": "" }, { "docid": "acbbe5f0141b3c84c0eb625b5a920c61", "score": "0.4978103", "text": "def trace_order_index(trace_id)\n global=@sort_order.index{|x| trace_id.start_with? x} ||\n (@sort_order.length+1)\n\n # add the {index} of the trace to\n orderId = [global.to_s.rjust(5,\"0\"),trace_id].join(\"_\")\n orderId\n end", "title": "" }, { "docid": "1c425b1506e63cda654a729adf78d8fe", "score": "0.49760443", "text": "def sort_value(card)\n return [0] if card.value == 'J' && card.suite == @trump\n return [1] if card.value == 'J' && card.suite == @same\n return [2+@suite_order.index(card.suite),-card.to_i]\n end", "title": "" }, { "docid": "8053d7aa8659f0832c860af5cf2ba182", "score": "0.4975628", "text": "def aasm_state_order\n self.class.get_aasm_state_order\n end", "title": "" } ]
c5eba075eb0dbb4fd6a1692ec452b7a8
MySQL supports ORDER and LIMIT clauses in UPDATE statements.
[ { "docid": "b3e8a38a1e1ab027baaeb87ba9f7acd8", "score": "0.684847", "text": "def update_sql(values, opts = nil, &block)\n sql = super\n opts = opts ? @opts.merge(opts) : @opts\n\n if order = opts[:order]\n sql << \" ORDER BY #{column_list(order)}\"\n end\n if limit = opts[:limit]\n sql << \" LIMIT #{limit}\"\n end\n\n sql\n end", "title": "" } ]
[ { "docid": "320965acea764888495193383eb4bd3d", "score": "0.6060693", "text": "def _update_sql\n clause_sql(:update)\n end", "title": "" }, { "docid": "8fbec19e369f1a9d919bafe87eda2421", "score": "0.6052184", "text": "def _execute_position_update!(sql, async: false)\n # The job is handled in the app code\n acts_as_list_class.connection.execute(sql)\n end", "title": "" }, { "docid": "1a82a76238c9fd6672c5a68b171daafa", "score": "0.60058784", "text": "def update_query(options)\n query = \"UPDATE #{options[:table]} SET #{options[:values]}\"\n query += \" WHERE #{options[:conditions]}\" if options[:conditions]\n @connection.query(query)\n end", "title": "" }, { "docid": "4ba1102ff6ff870ebff57f216dfa2524", "score": "0.589451", "text": "def exec_update(sql, name, binds)\n if sql =~ /\\AUPDATE (.*) SET (.*)\\z/\n sql = \"ALTER TABLE #{$1} UPDATE #{$2}\"\n end\n exec_update_original(sql, name, binds)\n end", "title": "" }, { "docid": "9d1722a1c5fe58fd0fba56b0b2a727b1", "score": "0.5888889", "text": "def update!(**args)\n @apply_order = args[:apply_order] if args.key?(:apply_order)\n @count_limit = args[:count_limit] if args.key?(:count_limit)\n end", "title": "" }, { "docid": "69dc781c36a8fa0d6fc4524b33c9070a", "score": "0.5866364", "text": "def update_all(updates, conditions = nil, options = {})\n sql = \"UPDATE #{quoted_table_name} SET #{sanitize_sql_for_assignment(updates)} \"\n\n scope = scope(:find)\n\n select_sql = \"\"\n add_conditions!(select_sql, conditions, scope)\n\n if options.has_key?(:limit) || (scope && scope[:limit])\n # Only take order from scope if limit is also provided by scope, this\n # is useful for updating a has_many association with a limit.\n add_order!(select_sql, options[:order], scope)\n\n add_limit!(select_sql, options, scope)\n sql.concat(connection.limited_update_conditions(select_sql, quoted_table_name, connection.quote_column_name(primary_key)))\n else\n add_order!(select_sql, options[:order], nil)\n sql.concat(select_sql)\n end\n\n connection.update(sql, \"#{name} Update\")\n end", "title": "" }, { "docid": "8b429f21de0f7e99b3392f99e31f880c", "score": "0.58407664", "text": "def update!(**args)\n @columns = args[:columns] if args.key?(:columns)\n @index = args[:index] if args.key?(:index)\n @key_set = args[:key_set] if args.key?(:key_set)\n @limit = args[:limit] if args.key?(:limit)\n @partition_token = args[:partition_token] if args.key?(:partition_token)\n @resume_token = args[:resume_token] if args.key?(:resume_token)\n @table = args[:table] if args.key?(:table)\n @transaction = args[:transaction] if args.key?(:transaction)\n end", "title": "" }, { "docid": "a79d5265d276bb03b04b6396f4c7f17e", "score": "0.58358306", "text": "def update!(**args)\n @end_at = args[:end_at] if args.key?(:end_at)\n @from = args[:from] if args.key?(:from)\n @limit = args[:limit] if args.key?(:limit)\n @offset = args[:offset] if args.key?(:offset)\n @order_by = args[:order_by] if args.key?(:order_by)\n @select = args[:select] if args.key?(:select)\n @start_at = args[:start_at] if args.key?(:start_at)\n @where = args[:where] if args.key?(:where)\n end", "title": "" }, { "docid": "a79d5265d276bb03b04b6396f4c7f17e", "score": "0.58358306", "text": "def update!(**args)\n @end_at = args[:end_at] if args.key?(:end_at)\n @from = args[:from] if args.key?(:from)\n @limit = args[:limit] if args.key?(:limit)\n @offset = args[:offset] if args.key?(:offset)\n @order_by = args[:order_by] if args.key?(:order_by)\n @select = args[:select] if args.key?(:select)\n @start_at = args[:start_at] if args.key?(:start_at)\n @where = args[:where] if args.key?(:where)\n end", "title": "" }, { "docid": "7d0e33d6a72198ede576368bc25d27dd", "score": "0.5827118", "text": "def prepare_update_statement(o)\n if o.key && (has_limit_or_offset_or_orders?(o) || has_join_sources?(o))\n stmt = o.clone\n stmt.limit = nil\n stmt.offset = nil\n stmt.orders = []\n stmt.wheres = [Nodes::In.new(o.key, [build_subselect(o.key, o)])]\n stmt.relation = o.relation.left if has_join_sources?(o)\n stmt.groups = o.groups unless o.groups.empty?\n stmt.havings = o.havings unless o.havings.empty?\n stmt\n else\n o\n end\n end", "title": "" }, { "docid": "88caeef76d3514f30de6c55b392226e1", "score": "0.5819646", "text": "def ff_update_all_in_order(predicates, conditions, order, prequeries = nil)\n update_fields = []\n predicates.each_pair do |key, value| # NOTICE string value\n quoted = ff_quoted_column(key)\n update_fields << \"#{quoted} = #{value}\"\n end\n\n update_conditions = []\n conditions.each_pair do |key, value|\n if key.is_a?(Integer)\n update_conditions << value\n else\n quoted = ff_quoted_column(key)\n if value.is_a?(Array)\n joined = value.join(',')\n update_conditions << \"#{quoted} IN (#{joined})\"\n else\n info = key.to_s.split(' ')\n if 1 < info.length\n picked_column = ff_quoted_column(info.shift.to_sym)\n join_list = [picked_column] + info + [value]\n update_conditions << join_list.join(' ')\n else\n update_conditions << \"#{quoted} = #{value}\"\n end\n end\n end\n end\n\n update_order = []\n order.each_pair do |key, value|\n direction = key.is_a?(Integer) ? 'ASC' : value\n quoted = ff_quoted_column(key)\n update_order << \"#{quoted} #{direction}\"\n end\n\n # pre-query to SET @xxx := value\n # can execuete two query() at once, however can not get affectedRows.\n prequeries = [prequeries] unless prequeries.instance_of?(Array)\n prequeries.each { |query| ff_raw_query(query) }\n\n # use raw query, because can not use ORDER BY in standard updateAll().\n update_query_string = [\n 'UPDATE',\n quoted_table_name(), # OK `categories`\n 'SET',\n update_fields.join(', '),\n 'WHERE',\n update_conditions.map { |cond| \"(#{cond})\" }.join(' AND '),\n 'ORDER BY',\n update_order.join(', '),\n ].join(' ')\n\n # return value\n connection.update(update_query_string)\n end", "title": "" }, { "docid": "c4574738e6460351ff5dba0b7b65a161", "score": "0.5774083", "text": "def update_all(updates, conditions = nil, options = {})\n IdentityMap.repository[symbolized_base_class].clear if IdentityMap.enabled?\n if conditions || options.present?\n where(conditions).apply_finder_options(options.slice(:limit, :order)).update_all(updates)\n else\n stmt = Arel::UpdateManager.new(arel.engine)\n\n stmt.set Arel.sql(@klass.send(:sanitize_sql_for_assignment, updates))\n stmt.table(table)\n stmt.key = table[primary_key]\n\n if joins_values.any?\n @klass.connection.join_to_update(stmt, arel)\n else\n stmt.take(arel.limit)\n stmt.order(*arel.orders)\n stmt.wheres = arel.constraints\n end\n\n @klass.connection.update stmt, 'SQL', bind_values\n end\n end", "title": "" }, { "docid": "bf09b94e36616380dfdc57cb0bfcfad8", "score": "0.5734257", "text": "def update!(**args)\n @column = args[:column] if args.key?(:column)\n @sort_order = args[:sort_order] if args.key?(:sort_order)\n end", "title": "" }, { "docid": "d039e536e1da5fd6eb6537c865acba5e", "score": "0.57239866", "text": "def update(table, options)\r\n return 5\r\n end", "title": "" }, { "docid": "e65791816000ae833667b7928c27628c", "score": "0.57146853", "text": "def update!(**args)\n @offset = args[:offset] if args.key?(:offset)\n @order_by = args[:order_by] if args.key?(:order_by)\n @search_query = args[:search_query] if args.key?(:search_query)\n end", "title": "" }, { "docid": "681053ab3530ef1df0e5b35e48f4f137", "score": "0.57116646", "text": "def join_to_update(update, select) #:nodoc:\n if select.limit || select.offset || select.orders.any?\n super\n else\n update.table select.source\n update.wheres = select.constraints\n end\n end", "title": "" }, { "docid": "ecbb11eb70578a67545de198bd028fc1", "score": "0.5658969", "text": "def exec_update(sql, name = T.unsafe(nil), binds = T.unsafe(nil)); end", "title": "" }, { "docid": "994fbb37ae079ced98bc5573558a02c8", "score": "0.5654927", "text": "def update(sql, name = nil) end", "title": "" }, { "docid": "d662a91dcb7e261444eee9d0fc1509c1", "score": "0.5614589", "text": "def update_without_callbacks\n where_clause_terms = [self.class.primary_key, quoted_id].transpose.map do |pair| \n \"(#{connection.quote_column_name(pair[0])} = #{pair[1]})\"\n end\n where_clause = where_clause_terms.join(\" AND \")\n connection.update(\n \"UPDATE #{self.class.quoted_table_name} \" +\n \"SET #{quoted_comma_pair_list(connection, attributes_with_quotes(false, false))} \" +\n \"WHERE #{where_clause}\",\n \"#{self.class.name} Update\"\n )\n return true\n end", "title": "" }, { "docid": "0ca31c8ba3d3cef45e99f61c21602ce9", "score": "0.5610033", "text": "def update\n # ...\n cols = self.class.columns[1..-1]\n cols.map!(&:to_s)\n col_names = cols.join(' = ?, ')\n col_names += \" = ?\"\n # my_id = self.id\n # byebug\n DBConnection.execute(<<-SQL, *attribute_values[1..-1], id)\n UPDATE\n #{self.class.table_name}\n SET\n #{col_names}\n WHERE\n id = ?\n SQL\n end", "title": "" }, { "docid": "70410f3176461e7d251a0a50734e9618", "score": "0.56011796", "text": "def update!(**args)\n @max_rows = args[:max_rows] if args.key?(:max_rows)\n @query = args[:query] if args.key?(:query)\n @query_parameters = args[:query_parameters] if args.key?(:query_parameters)\n @timeout = args[:timeout] if args.key?(:timeout)\n end", "title": "" }, { "docid": "7f2919ca1e9140766f9f76fa646ab15a", "score": "0.55950403", "text": "def update(values, opts = nil)\n # @db.synchronize do\n # @db.execute(update_sql(values, opts)).affected_rows\n # end\n raise NotImplementedError, NOTIMPL_MSG\n end", "title": "" }, { "docid": "02af70d7e7b66ac817ddb87166a8962c", "score": "0.5588757", "text": "def update\n cols = self.class.columns\n set_line = cols.map {|col| \"#{col} = ?\"}.join(\", \")\n DBConnection.execute(<<-SQL, *attribute_values, id)\n UPDATE\n #{self.class.table_name}\n SET\n #{set_line}\n WHERE\n #{self.class.table_name}.id = ?\n SQL\n end", "title": "" }, { "docid": "834b6e79ce77b1b2e7156cf0bcc61878", "score": "0.55709195", "text": "def decrement_positions_on_higher_items(model_id, table_name, old_position, new_position)\n \"UPDATE `#{table_name}` SET `position` = (`#{table_name}`.`position` - 1) \"\\\n \"WHERE (`#{table_name}`.id != '#{model_id}') \"\\\n \"AND (`#{table_name}`.`position` > #{old_position}) \"\\\n \"AND (`#{table_name}`.`position` <= #{new_position})\"\n end", "title": "" }, { "docid": "428f77df88652607e65f4c3927257a20", "score": "0.55655646", "text": "def change_column_orders\n Column\n .where(\"column_order >= ? AND board_id = ?\", column_order, board_id)\n .update_all(\"column_order = column_order + 1\")\n end", "title": "" }, { "docid": "9e6fcffdf24235685084af983167c3ef", "score": "0.55566424", "text": "def update\n update_to = attributes.keys.map { |col| \"#{col} = ?\"}.join(\", \")\n where_to = \"id = ?\"\n vals = attribute_values\n vals << self.id\n table = self.class.table_name\n query = @@db.execute(<<-SQL, *vals)\n UPDATE\n #{table}\n SET\n #{update_to}\n WHERE\n #{where_to}\n SQL\n end", "title": "" }, { "docid": "82563d98a39935ca926f5316a7892748", "score": "0.5543468", "text": "def cursor_update( table, sql, opt=nil)\n return self.cursor(CS_CURSOR_UPDATE, table, sql, opt)\n end", "title": "" }, { "docid": "784fca0aa5531435f3c00525471725b0", "score": "0.5529972", "text": "def update_ords!\n old_ord = List.find(id).ord\n\n return nil if ord == old_ord\n\n if ord < old_ord\n List.where(\n \"board_id = ? AND ord >= ? AND ord < ?\",\n board_id,\n ord,\n old_ord\n ).update_all(\"ord = ord + 1\")\n else\n List.where(\n \"board_id = ? AND ord > ? AND ord <= ?\",\n board_id,\n old_ord,\n ord\n ).update_all(\"ord = ord - 1\")\n end\n\n end", "title": "" }, { "docid": "4825a160fdb3097bd6af4f918292c38a", "score": "0.5529055", "text": "def update(id, data)\n adapter.exec_prepared(\"update_#{table_name}\", update_sql(id, data.keys), *data.values)\n end", "title": "" }, { "docid": "f57117e70473e41dd7ec28ca7d0d1065", "score": "0.55226797", "text": "def updated_from index\n index.upto(@rows.size - 1) do |idx|\n row = row(idx)\n row.idx = idx\n row_updated idx, row\n end\n end", "title": "" }, { "docid": "1384cae0c0700c9c2275e47ab6caa895", "score": "0.55162656", "text": "def update\n set_line = self.class.columns.map { |attr| \"#{attr} = ?\" }.join(\", \")\n\n # Note: uses the helper method: #attribute_values\n DBConnection.execute(<<-SQL, *attribute_values, id)\n UPDATE\n #{self.class.table_name}\n SET\n #{set_line}\n WHERE\n #{self.class.table_name}.id = ?\n SQL\n\n end", "title": "" }, { "docid": "373facbc7044d05dd2ced0fc9f5a3d62", "score": "0.5515568", "text": "def db_update(where = {}, cols = {}, opts = {})\n\t\t\t\twhere[:_id] = _id\n\t\t\t\tres = EM::Synchrony.sync coll.safe_update(where, cols, opts)\n\t\t\t\thandle_error(res)\n\t\t\t\treturn res\n\t\t\tend", "title": "" }, { "docid": "111da868ade69eb2290ab6e9aaf7085d", "score": "0.5509563", "text": "def update_list_order(model, order)\n order.to_a.each_with_index do |item, pos|\n model.update(item, position:(pos + 1))\n end\n end", "title": "" }, { "docid": "111da868ade69eb2290ab6e9aaf7085d", "score": "0.5509563", "text": "def update_list_order(model, order)\n order.to_a.each_with_index do |item, pos|\n model.update(item, position:(pos + 1))\n end\n end", "title": "" }, { "docid": "111da868ade69eb2290ab6e9aaf7085d", "score": "0.5509563", "text": "def update_list_order(model, order)\n order.to_a.each_with_index do |item, pos|\n model.update(item, position:(pos + 1))\n end\n end", "title": "" }, { "docid": "a58e488ff04b15680738de4cf94f504e", "score": "0.550437", "text": "def exec_update(sql, name, binds)\n if sql.respond_to?(:to_sql)\n sql = to_sql(sql, binds); to_sql = true\n end\n if prepared_statements?\n log(sql, name || 'SQL', binds) { @connection.execute_update(sql, binds) }\n else\n sql = suble_binds(sql, binds) unless to_sql # deprecated behavior\n log(sql, name || 'SQL') { @connection.execute_update(sql) }\n end\n end", "title": "" }, { "docid": "e661ee45663998c284d8101dce09dfee", "score": "0.5503565", "text": "def increment_positions_on_lower_items(model_id, table_name, old_position, new_position)\n \"UPDATE `#{table_name}` SET `position` = (`#{table_name}`.`position` + 1) \"\\\n \"WHERE (`#{table_name}`.id != '#{model_id}') \"\\\n \"AND (`#{table_name}`.`position` >= #{new_position}) \"\\\n \"AND (`#{table_name}`.`position` < #{old_position})\"\n end", "title": "" }, { "docid": "c41b5c1377ca0b4a523a78280e4f6585", "score": "0.54961425", "text": "def update(values=OPTS, &block)\n sql = update_sql(values)\n if uses_returning?(:update)\n returning_fetch_rows(sql, &block)\n else\n execute_dui(sql)\n end\n end", "title": "" }, { "docid": "8fc87f67368bde8cd214a4fe696af784", "score": "0.54937166", "text": "def exec_update(sql, name = nil, binds = [])\n internal_exec_query(sql, name, binds)\n end", "title": "" }, { "docid": "d8560d90f92f0cde6e25b16f5e24d7a8", "score": "0.5485456", "text": "def exec_update(sql, name, binds)\n exec_query(sql, name, binds)\n end", "title": "" }, { "docid": "d8560d90f92f0cde6e25b16f5e24d7a8", "score": "0.5485456", "text": "def exec_update(sql, name, binds)\n exec_query(sql, name, binds)\n end", "title": "" }, { "docid": "af094fc3dad81c44ec68c4c4a68557b9", "score": "0.54824793", "text": "def update!(**args)\n @order_by = args[:order_by] if args.key?(:order_by)\n @page_size = args[:page_size] if args.key?(:page_size)\n @page_token = args[:page_token] if args.key?(:page_token)\n @query = args[:query] if args.key?(:query)\n @scope = args[:scope] if args.key?(:scope)\n end", "title": "" }, { "docid": "af094fc3dad81c44ec68c4c4a68557b9", "score": "0.54824793", "text": "def update!(**args)\n @order_by = args[:order_by] if args.key?(:order_by)\n @page_size = args[:page_size] if args.key?(:page_size)\n @page_token = args[:page_token] if args.key?(:page_token)\n @query = args[:query] if args.key?(:query)\n @scope = args[:scope] if args.key?(:scope)\n end", "title": "" }, { "docid": "db35a0a490a4a2820d0c4908e87af8c2", "score": "0.5479747", "text": "def sql_update table, id, field, value\n # 2010-09-12 11:42 added to_s to now, due to change in sqlite3 1.3.x\n @db.execute( \"update #{table} set #{field} = ?, date_modified = ? where id = ?\", [value,$now.to_s, id])\n end", "title": "" }, { "docid": "da88a55c00f81a3274307f656059e79a", "score": "0.5476007", "text": "def executeUpdate(sql) \n @Handle.execute(sql)\n end", "title": "" }, { "docid": "06497e073facd119689336f41fe3fc64", "score": "0.5460116", "text": "def update(params, extra_where={})\n update_timestamp = self.timestamp_cols[:update]\n values = []\n key = self.primary_key\n id = params.delete key\n sql = \"\"\n if extra_where.blank?\n sql << \"UPDATE #{self.table_name} SET \"\n if update_timestamp\n sql << \"#{update_timestamp} = ?, \"\n values << SQLTime.timestamp\n end\n params.each do |k,v|\n sql << \"#{k} = ?, \"\n values << v\n end\n sql = sql[0...-2]\n sql << \" WHERE #{key} = ?\"\n values << id\n else\n end\n res = nil\n db_try do\n res = Db.conn.execute sql, *values\n end\n res\n end", "title": "" }, { "docid": "b393f802c552b518c1c1b48cb037fb8d", "score": "0.5457115", "text": "def update\n set_str = self.class.columns.join(' = ?, ')\n set_str += ' = ?'\n DBConnection.execute(<<-SQL, *attribute_values)\n UPDATE\n #{self.class.table_name}\n SET\n #{set_str}\n WHERE\n id = #{self.id}\n SQL\n end", "title": "" }, { "docid": "f5d2a94aaab7e6a726b4e2d937ccff75", "score": "0.5456228", "text": "def test_update_all_with_joins_and_offset_and_order\n user_1 = User.create :login => 'user_1'\n user_2 = User.create :login => 'user_2'\n\n Entry.create :title => 'title_1', :content => 'content_1', :rating => 0,\n :user_id => user_1.id\n Entry.create :title => 'title_2', :content => 'content_2', :rating => 1,\n :user_id => user_2.id\n\n all_entries = Entry.joins(:user).where('users.id' => user_1.id).\n order('users.id', 'entries.id')\n count = all_entries.count\n entries = all_entries.offset(1)\n\n assert_equal count - 1, entries.update_all(:user_id => user_2.id)\n assert_equal user_2, Entry.find_by_title('title_2').user\n end", "title": "" }, { "docid": "7366239b3cd9fef1638cb59d48040e2e", "score": "0.544957", "text": "def exec_update(sql, name = nil, binds = [])\n type_casted_binds = type_casted_binds(binds)\n\n log(sql, name, binds, type_casted_binds) do\n with_retry do\n cached = false\n if without_prepared_statement?(binds)\n cursor = @raw_connection.prepare(sql)\n else\n if @statements.key?(sql)\n cursor = @statements[sql]\n else\n cursor = @statements[sql] = @raw_connection.prepare(sql)\n end\n\n cursor.bind_params(type_casted_binds)\n\n cached = true\n end\n\n res = cursor.exec_update\n cursor.close unless cached\n res\n end\n end\n end", "title": "" }, { "docid": "a9f80590745898b7ae413688fb42402d", "score": "0.544629", "text": "def update_sql; end", "title": "" }, { "docid": "3a575ca595337bf66c0c12caf86a8769", "score": "0.54191095", "text": "def update_sql(values = {}, opts = nil, &block)\n opts = opts ? @opts.merge(opts) : @opts\n\n if opts[:group]\n raise Error::InvalidOperation, \"A grouped dataset cannot be updated\"\n elsif (opts[:from].size > 1) or opts[:join]\n raise Error::InvalidOperation, \"A joined dataset cannot be updated\"\n end\n \n sql = \"UPDATE #{@opts[:from]} SET \"\n if block\n sql << block.to_sql(self, :comma_separated => true)\n else\n # check if array with keys\n values = values.to_hash if values.is_a?(Array) && values.keys\n if values.is_a?(Hash)\n # get values from hash\n values = transform_save(values) if @transform\n set = values.map do |k, v|\n # convert string key into symbol\n k = k.to_sym if String === k\n \"#{literal(k)} = #{literal(v)}\"\n end.join(COMMA_SEPARATOR)\n else\n # copy values verbatim\n set = values\n end\n sql << set\n end\n if where = opts[:where]\n sql << \" WHERE #{where}\"\n end\n\n sql\n end", "title": "" }, { "docid": "9dbdbdb015ed1266f25ca53ef1b54ff4", "score": "0.54107326", "text": "def update \n sql = <<-SQL\n UPDATE students\n SET name = ?, grade = ?\n WHERE id = ?;\n SQL\n\n DB[:conn].execute(sql, self.name, self.grade, self.id)\nend", "title": "" }, { "docid": "702e4fd1862c9d1661a0be114a373a22", "score": "0.53979987", "text": "def update\n set_line = self.class.columns.map { |name| name.to_s + \" = ?\" }.join(\", \")\n DBConnection.execute(<<-SQL, *attribute_values, self.id)\n UPDATE\n #{self.class.table_name}\n SET\n #{set_line}\n WHERE\n #{self.class.table_name}.id = ?\n SQL\n end", "title": "" }, { "docid": "51501f4497d875afc7fef7e072292c69", "score": "0.5387722", "text": "def update # EXTENSION\n sql = \"UPDATE customers SET name = $1, funds = $2 WHERE id = $3\"\n values = [@name, @funds, @id]\n SqlRunner.run(sql, values)\nend", "title": "" }, { "docid": "637ed8691ecdaaa60419aa8016cff022", "score": "0.5387638", "text": "def update\n self.class.update_order_by_id(self.id, self)\n end", "title": "" }, { "docid": "bd2e916d6f98cacfc62f6a095bf0e19c", "score": "0.5384728", "text": "def add_limit_offset!(statement, limit, offset, bind_values)\n if limit\n statement.replace statement.gsub(/^SELECT/i, \"SELECT TOP #{limit}\")\n end\n\n # TODO handle offsets - perhaps send a signal down to do_openedge\n # to manually adjust the ResultSet cursor?\n end", "title": "" }, { "docid": "a6bb8eef6f204ac20a2b418482c707f3", "score": "0.53823876", "text": "def statement\n \"update#{only_option} #{@table} set #{set_clause_list}#{where_clause}\"\n end", "title": "" }, { "docid": "53fba03fc8d791486b9a05c8e052f785", "score": "0.5372588", "text": "def update()\n sql = \"UPDATE films\n SET\n (\n title,\n price\n ) =\n (\n $1, $2\n )\n WHERE id = $3\"\n values = [@title, @price, @id]\n SqlRunner.run(sql, values)\nend", "title": "" }, { "docid": "a946294c256fdf6539c37729649f233d", "score": "0.5362848", "text": "def prepare_update_statement(o); end", "title": "" }, { "docid": "a946294c256fdf6539c37729649f233d", "score": "0.5362848", "text": "def prepare_update_statement(o); end", "title": "" }, { "docid": "db0ca90a10d8528917f95c30d3d8ceb1", "score": "0.536279", "text": "def update\n set_vals = self.class.columns.map{|attr| \"#{attr}= ?\"}.join(\", \")\n DBConnection.execute(<<-SQL, *attribute_values)\n UPDATE #{self.class.table_name}\n SET #{set_vals}\n WHERE id = #{self.id}\n SQL\n end", "title": "" }, { "docid": "7c790446ce9f1b4ba09caadc9a51c385", "score": "0.53515136", "text": "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @offset = args[:offset] if args.key?(:offset)\n end", "title": "" }, { "docid": "4b5fbec382bc70469325104a86acd39c", "score": "0.53439635", "text": "def update_priority(db, content, new_priority)\r\n\tunless new_priority < 0 || new_priority > 5\r\n\t\tdb.execute(\"UPDATE tasks SET priority=\\\"#{new_priority}\\\" WHERE content=\\\"#{content}\\\"\")\r\n\telse\r\n\t\tputs \"Priority must be between 0 and 5.\"\r\n\tend\r\nend", "title": "" }, { "docid": "cc31c5b502fa18269433d0ad75e6832a", "score": "0.53363174", "text": "def update # EXTENSION\n sql = \"UPDATE films SET title = $1, price = $2 WHERE id = $3\"\n values = [@title, @price, @id]\n SqlRunner.run(sql, values)\nend", "title": "" }, { "docid": "3c33aa183e03526cc20764a1381f9a57", "score": "0.5325374", "text": "def update() #UPDATE customer1.funds = 10 then customer1\n sql = \"UPDATE customers SET (name,funds) = ($1, $2) RETURNING id = $3\"\n values = [@name, @funds, @id]\n result = SqlRunner.run(sql, values)\n end", "title": "" }, { "docid": "4938a34a07f3242af8b68df26d33d6aa", "score": "0.53216565", "text": "def update_query(keys_array, values_array)\n \"UPDATE #{@table_name} SET #{keys_array.join(', ')} FROM\n ( SELECT #{values_array.join(', ')}) as source WHERE #{@table_name}.id = source.id;\"\n end", "title": "" }, { "docid": "429b81efb72786eb737cb2d5ad1c16b0", "score": "0.5320863", "text": "def change_position(position)\n update_attribute :row_order_position, position\n end", "title": "" }, { "docid": "429b81efb72786eb737cb2d5ad1c16b0", "score": "0.5320863", "text": "def change_position(position)\n update_attribute :row_order_position, position\n end", "title": "" }, { "docid": "221d43d07b9afc85d92d04f87afc07cc", "score": "0.5319366", "text": "def update!(**args)\n @offset = args[:offset] if args.key?(:offset)\n @sequence = args[:sequence] if args.key?(:sequence)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n end", "title": "" }, { "docid": "3c9838ba31e732a25709f7f82181d684", "score": "0.5317379", "text": "def update(*) end", "title": "" }, { "docid": "24ccc1020e1622a0aa154f193350e483", "score": "0.5312478", "text": "def update!(**args)\n @end_cursor = args[:end_cursor] if args.key?(:end_cursor)\n @filter = args[:filter] if args.key?(:filter)\n @group_by = args[:group_by] if args.key?(:group_by)\n @kinds = args[:kinds] if args.key?(:kinds)\n @limit = args[:limit] if args.key?(:limit)\n @offset = args[:offset] if args.key?(:offset)\n @order = args[:order] if args.key?(:order)\n @projection = args[:projection] if args.key?(:projection)\n @start_cursor = args[:start_cursor] if args.key?(:start_cursor)\n end", "title": "" }, { "docid": "9db2a45959347cf670be30fa7e6ce9ba", "score": "0.530987", "text": "def update!(**args)\n @position = args[:position] if args.key?(:position)\n end", "title": "" }, { "docid": "9db2a45959347cf670be30fa7e6ce9ba", "score": "0.530987", "text": "def update!(**args)\n @position = args[:position] if args.key?(:position)\n end", "title": "" }, { "docid": "11bab02e03aaa63a1f3d23ba88926197", "score": "0.5306107", "text": "def update_sql(sql, name = nil)\n execute(sql, name)\n end", "title": "" }, { "docid": "11bab02e03aaa63a1f3d23ba88926197", "score": "0.5306107", "text": "def update_sql(sql, name = nil)\n execute(sql, name)\n end", "title": "" }, { "docid": "127292d637419fc7a80fb425500897a4", "score": "0.52907604", "text": "def move_to_position(new_position)\n if new_position.is_a?(Integer)\n conversations = Conversation.sort_position_asc.select([:id,:position]).where(['id != ?', self.id]).all\n self.transaction do\n conversations.each_with_index do |conversation, index|\n if index >= new_position\n new_index = index + 1\n else\n new_index = index\n end\n Conversation.where(:id=>conversation.id).update_all(:position => (new_index))\n end\n Conversation.where(:id=>self.id).update_all(:position => new_position)\n end\n end\n end", "title": "" }, { "docid": "a40d26a02b0e2b0763a14c987c3a6cdf", "score": "0.5287705", "text": "def update (table, values, where, omitt)\n if omitt == false\n @oci.exec(\"UPDATE #{table} SET #{values[0]} WHERE #{where}\")\n @oci.commit\n else\n @oci.exec(\"UPDATE #{table} SET #{values[0]}\")\n @oci.commit\n end\n end", "title": "" }, { "docid": "e4b9d0a3361ecbf57be90d726a6a7449", "score": "0.52827513", "text": "def update!(**args)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n @rows = args[:rows] if args.key?(:rows)\n end", "title": "" }, { "docid": "9c8e663a2e1c68e410a88ca7aa9f1425", "score": "0.52820325", "text": "def update_order(new_order, items_to_update)\n if items_to_update != nil && new_order != nil && items_to_update.count == new_order.count\n items_to_update.each do |item|\n item.position = new_order.index(item.id.to_s) + 1\n item.save\n end\n end\n end", "title": "" }, { "docid": "e4b9d0a3361ecbf57be90d726a6a7449", "score": "0.52820325", "text": "def update!(**args)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n @rows = args[:rows] if args.key?(:rows)\n end", "title": "" }, { "docid": "e4b9d0a3361ecbf57be90d726a6a7449", "score": "0.52820325", "text": "def update!(**args)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n @rows = args[:rows] if args.key?(:rows)\n end", "title": "" }, { "docid": "e4b9d0a3361ecbf57be90d726a6a7449", "score": "0.52820325", "text": "def update!(**args)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n @rows = args[:rows] if args.key?(:rows)\n end", "title": "" }, { "docid": "e4b9d0a3361ecbf57be90d726a6a7449", "score": "0.52820325", "text": "def update!(**args)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n @rows = args[:rows] if args.key?(:rows)\n end", "title": "" }, { "docid": "e4b9d0a3361ecbf57be90d726a6a7449", "score": "0.52820325", "text": "def update!(**args)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n @rows = args[:rows] if args.key?(:rows)\n end", "title": "" }, { "docid": "e4b9d0a3361ecbf57be90d726a6a7449", "score": "0.52820325", "text": "def update!(**args)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n @rows = args[:rows] if args.key?(:rows)\n end", "title": "" }, { "docid": "e4b9d0a3361ecbf57be90d726a6a7449", "score": "0.52820325", "text": "def update!(**args)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n @rows = args[:rows] if args.key?(:rows)\n end", "title": "" }, { "docid": "6325dd33c1ac6a996a3049806ffad2c0", "score": "0.52767575", "text": "def update()\n sql = \"UPDATE albums SET (\n title,\n genre,\n artist_id\n ) =\n ($1, £2, $3,\n )\n WHERE id = $4\"\n values = [@title, @genre, @artist_id, @id]\n SqlRunner.run(sql, values)\n end", "title": "" }, { "docid": "311c48c65acef2b577dcf38b11dcbc12", "score": "0.5274903", "text": "def update!(**args)\n @expression = args[:expression] if args.key?(:expression)\n @limit = args[:limit] if args.key?(:limit)\n @offset = args[:offset] if args.key?(:offset)\n @order = args[:order] if args.key?(:order)\n @return_user_info = args[:return_user_info] if args.key?(:return_user_info)\n @sort_by = args[:sort_by] if args.key?(:sort_by)\n @tenant_id = args[:tenant_id] if args.key?(:tenant_id)\n end", "title": "" }, { "docid": "184d7ffceb7f73cdcfbc00ba09f1b824", "score": "0.52746063", "text": "def execute_update(sql)\n\n unit_of_work do |session|\n session.do_work(UpdateWork.new(sql))\n end\n end", "title": "" }, { "docid": "7d2d5a92849175f0c28a53bdad02a40b", "score": "0.5264973", "text": "def update # EXTENSION\n sql = \"UPDATE screenings SET screening_time = $1, total_tickets = $2, film_id = $3 WHERE id = $4\"\n values = [@screening_time, @total_tickets, @film_id, @id]\n SqlRunner.run(sql, values)\nend", "title": "" }, { "docid": "624f0ee930b70e9d29c285636105d37f", "score": "0.52620864", "text": "def update!(**args)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n @orders = args[:orders] if args.key?(:orders)\n @total_size = args[:total_size] if args.key?(:total_size)\n end", "title": "" }, { "docid": "6a8d022a2375d7be7a4cbcffe70da6eb", "score": "0.525825", "text": "def update!(**args)\n @sequence = args[:sequence] if args.key?(:sequence)\n @offset = args[:offset] if args.key?(:offset)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n end", "title": "" }, { "docid": "00cf57c8a9ffdcfa2a363008a788de4d", "score": "0.5256097", "text": "def update(ids, updates)\n case updates\n when Hash\n updates_array = build_updates_array(updates)\n \n if ids.class == Fixnum\n where_clause = \"WHERE id = #{ids};\"\n elsif ids.class == Array\n where_clause = ids.empty? ? \";\" : \"WHERE id IN (#{ids.join(\",\")});\"\n else\n where_clause = \";\"\n end\n \n connection.execute <<-SQL\n UPDATE #{table}\n SET #{updates_array * \",\"} #{where_clause}\n SQL\n when Array\n if ids.class == Fixnum\n if ids.size != updates.size\n \n updates.each do |update, index|\n updates_array = build_updates_array(update)\n \n connection.execute <<-SQL\n UPDATE #{table}\n SET #{updates_array * \",\"} WHERE id = #{ids[index]};\n SQL\n end\n end\n \n true\n end\n\n private\n\n def build_updates_array(hash)\n hash = BlocRecord::Utility.convert_keys(hash)\n hash.delete \"id\"\n hash_array = hash.map { |key, value| \"#{key}=#{BlocRecord::Utility.sql_strings(value)}\" }\n end\n end \n\n end", "title": "" }, { "docid": "c743637c7f43b605489ecb98a6099419", "score": "0.5251718", "text": "def update; @items[UPDATE_INDEX] end", "title": "" }, { "docid": "45edfedf302807a0819654f629ba231a", "score": "0.52437574", "text": "def sql_update(sql)\n exec(sql)\n @conn.affected_rows\n end", "title": "" }, { "docid": "15936bd00da321294b3c968b76a03b10", "score": "0.5242114", "text": "def update!(**args)\n @enable_dynamic_position = args[:enable_dynamic_position] if args.key?(:enable_dynamic_position)\n @excluded_filter_keys = args[:excluded_filter_keys] if args.key?(:excluded_filter_keys)\n @facet_key = args[:facet_key] if args.key?(:facet_key)\n @limit = args[:limit] if args.key?(:limit)\n end", "title": "" }, { "docid": "bcd65422c084d7a056b5fae31c5b18b6", "score": "0.5236457", "text": "def update()\n sql = \"UPDATE artists\n SET\n (\n artist_name\n ) =\n (\n $1\n )\n WHERE id = $2\"\n values = [@artist_name, @id]\n SqlRunner.run(sql, values)\nend", "title": "" }, { "docid": "309f5c0958f9be9a83f836ab747e1949", "score": "0.5236141", "text": "def update_all!\n klass = self.class\n\n set, bindvars = update_set()\n \n $db.do(\n \"UPDATE #{klass.sql_table} SET #{set} WHERE id=#{@id}\", \n *bindvars\n )\n \n klass.db_update_callback(@id)\n end", "title": "" }, { "docid": "dd371629630eb4047c7b7441d26241f7", "score": "0.52341336", "text": "def update!(**args)\n @param_types = args[:param_types] if args.key?(:param_types)\n @params = args[:params] if args.key?(:params)\n @partition_token = args[:partition_token] if args.key?(:partition_token)\n @query_mode = args[:query_mode] if args.key?(:query_mode)\n @query_options = args[:query_options] if args.key?(:query_options)\n @resume_token = args[:resume_token] if args.key?(:resume_token)\n @seqno = args[:seqno] if args.key?(:seqno)\n @sql = args[:sql] if args.key?(:sql)\n @transaction = args[:transaction] if args.key?(:transaction)\n end", "title": "" } ]
58a14a6350d7e30f540ce2d1d1f5854b
def _print_da_results_headers Diagnostic Test Results are different from Standard Extraction. The measurements are always the same. There's currently no customization permitted. This may change in the future. This will return an array of measure names to use in the header. returns Array
[ { "docid": "2225a0c2fd717b2170aeb5c7627a1ccd", "score": "0.0", "text": "def _lsof_measures_in_rss(rss_type)\n case rss_type\n when :descriptive_statistics\n rsstms = ResultStatisticSectionTypesMeasure\n .where(result_statistic_section_type_id: 5, default: true, type1_type_id: nil)\n @rsstms_descriptive_statistics = rsstms\n\n when :special_area_for_auc_and_q_star\n rsstms = ResultStatisticSectionTypesMeasure\n .where(result_statistic_section_type_id: 6, default: true, type1_type_id: nil)\n @rsstms_special_area_for_auc_and_q_star = rsstms\n\n when :_2x2_table\n rsstms = ResultStatisticSectionTypesMeasure\n .where(result_statistic_section_type_id: 7, default: true, type1_type_id: nil)\n @rsstms_2x2_table = rsstms\n\n when :test_accuracy_metrics\n rsstms = ResultStatisticSectionTypesMeasure\n .where(result_statistic_section_type_id: 8, default: true, type1_type_id: nil)\n @rsstms_test_accuracy_metrics = rsstms\n\n end # case rss_type\n\n rsstms.map { |rsstm| rsstm.measure.name }\n end", "title": "" } ]
[ { "docid": "7b1c2608f7a2dd514944d1470f50cbfa", "score": "0.61777866", "text": "def expected_results\n return self.product_test.measure_defs.collect do |measure|\n expected_result(measure)\n end\n end", "title": "" }, { "docid": "7d8ae2e1ca73b9b8a6546ca3bc77f6c8", "score": "0.59146255", "text": "def expected_values_for_qrda_export(measure)\n qrda_expected_values = []\n expected_pop_names = HQMF::PopulationCriteria::ALL_POPULATION_CODES - %w{STRAT OBSERV}\n measure.populations.each_with_index do |pop, idx|\n pop.each do |pkey, pvalue|\n next unless expected_pop_names.include?(pkey)\n this_ev = {}\n this_ev[:hqmf_id] = measure.population_criteria[pvalue.to_s]['hqmf_id']\n if pkey == 'DENEX'\n this_ev[:display_name] = 'Denominator Exclusions'\n else\n this_ev[:display_name] = measure.population_criteria[pvalue.to_s]['title']\n end\n this_ev[:code] = pkey\n this_ev[:expected_value] = self.expected_values[idx][pkey].to_s\n qrda_expected_values << this_ev\n end\n end\n qrda_expected_values\n end", "title": "" }, { "docid": "7d8ae2e1ca73b9b8a6546ca3bc77f6c8", "score": "0.59146255", "text": "def expected_values_for_qrda_export(measure)\n qrda_expected_values = []\n expected_pop_names = HQMF::PopulationCriteria::ALL_POPULATION_CODES - %w{STRAT OBSERV}\n measure.populations.each_with_index do |pop, idx|\n pop.each do |pkey, pvalue|\n next unless expected_pop_names.include?(pkey)\n this_ev = {}\n this_ev[:hqmf_id] = measure.population_criteria[pvalue.to_s]['hqmf_id']\n if pkey == 'DENEX'\n this_ev[:display_name] = 'Denominator Exclusions'\n else\n this_ev[:display_name] = measure.population_criteria[pvalue.to_s]['title']\n end\n this_ev[:code] = pkey\n this_ev[:expected_value] = self.expected_values[idx][pkey].to_s\n qrda_expected_values << this_ev\n end\n end\n qrda_expected_values\n end", "title": "" }, { "docid": "175629d2d0bacbf79fa058bdc70e8405", "score": "0.586054", "text": "def measure_table_header\n line = \"|Measure|Status\".dup\n line << \"\\n\"\n end", "title": "" }, { "docid": "e19d61730d176c9c707f82e15cb5a9f2", "score": "0.58518237", "text": "def measures_caption measures = []\n if measures.empty? || measures.nil?\n response.measures\n else\n measures.collect{|measure|\n next unless col = response.measures.detect{|value| value[:name] == measure}\n col\n }.compact\n end\n\n end", "title": "" }, { "docid": "4439a92c4424ee5d3d476a0186115abd", "score": "0.5717298", "text": "def main_headers\n main_reports.map(&:headers).flatten.uniq\n end", "title": "" }, { "docid": "cb6b87a798f3a56ad706cb6e88778d81", "score": "0.56720567", "text": "def measures\n [response[:axes][:axis][0][:tuples][:tuple]].flatten.collect{|m|\n {\n name: (m[:member].kind_of?(Array) ? m[:member].collect { |x| x[:u_name]}.join(', ') : m[:member][:u_name]),\n caption: (m[:member].kind_of?(Array) ? m[:member].collect { |x| x[:caption]}.join(', ') : m[:member][:caption]),\n }\n }\n end", "title": "" }, { "docid": "a5e0c9660d200d08f40491ed5fdc744e", "score": "0.5632762", "text": "def assessmenmts_summary_array(assessment_headers, symptoms_headers)\n # A header will be included in this\n assessments_summary = []\n assessments.each do |assessment|\n entry = []\n assessment_headers.each do |header|\n # Whether or not the assessment has that particular attribute, the row still needs a value\n entry.push(assessment[header] || '')\n end\n symptoms_headers.each do |header|\n # Whether or not the assessment has that particular symptom, the row still needs a value\n entry.push(assessment.get_reported_symptom_value(header) || '')\n end\n assessments_summary.push(entry)\n end\n assessments_summary\n end", "title": "" }, { "docid": "a5e0c9660d200d08f40491ed5fdc744e", "score": "0.5632762", "text": "def assessmenmts_summary_array(assessment_headers, symptoms_headers)\n # A header will be included in this\n assessments_summary = []\n assessments.each do |assessment|\n entry = []\n assessment_headers.each do |header|\n # Whether or not the assessment has that particular attribute, the row still needs a value\n entry.push(assessment[header] || '')\n end\n symptoms_headers.each do |header|\n # Whether or not the assessment has that particular symptom, the row still needs a value\n entry.push(assessment.get_reported_symptom_value(header) || '')\n end\n assessments_summary.push(entry)\n end\n assessments_summary\n end", "title": "" }, { "docid": "662106f313ac6495241711b9f45223ec", "score": "0.5537254", "text": "def short_report\n puts @specs.map {|spec| spec.name}.format_output_columns, \"\"\n end", "title": "" }, { "docid": "7a320c3b5e2b9303140de3946049d833", "score": "0.5536536", "text": "def pretty_print_export_header\n text = ''\n comparate_groups.each do |cg|\n text += '['\n cg.comparates.each do |c|\n comparable = c.comparable_element.comparable\n if comparable.instance_of? ExtractionsExtractionFormsProjectsSectionsType1\n t1 = comparable.type1\n text += t1.name\n text += \" (#{t1.description}), \" if t1.description.present?\n elsif comparable.instance_of? ExtractionsExtractionFormsProjectsSectionsType1RowColumn\n tn = comparable.timepoint_name\n text += tn.name\n text += \" (#{tn.unit}), \" if tn.unit.present?\n end\n end\n text = text.gsub(/,\\s$/, '') + ']'\n text += ' vs. '\n end\n\n \"[ID: #{id}] \" + text[0..-6]\n end", "title": "" }, { "docid": "10b1f6210040e013d0ef539cf0697d8a", "score": "0.5514491", "text": "def dmr(results)\n results.inject(\"\"){ |s,(k,v)| s << \"#{k}:\\t#{v}\\n\"; s }\n end", "title": "" }, { "docid": "3015c1cf9262e26c4bc3e00a6e8d7f29", "score": "0.5509101", "text": "def get_array_of_headers\n\t\t\tarray = []\n\t\t\t@data_to_render.each do |s|\n\t\t\t\tarray << convert_symbol_to_header(s)\n\t\t\tend\n\t\t\tarray\n\t\tend", "title": "" }, { "docid": "6bcfb2689c2e855d1c45fc6ae9df313f", "score": "0.55015045", "text": "def report_names\n Constants::REPORTS.collect do |name|\n name = 'AVERAGE' if name == 'SUMMATION' and year?\n name.titleize\n end\n end", "title": "" }, { "docid": "4cf8ebd4f3321d5cc5a6efaeb210ee91", "score": "0.5499269", "text": "def formatted_test_results\n str = ''\n Stats.test_results.keys.sort.each do |key|\n str += formatted_test_results_for_key(key)\n end\n str\n end", "title": "" }, { "docid": "29417a9adf0afcd544a1d21784c39a01", "score": "0.54966295", "text": "def failing_measures\n return self.product_test.measure_defs.select do |measure|\n !self.passed?(self.expected_result(measure))\n end\n end", "title": "" }, { "docid": "c862bdcd62105fa7a7003ceda75a11e5", "score": "0.5389031", "text": "def perf_util_summary_section(s)\n ss = []\n\n # Fill in the single day data from the timestamp report\n ts_rpt = @sb[:ts_rpt]\n total_vals = 0.0\n ts_rpt.table.data.each do |r|\n next unless r[0].downcase.include?(s)\n\n ts_rpt.col_order.each_with_index do |col, col_idx|\n next unless col.ends_with?(\"_percent\")\n\n # Do NOT show reserve (available) column for Host and Storage nodes\n next if col.include?(\"_reserve\") && %w[Host Storage].include?(@sb[:options][:model])\n\n tip = case s # Override the formatting for certain column groups on single day percent utilization chart\n when \"cpu\"\n ts_rpt.format(col + '_tip', r[col + '_tip'],\n :format => {\n :function => {\n :name => \"mhz_to_human_size\",\n :precision => 1\n }\n })\n when \"memory\"\n ts_rpt.format(col + '_tip', r[col + '_tip'].to_f * 1024 * 1024,\n :format => {\n :function => {\n :name => \"bytes_to_human_size\",\n :precision => 1\n }\n })\n when \"disk\"\n ts_rpt.format(col + '_tip', r[col + '_tip'],\n :format => {\n :function => {\n :name => \"bytes_to_human_size\",\n :precision => 1\n }\n })\n else\n ts_rpt.format(col + '_tip', r[col + '_tip'])\n end\n val = ts_rpt.format(col, r[col], :format => {:function => {:name => \"number_with_delimiter\", :suffix => \"%\"}, :precision => \"0\"})\n ss.push([_(ts_rpt.headers[col_idx]), \"#{tip} (#{val})\"])\n total_vals += r[col].to_f # Total up the values for this section\n end\n end\n return nil if total_vals.zero? # If no values, return nil so this section won't show on the screen\n\n # Get the trend information from the trend charts/report\n @sb[:trend_charts].each do |c|\n s = \"storage\" if s == \"disk\" # disk fields have 'storage' in them\n next unless c[:columns].first.include?(\"#{s}_\")\n next unless c[:trends]\n\n c[:trends].each do |t|\n c[:columns].each do |trendcol|\n next unless trendcol.starts_with?(\"trend_\")\n\n ss.push([Dictionary.gettext(trendcol, :type => :column, :notfound => :titleize) + \": \" + t.split(\":\").last,\n @sb[:trend_rpt].extras[:trend][trendcol + \"|\" + t.split(\":\").first]])\n end\n end\n end\n ss\n end", "title": "" }, { "docid": "ab94f36da0ddba149e50abfadc5b4275", "score": "0.53783274", "text": "def passing_measures\n return self.product_test.measure_defs.select do |measure|\n self.passed?(self.expected_result(measure))\n end\n end", "title": "" }, { "docid": "f0e6857a851b0e790b5864d2fc909caf", "score": "0.5349973", "text": "def format_ead_subjects headings, results = Array.new\n headings.each do |heading|\n results << heading.split(\"--\")\n end\n return results\n end", "title": "" }, { "docid": "dea4709fac604ed9dbc33bcf709f52cd", "score": "0.5340705", "text": "def header\n temp = \"\"\n result = \"SpecId\\tLabel\\tCharge\\t\"\n \n nokogiriDoc(@target).xpath(\"//#{@xmlns}search_hit\").each do |hit|\n temp = hit.xpath(\".//#{@xmlns}search_score\")\n break\n end\n \n temp.each do |score|\n result += score.xpath(\"./@name\").to_s + \"\\t\"\n end\n \n result += \"Peptide\\t\" + \"Proteins\"\n end", "title": "" }, { "docid": "7d49062f1c31a87bc186566884353bca", "score": "0.5322111", "text": "def output_finder_details report_table\n if guessed_types.length > 1\n report_table.write_stats \"Alternate possible types:\", guessed_types.join(\"\\n\")\n end\n\n all_page_elements = Capybara.current_session.all(*search_args, visible: false).to_a\n all_elements report_table\n report_table.write_stats \"Total elements found:\", all_elements.length\n all_elements.each_with_index do |element, element_index|\n report_table.write_stats \"Element[#{element_index}]\",\n analyze_report_element(element, report_table),\n prevent_shrink: true,\n exclude_code_block: true,\n do_not_pretty_print: true\n end\n\n if (all_elements.length != all_page_elements.length)\n all_other_elements = all_page_elements - all_elements\n report_table.write_stats \"Total elements found elsewhere:\", all_other_elements.length\n all_other_elements.each_with_index do |element, element_index|\n report_table.write_stats \"Other Element[#{element_index}]\",\n analyze_report_element(element, report_table),\n prevent_shrink: true,\n exclude_code_block: true,\n do_not_pretty_print: true\n end\n end\n end", "title": "" }, { "docid": "40a66a8563ca2bcceb2f7c5ed9b6ac07", "score": "0.5299641", "text": "def header\n temp = \"\"\n result = \"SpecId\\tLabel\\tCharge\\t\"\n \n nokogiriDoc(@target).xpath(\"//xmlns:SpectrumIdentificationItem\").each do |hit|\n temp = hit.xpath(\".//xmlns:cvParam\")\n break\n end\n \n temp.each do |score|\n result += score.xpath(\"./@name\").to_s + \"\\t\"\n end\n \n result += \"Peptide\\t\" + \"Proteins\"\n end", "title": "" }, { "docid": "a9d14889675cdcf149a8c5c2d04a05f0", "score": "0.5276866", "text": "def dc_header_for_result\n html = '<div class=\"dc-result-header\">'\n if @form['result_set']['actions'] #&& !@form['readonly']\n ignore, width, has_check = dc_actions_column()\n check_all = fa_icon('check-box-o', class: 'dc-check-all') if has_check\n html << %(<div class=\"dc-result-actions\" style=\"width:#{width}px;\">#{check_all}</div>)\n end\n # preparation for sort icon \n sort_field, sort_direction = nil, nil\n if session[@form['table']]\n sort_field, sort_direction = session[@form['table']][:sort].to_s.split(' ')\n end\n\n if (columns = @form['result_set']['columns'])\n columns.sort.each do |key, options|\n session[:form_processing] = \"result_set:columns: #{key}=#{options}\"\n next if options['width'].to_s.match(/hidden|none/i)\n\n th = %(<div class=\"th\" style=\"width:#{options['width'] || '15%'};text-align:#{options['align'] || 'left'};\" data-name=\"#{options['name']}\")\n label = t_label_for_column(options)\n # no sorting when embedded documents or custom filter is active\n sort_ok = !dc_dont?(@form['result_set']['sort'], false)\n sort_ok = sort_ok || (@form['index'] && @form['index']['sort'])\n sort_ok = sort_ok && !dc_dont?(options['sort'], false)\n if @tables.size == 1 && sort_ok\n icon = 'sort_unset md-18'\n filter_class = form_has_input_field?(options['name']) ? nil : 'no-filter'\n if options['name'] == sort_field\n icon = sort_direction == '1' ? 'sort_down md-18' : 'sort_up md-18'\n else\n # no icon if filter can not be set\n icon = nil if filter_class\n end\n # sort and filter icon\n icon = mi_icon(icon, class: filter_class) if icon\n url = url_for(controller: 'cmsedit', action: 'run', control: 'cmsedit.sort', sort: options['name'],\n t: CmsHelper.table_param(params), f: CmsHelper.form_param(params))\n th << %(><span data-url=\"#{url}\">#{label}</span>#{icon}</div>)\n else\n th << \">#{label}</div>\"\n end\n html << %(<div class=\"spacer\"></div>) + th\n end\n end\n (html << '</div>').html_safe\nend", "title": "" }, { "docid": "8e8bb60e2b0cabf46d5c2ba6eb5d6983", "score": "0.5275602", "text": "def getDetailsData(report, forstring, table, row, column, units, final_units)\n if report == 'ZoneComponentLoadSummary'\n forstring.upcase!\n end\n\n str_HVACEquipment_query = 'SELECT Value FROM tabulardatawithstrings WHERE '\n str_HVACEquipment_query << \"ReportName='#{report}' AND \"\n str_HVACEquipment_query << \"ReportForString='#{forstring}' AND \"\n str_HVACEquipment_query << \"TableName='#{table}' AND \"\n str_HVACEquipment_query << \"RowName LIKE '#{row}' AND \"\n str_HVACEquipment_query << \"ColumnName='#{column}' AND \"\n str_HVACEquipment_query << \"Units='#{units}'\"\n\n query_results = @sqlFile.execAndReturnFirstString(str_HVACEquipment_query)\n\n if query_results.empty?\n\n @runner.registerWarning(\"Could not get data for #{report} #{forstring} #{table} #{row} #{column}.\")\n return final_units == 's' ? '' : 0.0\n\n else\n r = query_results.get\n if report == 'ZoneComponentLoadSummary'\n @testData[\"#{@currentZoneName}_#{table}_#{row}\"] = r\n end\n\n if final_units == 's'\n return r\n else\n converted = OpenStudio.convert(r.to_f, eplus_to_openstudio(units), final_units)\n if converted.empty?\n @runner.registerError(\"Could not convert #{r} from #{units} to #{final_units}\")\n return 0.0\n else\n return converted.get.round(2)\n end\n end\n\n end\n end", "title": "" }, { "docid": "44c8953b478251eda9ac411534a01628", "score": "0.5273948", "text": "def header\n (mo_report_flag == true) ? \"MSW Evaluation & Treatment MD Order\" : \"MSW Evaluation & Treatment\"\n end", "title": "" }, { "docid": "cc8f5998c14b05ff75158045169f6bb9", "score": "0.52718264", "text": "def statistics_header(options)\n [\n {:title => options[:title], :width => :rest},\n {:title => 'Hits', :align => :right, :highlight => (options[:highlight] == :hits), :min_width => 4},\n {:title => 'Sum', :align => :right, :highlight => (options[:highlight] == :sum), :min_width => 6},\n {:title => 'Mean', :align => :right, :highlight => (options[:highlight] == :mean), :min_width => 6},\n {:title => 'StdDev', :align => :right, :highlight => (options[:highlight] == :stddev), :min_width => 6},\n {:title => 'Min', :align => :right, :highlight => (options[:highlight] == :min), :min_width => 6},\n {:title => 'Max', :align => :right, :highlight => (options[:highlight] == :max), :min_width => 6},\n {:title => '95 %tile', :align => :right, :highlight => (options[:highlight] == :percentile_interval), :min_width => 11}\n ]\n end", "title": "" }, { "docid": "c82dc613e1e5f3c82cb1bd69fafbfb5b", "score": "0.5267539", "text": "def overlapping_result_headers(results)\n if results.size == 1\n return []\n else\n return results.values.collect do |res|\n res.collect{|val| val.keys}.flatten.uniq\n end.inject(:&)\n end\n end", "title": "" }, { "docid": "016d0e1aa4d768650d4f232881aaa9a9", "score": "0.5265879", "text": "def table\n diff\n main = timer.shift\n total = main[:elapsed]\n p_tot = 0\n e_tot = 0\n t_ary = timer.each_with_object([]) do |timing, ary|\n title = timing[:title]\n elapsed = timing[:elapsed]\n e_tot += elapsed\n percent = (elapsed / total * 100).round(2)\n p_tot = (p_tot + percent).round(2)\n ary.append(t_format(title, elapsed, percent, p_tot))\n end\n str = t_format('Untracked', (total - e_tot).round(2), (100 - p_tot).round(2), '100')\n t_ary.append(str)\n t_ary.unshift(t_format(main[:title], main[:elapsed]))\n end", "title": "" }, { "docid": "3322df2a5be41766da888f0c311d0bd6", "score": "0.52597123", "text": "def output_basic_details report_table\n report_table.write_stats \"Function:\", @function_name.to_s\n\n args_table = TestSupport::DiagnosticsReportBuilder::ReportTable.new\n search_args.each_with_index do |the_arg, arg_index|\n args_table.write_stats \"[#{arg_index}]\", dump_value(the_arg) + ((arg_index == 0 && @args[0] != the_arg) ? \" (guessed)\" : \"\")\n end\n if options\n options.each do |key, value|\n args_table.write_stats key, dump_value(value)\n end\n end\n\n report_table.write_stats \"Args:\",\n args_table.full_table,\n prevent_shrink: true,\n exclude_code_block: true,\n do_not_pretty_print: true\n\n if Capybara.current_session.driver.respond_to? :evaluate_script\n begin\n report_table.write_stats \"Window Height:\", Capybara.current_session.driver.evaluate_script(\"window.innerHeight\")\n report_table.write_stats \"Window Width:\", Capybara.current_session.driver.evaluate_script(\"window.innerWidth\")\n rescue Capybara::NotSupportedByDriverError\n end\n end\n end", "title": "" }, { "docid": "199c0775ad56b29368c9e399ffe56c93", "score": "0.5226157", "text": "def prepare_report_detail()\n Ruport::Data::Table.new( :column_names => self.class.report_detail_symbols() ) { |t|\n t << self.to_a_s( self.class.report_detail_symbols(), CONVERTED_FLOAT2STRING_FIXED_PRECISION, 8 )\n }\n end", "title": "" }, { "docid": "6a4fd20faffaa97c5c23114f931ae542", "score": "0.522571", "text": "def statistics_header(options)\n [\n {:title => options[:title], :width => :rest},\n {:title => 'Hits', :align => :right, :highlight => (options[:highlight] == :hits), :min_width => 4},\n {:title => 'Sum', :align => :right, :highlight => (options[:highlight] == :sum), :min_width => 6},\n {:title => 'Mean', :align => :right, :highlight => (options[:highlight] == :mean), :min_width => 6},\n {:title => 'StdDev', :align => :right, :highlight => (options[:highlight] == :stddev), :min_width => 6},\n {:title => 'Min', :align => :right, :highlight => (options[:highlight] == :min), :min_width => 6},\n {:title => 'Max', :align => :right, :highlight => (options[:highlight] == :max), :min_width => 6}\n ]\n end", "title": "" }, { "docid": "eb3cce0efd63cc5143d9eeaafc723898", "score": "0.5215629", "text": "def report\n Terminal::Table.new(:headings => HEADERS) do |t|\n group_analysis = Memtf::Analyzer.analyze_group(group)\n group_analysis.sort_by { |k,v| -v['impact'] }.each do |k,v|\n t << [k,\n to_pct(v['impact']),\n to_MB(v['size']),\n to_MB(v['size_delta']),\n v['count'],\n v['count_delta']]\n end\n end\n end", "title": "" }, { "docid": "4e4db145f264c6c121b0bdb885f778ff", "score": "0.52152145", "text": "def verbose_report\n result = header\n result += \":\\n#{smell_list}\" if should_report\n result += \"\\n\"\n result\n end", "title": "" }, { "docid": "51c31ce2d1119fecbc7e83d2ba65eacc", "score": "0.5211328", "text": "def compare_risk_variable_results(calculated, issues = [])\n measure.supplemental_data_elements.each do |supplemental_data_element|\n statement_name = supplemental_data_element['statement_name']\n original_statement_results = statement_results.select { |sr| sr['statement_name'] == statement_name }.first&.raw\n calculated_statement_results = calculated['statement_results'].select { |sr| sr['statement_name'] == statement_name }.first&.raw\n next if original_statement_results.blank?\n next unless calculated_statement_results.blank?\n\n issues << \"#{statement_name} - Not Found in File\"\n end\n end", "title": "" }, { "docid": "f0cc71c4c02386db6eeaf4774f5d4d74", "score": "0.51959634", "text": "def print_metrics(money_day)\n print_arr = [[\"\\nTOTAL EARNINGS\"], [\"\\nAVERAGE RATINGS\"], [\"\\nNUMBER OF RIDES\"], [\"\\nDAY WITH MOST EARNINGS\"]]\n @@drivers.each do |id, data|\n print_arr[0] << \"Driver #{id}: $%0.2f\" % [data[:earnings]]\n print_arr[1] << \"Driver #{id}: %0.1f\" % [data[:rating]]\n print_arr[2] << \"Driver #{id}: #{data[:rides]} \"\n print_arr[3] << \"Driver #{id}: #{data[:money_day][0]}\"\n end\n print_arr.pop unless money_day == \"money day tallied\"\n return print_arr\n end", "title": "" }, { "docid": "f05ace9a3e828354ec7766b6e9ae9570", "score": "0.5191757", "text": "def ed_headers\n ed_report.headers\n end", "title": "" }, { "docid": "4ed52263e552d4a0cc7ced5af30cc21b", "score": "0.5177277", "text": "def summarize_results!(results)\n \t File.open(@dir + '/results.yaml', 'w' ) do |out|\n \t\t\tYAML.dump(results, out)\n \t\tend\n \t\t# create an array of arrays\n \t\tres = results.keys.map do |key| \n \t\t # calculate stats\n \t\t a = results[key]\n \t\t if a.all? {|el| el.is_a? Numeric }\n \t\t [key] + a + [Stats::mean(a), Stats::standard_deviation(a)]\n\t\t else\n\t\t [key] + a + [\"--\", \"--\"]\n\t end\n\t\t end\n\t\t \n\t\t ls = results.keys.map{|v| [7, v.to_s.length].max }\n \t\t\n \t\tls = [\"Std Deviation\".length] + ls\n \t\tres = header_column + res\n \t\tres = res.transpose\n \t\tout = build_table res, ls\n \t\tFile.open(@dir + \"/summary.mmd\", 'w') do |f|\n \t\t f << \"## Results for #{@experiment} ##\\n\\n\"\n \t\t f << out\n\t\t end\n \t #results = results.reduce({}) do |tot, res|\n \t # cv = res.delete :cv\n \t # tot.merge Hash[res.to_a.map {|a| [\"cv_#{cv}_#{a.first}\".to_sym, a.last]}]\n \t #end\n \t #FasterCSV.open(\"./results/all.csv\", \"a\") do |csv|\n \t # csv << results.to_a.sort_by{|a| a.first.to_s}.map(&:last)\n \t #end\n \tend", "title": "" }, { "docid": "8d98a7dc79d1177dcdf261593f6178e3", "score": "0.51751685", "text": "def get_results_header(type = nil)\n case type\n when \"degrees\"\n \"#{pluralize(@collection.total_entries-2, \"Degree\")} of Separation\"\n when \"followers\"\n \"#{@collection.total_entries} Shared Followers\"\n when \"friends\"\n \"#{@collection.total_entries} Shared Friends\"\n else\n \"\"\n end\n end", "title": "" }, { "docid": "36f04932454c5ddf739b44e0271d31c4", "score": "0.5162775", "text": "def headings_for_filed_bug\n [\n tablesort_heading_custom_sort_numeric('Bug ID'),\n tablesort_heading_custom_sort_numeric('Priority'),\n tablesort_heading_custom_sort_numeric('Status'),\n 'Advisory',\n 'Description'\n ]\n end", "title": "" }, { "docid": "83360ca2d8e4d083264da17242dbec4d", "score": "0.5160177", "text": "def report\n # Header lines\n line = \"Heat \"\n @lanes.sort.each do |lane|\n line << \"Lane #{lane} \"\n end\n puts line\n line = \"---- \"\n @lanes.sort.each do |lane|\n line << \"------ \"\n end\n puts line\n # Report lines\n @heats.each do |heat|\n line = sprintf(\"%3d \", heat)\n @heat_lane_cars[heat].keys.sort.each do |lane|\n line << sprintf(\"%5d \", @heat_lane_cars[heat][lane])\n end\n puts line\n end\n end", "title": "" }, { "docid": "0bfba1edf2c1739a2c35930268b1cdcc", "score": "0.51519203", "text": "def summary_test_result_csv\n results = {}\n headers = Set.new\n summary_test_results = self.summary_test_results.as_json\n\n summary_test_results.each do |test_result|\n header = \"#{test_result['name']}:#{test_result['test_result_name']}\"\n\n if results.key?(test_result['group_name'])\n results[test_result['group_name']][header] = test_result['status']\n else\n results[test_result['group_name']] = { header => test_result['status'] }\n end\n\n headers << header\n end\n headers = headers.sort\n\n CSV.generate do |csv|\n csv << [nil, *headers]\n\n results.sort_by(&:first).each do |group_name, _test_group|\n row = [group_name]\n\n headers.each do |header|\n if results[group_name].key?(header)\n row << results[group_name][header]\n else\n row << nil\n end\n end\n csv << row\n end\n end\n end", "title": "" }, { "docid": "5b2c28412552a382f65785ef1d85b176", "score": "0.5151399", "text": "def get_all_user_defined_measures\n\t\t# get all comparison ids for the study\n\t\tstudy = Study.find(:first, :conditions=>[\"id=?\",self.study_id],:select=>[\"project_id\"])\n project_study_ids = Study.find(:all, :conditions=>[\"project_id=?\",study.project_id],:select=>[\"id\"])\n\n\t\tcomparisons = Comparison.find(:all, :conditions=>[\"study_id IN (?)\", project_study_ids], :select=>[\"id\"])\n\t\t# get all associated user-defined measures\n\t\tmeasures = ComparisonMeasure.where(:comparison_id => comparisons, :measure_type=>0)\n\t\tuniq_measures = []\n\t\ttitle_array = []\n\t\tmeasures.each_with_index do |m,i|\n\t\t\tif !title_array.include?(m.title)\n\t\t\t\tuniq_measures << m\n\t\t\t\ttitle_array << m.title\n\t\t\tend\n\t\tend\n\t\t\n\t\treturn uniq_measures\n\tend", "title": "" }, { "docid": "bc81dde595fe897e36c1cc55ea026695", "score": "0.514696", "text": "def functional_group_header\n ['GS', 'HP', payer_id, strip_string('1000000'), Time.now().strftime(\"%Y%m%d\"), Time.now().strftime(\"%H%M\"),\n (@isa_record.isa_number.to_s.rjust(9, '0') if @isa_record), 'X',\n ((!@output_version || @output_version == '4010') ? '004010X091A1' : '005010X221A1')].join(@element_seperator)\n end", "title": "" }, { "docid": "789912f58d84d72f288176fdf7f9073f", "score": "0.5144601", "text": "def drug_headers\n [\n \"Amlodipine\",\n \"ARBs/ACE Inhibitors\",\n \"Diuretic\"\n ]\n end", "title": "" }, { "docid": "ffce3eb12262abcdc1e07a1e329b5bda", "score": "0.51267594", "text": "def get_htsc_fix_results text, header = []\r\n\t\tresults = []\t# List of array/csv rows \r\n\t\t\r\n\t\txhash = XmlSimple.xml_in(text)\t\t# Parse TEXT/XML into Ruby Arrays & Hashes\r\n\t\t# puts xhash['Order']\t\t\t\t# See one chunk of parsed object\r\n\t\t# ap xhash\t\t\t\t\t\t\t# \"awesome_print\" helps see Ruby object\r\n\t\t\r\n\t\t# We will denormaize from: Header => Lines => Assortment => HTSC. As each loop occurs, we will dup array of fields and print when done\r\n\t\theader << xhash['Order'][0]['Header'][0]['OrderNumber']\r\n\r\n\t\t# <Order> <Details> ... then list of <LineItem> -- [0] are because Ruby XmlSimple makes them arrays because it is not looking at XSD\r\n\t\tlines = xhash['Order'][0]['Details']\t# NO [0] here because we want the array not the hash of first LineItem\r\n\t\tlines.each do |li|\r\n\t\t\tline = header.dup\r\n\t\t\tline << li['LineItem'][0]['LineItemNumber']\t\t# Add to array\r\n\t\t\tline << li['LineItem'][0]['ProductCode']\r\n\t\t\t\r\n\t\t\tassortments = li['LineItem'][0]['Assortment']\r\n\t\t\t# puts assortments\t# Helps A LOT to print piece of Ruby Object (hashes & arrays) parsed by XmlSimple\r\n\t\t\tassortments.each do |asmt|\r\n\t\t\t\tasmtline = line.dup\r\n\t\t\t\t\r\n\t\t\t\t# Size / Color / Dimension are in array of References. Get them as simple hash and append in order to array/csv\r\n\t\t\t\tasmt_references = get_type_values_as_hash(asmt['References'])\r\n\t\t\t\t['Size','Color','Dimension'].each {|attr| asmtline << asmt_references[attr] }\r\n\t\t\t\t\r\n\t\t\t\t# May have 2+ Harmonzied Codes per Assortment\r\n\t\t\t\thcline = asmtline.dup\r\n\t\t\t\tharmcode_references = get_type_values_as_hash(asmt['HarmonizedCodeInfo'][0]['References'])\r\n\t\t\t\t['HTS','CustomsHTSText','UserDefChar1','UserDefChar2'].each {|attr| hcline << harmcode_references[attr] }\r\n\t\t\t\t\r\n\t\t\t\t# print_csv hcline\r\n\t\t\t\t\r\n\t\t\t\tresults << hcline\r\n\t\t\tend\r\n\t\tend\r\n\t\tresults\r\n\tend", "title": "" }, { "docid": "4e05da40141cb0cecc210ff460867642", "score": "0.5121619", "text": "def search_results_table_headers\n search_results_table.headers_text\n end", "title": "" }, { "docid": "d79dd38dcbece4ee70f73cfbc6ed093e", "score": "0.5120836", "text": "def results_header()\n results.find_element(:id, \"results_header\")\n end", "title": "" }, { "docid": "664998309cb23722f298a4be4cead69f", "score": "0.51122093", "text": "def reports_to_calculate_limit_headers\n all_reports = application_usage_reports\n\n return all_reports if (@usage.nil? || @usage.empty?)\n\n metric_names_in_usage = @usage.keys\n metrics = metric_names_in_usage | ascendants_names(metric_names_in_usage)\n all_reports.select { |report| metrics.include?(report.metric_name) }\n end", "title": "" }, { "docid": "43bcbb5a2a9153eb9c375baf8535930c", "score": "0.5105647", "text": "def print_report\n table_attributes = []\n [tv, call_fix_fr, call_mob_fr].each do |attribute|\n if attribute == true\n table_attributes << 'Oui'\n else\n table_attributes << 'Non'\n end\n end\n table_attributes\n end", "title": "" }, { "docid": "ae575f26a5988cfd835c8204ce3611e8", "score": "0.51018476", "text": "def mark_results_with_times(results)\n unless results.empty?\n vals = results.map{|r|\n [\"#{r.suite.inspect}:\", r.benchmark.real, r.char]\n }\n w = vals.map{|a| a.first.size }.max\n fmt = \"%-#{w}s %.2f sec: %s\"\n result_descriptions = vals.map{|a| fmt % a }\n else\n result_descriptions = []\n end\n blank\n @f.puts result_descriptions\n blank\n end", "title": "" }, { "docid": "56afc18f7dc58342dbc7f716d209514b", "score": "0.5096292", "text": "def summary\n qsumm = summarytext\n \n stats = Array.new\n qsumm.each do |q|\n domain = nil\n \n if q =~ /^\\W+(\\d+)\\W+(\\d+\\w+)\\W+(\\w+)\\W+(\\w+)\\W+(.+)$/\n domain = {}\n \n domain[:count] = $1\n domain[:volume] = $2\n domain[:oldest] = $3\n domain[:newest] = $4\n domain[:domain] = $5\n \n stats << domain unless $5 == \"TOTAL\" && $1 =~ /\\d+/\n end\n end\n \n stats\n end", "title": "" }, { "docid": "7f55035e628034872c7bd89bf3cf258b", "score": "0.5071201", "text": "def get_column_names\n column_names_tr = @browser.find_element :xpath, @header_xpath\n column_names_ths = column_names_tr.find_elements :tag_name, 'th'\n \n column_names = []\n column_names_ths.each do |th|\n column_names.push th.text\n end\n\n column_names.map! do |name|\n case name\n when ''\n name = 'Is Network'\n when '#'\n name = 'Rank'\n when 'US'\n name = 'Allows US Players'\n when 'Data'\n name = 'Is Data Current'\n end\n\n name.match(/\\W/) ? \"\\\"#{name}\\\"\" : name\n end\n\n column_names\nend", "title": "" }, { "docid": "fe90a126c7ec5832656663220cfb89f1", "score": "0.50641096", "text": "def print_meta_head\n puts \"\\nScaled Dataset: Difference of #{@meta_data.name} between the two datasets\"\n end", "title": "" }, { "docid": "6c677023af210962eb9c1acc694c77da", "score": "0.50577354", "text": "def output_results_table(results={})\n puts\n puts \"----------------------------------------\"\n puts \"| Type | Mean | Median |\"\n puts \"----------------------------------------\"\n results.each do |label, hash|\n print \"| \" + label.ljust(10) + \" | \"\n print sprintf(\"%.6f\", hash[:mean]).rjust(10) + \" | \"\n puts sprintf(\"%.6f\", hash[:median]).rjust(10) + \" |\"\n end\n puts \"----------------------------------------\"\n puts\nend", "title": "" }, { "docid": "01325cb70a9cae02df29388f502f2469", "score": "0.5057157", "text": "def expected_result(measure)\n (expected_results || {})[measure.key]\n end", "title": "" }, { "docid": "3faca84c062f072d105664997827ce78", "score": "0.50566286", "text": "def get_metrics_names(dataHash)\n metrics_names = dataHash.first.keys\n return metrics_names\nend", "title": "" }, { "docid": "280d86ff7b1abee11bcabe6e779237f3", "score": "0.5053114", "text": "def format_data\n str = \"Trial, Type, Time, Distance, Errors\\n\"\n \n @test_data.each do |trial|\n str << \"#{trial.join(', ')}\\n\"\n end\n \n str\n end", "title": "" }, { "docid": "21e840a2aa03b2aacdbb68837d28216f", "score": "0.50522786", "text": "def moe_names\n moe_name_set = []\n limit = @experiment.size > 1000 ? @experiment.size / 2 : @experiment.size\n @experiment.simulation_runs.where({is_done: true}, {fields: %w(result), limit: limit}).each do |simulation_run|\n moe_name_set += simulation_run.result.keys.to_a\n end\n\n moe_name_set.uniq\n end", "title": "" }, { "docid": "217271f8fb83afba799935f37fadad24", "score": "0.5051137", "text": "def report\n buf = []\n unless DvdProfiler2Xbmc.interrupted?\n unless @media_files.nil?\n buf += gen_report('duplicates', 'Duplicates')\n buf += gen_report('missing_isbns', 'Missing ISBNs')\n buf += gen_report('missing_imdb_ids', 'Missing IMDB IDs')\n buf += gen_report('missing_thumbnails', 'Missing Thumbnails')\n buf += gen_report('multiple_profiles', 'Multiple Profiles Found For Single Titles')\n end\n end\n buf\n end", "title": "" }, { "docid": "31654a2d1f096aa7a201092b5a6604e7", "score": "0.504538", "text": "def interesting_measure_ids\n @product.product_tests.measure_tests.map { |test| test.measure_ids.first } # Probably not the way we want to choose measures ~ Jaebird\n end", "title": "" }, { "docid": "31654a2d1f096aa7a201092b5a6604e7", "score": "0.504538", "text": "def interesting_measure_ids\n @product.product_tests.measure_tests.map { |test| test.measure_ids.first } # Probably not the way we want to choose measures ~ Jaebird\n end", "title": "" }, { "docid": "07c4533db9b0b49b8f962d8456dc1a78", "score": "0.50391454", "text": "def headers_with_frequency_code\n return self.headers.keys if self.headers.keys[0].split(\".\").count == 2\n return_array = Array.new\n frequency_code = \".A\" if self.frequency == :year\n frequency_code = \".M\" if self.frequency == :month\n frequency_code = \".Q\" if self.frequency == :quarter\n frequency_code = \".S\" if self.frequency == :semi\n frequency_code = \".W\" if self.frequency == :week\n \n arr = self.headers.sort {|a,b| a[1]<=>b[1]}\n arr.each do |elem|\n header_name = elem[0]\n return_array.push(header_name+frequency_code) unless header_name.nil?\n end\n \n return_array\n end", "title": "" }, { "docid": "9937ed42dbb0a6ceb45a39a04ce9a0c6", "score": "0.50376904", "text": "def scrapeResults(folder, specArray)\n tempResults = []\n File.open(File.join(folder, @dataFile)).each do |line|\n # split the line on spaces, the 2nd field should match one of the \n # fields in specArray if can use it\n fieldName = line.split(\" \")[1]\n if( specArray.index(fieldName) != nil ) \n rtemp = {}\n rtemp[:name] = fieldName\n # we should track what order in the spec this particular result is\n rtemp[:index] = specArray.index(fieldName)\n rtemp[:value] = line.split(\" \")[2]\n rtemp[:err] = line.split(\" \")[3]\n tempResults.push(rtemp)\n end\n end\n ## now we sort the results by their index\n tempResults.sort { |x,y| x[:index] <=> y[:index]}\n end", "title": "" }, { "docid": "7e25b83915edfff78dcb1f9bfd1e474f", "score": "0.5037499", "text": "def format_estimate_array\n\ttitles = reformat_titles\n\n\ttitles.map do |titles| \n\t\ttitles[:col_id].insert(-4, 'e')\n\n\t \tif titles[:col_id][-3] == \"0\" && titles[:col_id][-2] != \"0\"\n\t \t\ttitles[:col_id].slice!(-3)\n\t\telsif titles[:col_id][-3] == \"0\" && titles[:col_id][-2] == \"0\" \n\t\t\ttitles[:col_id].slice!(-3)\n\t\t\ttitles[:col_id].slice!(-2)\n\t\tend\n\tend\n\t\n\treturn titles\nend", "title": "" }, { "docid": "bb7805291123d907265dd52c69a3013a", "score": "0.50317657", "text": "def dc_header_for_result()\n c = ''\n actions = @form['result_set']['actions']\n c = '<th>&nbsp;</th>' unless actions.nil? or @form['readonly']\n# preparation for sort icon \n sort_field, sort_direction = nil, nil\n if session[@form['table']]\n sort_field, sort_direction = session[@form['table']][:sort].to_s.split(' ')\n end\n# \n if (columns = @form['result_set']['columns'])\n columns.each do |k,v|\n session[:form_processing] = \"result_set:columns: #{k}=#{v}\"\n th = '<th '\n v = {'name' => v} if v.class == String \n caption = v['caption'] || t(\"helpers.label.#{@form['table']}.#{v['name']}\")\n# no sorting when embedded documents or custom filter is active \n sort_ok = @form['result_set'].nil? || (@form['result_set'] && @form['result_set']['filter'].nil?)\n sort_ok = sort_ok || (@form['index'] && @form['index']['sort'])\n if @tables.size == 1 and sort_ok\n icon = 'sort lg'\n if v['name'] == sort_field\n icon = sort_direction == '1' ? 'sort-alpha-asc lg' : 'sort-alpha-desc lg'\n end \n th << \">#{dc_link_to(caption, icon, sort: v['name'], table: params[:table], formname: params[:formname], action: :index )}</th>\"\n else\n th << \">#{caption}</th>\"\n end\n c << th\n end\n end\n c.html_safe\nend", "title": "" }, { "docid": "99fc80f5c102fdd3f1ce378a9291917d", "score": "0.5031543", "text": "def report_header\n @report_header ||= [\"\\\"Probe\\\"\"].concat( header_arguments ).compact.join( \", \" )\n end", "title": "" }, { "docid": "179c4eaa7d07220c5e8f3a65b863f36e", "score": "0.5031276", "text": "def test_wd_st_004\n printf \"\\n+ Test 004\"\n open_diff_result_summary_page(1)\n assert is_text_present($diff_result_summary[\"all_table_header\"])\n (1..10).each do |i|\n assert_equal $diff_result_summary[\"all_table\"][i-1], @selenium.get_text($diff_result_summary_xpath[\"all_table_header\"]+\"[#{i}]\")\n end\n logout\n end", "title": "" }, { "docid": "fa9ed1400a7b594e1923e928ce59cf7d", "score": "0.50280935", "text": "def get_statistics\n output_data = [['Project name', 'Lines of Code', 'Duplicated Lines', 'Blocked Violations', 'Critical Violations', 'Major Violations', 'High Priority Code Violations']]\n sonar_dashboard_information.each do |item|\n output_data << item.to_a\n end\n output_data << []\n end", "title": "" }, { "docid": "458bf6d4e010f5aa4a2e1940101817a8", "score": "0.5025542", "text": "def details\n d = {}\n d['name'] = @custodian\n d['exportDuration'] = @duration\n @statistics[:export].each do |k, v|\n # fix case\n n = String.new(k)\n n[0] = n[0].downcase\n d[n] = v\n end\n d\n end", "title": "" }, { "docid": "8eab8e717c1c765c8276d773fd362c36", "score": "0.50192636", "text": "def rpmdiff_control_header\n '<tr><thead>\n <td>Run</td>\n <td>Score</td>\n <td>Package</td>\n <td>Old</td>\n <td>New</td>\n <td>Advisory</td>\n <td>Owner</td>\n <td>Date</td>\n </thead></tr>'.html_safe\n end", "title": "" }, { "docid": "4967993abc88422907d5f0d5eb5f9f47", "score": "0.501665", "text": "def parse_results (results, heading)\n message = \"#### #{heading}\\n\\n\"\n\n message << \"File | Line | Reason |\\n\"\n message << \"| --- | ----- | ----- |\\n\"\n\n results.each do |r|\n filename = r['file'].split('/').last\n line = r['line']\n reason = r['reason']\n\n message << \"#{filename} | #{line} | #{reason} \\n\"\n end\n\n message\n end", "title": "" }, { "docid": "11c348206867c208d009a68837236999", "score": "0.5016123", "text": "def test_display_results\n assert_output(\"After 527 days Prospector #667 returned to San Fransisco with:\\n\\t0 ounces of gold.\\n\\t0 ounces of silver.\\n\\tHeading home with $0.00\\n\") {@p.display_results 667, 527, 0, 0}\n \n end", "title": "" }, { "docid": "1a0189771a2eb77eba1e9e42f5cde8e7", "score": "0.50159675", "text": "def unexpected_response_report\n result_text = StringIO.new\n\n unless @unexpectedresponsefrom.empty?\n result_text.puts Util.colorize(:red, \"Unexpected response from:\")\n result_text.puts\n\n field_size = Util.field_size(@unexpectedresponsefrom, 30)\n fields_num = Util.field_number(field_size)\n format = \" #{\" %-#{field_size}s\" * fields_num}\"\n\n @unexpectedresponsefrom.sort.in_groups_of(fields_num) do |c|\n result_text.puts format % c\n end\n end\n\n result_text.string\n end", "title": "" }, { "docid": "1d7e8c5324195d48ccb980b4fb9705ad", "score": "0.5010447", "text": "def deliberation_report\n @deliberation.characteristics.keys.sort_by(&:to_s).map do |characteristic|\n statement = \"#{characteristic}: \"\n if report = @deliberation.report(characteristic)\n statement << report.quorum.name.humanize.downcase\n else\n statement << 'provided as input'\n end\n end.join ', '\n end", "title": "" }, { "docid": "eb1893de325f59b86e16edaabf8a22bd", "score": "0.50052035", "text": "def format_margin_of_error_array\n\ttitles = reformat_titles\n\n\ttitles.map do |titles| \n\t\ttitles[:col_id].insert(-4, 'm')\n\t\ttitles[:title].insert(0, 'moe_')\n\n\t \tif titles[:col_id][-3] == \"0\" && titles[:col_id][-2] != \"0\"\n\t \t\ttitles[:col_id].slice!(-3)\n\t\telsif titles[:col_id][-3] == \"0\" && titles[:col_id][-2] == \"0\" \n\t\t\ttitles[:col_id].slice!(-3)\n\t\t\ttitles[:col_id].slice!(-2)\n\t\tend\n\tend\n\n\treturn titles\nend", "title": "" }, { "docid": "862da901ad700b626b909cbad997435d", "score": "0.49976736", "text": "def expected_results_output_coaches \n results_output = [\n \"Greatest NFL Coaches in Super Bowl Era\",\n \"-----------------------------------------\",\n \"Current results (1486 votes):\\n\\n\",\n \"Bill Belichick: 55% (830)\",\n \"Joe Gibbs: 15% (232)\",\n \"Vince Lombardi: 14% (209)\", \n \"Chuck Noll: 10% (161)\",\n \"Tom Landry: 3% (54)\"\n ]\n return results_output\n end", "title": "" }, { "docid": "fd9f7a0cc849109d5afa1970e59fe4b4", "score": "0.49945995", "text": "def header\n temp = \"\"\n result = \"SpecId\\tLabel\\tCharge\\t\"\n \n nokogiriDoc(@target).xpath(\"//xmlns:SpectrumIdentificationItem\").each do |hit|\n temp = hit.xpath(\".//xmlns:cvParam\")\n break\n end\n \n temp.each do |score|\n result += score.xpath(\"./@name\").to_s + \"\\t\"\n end\n \n result += \"Peptide\\t\" + \"Proteins\"\n end", "title": "" }, { "docid": "7143863fed4a5cc1eea6c31c98bff700", "score": "0.49936488", "text": "def print_sales_report_header\n\tsales_report_header = []\n\tsales_report_header.push \" ##### ###### \"\n\tsales_report_header.push \"# # ## # ###### #### # # ###### ##### #### ##### #####\"\n\tsales_report_header.push \"# # # # # # # # # # # # # # # #\"\n\tsales_report_header.push \" ##### # # # ##### #### ###### ##### # # # # # # #\"\n\tsales_report_header.push \" # ###### # # # # # # ##### # # ##### #\"\n\tsales_report_header.push \"# # # # # # # # # # # # # # # # #\"\n\tsales_report_header.push \" ##### # # ###### ###### #### # # ###### # #### # # #\"\n\tsales_report_header.push \"********************************************************************************\"\n\treturn sales_report_header.join(\"\\n\")\nend", "title": "" }, { "docid": "cbdee16d4a77739e3a81791f71a613f4", "score": "0.4991978", "text": "def results\n @violations.each do |k,v|\n total = v[:total]\n earliest = DateTime.parse(v[:earliest])\n earliest_time = earliest.strftime('%I:%M:%S %p')\n latest = DateTime.parse(v[:latest])\n latest_time = latest.strftime('%I:%M:%S %p')\n if total > 1\n puts \"#{k} occurred #{total} times with the earliest occurrence on #{earliest.month}-#{earliest.day}-#{earliest.year} and latest occurrence on #{latest.month}-#{latest.day}-#{latest.year}.\"\n else\n puts \"#{k} occurred #{total} time with the earliest occurrence on #{earliest.month}-#{earliest.day}-#{earliest.year} and latest occurrence on #{latest.month}-#{latest.day}-#{latest.year}.\"\n end\n end\n end", "title": "" }, { "docid": "f30cdca7e83e02872068415dc77d47f6", "score": "0.4983959", "text": "def stats\n table_name = @tables.keys.sample\n table = @tables[table_name]\n\n column = table.defs.to_a.sample\n while String == column[1]\n column = table.defs.to_a.sample\n end\n\n column_idx = table.defs.keys.index column[0]\n\n values = table.data.map{ |r| r[column_idx].to_f }.sort\n\n # LLL.info values\n\n count = values.length\n mean = values.inject{ |memo, obj| memo + obj } / count\n\n midpoint = count / 2\n median = values[midpoint]\n\n squared_differences = values.map do |obj|\n d = mean - obj\n d * d\n end\n\n # LLL.info squared_differences\n\n stddev = Math.sqrt(squared_differences.sum / (count - 1))\n\n pseudo_expectation = [[\"stddev\".k, stddev],\n [\"median\".k, median],\n [\"count\".k, count],\n [\"mean\".k, mean]]\n\n got = evaluate([\"stats\".k, [\"table\".k, table_name],\n [\"row-lambda\".k, column[0].k]]).to_h\n\n pseudo_expectation.each do |x|\n assert_in_epsilon(x[1], got[x[0]])\n end\n end", "title": "" }, { "docid": "a3a96412329b82a9e0e807b6a10c22df", "score": "0.4979912", "text": "def results_breakdown_statement\n [ \"#{self.count(:tests)} tests, #{self.count(:results)} assertions\",\n self.to_sentence(self.ocurring_result_types.collect do |result_type|\n self.result_summary_msg(result_type)\n end)\n ].join(\", \")\n end", "title": "" }, { "docid": "bce18003ac635082b297b1e118c950e0", "score": "0.49733016", "text": "def theater_names\n my_movie_theaters = [self.display_a_sampler(0)[0],\n self.display_a_sampler(1)[0],\n self.display_a_sampler(2)[0]\n ]\n\n return my_movie_theaters\n end", "title": "" }, { "docid": "dcd07d4dbfbebbaa419e674b395b3929", "score": "0.49699482", "text": "def headers\n self.datacolumns.collect{|dc| dc.columnheader}\n end", "title": "" }, { "docid": "4bbe81facdb3883a3fa0548b04aa0ef8", "score": "0.49688214", "text": "def labels\n @report.demographics.map { |key, values| key if !values.blank? }.compact\n end", "title": "" }, { "docid": "c58afead609995499df47ecaec14a452", "score": "0.4961155", "text": "def charge_summary_table_headers\n charge_summary_table.headers_text\n end", "title": "" }, { "docid": "e301ceeb6d000a93a0937362aef65714", "score": "0.49582198", "text": "def pretty_print_export_header\n text = name\n text += \" (#{ unit })\" if unit.present?\n return text\n end", "title": "" }, { "docid": "62db9136f90af45551d0639dce755752", "score": "0.4951385", "text": "def test_wd_st_005\n printf \"\\n+ Test 005\"\n open_diff_result_summary_page(1)\n assert is_text_present($diff_result_summary[\"module_table_header\"])\n (1..10).each do |i|\n assert_equal $diff_result_summary[\"all_table\"][i-1], @selenium.get_text($diff_result_summary_xpath[\"module_table_header\"]+\"[#{i}]\")\n end\n logout\n end", "title": "" }, { "docid": "e641a496497e6e88f1bc2c5ecd8ce9c9", "score": "0.49500465", "text": "def rosa_facts\r\n rosa = Record.where(:first => 'Rosa').first\r\n\r\n\t [rosa.birthdate, \r\n\t rosa.measures[\"0002\"].first.second.first,\r\n rosa.measures[\"0073\"][\"diastolic_blood_pressure_physical_exam_finding\"].second[\"date\"],\r\n rosa.care_goals.first.time,\r\n rosa.vital_signs.first.time,\r\n rosa.laboratory_tests.second.time,\r\n rosa.encounters.second.time,\r\n rosa.conditions.first.time,\r\n rosa.procedures.second.time,\r\n rosa.medications.second.time,\r\n rosa.immunizations.second.time]\r\n end", "title": "" }, { "docid": "1a0b3cf22eb1866d77116587635cae04", "score": "0.4948417", "text": "def test_wd_st_006\n printf \"\\n+ Test 006\"\n open_diff_result_summary_page(1)\n assert is_text_present($diff_result_summary[\"file_table_header\"])\n (1..11).each do |i|\n assert_equal $diff_result_summary[\"file_table\"][i-1], @selenium.get_text($diff_result_summary_xpath[\"file_table_header\"]+\"[#{i}]\")\n end\n logout\n end", "title": "" }, { "docid": "57f6c98c0205e9914ed8683f8d430213", "score": "0.49465552", "text": "def md_results(**opt)\n # css = '.api-container'\n heading = 'Math Detective API Response Data' # TODO: I18n\n md_output_container('api', heading, **opt)\n end", "title": "" }, { "docid": "e2175e4c6ddcbc37382447437334995f", "score": "0.4941098", "text": "def get_headers\n headers = []\n @data.each do |druid, column_hash|\n headers << column_hash.keys\n end\n headers_out = headers.flatten.uniq\n end", "title": "" }, { "docid": "ce22a78c87b6d6f6a0a17e732a1005c9", "score": "0.49397326", "text": "def get_all_user_defined_measures\n # get all the ocde ids for the study\n study = Study.find(:first, :conditions=>[\"id=?\",self.study_id],:select=>[\"project_id\"])\n project_study_ids = Study.find(:all, :conditions=>[\"project_id=?\",study.project_id],:select=>[\"id\"])\n ocdes = OutcomeDataEntry.find(:all, :conditions=>[\"study_id IN (?)\",project_study_ids], :select=>[\"id\"])\n # get all associated user-defined measures\n measures = OutcomeMeasure.find(:all, :conditions=>[\"outcome_data_entry_id IN (?) AND measure_type = ?\",ocdes,0])\n uniq_measures = []\n title_array = []\n measures.each_with_index do |m,i|\n if !title_array.include?(m.title)\n uniq_measures << m\n title_array << m.title\n end\n end\n return uniq_measures\n end", "title": "" }, { "docid": "49329a37781cdcc8434fbcb79e532c93", "score": "0.49362656", "text": "def rpmdiff_list_header(with_reschedule = false)\n headers = [\n tablesort_heading_custom_sort_numeric('ID'),\n 'Status',\n 'Package',\n 'Old',\n 'New',\n 'Path',\n tablesort_heading_custom_sort_numeric('Date'),\n 'Person']\n headers << tablesort_heading_no_sort('Reschedule') if (\n with_reschedule && @reschedule_permitted)\n headers\n end", "title": "" }, { "docid": "f60d57d6bcbf01fe657bd24736577b01", "score": "0.4926634", "text": "def all_outputs\n amee_return_values.each do |rvd|\n output {\n path rvd.name\n default_unit rvd.unit\n default_per_unit rvd.perunit\n }\n end\n end", "title": "" }, { "docid": "2639707238eda21079661aa56edd0956", "score": "0.49261826", "text": "def print_results(results)\n SparkleMotion.logger.unknown { \"Results:\" }\n print_basic_stats(results)\n print_other_stats(results)\n end", "title": "" }, { "docid": "2b64159412ac546c52019e65c7cac0a0", "score": "0.49257454", "text": "def print_pdcsv_output(array=nil, filter='.*', exclude=nil)\n return if array.nil?\n @name_filter = filter\n @exclude_filter = exclude\n @output_type = 'PDCSV'\n @output_detail = 'brief'\n print_card_output(array)\nend", "title": "" }, { "docid": "20249d48d86eb2103eb6b2a82bbc2c41", "score": "0.49088788", "text": "def test_results\n Stats.test_results\n end", "title": "" }, { "docid": "2d0d07a5c8c75de6aae201188930c0ea", "score": "0.49082762", "text": "def results_list\n names = []\n results_table.wait_until_present\n results_table.rows.each { |row| names << row[POPULATION_NAME].text }\n names.delete_if { |name| name == \"\" }\n names.delete_if { |name| name == \"Name\" }\n names\n end", "title": "" }, { "docid": "fbcde03774dbe93f0f47197e5546f98b", "score": "0.49062288", "text": "def parse_results_for_xccdf(results)\n results.map do |result|\n data = {}\n data['status'] = result['status']\n data['code_desc'] = result['code_desc']\n data['run_time'] = result['run_time']\n data['start_time'] = result['start_time']\n data['resource'] = result['resource']\n data['message'] = result['message']\n data['skip_message'] = result['skip_message']\n data\n end\n end", "title": "" }, { "docid": "fbcde03774dbe93f0f47197e5546f98b", "score": "0.49062288", "text": "def parse_results_for_xccdf(results)\n results.map do |result|\n data = {}\n data['status'] = result['status']\n data['code_desc'] = result['code_desc']\n data['run_time'] = result['run_time']\n data['start_time'] = result['start_time']\n data['resource'] = result['resource']\n data['message'] = result['message']\n data['skip_message'] = result['skip_message']\n data\n end\n end", "title": "" }, { "docid": "ff4a85b4bcc5f22d66f5c4d91a8def68", "score": "0.4902084", "text": "def analyze_headers\n# @chron_list = nil\n chrons = []\n extractor.headers.each_with_index do |v, colnum|\n pv = ParsedValue.new(v)\n if !pv.chron.empty? then\n chrons << pv.chron.first\n if colnum < @ncolumns\n# puts \"Setting the column role to #{pv.chron.first}\"\n @columns[colnum].role = pv.chron.first\n end\n end\n end\n # p chrons\n# @chron_list = chrons unless chrons.empty?\n end", "title": "" } ]
81348be91725d09e801318391806c31a
Return Trainers that are nearby and have live kudomon
[ { "docid": "9d7ebc48359221f49e611e33549f2c42", "score": "0.798703", "text": "def challengeable_trainers\n other_trainers = Trainer.all.reject { |trainer| trainer == self }\n other_trainers.select do |trainer|\n trainer.nearby?(coordinates) && trainer.live_kudomon?\n end\n end", "title": "" } ]
[ { "docid": "1bc97dcd3e3b34aaf501464e22faef58", "score": "0.63523656", "text": "def trainees\n users = []\n ongoing_trainings.each do |t|\n users << t.user unless t.is_trainer?\n end\n users.sort { |a,b| User.sort_value(a) <=> User.sort_value(b) }\n end", "title": "" }, { "docid": "1d79b2c3d9ece0ba244087a00fac133f", "score": "0.6162708", "text": "def find_kudomons()\n kudomons = @game.kudomons\n nearby_kudomons = Array.new\n #from the list of kudomons, find the ones close to xpos, ypos\n kudomons.each {|k|\n if in_range?(SEARCH_RANGE, k)\n #k is in range\n nearby_kudomons << k\n end\n }\n return nearby_kudomons\n end", "title": "" }, { "docid": "03c9f5e8a1d5b89ed691556266ceedef", "score": "0.6077067", "text": "def get_nearby_locations(nelat, nelng, swlat, swlng, user_id)\n @locations = []\n Location.order(:latitude).each do |x|\n lat = x.latitude\n lon = x.longitude\n if @locations.length < 50\n if lat >= swlat.to_f and lat <= nelat.to_f\n if lon >= swlng.to_f and lon <= nelng.to_f\n follows = User.find(user_id).locations.exists?(x.id)\n @locations.append({:id=>x.id, :name=>x.name, :latitude=>lat, :longitude=>lon, :follows=>follows})\n end\n end\n end\n end\n end", "title": "" }, { "docid": "7d7ac12efc31d75754c446d99d8e6300", "score": "0.6063749", "text": "def nearby_volunteers(volunteers,latitude, longitude)\n @volunteers_seventy_five = @matched_volunteers\n # to remove duplicates from array\n @volunteers_fifty = @volunteers_seventy_five - @volunteers_fifty\n @seventy_five = false\n @hundred = false \n users = []\n volunteers.each do |volunteer|\n users << volunteer.id\n end\n # finde users geolacation to compare\n users = User.where(:id => users)\n matched_volunteers = users.near([latitude, longitude], 50, units: :km) # within 50 kilometres of user address\n\n if matched_volunteers.size > 0\n @matched_volunteers = matched_volunteers\n # to remove duplicates from array\n @volunteers_seventy_five = (@matched_volunteers - @volunteers_seventy_five)\n @hundred = true # 100% match\n else\n @seventy_five = true # 75% match\n end\n end", "title": "" }, { "docid": "45fca98a1f6945993ea504c987c563bc", "score": "0.59723073", "text": "def get_nearby_locations(nelat, nelng, swlat, swlng, user_id)\n places = Location.where(:latitude => swlat..nelat, :longitude => swlng..nelng)\n @locations = []\n places.each do |loc|\n loc_hash = loc.to_hash\n loc_hash[:follows] = User.find(user_id).locations.include? loc\n @locations << loc_hash\n end\n @locations.sort_by! do |loc|\n loc[:latitude]\n end\n @locations = @locations[0..49]\n end", "title": "" }, { "docid": "0ca153857cc820cc6e29e94113a7a36a", "score": "0.5963382", "text": "def get_nearby_locations(nelat, nelng, swlat, swlng, user_id)\n @locations = []\n Location.find(:all,:order => \"latitude ASC\").each do |loc|\n if loc.latitude.between?(swlat.to_f,nelat.to_f) and loc.longitude.between?(swlng.to_f,nelng.to_f)\n if Following_location.where(:user_id=>user_id,:location_id=>loc.id).empty?\n follow=false\n else follow=true\n end\n\tif @locations.length <50\n @locations.push({:id => loc.id, :name => loc.name, :latitude => loc.latitude, :longitude => loc.longitude, :follows => follow})\n else return\n end\n end\n end\n end", "title": "" }, { "docid": "06762e4bfd0863c756edd0fda7aed422", "score": "0.5962167", "text": "def get_nearby_locations(nelat, nelng, swlat, swlng, user_id)\n @locations = Location.where(\"latitude < #{nelat} and longitude < #{nelng} and latitude > #{swlat} and longitude > #{swlng}\").limit(50).order('latitude ASC')\n \n usr = User.find_by_id(user_id)\n @locations.each do |l|\n if l.in?(usr.locations)\n l[:follows] = true\n end\n end\n \n end", "title": "" }, { "docid": "35ef98cc41da149d2c215b29ce5a844f", "score": "0.59198225", "text": "def nearby_doctors\n self.nearbys.limit(20).collect{|a| a.id}.uniq\n end", "title": "" }, { "docid": "569c97b49343dc2b34322bcd97856490", "score": "0.5845523", "text": "def nonpermanent_freight?(train)\n train.distance < 6\n end", "title": "" }, { "docid": "fdb383a1b44dd0f2d715613bb83a05d7", "score": "0.58370364", "text": "def travelable_neighbors\n\t\tavailable = []\n\t\[email protected] do |key, val|\n\t\t\tavailable << @neighbors[key] unless val or @neighbors[key].nil?\n\t\tend\n\t\tavailable\n\tend", "title": "" }, { "docid": "3f9fb3ff521826b9d469d3c3f85bcc1c", "score": "0.58315545", "text": "def show\n @other_club_stations = @club.nearbys(25)\n # @other_stations = Location.near(params[:search], 50, :order => :distance)\n end", "title": "" }, { "docid": "4b7a7ca089eeb3e94c0cf8fd17b87ec7", "score": "0.58121085", "text": "def closest_friends\n nearbys(6371).sort_by {|friend| friend.distance_to(self, :km) }[0..2]\n end", "title": "" }, { "docid": "9fce283aba01e6a08878bd4bca018685", "score": "0.5806763", "text": "def show\n @nearest_stations = @rent_house.nearest_stations\n end", "title": "" }, { "docid": "64d2e1282cb18c4b3b129e7afa17a060", "score": "0.5802994", "text": "def find_trains_by_direction (direction, trains)\n train_list = []\n trains.each do |train|\n if train[:direction] == direction\n train_list << train\n end\n end\n return train_list\nend", "title": "" }, { "docid": "e73da12407984ce77218fa16c4a91cbb", "score": "0.580005", "text": "def near?(sitters)\n @sitters_near = []\n sitters.each do |sitter|\n if params[:user_address].present?\n if Geocoder::Calculations.distance_between(params[:user_address], sitter.user) < 20\n @sitters_near << sitter\n end\n else\n if Geocoder::Calculations.distance_between(current_user, sitter.user) < 20\n @sitters_near << sitter\n end\n end\n end\n return @sitters_near\n end", "title": "" }, { "docid": "b0bc8b97453a25ee78b73e187ebc214a", "score": "0.578944", "text": "def nearest_station\n #=== Instructions ===================================\n # Use the Divvy API to display all stations that have at least\n # 5 bikes available\n #\n # Bonus: Sort the stations by distance from a user-submitted\n # address\n #\n # Ref: http://www.divvybikes.com/stations/json/\n #================================================\n\n result = open(\"http://www.divvybikes.com/stations/json/\").read\n parsed_result = JSON.parse(result)\n @stations = []\n parsed_result['stationBeanList'].each do |stations_hash|\n if stations_hash['availableBikes'] >= 5\n @stations << \"#{stations_hash['stationName']} - #{stations_hash['availableBikes']} bikes\"\n end\n end\n end", "title": "" }, { "docid": "46c36f8f972fdba6cd7bb5c81d3b24ce", "score": "0.57886356", "text": "def nearby\n nearby_gps | nearby_bssids\n end", "title": "" }, { "docid": "abe5c64b157cdeea9f19138b1ec658da", "score": "0.57868886", "text": "def available_tours\n if vehicles.count > 1\n Tour.where(is_active: true)\n else\n Tour.where(is_active: true).where.not(tuktuk_price_cents: 0)\n end\n end", "title": "" }, { "docid": "0d0f06b1de56ea16b3730f0668e9d16a", "score": "0.57423365", "text": "def nearby?\n @_nearby.any?\n end", "title": "" }, { "docid": "0f8f2b289076c2f1f2cd8c1d5e4ebde1", "score": "0.5738487", "text": "def get_nearby(place, kms)\n high = place[\"distance\"].to_i + kms.to_i\n low = place[\"distance\"].to_i - kms.to_i\n query = TokyoCabinet::TDBQRY.new(db)\n query.addcond(\"distance\", TokyoCabinet::TDBQRY::QCNUMBT, \"#{low} #{high}\")\n ids = query.search\n ids.collect { |i| db.get(i) }.select { |r|\n Nearby.haversine_distance(place[\"latitude\"], place[\"longitude\"], r[\"latitude\"], r[\"longitude\"]) < kms\n }\n end", "title": "" }, { "docid": "037b1650666afd614f7565564c759821", "score": "0.5724971", "text": "def trips_within(meters)\n f = distance(:from)\n t = distance(:to)\n trips_with_distance.where{(f + t <= meters)}.exclude(:id => self.id).all\n end", "title": "" }, { "docid": "c275212b4bf06708be482fcba479a60d", "score": "0.5706066", "text": "def nearby_users(distance_in_km=10)\n result = Hash.new\n # distance_in_km = distance_in_km || 10\n if (self.longitude && self.latitude )\n # sw_ne_points = LacticLocationHelper.bounding_box([self.latitude,self.longitude],distance_in_km)\n sw_ne_points = bounding_box([self.latitude,self.longitude],distance_in_km)\n # result = PostgresUserInfos.locations_nearby(sw_ne_points)\n result = pg_locations_nearby(sw_ne_points)\n end\n result\n\n end", "title": "" }, { "docid": "7deb18c21a19891d85cd30a970444f98", "score": "0.56810087", "text": "def nearby\n end", "title": "" }, { "docid": "075c24180f92614fa4bccb4ee901221e", "score": "0.5660421", "text": "def trainers()\n self.contracts().map() { | contract | contract.trainer }\n end", "title": "" }, { "docid": "a5bdbe179b863e71db3ae3d9dcfefb48", "score": "0.56557167", "text": "def nearby_contractors\n Contractor.approved.near(self, 200)\n end", "title": "" }, { "docid": "678890035a79c7f554bdf1542aea40d8", "score": "0.56491196", "text": "def trains_for_city()\n\n returned_trains = DB.exec(\"SELECT train_name FROM stops WHERE city_name = '#{@name}';\")\n trains = []\n returned_trains.each do |train|\n trains.push(train.fetch(\"train_name\"))\n end\n trains\n\n end", "title": "" }, { "docid": "0aab6d41f5b491ed970ce31a1888b337", "score": "0.56404614", "text": "def get_nearby_locations(nelat, nelng, swlat, swlng, user_id)\n @locations = []\n listOfLocations = Locations.where(\"longitude >= ?\", swlng).where(\"longitude <= ?\", nelng).where(\"latitude >= ?\", swlat).where(\"latitude <= ?\", nelat).limit(50)\n listOfLocations.each do |location|\n userLocation = (ActiveRecord::Base.connection.execute(\"SELECT * from Userslocations where locations_id = #{location[\"id\"]} AND users_id = #{user_id}\"))\ntempHash = {:id=>location[:id], :name=>location[:name], :latitude=>location[:latitude], :longitude=>location[:longitude]}\n\t if userLocation.size >= 1\n\t\t\ttempHash.merge!( {:follows=>true} )\n\t\telse\t\t\n\t\t\ttempHash.merge!( {:follows=>false} )\n\t\tend\t\t\n\t\t@locations << tempHash\n end\n nil\n end", "title": "" }, { "docid": "b7e11f3c25e78bb972ca8731a617afc3", "score": "0.5638909", "text": "def live_orders() orders.select {|o| o.live_university_at?} end", "title": "" }, { "docid": "f8dbe5d515b20451f9ce46119a789527", "score": "0.56213987", "text": "def get_available_trips\n start_f =start_time.to_f\n end_f = end_time.to_f\n erg = []\n\n Trip.all.each do |t|\n if t.start_time.to_f.between?(start_f, end_f) and \n ((Geocoder::Calculations.distance_between [t.starts_at_N, t.starts_at_E], \n [starts_at_N, starts_at_E], :units => :km) <= self.start_radius) and\n ((Geocoder::Calculations.distance_between [t.ends_at_N, t.ends_at_E], \n [ends_at_N, ends_at_E], :units => :km) <= self.end_radius) and \n (!self.baggage and !t.baggage or t.baggage) and\n !self.user.ignorings.include?(t.user)\n then erg << t\n end\n end\n return erg\n end", "title": "" }, { "docid": "977c15fec82d52fa69e69f7e8bc74be7", "score": "0.5616858", "text": "def trainers\n self.lessons.map{|l| l.trainer.name}\n end", "title": "" }, { "docid": "396217c4557ebf3c41831fa1fca3862a", "score": "0.559687", "text": "def trips\n Trip.all.select do |trip|\n trip.landmark == self\n end\n end", "title": "" }, { "docid": "0799565ff89e2d47e264f746a18e9961", "score": "0.55832726", "text": "def near_winners\n result = {\n set: [],\n match: []\n }\n first = object.first_team\n second = object.second_team\n last_set_var = object.last_set\n if first && second && last_set_var\n add_near_winner first, last_set_var, result\n add_near_winner second, last_set_var, result\n end\n\n result\n end", "title": "" }, { "docid": "d18534c74995854b3b248d48f4fc99fa", "score": "0.55817866", "text": "def trainings\n end", "title": "" }, { "docid": "c407f8524eb3cd32f7c0990ea0b2fc7a", "score": "0.55727607", "text": "def players_near_me\n users = []\n\n my_courts.each do |court|\n users_near_court(court).each do |user|\n users << user unless user == current_user\n end\n end\n\n return users.uniq\n end", "title": "" }, { "docid": "41909a8e43509056c556860b5070d121", "score": "0.5571558", "text": "def catchable_kudomon\n free_kudomon = Kudomon.free.select { |k| k.nearby?(coordinates) }\n free_kudomon.reject { |k| already_has?(k.species) }\n end", "title": "" }, { "docid": "7342db6af85135ab628608900227143a", "score": "0.5569298", "text": "def get_arrival_times_by_uid\n\troutes_with_arrivals = []\n\[email protected] do |route|\n\t\t# Get all uids for the stations listed in the route\n\t\tall_objects = check_stations_on_route route[:stations]\n\n\t\t# Get the train object for just the uid we want\n\t\tall_objects.each do |train|\n\t\t\tif (train[:uid] == route[:uid])\n\t\t\t\troutes_with_arrivals.push(train)\n\t\t\tend\n\t\tend\n\tend\n\treturn routes_with_arrivals\nend", "title": "" }, { "docid": "de9aa73875ca6239db09b1e37546c02d", "score": "0.55511683", "text": "def near_servers(candidates = [])\n return candidates if candidates.empty?\n nearest_server = candidates.min_by(&:average_round_trip_time)\n threshold = nearest_server.average_round_trip_time + (local_threshold * 1000)\n candidates.select { |server| server.average_round_trip_time <= threshold }.shuffle!\n end", "title": "" }, { "docid": "40eb01528144fd094e4c5ce2920b082e", "score": "0.55496526", "text": "def nearby_users(distance: 1.0)\n self.class.nearby(self, distance: distance)\n end", "title": "" }, { "docid": "ce2ec628c2b9284b38365242214fbc92", "score": "0.5543925", "text": "def search\n customers = []\n @locations.each do |user_location|\n distance = DistanceCalculator.new(@home_latitude, @home_longitude, user_location[\"latitude\"], user_location[\"longitude\"]).distance_between_2_points\n customers << user_location if distance <= @within_radius\n end\n customers.sort! {|x,y| x[\"user_id\"] <=> y[\"user_id\"] }\n end", "title": "" }, { "docid": "500720679574eaa0f7418273c1345029", "score": "0.5543472", "text": "def train_search(direction, trains)\n trains_in_this_direction = []\n trains.each do |train|\n train.each do |key, value|\n if train[:direction] == direction\n trains_in_this_direction << train[:train]\n return \"Trains in this direction: #{trains_in_this_direction}\"\n end\n end\n end\nend", "title": "" }, { "docid": "a4fcd081076530bbab16c28bec30fa89", "score": "0.5542069", "text": "def get_nearby_locations(nelat, nelng, swlat, swlng, user_id)\n # @locations = ActiveRecord::Base.connection.execute(\"SELECT * FROM locations L WHERE L.latitude BETWEEN \" +swlat + \"AND \" + nelat +\"AND L.longitude BETWEEN \"+swlng +\"AND \"+nelng+ \"LIMIT 5 ORDER BY L.latitude ASC\")\n locs = Location.where(:latitude => swlat.to_f..nelat.to_f, :longitude => swlng.to_f..nelng.to_f).order(\"latitude ASC\").limit(50)\n num = 0\n locations = []\n if not locs or locs.empty?\n \tlocs = []\n else\n \tlocs.each do |entry|\n \tfollowed = Follow.where(:location_id => entry[:id], :user_id => user_id)\n\t\t locations[num] = {:id => entry[:id], :name => entry[:name], :latitude => entry[:latitude], :longitude => entry[:longitude], :follows => false}\n \tif(not followed.empty?)\n \t locations[num][:follows] = true\n \tend\n \t num+=1\n end\n end\n @locations = locations\n end", "title": "" }, { "docid": "f5ec6fec28460daf6ebb1ddd1319fc86", "score": "0.553585", "text": "def index\n @stations = Station.near([params[:latitude], params[:longitude]], params[:radius], units: :km)\n @stations = @stations.where('available_bikes > 0') unless params[:empty] == 'true'\n end", "title": "" }, { "docid": "c3e397310afaa46f6484b09207f9e532", "score": "0.5531235", "text": "def nearby\n lat, lon = find_location\n if lat and lon\n ts_deals = Deal.filtered_search(:lat => lat, :lon => lon, :range => Deal::MAX_RANGE*2).compact.first(6)\n @deals = Array.new\n ts_deals.map do |deal|\n if deal.hidden == false\n @deals.push deal\n end\n end\n else\n @deals = []\n end\n \n render layout: false\n end", "title": "" }, { "docid": "59ec63bf44fdca5b1f0c0c67686def40", "score": "0.552211", "text": "def trips\n Trip.all.select do |trip|\n trip.landmark == self\n end\n end", "title": "" }, { "docid": "3a3b0b5a314db189847f5542fc5f041d", "score": "0.5511268", "text": "def parse_nearby(response)\n min_rating = 3\n # min_places = 1 if !params[:min_places]\n\n places = response[\"results\"]\n\n #places.select { |place| place[\"rating\"] > min_rating if place[\"rating\"]}\n end", "title": "" }, { "docid": "830e7113308382b3ec5cf0f89191071b", "score": "0.54850245", "text": "def near(max_meters=0)\n\t\tplaces=[]\n\t\tPlace.near(@location, max_meters).each do |p| \n places.push(Place.new(p))\n end\n return places\n\tend", "title": "" }, { "docid": "840cb4dd88a4d389da470d80eb93c998", "score": "0.5452522", "text": "def clients \n Client.all.select {|client| client.trainer == self}\n end", "title": "" }, { "docid": "86dc66bbe721e27dec96e7b4673a7c97", "score": "0.5450849", "text": "def check_stations_on_route route_array\n\ttrainsList = []\n\n\t# Make train objects for each station in route_array\n\troute_array.each do |curStation|\n\t\tdepartures = make_train_objects curStation\n\n\t\tdepartures.each do |departure|\n\t\t\t# New station for route\n\t\t\tnewStation = {\n\t\t\t\t:name => departure[:next_stop],\n\t\t\t\t:arrival_time => departure[:arrival_time]\n\t\t\t\t#:estimate_mins => departure[:estimate_mins]\n\t\t\t}\n\n\t\t\t# Check station seen before\n\t\t\tseenBefore = false\n\t\t\ttrainsList.each do |train|\n\t\t\t\tif (train[:uid] == departure[:uid])\n\t\t\t\t\t# Add station and time to existing item if seen before\n\t\t\t\t\tseenBefore = true\n\n\t\t\t\t\ttrain[:stations].push(newStation)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\t# Add to array if never seen before\n\n\t\t\tif !seenBefore\n\t\t\t\ttrainsList.push({\n\t\t\t\t\t:uid => departure[:uid],\n\t\t\t\t\t:origin => departure[:origin],\n\t\t\t\t\t:destination => departure[:destination],\n\t\t\t\t\t:stations => [newStation]\n\t\t\t\t})\n\t\t\tend\n\t\t\t#puts trainsList[trainsList.length-1]\n\n\t\tend\n\tend\n\treturn trainsList\nend", "title": "" }, { "docid": "e7e7a741a56d91baa227dee4701ea22e", "score": "0.54503006", "text": "def show_wagons_by_train\n if @trains.empty?\n trains_or_wagons_void\n else\n request_info = [\"Введите номер поезда: [#{@trains.keys.join(', ')}]: \"]\n getting_info(request_info, :validate_train_for_wagons_show, :show_wagon)\n end\n end", "title": "" }, { "docid": "89b47b4a2b58bd0ea3d82ec22c8f5d74", "score": "0.54391366", "text": "def users_near_court(court)\n users = User.where.not(latitude: nil, longitude: nil)\n p users\n users.select do |user|\n Court.near(user.address, user.radius).include?(court)\n end\n end", "title": "" }, { "docid": "10f5d4c9c1ffeaa1e36312fa8ddaaab4", "score": "0.5431443", "text": "def tourists\n self.trips.collect do |trip|\n trip.tourist\n end\n end", "title": "" }, { "docid": "72a2c214169b0bd7c45043d1d4636323", "score": "0.5421287", "text": "def index\n user = User.find_by_id(params[:user_id])\n colleagues = user.group.users.ids\n @trips = Trip.where(source: user.home_place, destination: user.work_place, driver: colleagues)\n @trips = @trips.where('departure_time > ? and seat > 0', DateTime.now)\n end", "title": "" }, { "docid": "6e70c38901257e2948abe81a53a63b18", "score": "0.54137343", "text": "def get_nearby_locations(nelat, nelng, swlat, swlng, user_id)\n @locations = []\n end", "title": "" }, { "docid": "bcc5ddbec9b2f76ac49188e5e6d77d2b", "score": "0.5411535", "text": "def index\n @nearest_stations = NearestStation.all\n end", "title": "" }, { "docid": "015f85ce1363b67d0c1132eae3188396", "score": "0.5407946", "text": "def near(point, distance)\n customers.find_all { |customer| customer.distance_to(point) <= distance }.sort_by(&:user_id)\n end", "title": "" }, { "docid": "a0391cde791f45712133f9887bb1bb0d", "score": "0.540634", "text": "def accessible?(departure_time)\n accessible_stations = [\n\n # CTA BROWN LINE\n \"Kimball\", \"Kedzie-Brown\", \"Francisco\", \"Rockwell\", \"Western-Brown\", \"Damen-Brown\",\n \"Montrose\", \"Irving Park\", \"Addison-Brown\", \"Paulina\", \"Southport\", \"Belmont\",\n \"Wellington\", \"Diversey\", \"Fullerton\", \"Armitage\", \"Sedgwick\", \"Chicago-Brown\",\n \"Merchandise Mart\", \"Washington/Wells\", \"Harold Washington Library-State/Van Buren\",\n \"Clark/Lake\",\n\n # CTA BLUE LINE\n \"O’Hare\", \"Rosemont\", \"Cumberland\", \"Harlem (O'Hare)\", \"Jefferson Park\", \"Logan Square\",\n \"Western (O’Hare)\", \"Clark/Lake\", \"Jackson-Blue\", \"UIC-Halsted\",\n \"Illinois Medical District (Damen Entrance)\", \"Kedzie-Homan\", \"Forest Park\",\n\n # CTA GREEN LINE\n \"Ashland/63rd\", \"Halsted\", \"Cottage Grove\", \"King Drive\", \"Garfield\", \"51st\", \"47th\",\n \"43rd\", \"Indiana\", \"35th-Bronzeville-IIT\", \"Roosevelt\", \"Clark/Lake\", \"Clinton\",\n \"Morgan-Lake\", \"Ashland\", \"California\", \"Kedzie-Green\", \"Conservatory-Central Park Drive\",\n \"Pulaski\", \"Cicero\", \"Laramie\", \"Central\",\"Harlem/Lake (via Marion entrance)\",\n\n # CTA ORANGE LINE\n \"Midway\", \"Pulaski\", \"Kedzie-Orange\", \"Western-Orange\", \"35/Archer\", \"Ashland\", \"Halsted\", \"Roosevelt\", \"Harold Washington Library-State/Van Buren\",\n \"Harold Washington Library-State/Van Buren\", \"Washington/Wells\", \"Clark/Lake\",\n\n # CTA PINK LINE\n \"54th/Cermak\", \"Cicero\", \"Kostner\", \"Pulaski\", \"Central Park\", \"Kedzie-Pink\", \"California\",\n \"Western-Pink\", \"Damen-Pink\", \"18th\", \"Polk\", \"Ashland\", \"Morgan-Lake\", \"Clinton\", \"Clark/Lake\",\n \"Harold Washington Library-State/Van Buren\", \"Washington/Wells\",\n\n # CTA PURPLE LINE\n \"Belmont\", \"Wellington\", \"Diversey\", \"Fullerton\", \"Armitage\", \"Sedgwick\", \"Chicago-Purple\",\n \"Merchandise Mart\", \"Clark/Lake\", \"Harold Washington Library-State/Van Buren\",\n \"Washington/Wells\",\n\n # CTA RED LINE\n \"Howard\", \"Loyola\", \"Graville\", \"Addison-Red\", \"Belmont\", \"Fullerton\", \"Chicago-Red\", \"Grand\", \"Lake\",\n \"Jackson-Red\", \"Roosevelt\", \"Cermak-Chinatown\", \"Sox-35th\", \"47th\", \"Garfield\", \"63rd\",\n \"69th\", \"79th\", \"87th\", \"95th/Dan Ryan\",\n\n # CTA YELLOW LINE\n \"Howard\", \"Oakton-Skokie\", \"Dempster-Skokie\",\n ]\n\n # Logic to filter out any unaccessible routes\n accessible_directions = []\n self.directions?(departure_time).each do |direction|\n accessible = true\n direction['route'].each do |route|\n case route['vehicle_type']\n when 'SUBWAY'\n can_depart = accessible_stations.include?(route['departure_stop_name'])\n can_arrive = accessible_stations.include?(route['arrival_stop_name'])\n unless can_depart and can_arrive\n accessible = false\n break\n end\n end\n end\n \n accessible_directions << direction if accessible\n end\n\n accessible_directions\n end", "title": "" }, { "docid": "abeeb5853dd4039afc89c06e3a9bdbb5", "score": "0.5404487", "text": "def get_stations_near(city, max=50)\n Yesradio::search_stations :loc => city, :max => max\nend", "title": "" }, { "docid": "11a7305b619b5e1171f8535c30c5ef9f", "score": "0.5402955", "text": "def neighbors\n city_roads.keys\n end", "title": "" }, { "docid": "5f8da3adebcd4398722704c2143fe7d0", "score": "0.53953177", "text": "def filter_meters()\n meter_list = Meter.all #may not do this\n meters = []\n \n @currentLocation = Location.last\n\n if @currentLocation == nil\n loc = Location.new\n loc.lat = 49.2496600\t\n loc.lon = -123.1193400 \n @currentLocation = loc\n end\n \n current_lat = @currentLocation.lat\n current_lon = @currentLocation.lon\n\n meter_list.each do |m|\n m_lat = m.lat\n m_lon = m.lon\n\n if m_lat != nil && m_lon != nil\n distance = Location.get_distance_between_in_km(current_lat, current_lon, m_lat, m_lon)\n if distance <= 0.4\n meters.push(m)\n end\n end\n\n end\n\n return meters\n\n end", "title": "" }, { "docid": "3e07c07c40521150d5d041462c95e8c0", "score": "0.5362357", "text": "def get_nearby_locations(nelat, nelng, swlat, swlng, user_id)\n near_query = \"SELECT L.id AS id,\n L.name AS name,\n L.latitude AS latitude,\n L.longitude AS longitude\n FROM locations L\n WHERE L.latitude < #{nelat} AND L.latitude > #{swlat} AND\n L.longitude < #{nelng} AND L.longitude > #{swlng}\n\t\t ORDER BY L.latitude ASC\n\t\t LIMIT 50\"\n results = ActiveRecord::Base.connection.execute(near_query)\n\n @locations = []\n results.each do |row|\n follows_query = \"SELECT *\n FROM follows F\n WHERE F.location_id = #{row[\"id\"]} AND\n F.user_id = #{user_id}\"\n follows_res = ActiveRecord::Base.connection.execute(follows_query)\n @locations.push({\n :id => row[\"id\"],\n :name => row[\"name\"],\n :latitude => row[\"latitude\"],\n :longitude => row[\"longitude\"],\n :follows => !follows_res.empty?\n })\n end\n end", "title": "" }, { "docid": "42f8bbe7a375e1dc43e3d18b8f9e923c", "score": "0.53606504", "text": "def viewers m\r\n \tviewers_m=Array.new\r\n @training_set.each do |u,m1|\r\n \tif m1.keys & [m]==[m]\r\n viewers_m+=[u]\r\n end# end if \r\n end # end do \r\n return viewers_m\r\n end", "title": "" }, { "docid": "fd22b01fd1b2bc6f09db5c25c94b29c2", "score": "0.535935", "text": "def is_06mi_nearby?(user_lat, user_long, bus_lat, bus_long)\n # Max distance in degrees, approx 0.6 miles\n max_distance = 0.01\n difference_latitudes = user_lat - bus_lat.to_f\n difference_longitudes = user_long - bus_long.to_f\n distance = Math.sqrt(difference_latitudes**2 + difference_longitudes**2)\n distance <= max_distance\n end", "title": "" }, { "docid": "d76b6bfa1dfa6d79e51810598cb9e904", "score": "0.53592426", "text": "def trips\n Trip.all.select do |trip|\n trip.tourist == self\n end\n end", "title": "" }, { "docid": "e7e7ee9d8eefcc7c028cc42a6091fbcc", "score": "0.53528047", "text": "def get_closest_stops latlng, cnt=10\n begin\n db = TTC::Database.new($database_url)\n stops = db.get_stops\n \n stops.sort! do |a, b|\n latlng.distance_to(a.position) <=> latlng.distance_to(b.position)\n end\n \n ensure\n db.disconnect\n end\n \n stops[0...cnt]\nend", "title": "" }, { "docid": "ead39af8e2f5a2d0bc843414520b69d0", "score": "0.5342983", "text": "def greatminds\n # all minds that\n @completed_minds = Mind.completed_minds\n\n public_minds = Mind.\n # are public\n where(:public => true)\n # have >= 5 neurons\n\n finished_public_minds = public_minds.select {|mind| mind.neurons.size == 4}\n # have >= 5 neurons\n \n @great_minds = finished_public_minds.sort_by {|finished_mind| finished_mind.upvote.count}.reverse\n \n end", "title": "" }, { "docid": "6d0d2030fc1c18de9c712d645a6c79da", "score": "0.53427625", "text": "def train_finder (trains_input, direction)\n trains_output = []\n trains_input.each do |train|\n if train[:direction] == \"#{direction}\"\n trains_output.push(train[:train])\n end \n end\n return trains_output\nend", "title": "" }, { "docid": "bb7ab953b64cf990a8309dac31161d09", "score": "0.5339732", "text": "def nearby_metro_stops\n return Ratp::Stop.none if !latitude.present? or !longitude.present?\n\n Rails.cache.fetch ['Place#nearby_metro_stops', self] do\n Ratp::Stop.near([latitude, longitude], METRO_STOP_MAX_DISTANCE, units: :km)\n end\n end", "title": "" }, { "docid": "f4476e1feca12457bedfa674e145893b", "score": "0.5335925", "text": "def all_units_for_user(user)\n my = Unit.select_alive_by_user(user)\n visible = {}\n visible.merge! my\n my.each do |my_unit_id, my_unit|\n Unit.each do |id, other_unit|\n if my_unit.spotted? other_unit\n visible[id] = other_unit\n end\n end\n end\n visible\n end", "title": "" }, { "docid": "6669ffa7ed30d4e03f9b0afd18205ecc", "score": "0.5333382", "text": "def search_guests\n guests = []\n @locations.each do |user_location|\n distance = DistanceCalculator.new(@office_latitude, @office_longitude, user_location[\"latitude\"], user_location[\"longitude\"]).distance_between_2_points\n guests << user_location if distance <= @radius_range\n end\n guests.sort! {|k,v| k[\"user_id\"] <=> v[\"user_id\"] }\n end", "title": "" }, { "docid": "fed41b4ae0e8f6c8756dd1223c9130d8", "score": "0.5325799", "text": "def theaters\n results = showings.map do |showing|\n showing.theater\n end\n results.uniq\n end", "title": "" }, { "docid": "29d753b5c9fcd62f32ded140b7f5b655", "score": "0.53215814", "text": "def next_trains\n trains.select { |train| train.type.equal? next_train_type }\n end", "title": "" }, { "docid": "1653b455b0aeea6e43da9558ca034c79", "score": "0.53187394", "text": "def clients()\n Client.all().select() { | client | client.trainer == self }\n end", "title": "" }, { "docid": "e584448bfb7864f3a72c406b781204e5", "score": "0.53045195", "text": "def get_north_trains(array)\n trains_north = []\n array.each do |item|\n if item[:direction] == \"north\"\n trains_north.push item[:train]\n end\n end\n return trains_north\nend", "title": "" }, { "docid": "8c2240bf5c61c17ebf78a3e0ee0c7508", "score": "0.53021145", "text": "def get_closest_vehicles latlng, route=nil, cnt=10\n begin\n db = TTC::Database.new($database_url)\n vehicles = db.get_vehicle_locations route\n \n vehicles.sort! do |a, b|\n latlng.distance_to(a.position) <=> latlng.distance_to(b.position)\n end\n ensure\n db.disconnect unless db.nil?\n end\n \n vehicles[0...cnt]\nend", "title": "" }, { "docid": "1a4e47eaeadf0b9d856622172ce3a653", "score": "0.52944124", "text": "def trains_direction(trains, direction)\n trains_list = []\n trains.each do |train|\n if train[:direction] == direction\n trains_list.push(train[:train])\n end\n end\n return trains_list\nend", "title": "" }, { "docid": "8f5dc8480fb4830ac63571627a47bfd6", "score": "0.52852476", "text": "def results\n Unit.near(near).available(start_at, end_at) if valid?\n end", "title": "" }, { "docid": "72abec7a94bf54a485da0d90b006c80c", "score": "0.5282519", "text": "def find_kudomon(trainer)\n trainer == @challenger ? @challenger_kudomon : @defender_kudomon\n end", "title": "" }, { "docid": "a750dd9002fca1b1fdc29ca34f89661f", "score": "0.5278554", "text": "def moonwalkers\n @users = User.all.select { |user| user.moonwalker? }\n end", "title": "" }, { "docid": "9699972405860229c9e68df10c7b2b2d", "score": "0.5270163", "text": "def nearest_city\n Traveler.cities.min_by { |city| self.distance_to city }\n end", "title": "" }, { "docid": "a89f52af052c8cbe439d8172dadb9a69", "score": "0.5260767", "text": "def trips\n Trip.all.select do |trip|\n trip.tourist == self\n end\n end", "title": "" }, { "docid": "5259e65496c42e0da5aeab55eb4f6261", "score": "0.52501357", "text": "def near_nodes(candidates = [])\n return candidates if candidates.empty?\n nearest_node = candidates.min_by(&:ping_time)\n max_latency = nearest_node.ping_time + acceptable_latency\n near_nodes = candidates.select { |node| node.ping_time <= max_latency }\n near_nodes.shuffle!\n end", "title": "" }, { "docid": "e6fee6250509178f57cc8d27d36c9545", "score": "0.5246825", "text": "def index\n @places = Place.where(online: true).or(Place.where(author: current_user))\n end", "title": "" }, { "docid": "d4dcc52ae25ef50e1d3438b5b5beebe0", "score": "0.52410734", "text": "def choose_nearest(door, plan, passengers)\n occupied, unoccupied = occupied_and_not(plan, passengers)\n \n unoccupied.min_by { |s| manhattan_distance(door, s) }\nend", "title": "" }, { "docid": "a83fc7d3e4a5b4cb909e5307ca609c4f", "score": "0.52348804", "text": "def nearest_station latitude, longitude\n\t\tget_bike[\"stations\"][\"station\"].min_by(3) { |s| Haversine.distance([latitude.to_f, longitude.to_f],[s[\"lat\"].to_f,s[\"long\"].to_f]).to_miles }\n\tend", "title": "" }, { "docid": "243c83450c5ac2fc6ca644f4ae3584a4", "score": "0.5231996", "text": "def filter_by_distance\n return @spots unless @params[:lat].present? && @params[:lng].present? &&\n @params[:distance].present?\n @spots.nearest(@params[:lat], @params[:lng], @params[:distance])\n end", "title": "" }, { "docid": "61acf193aa54005a34a524868970e1dd", "score": "0.5230078", "text": "def listings\n Trip.all.select do |trip|\n trip.guest == self\n end\n end", "title": "" }, { "docid": "ccbf45b1c7ea9181fed9ed5dc6c7198e", "score": "0.52241844", "text": "def get_neighbors()\n @neighbors\n end", "title": "" }, { "docid": "aa97dbb15231ed9bd38f957c4490ed43", "score": "0.52240914", "text": "def viewers(m)\n\t\tviewers_array = []\n\t\t@training_data.each do |user, movie|\n\t\t\tif movie.keys.include?(m.to_s)\n\t\t\t\tviewers_array.push(user)\n\t\t\tend\n\t\tend\n\t\treturn viewers_array\n\tend", "title": "" }, { "docid": "71f11782c045aac5b51ac5dd67ac489b", "score": "0.52220905", "text": "def active_trips\n all_trips.select do |listing|\n listing.check_in >= current_time\n end\n end", "title": "" }, { "docid": "e94b8deec0a54725431456586c7a9bed", "score": "0.52165073", "text": "def get_list_of_trains_by_direction(trains, direction)\n\n trains.each do |train|\n if train[:direction] == direction\n puts \"Train #{train[:train]} is heading #{direction}\"\n end\n end\n\nend", "title": "" }, { "docid": "8983572667295f5bfa11b8bad540572a", "score": "0.5213303", "text": "def index\n @venues = Venue.all\n @venues_near_me = Venue.where(location: current_user.location).find_each\n end", "title": "" }, { "docid": "40da1e71163cd1e479070dea3eab7bd7", "score": "0.5210931", "text": "def trending_up\n today_from = Time.now - ((60 * 60) * 6)\n today_to = Time.now\n\n yesterday_from = (Time.now - (60 * 60 * 24)) - ((60 * 60) * 6)\n yesterday_to = (Time.now - (60 * 60 * 24))\n \n today_mentions = Mention.find(:all, :conditions => {:city_id => self.id, :mentioned_at => (time_string_builder(today_from)..time_string_builder(today_to))})\n yesterday_mentions = Mention.find(:all, :conditions => {:city_id => self.id, :mentioned_at => (time_string_builder(yesterday_from)..time_string_builder(yesterday_to))})\n \n today_mentions.length > yesterday_mentions.length\n end", "title": "" }, { "docid": "0913c5e22af6c2c9c1da274c3dc0326a", "score": "0.5209515", "text": "def index\n @tokimons = Tokimon.all\n @trainers = Trainer.all\n end", "title": "" }, { "docid": "0ea69c99d86391c4cb645327582775b8", "score": "0.52061564", "text": "def get_east_trains(array)\n trains_east = []\n array.each do |item|\n if item[:direction] == \"east\"\n trains_east.push item[:train]\n end\n end\n return trains_east\nend", "title": "" }, { "docid": "43b648812032415c05b261a9de733c0c", "score": "0.52035016", "text": "def show\n @trainers = Trainer.all\n end", "title": "" }, { "docid": "0741157ceaf3f1214b21b30cd7181a90", "score": "0.52031237", "text": "def theaters\n Apis.client.get('/cinema/theaters')\n end", "title": "" }, { "docid": "1b4bd87f8f1053cd05dd7d7702db6e54", "score": "0.51991224", "text": "def driven_with\n erg=[]\n passenger_trips.each do |x|\n if x.start_time < Time.now\n then erg = erg << x\n end\n end\n return erg.sort{|a,b| b.start_time <=> a.start_time}\n end", "title": "" }, { "docid": "e5dbeaaed50b9768999cd7411040ebff", "score": "0.5193865", "text": "def nearby_gps\n return [] unless has_gps\n\n lon = ( gps[:longitude] || gps[\"longitude\"] )\n lat = ( gps[:latitude] || gps[\"latitude\"] )\n acc = ( gps[:accuracy] || gps[\"accuracy\"] )\n\n # look for clients with environment updates in the last 30s\n # if api key hoccer compatible: only clients with hoccer compatible api keys\n # if not: only clients with same api key\n\n if hoccer_compatible?\n query = {\n \"api_key\" => {\"$in\" => hoccer_compatible_api_keys},\n \"created_at\" => {\"$gt\" => Time.now.to_f - 30}\n }\n else\n query = {\n \"api_key\" => api_key,\n \"created_at\" => {\"$gt\" => Time.now.to_f - 30}\n }\n end\n\n # all such clients within MAX_SEARCH_DISTANCE meters\n\n results = Environment.db.command({\n \"geoNear\" => \"environments\",\n \"near\" => [lon.to_f, lat.to_f],\n \"maxDistance\" => MAX_SEARCH_DISTANCE / EARTH_RADIUS,\n \"spherical\" => true,\n \"query\" => query\n })[\"results\"]\n\n # get nearby clients\n\n results.select! do |result|\n distance = (result[\"dis\"] * EARTH_RADIUS) # in meters\n\n # maximal distance given by gps for two clients in the same position (according to accuracy), but at most MAX_SEARCH_DISTANCE\n\n uncerteny = [(result[\"obj\"][\"gps\"][\"accuracy\"] + acc) * 2, MAX_SEARCH_DISTANCE].min\n\n # clients within that distance or GUARANTEED_DISTANCE\n \n distance <= [GUARANTEED_DISTANCE, uncerteny].max\n end\n\n # return clients\n\n results.map do |result|\n Mongoid::Factory.build(Environment, result[\"obj\"])\n end\n end", "title": "" }, { "docid": "2d7b7d0dde0a0ca7f0c6e6dcd49a4c9f", "score": "0.5188999", "text": "def tourists\n trips.map do |trip|\n trip.tourist\n end\n end", "title": "" }, { "docid": "995bc048869d1a3996d10cf263cefe87", "score": "0.5182119", "text": "def results\n @location = Location.all\n if params[:spot].present?\n @fruits =Location.near(params[:spot], 5)\n else\n @fruits = Location.all\n end\n end", "title": "" } ]
14bd3eea046832e02f6ef6815060f3d7
indicates whether this view has to be rendered inside a component
[ { "docid": "41011044b492b24840a6a8c68bedf6c6", "score": "0.0", "text": "def has_container?\n !container.nil?\n end", "title": "" } ]
[ { "docid": "bd64189e3237f081dc0319b9edd5671d", "score": "0.72424734", "text": "def component?\n !!@component\n end", "title": "" }, { "docid": "81619635988c6c2d793d55079cb7bb3d", "score": "0.7234283", "text": "def component?\n @object.labeled?(:ui)\n end", "title": "" }, { "docid": "f1a2ef2bd19e9fd8ca9160b9089a5d53", "score": "0.7059107", "text": "def components_pending?\n not layout.components.empty?\n end", "title": "" }, { "docid": "735f494455a3b851447be7be3db5251c", "score": "0.70054704", "text": "def render?\n visible?\n end", "title": "" }, { "docid": "c57e167ed72bc871334fcdbd22aedd59", "score": "0.69872946", "text": "def affects_render?\n\n return gui_block.respond_to?(:custom)\n\n end", "title": "" }, { "docid": "547751ebcb9c6974efd82ebdc9daa579", "score": "0.6984767", "text": "def in_layout_view?\n @view && @view.superview.kind_of?(LayoutView)\n end", "title": "" }, { "docid": "8f3220e6d5ac2bef016397d68e3dd416", "score": "0.6823101", "text": "def render?\n manager?\n end", "title": "" }, { "docid": "3ba4f54deab9080927d28744c15ef7c4", "score": "0.68143594", "text": "def render?\n true\n end", "title": "" }, { "docid": "3c82ec5cb17b543099d22375537807cd", "score": "0.68070036", "text": "def render?\n true\n end", "title": "" }, { "docid": "2984283f6e2fff52043f314bb0b24a93", "score": "0.67992496", "text": "def is_rendering_node?\n\t\t\ttrue\n\t\tend", "title": "" }, { "docid": "2984283f6e2fff52043f314bb0b24a93", "score": "0.67992496", "text": "def is_rendering_node?\n\t\t\ttrue\n\t\tend", "title": "" }, { "docid": "4a77ffc85c888836468d4318b8cb2240", "score": "0.6782718", "text": "def component_needs_building?\n [email protected]?\n end", "title": "" }, { "docid": "52fc8d44e5b9e883820fa12adbb4510e", "score": "0.6768065", "text": "def render?\n include?\n end", "title": "" }, { "docid": "9562f02c14d8f8ced4057b5bf18a8da9", "score": "0.67295754", "text": "def component_defined?\n defined?(component)\n end", "title": "" }, { "docid": "9562f02c14d8f8ced4057b5bf18a8da9", "score": "0.67295754", "text": "def component_defined?\n defined?(component)\n end", "title": "" }, { "docid": "03711060fc9e6dbd573d0f9f35e5faad", "score": "0.67186403", "text": "def is_rendering_node?\n\t\t\tfalse\n\t\tend", "title": "" }, { "docid": "03711060fc9e6dbd573d0f9f35e5faad", "score": "0.67186403", "text": "def is_rendering_node?\n\t\t\tfalse\n\t\tend", "title": "" }, { "docid": "03711060fc9e6dbd573d0f9f35e5faad", "score": "0.67186403", "text": "def is_rendering_node?\n\t\t\tfalse\n\t\tend", "title": "" }, { "docid": "e5ddaea8a04f3db7cd596dfe695d7c93", "score": "0.6692137", "text": "def includes_components?\n (bundle? || composite? || package?) && component_entries.live.any?\n end", "title": "" }, { "docid": "12adc7b3b7232f21add377d47b6d20a0", "score": "0.6658222", "text": "def independent_component?\n false\n end", "title": "" }, { "docid": "25c56f4936f6cd9e331e16f821169587", "score": "0.665634", "text": "def renders_own_childs?\n false\n end", "title": "" }, { "docid": "d9600e831d71237ef932d1b64b8359ef", "score": "0.6631943", "text": "def independent_component?\n true\n end", "title": "" }, { "docid": "d9600e831d71237ef932d1b64b8359ef", "score": "0.6631943", "text": "def independent_component?\n true\n end", "title": "" }, { "docid": "908e8f8d32a94cac34342d2591fa5084", "score": "0.66287255", "text": "def render_parents? \n (@render_mode == Base.all_styles)\n end", "title": "" }, { "docid": "0fcc6f6812b4d5824c1e7086484eb085", "score": "0.66275054", "text": "def node_component?\n NodeComponent.node_component?(self)\n end", "title": "" }, { "docid": "be107b43b6b29d989e2fe25b4ad2fe7e", "score": "0.66207373", "text": "def renders_own_childs?\n true\n end", "title": "" }, { "docid": "9a82fbfc0b09cd292ae60cc807b4e46b", "score": "0.66065353", "text": "def should_render_without_layout\n should_render_with_layout nil\n end", "title": "" }, { "docid": "ba23025e181b8f566889c12c24b92a7f", "score": "0.66038024", "text": "def _conditional_layout?\n return unless super\n true\n end", "title": "" }, { "docid": "1d091768a6255d49429b5fdf390883f1", "score": "0.6600301", "text": "def view_has_layout?\n @_view_has_layout\n end", "title": "" }, { "docid": "3b700d7c1cd0e79e2ec13d747d689ee1", "score": "0.65675044", "text": "def should_render_without_layout\n should_render_with_layout nil\n end", "title": "" }, { "docid": "01e9ea9e2523594071005ec6b34b7f17", "score": "0.65668774", "text": "def can_render?\n return false if date && date >= DateTime.now \n return true if flag?('visible')\n !hidden? and !in_layout_dir?\n end", "title": "" }, { "docid": "e49209cd00eb3de77dd0bcd5de4f6cea", "score": "0.6566259", "text": "def has_component?(component_class)\n self.components.include? component_class\n end", "title": "" }, { "docid": "a2d916165205aa0d06a443d6f313d613", "score": "0.64892834", "text": "def layout?\n context.layout != false\n end", "title": "" }, { "docid": "738fb671da8bb9a53e96f4ccac04d769", "score": "0.646908", "text": "def component?\n @_component ||= tag && !!/[[:upper:]]/.match(tag[0])\n end", "title": "" }, { "docid": "a78595552b2f6d596c09cb145a7fb86a", "score": "0.6449469", "text": "def render_as_page?\n children.any? ||\n (Config.instance.separate_global_declarations &&\n type.global?)\n end", "title": "" }, { "docid": "63602b459d2d58b8c0a0d49c461ee080", "score": "0.6404091", "text": "def render?\n !(content_for?(:label_as_title) || content_for?(:notification_panel_as_title))\n end", "title": "" }, { "docid": "e9d696ea620cad63e96e487b90334615", "score": "0.6351547", "text": "def renderable?\n !!handler\n end", "title": "" }, { "docid": "6fc2ef174bbd5b788273c73781d0cc93", "score": "0.63438195", "text": "def top_level_component? c\n @top_level_components.include? c\n end", "title": "" }, { "docid": "e22d6bbcccc758a4f5eba99348205177", "score": "0.6337235", "text": "def built?\n [email protected]?\n end", "title": "" }, { "docid": "d04263b177cdde43f9fdde84a5db4aed", "score": "0.6330899", "text": "def in_use?\n Page.all.each do |page|\n return true if page.page_template_id == self.id\n page.page_components.each do |component|\n return true if component.page_template_id == self.id\n end\n end\n false\n end", "title": "" }, { "docid": "154b512f197b10dc6dbcd3078fb1f903", "score": "0.63233614", "text": "def is_node_component?\n NodeComponent.is_node_component?(self)\n end", "title": "" }, { "docid": "8fb75e62bedee4c9a93f295ad0e43a35", "score": "0.6296569", "text": "def is_container?\n\t\treturn true\n\tend", "title": "" }, { "docid": "8128c00e82a6cd7b82c40d429fb6d33e", "score": "0.62822866", "text": "def is?(component_class)\n !!component_class.one(self)\n end", "title": "" }, { "docid": "da82ec583db258710d48193db6174baf", "score": "0.6258668", "text": "def already_rendered?\n @already_rendered\n end", "title": "" }, { "docid": "35cd416a46eb4ae29a79ab67f391fd31", "score": "0.62439126", "text": "def is_view_class?\n\t\t\treturn self.respond_to?( :view_dataset ) && self.view_dataset ? true : false\n\t\tend", "title": "" }, { "docid": "5c209cd8c8ead42e20d4f1fea9bbdbc6", "score": "0.6239751", "text": "def has_specific_components?\n !item_components.empty? || !reagent_components.empty? || !transformation_components.empty?\n end", "title": "" }, { "docid": "de569a62a8f824faf55391c74733cf7e", "score": "0.6232062", "text": "def is_layout?\n self.layout.nil?\n end", "title": "" }, { "docid": "fa78c1d7e01d7d017b8931f1c724219e", "score": "0.61855495", "text": "def render?\n helpers.should_render_field?(@field_config, @display_facet)\n end", "title": "" }, { "docid": "8785f51357be737b09d1519b816a3741", "score": "0.6172193", "text": "def is_template_directly_usable\n super\n end", "title": "" }, { "docid": "ecb823fab5023a1883cd305ca8b90ae5", "score": "0.6171147", "text": "def container?\n false\n end", "title": "" }, { "docid": "b98144fbb934d42f47354d90c4341490", "score": "0.613667", "text": "def visible?\n super\n end", "title": "" }, { "docid": "7a94616cc578e25a6d0792b9dc76c3a0", "score": "0.6123873", "text": "def has_partial?\n @view.lookup_context.template_exists? partial_includepath\n end", "title": "" }, { "docid": "5c0dd1349a2afeda8232637e86d26e0f", "score": "0.61059594", "text": "def container_pane?\n if children.any?\n true\n else\n false\n end\n end", "title": "" }, { "docid": "f8d470cdb59414a3df31380f6d53657d", "score": "0.6098239", "text": "def view_embedded?\n params[:view_as]&.in? %w[embedded simple-embedded]\n end", "title": "" }, { "docid": "911425c2311e20a04767acbcd97bb265", "score": "0.6094887", "text": "def composite?\n components.length > 0\n end", "title": "" }, { "docid": "58a6a52ffb80eee4aeaf950a063a23ea", "score": "0.60836375", "text": "def display_tag?\n left_outer? || right_outer? || inside_window? || single_gap?\n end", "title": "" }, { "docid": "e64f61e0afe3a8f4a2674f6836558e1c", "score": "0.60827535", "text": "def omit_content_from_parent?\n Config.instance.separate_global_declarations &&\n render_as_page?\n end", "title": "" }, { "docid": "42a29062c4b8de778b4d4e82e7941c9d", "score": "0.60667056", "text": "def has_component?( component )\n\t\treturn self.components.key?( component )\n\tend", "title": "" }, { "docid": "329a079d3b4b79e06a73c99835109554", "score": "0.6059617", "text": "def extending_extjs_component?\n @klass.superclass == Netzke::Base\n end", "title": "" }, { "docid": "329a079d3b4b79e06a73c99835109554", "score": "0.6059617", "text": "def extending_extjs_component?\n @klass.superclass == Netzke::Base\n end", "title": "" }, { "docid": "329a079d3b4b79e06a73c99835109554", "score": "0.6059617", "text": "def extending_extjs_component?\n @klass.superclass == Netzke::Base\n end", "title": "" }, { "docid": "31a7e4ed088b13e4f52bf351e7eca233", "score": "0.60592794", "text": "def partial?\n @has_partial\n end", "title": "" }, { "docid": "c8fa14b2b5ef0d0282b583ce159027d6", "score": "0.60528135", "text": "def attached?\n return @views[:master] && @views[:master].visible?\n end", "title": "" }, { "docid": "33a734f13d04327b7e6acb3a0382ef52", "score": "0.6049276", "text": "def render_parents? \n (@render_mode == Base.mode_reset)\n end", "title": "" }, { "docid": "3774c490ea92e6ed355c66d1d3056f03", "score": "0.6041387", "text": "def render?\n return true if @current_page && @total_pages > 1\n\n false\n end", "title": "" }, { "docid": "cc20288e11baf5f1c425290067fe9759", "score": "0.6040269", "text": "def required_component? c\n @required_components.include? c\n end", "title": "" }, { "docid": "50c0c10cf700e9223c879a4f96a63bb5", "score": "0.6012354", "text": "def views_initialized?\n @_views_initialized\n end", "title": "" }, { "docid": "0219f5fadb10a078f727f5678e27d1bc", "score": "0.6009803", "text": "def partial?\n @partial\n end", "title": "" }, { "docid": "e9f88da71f6d43f8ab4757d207bbbe13", "score": "0.6006821", "text": "def variant?\n self.parent.present?\n end", "title": "" }, { "docid": "8137cb12c964f06e0673ddf93d31f2d2", "score": "0.60062754", "text": "def content_for?(name)\n @view_flow.get(name).present?\n end", "title": "" }, { "docid": "23ceccf01b805d70dd9025d7efaee893", "score": "0.60001665", "text": "def top_level_component? c\n ! ! @top_level_component[c]\n end", "title": "" }, { "docid": "9a6cb3214e098e63d5814fb702effe55", "score": "0.5995549", "text": "def template?\n !pipeline.empty?\n end", "title": "" }, { "docid": "2ccd570ccfbcb2c4b23933047ae3e989", "score": "0.5995249", "text": "def partial?\n @object.type == :partial\n end", "title": "" }, { "docid": "89ac7f6d2716548b873d32bfad9c4690", "score": "0.5994072", "text": "def has_child?(view)\n children.any? { |vw| vw == view }\n end", "title": "" }, { "docid": "5b529dea3732ffad172df5add4cd71cd", "score": "0.5983257", "text": "def render_empty?\n DEFAULT_RENDER_EMPTY\n end", "title": "" }, { "docid": "ee3a4bb152b4dedfb1fecf0d3c21c67d", "score": "0.59815675", "text": "def partial?\n \t@partial\n end", "title": "" }, { "docid": "75eb7ea7eaeadc6bd7ff2ce33db24c43", "score": "0.5973902", "text": "def visible?(_context)\n true\n end", "title": "" }, { "docid": "2a25a98f4cfecba2b0d1fa042dfe3ca9", "score": "0.59595686", "text": "def render_performed?\n @render_performed\n end", "title": "" }, { "docid": "4077f8cbfbd1be40ee479fb118da64a0", "score": "0.59574085", "text": "def is_container?\n @is_container\n end", "title": "" }, { "docid": "009e9d9d0f273b73237f4935442e4385", "score": "0.5936657", "text": "def should_display?(product) !display_flag and (parent ? parent.should_display?(product) : true) end", "title": "" }, { "docid": "22c87d9c477fc2be975ee22e9ffc5de0", "score": "0.59168994", "text": "def render_size?\n self.respond_to?(:render_size) && !self.render_size.nil? && !self.render_size.empty?\n end", "title": "" }, { "docid": "2743f7d1e1ba9a42d0fd8884e3732633", "score": "0.59086365", "text": "def container?\n @object.type == :container\n end", "title": "" }, { "docid": "146baa62f0c48f23100c0a7c29cdbbee", "score": "0.5908581", "text": "def visible?\n base.visible?\n end", "title": "" }, { "docid": "a8a49dd2eeb57a3364f61186a6f9fc1d", "score": "0.59039927", "text": "def sinergy_bar_visible?\n !@s_view1.disposed? and @s_view1.visible\n end", "title": "" }, { "docid": "4fcf1ea7e6fa5fd9cbff2fe694ec838b", "score": "0.59024227", "text": "def overridden_helper_methods?\n return false if explicit_component_configuration?\n\n @view_context.method(:render_facet_item).owner != Blacklight::FacetsHelperBehavior ||\n @view_context.method(:render_facet_value).owner != Blacklight::FacetsHelperBehavior ||\n @view_context.method(:render_selected_facet_value).owner != Blacklight::FacetsHelperBehavior\n end", "title": "" }, { "docid": "8e8f7507cf4476e5ed3fa5d4ab38baf3", "score": "0.5901522", "text": "def supports_views?\n false\n end", "title": "" }, { "docid": "9d8022bd75bc670c7a4bef66c3899c16", "score": "0.5900443", "text": "def should_render?(part, omit_optional = true)\n if part[:optional] && omit_optional\n false unless @excludes.include?(part[:anchor])\n elsif @excludes.include?(part[:anchor])\n false\n else\n true\n end\n end", "title": "" }, { "docid": "e69df97bc5ac802878a6570333883d53", "score": "0.589756", "text": "def rendering?\n @render_lock.read_sync{ @rendering != 0 || @flag_update }\n end", "title": "" }, { "docid": "e365202629498948c11a9466d5d2b0d3", "score": "0.5895165", "text": "def template?\n true\n end", "title": "" }, { "docid": "b3f9c4b2b5393a50540c38179941e6e6", "score": "0.5893273", "text": "def render_field?\n view_context.should_render_field?(field_config, document)\n end", "title": "" }, { "docid": "dae343636430c93cf396adbe09f185f2", "score": "0.5891137", "text": "def display?(context = nil)\n\n return false unless render_in_context(context, @should_display)\n\n return false if !real_url?(context) && @children.any? && !items(context).any?\n\n true\n\n end", "title": "" }, { "docid": "05795077b97a20075d49a3eb0266d0a1", "score": "0.58881354", "text": "def on_first_component?\n @current_component == @components.first\n end", "title": "" }, { "docid": "05795077b97a20075d49a3eb0266d0a1", "score": "0.58881354", "text": "def on_first_component?\n @current_component == @components.first\n end", "title": "" }, { "docid": "7c9a748bc7686c70ce93cf58b9a0538e", "score": "0.5880584", "text": "def components_exist?\n true\n end", "title": "" }, { "docid": "4b6c865992326b9befadc490155d043d", "score": "0.58797276", "text": "def _conditional_layout?\n return unless super\n\n conditions = _layout_conditions\n\n if only = conditions[:only]\n only.include?(action_name)\n elsif except = conditions[:except]\n !except.include?(action_name)\n else\n true\n end\n end", "title": "" }, { "docid": "84fd58ea6470246bcb28b4eb3e5920b4", "score": "0.5874654", "text": "def parent?\n false\n end", "title": "" }, { "docid": "8242e3481cbc526af67b896a3c80586a", "score": "0.58653545", "text": "def has_renderable_items?\n renderable_items.any?\n end", "title": "" }, { "docid": "740fc760cd588740ed9eef0044d1e6d6", "score": "0.58640504", "text": "def should_render_without_layout\n ::ActiveSupport::Deprecation.warn(\"use: should_not render_with_layout\")\n should_not render_with_layout\n end", "title": "" }, { "docid": "1aec073a095610a61808a792d85c37ac", "score": "0.586058", "text": "def has_layout?\n return self.body != self.html_body\n end", "title": "" }, { "docid": "de0436e88351b74d366446d8b91a9977", "score": "0.58554256", "text": "def render_view_type_group?(_config, _opt = nil)\n !disabled?(:view_type_group)\n end", "title": "" }, { "docid": "1c3ba4a3333b78aea0cc3153ee679c89", "score": "0.5852788", "text": "def view_component\n @view_component ||= if @work.is_oral_history? && @work.oral_history_content&.available_by_request_off? && has_oh_audio_member?\n # special OH audio player template\n WorkOhAudioShowComponent.new(@work)\n elsif @work.is_oral_history?\n # OH with no playable audio, either becuae it's by-request or it's not there at all.\n WorkFileListShowComponent.new(@work)\n elsif has_video_representative?\n WorkVideoShowComponent.new(@work)\n else\n # standard image-based template.\n WorkImageShowComponent.new(@work)\n end\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "8fc4adc1a69772a07d841daa530ed09f", "score": "0.0", "text": "def set_group\n @group = Group.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook; end", "title": "" }, { "docid": "b8b36fc1cfde36f9053fe0ab68d70e5b", "score": "0.5946146", "text": "def run_actions; end", "title": "" }, { "docid": "3e521dbc644eda8f6b2574409e10a4f8", "score": "0.591683", "text": "def define_action_hook; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "bfb8386ef5554bfa3a1c00fa4e20652f", "score": "0.58349305", "text": "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "title": "" }, { "docid": "6c8e66d9523b9fed19975542132c6ee4", "score": "0.5776858", "text": "def add_actions; end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "6ce8a8e8407572b4509bb78db9bf8450", "score": "0.5652805", "text": "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "title": "" }, { "docid": "1964d48e8493eb37800b3353d25c0e57", "score": "0.5621621", "text": "def define_action_helpers; end", "title": "" }, { "docid": "5df9f7ffd2cb4f23dd74aada87ad1882", "score": "0.54210985", "text": "def post_setup\n end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.53794575", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.5357573", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "0464870c8688619d6c104d733d355b3b", "score": "0.53402257", "text": "def define_action_helpers?; end", "title": "" }, { "docid": "0e7bdc54b0742aba847fd259af1e9f9e", "score": "0.53394014", "text": "def set_actions\n actions :all\n end", "title": "" }, { "docid": "5510330550e34a3fd68b7cee18da9524", "score": "0.53321576", "text": "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "title": "" }, { "docid": "97c8901edfddc990da95704a065e87bc", "score": "0.53124547", "text": "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "title": "" }, { "docid": "4f9a284723e2531f7d19898d6a6aa20c", "score": "0.529654", "text": "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "title": "" }, { "docid": "83684438c0a4d20b6ddd4560c7683115", "score": "0.5296262", "text": "def before_actions(*logic)\n self.before_actions = logic\n end", "title": "" }, { "docid": "210e0392ceaad5fc0892f1335af7564b", "score": "0.52952296", "text": "def setup_handler\n end", "title": "" }, { "docid": "a997ba805d12c5e7f7c4c286441fee18", "score": "0.52600986", "text": "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "1d50ec65c5bee536273da9d756a78d0d", "score": "0.52442724", "text": "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "635288ac8dd59f85def0b1984cdafba0", "score": "0.5232394", "text": "def workflow\n end", "title": "" }, { "docid": "e34cc2a25e8f735ccb7ed8361091c83e", "score": "0.523231", "text": "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "title": "" }, { "docid": "78b21be2632f285b0d40b87a65b9df8c", "score": "0.5227454", "text": "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52226824", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "923ee705f0e7572feb2c1dd3c154b97c", "score": "0.52201617", "text": "def process_action(...)\n send_action(...)\n end", "title": "" }, { "docid": "b89a3908eaa7712bb5706478192b624d", "score": "0.5212327", "text": "def before_dispatch(env); end", "title": "" }, { "docid": "7115b468ae54de462141d62fc06b4190", "score": "0.52079266", "text": "def after_actions(*logic)\n self.after_actions = logic\n end", "title": "" }, { "docid": "d89a3e408ab56bf20bfff96c63a238dc", "score": "0.52050185", "text": "def setup\n # override and do something appropriate\n end", "title": "" }, { "docid": "62c402f0ea2e892a10469bb6e077fbf2", "score": "0.51754695", "text": "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "title": "" }, { "docid": "72ccb38e1bbd86cef2e17d9d64211e64", "score": "0.51726824", "text": "def setup(_context)\n end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "1fd817f354d6cb0ff1886ca0a2b6cce4", "score": "0.5166172", "text": "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "title": "" }, { "docid": "5531df39ee7d732600af111cf1606a35", "score": "0.5159343", "text": "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "title": "" }, { "docid": "bb6aed740c15c11ca82f4980fe5a796a", "score": "0.51578903", "text": "def determine_valid_action\n\n end", "title": "" }, { "docid": "b38f9d83c26fd04e46fe2c961022ff86", "score": "0.51522785", "text": "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "title": "" }, { "docid": "199fce4d90958e1396e72d961cdcd90b", "score": "0.5152022", "text": "def startcompany(action)\n @done = true\n action.setup\n end", "title": "" }, { "docid": "994d9fe4eb9e2fc503d45c919547a327", "score": "0.51518047", "text": "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "title": "" }, { "docid": "62fabe9dfa2ec2ff729b5a619afefcf0", "score": "0.51456624", "text": "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.51398855", "text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "title": "" }, { "docid": "adb8115fce9b2b4cb9efc508a11e5990", "score": "0.5133759", "text": "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "title": "" }, { "docid": "e1dd18cf24d77434ec98d1e282420c84", "score": "0.5112076", "text": "def setup(&block)\n define_method(:setup, &block)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "f54964387b0ee805dbd5ad5c9a699016", "score": "0.5106169", "text": "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "title": "" }, { "docid": "35b302dd857a031b95bc0072e3daa707", "score": "0.509231", "text": "def config(action, *args); end", "title": "" }, { "docid": "bc3cd61fa2e274f322b0b20e1a73acf8", "score": "0.50873137", "text": "def setup\n @setup_proc.call(self) if @setup_proc\n end", "title": "" }, { "docid": "5c3cfcbb42097019c3ecd200acaf9e50", "score": "0.5081088", "text": "def before_action \n end", "title": "" }, { "docid": "246840a409eb28800dc32d6f24cb1c5e", "score": "0.508059", "text": "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "title": "" }, { "docid": "dfbcf4e73466003f1d1275cdf58a926a", "score": "0.50677156", "text": "def action\n end", "title": "" }, { "docid": "36eb407a529f3fc2d8a54b5e7e9f3e50", "score": "0.50562143", "text": "def matt_custom_action_begin(label); end", "title": "" }, { "docid": "b6c9787acd00c1b97aeb6e797a363364", "score": "0.5050554", "text": "def setup\n # override this if needed\n end", "title": "" }, { "docid": "9fc229b5b48edba9a4842a503057d89a", "score": "0.50474834", "text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "title": "" }, { "docid": "9fc229b5b48edba9a4842a503057d89a", "score": "0.50474834", "text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "title": "" }, { "docid": "fd421350722a26f18a7aae4f5aa1fc59", "score": "0.5036181", "text": "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "title": "" }, { "docid": "d02030204e482cbe2a63268b94400e71", "score": "0.5026331", "text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "title": "" }, { "docid": "4224d3231c27bf31ffc4ed81839f8315", "score": "0.5022976", "text": "def after(action)\n invoke_callbacks *options_for(action).after\n end", "title": "" }, { "docid": "24506e3666fd6ff7c432e2c2c778d8d1", "score": "0.5015441", "text": "def pre_task\n end", "title": "" }, { "docid": "0c16dc5c1875787dacf8dc3c0f871c53", "score": "0.50121695", "text": "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "title": "" }, { "docid": "c99a12c5761b742ccb9c51c0e99ca58a", "score": "0.5000944", "text": "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "title": "" }, { "docid": "0cff1d3b3041b56ce3773d6a8d6113f2", "score": "0.5000019", "text": "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "title": "" }, { "docid": "791f958815c2b2ac16a8ca749a7a822e", "score": "0.4996878", "text": "def setup_signals; end", "title": "" }, { "docid": "6e44984b54e36973a8d7530d51a17b90", "score": "0.4989888", "text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "title": "" }, { "docid": "6e44984b54e36973a8d7530d51a17b90", "score": "0.4989888", "text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "title": "" }, { "docid": "5aa51b20183964c6b6f46d150b0ddd79", "score": "0.49864885", "text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "title": "" }, { "docid": "7647b99591d6d687d05b46dc027fbf23", "score": "0.49797225", "text": "def initialize(*args)\n super\n @action = :set\nend", "title": "" }, { "docid": "67e7767ce756766f7c807b9eaa85b98a", "score": "0.49785787", "text": "def after_set_callback; end", "title": "" }, { "docid": "2a2b0a113a73bf29d5eeeda0443796ec", "score": "0.4976161", "text": "def setup\n #implement in subclass;\n end", "title": "" }, { "docid": "63e628f34f3ff34de8679fb7307c171c", "score": "0.49683493", "text": "def lookup_action; end", "title": "" }, { "docid": "a5294693c12090c7b374cfa0cabbcf95", "score": "0.4965126", "text": "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "title": "" }, { "docid": "57dbfad5e2a0e32466bd9eb0836da323", "score": "0.4958034", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "5b6d613e86d3d68152f7fa047d38dabb", "score": "0.49559742", "text": "def release_actions; end", "title": "" }, { "docid": "4aceccac5b1bcf7d22c049693b05f81c", "score": "0.4954353", "text": "def around_hooks; end", "title": "" }, { "docid": "2318410efffb4fe5fcb97970a8700618", "score": "0.49535993", "text": "def save_action; end", "title": "" }, { "docid": "64e0f1bb6561b13b482a3cc8c532cc37", "score": "0.4952725", "text": "def setup(easy)\n super\n easy.customrequest = @verb\n end", "title": "" }, { "docid": "fbd0db2e787e754fdc383687a476d7ec", "score": "0.49467874", "text": "def action_target()\n \n end", "title": "" }, { "docid": "b280d59db403306d7c0f575abb19a50f", "score": "0.49423352", "text": "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "title": "" }, { "docid": "9f7547d93941fc2fcc7608fdf0911643", "score": "0.49325448", "text": "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "title": "" }, { "docid": "da88436fe6470a2da723e0a1b09a0e80", "score": "0.49282882", "text": "def before_setup\n # do nothing by default\n end", "title": "" }, { "docid": "17ffe00a5b6f44f2f2ce5623ac3a28cd", "score": "0.49269363", "text": "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "title": "" }, { "docid": "21d75f9f5765eb3eb36fcd6dc6dc2ec3", "score": "0.49269104", "text": "def default_action; end", "title": "" }, { "docid": "3ba85f3cb794f951b05d5907f91bd8ad", "score": "0.49252945", "text": "def setup(&blk)\n @setup_block = blk\n end", "title": "" }, { "docid": "80834fa3e08bdd7312fbc13c80f89d43", "score": "0.4923091", "text": "def callback_phase\n super\n end", "title": "" }, { "docid": "f1da8d654daa2cd41cb51abc7ee7898f", "score": "0.49194667", "text": "def advice\n end", "title": "" }, { "docid": "99a608ac5478592e9163d99652038e13", "score": "0.49174926", "text": "def _handle_action_missing(*args); end", "title": "" }, { "docid": "9e264985e628b89f1f39d574fdd7b881", "score": "0.49173003", "text": "def duas1(action)\n action.call\n action.call\nend", "title": "" }, { "docid": "399ad686f5f38385ff4783b91259dbd7", "score": "0.49171105", "text": "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "title": "" }, { "docid": "0dccebcb0ecbb1c4dcbdddd4fb11bd8a", "score": "0.4915879", "text": "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "title": "" }, { "docid": "6e0842ade69d031131bf72e9d2a8c389", "score": "0.49155936", "text": "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend", "title": "" } ]
958136479b07448652d7c7a4f8b4b942
DELETE /admin/jobs/1 DELETE /admin/jobs/1.json
[ { "docid": "825484eae9a905e95c59a6b3002cca72", "score": "0.79554325", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to admin_jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "66db0ef98d50e458b6aaead27c514ac5", "score": "0.8001244", "text": "def delete(args)\n options = { body: args, basic_auth: { username: @api_key } }\n Try { self.class.post(\"/api/jobs/delete.json\", options) }.to_either >-> response {\n if response.code == 200\n Right(response)\n else\n Left(response)\n end\n }\n end", "title": "" }, { "docid": "48e0a876e36dfc65d956ffaf93cfc05d", "score": "0.7772154", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "47a15dac154ec4375149d53d143ae704", "score": "0.77546924", "text": "def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to console_jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6c070269871fbf70879e45dfaa8a778d", "score": "0.77286404", "text": "def destroy\n\n @job.destroy\n respond_to do |format|\n format.html { redirect_to admin_jobs_path, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "00a8cf02459edaa6d0411972ece967a7", "score": "0.77036345", "text": "def destroy\n the_id = params[:id]\n job = Job.find_by(id: the_id)\n job.destroy\n render json: {message:\"This job has been deleted\"}\n end", "title": "" }, { "docid": "1c510c5d57c690df2002fe0f8fe53199", "score": "0.7680988", "text": "def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_jobs_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2d7350cd1fecd773149fd506b484cde2", "score": "0.76789075", "text": "def destroy\n @job.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "be8fdec9a0acf7958c60f46d566a1047", "score": "0.7660104", "text": "def destroy\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1ded28e98cdb15f2f2762f6bcb8820f9", "score": "0.7639092", "text": "def destroy\n @job = Job.find(params[:id])\n @job.delete\n\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Job was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a647fa54a3b9fc507fdca7a369bc7bc3", "score": "0.7632723", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a647fa54a3b9fc507fdca7a369bc7bc3", "score": "0.7632723", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a647fa54a3b9fc507fdca7a369bc7bc3", "score": "0.7632723", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a647fa54a3b9fc507fdca7a369bc7bc3", "score": "0.7632723", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a647fa54a3b9fc507fdca7a369bc7bc3", "score": "0.7632723", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a647fa54a3b9fc507fdca7a369bc7bc3", "score": "0.7632723", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a647fa54a3b9fc507fdca7a369bc7bc3", "score": "0.7632723", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a647fa54a3b9fc507fdca7a369bc7bc3", "score": "0.7632723", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a647fa54a3b9fc507fdca7a369bc7bc3", "score": "0.7632723", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a647fa54a3b9fc507fdca7a369bc7bc3", "score": "0.7632723", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c48aa9f2b2cefa3883f595e8523a8b76", "score": "0.7626275", "text": "def destroy\n @job = Job.find(params[:id])\n @job.destroy\n redirect_to admin_jobs_url\n end", "title": "" }, { "docid": "98d20d6e71e0985c23774a53126d68e8", "score": "0.76178586", "text": "def destroy\n #@job = Job.find(params[:id])\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "80cb7f529e875754b70bccadafb92e51", "score": "0.76106787", "text": "def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "80cb7f529e875754b70bccadafb92e51", "score": "0.76106787", "text": "def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "ca46b1a3372f9c6f48a9df6fa8155189", "score": "0.76101965", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to manage_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1a8a967ddafcfd7030a9bfac29fcb602", "score": "0.7607643", "text": "def destroy\n if UbiquoJobs.manager.delete(params[:id])\n flash[:notice] = t(\"ubiquo.jobs.job_removed\")\n else\n flash[:error] = t(\"ubiquo.jobs.cant_remove\")\n end\n\n respond_to do |format|\n format.html { redirect_to(ubiquo_jobs_path) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a4df5a07bb10b69d2d73074363e8ede4", "score": "0.75993156", "text": "def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a4df5a07bb10b69d2d73074363e8ede4", "score": "0.75993156", "text": "def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a4df5a07bb10b69d2d73074363e8ede4", "score": "0.75993156", "text": "def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a4df5a07bb10b69d2d73074363e8ede4", "score": "0.75993156", "text": "def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a4df5a07bb10b69d2d73074363e8ede4", "score": "0.75993156", "text": "def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a4df5a07bb10b69d2d73074363e8ede4", "score": "0.75993156", "text": "def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a4df5a07bb10b69d2d73074363e8ede4", "score": "0.75993156", "text": "def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a4df5a07bb10b69d2d73074363e8ede4", "score": "0.75993156", "text": "def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a4df5a07bb10b69d2d73074363e8ede4", "score": "0.75993156", "text": "def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a4df5a07bb10b69d2d73074363e8ede4", "score": "0.75993156", "text": "def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a4df5a07bb10b69d2d73074363e8ede4", "score": "0.75993156", "text": "def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a4df5a07bb10b69d2d73074363e8ede4", "score": "0.75993156", "text": "def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a4df5a07bb10b69d2d73074363e8ede4", "score": "0.75993156", "text": "def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a4df5a07bb10b69d2d73074363e8ede4", "score": "0.75993156", "text": "def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a4df5a07bb10b69d2d73074363e8ede4", "score": "0.75993156", "text": "def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a4df5a07bb10b69d2d73074363e8ede4", "score": "0.75993156", "text": "def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a4df5a07bb10b69d2d73074363e8ede4", "score": "0.75993156", "text": "def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a4df5a07bb10b69d2d73074363e8ede4", "score": "0.7599094", "text": "def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f8e79ff8e4bb1aaecdba79426415ed7a", "score": "0.7590968", "text": "def destroy\n @job = Job.find(params[:id])\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6acc67bdf42b99a29ac86faab9daa09b", "score": "0.7589511", "text": "def destroy\r\n @job.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to jobs_url }\r\n format.json { head :no_content }\r\n end\r\n end", "title": "" }, { "docid": "dcb6d2fe9a4314a941b634ab12c0c834", "score": "0.75847626", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: t('messages.deleted_job') }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f9108257de4704c003a2446e159f62cd", "score": "0.7573946", "text": "def delete(id)\n connection.delete do |req|\n req.url \"job/#{id}\"\n end\n end", "title": "" }, { "docid": "0aa2e88bd0fba0653e5379d0d8a8bb88", "score": "0.75595605", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: t('jobs_controller.jobs_delete_success') }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0b67c168748c2ce98195fb2ae106394e", "score": "0.7537528", "text": "def delete_job\n delete\n end", "title": "" }, { "docid": "01605f3a04722a9b849c3d38e004c5c3", "score": "0.75342107", "text": "def destroy\n authorize @job\n @job.destroy\n head :no_content\n end", "title": "" }, { "docid": "ba5a83ea809bebba4dea81bfd6301231", "score": "0.75322294", "text": "def destroy\n @job = project.jobs.find(params[:id])\n @job.destroy\n\n end", "title": "" }, { "docid": "402236c7ec626ed02cc82cd516b6e49e", "score": "0.75201267", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: 'Job was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "30baf3a31e5ef2611d6b9bc18200eeac", "score": "0.7511943", "text": "def destroy\n flash[:alert] = \"Manually deleting jobs has been disabled\"\n return redirect_to :root\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fb7d6a73f4cb8021f23c21ac7112e76d", "score": "0.74864435", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fb7d6a73f4cb8021f23c21ac7112e76d", "score": "0.74864435", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fb7d6a73f4cb8021f23c21ac7112e76d", "score": "0.74864435", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fb7d6a73f4cb8021f23c21ac7112e76d", "score": "0.74864435", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fbec1989febecba69bdac07403b4edc9", "score": "0.7486394", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to current_user, notice: 'Job was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "86ac58184c32fe228a295a1735e996bc", "score": "0.74832326", "text": "def destroy\n @job = Job.find(params[:id])\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: \"Job was successfully deleted.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f9782e03aaed9901ad6f06f9d46fdc4b", "score": "0.7473345", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to app_jobs_path, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "70b8e7ba227e1e06542378eb0556aef0", "score": "0.74483883", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: t('.job_destroyed') }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "03ec5705d25d7b0dbc41c20d43c74487", "score": "0.7448261", "text": "def destroy\n @queue_job = QueueJob.find(params[:id])\n @queue_job.destroy\n\n respond_to do |format|\n format.html { redirect_to queue_jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fc4ceffbe7851f0e3623818119209e59", "score": "0.7447439", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to admin_jobs_url, notice: 'Job was successfully destroyed.' }\n end\n end", "title": "" }, { "docid": "0a0c68ec77b2509127d102badbecee53", "score": "0.74407005", "text": "def destroy\n @job_detail.destroy\n respond_to do |format|\n format.html { redirect_to job_details_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0ebf1d728424eca978922b3a598c1ca1", "score": "0.74212533", "text": "def destroy\n @job = current_company.jobs.find(params[:id])\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "edc0de92163b491f9031e27b3532121f", "score": "0.74153394", "text": "def asyncDelete\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9cd32a32bf68dd2afab9052840b46bc0", "score": "0.74046797", "text": "def destroy\n #TODO: Notify worker if there is one\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to jobs_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "cd22fab4311b2aaafd396638ef3bc346", "score": "0.73974466", "text": "def destroy\n @user_job.destroy\n respond_to do |format|\n format.html { redirect_to user_jobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8b628a82e69112feb4112c092cc5c3c7", "score": "0.73954964", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: ' job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "062132897afd7710fc472feefae399d1", "score": "0.73905015", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to my_jobs_path, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "33ad4d93f9aa4dd27a4cb5687059e58b", "score": "0.73891544", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Lavorazione eliminata.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2db03cbe6467605e7cf836fdf212d88e", "score": "0.73869985", "text": "def destroy\n @jobboard.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": "a181c565c74477a74493540dffeb2245", "score": "0.73821443", "text": "def destroy\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to(jobs_url) }\n format.xml { head :ok }\n\t\t\tformat.json { render :json => @job, :status => 200 }\n end\n end", "title": "" }, { "docid": "154820441cc7bc0f94ca3f8c2af1d9ca", "score": "0.7373623", "text": "def destroy\n\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "154820441cc7bc0f94ca3f8c2af1d9ca", "score": "0.7373623", "text": "def destroy\n\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "179a2329b902e4f15dcbf053ae8caf21", "score": "0.7372038", "text": "def destroy\n\n @job = Job.find(params[:id])\n @job.destroy\n\n respond_to do |format|\n format.html { redirect_to(jobs_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d3670af23049b0f9f6c634e4124ef931", "score": "0.7368906", "text": "def destroy\n\t @job.destroy\n\t respond_to do |format|\n\t format.html { redirect_to owners_path }\n\t format.json { head :no_content }\n\t end\n\tend", "title": "" }, { "docid": "15aef2643bb5fd036272938626c43158", "score": "0.73650324", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully de_stroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1450929a5a178f0149e639ce9a3cc9e1", "score": "0.73574394", "text": "def destroy\n\t\[email protected]\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to jobs_url }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend", "title": "" }, { "docid": "1bafc332bb0fd8f4ee6b21c690814de4", "score": "0.73429966", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'המשרה הוסרה בהצלחה.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "62f1e5a3a6788bb109508ee32a3bd856", "score": "0.73370093", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "62f1e5a3a6788bb109508ee32a3bd856", "score": "0.73370093", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "62f1e5a3a6788bb109508ee32a3bd856", "score": "0.73370093", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "62f1e5a3a6788bb109508ee32a3bd856", "score": "0.73370093", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "62f1e5a3a6788bb109508ee32a3bd856", "score": "0.73370093", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "62f1e5a3a6788bb109508ee32a3bd856", "score": "0.73370093", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "62f1e5a3a6788bb109508ee32a3bd856", "score": "0.73370093", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "62f1e5a3a6788bb109508ee32a3bd856", "score": "0.73370093", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "62f1e5a3a6788bb109508ee32a3bd856", "score": "0.73370093", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "62f1e5a3a6788bb109508ee32a3bd856", "score": "0.73370093", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "62f1e5a3a6788bb109508ee32a3bd856", "score": "0.73370093", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "62f1e5a3a6788bb109508ee32a3bd856", "score": "0.73370093", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "62f1e5a3a6788bb109508ee32a3bd856", "score": "0.73370093", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "62f1e5a3a6788bb109508ee32a3bd856", "score": "0.73370093", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "62f1e5a3a6788bb109508ee32a3bd856", "score": "0.73370093", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "62f1e5a3a6788bb109508ee32a3bd856", "score": "0.73370093", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "62f1e5a3a6788bb109508ee32a3bd856", "score": "0.73370093", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "62f1e5a3a6788bb109508ee32a3bd856", "score": "0.73370093", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "62f1e5a3a6788bb109508ee32a3bd856", "score": "0.73370093", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "62f1e5a3a6788bb109508ee32a3bd856", "score": "0.73370093", "text": "def destroy\n @job.destroy\n respond_to do |format|\n format.html { redirect_to jobs_url, notice: 'Job was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
8e46fddb95e220f55b119a7041547571
[3,4,6,1] 3 + 4 = 7 3 + 6 = 9 3 + 1 = 4 4 + 6 = 10 4 + 1 = 5 6 + 1 = 7
[ { "docid": "0008bc55f0a054ae15539cb5a5eba2bb", "score": "0.0", "text": "def sumTwo(array, sum)\n\tfor i in 0..array.length-2\n\t\tn1 = array[i]\n\t\tn2 = array[i+1]\n\t\tif n1 + n2 == sum\n\t\t\toutput = [n1, n2]\n\t\t\tbreak\n\t\tend\n\tend\n\toutput ||= \"no pairs sum to this input\"\n\tputs \"#{output}\"\n\treturn output\nend", "title": "" } ]
[ { "docid": "354acc44d23902170d18ef50bb27f5b1", "score": "0.6858116", "text": "def dynamic_programming(sorted)\n acc = { sorted.length - 1 => 1 }\n result = 1\n (2..sorted.length).each do |offset|\n (sorted.length - offset + 2...sorted.length).each do |index|\n break unless sorted[index] - sorted[sorted.length - offset] <= 3\n\n result += acc[index]\n end\n acc[sorted.length - offset] = result\n end\n result\nend", "title": "" }, { "docid": "b4b449404da82a697ec23442116ead7a", "score": "0.68148786", "text": "def array(n)\n n.inject(:+)\nend", "title": "" }, { "docid": "c8dd625e6c894142a0c7e940d8856eef", "score": "0.67712384", "text": "def solution(a)\n return 1 if a.empty?\n\n (1..a.count + 1).inject(:+) - a.inject(:+)\nend", "title": "" }, { "docid": "e3b0918831337e19aaf694fce52ca7c0", "score": "0.6728954", "text": "def running_total3(arr)\n output = []\n arr.size.times { |count| output << arr[0..count].inject(:+)}\n output\nend", "title": "" }, { "docid": "1c498ff5848b8ea7cad89ed3ead7eed4", "score": "0.6720169", "text": "def solution(a)\n max = a.length + 1\n (1 + max) * max / 2 - a.inject(0, &:+)\nend", "title": "" }, { "docid": "7627e3dad1bdcd5875d68180d60e7196", "score": "0.6706012", "text": "def Array nums\n nums.map(&:to_i).inject(&:+)\nend", "title": "" }, { "docid": "ce7df166ef3a486604fcfe71889c886b", "score": "0.66669494", "text": "def total2(array_of_nums)\r\n return array_of_nums.inject(:+)\r\nend", "title": "" }, { "docid": "db1db1204b1cc696812342afc6409803", "score": "0.6657173", "text": "def sum(n)\n (1..n).inject(&:+)\nend", "title": "" }, { "docid": "626ad0bb04aa7e5e5792acac237ebc2f", "score": "0.66457695", "text": "def sum(n)\n a = Array.new((n - 1) / 2 + 1)\n a.length.times do |i|\n a[i] = case i\n when 0;\n [1]\n else\n l = a[i - 1].last\n g = i * 2\n [l + g, l + g * 2, l + g * 3, l + g * 4]\n end\n end\n\n a.reduce(0) do |r, b|\n r + b.reduce(:+)\n end\nend", "title": "" }, { "docid": "e011f0bd971ee31cd802d7eef4f0c369", "score": "0.66419286", "text": "def running_total(array)\n results = []\n array.size.times do\n results << array.inject(:+)\n array.pop\nend\n results.reverse\nend", "title": "" }, { "docid": "cb413a5e3265e87d0e6757915955aa8c", "score": "0.66404366", "text": "def p1\n (1...1000).reduce(0) do |acc, el|\n if el % 5 == 0 || el % 3 == 0\n acc + el\n else\n acc\n end\n end\nend", "title": "" }, { "docid": "eb62fde6ff4c2b9a7e5b49aa07db4426", "score": "0.66394395", "text": "def multisum(num)\nlist = Array(1..num)\nresult = []\nlist.each do |x|\n if x % 3 == 0 || x % 5 == 0\n result.push(x)\n end\nend\nresult.inject(:+)\nend", "title": "" }, { "docid": "0d768fb81fd01abad53bafca7694c0de", "score": "0.66159457", "text": "def summation(num)\n# So you can't use inject on an argument that isn't an array, so I had to first do as the \n# instructions asked, that is create a range from 1 to num then turn that to an array upon\n# which we can call inject (which is an aliase for 'reduce', which is like 'build on' or \n# reducing the array to one thing) on.\n# summing the items of the array together\n (1..num).to_a.inject(:+)\n #num.size == 1 ? num : num.inject(:+)#each { |a| sum+=a}#\n #end\nend", "title": "" }, { "docid": "856f3a87d6d9448560830683637f1d8e", "score": "0.66148764", "text": "def arithmetic_sequence_sum(a, r, n)\n a*n + r*n*(n-1)/2\nend", "title": "" }, { "docid": "0b38bb1ea09c2dee29f9a700d19ee5cd", "score": "0.66024894", "text": "def problem_6\n (1.upto(100).reduce(:+) ** 2 ) - (1..100).inject { |sum, n| sum += n**2 }\nend", "title": "" }, { "docid": "5fe02bd8d7e4fd86cc95cc22b11dab31", "score": "0.6568041", "text": "def total(n)\n (n).reduce(:+)\nend", "title": "" }, { "docid": "5d97b0db568109e5f9c8c925eadd8f20", "score": "0.6554841", "text": "def sum1(n)\n n * (n + 1) * (2 * n + 1) / 6\nend", "title": "" }, { "docid": "d990dbabe0c52caa31e0c082b5f0895f", "score": "0.6552694", "text": "def problem28\n (1..500).inject(1) {|sum, n| sum + ( (n = 2 * n + 1)**2 + (n**2 - (x = n - 1)) + (n**2 - 2 * x) + (n**2 - 3 * x) )}\nend", "title": "" }, { "docid": "0ae5e00166ab1b784353d7010a17f3bc", "score": "0.65213823", "text": "def handshakes(num)\n\t(1..num).reduce(:+)\nend", "title": "" }, { "docid": "93a13b30f0757a816370ee624d1dba19", "score": "0.6500529", "text": "def SimpleAdding(num)\n return (1..num).to_a.inject(:+) \nend", "title": "" }, { "docid": "3404c29a97adf2298cb1b495e8a3f64f", "score": "0.64990264", "text": "def summation(n)\r\n arr=[]\r\n while n > 0\r\n arr << n if n%3==0 || n%5==0\r\n n-=1\r\n end\r\n arr.reduce(:+)\r\nend", "title": "" }, { "docid": "b26d7f91d80d406fb0e7a1b373153388", "score": "0.6492956", "text": "def solution(number)\n\ta=[]\n\t(1..number-1).map {|x| a << x if (x%3==0 || x%5==0)}\n\ta.reduce(:+)\n\t\nend", "title": "" }, { "docid": "479b2ac59894d48761ca1ce80411f397", "score": "0.64652485", "text": "def example1()\n\tarr = 1.upto($limit).each_with_index.map {|index| if (divisorSum(index) > index + 1) then index end}.compact\n\t#arr.each_with_index { |n,index| if(n.nil? == false) then printf \"index %d = %d\\n\",index, n end }\n\t#p divisorSum(16)\n\tp arr\n\tarr = arr.product(arr)\n\t#p arr\n\t#p \"---------------------\"\n\tarr = arr.map {|mylist| mylist.reduce(:+) }.uniq!\n\ttotal = 0\n\t1.upto($limit) do |index|\n\tif(arr.include?(index) == false) then\n\t\t\ttotal = total + index\n\t\t\t#p index\n\t\tend\n\tend\n\ttotal\nend", "title": "" }, { "docid": "3002cd58cee74fbf6510318593bb4f34", "score": "0.64602244", "text": "def dynamic_programming(nums)\n left = [1]\n right = [1]\n\n (1...nums.size).each do |index|\n left[index] = nums[index-1] * left[index-1]\n right.unshift(nums[-index] * right.first)\n end\n \n\n ans = []\n (0...nums.size).each do |index|\n ans << left[index] * right[index]\n end\n ans\nend", "title": "" }, { "docid": "caf095b7fbd9b34c6f803635815f5c76", "score": "0.6458196", "text": "def summingSeries(n)\n return (n*n).modulo(10**9+7);\nend", "title": "" }, { "docid": "7ea51cd2a9737b691da300f3fa9eac26", "score": "0.6450014", "text": "def solution(a)\n # write your code in Ruby 2.2\n total_sum = (1..(a.count+1)).reduce(:+)\n total_arr = a.reduce(:+) || 0\n total_sum - total_arr\nend", "title": "" }, { "docid": "bc2cea007bfead858c8dbadbee73ea14", "score": "0.64438367", "text": "def formula(size)\n # f(0) = 1\n previous = 1\n # instead of advancing as 3, 5, 7 (in reference to 3x3, 5x5, 7x7 spirals),\n # we advance as 1, 2, 3\n (1..(size-1)/2).each do |i|\n # from formula for f(n) above\n current = 4*((2*i+1)**2) - 12*i + previous\n previous = current\n end\n\n previous\nend", "title": "" }, { "docid": "576a7399151404eb24e394217876afcc", "score": "0.6439841", "text": "def add(numbers)\n\tnumbers.inject(:+)\nend", "title": "" }, { "docid": "756762389eed8ab63adfac2a2bb4011a", "score": "0.64389044", "text": "def solution(number)\r\n num= (1..number-1).to_a\r\n arry=[]\r\n for i in num \r\n if i % 3 == 0 or i % 5 == 0\r\n arry << i \r\n end\r\n end\r\n p arry.sum \r\nend", "title": "" }, { "docid": "306912442b1730a1d3a37fad1d39aaa4", "score": "0.64323306", "text": "def refact(array)\n array.inject {|sum, i| sum + i}\nend", "title": "" }, { "docid": "4991b6832daaa362c976ed9281725215", "score": "0.64285284", "text": "def running_total_with_inject(array)\n new_array = []\n array.map do |num|\n new_array << num\n new_array.inject(:+)\n end\nend", "title": "" }, { "docid": "93467339662d228ca010e49ce00e51b0", "score": "0.64189935", "text": "def dbl_linear(n)\n i = 0\n result = [1]\n while result.length < n\n result.push(2*result[i]+1)\n result.push(3*result[i]+1)\n i += 1\n result = result.sort\n end\n return result\nend", "title": "" }, { "docid": "b59dc15c7446b5f1a950ed48439b1351", "score": "0.64185834", "text": "def add_all(n)\n if n / 3 - 2 < 3\n return n\n else \n (n / 3 - 2) + add_all(n / 3 - 2)\n end\nend", "title": "" }, { "docid": "acb167432bbada111a3fa2ac9c82dea1", "score": "0.64114565", "text": "def sum(num)\n (1..num).reduce(:+) \nend", "title": "" }, { "docid": "933a97847c51868ea1051de901d71954", "score": "0.6408281", "text": "def running_sum(nums)\n result = []\n result[0] = nums[0]\n nums.each_with_index do |n, i|\n if i!=0\n result.push(n + result[i-1])\n end\n end\n return result\nend", "title": "" }, { "docid": "4225b137937c0200a40b2d8cdc147cfb", "score": "0.6407548", "text": "def sum(list)\n list.inject(:+)\nend", "title": "" }, { "docid": "4225b137937c0200a40b2d8cdc147cfb", "score": "0.6407548", "text": "def sum(list)\n list.inject(:+)\nend", "title": "" }, { "docid": "4225b137937c0200a40b2d8cdc147cfb", "score": "0.6407548", "text": "def sum(list)\n list.inject(:+)\nend", "title": "" }, { "docid": "2d79a2c61c3d1950bcfe909767665c66", "score": "0.64051294", "text": "def ThreeFiveMultiples(num)\n mult_arr = (1..num).to_a\n total = []\n mult_arr.each do |digit|\n three_mult = digit * 3\n five_mult = digit * 5\n total << three_mult if three_mult < num\n total << five_mult if five_mult < num\n end\n num <= 3 ? p(0) : p(total.reduce(&:+))\nend", "title": "" }, { "docid": "0a12d2da634238b0606ad69ca2f10841", "score": "0.64014435", "text": "def crazy_sum(numbers)\r\n numbers.map.with_index {|x, i| x * i}.reduce(&:+)\r\nend", "title": "" }, { "docid": "775ea30b19098822f46b58f13e46d8b6", "score": "0.6399651", "text": "def problem1(n)\n\tmultiples = (0..n-1).to_a\n\tmultiples.reject! {|i| i % 3 != 0 and i % 5 != 0}\n\tmultiples.inject {|sum,i| sum + i}\nend", "title": "" }, { "docid": "965e607d39177eb6196595df14ff3773", "score": "0.6399633", "text": "def solution(x)\n sum = 0\n (1...x).each do |element|\n next if element % 3 != 0 && element % 5 != 0\n next if element % 3 == 0 && element % 5 == 0\n \n sum += element\n end\n sum\nend", "title": "" }, { "docid": "900fff8ab52d956381dc0b627f44e07f", "score": "0.6398553", "text": "def oneliner(a)\n a.sort!.each_with_index.map { |n, i| (1 << i) * (n - a[a.size - 1 - i]) }.reduce(:+) % (10**9 + 7)\nend", "title": "" }, { "docid": "1a33557053e43aece0c53df69dbe021f", "score": "0.63975656", "text": "def sum_three_or_five_array\r\n three_or_five_array.inject(:+)\r\nend", "title": "" }, { "docid": "e41b1f0111edb3c2286a676ccc1ad405", "score": "0.6397297", "text": "def problem_6(num = 100)\n (1..num).reduce {|a,n| a + n } ** 2 -\n (1..num).reduce {|a,n| a + n*n }\nend", "title": "" }, { "docid": "8e58227a09499884296b061f7e50b6c9", "score": "0.6395121", "text": "def sum(numbers)\n numbers.inject(0, :+)\nend", "title": "" }, { "docid": "8e58227a09499884296b061f7e50b6c9", "score": "0.6395121", "text": "def sum(numbers)\n numbers.inject(0, :+)\nend", "title": "" }, { "docid": "346dd99810d6f1e5b9249b7133ba1027", "score": "0.63930786", "text": "def summation(num)\n arr = 1..num\n arr.reduce(&:+)\nend", "title": "" }, { "docid": "3bcd9335b4b65f0de1d681e6e890c32d", "score": "0.6385223", "text": "def solution_28\n def f(n)\n if n == 1\n return [1]\n else\n start = f(n-2).last + (n-1)\n return (0..3).map { |i| start + (n-1)*i }\n end\n end\n sum = 0\n 1.step(1001, 2) { |i| sum += f(i).reduce(:+) }\n sum\n end", "title": "" }, { "docid": "89a0798fb90a875b764545b8035ccc3a", "score": "0.6384553", "text": "def triangle(n)\n 1.upto(n).inject(:+)\nend", "title": "" }, { "docid": "40c3a736d167abf9bc450f72cd16da56", "score": "0.63833225", "text": "def multisum(num)\n array_of_5s = []\n (1..num).each { |n| array_of_5s.push(n) if n % 5 == 0 || n % 3 == 0 }\n array_of_5s.inject(:+)\n\nend", "title": "" }, { "docid": "fc3a5db55facdc764fb8cecbc9ded8c8", "score": "0.6377403", "text": "def running_sum(nums)\n ans = []\n temp = 0\n for x in nums\n temp += x\n ans << temp\n end\n ans\nend", "title": "" }, { "docid": "2553c92a6af0d1d9517296e6352a198d", "score": "0.6375703", "text": "def total_product_sequence(num)\n base = [1, 2, 3]\n if num <= 3\n return base[num - 1]\n end\n\n while base.length < num\n base << base.reduce(:*)\n end\n\n return base[-1]\nend", "title": "" }, { "docid": "df618c9e178202571bd38676ef522661", "score": "0.63738674", "text": "def sum_array(numbers)\n numbers.inject(:+)\nend", "title": "" }, { "docid": "cacfcee9f4f36db314894b97089ed377", "score": "0.63657755", "text": "def example2()\n\tarr = 1.upto($limit).each_with_index.map {|index| if (divisorSum(index) > index + 1) then index end}.compact\n\t#arr.each_with_index { |n,index| if(n.nil? == false) then printf \"index %d = %d\\n\",index, n end }\n\t#p divisorSum(16)\n\t#p arr\n\t#arr = arr.product(arr)\n\t#arr2 = {}\n\tarr.sort\n\tarr2 = []\n\ti = 0\n\twhile (i < arr.length)\n\t\tj = 0\n\t\twhile(j < arr.length)\n\t\t#if(arr[i] + arr[j] <= $limit and arr2[arr[i] + arr[j]].nil? == false) then\n\t\t#\tarr2.merge(i => arr[i] + arr[j])\n\t\t#end\n\t\tif(arr[i] + arr[j] <= $limit) then\n\t\t\tarr2.push(arr[i] + arr[j])\n\t\telse\n\t\t\tbreak\n\t\tend\n\t\tj = j +1\n\t\tend\n\t\ti = i + 1\n\tend\n\tarr2 = arr2.uniq!\n\tp arr2\n\t#p \"---------------------\"\n\t#arr = arr.map {|mylist| mylist.reduce(:+) }.uniq!\n\ttotal = 0\n\t1.upto($limit) do |index|\n\t\tif(arr.include?(index) == false) then\n\t\t\ttotal = total + index\n\t\t\t#p index\n\t\tend\n\tend\n\ttotal\nend", "title": "" }, { "docid": "b3a4f0ae65612fc71e682f5ebd8dd057", "score": "0.63648736", "text": "def total(num_list)\r\n\treturn num_list.inject { |sum, n| sum + n }\r\nend", "title": "" }, { "docid": "e22211acfa5ee2ce035700044cce6d12", "score": "0.6363154", "text": "def solution(n)\n (1..n).reduce(:*).to_s.split(//).inject(0) { |a,n| a + n.to_i }\nend", "title": "" }, { "docid": "b1c288e399d873a4cdbd521194e97513", "score": "0.6363035", "text": "def total_initial(array)\n\tarray.inject(:+)\nend", "title": "" }, { "docid": "41a5216fa30a6dd3b3644d43dfa76e26", "score": "0.6357384", "text": "def linked_list_sum\r\n [first.join.to_i, last.join.to_i].reduce(:+).to_s.each_char.map(&:to_i).reverse\r\n end", "title": "" }, { "docid": "ab13530de33cef6420f1441295e65b27", "score": "0.63552785", "text": "def problem6(num)\n\tnumbers = (1..num).to_a\n\n\tsum1 = 0\n\tnumbers.each {|number| sum1 += number**2}\n\n\tsum2 = 0\n\tnumbers.each {|number| sum2 += number}\n\n\treturn sum2**2 - sum1\nend", "title": "" }, { "docid": "f96a745dcadd1d5e49b73809669ca63c", "score": "0.635419", "text": "def sum x #x is the limit of the problem, here it is 1000\n\tarrayofNumbers = []\n\tn = 0\n\twhile n < x # integer n\n\t\tif n % 3 == 0 || n % 5 == 0\n\t\t\tarrayofNumbers << n\n\t\tend\n\t\tn += 1\n\tend # could do a while loop for the array addition, but thats proably unncessary computing power\n\tanswer = arrayofNumbers.inject(0, :+) # (a, b) a denotes what number you start with, :+ probably is the addtion function\nend", "title": "" }, { "docid": "9af927911f629da51fdb3efe925ea401", "score": "0.6353909", "text": "def sum_of_range(array)\n # range = (highest - lowest) + 1\n # start with lowest number\n # add number to number + 1\n # do this range times\n array.sort!\n a = array.first # 1\n b = array.last # 4\n\n (a..b).inject { |sum, n| sum + n}\n\nend", "title": "" }, { "docid": "66bf8bbfd2cc05369d55552608163874", "score": "0.6348642", "text": "def calculate_sum(num)\n (1..num).inject(:+) \nend", "title": "" }, { "docid": "419ebd87b1e9c2e403d0b6979705350c", "score": "0.6345645", "text": "def score(a,value); return value if a.count == 0; value + a.map{|n| score(n, value+1)}.inject(&:+); end", "title": "" }, { "docid": "358ecc621be465ad59e186a455adb35e", "score": "0.6344916", "text": "def running_total(array)\n new = [] \n array.each { |i| new << i + (new[-1] or 0) }\n new\nend", "title": "" }, { "docid": "01bcd437a3e3b0357d47277d8200dafb", "score": "0.6343067", "text": "def running_total_two(numbers)\n number = 0\n numbers.inject(list_total = []) do |list_total, num|\n list_total << number += num\n end\nend", "title": "" }, { "docid": "ad6d5127b6b879b092198b412822dbfd", "score": "0.6339244", "text": "def summation(num)\n (1..num).reduce(:+)\nend", "title": "" }, { "docid": "d3d9f3a64f2dd1d91c7f1c49e873e662", "score": "0.63383764", "text": "def total (nums)\n nums.inject{|number,x| number + x }\nend", "title": "" }, { "docid": "991dd0155f0195fff34e13bac17fe48d", "score": "0.63374376", "text": "def sum_of_sums(numbers)\n sum = 0\n numbers.size.times do |index|\n sum += numbers[0,index + 1].reduce(:+)\n end\n sum\nend", "title": "" }, { "docid": "12b7b7ad42f1349a9a48d998ee65e20d", "score": "0.63368577", "text": "def sum (nums)\nnums.inject(0, :+)\nend", "title": "" }, { "docid": "a387d870fa4ca92305d630bb72a3ff33", "score": "0.6330021", "text": "def rec_sum(nums)\nend", "title": "" }, { "docid": "a387d870fa4ca92305d630bb72a3ff33", "score": "0.6330021", "text": "def rec_sum(nums)\nend", "title": "" }, { "docid": "94c857e7c803c80ab035b5a36c4c74bf", "score": "0.6325565", "text": "def sum_of_sums(numbers)\n amount = numbers.length\n temp_array = []\n numbers.each do |num|\n amount.times {temp_array << num}\n amount -= 1\n end\n # at this point if numbers = [3,5,2]\n # temp array = [3,3,3,5,5,2]\n temp_array.reduce(:+)\nend", "title": "" }, { "docid": "3a5474564f89c269feb33f42f2fbe945", "score": "0.63229966", "text": "def tetragon_ring\n [*1..6].reverse.permutation do |a,b,c,d,e,f|\n sum = a+d+e\n next unless b+e+f == sum && c+f+d == sum && a < b && a < c\n return [[a,d,e],[b,e,f],[c,f,d]].flatten.join.to_i\n end\nend", "title": "" }, { "docid": "ca56a89cdf5eeb344784321a1387c0fc", "score": "0.6318613", "text": "def compute_depth_two_electric_boogaloo n\n result, multiplier = [], 0\n -> { multiplier += 1 ; result.concat((n*multiplier).to_s.split('')).uniq! }.call until result.length == 10\n multiplier\nend", "title": "" }, { "docid": "bd791a132c3dfb8e9803b13163a9bbf5", "score": "0.63152575", "text": "def solution(number)\n answer = (number - 1).downto(3).to_a.each_with_object([]) do |item, arr|\n \t\tif item % 15 == 0\n \t\t\tarr << item\n \t\telsif item % 5 == 0\n \t\t\tarr << item\n \t\telsif item % 3 == 0\n \t\t\tarr << item\n \t\tend\n end.inject(:+)\nend", "title": "" }, { "docid": "534c66e2c2fe25e7e29e1e3b3931d3af", "score": "0.63091224", "text": "def total(numbers)\n numbers.map { |n| n.to_i }.inject { |sum, i| i + sum }\nend", "title": "" }, { "docid": "57e6b6503e72bacc8b37c0cb0f47b381", "score": "0.6303384", "text": "def multisum(num)\n result_arr = []\n \n (1..num).to_a.each do |current_num|\n if current_num % 3 == 0\n result_arr << current_num\n elsif current_num % 5 == 0\n result_arr << current_num\n end\n end\n p result_arr.reduce(:+)\nend", "title": "" }, { "docid": "f446779cdcc04db68af5c91d3d4b7542", "score": "0.62931854", "text": "def sum_of_multiples(target, factors) \n multiples = []\n factors = [3, 5] if factors.length == 0\n\n factors.each do |factor|\n current_multiple = factor\n\n while current_multiple < target\n multiples << current_multiple\n current_multiple += factor\n end\n end\n multiples.uniq.inject(0, :+)\n\nend", "title": "" }, { "docid": "ba86babcf40b2447de44565b2b762d8c", "score": "0.62926894", "text": "def four_sum(nums, target)\n nums.sort!\n res = []\n\n (0...nums.length - 3).each do |i|\n if i == 0 || nums[i] != nums[i - 1]\n (i + 1...nums.length - 2).each do |j|\n if j == i + 1 || nums[j] != nums[j - 1]\n low = j + 1\n high = nums.length - 1\n\n while low < high\n if nums[i] + nums[j] + nums[low] + nums[high] == target\n res << [nums[i], nums[j], nums[low], nums[high]]\n low += 1\n high -= 1\n\n low += 1 while nums[low] == nums[low - 1]\n high -= 1 while nums[high] == nums[high + 1]\n elsif nums[i] + nums[j] + nums[low] + nums[high] > target\n high -= 1\n else\n low += 1\n end\n end\n end\n end\n end\n end\n \n res\nend", "title": "" }, { "docid": "ee5cc5a000afac255da0182b96165ee1", "score": "0.62916106", "text": "def sum_numbers(numbers)\n # numbers.reduce(0) { |acc, i| i+acc }\n numbers.inject {|acc, n| acc + n}\nend", "title": "" }, { "docid": "10744c9259954c6bedde02579e6b6692", "score": "0.6291037", "text": "def v2(list)\n tally = list[0]\n other_tally = 0\n list.each do |el|\n if other_tally + el >= 0\n other_tally += el\n else\n other_tally = 0\n end\n if tally < other_tally\n tally = other_tally\n end\n end\n tally\nend", "title": "" }, { "docid": "7a007b872ce37620e3363cea2761da98", "score": "0.6288823", "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": "886dfce2708317d11c432a74263f65af", "score": "0.62857205", "text": "def sum_nums(num)\n return (1..num).inject(&:+)\nend", "title": "" }, { "docid": "d9734dafd7965abbd9f9174109526eee", "score": "0.6285116", "text": "def sum_of_all_numbers(number)\n i = 0\n numbers = []\n\n while i < number\n numbers.push(i)\n i += 1\n end\n\n puts numbers\n puts '-----'\n puts numbers.inject(:+)\n\nend", "title": "" }, { "docid": "ccf31ad02041cb1597dd906996a77b4f", "score": "0.6281976", "text": "def total(list_of_numbers)\r\n p list_of_numbers.reduce(:+)\r\nend", "title": "" }, { "docid": "182b965d9abdca43344f62a388cec8fb", "score": "0.6274137", "text": "def sums(arr)\n sum = []\n (0...arr.length-1).each do |num|\n sum << arr[num] + arr[num + 1]\n # p arr[num]\n # p arr[num+1]\n end\n sum\nend", "title": "" }, { "docid": "ed99ac6eac0a05775ec987bd80f73466", "score": "0.6273885", "text": "def summingSeries(n)\n (((2*(n**2)) - (3*n) + 2) % (7+10e9)).to_i\nend", "title": "" }, { "docid": "385eb116a47b69bdb6b09db93955350e", "score": "0.62732", "text": "def it_sum(arr)\n arr.inject {|sum, n| sum+n}\nend", "title": "" }, { "docid": "ccf364986efe87d5c6ca672891915835", "score": "0.62723225", "text": "def aVeryBigSum(n, ar)\n ar.inject(:+)\nend", "title": "" }, { "docid": "afb1336de38d590fb931a548b1a6e7ab", "score": "0.6271791", "text": "def multisum(num)\n list = []\n x=0; y=0; z = 0\n while x < num\n x += 3 ; y += 5\n list.push(x) unless x > num || list.include?(x)\n list.push(y) unless y > num\n end\n list.each {|i| z += i}\n return z\nend", "title": "" }, { "docid": "d130629f6bcbfe40f3b4dec12943647f", "score": "0.6269398", "text": "def compute_sum(num)\n (1..num).inject(:+)\nend", "title": "" }, { "docid": "f890715a259ef8a06ec60b3f8a826807", "score": "0.6268072", "text": "def addarray(n,list)\n for i in 0..list.length-1\n total=0\n for p in 0..list.length-1\n current=list[i]+list[p]\n if current==n\n puts \"#{list[i]} added to #{list[p]} equals #{n}\"\n else\n total=total+current\n if total==n\n for q in 0..p\n put \"#{list[q]} + \"\n end\n puts \"is equal to #{n}\"\n end\n end\n end\n end\nend", "title": "" }, { "docid": "50574ca0e88cadaea976b333372fc4c4", "score": "0.6267048", "text": "def total_of_array(array)\n array.inject(&:+)\nend", "title": "" }, { "docid": "50574ca0e88cadaea976b333372fc4c4", "score": "0.6267048", "text": "def total_of_array(array)\n array.inject(&:+)\nend", "title": "" }, { "docid": "804e4788d168882e2700e6ec11c0589f", "score": "0.6260801", "text": "def compute_sum(number)\r\n (1..number).reduce(:+)\r\nend", "title": "" }, { "docid": "ab7a9afd8764362d37bc0ca38456503d", "score": "0.6257413", "text": "def three_sum(nums)\n nums, result = nums.sort, []\n for i in (0..nums.length - 3)\n p1, p2 = i + 1, nums.length - 1 \n if i == 0 || nums[i] > nums[i - 1]\n while p1 < p2 \n s = nums[i] + nums[p1] + nums[p2]\n if s < 0 \n p1 += 1\n elsif s > 0\n p2 -= 1\n else \n result << [nums[i], nums[p1], nums[p2]] \n while p1 < p2 && nums[p1] == nums[p1 + 1]\n p1 += 1\n end\n while p1 < p2 && nums[p1] == nums[p2 - 1]\n p2 -= 1\n end\n p1 += 1; p2 -= 1\n end\n end\n end\n end\n result\nend", "title": "" }, { "docid": "a682f6057f39f91eb14157c00f56edbc", "score": "0.6256829", "text": "def sum ary\n ary.inject {|sum, n| sum + n}\nend", "title": "" }, { "docid": "86e8324d4292c9312d64eae6f2041796", "score": "0.625682", "text": "def solution_21\n def d(n)\n divisors = divisor_list(n)\n divisors.delete(n)\n divisors.reduce(:+)\n end\n result = 0\n (2..9999).each do |a|\n b = d(a)\n result += a if a == d(b) and a != b\n end\n result\n end", "title": "" }, { "docid": "387e4191f9981558a29a9e2fa1500fd2", "score": "0.6256387", "text": "def consecutive_sum(number)\n (1..number).reduce(:+)\nend", "title": "" }, { "docid": "0c34fce6e8bed0131e01d6558805a8ab", "score": "0.6250651", "text": "def solution(number)\n naturals = (0..(number - 1)).collect do |n|\n n if (n % 3).zero? || (n % 5).zero?\n end\n naturals.compact.inject(:+).to_i\nend", "title": "" } ]
063389526a1df2178b2262a561203520
The total duration of the replayed data, in seconds
[ { "docid": "b208be933411e58db80c163d0804405d", "score": "0.0", "text": "def duration\n intervals = used_streams.map { |s| s.info.interval_lg }\n min = intervals.map(&:first).min\n max = intervals.map(&:last).max\n if min && max\n max - min\n else 0\n end\n end", "title": "" } ]
[ { "docid": "32a2bebc7cdb4f32b204d08756d08ac9", "score": "0.79164404", "text": "def total_duration; end", "title": "" }, { "docid": "32a2bebc7cdb4f32b204d08756d08ac9", "score": "0.79164404", "text": "def total_duration; end", "title": "" }, { "docid": "b338fe16c2e56e0414ce7589e785f7cc", "score": "0.778581", "text": "def duration\n @timed_stats.sum\n end", "title": "" }, { "docid": "77d17526f26e399d2b1ce573cc3c5662", "score": "0.7576585", "text": "def duration\n @duration ||= (self.end - time) * 1000.0\n end", "title": "" }, { "docid": "edcb6d59b0ab279b0adaa72cd91ebe67", "score": "0.75472397", "text": "def duration\n data.duration\n end", "title": "" }, { "docid": "ae079dd3e8a5071f8445e81041089772", "score": "0.754105", "text": "def total_duration\n\t\tinject(0) {|memo, song| memo + song.duration }\n\tend", "title": "" }, { "docid": "1508ea0cadf2c66fa1765fc8f4b7138c", "score": "0.7440027", "text": "def duration_ms; end", "title": "" }, { "docid": "4c0b55845c2dfc0aec9df7ba641c120d", "score": "0.74394476", "text": "def duration\n @data[:d]\n end", "title": "" }, { "docid": "4c0b55845c2dfc0aec9df7ba641c120d", "score": "0.74394476", "text": "def duration\n @data[:d]\n end", "title": "" }, { "docid": "0f63e0205a498d1f3222b66428109222", "score": "0.74121165", "text": "def duration\n stream['duration'].to_f\n end", "title": "" }, { "docid": "a7e5629fc62462a7756b53952f2ae328", "score": "0.73810893", "text": "def duration; end", "title": "" }, { "docid": "a7e5629fc62462a7756b53952f2ae328", "score": "0.73810893", "text": "def duration; end", "title": "" }, { "docid": "a7e5629fc62462a7756b53952f2ae328", "score": "0.73810893", "text": "def duration; end", "title": "" }, { "docid": "a7e5629fc62462a7756b53952f2ae328", "score": "0.73810893", "text": "def duration; end", "title": "" }, { "docid": "a7e5629fc62462a7756b53952f2ae328", "score": "0.73810893", "text": "def duration; end", "title": "" }, { "docid": "a7e5629fc62462a7756b53952f2ae328", "score": "0.73810893", "text": "def duration; end", "title": "" }, { "docid": "a7e5629fc62462a7756b53952f2ae328", "score": "0.73810893", "text": "def duration; end", "title": "" }, { "docid": "a7e5629fc62462a7756b53952f2ae328", "score": "0.73810893", "text": "def duration; end", "title": "" }, { "docid": "6a01461e439f078de1f13d25605cf824", "score": "0.7375067", "text": "def duration\n @duration ||= 1000.0 * (self.end - time)\n end", "title": "" }, { "docid": "91dab93f1a8a2d43341790337a7f62aa", "score": "0.7370989", "text": "def duration\n return Time.at(@total_time/1000.0).getgm.strftime('%R:%S')\n end", "title": "" }, { "docid": "51e77e284682f099545f1868779f45ad", "score": "0.7322658", "text": "def duration\n 1000.0 * (self.end - time)\n end", "title": "" }, { "docid": "76770cfe18280973ba8453eefc982526", "score": "0.7314894", "text": "def duration\n ((@frame_count / @frame_rate.to_f * 10**5).round.to_f / 10**5 * 1000).round\n end", "title": "" }, { "docid": "586b3120a7a36a7fb3f63436f058b93d", "score": "0.7286259", "text": "def duration\n @duration || 0\n end", "title": "" }, { "docid": "eac9536e8686bff81ad69ddacd6207ec", "score": "0.72709113", "text": "def duration\n if @clear_time\n return @clear_time - Game.instance.frame_time\n end\n end", "title": "" }, { "docid": "e8e28a330b93631dadd2d495acc0b2ad", "score": "0.7261337", "text": "def total_duration\n n = 0.0\n @durations.values.each{ |d| n += d }\n n\n end", "title": "" }, { "docid": "97af6553f5fa071028e75794a5726327", "score": "0.72557396", "text": "def record_duration\n CONFIG[:settings][:pre_roll].to_i + CONFIG[:settings][:post_roll].to_i + self.duration\n end", "title": "" }, { "docid": "e24e4c3bf981085d1fc58f244a8ac1e0", "score": "0.7227191", "text": "def total_time; end", "title": "" }, { "docid": "e24e4c3bf981085d1fc58f244a8ac1e0", "score": "0.7227191", "text": "def total_time; end", "title": "" }, { "docid": "e24e4c3bf981085d1fc58f244a8ac1e0", "score": "0.7227191", "text": "def total_time; end", "title": "" }, { "docid": "1fc7b683ef11258fc0bdfeec636b1ef6", "score": "0.72170603", "text": "def duration\n @duration.to_i\n end", "title": "" }, { "docid": "c6f664962219a601ca8abac476c087ef", "score": "0.72006756", "text": "def duration\n @sessions.map(&:duration).reduce(&:+)\n end", "title": "" }, { "docid": "c6f664962219a601ca8abac476c087ef", "score": "0.72006756", "text": "def duration\n @sessions.map(&:duration).reduce(&:+)\n end", "title": "" }, { "docid": "b4e79a608ce56ef1036e99ea1bf31707", "score": "0.71653014", "text": "def duration\n @duration\n end", "title": "" }, { "docid": "7698fa6a64c7598e2fe096f3b1837f22", "score": "0.71575123", "text": "def total_duration=(_); end", "title": "" }, { "docid": "8fcb727dd368b9c32c4b1c09fe19fa94", "score": "0.7151421", "text": "def total_time\n @entries.reduce(0) { |sum, entry| sum + entry.duration }\n end", "title": "" }, { "docid": "df77b0a41d28d8f7611f2c66a36e95bc", "score": "0.71353483", "text": "def duration\n @rows.last.time / 10000.0\n end", "title": "" }, { "docid": "6532cdc7aef268680d91be3ae0748699", "score": "0.7122924", "text": "def duration\n return @duration\n end", "title": "" }, { "docid": "6532cdc7aef268680d91be3ae0748699", "score": "0.7122924", "text": "def duration\n return @duration\n end", "title": "" }, { "docid": "6532cdc7aef268680d91be3ae0748699", "score": "0.7122924", "text": "def duration\n return @duration\n end", "title": "" }, { "docid": "6532cdc7aef268680d91be3ae0748699", "score": "0.7122924", "text": "def duration\n return @duration\n end", "title": "" }, { "docid": "6532cdc7aef268680d91be3ae0748699", "score": "0.7122924", "text": "def duration\n return @duration\n end", "title": "" }, { "docid": "6532cdc7aef268680d91be3ae0748699", "score": "0.7122924", "text": "def duration\n return @duration\n end", "title": "" }, { "docid": "bede4fa175a93c426805bd128c3ae8e5", "score": "0.7086909", "text": "def total_playtime_ms\n self[:total_playtime_ms] || SegmentHistory.where(segment: segments).sum(:realtime_duration_ms)\n end", "title": "" }, { "docid": "6ffb87be9b6428a325fae0e8b22fb909", "score": "0.7075259", "text": "def call_recording_duration\n return @call_recording_duration\n end", "title": "" }, { "docid": "f8c7f71b2d36aa86ca5b9e5a8a806418", "score": "0.7065121", "text": "def duration\n __duration\n end", "title": "" }, { "docid": "f8c7f71b2d36aa86ca5b9e5a8a806418", "score": "0.7065121", "text": "def duration\n __duration\n end", "title": "" }, { "docid": "3bc1c2b36a55702ad2db08288b4fb7eb", "score": "0.70531964", "text": "def duration\n @duration ||= @av_format_ctx[:duration].to_f / AV_TIME_BASE\n end", "title": "" }, { "docid": "a34b6da51592b16dacc309438d7e9893", "score": "0.70474714", "text": "def duration\n @resolution / @rate\n end", "title": "" }, { "docid": "254621f7bfb84074bcbd5faa94f4691e", "score": "0.7046863", "text": "def to_seconds\n (@total / @fps)\n end", "title": "" }, { "docid": "d6f16c5233dc49dacb37905b38634b64", "score": "0.70468086", "text": "def duration\n\t\tdur_total = 0\n\t\[email protected] do |song|\n\t\t\tdur_total += song.duration\n\t\tend\n\t\treturn dur_total\n\tend", "title": "" }, { "docid": "4f29918b44e6e4e4217ca6f0573f3c8d", "score": "0.7045993", "text": "def duration\n return (@endtime.to_i - @starttime.to_i)\n end", "title": "" }, { "docid": "d27b3490b82ee2d73742cd2bf8746bd2", "score": "0.70424515", "text": "def duration\n @end_time - @start_time\n end", "title": "" }, { "docid": "9ce90f9038b0089f8562493fb5cdba8f", "score": "0.7023985", "text": "def duration\n self.stop - self.start\n end", "title": "" }, { "docid": "37de9ca6872313d95dd03d6d3cb0a24a", "score": "0.70218366", "text": "def total_playtime\n Duration.new(self[:total_playtime_ms] || SegmentHistory.where(segment: segments).sum(:realtime_duration_ms))\n end", "title": "" }, { "docid": "92abf3ccaec35d0c5e5e43366737d36b", "score": "0.7020494", "text": "def duration\n (@entries.last.time - @entries.first.time) / 1000.0\n end", "title": "" }, { "docid": "ebad0d511e71bfb7e9cf59814cc18f86", "score": "0.6997928", "text": "def duration\n end_time - start_time\n end", "title": "" }, { "docid": "2434f96e07c5f19f2d0e19c73bc97495", "score": "0.6995596", "text": "def duration\n self.end - self.begin\n end", "title": "" }, { "docid": "2434f96e07c5f19f2d0e19c73bc97495", "score": "0.6995596", "text": "def duration\n self.end - self.begin\n end", "title": "" }, { "docid": "1dbe3849ffef0b28a2e180ea95f368da", "score": "0.699157", "text": "def duration()\n self.end.to_f - self.start.to_f\n end", "title": "" }, { "docid": "9537081d5dcc8baf7a8e4ad6eef4cd99", "score": "0.6988481", "text": "def duration \n (finished_on - started_on).to_f.round(2) rescue 0.0\n end", "title": "" }, { "docid": "222861ac116c65f8749e7f8606c8fbd3", "score": "0.6983217", "text": "def in_seconds; end", "title": "" }, { "docid": "222861ac116c65f8749e7f8606c8fbd3", "score": "0.6983217", "text": "def in_seconds; end", "title": "" }, { "docid": "c045818b13bb0b398872127f66813438", "score": "0.69616437", "text": "def esteemed_total_seconds\n @esteemed_total_seconds ||= compute_total_seconds\n end", "title": "" }, { "docid": "c392e8dd9b424a645b9baf1101422f5c", "score": "0.6960319", "text": "def total_duration\n\t\thh_mm_sec physical_objects.inject(0){|sum, p| p[:duration].to_i + sum }\n\tend", "title": "" }, { "docid": "9496a312ce103c51a671d5d5c643da65", "score": "0.6951737", "text": "def duration\n self.audio_block.duration\n end", "title": "" }, { "docid": "7e86cac3159868d8265918af7c024fe4", "score": "0.6948497", "text": "def duration\n @values[:duration] || 0\n end", "title": "" }, { "docid": "cc4040e2d80f1baf1f8aefa5689b5b30", "score": "0.6947532", "text": "def duration\n return if end_time.nil?\n\n (end_time - start_time) * 1000.0\n end", "title": "" }, { "docid": "395b36b6839f7ece61051dce80e17bd4", "score": "0.6947346", "text": "def duration\n self.end_time.to_i - self.start_time.to_i\n end", "title": "" }, { "docid": "2defa7c25f077042faed1756d5ddb945", "score": "0.69419104", "text": "def duration()\n return (end_time - start_time) #will return in seconds because Time class method\n end", "title": "" }, { "docid": "1dcb0af025852daf82ed59b441d41fc3", "score": "0.69344825", "text": "def duration\n @tracks.map(&:duration).compact.inject(:+)\n end", "title": "" }, { "docid": "01d0fc93a79063864114519cee6e6680", "score": "0.6931126", "text": "def duration\n return @track_len.parse[1]/Gst::MSECOND\n end", "title": "" }, { "docid": "64a35b9087e7c4e3fcc1f306bd723572", "score": "0.6928252", "text": "def duration\n\t\t\tetime = self.completed || Time.now\n\t\t\tetime.to_f - self.created.to_f\n\t\tend", "title": "" }, { "docid": "b57ae898ecf01738b836f9e70d7129b6", "score": "0.69274193", "text": "def total_duration\n Duration.new(total_sample_frames, @format.sample_rate)\n end", "title": "" }, { "docid": "b57ae898ecf01738b836f9e70d7129b6", "score": "0.69274193", "text": "def total_duration\n Duration.new(total_sample_frames, @format.sample_rate)\n end", "title": "" }, { "docid": "19944fa670e5e76c32c0a8e991e1e903", "score": "0.6925516", "text": "def duration\n @duration ||= @av_format_context[:duration].to_f / AV_TIME_BASE\n end", "title": "" }, { "docid": "6e236837b83ebad9752eb7e08568db40", "score": "0.6920782", "text": "def duration\n if completed?\n Integer(completed_at - started_at)\n end\n end", "title": "" }, { "docid": "e339e0460f826619ef9d40048dd7f6ce", "score": "0.6911725", "text": "def duration\n @duration ||= sound_info[:length_seconds] - offset\n end", "title": "" }, { "docid": "b862a7eed5af9db44611044fd4cfb9d8", "score": "0.6910355", "text": "def duration_in_seconds\n object.runtime\n end", "title": "" }, { "docid": "f6f66c0b8e6ebe4cf75244f5bd2b5bd1", "score": "0.6909737", "text": "def duration\n return @gstbin.query_duration(Gst::Format::TIME)[1]/Gst::MSECOND\n end", "title": "" }, { "docid": "9f1df83107b509dbd8a2d2234f0a7f79", "score": "0.69089305", "text": "def current_duration\n if (FFMpeg.log || []).join =~ /Duration: ([\\w|:|.]+)/\n colon_time_to_seconds($1)\n end\n end", "title": "" }, { "docid": "fc1fc3d1084440ea3401dde1eb4799f4", "score": "0.69050986", "text": "def duration\n self.end_time - self.start_time\n end", "title": "" }, { "docid": "d720bcd4a7ce3a225e741c5ce2ee3d1b", "score": "0.6901313", "text": "def calculate_duration\n @duration = 0\n if @tracks.nil? || @tracks.empty? || @tracks[0].segments.nil? || @tracks[0].segments.empty?\n return @duration\n\n end\n\n @duration = (@tracks[-1].segments[-1].points[-1].time - @tracks.first.segments.first.points.first.time)\n rescue StandardError\n @duration = 0\n end", "title": "" }, { "docid": "4aabf01ed2daf095d82a51c4cf53821e", "score": "0.6900882", "text": "def duration\n track_points.last.time.to_f - track_points.first.time.to_f\n end", "title": "" }, { "docid": "34b5906fc3146c18260749949c85e086", "score": "0.6899452", "text": "def elapsed\n ((Time.now.to_f - started) * 1000).round(3)\n end", "title": "" }, { "docid": "938e8ade2ab929ce730e7262c89a1be7", "score": "0.68947035", "text": "def getTime\n if @timeStart != nil\n return @totalDuration + (Time.now() - @timeStart)\n else\n return @totalDuration\n end\n end", "title": "" }, { "docid": "02a2e0f8ec281b3cdf2fc42b16833ddb", "score": "0.6892989", "text": "def playback_length\n\t @playback_time_length ||= 0\n\t end", "title": "" }, { "docid": "1dfb8a440c2c76c3a2068c9fd6fde9c4", "score": "0.6892381", "text": "def duration\n return (@stop_time - @start_time)/60.0\n end", "title": "" }, { "docid": "1d67a080c61af927fe919bc951e0eadf", "score": "0.68710744", "text": "def duration\n 10.seconds\n end", "title": "" }, { "docid": "418041bb82653b6dfefc73db9bef5b1f", "score": "0.6870699", "text": "def get_duration\n return (@end_time - @start_time).to_i if !is_in_progress?\n end", "title": "" }, { "docid": "50973cfa2c590a11c5e174e26cb16760", "score": "0.68602127", "text": "def duration\n @duration ||= begin\n duration = @test_case['time']\n duration ? duration.to_f : nil\n end\n end", "title": "" }, { "docid": "50973cfa2c590a11c5e174e26cb16760", "score": "0.68602127", "text": "def duration\n @duration ||= begin\n duration = @test_case['time']\n duration ? duration.to_f : nil\n end\n end", "title": "" }, { "docid": "6fa07c5f6c42f7ccae6acbfcb39c21be", "score": "0.68570507", "text": "def return_time\n return @totalTime\n end", "title": "" }, { "docid": "b82066c67fdccc0ebb55a90d4f656293", "score": "0.68532205", "text": "def seconds; end", "title": "" }, { "docid": "b82066c67fdccc0ebb55a90d4f656293", "score": "0.68532205", "text": "def seconds; end", "title": "" }, { "docid": "b82066c67fdccc0ebb55a90d4f656293", "score": "0.68532205", "text": "def seconds; end", "title": "" }, { "docid": "b82066c67fdccc0ebb55a90d4f656293", "score": "0.68532205", "text": "def seconds; end", "title": "" }, { "docid": "b82066c67fdccc0ebb55a90d4f656293", "score": "0.68532205", "text": "def seconds; end", "title": "" }, { "docid": "cffc80bd87933b2742c29606c19ac057", "score": "0.68481386", "text": "def duration\n return @notes.inject(0) { |sum, note| sum + note.duration }\n end", "title": "" }, { "docid": "2d4ca4eb6346bd2696f970664b116f7c", "score": "0.6846155", "text": "def duration\n @duration ||= (@response[\"rows\"][0][\"elements\"][0][\"duration\"][\"value\"]).to_f / 60\n end", "title": "" }, { "docid": "14fa3192ae61d3762fc4a17698ff6ad7", "score": "0.68435913", "text": "def duration\n (self.end - start).round\n end", "title": "" }, { "docid": "e15ddf0a9ba25c1c0e434d8000175a32", "score": "0.6839173", "text": "def duration\n if @titulo.rm_tipo_instrumento.codigo == 38 # Letras del Tesoro\n ((@detalle.fecha_venc - @detalle.fecha_snapshot).to_f / 364 )\n else\n \t ((1 + rendimiento_efectivo) / rendimiento_efectivo) - ( ((vida_titulo_anualizada*((tasa/100.0) - rendimiento_efectivo)) + (1 + rendimiento_efectivo)) / ( ((tasa/100.0) * (1 + rendimiento_efectivo)** vida_titulo_anualizada ) - ((tasa/100.0) - rendimiento_efectivo)) ) \n end\n end", "title": "" } ]
ef893008b4e080829b72502070536337
separates args into tag or subcommand and items This allows user to pass e.g. a priority first and then item list or item list first and then priority. This can only be used if the tag or pri or status is nonnumeric and the item is numeric.
[ { "docid": "120170b1c8ef7dd7a338c892a5b21c08", "score": "0.6175047", "text": "def _separate args, pattern=nil #/^[a-zA-Z]/ \n tag = nil\n items = []\n args.each do |arg| \n if arg =~ /^[0-9\\.]+$/\n items << arg\n else\n tag = arg\n if pattern\n die \"#{@action}: #{arg} appears invalid.\" if arg !~ pattern\n end\n end\n end\n items = nil if items.empty?\n return tag, items\n end", "title": "" } ]
[ { "docid": "8299e0a77b11ed5b499bae3e819087cb", "score": "0.5704439", "text": "def preprocess_arguments_for_commands(args)\n # All arguments should be passed through to the atlantis command.\n if args.first == \"atlantis\"\n return args.slice!(1..-1)\n end\n if args.first == \"ssh\"\n arg_index = 1\n arg_index += 1 if Component.names.include?(args[1]) # Skip <component>, if it exists\n while arg_index < args.length\n break if args[arg_index][0] != \"-\"\n arg_index += 1 if args[arg_index] == \"-i\"\n arg_index += 1\n end\n return [] unless arg_index < args.length\n puts \"slicing #{arg_index.inspect}\"\n return args.slice!(arg_index..-1)\n end\n []\nend", "title": "" }, { "docid": "dd47e06a1c32076a3c4ace862de8aa41", "score": "0.5671699", "text": "def parse_args\n parser = Trollop::Parser.new do\n opt :list\n opt :add, \"\", :type => :string\n opt :remove, \"\", :type => :string\n opt :query, \"\", :type => :strings\n opt :verbose\n opt :die, \"\", :short => \"-e\"\n opt :format, \"\", :type => :string, :default => \"json\"\n opt :timeout, \"\", :type => :int, :default => TAG_REQUEST_TIMEOUT\n version \"\"\n end\n\n parse do\n options = parser.parse\n options[:action] = :get_tags if options.delete(:list)\n if options[:add]\n options[:action] = :add_tag\n options[:tag] = options.delete(:add).strip\n raise ::Trollop::CommandlineError.new(\"Non-empty value required\") if options[:tag].empty?\n end\n if options[:remove]\n options[:action] = :remove_tag\n options[:tag] = options.delete(:remove).strip\n raise ::Trollop::CommandlineError.new(\"Non-empty value required\") if options[:tag].empty?\n end\n if options[:query]\n options[:action] = :query_tags\n options[:tags] = options.delete(:query).map { |tag| tag.strip }\n end\n options[:format] = parse_format(options[:format])\n options\n end\n end", "title": "" }, { "docid": "c657150a708271ecf3bfc7c4ff29a7a3", "score": "0.5481917", "text": "def parse_extra_args(args)\n # Special case: consider a single argument\n if (ARGV.length == 1)\n return (ARGV[0].start_with?('-')) ? [] : [ARGV[0]]\n end\n \n args[0..-2].each_index do |i|\n if (args[i].start_with?('-'))\n # Delete the flag, and its value if present\n args.delete_at(i+1) unless(args[i+1].nil? || args[i+1].start_with?('-'))\n args.delete_at(i)\n end\n end\n \n # Special case: consider the last argument\n if (ARGV[-2].start_with?('-') && !ARGV[-1].start_with?('-'))\n args.unshift(ARGV[-1])\n end\n return args\nend", "title": "" }, { "docid": "5d62486aa809d73c710000e3694c0e92", "score": "0.5460983", "text": "def parse_extra_args(args)\r\n # Special case: consider a single argument\r\n if (ARGV.length == 1)\r\n return (ARGV[0].start_with?('-')) ? [] : [ARGV[0]]\r\n end\r\n \r\n args[0..-2].each_index do |i|\r\n if (args[i].start_with?('-'))\r\n # Delete the flag, and its value if present\r\n args.delete_at(i+1) unless(args[i+1].nil? || args[i+1].start_with?('-'))\r\n args.delete_at(i)\r\n end\r\n end\r\n \r\n # Special case: consider the last argument\r\n if (ARGV[-2].start_with?('-') && !ARGV[-1].start_with?('-'))\r\n args.unshift(ARGV[-1])\r\n end\r\n return args\r\nend", "title": "" }, { "docid": "5519d67e71daa44305db5779e116c024", "score": "0.5422732", "text": "def parse_args\n\t\t@args = @args_a.each_slice(2).to_a.inject({}) { |h, k| h[k[0]] = k[1]; h }\n\t\tkeys = @skeys + @lkeys\n\t\[email protected] do |k, v|\n\t\t\tif !keys.include?(k)\n\t\t\t\tputs \"Unknown option `#{k}'\"\n\t\t\t\texit\n\t\t\tend\n\n\t\t\tif keys.include?(v)\n\t\t\t\tputs \"Missing values for `#{k}' and `#{v}'\"\n\t\t\t\texit\n\t\t\tend\n\n\t\t\tif v != nil\n\t\t\t\tif v.start_with?('-')\n\t\t\t\t\tputs \"Warning: Value of `#{k}' appears to be a flag\"\n\t\t\t\tend\n\n\t\t\t\tif @static.has_key?(k)\n\t\t\t\t\tif !@static[k].include?(v)\n\t\t\t\t\t\tputs \"Unknown option `#{v}' for `#{k}'\"\n\t\t\t\t\t\texit\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\t\n\t\tif remove_keys(@no_vals).has_blank?\n\t\t\tputs \"Missing argument(s)\"\n\t\t\texit\n\t\tend\t\t\t\n\tend", "title": "" }, { "docid": "e83f0f479d84317377efa40c5baaea76", "score": "0.5418787", "text": "def process_args\n if has_directory?\n @directory_to_parse = @args[0]\n else\n @files = @args[[email protected]]\n @owner = @args[@args.count-3]\n @repo = @args[@args.count-2]\n @token = @args[@args.count-1]\n end\n end", "title": "" }, { "docid": "5fcac14f1534ca06e96e9febd9641fed", "score": "0.540858", "text": "def parse_args(args, stages, services)\n args = args.dup\n selected_services = []\n tasks = nil\n selected_stage = nil\n\n selected_stage = if stages.include?(args.first)\n args.shift\n elsif !get_stage_name(args.first, stages).nil?\n arg = args.shift\n selected_services << get_service_name(arg, services)\n get_stage_name(arg, stages)\n else\n nil\n end\n\n args.each_with_index do |a, i|\n if selected_stage.nil? && !get_stage_name(a, stages).nil?\n selected_stage = get_stage_name(a, stages)\n _service = get_service_name(a, services)\n selected_services << _service unless selected_services.include?(_service)\n elsif !get_service_name(a, services).nil?\n _service = get_service_name(a, services)\n selected_services << _service unless selected_services.include?(_service)\n else\n tasks = args[i..args.length].join(\" \")\n break\n end\n end\n [selected_stage, selected_services.flatten.uniq, tasks]\n end", "title": "" }, { "docid": "20321a4b8c69eeeafb3e68095a5d3de2", "score": "0.5403838", "text": "def parse_args\r\n if(cmd.args =~ /\\=/)\r\n self.names = InputFormatter.titlecase_arg(cmd.args.before(\"=\"))\r\n self.action_args = cmd.args.after(\"=\")\r\n elseif (cmd.args && one_word_command)\r\n self.names = InputFormatter.titlecase_arg(cmd.args)\r\n self.action_args = \"\"\r\n else\r\n self.names = enactor.name\r\n self.action_args = cmd.args\r\n end\r\n\r\n self.names = self.names ? self.names.split(/[ ,]/) : nil\r\n\r\n self.combat_command = cmd.switch ? cmd.switch.downcase : nil\r\n end", "title": "" }, { "docid": "d55b2ea18c8e876580e4fda3bba776ea", "score": "0.5402491", "text": "def multicommand_parser(message, argline)\n firstline = nil\n argline.split(/ +\\x00\\x00\\x00 +/).each do |newline|\n if firstline.nil?\n firstline = newline\n else\n add_nextcommand(message, newline)\n end\n end\n firstline\n end", "title": "" }, { "docid": "2858b095c6263754f338f9def5c1cd56", "score": "0.5340238", "text": "def get_arguments(cmd)\n (main_args, sub_command, sub_args) = split_command(cmd)\n int_sub_command = '' #sub_command\n until sub_args.empty? do\n (int_main_args, int_sub_command, sub_args) = split_command(sub_args)\n end\n return [sub_command, int_sub_command]\nend", "title": "" }, { "docid": "6d198057db556096be568154b1469127", "score": "0.53391004", "text": "def process_args\n @options = { sequence_num: nil, directory: nil, verbose: false }\n\n @optparse = OptionParser.new do |opts|\n opts.banner = 'Usage: Upload directory to MOA repository'\n\n @options[:sequence_num] = nil\n opts.on( '-s', '--seq SEQ', Integer, 'disk upload sequence number' ) do |seq|\n @options[:sequence_num] = seq\n end\n\n @options[:batch] = 1\n opts.on( '-b', '--batch BATCH', Integer, 'Start from batch number' ) do |batch|\n @options[:batch] = batch\n end\n\n @options[:batchsize] = BATCH_SIZE\n opts.on( '-n', '--batchsize BATCHSIZE', Integer, 'Set Batch Size (Default 5000 files)' ) do |batchsize|\n @options[:batchsize] = batchsize\n end\n\n @options[:directory] = nil\n opts.on( '-d', '--dir DIR', String, 'directory to upload' ) do |dir|\n @options[:directory] = dir\n end\n\n @options[:verbose] = false\n opts.on( '-v', '--verbose', 'Output more information' ) do\n @options[:verbose] = true\n end\n\n opts.on( '-?', '--help', 'Display this screen' ) do\n puts opts\n exit\n end\n end\n\n @optparse.parse!\n\n if @options[:directory].nil? || @options[:sequence_num].nil?\n puts @optparse\n exit(-1)\n end\nend", "title": "" }, { "docid": "a213fd6c3b6ba343bd5ab54ea06bc347", "score": "0.5335057", "text": "def split_command(args)\n main_args = nil\n sub_command = nil\n sub_args = []\n\n args.each_index do |i|\n if args[i].start_with?(\"-\")\n args.delete(args[i])\n end\n end\n\n args.each_index do |i|\n if !args[i].start_with?(\"-\")\n main_args = args[0,i]\n sub_command = args[i]\n sub_args = args[i+1, args.length - i + 1]\n break\n end\n end\n\n main_args = args.dup if main_args.nil?\n return [main_args, sub_command, sub_args]\nend", "title": "" }, { "docid": "70dff63e68ad6316e17ae20adff41014", "score": "0.53312147", "text": "def parse_args(arg)\n if arg.is_a?(Hash) and Knj::ArrayExt.hash_numeric_keys?(arg)\n arr = []\n \n arg.each do |key, val|\n arr << val\n end\n \n return self.parse_args(arr)\n elsif arg.is_a?(Hash)\n arg.each do |key, val|\n arg[key] = self.parse_args(val)\n end\n \n return arg\n elsif arg.is_a?(Array)\n arg.each_index do |key|\n arg[key] = self.parse_args(arg[key])\n end\n \n return arg\n elsif arg.is_a?(String) and match = arg.match(/^#<Model::(.+?)::(\\d+)>$/)\n return @ob.get(match[1], match[2])\n else\n return arg\n end\n end", "title": "" }, { "docid": "f84403d31508ec10a7312d1ec201b4ec", "score": "0.5318624", "text": "def normalize_args(args)\n return args if args.nil?\n args.pop if args.size > 0 && args.last == '--'\n args\n end", "title": "" }, { "docid": "8d4312c103ed4b64b9aea9ee8e8e8a54", "score": "0.53143716", "text": "def split_main_and_subcommand(argv)\n # Initialize return variables\n main_args = nil\n sub_command = nil\n sub_args = []\n\n # We split the arguments into two: One set containing any\n # flags before a word, and then the rest. The rest are what\n # get actually sent on to the subcommand.\n argv.each_index do |i|\n if !argv[i].start_with?(\"-\")\n # We found the beginning of the sub command. Split the\n # args up.\n main_args = argv[0, i]\n sub_command = argv[i]\n sub_args = argv[i + 1, argv.length - i + 1]\n\n # Break so we don't find the next non flag and shift our\n # main args.\n break\n end\n end\n\n # Handle the case that argv was empty or didn't contain any subcommand\n main_args = argv.dup if main_args.nil?\n\n return [main_args, sub_command, sub_args]\n end", "title": "" }, { "docid": "8d4312c103ed4b64b9aea9ee8e8e8a54", "score": "0.53143716", "text": "def split_main_and_subcommand(argv)\n # Initialize return variables\n main_args = nil\n sub_command = nil\n sub_args = []\n\n # We split the arguments into two: One set containing any\n # flags before a word, and then the rest. The rest are what\n # get actually sent on to the subcommand.\n argv.each_index do |i|\n if !argv[i].start_with?(\"-\")\n # We found the beginning of the sub command. Split the\n # args up.\n main_args = argv[0, i]\n sub_command = argv[i]\n sub_args = argv[i + 1, argv.length - i + 1]\n\n # Break so we don't find the next non flag and shift our\n # main args.\n break\n end\n end\n\n # Handle the case that argv was empty or didn't contain any subcommand\n main_args = argv.dup if main_args.nil?\n\n return [main_args, sub_command, sub_args]\n end", "title": "" }, { "docid": "22f452ebb961f1355d68f7b7099eb62d", "score": "0.53103155", "text": "def process_arguments(args)\n begin\n args.keys.sort.each do |k,v|\n case k\n when :quickpkg\n unless Boilermaker.gotroot? \n raise BoilerMakerErr.new(MSG_NO_ROOT)\n exit $!\n end\n unless Boilermaker.gotdevtools?\n raise BoilerMakerErr.new(MSG_NO_DEVTOOLS)\n exit $!\n end\n unless Boilermaker.gothdiutil? \n raise BoilerMakerErr.new(MSG_NO_HDIUTIL)\n exit $!\n end\n project = QuickPkg.new(args)\n # pp project.vars\n project.prep(args)\n project.build(args)\n when :createproj\n project = PkgProj.new(args)\n project.prep\n when :ktcheck\n unless Boilermaker.gotroot? \n raise BoilerMakerErr.new(MSG_NO_ROOT)\n exit $!\n end\n unless Boilermaker.gotradmind? \n raise BoilerMakerErr.new(MSG_NO_RADMIND)\n exit $!\n end\n Radmind.updateK(args)\n when :tconvert\n Radmind.convert(args)\n when :fetch\n unless Boilermaker.gotroot? \n raise BoilerMakerErr.new(MSG_NO_ROOT)\n exit $!\n end\n unless Boilermaker.gotradmind? \n raise BoilerMakerErr.new(MSG_NO_RADMIND)\n exit $!\n end \n Radmind.fetch(args)\n when :boil\n project = PkgProj.new(args)\n project.boil\n when :rollup\n unless Boilermaker.gotroot? \n raise BoilerMakerErr.new(MSG_NO_ROOT)\n exit $!\n end\n unless Boilermaker.gothdiutil? \n raise BoilerMakerErr.new(MSG_NO_HDIUTIL)\n exit $!\n end\n project = PkgProj.new(args)\n project.rollup\n when :package\n unless Boilermaker.gotroot? \n raise BoilerMakerErr.new(MSG_NO_ROOT)\n exit $!\n end\n unless Boilermaker.gotdevtools?\n raise BoilerMakerErr.new(MSG_NO_DEVTOOLS)\n exit $!\n end\n project = PkgProj.new(args)\n project.package(args)\n end\n end\n rescue => error\n puts error.message + \"\\n\"\n exit 1\n end\n \n end", "title": "" }, { "docid": "047a8290465ab79187c325f028c20135", "score": "0.5268948", "text": "def prep_args(*args)\n args = args.flatten.compact\n args = args.first.to_s.split(/\\s+/) if args.size == 1\n cmd = sudo? ? :sudo : args.shift\n \n # Symbols to switches. :l -> -l, :help -> --help\n args.collect! do |a|\n if a.is_a?(Symbol)\n a = (a.to_s.size == 1) ? \"-#{a}\" : a.to_s\n end\n a\n end\n [cmd, args]\n end", "title": "" }, { "docid": "84b7895b8f89ebdfe1dd60ef4b5f08b1", "score": "0.5248871", "text": "def parse(args)\n { unused: args }\n end", "title": "" }, { "docid": "c0a07d37ee9434bee02b505f578f9241", "score": "0.5231401", "text": "def parse_args\r\n self.names = cmd.args ? list_arg(cmd.args) : [enactor.name]\r\n end", "title": "" }, { "docid": "aafebe0fde943c25794c855a293ade0c", "score": "0.52132356", "text": "def parse(args, opts = {})\n return [args, opts] if args.empty?\n return [args, opts] unless self.class.flag?(args.first)\n\n res, flag, value = self.check_flag(args.first)\n # puts \"\\n\\nDEBUG: #{res} #{flag} #{value}\"\n\n return [args, opts] if res == :separator\n raise(\"flag expected for #{res}\") unless flag # sanity check\n\n # TODO: we should know by now whether it's a long or short flag\n sym = @index[:long][flag] || @index[:short][flag]\n raise \"unrecognized flag: #{flag}\" unless sym\n args.shift\n\n case res\n when :flag_has_val\n raise(\"value expected\") unless value\n opts[sym] = value\n when :flag_need_val\n opts[sym] = self.class.pop_value(args)\n when :flag_no_val\n opts[sym] = true\n when :flag_no_val_more\n opts[sym] = true\n raise(\"more expected for #{flag} parsed as #{res}\") unless value\n # look for smashed flags\n self.parse_smashed(value).each { |smflag, smval|\n # the last smashed flag may need a val from args\n opts[smflag] = smval || self.class.pop_value(args)\n }\n else\n raise \"unknown result: #{res}\"\n end\n self.parse(args, opts)\n end", "title": "" }, { "docid": "901d31a989762432b77f02c83c43b056", "score": "0.5204261", "text": "def parse_other_args(opts, options)\n opts.on('-q', '--offline-queueing') do\n options[:offline_queueing] = true\n end\n\n opts.on('-F', '--filter-params [PARAMS}') do |params|\n options[:filter_params] = params.split(/\\s*,\\s*/)\n end\n\n opts.on('--help') do\n puts Usage.scan(__FILE__)\n exit\n end\n end", "title": "" }, { "docid": "184f0b374482253145c09950c96f43cf", "score": "0.5199834", "text": "def parse_order *args\n current_order = nil \n @orders = {:global => [], :task_order => []}\n current_option = nil\n args.flatten.each { |arg|\n if arg[/.+\\:.+/] && !arg[' '] # Avoid strings with ':', like Git commit messages.\n current_order = arg\n @orders[:task_order] << current_order\n @orders[current_order] = {:global=>[]}\n else\n if current_order\n if arg[/^\\-/] \n current_option = arg.sub(/\\-+/,'').strip.to_sym\n @orders[current_order][current_option] ||= ''\n else\n if current_option\n @orders[current_order][current_option] += ' ' + arg\n @orders[current_order][current_option] = @orders[current_order][current_option].strip\n else\n raise ArgumentError, \"Option has no key: #{arg.inspect} --- all arguments: #{args.inspect}\"\n end\n end\n else\n @orders[:global] << arg.sub(/^\\-+/, '')\n end\n end\n }\n \n orders\n end", "title": "" }, { "docid": "7e6d8160e7647174d4bdb33b110e7443", "score": "0.516268", "text": "def parse_args\n options = { :verbose => false, :status => false, :immediately => false }\n parser = Trollop::Parser.new do\n opt :reboot\n opt :stop\n opt :terminate\n opt :immediately\n opt :deferred\n opt :verbose\n version \"\"\n conflicts :deferred, :immediately\n end\n\n parse do\n options.merge!(parser.parse)\n options[:level] = ::RightScale::ShutdownRequest::REBOOT if options[:reboot]\n options[:level] = ::RightScale::ShutdownRequest::STOP if options[:stop]\n options[:level] = ::RightScale::ShutdownRequest::TERMINATE if options[:terminate]\n options[:immediately] = false if options[:deferred]\n end\n options\n end", "title": "" }, { "docid": "3afd06939644edb4c7c30dbf9783463e", "score": "0.51091886", "text": "def parse\n @commands.each do |_, cmd|\n if cmd.flags?\n # or for the || seems to not do what I want it to do...\n next unless argv_index = ARGV.index(cmd.flags.short) || ARGV.index(cmd.flags.long)\n else\n next unless argv_index = ARGV.index(cmd.index.to_s)\n end\n cmd.given = true unless argv_index.nil?\n if cmd.type.nil?\n yield cmd if block_given?\n else\n if parsed = parse_cmd(cmd, flags)\n cmd.arguments = parsed || cmd.default\n yield cmd if block_given?\n elsif cmd.default\n cmd.arguments = cmd.default\n yield cmd if block_given?\n end\n end\n end\n end", "title": "" }, { "docid": "039acda63ac148d4e72099c415fa6af5", "score": "0.5096818", "text": "def parsed\n [raw_command] + args\n end", "title": "" }, { "docid": "c94614acee1d61b6138a3d89b0e1f7a1", "score": "0.50826365", "text": "def command_parse(argv)\n end", "title": "" }, { "docid": "7211bf107350daffb109c65f8f8d6c66", "score": "0.5081434", "text": "def parse(args)\n rest = args.clone\n rest.delete_at(0)\n return args[0], rest\n end", "title": "" }, { "docid": "1f82349631b157afd638b036de1d8930", "score": "0.5072522", "text": "def handle_command db, command, arg\n if command == 'get'\n db.get_books arg\n elsif command == 'count'\n db.count_books arg\n elsif command == 'find'\n db.find arg\n elsif command == 'add'\n args = arg.split ',', 2\n if args.length == 2\n #strip removes blanks from beginning and end of string\n db.add_book args[0].strip, args[1].strip\n else\n \"No book title provided\"\n end\n elsif command == 'delete'\n args = arg.split ',', 2\n if args.length == 2\n db.delete_book args[0].strip, args[1].strip\n else\n \"No book title provided\"\n end\n else\n puts \"Command not recognized\"\n end\nend", "title": "" }, { "docid": "bae98db6604f6d35f684161c7aa63693", "score": "0.505311", "text": "def parse_args\n case ARGV[0]\n when '-a'\n # check that no arg was passed with the -a flag.\n if ARGV[1]\n puts \"Error, '-a' flag cannot accept additional arguments.\"\n puts \"Run `validate-pp -h` for more info.\"\n exit!\n end\n parse_directory(File.expand_path(Dir.pwd))\n when '-d'\n ARGV.shift\n ARGV.each do |d|\n unless File.directory?(d)\n puts \"Error, #{d} is not a directory.\"\n puts \"Run `validate-pp -h` for more info.\"\n exit!\n end\n end\n dirs = ARGV.map { |d| File.expand_path(d) }\n dirs.each { |d| parse_directory(d) }\n when \"-f\"\n ARGV.shift\n ARGV.each do |f|\n unless File.extname(f) == '.pp'\n puts \"Error, #{f} is not a '.pp' file\"\n puts \"Run `validate-pp -h` for more info.\"\n exit!\n end \n end\n ARGV.each { |f| PuppetFile.new(File.expand_path(f)) }\n when '-g'\n if ARGV[1]\n puts \"Error, '-g' flag cannot accept additional arguments.\"\n puts \"Run `validate-pp -h` for more info.\"\n exit!\n end\n parse_git_repo\n end\nend", "title": "" }, { "docid": "e8c76fd8243f59e7217a1eb652bab6b0", "score": "0.5038412", "text": "def extract_argument_lists(args, splittable_args); end", "title": "" }, { "docid": "3e61945a99c592f3c9bca81e9cedda33", "score": "0.5031697", "text": "def priority _args\n \"priority _args;\" \n end", "title": "" }, { "docid": "d279f725d44f1174f8e51a0be6668dc0", "score": "0.50286293", "text": "def process_argv!\n args = ARGV.dup\n self.rest = []\n @unknown_argvs = []\n until args.empty? do\n arg = args.shift\n case\n # end of options parsing\n when arg == '--'\n self.rest += args\n break\n # --param=val or --param\n when arg =~ /\\A--([\\w\\-\\.]+)(?:=(.*))?\\z/\n param, val = [$1, $2]\n warn \"Configliere uses _underscores not dashes for params\" if param.include?('-')\n @unknown_argvs << param.to_sym if (not has_definition?(param))\n self[param] = parse_value(val)\n # -abc\n when arg =~ /\\A-(\\w\\w+)\\z/\n $1.each_char do |flag|\n param = find_param_for_flag(flag)\n unless param then @unknown_argvs << flag ; next ; end\n self[param] = true\n end\n # -a val\n when arg =~ /\\A-(\\w)\\z/\n flag = find_param_for_flag($1)\n unless flag then @unknown_argvs << flag ; next ; end\n if (not args.empty?) && (args.first !~ /\\A-/)\n val = args.shift\n else\n val = nil\n end\n self[flag] = parse_value(val)\n # -a=val\n when arg =~ /\\A-(\\w)=(.*)\\z/\n flag, val = [find_param_for_flag($1), $2]\n unless flag then @unknown_argvs << flag ; next ; end\n self[flag] = parse_value(val)\n else\n self.rest << arg\n end\n end\n @unknown_argvs.uniq!\n end", "title": "" }, { "docid": "884ea7ee225516252dbb65ced067d98d", "score": "0.5023098", "text": "def parse_args\n options = { :verbose => false, :status => false, :immediately => false, :action => :attach}\n\n parser = Trollop::Parser.new do \n opt :url, \"\", :long => \"--attach\", :short => \"-a\", :type => String, :required => true\n opt :force\n opt :cloud, \"\", :type => String\n version \"\"\n end\n\n parse do\n options.merge(parser.parse)\n end\n end", "title": "" }, { "docid": "ce626220302d8b8e8cec86ee2589440d", "score": "0.50227296", "text": "def parse_subcommand!(argv)\n argv.shift || false\n end", "title": "" }, { "docid": "9c855301dea23e6ff19a7fd61bd90562", "score": "0.5018463", "text": "def process_argv!\n args = ARGV.dup\n self.rest = []\n until args.empty? do\n arg = args.shift\n case\n when arg == '--'\n self.rest += args\n break\n when arg =~ /\\A--([\\w\\-\\.]+)(?:=(.*))?\\z/\n param, val = [$1, $2]\n param.gsub!(/\\-/, '.') # translate --scoped-flag to --scoped.flag\n param = param.to_sym unless (param =~ /\\./) # symbolize non-scoped keys\n if val == nil then val = true # --flag option on its own means 'set that option'\n elsif val == '' then val = nil end # --flag='' the explicit empty string means nil\n self[param] = val\n when arg =~ /\\A-(\\w+)\\z/\n $1.each_char do |flag|\n param = param_with_flag(flag)\n self[param] = true if param\n end\n else\n self.rest << arg\n end\n end\n end", "title": "" }, { "docid": "2b80bae2f8e990f9008dbb1ad27a9a2d", "score": "0.50168055", "text": "def process_options ( argv )\n\t\ttag = Tag.new\n\t\trenumber = false\n\t\tforce = false\n\t\tpreserve = false\n\t\trenumber_start_at = 1\n\t\tdoexit = false\n\t\ttitle_default = \"@B, @N of @T\"\n\n\t\tbegin\n\t\t\targv.options{ |opt|\n\n\t\t\t\t# help message banner and usage instructions\n\t\t\t\topt.banner = \"A script by Chris Tessmer that Retracks all mp3 id3v2 tags.\\n\"\n\t\t\t\topt.banner += \"version #{SCRIPT_VERSION}, #{SCRIPT_VERSION_DATE}.\\n\"\n\t\t\t\topt.banner += \"\\n\"\n\t\t\t\topt.banner += \"Usage: mp3_retracker [options] file(s)\\n\"\n\t\t\t\topt.banner += \"\\n\"\n\n\t\t\t\t# Defing options\n\t\t\t\topt.on( \"Options:\" )\n\t\t\t\topt.on( \"--renumber [START NUMBER]\", \"-n\", Integer, \"renumber tracks\" ) { |n|\n\t\t\t\t\trenumber \t\t\t\t\t= true\n\t\t\t\t\trenumber_start_at = n || 1\n\n\t\t\t\t\tif ( renumber_start_at < 1 )\n\t\t\t\t\t\trenumber_start_at = 1\n\t\t\t\t\tend\n\t\t\t\t\t}\n\t\t\t\topt.on( \"--force\",\n\t\t\t\t\t\"-f\",\n\t\t\t\t\t\"Force 'yes' to all questions\")\t{\n\t\t\t\t\tforce = true }\n\t\t\t\topt.on( \"--album 'ALBUM'\" ,\n\t\t\t\t\t\"-b\",\n\t\t\t\t\tString,\n#\t\t\t\t\t\"sets the album name\") { |tag.album| }\n\t\t\t\t\t\"sets the album name\") { |b| tag.album = b || nil }\n\t\t\t\topt.on( \"--artist 'ARTIST'\" , \"-a\", String, \"sets the artist name\") {\n\t\t\t\t\t# |tag.artist| }\n\t\t\t\t\t|a| tag.artist = a || nil }\n\t\t\t\topt.on( \"--composer [COMPOSER]\" , \"-c\", String, \"sets the composer name (defaults to artist)\") { |c|\n\t\t\t\t tag.composer = c || nil\n\t\t\t\t\t}\n\t\t\t\topt.on( \"--genre 'GENRE'\" , \"-g\", String, \"sets the genre\") {\n\t\t\t\t\t# |tag.genre| }\n\t\t\t\t\t|g|\n\t\t\t\t\ttag.genre = g || nil }\n\t\t\t\topt.on( \"--title [TITLE]\", \"-t\", String, \"sets title (uses meta chars, default = \\\"#{title_default}\\\")\" ) {\n\t\t\t\t\t\t|t|\n\t\t\t\t\t\ttag.title = t || title_default\n\t\t\t\t\t}\n\t\t\t\topt.on( \"--year YEAR\", \"-y\", String, \"sets year\" ) {|y|\n\t\t\t\t\tif( y =~ /^\\d{4,4}$/ )\n\t\t\t\t\t\ttag.year = y\n\t\t\t\t\telse\n\t\t\t\t\t\traise \"Bad year '#{y}'- must be in four-digit (YYYY) numeric format.\"\n\t\t\t\t\tend\n\t\t\t\t\t}\n\t\t\t\topt.on( \"--website 'URL'\", \"-w\", String, \"sets website\" ) {\n\t\t\t\t\t# |tag.web_site| }\n\t\t\t\t\t|w| tag.web_site = w || nil }\n\t\t\t\topt.on( \"--album-artist 'ARTIST'\", \"-m\", String, \"sets album artist\" ) {\n\t\t\t\t\t# |tag.album_artist| }\n\t\t\t\t\t|m| tag.album_artist = m || nil }\n\t\t\t\topt.on( \"--retrack-defaults 'ALBUM'\", \"-x\", String, \"equivilant to -n -t -b ALBUM\" ){\n\t\t\t\t\t# |tag.album|\n\t\t\t\t\ttag.album\n\t\t\t\t\trenumber \t\t= true\n\t\t\t\t\trenumber_start_at \t= 1\n\t\t\t\t\ttag.title \t\t= title_default\n\t\t\t\t}\n\t\t\t\topt.on( \"--preserve-times\", \"-p\", \"preserves original file timestamps\" ) {\n\t\t\t\t\tpreserve = true }\n\t\t\t\topt.on( \"--help\", \"-h\", \"This text\" ) {\n\t\t\t\t\tputs opt\n\t\t\t\t\texit EXITSTATUS_COMPLETE\n\t\t\t\t}\n\n\t\t\t\t# Additional help message instructions:\n\t\t\t\topt.separator \"\"\n\t\t\t\topt.separator \"Meta Characters:\"\n\t\t\t\topt.separator \"\\t@N Track Number\"\n\t\t\t\topt.separator \"\\t@T Total Tracks\"\n\t\t\t\topt.separator \"\\t@B Album Name\"\n\t\t\t\topt.separator \"\"\n\t\t\t\topt.parse!\n\n\t\t\t\tif tag.composer.nil?\n\t\t\t\t\tif not tag.composer = tag.artist\n\t\t\t\t\t\traise \"Composer Requested with no Composer or Artist given.\"\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\t# Exit with help message if no arguments are given\n\t\t\t\tif ( argv.length == 0 )\n\t\t\t\t\tputs opt\n\t\t\t\t\tdoexit = true\n\t\t\t\tend\n\t\t\t}\n\n\t\trescue Exception => e\n\t\t\tif e.class != SystemExit\n\t\t\t\tSTDERR.puts \"\\n#{e.class}\"\n\t\t\t\tSTDERR.puts \"\\t#{e}\\n\"\n\t\t\t\tSTDERR.puts \"Since this messed up the arguments, I am ABORTING THE PROGRAM. Sorry.\\n\\n\"\n\t\t\tend\n\n\t\t\texit EXITSTATUS_ARG_ERROR\n\t\tend\n\n\t\t# Handle graceful exit (couldn't put in opt block because of rescue clause)\n\t\tif doexit\n\t\t\texit EXITSTATUS_COMPLETE\n\t\tend\n\n\t\tputs \"tag:\\n#{tag}\"\n\t\tt = TagRetracker.new( tag, renumber, force, preserve )\n\t\tt.renumber_start_at = renumber_start_at\n\t\tt\n\tend", "title": "" }, { "docid": "ae31f3f7bf2165348bed7c86ebc2d29d", "score": "0.50061274", "text": "def parse argv\n parse_args argv do |argv, remaining_args, arg|\n remaining_args << arg\n end\n end", "title": "" }, { "docid": "2884d72d9840fb77b8fdba23455c5351", "score": "0.50035954", "text": "def parse( args )\n opts = OptionParser.new\n opts.banner = 'Usage: stratus [options] target [target args]'\n\n opts.separator ''\n\n desired_opts = %[--describe --prereqs --tasks --trace]\n app.standard_rake_options.each do |options|\n next unless desired_opts.include?(options.first)\n opts.on(*options)\n end\n\n opts.separator ''\n opts.separator 'common options:'\n\n opts.on_tail( '-h', '--help', 'show this message' ) do\n @out.puts opts\n exit\n end\n opts.on_tail( '-q', '--quiet', 'show compact messages' ) do\n ENV['STRATUS_LOGGING'] = 'quiet'\n end\n opts.on_tail( '--version', 'show version' ) do\n @out.puts \"Stratus #{::Stratus::VERSION}\"\n exit\n end\n \n begin\n opts.parse! args\n rescue OptionParser::InvalidOption => ex\n puts \"!! #{ex}\"\n end\n \n \n ARGV.replace Array(args.shift)\n args.delete_if do |arg|\n if %r/^[A-Z_]+=/ =~ arg\n ARGV << arg\n next true\n end\n false\n end\n\n args\n end", "title": "" }, { "docid": "85fb8ce57274b7dee84ad541d4dbccc4", "score": "0.5000726", "text": "def parse_subcommand!(argv)\n argv.shift || false\n end", "title": "" }, { "docid": "6936987dc11d84442e7301ae2f989e4c", "score": "0.49988458", "text": "def parse_command_line_args(args)\n opts = OptionParser.new do |opts|\n opts.banner = 'Usage: tbibtools [OPTIONS] [FILES] < IN > OUT'\n opts.separator ''\n opts.separator 'tbibtools is a free software with ABSOLUTELY NO WARRANTY under'\n opts.separator 'the terms of the GNU General Public License version 2 or newer.'\n opts.separator ''\n \n opts.on('-c', '--config=FILE', String, 'Configuration file') do |value|\n @configuration.config value\n end\n\n opts.on('-e', '--regexp=REGEXP', String, 'Display entries matching the regexp') do |value|\n @configuration.filter Regexp.new(value)\n end\n\n opts.on('-f', '--format=STRING', String, 'Re-format entries (order matters)') do |value|\n @configuration.format *value.split(/,/)\n end\n\n opts.on('--[no-]formatted', 'Unformatted output') do |bool|\n unless bool\n @configuration.entry_format = []\n @configuration.entry_format_default = []\n end\n end\n\n opts.on('-i', '--[no-]case-sensitive', 'Case insensitive') do |bool|\n @configuration.sort_case bool\n end\n \n opts.on('-l', '--format-list=[STRING]', String, 'Format string for list (implies --ls)') do |value|\n @configuration.shortcut_ls\n @configuration.list_format value if value\n end\n\n opts.on('--ls', 'Synonym for: -f list,stripPrelude (\"list\" implies \"unwrap\")') do |bool|\n @configuration.shortcut_ls if bool\n end\n\n opts.on('-o', '--output=FILE', String, 'Output file') do |value|\n @configuration.output value\n end\n\n opts.on('-P', '--strip-prelude', 'Strip the prelude: same as -f stripPrelude but helps to maintain the original formatting') do |bool|\n @configuration.strip_prelude\n end\n\n opts.on('-q', '--query=FIELD=REGEXP', String, 'Show entries for which field matches the regexp') do |value|\n field, rx = value.split(/=/, 2)\n @configuration.query field => Regexp.new(rx, Regexp::IGNORECASE)\n end\n\n opts.on('-s', '--sort=STRING', String, 'Sort (default: sort by key; key = _id, type = _type)') do |value|\n @configuration.sort_key value\n end\n\n opts.on('-S', '--[no-]expand-strings', 'Replace/expand strings') do |bool|\n @configuration.expand_strings bool\n end\n\n opts.on('--strip=FIELDS', String, 'Ignore/strip fields') do |value|\n @configuration.strip value.split(/,/)\n end\n\n opts.on('-u', '--unsorted', 'Unsorted output') do |bool|\n @configuration.sort_key nil\n end\n\n opts.separator ''\n opts.separator 'Other Options:'\n \n opts.on('--debug', Integer, 'Show debug messages') do |v|\n $DEBUG = true\n $VERBOSE = true\n end\n \n opts.on('-v', '--verbose', 'Run verbosely') do |v|\n $VERBOSE = true\n end\n \n opts.on('-h', '--help', 'Show this message') do\n puts opts\n exit 1\n end\n\n opts.separator ''\n opts.separator 'Available formats:'\n format_rx = /^(format|preprocess|head|body|tail)_/\n format_names = (['nnIsYear', 'sortCrossref', 'downcaseType', 'upcaseType'] + \n @configuration.methods.find_all{|m| m =~ format_rx}.collect{|m| m.sub(format_rx, '')}).uniq.sort.join(', ')\n opts.separator format_names\n\n opts.separator ''\n opts.separator 'Known format shortcuts:'\n acc = []\n @configuration.methods.find_all{|m| m =~ /^shortcut_/}.sort.each do |meth|\n fn = meth.sub(/^shortcut_/, '')\n fs = @configuration.send(meth, acc)\n opts.separator \"#{fn}: #{fs.join(',')}\"\n end\n end\n @configuration.input *opts.parse!(args)\n self\n end", "title": "" }, { "docid": "798c15af7e288b3f7235ad998124d365", "score": "0.49979672", "text": "def multiball(message, argline)\n argline = quoteparam_parser(message, argline)\n argline = multicommand_parser(message, argline)\n argline = pipecommand_parser(message, argline)\n argline\n end", "title": "" }, { "docid": "c50ac553bd82d3401ff98f48f4253e0f", "score": "0.49930626", "text": "def split_args(ary)\n\tfiles = []\n\topts = []\n\tc = false\n\tary.each do |i|\n\t\tnext if i == '-'\n\t\tif i == '--' then\n\t\t\tc = true\n\t\t\tnext\n\t\tend\n\t\tfiles << i if c or not (i =~ /^-/)\n\t\topts << i if (not c) and (i =~ /^-/)\n\tend\n\t[files, opts]\nend", "title": "" }, { "docid": "f6d678411add584a905cc2329ab757e4", "score": "0.49838886", "text": "def parse_args\n require 'optimist'\n opts = Optimist.options do\n opt :source, \"Inventory Source UID\", :type => :string, :required => ENV[\"SOURCE_UID\"].nil?, :default => ENV[\"SOURCE_UID\"]\n opt :ingress_api, \"Hostname of the ingress-api route\", :type => :string, :default => ENV[\"INGRESS_API\"] || \"http://localhost:9292\"\n opt :config, \"Configuration file name\", :type => :string, :default => ENV[\"CONFIG\"] || \"default\"\n opt :data, \"Amount & custom values of generated items\", :type => :string, :default => ENV[\"DATA\"] || \"default\"\n end\n\n opts\nend", "title": "" }, { "docid": "2df291ada88f9bc12df3208d1e3e57d0", "score": "0.4982134", "text": "def parse(obj, argv)\n case argv\n when String\n require 'shellwords'\n argv = Shellwords.shellwords(argv)\n else\n argv = argv.dup\n end\n\n argv = argv.dup\n args, opts, i = [], {}, 0\n while argv.size > 0\n case opt = argv.shift\n when /=/\n parse_equal(obj, opt, argv)\n when /^--/\n parse_option(obj, opt, argv)\n when /^-/\n parse_flags(obj, opt, argv)\n else\n args << opt\n end\n end\n return args\n end", "title": "" }, { "docid": "26939823f35cd5ebf22cd43289f1f656", "score": "0.49782437", "text": "def validateArgs\n if ( ! ARGV[0] || ! ARGV[1])\n abort \"must provide two version numbers. try: tagdeleter.rb --help\"\n end\n end", "title": "" }, { "docid": "63cbc1948babf26ccdad6d7ee2d12f8c", "score": "0.4965213", "text": "def execute_todo\n\ncommand = ARGV[0]\n\ncase command\nwhen'add'\n\tdescription = ARGV[1]\n\tstatus = ARGV[2]\n\tTaskMethods.add(description,status)\n\n\t#add method\nwhen 'list'\n\tTaskMethods.list\n\nwhen 'update'\n\tindex = ARGV[1].to_i\n\tdescription = ARGV[2]\n\tstatus = ARGV[3]\n\tTaskMethods.update(index,description,status)\n\t\nwhen 'remove'\n\tindex = ARGV[1]\n\tTaskMethods.remove(index)\n\nend\n\nend", "title": "" }, { "docid": "00c4377ace17e743070e53205210e28c", "score": "0.49573448", "text": "def parse_args\n args = {\n :stack_name => nil,\n :parameters => {},\n :interactive => false,\n :region => default_region,\n :profile => nil,\n :nopretty => false,\n :s3_bucket => nil,\n }\n ARGV.slice_before(/^--/).each do |name, value|\n case name\n when '--stack-name'\n args[:stack_name] = value\n when '--parameters'\n args[:parameters] = Hash[value.split(/;/).map { |pair| parts = pair.split(/=/, 2); [ parts[0], Parameter.new(parts[1]) ] }]\n when '--interactive'\n args[:interactive] = true\n when '--region'\n args[:region] = value\n when '--profile'\n args[:profile] = value\n when '--nopretty'\n args[:nopretty] = true\n when '--s3-bucket'\n args[:s3_bucket] = value\n end\n end\n\n args\nend", "title": "" }, { "docid": "616ddee9ff848d51c2a2274c3a83e49a", "score": "0.49491143", "text": "def parse_options(args) # :nodoc:\n global_options,command,options,arguments = parse_options_helper(args.clone,Hash.new,nil,Hash.new,Array.new)\n flags.each { |name,flag| global_options[name] = flag.default_value if !global_options[name] }\n command.flags.each { |name,flag| options[name] = flag.default_value if !options[name] }\n return [global_options,command,options,arguments]\n end", "title": "" }, { "docid": "1dfd78f167924eacf081e4ba26c3ff56", "score": "0.49395812", "text": "def process_r2doc_args(args, overrides)\n processed = []\n local_options = {}\n \n # add the overrides first\n overrides.each do |o|\n processed.push \"--#{o[0]}\"\n processed.push o[2]\n end\n \n while args.length > 0 do\n thisOpt = args.shift\n thisParam = nil\n if thisOpt =~ /^-/\n # -- signals the end of options\n if thisOpt == '--'\n processed.push thisOpt\n processed.concat(args) if args.length > 0\n return processed, local_options\n end\n \n # this is an option, see if we have an argument\n if longMatch = /^--([^=]+)=(.*)/.match(thisOpt)\n if longMatch[1] == 'rdoc-version'\n local_options['rdoc-version'] = longMatch[2]\n else\n # don't pass overrides through\n processed.push thisOpt unless overrides.find{|o| o[0] == longMatch[1]}\n end\n elsif longMatch = /^--(.*)/.match(thisOpt)\n # special case for help, gems, and rdoc-version options\n if longMatch[1] == 'help'\n help_message\n processed.push thisOpt\n elsif longMatch[1] == 'gems'\n local_options['gems'] = args\n return processed, local_options\n elsif longMatch[1] == 'rdoc-version'\n local_options['rdoc-version'] = args.shift\n else\n # an argument could follow as the next item\n thisParam = args.shift unless args.first =~ /^-/\n unless overrides.find{|o| o[0] == longMatch[1]}\n processed.push thisOpt\n processed.push thisParam unless thisParam.nil?\n end\n end\n else\n # short option\n flag = thisOpt.slice(1, thisOpt.length - 1)\n if flag == 'h' || flag == '?'\n help_message\n processed.push thisOpt\n else\n thisParam = args.shift unless args.first =~ /^-/\n unless overrides.find{|o| o[1] == flag}\n processed.push thisOpt\n processed.push thisParam unless thisParam.nil?\n end\n end\n end\n else\n # not an option, so processing stops\n processed.push thisOpt\n processed.concat(args) if args.length > 0\n return processed, local_options\n end\n end\n \n return processed, local_options\nend", "title": "" }, { "docid": "1096c049fc37920fdd4dc0cecd73f70f", "score": "0.49370492", "text": "def fallback_parsing(*arguments)\n arguments = arguments.flatten\n case command = arguments.shift\n when nil, \"list\"\n @action = :list\n if arg = arguments.shift\n @state ||= arg.to_sym if %w(open closed).include? arg\n @user, @repo = arg.split \"/\" if arg.count(\"/\") == 1\n end\n when \"search\"\n @action = :search\n @search_term ||= arguments.shift\n when \"show\", /^-?(\\d+)$/\n @action = :show\n @number ||= ($1 || arguments.shift[/\\d+/]).to_i\n when \"open\"\n @action = :open\n when \"edit\"\n @action = :edit\n @number ||= arguments.shift[/\\d+/].to_i\n when \"close\"\n @action = :close\n @number ||= arguments.shift[/\\d+/].to_i\n when \"reopen\"\n @action = :reopen\n @number ||= arguments.shift[/\\d+/].to_i\n when \"label\"\n @action = :label\n @number ||= arguments.shift[/\\d+/].to_i\n @label ||= arguments.shift\n when \"unlabel\"\n @action = :unlabel\n @number ||= arguments.shift[/\\d+/].to_i\n @label ||= arguments.shift\n when \"comment\"\n @action = :comment\n @number ||= arguments.shift[/\\d+/].to_i\n when \"claim\"\n @action = :claim\n @number ||= arguments.shift[/\\d+/].to_i\n when %r{^([^/]+)/([^/]+)$}\n @action = :list\n @user, @repo = $1, $2\n when \"url\", \"web\"\n @action = :url\n @number ||= arguments.shift[/\\d+/].to_i\n end\n if @action\n @args = @argv.dup\n args.delete_if { |arg| arg == command }\n option_parser.parse!(*args)\n return true\n end\n unless command.start_with? \"-\"\n warn \"#{File.basename $0}: what do you mean, '#{command}'?\"\n end\n end", "title": "" }, { "docid": "098a7346cdfcaf2ee7197adfaf081f60", "score": "0.4926884", "text": "def process_command(*args, pre: nil, post: nil, wrap: nil, **opts)\n\t\t\tspawn_opts={}\n\t\t\tif args.last.kind_of?(Hash)\n\t\t\t\t#we may have no symbol keywords\n\t\t\t\t*args,spawn_opts=*args\n\t\t\tend\n\t\t\tsudo=opts.delete(:sudo)\n\t\t\tenv={}\n\t\t\tif args.first.kind_of?(Hash)\n\t\t\t\tenv,*args=*args\n\t\t\tend\n\t\t\tenv.merge!(opts.delete(:env)||{})\n\t\t\targs=args.map.with_index {|arg, i| i == 0 && arg.is_a?(Array) ? arg : arg.to_s} if args.length > 1\n\t\t\tspawn_opts.merge!(opts)\n\t\t\tif pre\n\t\t\t\tif args.length > 1\n\t\t\t\t\targs=args.unshift(*pre)\n\t\t\t\telse\n\t\t\t\t args=[\"#{pre.is_a?(Enumerable) ? pre.shelljoin : pre} #{args.first}\"]\n\t\t\t\tend\n\t\t\tend\n\t\t\tif post\n\t\t\t\tif args.length > 1\n\t\t\t\t\targs=args.push(*post)\n\t\t\t\telse\n\t\t\t\t args=[\"#{args.first} #{post.is_a?(Enumerable) ? post.shelljoin : post}\"]\n\t\t\t\tend\n\t\t\tend\n\t\t\tif wrap\n\t\t\t args=wrap.call(*args)\n\t\t\tend\n\t\t\tif sudo\n\t\t\t\tif args.length > 1\n\t\t\t\t\targs.unshift(*Run.sudo_args(sudo))\n\t\t\t\telse\n\t\t\t\t\targs=[\"#{Run.sudo_args(sudo).shelljoin} #{args.first}\"]\n\t\t\t\tend\n\t\t\tend\n\t\t\treturn env, args, spawn_opts\n\t\tend", "title": "" }, { "docid": "ee54f84daa9df3b00f04327999b653b0", "score": "0.49243718", "text": "def preparse(unparsed, args = [], opts = {})\n case unparsed\n when Hash then opts.merge! unparsed\n when Array then unparsed.each { |e| preparse(e, args, opts) }\n else args << unparsed.to_s\n end\n [args, opts]\n end", "title": "" }, { "docid": "2a6759cecf79ec1e97f4e0a14525a1c1", "score": "0.49046078", "text": "def get_command_from_args(args)\n raise 'A command is required' if args.empty?\n {\n :filename => 'todo_list_data.txt',\n :command => args[0],\n :modifier => args[1]\n }\n end", "title": "" }, { "docid": "aa5b18771c4659ca595abf1105bba573", "score": "0.48969343", "text": "def parse_cmd_arguments( args ) # {{{\n\n original_args = args.dup\n options = OpenStruct.new\n\n # Define default options\n options.verbose = false\n options.colorize = false\n options.process = []\n options.sources = []\n options.debug = false\n options.db_path = \"data/databases/test.sqlite3\"\n options.db_type = \"sqlite3\"\n options.read = false\n options.automatic = false\n options.interval = 3600 # update normally only every hour\n options.rate = false\n options.username = \"\"\n options.manual_input = false\n options.joke_count = false\n options.random_intervals = false\n options.random_interval_time = 25\n\n pristine_options = options.dup\n\n opts = OptionParser.new do |opts|\n opts.banner = \"Usage: #{__FILE__.to_s} [options]\"\n\n opts.separator \"\"\n opts.separator \"General options:\"\n\n opts.on(\"-d\", \"--db-path PATH\", \"Use the database which can be found in PATH\") do |d|\n options.db_path = d\n end\n\n opts.on(\"-t\", \"--db-type TYPE\", \"Use the database of class TYPE (e.g. sqlite3)\") do |t|\n options.db_type = t\n end\n\n opts.on(\"-r\", \"--read\", \"Read jokes that are stored in the DB\") do |r|\n options.read = r\n end\n\n opts.on(\"-r\", \"--rate\", \"Rate jokes that are stored in the DB for user account\") do |r|\n options.rate = r\n end\n\n opts.on(\"-u\", \"--username OPT\", \"Use username OPT\") do |u|\n options.username = u\n end\n\n opts.on(\"-m\", \"--manual-input\", \"Input a joke manually to the Database\") do |m|\n options.manual_input = m\n end\n\n opts.on(\"-j\", \"--joke-count\", \"Count how many jokes we have in the Database\") do |j|\n options.joke_count = j\n end\n\n opts.on(\"-r\", \"--random-intervals\", \"Use random intervals when downloading to mask our usage pattern\") do |r|\n options.random_intervals = r\n end\n\n opts.separator \"\"\n opts.separator \"Specific options:\"\n\n # Boolean switch.\n opts.on(\"-a\", \"--automatic\", \"Run automatically every #{options.interval.to_s} seconds unless the --interval option is given\") do |a|\n options.automatic = a\n end\n\n opts.on(\"-i\", \"--interval OPT\", \"Run every OPT seconds (works only with --automatic together)\") do |i|\n options.interval = i.to_i\n end\n\n # Set of arguments\n opts.on(\"-p\", \"--process OPT\", @configurations, \"Process one or more detected configuration (OPT: #{ @configurations.sort.join(', ') })\" ) do |d|\n options.process << d\n end\n\n # Set of arguments\n opts.on(\"-s\", \"--sources OPT\", @configurations, \"Use only these sources for read and rate (OPT: #{ @configurations.sort.join(', ') })\" ) do |d|\n options.sources << d\n end\n\n # Boolean switch.\n opts.on(\"-v\", \"--verbose\", \"Run verbosely\") do |v|\n options.verbose = v\n end\n\n opts.on(\"-d\", \"--debug\", \"Run in debug mode\") do |d|\n options.debug = d\n end\n\n # Boolean switch.\n opts.on(\"-q\", \"--quiet\", \"Run quietly, don't output much\") do |v|\n options.verbose = v\n end\n\n opts.separator \"\"\n opts.separator \"Common options:\"\n\n # Boolean switch.\n opts.on(\"-c\", \"--colorize\", \"Colorizes the output of the script for easier reading\") do |c|\n options.colorize = c\n end\n\n opts.on_tail(\"-h\", \"--help\", \"Show this message\") do\n puts opts\n exit\n end\n\n # Another typical switch to print the version.\n opts.on_tail(\"--version\", \"Show version\") do\n puts `git describe --tags`\n exit\n end\n end\n\n opts.parse!(args)\n\n # Show opts if we have no cmd arguments\n if( original_args.empty? )\n puts opts\n exit\n end\n\n options\n end", "title": "" }, { "docid": "f9f5730a8803e7f3493347b552428c4d", "score": "0.48965535", "text": "def parse(args, &_block)\n skip_next = false\n\n args.each_with_index do |arg, idx|\n if skip_next\n skip_next = false\n next\n end\n\n if arg.length > 1 && arg[0] == '-' && arg[1] != '-'\n arg.split('').each do |flag|\n fmt.each_pair do |fmtspec, val|\n next if fmtspec != \"-#{flag}\"\n\n param = nil\n\n if val[0]\n param = args[idx + 1]\n skip_next = true\n end\n\n yield fmtspec, idx, param\n end\n end\n else\n yield nil, idx, arg\n end\n end\n end", "title": "" }, { "docid": "82a27f4571afe02338fa2684d6b0405a", "score": "0.48868293", "text": "def parse_args(args, kwargs)\n return unless self.class.Args\n command_args = self.class.Args.new(self, *args, **kwargs)\n command_args.validate\n command_args\n end", "title": "" }, { "docid": "c2aaab7d104e4def2f37ef0683a0a1ba", "score": "0.4883291", "text": "def split_arguments!(arguments)\n \n if arguments.any? { |arg| arg.strip == 'of' }\n command = arguments.delete('of')\n elsif arguments.any? { |arg| arg.strip == 'convert' }\n command = arguments.delete('convert')\n end\n \n command\nend", "title": "" }, { "docid": "ce4b3784fd8d01fb2bb02f81d960c7bc", "score": "0.48830307", "text": "def parse_cmd(cmd, flags)\n if cmd.flags?\n args = Raw.arguments_to(cmd.flags.short, flags)\n if args.nil? || args.empty?\n args = Raw.arguments_to(cmd.flags.long, flags)\n end\n else\n args = Raw.arguments_to(cmd.index.to_s, flags)\n end\n unless cmd.type.to_s =~ /stdin/\n return nil if args.nil?\n end\n case cmd.type\n when :stdin\n args = STDIN.gets.strip\n when :stdin_stream\n args = STDIN\n when :stdin_string\n args = STDIN.gets.strip\n when :stdin_strings\n args = []\n while arg = STDIN.gets\n next if arg.nil?\n arg = arg.strip\n args << arg\n end\n args\n when :stdin_integer\n args = STDIN.gets.strip.to_i\n when :stdin_integers\n args = []\n while arg = STDIN.gets\n next if arg.nil?\n arg = arg.strip\n parse = arg.to_i\n if parse.to_s == arg\n args << parse\n end\n end\n args\n when :stdin_bool\n args = STDIN.gets.strip.downcase == \"true\"\n when :single, :string\n args = args.first\n when :strings, :multi\n if cmd.delimiter?\n if args.count > 1\n args = args.first.split(cmd.delimiter)\n else\n args = args.map { |arg| arg.split(cmd.delimiter) }.flatten\n end\n end\n args\n when :integer\n args = args.first.to_i\n when :integers\n if cmd.delimiter?\n if args.count > 1\n args = args.join\n args = args.select { |arg| arg if arg.include?(cmd.delimiter) }\n args = args.map { |arg| arg.split(cmd.delimiter) }.flatten\n else\n args = args.map { |arg| arg.split(cmd.delimiter) }.flatten\n end\n end\n args = args.map(&:to_i)\n when :bool, :bools\n if cmd.delimiter?\n if args.count > 1\n args = args.join\n args = args.select { |arg| arg if arg.include?(cmd.delimiter) }\n args = args.map { |arg| arg.split(cmd.delimiter) }.flatten\n else\n args = args.map { |arg| arg.split(cmd.delimiter) }.flatten\n end\n end\n args = args.map { |arg| arg == \"true\" }\n end\n rescue => e# this is dangerous\n puts e\n nil\n end", "title": "" }, { "docid": "aa2bde4a9d77cce01709334bfaf6ed5a", "score": "0.48825935", "text": "def parse str = nil, type = nil\n if str and !str.empty? \n str.split( get_separator( type ) )\n elsif @items and [email protected]?\n @items\n else\n raise ArgumentError.new \"Bad parameter passed to method!\"\n end\n end", "title": "" }, { "docid": "2cb5123735003b05a274ecf77458a8e6", "score": "0.48761278", "text": "def manage_args(*args)\n end", "title": "" }, { "docid": "e4157e1a92d77b37afb8f7a40781b45a", "score": "0.48669145", "text": "def primaryWeaponItems _args\n \"primaryWeaponItems _args;\" \n end", "title": "" }, { "docid": "9a6dc4e4c492d9a396697ca8d9a6679a", "score": "0.48656377", "text": "def parse_args\n parser = Trollop::Parser.new do\n opt :resume\n opt :verbose\n version \"\"\n end\n\n parse do\n parser.parse\n end\n end", "title": "" }, { "docid": "d57f8b3b8af8dd51880cea179e27d098", "score": "0.48627135", "text": "def parsed_args\n args = Options.new('binnacle - Simple Test and Infra automation Framework')\n args.verbose = 0\n args.runner = false\n args.result_json = ''\n\n opt_parser = OptionParser.new do |opts|\n opts.banner = 'Usage: binnacle [options] <testfile>'\n\n opts.on('-w', '--wide', 'Do not crop the task line') { args.wide = true }\n opts.on('-v', '--verbose', 'Verbose output') { args.verbose += 1 }\n opts.on('-r', '--runner', 'Run the tasks from a file (Internal use only)') { args.runner = true }\n opts.on('--results-json=FILE', 'Results JSON file') do |json_file|\n args.result_json = json_file\n end\n\n opts.on('-h', '--help', 'Prints this help') do\n puts opts\n exit\n end\n\n opts.on('--version', 'Show Version information') do\n puts \"Binnacle #{Binnacle::VERSION}\"\n exit\n end\n end\n\n opt_parser.parse!(ARGV)\n\n if ARGV.empty?\n warn 'Task file is not specified'\n exit EXIT_INVALID_ARGS\n end\n\n args.task_files = ARGV\n args\nend", "title": "" }, { "docid": "618db51158db8e2800ef3f0a70c44112", "score": "0.48540157", "text": "def parse_command(text)\n words = wordify preprocess_input text\n \n key = nil\n args = []\n \n while 0 < words.count\n key = words.join('_').intern\n \n return key, args if @actions.has_action? key\n \n args.unshift words.pop\n end # while\n \n return nil, args\n end", "title": "" }, { "docid": "7f322cb787f5888005b46c10294a38fe", "score": "0.48514697", "text": "def parse str = nil\n if str and !str.empty? \n str.split( _separator )\n elsif @items and [email protected]?\n @items\n else\n raise ArgumentError.new \"Bad parameter passed to method!\"\n end\n end", "title": "" }, { "docid": "87a679d4e1092b0d6966b38cd33a7a9d", "score": "0.48483133", "text": "def process(args)\n args\n end", "title": "" }, { "docid": "0bcd494736de067d503fa9bcef2754e0", "score": "0.48434308", "text": "def parse(argv, env)\n @argv = argv.dup\n @env = env\n\n tuple = find_command(@context, prefix: \"\")\n\n while (val = @argv.shift)\n @remaining_argv << val\n end\n\n tuple\n end", "title": "" }, { "docid": "95f78cab3b69ff4741ff38d0a4837656", "score": "0.48164204", "text": "def parse_opt(args)\n valid_opts = %w{--version -v --install -i --help -h\n --complete -c --bookmark -b --search -s}\n\n nextarg = args.shift\n errormsg = 'Error: '.red + \"unrecognized option #{nextarg}\"\n pexit errormsg, 1 if ! (valid_opts.include? nextarg)\n\n # forced bookmarking\n if nextarg == '--bookmark' || nextarg == '-b'\n if args.first.nil?\n pexit 'Error: '.red + 'booker --bookmark expects bookmark id', 1\n else\n open_bookmark args\n end\n end\n\n # autocompletion\n if nextarg == '--complete' || nextarg == '-c'\n allargs = args.join(' ')\n bm = Bookmarks.new(allargs)\n bm.autocomplete\n end\n\n # installation\n if nextarg == '--install' || nextarg == '-i'\n if !args.empty?\n install(args)\n else # do everything\n install(%w{completion config bookmarks})\n end\n end\n\n # forced searching\n if nextarg == '--search' || nextarg == '-s'\n pexit '--search requires an argument', 1 if args.empty?\n allargs = args.join(' ')\n open_search allargs\n end\n\n # print version information\n version if nextarg == '--version' || nextarg == '-v'\n\n # needs some help\n helper if nextarg == '--help' || nextarg == '-h'\n\n exit 0 # dont parse_arg\n end", "title": "" }, { "docid": "d48ffb15acea1d1c8232e5d73650687f", "score": "0.48153904", "text": "def items _args\n \"items _args;\" \n end", "title": "" }, { "docid": "e9ff4695901e0326f81065a556012900", "score": "0.4814246", "text": "def optparse_args\n if short\n [\"--#{name}\", \"-#{short}\", desc, :REQUIRED]\n else\n [\"--#{name}\", desc, :REQUIRED]\n end\n end", "title": "" }, { "docid": "5c9a886cb7c7bd73b7622d92c61bb3eb", "score": "0.47939304", "text": "def handgunItems _args\n \"handgunItems _args;\" \n end", "title": "" }, { "docid": "edb955781cd1c26b53a9069762490e16", "score": "0.4793574", "text": "def parse(args)\n arg_list = arg_groups(args)\n options = DEFAULT_OPTIONS.dup\n options[:exclude] += default_excludes\n options[:locations] = arg_list.shift\n\n arg_list.reject(&:empty?).each do |set|\n flag, *args = set\n args.map! { |arg| arg.delete(\"/\") } # \"log/\" => \"log\"\n\n case flag\n when '-f', '--flags' then options[:flags] += args\n when '-e', '--exclude' then options[:exclude] += args\n else puts \"Unknown argument: #{flag}\"\n end\n end\n\n options\n end", "title": "" }, { "docid": "79552068aea60a34567f1a08d9150355", "score": "0.4792584", "text": "def cli_parse\n @command = nil\n\n cli @argv,\n \"-R --rules\" => lambda{ @command = :list },\n \"-H --help\" => lambda{ @command = :help },\n \"-a --auto\" => method(:watch=),\n \"-f --fresh\" => method(:fresh!),\n \"-s --script\" => method(:script=),\n \"-D --debug\" => method(:debug!)\n end", "title": "" }, { "docid": "f6f8169e4c92016b73c7589889681468", "score": "0.47888145", "text": "def parse_args(argv)\n @args ||= nil\n raise \"#{class_name}.initialize failed to call super!\" unless\n args.is_a?(Hash)\n\n #\n # if this CLI has boolean arguments which can immediately\n # precede the non-option arguments (ie those arguments which\n # don't begin with '--'), those booleans need to be declared.\n # otherwise when parsing the boolean argument, we'll mistake\n # the boolean as an option with a value:\n #\n # foo.rb --boolean firstnonoption\n #\n # becomes args = {:boolean => 'firstnonoption'}.\n #\n booleans = {}\n booleans = Hash[*(boolean_args.map { |a| [a,1] }.flatten)] if\n self.respond_to? :boolean_args\n\n skipped = []\n while argv.length > 0 do\n unless argv[0] =~ /^--?/\n skipped.push argv.shift\n\n else\n # shift the argument name out of argv\n argname = argv.shift.sub(/^--?/, '').downcase\n raise ArgumentError, \"expected: --ARGNAME; got: '#{argname.inspect}'\" unless\n argname.is_str?\n\n # strip trailing '-' then convert remaining '-' to '_'\n argsym = argname.sub(/-+$/, '').gsub(/-+/, '_').to_sym\n\n if booleans[argsym] or (argv.length < 1) or (argv[0] =~ /^--?/)\n # a boolean argument whose value is false when the argument ends with '-'\n args[argsym] = (argname =~ /-$/) ? false : true\n else\n # named argument\n args[argsym] = argv.shift\n end\n end\n end\n\n self.argv = skipped || []\n\n usage if args[:help] or args[:usage]\n end", "title": "" }, { "docid": "608686eb9b3d6631cb8efce5149fed5d", "score": "0.47843385", "text": "def vestItems _args\n \"vestItems _args;\" \n end", "title": "" }, { "docid": "82d31601ef5885bda0c5416fc55635d3", "score": "0.47839993", "text": "def process_item_list(item)\n aux_item = item.strip\n\n # remove start [\n if aux_item.start_with?('[')\n aux_item = aux_item[1..aux_item.length]\n end\n\n # remove end ]\n if aux_item.end_with?(']')\n aux_item = aux_item[0..aux_item.length-2]\n end\n\n aux_item\n end", "title": "" }, { "docid": "b639c1a3f126d04c133515b9e2703a83", "score": "0.47771043", "text": "def parse_args(args)\n options = {\n :console => false,\n :tag => nil\n }\n\n opt_parser = OptionParser.new do |opts|\n opts.banner = \"Usage: #{$0} <input filepath> [options]\"\n\n opts.separator \"\"\n opts.separator \"Data options:\"\n\n opts.on(\"-t T\", String, \"Tag\") do |t|\n options[:tag] = t\n end\n opts.separator \"\"\n opts.on_tail(\"-h\", \"--help\", \"Show this message\") do\n puts opts\n exit\n end\n end\n\n opt_parser.parse!(args)\n options\nend", "title": "" }, { "docid": "557be17c4fa2ef28f8f18c782817c0b1", "score": "0.4755162", "text": "def parse args=ARGV\n\t\t\tOptionParser.new do |opts|\n\t\t\t\t# Setup\n\t\t\t\tversion_path = File.expand_path('../../VERSION', File.dirname(__FILE__))\n\t\t\t\topts.version = File.exist?(version_path) ? File.read(version_path) : ''\n\t\t\t\t# Start of help text\n\t\t\t\topts.banner = 'Usage: tracking [mode]'\n\t\t\t\topts.separator ' display recent tasks'\n\t\t\t\topts.separator ' <task description> start a new task with the given text (spaces allowed)'\n\t\t\t\t# Modes\n\t\t\t\topts.on('-f', '--find', 'display all tasks that match a search query') do\n\t\t\t\t\tdisplay(:query => text_from_args)\n\t\t\t\t\treturn\n\t\t\t\tend\n\t\t\t\topts.on('-a', '--all', 'display all tasks') do\n\t\t\t\t\tdisplay(:max => :all)\n\t\t\t\t\treturn\n\t\t\t\tend\n\t\t\t\topts.on('-n', '--number integer', 'display n tasks') do |number_str|\n\t\t\t\t\tdisplay(:max => number_str.to_i)\n\t\t\t\t\treturn\n\t\t\t\tend\n\t\t\t\topts.on('-r', '--rename', 'rename the last task') do\n\t\t\t\t\tList.rename text_from_args\n\t\t\t\t\tdisplay\n\t\t\t\t\treturn\n\t\t\t\tend\n\t\t\t\topts.on('-d', '--delete', 'delete the last task') do\n\t\t\t\t\tList.delete\n\t\t\t\t\tdisplay\n\t\t\t\t\treturn\n\t\t\t\tend\n\t\t\t\topts.on('-c', '--clear', 'delete all tasks') do\n\t\t\t\t\tList.clear\n\t\t\t\t\tputs 'List cleared.'\n\t\t\t\t\treturn\n\t\t\t\tend\n\t\t\t\topts.on('-h', '--help', 'display this help information') do\n\t\t\t\t\tputs opts\n\t\t\t\t\treturn\n\t\t\t\tend\n\t\t\tend.parse! args\n\n\t\t\t# Basic modes (display and add)\n\t\t\tif args.count == 0\n\t\t\t\t# Display all tasks\n\t\t\t\tdisplay\n\t\t\telse\n\t\t\t\t# Start a new task\n\t\t\t\tList.add args.join(' ').gsub(\"\\t\",'')\n\t\t\t\tdisplay\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "289e26568b597426c44fcb5e20a0a489", "score": "0.47519013", "text": "def extract_help_tag_arguments(*args)\n name = args.delete_at(0)\n text = nil\n options = {}\n args.each do |arg|\n if arg.is_a?(TrueClass)\n text = nil\n elsif arg.is_a?(String)\n text = arg\n elsif arg.is_a?(Hash)\n options.merge!(arg)\n end\n end\n options.stringify_keys!\n text ||= options.delete('text') unless options['text'].is_a?(TrueClass)\n return [name, text, options]\n end", "title": "" }, { "docid": "1115fef147b873019bc02182f6a70767", "score": "0.475155", "text": "def parse_command\n log_and_exit read_template('help') if @input.empty?\n @command = @input.shift\n \n while @input.any?\n opt = @input.shift\n \n if opt =~ /^--(\\w+)(=(\"[^\"]+\"|[\\w]+))*/\n name = $1\n value = $3 ? $3.gsub(/\"/, \"\") : true\n @named_options[name] = value\n else\n @options << opt\n end\n end\n end", "title": "" }, { "docid": "634b70373f31727c8a0c963059b87a18", "score": "0.47417834", "text": "def split_main_and_subcommand(argv, command_list)\n # Initialize return variables\n main_args = nil\n sub_command = nil\n sub_args = []\n\n commands = []\n command_list.keys.each {|k| commands << k.to_s}\n\n # We split the arguments into two: One set containing any flags before a word, and then the rest. The rest are what\n # get actually sent on to the command\n argv.each_index do |i|\n if commands.index(argv[i])\n main_args = argv[0, i]\n sub_command = argv[i]\n sub_args = argv[i+1..-1]\n break\n elsif argv[i].end_with?('.rb')\n main_args = argv[0, i]\n sub_command = 'execute_ruby_script'\n sub_args = argv[i..-1]\n break\n end\n end\n\n # Handle the case that argv was empty or didn't contain any command\n main_args = argv.dup if main_args.nil?\n\n [main_args, sub_command, sub_args]\nend", "title": "" }, { "docid": "015d03ab024fedd84c76b3dd1d55962c", "score": "0.47380388", "text": "def parse_command(cmd)\n command = cmd.split(\" \")\n if command[0] == \"Driver\"\n @drivers << Driver.new(command[1])\n elsif command[0] == \"Trip\"\n @drivers.find {|d| d.name == command[1]}.\n trips << Trip.new(command[1], command[2], command[3], command[4])\n end\n end", "title": "" }, { "docid": "60a2aed9f97d7c9987fb5aa4a30ee09c", "score": "0.47366318", "text": "def extract_options!\n option_parser.order!(args)\n end", "title": "" }, { "docid": "6e4fc54f8a43ef0d213133184db75a53", "score": "0.47348756", "text": "def parse_options(args)\n args.each do |arg|\n case arg\n when '-h', '--help' then @opts[:help] = true\n when '-un', '--user' then @opts[:user] = args.next(arg)\n when '-pw', '--pass' then @opts[:pass] = args.next(arg)\n when '-t', '--token' then @opts[:token] = args.next(arg)\n when '-g', '--get' then @opts[:get] = args.next(arg)\n when '-d', '--debug' then @opts[:debug] = true\n when '-r', '--random' then @opts[:get] = nil\n else next\n end\n end\n end", "title": "" }, { "docid": "2a45b137f6c5499bf0ac2f8a0bec9325", "score": "0.4733491", "text": "def parse_catchall\n bail_args(@argv.join(' ')) if(@argv.length != 0)\n end", "title": "" }, { "docid": "96c31c0425b124525387c0d25e859491", "score": "0.47271627", "text": "def parse(args = nil)\n\t\t\t\targs ||= {}\n\t\t\t\t# Create options\n\t\t\t\tnoat = [:bool, :action]\n\t\t\t\tsopts = @options.each_value.collect { |option| [option[:long], option[:short], noat.include?(option[:type]) ? GetoptLong::NO_ARGUMENT : GetoptLong::REQUIRED_ARGUMENT] }\n\n\t\t\t\topts = GetoptLong.new(*sopts)\n\t\t\t\topts.quiet = true\n\n\t\t\t\t# Parse option\n\t\t\t\tbegin\n\t\t\t\t\topts.each do |given, arg|\n\t\t\t\t\t\toptname = @options_map[given]\n\t\t\t\t\t\toption = @options[optname]\n\t\t\t\t\t\tvalue = nil\n\n\t\t\t\t\t\t# VALIDATE ARGUMENT DUE TO CASE\n\t\t\t\t\t\tcase option[:type]\n\t\t\t\t\t\t\twhen :string then\n\t\t\t\t\t\t\t\tvalue = arg\n\t\t\t\t\t\t\twhen :int then\n\t\t\t\t\t\t\t\tif arg.strip =~ /^(-?)(\\d+)$/ then\n\t\t\t\t\t\t\t\t\tvalue = arg.to_i(10)\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\[email protected](msg: \"Argument of option \\\"#{given}\\\" must be an integer.\", dots: false)\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\twhen :float then\n\t\t\t\t\t\t\t\tif arg.strip =~ /^(-?)(\\d*)(\\.(\\d+))?$/ && arg.strip() != \".\" then\n\t\t\t\t\t\t\t\t\tvalue = arg.to_f\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\[email protected](msg: \"Argument of option \\\"#{given}\\\" must be a float.\", dots: false)\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\twhen :choice then\n\t\t\t\t\t\t\t\tif @options[optname].choices.find_index { |choice| arg =~ choice } then\n\t\t\t\t\t\t\t\t\tvalue = arg\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\[email protected](msg: \"Invalid argument (invalid choice) for option \\\"#{given}\\\".\", dots: false)\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\twhen :list then\n\t\t\t\t\t\t\t\tvalue = arg.split(\",\")\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tvalue = true\n\t\t\t\t\t\tend\n\n\t\t\t\t\t\t@options[optname][:value] = value\n\t\t\t\t\tend\n\t\t\t\trescue StandardError => exception\n\t\t\t\t\tif exception.message =~ /.+-- (.+)$/ then\n\t\t\t\t\t\tgiven = $1\n\n\t\t\t\t\t\tif exception.is_a?(GetoptLong::InvalidOption) then\n\t\t\t\t\t\t\[email protected](msg: \"Unknown option \\\"#{given}\\\".\", dots: false) if !args[:ignore_unknown]\n\t\t\t\t\t\telsif exception.is_a?(GetoptLong::MissingArgument) then\n\t\t\t\t\t\t\[email protected](msg: \"Option \\\"-#{given}\\\" requires an argument.\", dots: false)\n\t\t\t\t\t\tend\n\t\t\t\t\telse\n\t\t\t\t\t\[email protected](\"Unexpected error: #{exc.message}.\")\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\t# SET OTHER ARGUMENTS\n\t\t\t\t@args = ARGV\n\n\t\t\t\t# CHECK IF HELP WAS REQUESTED\n\t\t\t\tif self.provided?(\"help\") && !args[:ignore_help] then\n\t\t\t\t\tself.print_help\n\t\t\t\t\texit(0)\n\t\t\t\tend\n\n\t\t\t\t# NOW CHECK IF SOME REQUIRED OPTION WAS NOT SPECIFIED OR IF WE HAVE TO EXECUTE AN ACTION\n\t\t\t\t@inserted[:name].each do |key|\n\t\t\t\t\toption = @options[key]\n\n\t\t\t\t\tif option[:required] == true && option[:value] == nil then\n\t\t\t\t\t\[email protected](msg: \"Required option \\\"#{option[:name]}\\\" not specified.\", dots: false)\n\t\t\t\t\telsif option[:value] == true && option[:type] == :action then\n\t\t\t\t\t\toption.action.call\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "ce4ffdb99bda38035bab102c53c8e81f", "score": "0.47193855", "text": "def parse!( args )\n @args = args\n @options.grep!(args)\n end", "title": "" }, { "docid": "0654416b2e58dc0ec56a4d7bd967e387", "score": "0.47136906", "text": "def get_cli_tags\n if ENV.include?(\"add_tags\") && ENV['add_tags']\n return ENV['add_tags'].downcase.split(',').collect {|s| s.strip }\n else\n return nil\n end\n end", "title": "" }, { "docid": "5756d68c16eca8db460c8cda0714af47", "score": "0.4705776", "text": "def parse_args(str)\n return str.split(/\\s+:(.*)|\\s+/)\n end", "title": "" }, { "docid": "65e93078bcfe181512eed5c6948a0f2c", "score": "0.47037542", "text": "def tokenize_args(args)\n args\n end", "title": "" }, { "docid": "23194a7a92ae3fb1f483f6f46f4e1fcb", "score": "0.47031158", "text": "def parse_options\nmain_opts = %w(jadd cadd jgadd cgadd wadd sum list ausgleich)\nbetrag_opts = %w(jadd cadd jgadd cgadd wadd)\n\n\tusage if ARGV.size < 1\n\n\toptions = {:modus => ARGV.shift}\n\n\tusage unless main_opts.include?(options[:modus])\n\n\tif betrag_opts.include?(options[:modus])\n\t\tusage if ARGV.size < 1\n\t\toptions[:betrag] = ARGV.shift.to_f\n\t\toptions[:tags] = sanitize_tags(ARGV)\n\n\t\toptions[:jahr] = Time.now.year\n\t\toptions[:monat] = Time.now.month\n\telsif options[:modus] == \"sum\" || options[:modus] == \"list\"\n\t\t#usage if ARGV.size < 1\n\t\toptions[:name] = parse_name\n\t\toptions[:jahr], options[:monat] = parse_date\n\telsif options[:modus] == \"ausgleich\"\n\t\toptions[:jahr], options[:monat] = parse_date\n\tend\n\n\treturn options\nend", "title": "" }, { "docid": "7c9b0271097d700c554bf9c82636906f", "score": "0.4693315", "text": "def parse argv\n @bare.clear\n eoo = argv.index '--' # end of options\n if eoo\n tail = argv[eoo+1 .. ]\n argv = argv[ .. eoo-1]\n end\n re = /^-{1,2}(?=[^-])/\n for first,second in argv.chunk_while{ _1 =~ re and _2 !~ re }\n case first\n when /^--(?i:no)-(?=[^-])/\n # --no-long\n p = plong $~.post_match\n raise \"#{p.long} is not boolean\" unless p.boolean\n @buffer[p] = false\n @bare.push second if second\n when /^--(?=[^-])/\n # --long\n p = plong $~.post_match\n if p.boolean\n @buffer[p] = true\n @bare.push second if second\n else\n @buffer[p] = second\n end\n when /^-(?=[^-])(?!.*[0-9])/\n # -short\n letters = $~.post_match.chars\n b,o = letters.map{ pshort _1 }.partition &:boolean\n b.each{ @buffer[_1] = true }\n o.each{ @buffer[_1] = nil }\n if second\n if o.empty?\n @bare.push second\n else\n @buffer[o.pop] = second\n end\n end\n else\n # bare\n @bare.push first\n end\n end\n @bare.concat tail if tail\n end", "title": "" }, { "docid": "5d52f5af3e6cc6275a9104e566a3e91e", "score": "0.4692787", "text": "def argv; argline.split(/ +/) unless argline.nil?; end", "title": "" }, { "docid": "97dd178e170ff296772a2fd1141dadd2", "score": "0.46924525", "text": "def parse_argv(argv, &block)\n return parse_posix_argv(argv, &block) if @posix\n\n @not_parsed = []\n tagged = []\n argv.each_with_index { |e,i|\n if \"--\" == e\n @not_parsed = argv[(i+1)..(argv.size+1)]\n break\n elsif \"-\" == e\n tagged << [:arg, e] \n elsif ?- == e[0] \n m = Option::GENERAL_OPT_EQ_ARG_RE.match(e)\n if m.nil?\n tagged << [:opt, e] \n else\n tagged << [:opt, m[1]]\n tagged << [:arg, m[2]]\n end\n else\n tagged << [:arg, e]\n end\n }\n\n #\n # The tagged array has the form:\n # [\n # [:opt, \"-a\"], [:arg, \"filea\"], \n # [:opt, \"-b\"], [:arg, \"fileb\"], \n # #[:not_parsed, [\"-z\", \"-y\", \"file\", \"file2\", \"-a\", \"-b\"]]\n # ]\n\n #\n # Now, combine any adjacent args such that\n # [[:arg, \"arg1\"], [:arg, \"arg2\"]]\n # becomes\n # [[:args, [\"arg1\", \"arg2\"]]]\n # and the final result should be\n # [ \"--file\", [\"arg1\", \"arg2\"]]\n #\n\n parsed = []\n @args = []\n tagged.each { |e|\n if :opt == e[0]\n parsed << [e[1], []]\n elsif :arg == e[0]\n if Array === parsed[-1] \n parsed[-1][-1] += [e[1]]\n else\n @args << e[1]\n end\n else\n raise \"How did we get here?\"\n end\n }\n parsed.each { |e| block.call(e) }\n end", "title": "" }, { "docid": "c366558aafef5feda0e7f9fbe842613b", "score": "0.46680272", "text": "def handle_add_command(text, bot, withnote)\n bot.logger.info(withnote)\n run_command = 'capture'\n first_arg, rest = text.split(' ', 2)\n case first_arg\n when 'top'\n # prepend\n run_command += ' --priority=0'\n when 'bottom'\n # append\n run_command += ' --priority=1000'\n else\n if first_arg.scan(/\\D/).empty?\n # number -> explicitly given position\n run_command += \" --priority=#{first_arg.to_i}\"\n else\n # rejoin\n rest = (first_arg || '') + ' ' + (rest || '')\n end\n end\n if withnote\n parentnode, text_and_note = rest.split(' ', 2)\n text_to_add, note = text_and_note.split('\" \"', 2)\n text_to_add = text_to_add[1, note.length] if text_to_add.start_with?('\"')\n note = note[0, note.length - 1] if (note || '').end_with?('\"')\n call_wf(\"#{run_command} --parentid=#{parentnode} --name=\\\"#{text_to_add}\\\" --note=\\\"#{note}\\\"\", bot)\n else\n parentnode, text_to_add = rest.split(' ', 2)\n call_wf(\"#{run_command} --parentid=#{parentnode} --name=\\\"#{text_to_add}\\\"\", bot)\n end\nend", "title": "" }, { "docid": "5fa55f7cd8bc9b26e995aa24c0b4cc78", "score": "0.4666495", "text": "def parse_extra_args(extra = {})\n raise NotImplementedError,\n \"This Rhizome Equipment Type (#{type}) does not have extra arguments\"\n end", "title": "" }, { "docid": "270efd58db22f6317dd310cc86b74aaa", "score": "0.4665511", "text": "def item_1(tape:, state_info:, args: {})\n result = args[:subclass].process(tape: tape, **args)\n return result.merge({ state: :failed }) if result.failed\n\n result.merge({ state: :delimiter_1 })\n end", "title": "" }, { "docid": "46c2d7f92501ca33791f1c2667ced61f", "score": "0.46540797", "text": "def parse_args(args)\n case args\n when String\n begin\n Sidekiq.load_json(args)\n rescue JSON::ParserError\n [*args] # cast to string array\n end\n when Hash\n [args] # just put hash into array\n when Array\n args # do nothing, already array\n else\n [*args] # cast to string array\n end\n end", "title": "" }, { "docid": "1091620f2f37d41ccd7599401bdffb80", "score": "0.46448708", "text": "def parse(argv=ARGV)\n argv = Array(argv)\n\n while @parse and entry = argv.shift\n # collect everything that is not an option\n if entry[0] != ?-\n @on_extra[entry]\n next\n end\n\n # this is a long option\n if entry[1] == ?-\n opt, arg = entry.split \"=\"\n process argv, entry, opt, arg\n next\n end\n\n # disambiguate short option group from short option with argument\n opt, arg, rest = split entry, 2\n\n # process first option\n option = process argv, entry, opt, arg\n next unless option and not option.arg?\n\n # process the rest of the options\n while rest.size > 0\n opt, arg, rest = split rest, 1\n opt = \"-\" + opt\n option = process argv, opt, opt, arg\n break if option.arg?\n end\n end\n\n @extra\n rescue ParseError => e\n puts self\n puts e\n exit 1\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "f71344478ed87533b34c8a3c7c3660ee", "score": "0.0", "text": "def set_djcat\n @djcat = Djcat.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "def on_setup_callbacks; end", "title": "" }, { "docid": "311e95e92009c313c8afd74317018994", "score": "0.59219855", "text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5913137", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5913137", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "bfea4d21895187a799525503ef403d16", "score": "0.589884", "text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "352de4abc4d2d9a1df203735ef5f0b86", "score": "0.5889191", "text": "def required_action\n # TODO: implement\n end", "title": "" }, { "docid": "8713cb2364ff3f2018b0d52ab32dbf37", "score": "0.58780754", "text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n else\n super\n end\n end", "title": "" }, { "docid": "a80b33627067efa06c6204bee0f5890e", "score": "0.5863248", "text": "def actions\n\n end", "title": "" }, { "docid": "930a930e57ae15f432a627a277647f2e", "score": "0.58094144", "text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end", "title": "" }, { "docid": "33ff963edc7c4c98d1b90e341e7c5d61", "score": "0.57375425", "text": "def setup\n common_setup\n end", "title": "" }, { "docid": "a5ca4679d7b3eab70d3386a5dbaf27e1", "score": "0.57285565", "text": "def perform_setup\n end", "title": "" }, { "docid": "ec7554018a9b404d942fc0a910ed95d9", "score": "0.57149214", "text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "c85b0efcd2c46a181a229078d8efb4de", "score": "0.56900954", "text": "def custom_setup\n\n end", "title": "" }, { "docid": "100180fa74cf156333d506496717f587", "score": "0.56665677", "text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend", "title": "" }, { "docid": "2198a9876a6ec535e7dcf0fd476b092f", "score": "0.5651118", "text": "def initial_action; end", "title": "" }, { "docid": "b9b75a9e2eab9d7629c38782c0f3b40b", "score": "0.5648135", "text": "def setup_intent; end", "title": "" }, { "docid": "471d64903a08e207b57689c9fbae0cf9", "score": "0.56357735", "text": "def setup_controllers &proc\n @global_setup = proc\n self\n end", "title": "" }, { "docid": "468d85305e6de5748477545f889925a7", "score": "0.5627078", "text": "def inner_action; end", "title": "" }, { "docid": "bb445e7cc46faa4197184b08218d1c6d", "score": "0.5608873", "text": "def pre_action\n # Override this if necessary.\n end", "title": "" }, { "docid": "432f1678bb85edabcf1f6d7150009703", "score": "0.5598699", "text": "def target_callbacks() = commands", "title": "" }, { "docid": "48804b0fa534b64e7885b90cf11bff31", "score": "0.5598419", "text": "def execute_callbacks; end", "title": "" }, { "docid": "5aab98e3f069a87e5ebe77b170eab5b9", "score": "0.5589822", "text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5558845", "text": "def global_callbacks; end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5558845", "text": "def global_callbacks; end", "title": "" }, { "docid": "482481e8cf2720193f1cdcf32ad1c31c", "score": "0.55084664", "text": "def required_keys(action)\n\n end", "title": "" }, { "docid": "353fd7d7cf28caafe16d2234bfbd3d16", "score": "0.5504379", "text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end", "title": "" }, { "docid": "dcf95c552669536111d95309d8f4aafd", "score": "0.5465574", "text": "def layout_actions\n \n end", "title": "" }, { "docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40", "score": "0.5464707", "text": "def on_setup(&block); end", "title": "" }, { "docid": "8ab2a5ea108f779c746016b6f4a7c4a8", "score": "0.54471064", "text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend", "title": "" }, { "docid": "e3aadf41537d03bd18cf63a3653e05aa", "score": "0.54455084", "text": "def before(action)\n invoke_callbacks *options_for(action).before\n end", "title": "" }, { "docid": "6bd37bc223849096c6ea81aeb34c207e", "score": "0.5437386", "text": "def post_setup\n end", "title": "" }, { "docid": "07fd9aded4aa07cbbba2a60fda726efe", "score": "0.54160327", "text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "9358208395c0869021020ae39071eccd", "score": "0.5397424", "text": "def post_setup; end", "title": "" }, { "docid": "cb5bad618fb39e01c8ba64257531d610", "score": "0.5392518", "text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "a468b256a999961df3957e843fd9bdf4", "score": "0.5385411", "text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.53794575", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.5357573", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "118932433a8cfef23bb8a921745d6d37", "score": "0.53487605", "text": "def register_action(action); end", "title": "" }, { "docid": "725216eb875e8fa116cd55eac7917421", "score": "0.5346655", "text": "def setup\n @controller.setup\n end", "title": "" }, { "docid": "39c39d6fe940796aadbeaef0ce1c360b", "score": "0.53448105", "text": "def setup_phase; end", "title": "" }, { "docid": "bd03e961c8be41f20d057972c496018c", "score": "0.5342072", "text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end", "title": "" }, { "docid": "c6352e6eaf17cda8c9d2763f0fbfd99d", "score": "0.5341318", "text": "def initial_action=(_arg0); end", "title": "" }, { "docid": "207a668c9bce9906f5ec79b75b4d8ad7", "score": "0.53243506", "text": "def before_setup\n\n end", "title": "" }, { "docid": "669ee5153c4dc8ee81ff32c4cefdd088", "score": "0.53025913", "text": "def ensure_before_and_after; end", "title": "" }, { "docid": "c77ece7b01773fb7f9f9c0f1e8c70332", "score": "0.5283114", "text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end", "title": "" }, { "docid": "1e1e48767a7ac23eb33df770784fec61", "score": "0.5282289", "text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "4ad1208a9b6d80ab0dd5dccf8157af63", "score": "0.52585614", "text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end", "title": "" }, { "docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7", "score": "0.52571374", "text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end", "title": "" }, { "docid": "fc88422a7a885bac1df28883547362a7", "score": "0.52483684", "text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end", "title": "" }, { "docid": "8945e9135e140a6ae6db8d7c3490a645", "score": "0.5244467", "text": "def action_awareness\n if action_aware?\n if [email protected]?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "7b3954deb2995cf68646c7333c15087b", "score": "0.5236853", "text": "def after_setup\n end", "title": "" }, { "docid": "1dddf3ac307b09142d0ad9ebc9c4dba9", "score": "0.52330637", "text": "def external_action\n raise NotImplementedError\n end", "title": "" }, { "docid": "5772d1543808c2752c186db7ce2c2ad5", "score": "0.52300817", "text": "def actions(state:)\n raise NotImplementedError\n end", "title": "" }, { "docid": "64a6d16e05dd7087024d5170f58dfeae", "score": "0.522413", "text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52226824", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "db0cb7d7727f626ba2dca5bc72cea5a6", "score": "0.521999", "text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end", "title": "" }, { "docid": "8d7ed2ff3920c2016c75f4f9d8b5a870", "score": "0.5215832", "text": "def pick_action; end", "title": "" }, { "docid": "7bbfb366d2ee170c855b1d0141bfc2a3", "score": "0.5213786", "text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end", "title": "" }, { "docid": "78ecc6a2dfbf08166a7a1360bc9c35ef", "score": "0.52100146", "text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end", "title": "" }, { "docid": "2aba2d3187e01346918a6557230603c7", "score": "0.52085197", "text": "def ac_action(&blk)\n @action = blk\n end", "title": "" }, { "docid": "4c23552739b40c7886414af61210d31c", "score": "0.5203262", "text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end", "title": "" }, { "docid": "691d5a5bcefbef8c08db61094691627c", "score": "0.5202406", "text": "def performed(action)\n end", "title": "" }, { "docid": "6a98e12d6f15af80f63556fcdd01e472", "score": "0.520174", "text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end", "title": "" }, { "docid": "d56f4ec734e3f3bc1ad913b36ff86130", "score": "0.5201504", "text": "def create_setup\n \n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51963276", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51963276", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "7fca702f2da4dbdc9b39e5107a2ab87d", "score": "0.5191404", "text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end", "title": "" }, { "docid": "063b82c93b47d702ef6bddadb6f0c76e", "score": "0.5178325", "text": "def setup(instance)\n action(:setup, instance)\n end", "title": "" }, { "docid": "9f1f73ee40d23f6b808bb3fbbf6af931", "score": "0.51765746", "text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "7a0c9d839516dc9d0014e160b6e625a8", "score": "0.5162045", "text": "def setup(request)\n end", "title": "" }, { "docid": "e441ee807f2820bf3655ff2b7cf397fc", "score": "0.5150735", "text": "def after_setup; end", "title": "" }, { "docid": "1d375c9be726f822b2eb9e2a652f91f6", "score": "0.5143402", "text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end", "title": "" }, { "docid": "c594a0d7b6ae00511d223b0533636c9c", "score": "0.51415485", "text": "def code_action_provider; end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.51398855", "text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "title": "" }, { "docid": "2fcff037e3c18a5eb8d964f8f0a62ebe", "score": "0.51376045", "text": "def setup(params)\n end", "title": "" }, { "docid": "111fd47abd953b35a427ff0b098a800a", "score": "0.51318985", "text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end", "title": "" }, { "docid": "f2ac709e70364fce188bb24e414340ea", "score": "0.5115387", "text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "4c7a1503a86fb26f1e4b4111925949a2", "score": "0.5109771", "text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end", "title": "" }, { "docid": "63849e121dcfb8a1b963f040d0fe3c28", "score": "0.5107364", "text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend", "title": "" }, { "docid": "f04fd745d027fc758dac7a4ca6440871", "score": "0.5106081", "text": "def block_actions options ; end", "title": "" }, { "docid": "0d1c87e5cf08313c959963934383f5ae", "score": "0.51001656", "text": "def on_action(action)\n @action = action\n self\n end", "title": "" }, { "docid": "916d3c71d3a5db831a5910448835ad82", "score": "0.50964546", "text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end", "title": "" }, { "docid": "076c761e1e84b581a65903c7c253aa62", "score": "0.5093199", "text": "def add_callbacks(base); end", "title": "" } ]
b83c101c76c9a72cbe7a9ab5ce2a411b
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Draw Data data_type : the data block to draw next ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ { "docid": "dc4625edfa7669f6bb44a4a7aa5d471c", "score": "0.74938154", "text": "def draw_data(data_type)\n @maqj_font_data_type = data_type\n reset_font_settings\n send(:\"draw_#{data_type}\") if self.class.method_defined?(:\"draw_#{data_type}\")\n @draw_y += data_height(data_type)\n end", "title": "" } ]
[ { "docid": "d5bdf726c20ccf517a108a32b0820b07", "score": "0.6572497", "text": "def draw_data?(data_type)\n case data_type\n when :line then true\n when :level then @quest.level > 0 \n when :objectives then [email protected]_objectives.empty?\n when Array then (data_type - [:line]).any? { |dt| draw_data?(dt) }\n else [email protected](data_type).empty? # :description, :name, etc...\n end\n end", "title": "" }, { "docid": "7f55a1dfc82be120b2320da47152204d", "score": "0.6459716", "text": "def draw_data(x, y, width, header, text)\n x += 5\n width -= 5\n draw_line(x, y + line_height - 1, width)\n #draw_bg_rect(x + 1 , y, width - 2, line_height)\n if header.is_a? String\n change_color(system_color)\n draw_text(x, y, width, line_height, header)\n else\n draw_icon(header, x, y)\n end\n change_color(normal_color)\n draw_text(x, y, width, line_height, text, 2)\n end", "title": "" }, { "docid": "4b89e5466ca2d9db485ee1bf6bb92ca5", "score": "0.61515343", "text": "def draw_line_graph(data,data_description,serie_name=\"\")\r\n # Validate the Data and DataDescription array */\n #TODO Add method fr validate_data_description\r\n data_description = self.validate_data_description(\"draw_line_graph\",data_description)\n self.validate_data(\"draw_line_graph\",data)\r\n graph_id= 0\r\n data_description[\"values\"].each do |col_name|\r\n id = 0\r\n data_description[\"description\"].each do |keyi,valui|\r\n color_id = id if ( keyi == col_name ) \n id=id+1 \n end\r\n if ( serie_name == \"\" || serie_name == col_name )\r\n xpos = @g_area_x1 + @g_area_offset\r\n xlast = -1\r\n data.each do |key|\r\n if ( !(key[col_name].nil?))\r\n value =key[col_name]\r\n ypos = @g_area_y2 - ((value-@vmin) * @division_ratio)\r\n #Save point into the image map if option activated */\r\n self.add_to_image_map(xpos-3,ypos-3,xpos+3,ypos+3,data_description[\"description\"][col_name],key[col_name],data_description[\"unit\"][\"y\"],\"line\") if ( @build_map )\r\n xlast = -1if (!((value).is_a?(Numeric)))\r\n \r\n self.draw_line(xlast,ylast,xpos,ypos,@palette[color_id][\"r\"],@palette[color_id][\"g\"],@palette[color_id][\"b\"],true) if ( xlast != -1 )\r\n\r\n xlast = xpos\r\n ylast = ypos\r\n xlast = -1 if (!((value).is_a?(Numeric))) \r\n end\r\n xpos = xpos + @division_width\r\n end\r\n graph_id=graph_id+1\r\n end\r\n end\r\n end", "title": "" }, { "docid": "02598d91c25fdfa1476aa94946d8d5cc", "score": "0.58243227", "text": "def draw_data\r\n self.contents.font.name = AmmoFont\r\n # Loop through every item\r\n for i in 0...[@items.size, @xy_pos.size].min\r\n # Skip drawing the icon if the item is diabled\r\n next if item_disabled(i)\r\n next if not @items[i].methods.include( 'icon_name' )\r\n # Get the bitmap\r\n bitmap = RPGCache.icon(@items[i].icon_name)\r\n # If COG - Extra Frames is being used\r\n if defined(COG_ExtraFrames)\r\n # If the icon name includes the regexp, restrict to the first frame\r\n if @items[i].icon_name[COG_ExtraFramesREGEXP]\r\n rect = Rect.new(0, 0, bitmap.width $1.to_i, bitmap.height)\r\n # If it's a normal item, use its size\r\n else\r\n rect = bitmap.rect\r\n end\r\n else\r\n # Make the graphic's size the icon's size\r\n rect = bitmap.rect\r\n end\r\n x, y = @xy_pos[i][0] - rect.width 2, @xy_pos[i][1] - rect.height 2\r\n #set opacity depending on whether the item is usable\r\n opacity = (item_usable(@items[i]) 255 DisabledOpacity)\r\n # copy the bitmap onto the window\r\n self.contents.blt(x, y, bitmap, rect, opacity)\r\n #if the data is an item\r\n if @items[i].is_a(RPGItem)\r\n #get the id of the consumable used by the item\r\n id = XASITEM_COST[XASXASITEM_ID[@items[i].id]] rescue next\r\n #skip if there is no consumable\r\n next if id.nil\r\n #get the amount of that item\r\n ammount = $game_party.item_number(id)\r\n #check if the amount is capped\r\n if defined(ZeldaHUD_Customization) && \r\n !ZeldaHUD_CustomizationItemCapVar[id].nil\r\n value = $game_variables[ZeldaHUD_CustomizationItemCapVar[id]]\r\n cap = (ammount == value)\r\n else\r\n cap = (ammount == 99)\r\n end\r\n #get the font color\r\n color = cap Color.new(0,255,0,opacity) Color.new(255,255,255,opacity)\r\n self.contents.font.color = color\r\n #draw the ammount of the consumable\r\n self.contents.draw_text(x, y + 16, bitmap.width,\r\n bitmap.height, ammount.to_s, 0)\r\n end\r\n end\r\n #Reset the font details\r\n self.contents.font.name = Font.default_name\r\n self.contents.font.color = Font.default_color\r\n end", "title": "" }, { "docid": "728497c6ec4c55a5c866f586f0b13f01", "score": "0.5802348", "text": "def draw_data\n\n # Set font.\n font = \"SF Mono\"\n color = '000000'\n\n # Format dates.\n ship_date = Time.iso8601(@data[:date]).strftime(\"%m/%d/%y\")\n\n # Repeat format on all pages.\n self.repeat(:all) do\n\n # Carrier, shipper #s, and date.\n self.txtb(@data[:carrier], 1.171, 8.55 + 10.pt, 4, 10.pt, size: 10, style: :bold, h_align: :left, font: font, color: color)\n self.txtb(@data[:shipper], 6.75, 8.75 + 10.pt, 6.65, 10.pt, size: 10, style: :bold, h_align: :left, font: font, color: color)\n self.txtb(ship_date, 6.75, 8.55 + 10.pt, 6.65, 10.pt, size: 10, style: :bold, h_align: :left, font: font, color: color)\n\n # Ship to.\n if @data[:ship_to][:name].length == 2\n self.txtb(@data[:ship_to][:name][0], 1.006, 8.35 + 10.pt, 4, 10.pt, size: 10, style: :bold, h_align: :left, font: font, color: color)\n self.txtb(@data[:ship_to][:name][1], 1.006, 8.175 + 10.pt, 4, 10.pt, size: 10, style: :bold, h_align: :left, font: font, color: color)\n else\n self.txtb(@data[:ship_to][:name][0], 1.006, 8.175 + 10.pt, 4, 10.pt, size: 10, style: :bold, h_align: :left, font: font, color: color)\n end\n self.txtb(@data[:ship_to][:address], 1.006, 8 + 10.pt, 4, 10.pt, size: 10, style: :bold, h_align: :left, font: font, color: color)\n self.txtb(@data[:ship_to][:city_state], 1.006, 7.825 + 10.pt, 4, 10.pt, size: 10, style: :bold, h_align: :left, font: font, color: color)\n self.txtb(@data[:ship_to][:zip].to_s.rjust(5, '0'), 3.65, 7.825 + 10.pt, 4, 10.pt, size: 10, style: :bold, h_align: :left, font: font, color: color)\n\n # Ship from.\n self.txtb(@data[:initials], 7.65, 7.825 + 10.pt, 4, 10.pt, size: 10, style: :bold, h_align: :left, font: font, color: color)\n\n # Table.\n y = 7.1 + 10.pt\n 0.upto(8) do |i|\n self.txtb(@data[:units][i], 0.25, y, 1.25, 10.pt, size: 10, style: :bold, font: font, color: color) unless @data[:units][i] == 0\n self.txtb(@data[:hazardous][i], 1.5, y, 0.4, 10.pt, size: 10, style: :bold, font: font, color: color)\n self.txtb(@data[:descriptions][i], 1.95, y, 3.25, 10.pt, size: 10, style: :bold, h_align: :left, font: font, color: color)\n self.txtb(@data[:weights][i], 5.25, y, 1.25, 10.pt, size: 10, style: :bold, font: font, color: color)\n self.txtb(@data[:rates][i], 6.5, y, 0.6, 10.pt, size: 10, style: :bold, font: font, color: color)\n y -= 0.193\n end\n\n # Draw special instructions.\n self.txtb(@data[:special_instructions][0], 0.35, 3.67 + 10.pt, 7.8, 10.pt, size: 10, style: :bold, h_align: :left, font: font, color: color)\n self.txtb(@data[:special_instructions][1], 0.35, 3.5325 + 10.pt, 7.8, 10.pt, size: 10, style: :bold, h_align: :left, font: font, color: color)\n self.txtb(@data[:special_instructions][2], 0.35, 3.395 + 10.pt, 7.8, 10.pt, size: 10, style: :bold, h_align: :left, font: font, color: color)\n\n # Check box for collect.\n self.txtb(\"XX\", 7.377, 1.81 + 10.pt, 0.2, 0.2, size: 10, style: :bold, font: font, color: color) if @data[:collect]\n\n # Draw certification info.\n self.txtb(@data[:carrier], 4.95, 0.725 + 10.pt, 5, 10.pt, size: 10, style: :bold, h_align: :left, font: font, color: color)\n self.txtb(ship_date, 6.8, 0.575 + 10.pt, 5, 10.pt, size: 10, style: :bold, h_align: :left, font: font, color: color)\n\n # Draw signatures.\n if @data[:auto_sign]\n person = nil\n case @data[:user]\n when \"TERRY\"\n person = :terry_marshall\n when \"ROB\"\n person = :rob_caudill\n when \"TIM\"\n person = :tim_hudson\n when \"MITCH\"\n person = :mike_mitchell\n when \"CAP\"\n person = :gerald_cappelletti\n when \"DALLAS\"\n person = :dallas_roll\n when \"JAMES\"\n person = :james_hill\n end\n unless person.blank?\n self.signature(person, 4.35, 2.425, 2.05, 0.5)\n self.signature(person, 0.95, 0.8, 2.05, 0.25, h_align: :left)\n end\n end\n\n end\n\n end", "title": "" }, { "docid": "dd4514c2d0d770d183c6e066b9ef67b3", "score": "0.57103646", "text": "def generate_itemdef_data(type,name)\n generate_itemdef_line(type,name,true,false)\n end", "title": "" }, { "docid": "90e8356ff04e184d711557e46164662c", "score": "0.5613847", "text": "def data_height(data_type)\n return 0 unless draw_data?(data_type)\n return line_height if QuestData::BASIC_DATA_TYPES.include?(data_type)\n @maqj_font_data_type = data_type\n reset_font_settings\n return case data_type\n when :line, :level, :name then line_height\n when :banner\n bmp = Cache.picture(@quest.banner)\n hght = bmp.rect.height\n bmp.dispose\n hght\n when :description\n buff = description_x*2\n paragraph = mapf_format_paragraph(@quest.description, contents_width - buff)\n line_num = paragraph.scan(/\\n/).size + 1\n line_num += (QuestData::DESCRIPTION_IN_BOX ? 2 : \n !QuestData::VOCAB[:description].empty? ? 1 : 0)\n line_num*line_height\n when :objectives\n objectives = @quest.revealed_objectives.collect { |obj_id| \n @quest.objectives[obj_id] } \n line_num = QuestData::VOCAB[:objectives].empty? ? 0 : 1\n buff = (objective_x*2) + text_size(QuestData::VOCAB[:objective_bullet]).width\n objectives.each { |obj|\n paragraph = mapf_format_paragraph(obj, contents_width - buff)\n line_num += paragraph.scan(/\\n/).size + 1 }\n line_num*line_height\n when :rewards\n line_num = QuestData::VOCAB[:rewards].empty? ? 0 : 1\n (line_num + @quest.rewards.size)*line_height\n when Array then data_height(data_type.max_by { |dt| data_height(dt) })\n else 0\n end\n end", "title": "" }, { "docid": "92904c5a38cc6b27bbcb5a92aee85fa3", "score": "0.5603063", "text": "def draw\n get_blocks.each { |block| block.draw }\n end", "title": "" }, { "docid": "9b149331f061aec65b881d203cb8c3e5", "score": "0.55360633", "text": "def create_data_line(which = 1)\n create_line(\"data_line_#{which}\",\"Data_Line\", which)\n end", "title": "" }, { "docid": "e03c68816315ecc897bda901fe79e1f0", "score": "0.54938036", "text": "def draw_fame_data(x, line, width)\n y = line * line_height\n draw_fame(x, y, width / 2)\n draw_infame(x + width / 2, y, width / 2)\n end", "title": "" }, { "docid": "39f5234246abaddcc32a40879d5a9497", "score": "0.5473703", "text": "def fill_content\n @content[:type] = 'line' if ! @content[:type]\n\n data[:datasets].each do |current|\n add_color(current) if ! current[:borderColor]\n current[:fill] = false if ! current[:fill]\n current[:lineTension] = 0 if ! current[:lineTension]\n raise \"chart maker needs data. content #{@content}\" if ! current[:data]\n end\n\n end", "title": "" }, { "docid": "81aff46572e314a04008826a4c7e4e6d", "score": "0.5456488", "text": "def type\n data.type\n end", "title": "" }, { "docid": "47e688aa20057208955a7c49469e8903", "score": "0.54068303", "text": "def draw_data_array(layout_array)\n y, max_y = @draw_y, @draw_y\n # Draw each data aspect at the same starting @draw_y\n layout_array.each { |dt|\n @draw_y = y\n draw_data(dt)\n max_y = @draw_y if @draw_y > max_y\n }\n @draw_y = max_y\n end", "title": "" }, { "docid": "f15a04cfcf79a040f381efc225b23149", "score": "0.54011136", "text": "def do_draw(canvas, data)\n draw = Magick::Draw.new\n draw.fill('green')\n \n data.size.times do |y|\n data[y].size.times do |x|\n if data[y][x] == 1\n draw.rectangle(\n x * @x_map, y * @y_map,\n x * @x_map + @x_map, y * @y_map + @y_map)\n end\n end\n end\n \n draw.draw(canvas)\n end", "title": "" }, { "docid": "d0bc2f8eb7c781c2b732eb72ac325855", "score": "0.53985405", "text": "def draw(&block)\n instance_eval(&block)\n end", "title": "" }, { "docid": "89ee82431f1c1bb17287bda993d23731", "score": "0.539133", "text": "def draw\n\t\t\t\t\n\t\t\tend", "title": "" }, { "docid": "18cbd592342ef44092865ddedcbc5489", "score": "0.5374711", "text": "def draw_lines\n @dim.times do |i|\n if @type.nil?\n draw_line(i+1)\n draw_edge\n puts\n elsif @type == \"allx\" || @type == \"alt\"\n draw_alt_line\n draw_edge\n puts\n end\n end\n end", "title": "" }, { "docid": "5786e0af1e4fec5000996dbe014c7189", "score": "0.52977556", "text": "def draw()\n @ucIcon.draw()\n @cItemName.draw()\n @cItemNumber.draw()\n end", "title": "" }, { "docid": "5786e0af1e4fec5000996dbe014c7189", "score": "0.52977556", "text": "def draw()\n @ucIcon.draw()\n @cItemName.draw()\n @cItemNumber.draw()\n end", "title": "" }, { "docid": "ccc69f8559d91beb0f19b3734a9144a3", "score": "0.5296247", "text": "def set_data(data)\n @data_changed=true\n data ||= \"\"\n self.cur_pos=@last_pos=0\n clear_selection\n @data = data\n update_dimensions()\n refresh()\n end", "title": "" }, { "docid": "8d614257abdc50a9f548be6055d0bcd8", "score": "0.52871054", "text": "def draw()\n @ucIcon.draw()\n @cItemName.draw()\n @cItemPrice.draw()\n @cItemPossess.draw()\n @ucItemNumber.draw()\n end", "title": "" }, { "docid": "a63768609c05fd70f5fe9fdf06fd500a", "score": "0.52828366", "text": "def draw\n\n\t\tend", "title": "" }, { "docid": "729b9f21a28ef98a033b46f99e36dec5", "score": "0.5270068", "text": "def draw_play_data(x, line, width)\n y = line * line_height\n draw_playtime(x, y, width)\n max_story = $game_system.max_story\n draw_data_gauge(x, y + line_height, width / 2, Vocab::pi_storyboard, player.storymode, max_story, :percentage)\n x2 = x + width / 2\n w2 = width / 2\n #TODO: impostare il numero massimo di quest come da scritpt delle missioni\n draw_data_gauge(x2, y + line_height, w2, Vocab::pi_quests, player.quests, 50, :divisor)\n end", "title": "" }, { "docid": "1b7fa10d0cf7659663c856af81bb7b31", "score": "0.5262898", "text": "def create_graphics\n super\n draw_wanted_data\n end", "title": "" }, { "docid": "40719c39598322b4f8cb755b0faa7a89", "score": "0.52614045", "text": "def data_set(data, &block)\n Gnuplot::DataSet.new(data) do |ds|\n ds.with = config.linetype\n ds.linewidth = config.linewidth\n block.call(ds) if block_given?\n end\nend", "title": "" }, { "docid": "d3cce586cc7593eb77d3cae1783eb6bf", "score": "0.52485925", "text": "def data_type(data_type)\n state_depth_must_be(States::ATTRIBUTE)\n raise 'data_type already defined' if @current_attribute.data_type\n @current_attribute.data_type = data_type\n end", "title": "" }, { "docid": "62a0e9b8cc639670464d7aefc0c4731d", "score": "0.52472335", "text": "def draw()\n @cEquipKind.draw()\n @ucIcon.draw()\n @cEquipName.draw()\n end", "title": "" }, { "docid": "2a00a750f132ff8c1056cd9687fe7d6d", "score": "0.52440214", "text": "def draw()\n @cLabel.draw()\n @cValue.draw()\n end", "title": "" }, { "docid": "c79b4fe43a82c3d2fff540195337301d", "score": "0.52354527", "text": "def write_chart_type; end", "title": "" }, { "docid": "efb8b5a7a900636f0fe68048af5cb58f", "score": "0.5229465", "text": "def data(type = 1, size = nil, *args)\n res = ''\n if type.respond_to? :to_data\n unless Integer === size\n args.unshift size\n size = args.length\n end\n size.times do\n res << type.to_data(self, 0, args.shift)\n end\n size = nil\n else\n bsize = type.to_i\n raise Syntax, \"Invalid data type\" unless bsize == 1 || bsize == 2\n if Integer === size\n size *= bsize\n else\n args.unshift size\n size = nil\n end\n pack_string = bsize == 1 ? 'c' : 's'\n args.flatten.each_with_index do |data, index|\n res << \n if data.respond_to? :to_label\n case bsize\n when 1 then Z80::add_reloc(self, data, 1, index, :self)\n when 2 then Z80::add_reloc(self, data, 2, index*2)\n end\n elsif data.respond_to? :to_z80bin\n data.to_z80bin\n elsif Integer === data\n [data].pack(pack_string)\n else\n data.to_s\n end\n end\n end\n if size\n res = res.ljust(size, \"\\x0\") if res.bytesize < size\n res.slice!(size..-1)\n end\n Z80::add_code(self, res.force_encoding(Encoding::ASCII_8BIT), type)\n end", "title": "" }, { "docid": "c3159a2efdf1994a675fe826e7d4f2b2", "score": "0.5224996", "text": "def next_aide\n next_data = tdm[aide_index + 1]\n log(\"next_data: #{next_data.inspect}\",true)\n if not(next_data.nil?)\n @current = new(next_data)\n @current.output\n @aide_index += 1\n else\n log(\"Fin de l'aide. Pas de nouveau fichier.\".freeze, true)\n end\n end", "title": "" }, { "docid": "80a1a207f935f3b99f372de2a1c6b96e", "score": "0.52118856", "text": "def draw(iInputData, oOutputData, iIdxBeginSample, iIdxEndSample, iUnitDB, iMedianValue)\n prepareFunctionUtils\n lCFunction = @FunctionUtils.createCFunction(@Function, iIdxBeginSample, iIdxEndSample)\n oOutputData.each_buffer(iIdxBeginSample, iIdxEndSample) do |iIdxBeginBufferSample, iIdxEndBufferSample|\n prepareVolumeUtils\n oOutputData.pushRawBuffer(@VolumeUtils.drawVolumeFct(lCFunction, iInputData.Header.NbrBitsPerSample, iInputData.Header.NbrChannels, iIdxEndBufferSample-iIdxBeginBufferSample+1, iIdxBeginBufferSample, iUnitDB, iMedianValue))\n end\n end", "title": "" }, { "docid": "eaeb3a7b3b670bebd337056adb74da67", "score": "0.52048844", "text": "def do_extended_data( type, data )\n update_local_window_size data\n callback :extended_data, self, type, data\n end", "title": "" }, { "docid": "cd6aa9345fd9b8fa9a1ac547dca3c3a9", "score": "0.5188154", "text": "def type(flash_card_data, data_type)\n puts \"\\n------------ COMMAND: #{data_type} ------------\\n\"\n\n flash_card_data[data_type].each do |command|\n print_command(command)\n end\n\nend", "title": "" }, { "docid": "07027816a22ced87e4a293d1c6bac260", "score": "0.5186155", "text": "def draw(surface, data)\n value = @opts[:val].call(data) rescue nil\n return unless value\n\n @opts[:font].draw_blended_utf8(\n surface,\n value,\n @opts[:loc][0], @opts[:loc][1], \n @opts[:rgb][0], @opts[:rgb][1], @opts[:rgb][2]\n )\n end", "title": "" }, { "docid": "22e87038187c429105f3daed33a366ae", "score": "0.51764196", "text": "def type\n @data['type']\n end", "title": "" }, { "docid": "2077408ba8cb80e0b16f7694e6b1ede7", "score": "0.51724344", "text": "def draw\n\t\tend", "title": "" }, { "docid": "4d01bd8477a812699cf06812b857b684", "score": "0.5170684", "text": "def draw\n\t\tfield.each do |arr|\n\t\t\tarr.each { |i| print \" #{i} \".black.bg_cyan }\n\t\t\tputs\n\t\tend\n\tend", "title": "" }, { "docid": "feb545998bb1820d64f521423a6e9532", "score": "0.51660883", "text": "def draw; end", "title": "" }, { "docid": "feb545998bb1820d64f521423a6e9532", "score": "0.51660883", "text": "def draw; end", "title": "" }, { "docid": "561d78696ca8fa1289b825f524e03099", "score": "0.5162648", "text": "def find_type(data)\n start = data if self.rank == 0\n start = data.flatten[0] if self.rank != 0 \n self.type_num = Tensorflow::TF_INT64\n if start.is_a? Integer\n type = Integer\n self.data_size = 8\n elsif start.is_a? Float\n type = Float\n self.type_num = Tensorflow::TF_DOUBLE\n self.data_size = 8\n elsif start.is_a? String\n type = String\n self.type_num = Tensorflow::TF_STRING\n self.data_size = 8\n elsif start.is_a? Complex\n type = Complex\n self.type_num = Tensorflow::TF_COMPLEX128\n self.data_size = 16\n else \n raise \"Data type not supported.\"\n end\n return type if self.rank == 0 \n if type == Integer || type == Float\n float_flag = 0\n float_flag = 1 if type == Float\n data.flatten.each do |i|\n raise \"Different data types in array.\" if !(i.is_a? (Float) or i.is_a? (Integer))\n float_flag = 1 if i.is_a? (Float)\n end\n if float_flag == 1\n type = Float\n self.type_num = Tensorflow::TF_DOUBLE\n self.data_size = 8\n end\n else\n data.flatten.each do |i|\n raise \"Different data types in array.\" if !(i.is_a? (type))\n end\n end\n type\n end", "title": "" }, { "docid": "0bc3dafc5b23db54555d3dd3958a6b07", "score": "0.5161775", "text": "def send_data( type, data )\n data = data.to_s\n\n msg = @buffers.writer\n msg.write_long data.length + 1\n msg.write_byte type\n msg.write data\n\n @channel.send_data msg\n end", "title": "" }, { "docid": "f594f96e304a69f50a7b9797b7fa9caa", "score": "0.5156921", "text": "def data_block\n return @data_block unless @data_block.nil?\n io = _root.data_blocks_with_io._io\n _pos = io.pos\n io.seek(ofs_data_block)\n @data_block = DataBlock.new(io, self, @_root)\n io.seek(_pos)\n @data_block\n end", "title": "" }, { "docid": "59dc0fffdd98065775411c234778696b", "score": "0.5144887", "text": "def type\n @data['type']\n end", "title": "" }, { "docid": "15332f6b98681fd7748152049c1bc73c", "score": "0.5138054", "text": "def fill_content\n @content[:type] = 'line' if ! @content[:type]\n\n # data portion\n raise \"line chart maker needs labels . content #{@content}\" if ! data[:labels]\n data[:datasets].each do |current|\n puts \"current is #{current}\"\n add_color(current) if ! current[:borderColor]\n if ! current[:fill]\n current[:fill] = false \n if @args[:stacked] # stack chart and fill make more sense together\n current[:fill] = true\n end\n end\n current[:lineTension] = 0.1 if ! current[:lineTension]\n raise \"chart maker needs data. content #{@content}\" if ! current[:data]\n end\n end", "title": "" }, { "docid": "30ed888a49b9a5b46674a0236d8d35a2", "score": "0.513627", "text": "def store_chart_type # :nodoc:\n record = 0x1019 # Record identifier.\n length = 0x0006 # Number of bytes to follow.\n angle = 0x0000 # Angle.\n donut = 0x0000 # Donut hole size.\n grbit = 0x0002 # Option flags.\n\n store_simple(record, length, angle, donut, grbit)\n end", "title": "" }, { "docid": "7a3c5c1fb79b6b3d27a5d88d55c9e2f1", "score": "0.513306", "text": "def draw\n\t\t\n\tend", "title": "" }, { "docid": "7a3c5c1fb79b6b3d27a5d88d55c9e2f1", "score": "0.513306", "text": "def draw\n\t\t\n\tend", "title": "" }, { "docid": "7a3c5c1fb79b6b3d27a5d88d55c9e2f1", "score": "0.513306", "text": "def draw\n\t\t\n\tend", "title": "" }, { "docid": "7a3c5c1fb79b6b3d27a5d88d55c9e2f1", "score": "0.513306", "text": "def draw\n\t\t\n\tend", "title": "" }, { "docid": "173a7c3f3ff8151033df4e192486d177", "score": "0.5127943", "text": "def write_chart_type # :nodoc:\n end", "title": "" }, { "docid": "d0c1110675886c00ce81ed22c8f6aab3", "score": "0.5124513", "text": "def data\n @data_t\n end", "title": "" }, { "docid": "d2566c62642471098939f4452f400a95", "score": "0.51232725", "text": "def draw_item(index)\n end", "title": "" }, { "docid": "a70d9fbaa58bd7f02a21f4bdfa80057c", "score": "0.5123253", "text": "def initialize opts = {}\n \n @block=opts[:blk]||nil\n @selected=nil\n @state=:enabled\n @height=opts[:rows]\n @items=opts[:items] \n @headers=opts[:headers]\n @[email protected]\n mult = @items.size > @height ? 1:0\n debug(mult)\n nostroke\n @width=2\n @item=[]\n @headers.each { |x| @width+=(x[1]+1) }\n nostroke\n fill red\n @top=opts[:top]\n @left=opts[:left]\n @rec=rect :top => 0, :left => 0, :width=>@width+mult*12+2, :height=>31*(@height+1)+4 \n @lefty=0 \n\n # tweaks \n @default_color = black\n @default_color = opts[:defaultcolor] if opts[:defaultcolor]\n @color = black\n @color = opts[:color] if opts[:color]\n @predicate = Proc.new {|i| true }\n @predicate = opts[:predicate] unless opts[:predicate].nil?\n\n \n @header=flow do \n @headers.each_with_index do |h,l|\n temp=([email protected] ? h[1]+12*mult : h[1])\n debug(\"#{l} -> #{temp}\")\n flow :top=>2,:left=>@lefty+2,:width=>temp,:height=>29 do\n rect(:top=>0,:left=>1,:width=>temp,:height=>29, :fill=>lightgrey)\n p=para strong(h[0]), :top=>2, :align=>'center'\n @lefty+=h[1]+1\n end\n end \n end\n\n @flot1=stack :width=>@width+mult*12+2, :height=>31*(@height), :scroll=>true, :top=>33, :left=>1 do\n @items.each_with_index do |it, i|\n inscription \" \"\n @item[i]=stack :width=>@width-1, :top=>31*i, :left=>1 do\n @lefty=0\n rr=[]\n @columns.times do |ei|\n rr[ei]=rect(:top=>1, :left=>@lefty+1, :width=>@headers[ei][1]-1,:height=>29, :fill=>white)\n it[ei]=\" \" if not it[ei] or it[ei]==\"\"\n ins = inscription strong(it[ei]), :top=>31*i+3, :left=>@lefty+2, :width=>@headers[ei][1]-1, :align=>'center'\n\n # color tweak\n if @predicate.call(i)\n ins.style(:stroke => @color) \n else\n ins.style(:stroke => @default_color) \n end\n\n @lefty+=@headers[ei][1]+1\n end\n\n hover do\n if @state==:enabled\n @item[i].contents.each{|x| x.style(:fill=>dimgray)}\n end\n end\n leave do\n if @state==:enabled\n if @selected\n if @selected==i\n @item[i].contents.each{|x| x.style(:fill=>salmon)}\n else\n @item[i].contents.each{|x| x.style(:fill=>white)}\n end\n else\n @item[i].contents.each{|x| x.style(:fill=>white)}\n end\n end\n end\n click do\n if @state==:enabled\n if @selected\n if @selected==i\n @item[i].contents.each{|x| x.style(:fill=>white)}\n @selected=nil\n else\n @item[@selected].contents.each{|x| x.style(:fill=>white)} \n @item[i].contents.each{|x| x.style(:fill=>salmon)}\n @selected=i\n end\n else\n @item[i].contents.each{|x| x.style(:fill=>salmon)}\n @selected=i\n end\n @block.call @items[i] if @selected and @block\n end \n end \n end\n end\n end\n end", "title": "" }, { "docid": "3d3a117eb6a9761bf0cc19265ea81e48", "score": "0.5118684", "text": "def draw\n end", "title": "" }, { "docid": "3d3a117eb6a9761bf0cc19265ea81e48", "score": "0.5118684", "text": "def draw\n end", "title": "" }, { "docid": "3d3a117eb6a9761bf0cc19265ea81e48", "score": "0.5118684", "text": "def draw\n end", "title": "" }, { "docid": "2499de00d4dd7f685603383a2cef3c77", "score": "0.5118016", "text": "def draw(&block)\n block.call(self)\n end", "title": "" }, { "docid": "cf50c60005308a30aad59f40160212b3", "score": "0.5108314", "text": "def draw_item(index)\n #disegno l'oggetto\n end", "title": "" }, { "docid": "151cfc47c6a833ed7d164fc1173faff2", "score": "0.51071316", "text": "def plot_data\n clear_lines\n @buffer.keys.each { |k| plot_data_line(k, @buffer[k]) }\n end", "title": "" }, { "docid": "87e9cab78ab2a141d5b67dce44b2434b", "score": "0.5104754", "text": "def draw\n # TODO Left label\n # TODO Bottom labels and markers\n # @graph_bottom\n # Calculations are off 800x???\n\n @colors.reverse!\n\n draw_title\n\n @margin = 30.0\n @thickness = @raw_rows / 6.0\n @right_margin = @margin\n @graph_left = @title_width * 1.3 rescue @margin # HACK Need to calculate real width\n @graph_width = @raw_columns - @graph_left - @right_margin\n @graph_height = @thickness * 3.0\n\n # Background\n @d = @d.fill @colors[0]\n @d = @d.rectangle(@graph_left, 0, @graph_left + @graph_width, @graph_height)\n\n [:high, :low].each_with_index do |indicator, index|\n next unless @options.has_key?(indicator)\n @d = @d.fill @colors[index + 1]\n indicator_width_x = @graph_left + @graph_width * (@options[indicator] / @maximum_value)\n @d = @d.rectangle(@graph_left, 0, indicator_width_x, @graph_height)\n end\n\n if @options.has_key?(:target)\n @d = @d.fill @font_color\n target_x = @graph_left + @graph_width * (@options[:target] / @maximum_value)\n half_thickness = @thickness / 2.0\n @d = @d.rectangle(target_x, half_thickness, target_x + half_thickness, @thickness * 2 + half_thickness)\n end\n\n # Value\n @d = @d.fill @font_color\n @d = @d.rectangle(@graph_left, @thickness, @graph_left + @graph_width * (@value / @maximum_value), @thickness * 2)\n\n @d.draw(@base_image)\n end", "title": "" }, { "docid": "4d07a481dfe82d509d733f980d652658", "score": "0.51016337", "text": "def render_data(data)\n # calculate quartiles for plot, use this as data\n @data_quartiles = DATA.collect { |row|\n data = quartiles(row[1])\n OpenStruct.new(\n :name => row[0],\n :q0 => data[0],\n :q1 => data[1],\n :q2 => data[2],\n :q3 => data[3],\n :q4 => data[4],\n :index => 0\n ) \n }\n # NOTE: need index to lay out coloumns horizontally\n @data_quartiles.each_with_index { |d, i|\n d.index = i\n }\n # find limits of data so we know where axes are\n data_min = @data_quartiles.collect { |col| col.q0 }.min()\n data_max = @data_quartiles.collect { |col| col.q4 }.max()\n bounds = bounds([data_min, data_max])\n plot_range = bounds[1] - bounds[0]\n\n \n # make area for plotting\n # left, etc. set padding so actual size is ht/wt + padding\n vis = pv.Panel.new()\n .width(@canvas_wt)\n .height(@canvas_ht)\n .margin(@margin)\n .left(30)\n .bottom(20)\n .top(10)\n .right(10)\n \n # adhoc guess at bar width\n bar_width = @plot_wt / @data_quartiles.size() * 0.8\n \n # scaling to position datapoints in plot\n vert = pv.Scale.linear(bounds[0], bounds[1]).range(0, @plot_ht)\n horiz = pv.Scale.linear(0, @data_quartiles.size()).range(0, @plot_wt)\n\n # where to draw labels on graph\n label_ticks = vert.ticks.each_slice(4).map(&:first)\n\n # make horizontal lines:\n # - what values are drawn\n # - where the bottom of it appears\n # - what color to make the line\n # - the width of the line\n # - antialias it?\n # - add a label\n # - where does label appear relative to line\n # - how is the text aligned in own space\n # - align text vertically (\"top\" looks like \"middle\")\n # - what appears in the label\n vis.add(pv.Rule)\n .data(vert.ticks()) \n .bottom(lambda {|d| vert.scale(d)}) \n .strokeStyle(lambda { |d| label_ticks.member?(d) ? \"black\" : \"lightblue\" })\n .line_width(lambda { |d| label_ticks.member?(d) ? 0.5 : 0.1 })\n .antialias(true)\n .add(pv.Label) \n .left(0) \n .textAlign(\"right\")\n .textBaseline(\"top\")\n .text(lambda {|d| label_ticks.member?(d) ? sprintf(\"%0.2f\", d) : '' }) \n \n # y (vertical) axis\n vis.add(pv.Rule)\n .data([0])\n .left(horiz.scale(0))\n .bottom(@margin)\n .strokeStyle(\"black\")\n \n # make the main body of boxplot\n vis.add(pv.Rule)\n .data(@data_quartiles)\n .left(lambda {|d| horiz.scale(d.index + 0.5) })\n .bottom(lambda {|d| vert.scale(d.q1)})\n .lineWidth(bar_width)\n .height(lambda {|d| vert.scale(d.q3) - vert.scale(d.q1)})\n .strokeStyle(@bar_clr)\n\n # add bottom labels\n vis.add(pv.Label)\n .data(@data_quartiles)\n .left(lambda {|d| horiz.scale(d.index + 0.5) })\n .bottom(0)\n .text_baseline(\"top\")\n .text_margin(15)\n .textAlign(\"center\")\n .text(lambda {|d| d.name })\n\n # make the whisker \n vis.add(pv.Rule)\n .data(@data_quartiles)\n .left(lambda {|d| horiz.scale(d.index + 0.5)})\n .bottom(lambda {|d| vert.scale(d.q0)})\n .lineWidth(1)\n .height(lambda {|d| vert.scale(d.q4) - vert.scale(d.q0)})\n .strokeStyle(@bar_clr)\n\n # make the median line \n vis.add(pv.Rule)\n .data(@data_quartiles)\n .left(lambda {|d| horiz.scale(d.index + 0.5)})\n .bottom(lambda {|d| vert.scale(d.q2)})\n .height(1)\n .lineWidth(bar_width)\n .strokeStyle(\"white\")\n \n vis.render()\n return vis.to_svg()\n end", "title": "" }, { "docid": "f568dbb598b99038254263fec0d50daf", "score": "0.5092755", "text": "def draw\n end", "title": "" }, { "docid": "ae6ac0a2086c8500278820af2eeefb45", "score": "0.50830394", "text": "def render\n draw\n (@shape.size).times {|c| puts @shape[c]}\n end", "title": "" }, { "docid": "1531da269a433dd7e2cc7b34625d68ea", "score": "0.50822717", "text": "def render_graphics(types, concs)\n types.zip(concs) do |type, slices|\n make_gnuplot(type, \"#{type} atom type\", 'time (s)', 'concentration (%)') do |plot|\n # plot.yrange('[0:1]')\n plot.data += slices.map do |n, slice|\n data_set([slice.keys, slice.values])\n end\n end\n end\nend", "title": "" }, { "docid": "2ef0a058f176a918bcdb3946659c180f", "score": "0.50749725", "text": "def draw_item(index)\n item = @data[index]\n rect = item_rect(index)\n enabled = enable?(item)\n draw_item_name(item.item, rect.x, rect.y, enabled)\n draw_item_number(item, rect)\n draw_item_forge_cost(item, rect, enabled)\n end", "title": "" }, { "docid": "dc9365658f4838acf1c13d3e3a74c474", "score": "0.5067904", "text": "def draw()\n @ucCharFace.draw()\n @cCharName.draw()\n @ucCharLvl.draw()\n @cHpStatGauge.draw()\n @ucHpStat.draw()\n @cMpStatGauge.draw()\n @ucMpStat.draw()\n end", "title": "" }, { "docid": "dc9365658f4838acf1c13d3e3a74c474", "score": "0.5067904", "text": "def draw()\n @ucCharFace.draw()\n @cCharName.draw()\n @ucCharLvl.draw()\n @cHpStatGauge.draw()\n @ucHpStat.draw()\n @cMpStatGauge.draw()\n @ucMpStat.draw()\n end", "title": "" }, { "docid": "7cf2c5826c7e33b6f4b98c9bb4312ab2", "score": "0.5067252", "text": "def draw(&proc)\n end", "title": "" }, { "docid": "7cf2c5826c7e33b6f4b98c9bb4312ab2", "score": "0.5067252", "text": "def draw(&proc)\n end", "title": "" }, { "docid": "7cf2c5826c7e33b6f4b98c9bb4312ab2", "score": "0.5067252", "text": "def draw(&proc)\n end", "title": "" }, { "docid": "53e099ea46badb979f40dd540e05e18a", "score": "0.5064709", "text": "def draw()\n @ucIcon.draw()\n @cSkillName.draw()\n @cSkillMpCost.draw()\n end", "title": "" }, { "docid": "e5657678f39b464da60da4c5a4ef1779", "score": "0.5056133", "text": "def chart_data(chart_type)\n Chart::Data.const_get(chart_type).new(data)\n end", "title": "" }, { "docid": "e0f73d65f62f14f6388cec12fd102933", "score": "0.50549304", "text": "def render\n update\n @batch.begin\n case @shape_type\n when :filled\n @shape.begin(com.badlogic.gdx.graphics.glutils.ShapeRenderer::ShapeType::Filled)\n when :point\n @shape.begin(com.badlogic.gdx.graphics.glutils.ShapeRenderer::ShapeType::Point)\n when :line\n @shape.begin(com.badlogic.gdx.graphics.glutils.ShapeRenderer::ShapeType::Line)\n else\n @shape.begin(com.badlogic.gdx.graphics.glutils.ShapeRenderer::ShapeType::Filled)\n end\n display\n @shape.end unless @shape.nil?\n @batch.end\n end", "title": "" }, { "docid": "1b0543f53c5dd5ad88531b824c5b2612", "score": "0.5041839", "text": "def draw_heading(data_type, y)\n set_data_font(:heading)\n clear_and_draw_text(40, y, contents_width - 80, line_height, \n QuestData::VOCAB[data_type], QuestData::HEADING_ALIGN[data_type])\n reset_font_settings\n end", "title": "" }, { "docid": "087a6ff4b5ad47ca30880946d67e5a54", "score": "0.5037814", "text": "def draw_item(index)\r\r\n item = @data[index]\r\r\n rect = item_rect(index)\r\r\n draw_item_name(item, rect.x, rect.y, enable?(item))\r\r\n rect.width -= 4\r\r\n draw_price(rect, item, 2)\r\r\n end", "title": "" }, { "docid": "b79deac3afd7e74d41e4efcf096b5ebc", "score": "0.50371766", "text": "def data_type\n return @data_type\n end", "title": "" }, { "docid": "a6f52e712dd4dab91ab773ddb57080f4", "score": "0.50359756", "text": "def mainWidgetData\n\n\n\t\t\t# Set an empty array\n\t\t\tdata = []\n\t\t\t# Loop through the rawData\n\t\t\[email protected] do |day|\n\t\t\t\t# Set the empty array for each day\n\t\t\t\tdayHash = []\n\t\t\t\tdayHash << [day[:total_prayed], \"total\"]\t# Push in the key value pair [value, \"total\"]\n\t\t\t\tdayHash << [day[:fajr], \"fajr\"]\t\t\t\t# Push in the key value pair [value, \"fajr\"]\n\t\t\t\tdayHash << [day[:zuhr], \"duhr\"]\t\t\t\t# Same as above\n\t\t\t\tdayHash << [day[:asr], \"asr\"]\t\t\t\t# Same as above\n\t\t\t\tdayHash << [day[:maghrib], \"maghrib\"]\t\t# Same as above\n\t\t\t\tdayHash << [day[:isha], \"isha\"]\t\t\t\t# Same as above\n\t\t\t\tdata <<\tdayHash\t\t\t\t\t\t\t\t# Push in the dayHash into the main parent hash\n\t\t\tend\n\t\t\t# Generate a path for the dot chart svg\n\t\t\t# Set the initial value of the path\n\t\t\tpath = \"M10 20 \"\n\t\t\t\n\t\t\tif @timesRequestSent < 16\n\t\t\t\t# Loop through the entire data\n\t\t\t\t(0..(@timesRequestSent-1)).each do |i|\n\t\t\t\t\t# Add path based on the average per day prayer, using the \"total\" value\n\t\t\t\t\tpath += \"L#{30+ 60*i} #{20 - (data[i][0][0]/5.to_f)*20} \"\n\t\t\t\tend\n\t\t\t\tpath += \"L#{60*@timesRequestSent - 10} 20 Z\"\n\t\t\telse\n\t\t\t\tputs \"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\"\n\t\t\t\tdata = data[(@timesRequestSent-15),(@timesRequestSent-1)]\n\t\t\t\tputs data.count\n\t\t\t\t# Loop through the entire data\n\t\t\t\t(0..14).each do |i|\n\t\t\t\t\t# Add path based on the average per day prayer, using the \"total\" value\n\t\t\t\t\tpath += \"L#{30+ 60*i} #{20 - (data[i][0][0]/5.to_f)*20} \"\n\t\t\t\tend\n\t\t\t\tpath += \"L#{60*15 - 10} 20 Z\"\n\t\t\tend\n\t\t\t\n\t\t\t# Return both the path and the day array\n\t\t\t{ data: data, path: path }\n\t\tend", "title": "" }, { "docid": "ade6c291dcb909a19b2a8eab842e1927", "score": "0.5021575", "text": "def draw(type=1,index=1)\n DCL.sgplzv(vx,vy,type,index)\n end", "title": "" }, { "docid": "5eb7883acc600f2760d4cf4d89e5793c", "score": "0.5018043", "text": "def data(type:)\n return nil unless (part = @parts[type.to_s])\n\n File.open(@path) do |file|\n # Seek to the image data position\n file.pos = part[:offset]\n\n # Read the length of the image data\n file.read(part[:length])\n end\n end", "title": "" }, { "docid": "48c489c954c8366d199ab709bb3e214e", "score": "0.5012702", "text": "def draw_item(index)\n item = @data[index]\n if item\n rect = item_rect(index)\n rect.width -= 4\n draw_item_name(item, rect.x, rect.y, enable?(item))\n draw_item_state(rect, item)\n end\n end", "title": "" }, { "docid": "3b2f42768d0b11853b588cb8cb50e5c1", "score": "0.50075233", "text": "def draw_no_data\n @d.fill = @font_color\n @d.font = @font if @font\n @d.stroke('transparent')\n @d.font_weight = NormalWeight\n @d.pointsize = scale_fontsize(80)\n @d.gravity = CenterGravity\n @d = @d.annotate_scaled( @base_image,\n @columns, @rows/2.0,\n 0, 10,\n @no_data_message, @scale)\n end", "title": "" }, { "docid": "49e63f68a83501822c935537350d0398", "score": "0.50073683", "text": "def draw(entity)\n case entity\n when Edge then draw_edge entity\n when Box then draw_box entity\n end\n end", "title": "" }, { "docid": "ef4a031cd2cf523d66afb9994c1b17a0", "score": "0.49994794", "text": "def draw( &blk )\n register\n instance_eval &blk if blk\n self\n end", "title": "" }, { "docid": "f8ed40419be4447d632c999034a02960", "score": "0.4993375", "text": "def draw()\n @ucActStates.draw()\n @cCharImage.draw()\n @cCharName.draw()\n @ucCharLvl.draw()\n @cHpStatGauge.draw()\n @ucHpStat.draw()\n @cMpStatGauge.draw()\n @ucMpStat.draw()\n @cExpGauge.draw()\n @ucExp.draw()\n end", "title": "" }, { "docid": "e3dffa48a8b7498919cb7db31164f383", "score": "0.49925962", "text": "def graph_time_data\r\n g = Gruff::Line.new\r\n g.data :data, @time_data\r\n end", "title": "" }, { "docid": "3608ef9d0ffcfb1a6516b6654db861c5", "score": "0.49925074", "text": "def type\n\t\t\t@data[\"type\"]\n\t\tend", "title": "" }, { "docid": "d9a657f1772d8fa101391ccdb6216711", "score": "0.49915892", "text": "def data_type=(value)\n @data_type = value\n end", "title": "" }, { "docid": "fd766c0619112d790e9456292fb9e298", "score": "0.4989097", "text": "def data\n @data ||= \"O\" * size\n end", "title": "" }, { "docid": "9c25dfcf1927e164a2a2af8339239b30", "score": "0.49723154", "text": "def set_data_font(data_type)\n @maqj_default_font = contents.font.dup unless @maqj_default_font\n contents.font.name = QuestData::FONTNAMES[data_type] ? \n QuestData::FONTNAMES[data_type] : @maqj_default_font.name\n contents.font.size = QuestData::FONTSIZES[data_type] ? \n QuestData::FONTSIZES[data_type] : @maqj_default_font.size\n contents.font.bold = QuestData::FONTBOLDS.keys.include?(data_type) ? \n QuestData::FONTBOLDS[data_type] : @maqj_default_font.bold\n contents.font.italic = QuestData::FONTITALICS.keys.include?(data_type) ?\n QuestData::FONTITALICS[data_type] : @maqj_default_font.italic\n case data_type\n when :objectives then change_color(@maqj_objective_color) if @maqj_objective_color\n when :name then change_color(quest_name_colour(@quest)) if @quest\n else\n change_color(text_color(QuestData::COLOURS[data_type])) if QuestData::COLOURS.keys.include?(data_type)\n end\n end", "title": "" }, { "docid": "0e56dee070a9e686ef76791975cc7ea5", "score": "0.4958524", "text": "def draw()\n @ucStat.draw()\n @ucCompareStat.draw()\n end", "title": "" }, { "docid": "bbe4910abc4e44170ba8e56590e33401", "score": "0.49563578", "text": "def draw\n\tend", "title": "" }, { "docid": "134dc1ba85b94d86008b71c22c93472d", "score": "0.4940753", "text": "def data_blocks\n return @data_blocks unless @data_blocks.nil?\n @data_blocks = data_blocks_with_io.data\n @data_blocks\n end", "title": "" }, { "docid": "9ee7eb23a361b7de1d52c4792f832eb3", "score": "0.49343494", "text": "def reload_data(inputData)\r\n # Initialise the list of items being shown, the coordinates to show\r\n # them at, and what do do if the item is selected.\r\n @items = [ ]\r\n @xy_pos = [ ]\r\n @selected_data = []\r\n # Check the inputData, when it is items\r\n # Read the items input\r\n for data in inputData\r\n # If there is already an item at the XY position\r\n if @xy_pos.include(data[2..3])\r\n # Get the array's index where the item exists\r\n index = @xy_pos.index(data[2..3])\r\n # Delete the alraeady existing item\r\n @items.delete_at(index)\r\n @xy_pos.delete_at(index)\r\n @selected_data.delete_at(index)\r\n end\r\n case data[0]\r\n when item\r\n @items $data_items[eval(data[1]).to_i]\r\n when weapon\r\n @items $data_weapons[eval(data[1]).to_i]\r\n when armor\r\n @items $data_armors[eval(data[1]).to_i]\r\n when sym\r\n @items data[1]\r\n else\r\n raise('Sorry, the item type ' + data[0].to_s + ' is not recognised')\r\n end\r\n # Store the x & y for the items separately (for speed)\r\n @xy_pos data[2..3]\r\n # Store what to do with the item if selected\r\n @selected_data data[4..5]\r\n end\r\n # Add the toggles\r\n @items += [ left_toggle, right_toggle ]\r\n @xy_pos += ToggleCoords\r\n # Draw the data, item name and move the cursor\r\n draw_data\r\n draw_item_name\r\n @cursor.x, @cursor.y = @xy_pos[@index][0], @xy_pos[@index][1]\r\n end", "title": "" }, { "docid": "edee780df827ab258e647b6996b436fd", "score": "0.493329", "text": "def on_paint(dc)\n return unless @started\n dc.set_font(@font)\n first_row = row = get_first_visible_line\n last_row = get_last_visible_line+1\n y = 0\n hX = @hex0\n aX = @asc0\n idx = (row.zero?)? 0 : @columns * row\n\n hex_w = @hex_width + @asc_width\n h_off = @hex_width / 2\n\n # draw blank background\n dc.set_pen(Wx::TRANSPARENT_PEN)\n dc.set_brush(Wx::Brush.new(@bg_color))\n dc.draw_rectangle(0, 0, client_size.width, client_size.height)\n\n paint_row(dc, y, idx, row)\n\n while(c=@data[idx]) and row <= last_row\n if(hX >= @hexN)\n hX = @hex0\n aX = @asc0\n y += @txt_height\n row +=1\n paint_row(dc, y, idx, row)\n end\n\n # call byte colorization block if we have one\n text_color =\n if( @post_paint_proc and\n bret=@post_paint_proc.call(self,dc,idx,c,hX+h_off,aX,y) )\n bret\n else\n @dump_color\n end\n\n # selection stuff goes here\n if @selection and @selection.include?(idx)\n sbrushes = [\n @select_bgs[ @cursor.area ],\n @select_bgs[ (@cursor.area+1) % AREAS.size ]\n ]\n colorize_byte_bg(sbrushes, dc, hX+h_off, aX, y)\n end\n\n dc.set_text_foreground(text_color)\n dc.draw_text(\"#{disp_hex_byte(c)}\", hX+h_off, y)\n dc.draw_text(\"#{disp_ascii_byte(c)}\", aX, y)\n\n hX += hex_w\n aX += @asc_width\n idx += 1\n end\n\n paint_boundaries(dc)\n paint_cursor(dc)\n end", "title": "" }, { "docid": "abf77cef5c690ffb57f21d433b30f1e6", "score": "0.49329636", "text": "def draw_item(index)\n item = @data[index]\n if item\n rect = item_rect(index)\n change_color(normal_color, enable?(index))\n draw_text(rect.x, rect.y, contents_width / col_max, line_height, item)\n end\n end", "title": "" }, { "docid": "a1bc0055892301c8d2e8cf632910708c", "score": "0.4932202", "text": "def d(data)\n data.send :display \n \"\\n\".send :display\nend", "title": "" }, { "docid": "ac418627b31c41351ecb06e0b4ff5a3d", "score": "0.4923612", "text": "def scrolldata\n #==========================================================================\n # First we calculate an X value to help us display the right arrow. After\n # that, we calculate the y value at which the information should be\n # drawn.\n #==========================================================================\n x = text_size(\"#{max_pages}/#{max_pages}\").width + 4\n y = if Graphics.height - height == 0 then height - 28\n else self.y + height - 28 end\n #==========================================================================\n # Here's the meat of the method. You may need to edit the src_rect\n # information for the arrows if you're using a custom windowskin - it's\n # configured to use the base. Note that each of the keys in this hash\n # will become a Sprite object when draw_scroll is called.\n #\n # Each key in the main hash is linked to a second hash. There are 5\n # possible values in that second hash:\n # :x => Easy enough. This is the X coordinate at which the item will be\n # drawn.\n # :y => Also easy - the Y coordinate for drawing.\n # :bitmap => The Sprite's bitmap. For :pagecount, this should be an empty\n # bitmap placed at the x we calculated earlier. Its height should\n # be equivalent to line_height - I simply set it at 24 (the default\n # value for line_height) for visibility.\n # :src_rect => The visible portion of the Sprite's bitmap. You'll need to\n # change this for :rarrow and :larrow if you're using a custom\n # windowskin that has arrows of a different size than those in the\n # default window.\n # :d_rect => :pagecount only. This should be the same as :src_rect. It\n # exists to simplify drawing the page numbers and so that if you\n # overwrite/extend this method with new Sprites you can have the\n # page numbers drawn in the way you want.\n #==========================================================================\n { :pagecount => { :x => sx + 10, :y => y - 7, :bitmap => Bitmap.new(x, 24),\n :src_rect => Rect.new(0,0,x+4,line_height),\n :d_rect => Rect.new(0, 0, x + 4, line_height) },\n :rarrow => { :x => sx + x + 28, :y => y-1, :bitmap => arrow_bitmap(:r),\n :src_rect => Rect.new(104,25,8,14) },\n :larrow => { :x => sx - 12, :y => y-1, :bitmap => arrow_bitmap(:l),\n :src_rect => Rect.new(80,25,8,14) }\n }\n end", "title": "" }, { "docid": "703ea977eb4d62ee7b8295850c0b81cc", "score": "0.49235135", "text": "def draw(&block)\n auto_update(false)\n block.call\n auto_update(true)\n end", "title": "" }, { "docid": "4ad248fd54f435c2c478b1ffec6a008f", "score": "0.49114382", "text": "def draw\n\t\t#\n\t\t# Draw the \"top\" line.\n\t\t#\n\t\tputs \" \" + \"_\" * (@width * 2 - 1)\n\t\n\t\t#\t\n\t\t# Draw each of the rows.\n\t\t#\n\t\[email protected] do |y|\n\t\t\tprint \"|\"\n\t\t\[email protected] do |x|\n\t\t\t\t# render \"bottom\" using \"S\" switch\n\t\t\t\tprint( (@grid[y][x] & @@S != 0) ? \" \" : \"_\" )\n\t\t\t\n\t\t\t\t# render \"side\" using \"E\" switch\t\n\t\t\t\tif @grid[y][x] & @@E != 0\n\t\t\t\t\tprint( ( ( @grid[y][x] | @grid[y][x+1] ) & @@S != 0 ) ? \" \" : \"_\" )\n\t\t\t\telse\n\t\t\t\t\tprint \"|\"\n\t\t\t\tend\n\t\t\tend\n\t\t\tputs\n\t\tend\n\n\t\t# \n\t\t# Output metadata\n\t\t#\n\t\tputs metadata\n\tend", "title": "" } ]
5f5538dd28b3882589ef7d74723738e0
Get common channel information. This method returns a common set of channel data, for use by the access keys. The hash returned by this method contains the following keys: :channel_title A string containing the channel title. :channel_id A string containing the channel identifier. :channel_description A string containing the channel description. :playlists A hash containing the channe's playlists, as described in get_playlists
[ { "docid": "2102dc5c7aa5dfabe22476b4e06b094c", "score": "0.6850354", "text": "def get_channel_info(user_id = nil)\n response = self.get_channel_data(user_id, {\n :part => [ :contentDetails, :snippet ],\n :fields => [ 'items/id',\n 'items/contentDetails/relatedPlaylists',\n 'items/snippet/title',\n 'items/snippet/description',\n 'items/snippet/publishedAt'\n ]\n })\n if response.is_a?(Net::HTTPOK)\n info = {}\n json = ActiveSupport::JSON.decode(response.body)\n items = json['items']\n if items.is_a?(Array)\n first = items[0]\n if first.has_key?('contentDetails')\n info[:playlists] = first['contentDetails']['relatedPlaylists']\n end\n info[:channel_id] = first['id'] if first.has_key?('id')\n snippet = first['snippet']\n info[:channel_title] = snippet['title'] if snippet.has_key?('title')\n if snippet.has_key?('description') && (snippet['description'].length > 0)\n info[:channel_description] = snippet['description']\n end\n info[:channel_published_at] = snippet['publishedAt'] if snippet.has_key?('publishedAt')\n end\n else\n info = nil\n end\n\n info\n end", "title": "" } ]
[ { "docid": "ec61ff8da9a70aacee82b3155a2c3611", "score": "0.6663863", "text": "def get_channels\n data_hash = retrieve_external_data\n channels_hash = data_hash[\"channels\"] \n channels = build_channels channels_hash\n return channels\n end", "title": "" }, { "docid": "ec0fd2d052a8e69d32955eda248e05bd", "score": "0.63264877", "text": "def get_channel_data\n @channel = current_user.channels.find(params[:channel_id]) if params[:channel_id]\n @channel = current_user.channels.find(params[:id]) if @channel.nil? and params[:id]\n @channel.ranking = @channel.set_ranking if @channel.ranking.blank?\n @key = @channel.api_keys.write_keys.first.try(:api_key) || \"\"\n end", "title": "" }, { "docid": "cea88927ce044b7bf0267351a1d6cd1b", "score": "0.6238562", "text": "def channels\n\t\t{\n\t\t\t\"CDUMMYDUMMY1\" => {\n\t\t\t\t\"name\" => \"xyztestxyz\", \"is_member\"=>true\n\t\t\t}\n\t\t}\n\tend", "title": "" }, { "docid": "ff4f20910aafcacfc3cd5cc366344bb3", "score": "0.6232164", "text": "def channel_detail(channelids)\n return [] if channelids.empty?\n\n channels = []\n\n # [\"xxxxxx\"] -> \"xxxxxx\"\n channelids.each do |c|\n action = \"http://music.163.com/api/dj/program/detail?id=#{c.join('')}\"\n begin\n data = http_request('GET', action)\n channel = dig_info(data['program']['mainSong'], 'channels')\n channels.push channel\n rescue => e\n next\n end\n end\n\n channels\n end", "title": "" }, { "docid": "e202bc7418bbc3fe05f793f595c53754", "score": "0.618952", "text": "def channels(key)\n value = @redis.hget(channel_key, key)\n (value ? JSON.parse(value) : []).map { |channel| channel.to_sym }\n end", "title": "" }, { "docid": "8979859a231836a0ad229a9187ae599a", "score": "0.61827445", "text": "def channels\n @cache.fetch 'channels' do\n response = @http.get '/tvtid-app-backend/channels', HTTP_REQUEST_HEADERS\n\n json_data = MultiJson.load response.body\n json_data.map{|json_channel_data| Channel.from_json json_channel_data }\n end\n end", "title": "" }, { "docid": "4cae899228d2c09077b2092782580c8c", "score": "0.61319286", "text": "def get_channel_list()\n # checks if all required parameters are set\n \n\n op = NovacastSDK::Client::Operation.new '/channels', :GET\n\n # path parameters\n path_params = {}\n op.params = path_params\n\n # header parameters\n header_params = {}\n op.headers = header_params\n\n # query parameters\n query_params = {}\n op.query = query_params\n\n # http body (model)\n \n\n \n # authentication requirement\n op.auths = [\n { name: 'accessKey', key: 'access_token', in_query: true }\n ]\n \n\n resp = call_api op\n\n \n NovacastSDK::EventV1::Models::ChannelList.from_json resp.body\n \n end", "title": "" }, { "docid": "7f30ee509d4f2ffaf0c20cccd8128f5a", "score": "0.601219", "text": "def hash\n [channel_id, channel_name, redirect_url, team_id].hash\n end", "title": "" }, { "docid": "6bab0d43c81ecaec2f0dd8d83ae5a697", "score": "0.597738", "text": "def channels\n \t url = URI.parse(\"#{@base_url}#{@api_version}/channels\")\n \t request = Net::HTTP::Get.new(url.request_uri)\n\n \t @headers.each {|k, v| request[k] = v }\n\n \tresponse = Net::HTTP.start(url.hostname, url.port, :use_ssl => url.scheme == 'https') do |http|\n \t\thttp.request(request)\n \t end\t\n\n \t JSON.parse(response.body)[\"channels\"].collect {|channel| CallAction::Channel.new channel }\n end", "title": "" }, { "docid": "43da69e1e100fd359bb4d166b157c4bc", "score": "0.59721965", "text": "def channels\n get \"/api/channels.json\" do |response, error|\n raise ::Pigeon::NuntiumException.new error.message if error\n\n channels = JSON.parse response.body\n channels.map! do |channel|\n read_configuration channel\n with_indifferent_access channel\n end\n channels\n end\n end", "title": "" }, { "docid": "3976ebdaa77131f73b9f69ceab2622dd", "score": "0.5954813", "text": "def channels\n @channels ||= Hash.new {|h,k| h[k] = []} # Default hash empty hash values with an array (instead of nil)\n end", "title": "" }, { "docid": "7b2c6fa2880a0095867b7b435687267a", "score": "0.5942142", "text": "def channels\n @channels ||= {}\n end", "title": "" }, { "docid": "0c74b3cbecc8ffc73fe233a7ef0b427f", "score": "0.5896148", "text": "def channels\n res = @conn.get 'channels.list', token: @api_token\n Array(JSON.parse(res.body)['channels'])\n end", "title": "" }, { "docid": "8f6dddf5892e2004736a0a4af36282dd", "score": "0.5830559", "text": "def get_channels_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: InstallationsApi.get_channels ...'\n end\n # resource path\n local_var_path = '/installations/channels'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'X-Embarcadero-Application-Id'] = opts[:'x_embarcadero_application_id'] if !opts[:'x_embarcadero_application_id'].nil?\n header_params[:'X-Embarcadero-App-Secret'] = opts[:'x_embarcadero_app_secret'] if !opts[:'x_embarcadero_app_secret'].nil?\n header_params[:'X-Embarcadero-Master-Secret'] = opts[:'x_embarcadero_master_secret'] if !opts[:'x_embarcadero_master_secret'].nil?\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<ChannelName>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: InstallationsApi#get_channels\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "203572f948feb4c37525073b188b992a", "score": "0.582256", "text": "def channels_info(params = {})\n fail ArgumentError, \"Required arguments 'channel' missing\" if params['channel'].nil?\n response = @session.do_post \"#{SCOPE}.info\", params\n Slack.parse_response(response)\n end", "title": "" }, { "docid": "7be3c2aff4e1699ea229f2393b7b10a1", "score": "0.58026165", "text": "def channels(player_id)\n synchronize do\n (@channels_cache[player_id] || []).map { |name| @channels[name] }\n end\n end", "title": "" }, { "docid": "36ef2aad6d5716c5c091344d4c5434dc", "score": "0.5777019", "text": "def channels\n JSON.parse(SideJob.redis.hget(\"#{@job.redis_key}:#{type}ports:channels\", @name)) rescue []\n end", "title": "" }, { "docid": "8836d8b13a7bbba5a3b768732deacfa8", "score": "0.57612425", "text": "def channels\n Marvin::IRC::Server::ChannelStore.values\n end", "title": "" }, { "docid": "6bba1f83724b0357c4971ca2a68ac983", "score": "0.57469356", "text": "def get_channels(&block)\n response = @client.call(:get_channels, {}, &block)\n\n channels = response.to_hash[:get_channels_response][:channel]\n channels = [channels].compact unless channels.is_a?(Array)\n channels.map do |hash|\n IsbmAdaptor::Channel.from_hash(hash)\n end\n end", "title": "" }, { "docid": "4def12ed02210143525615befba37e28", "score": "0.57445544", "text": "def channels\n @data[:channels]\n end", "title": "" }, { "docid": "7c085e5ccffe087faea543d5120130a4", "score": "0.57231504", "text": "def channel_by_id channel_id\n @channels.find{ |channel| channel.id == channel_id }\n end", "title": "" }, { "docid": "d89919e941cf0df057766ad926d269db", "score": "0.568317", "text": "def channel\n DiscourseChatIntegration::Channel.find_by(id: channel_id)\n end", "title": "" }, { "docid": "afa997a2561366c22e6b5a499c4ef287", "score": "0.56757253", "text": "def channels(options = [], cache: true)\n return @channels if cache && [email protected]?\n channels = @slack.channels_list\n @channels = begin\n channels[\"channels\"].map do |channel|\n add_params = options.empty? ? {} : options_to_hash(options, channel)\n { id: channel[\"id\"], name: channel[\"name\"] }.merge(add_params)\n end.sort_by {|ch| ch[:name] }\n end\n end", "title": "" }, { "docid": "de35a7d737a1c3f29c01889c7cd3e284", "score": "0.56708944", "text": "def channels\n return @channels.values\n end", "title": "" }, { "docid": "f9231c5cff0e79b018f6c7d5eb05f286", "score": "0.5661441", "text": "def get_channel(channel_id)\n get(\"channels/#{channel_id}\")\n end", "title": "" }, { "docid": "4c9460a5b41b00e79cd8da5394933599", "score": "0.5641668", "text": "def channel_id\n api.channel_id\n end", "title": "" }, { "docid": "3dbb5011ee470b054e6292942462d907", "score": "0.56131536", "text": "def channel_names\n Marvin::IRC::Server::ChannelStore.keys\n end", "title": "" }, { "docid": "1db2944b0e36e1ff3e2d4da3d42956ae", "score": "0.56102777", "text": "def get_well_channels # (poor channels. get well soon!)\n well_channels = {}\n wells.each do |well|\n next if well.channel.blank?\n well_channels[well.name] = well.channel\n end\n well_channels\n end", "title": "" }, { "docid": "1db2944b0e36e1ff3e2d4da3d42956ae", "score": "0.56102777", "text": "def get_well_channels # (poor channels. get well soon!)\n well_channels = {}\n wells.each do |well|\n next if well.channel.blank?\n well_channels[well.name] = well.channel\n end\n well_channels\n end", "title": "" }, { "docid": "f48ccc6bcbad2f85ba4f1846c4060a1b", "score": "0.5609216", "text": "def get_notifications_channels_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: NotificationsApi.get_notifications_channels ...\"\n end\n \n \n \n \n if opts[:'includechannels'] && !['token', 'oauthclient'].include?(opts[:'includechannels'])\n fail ArgumentError, 'invalid value for \"includechannels\", must be one of token, oauthclient'\n end\n \n \n \n \n # resource path\n local_var_path = \"/api/v2/notifications/channels\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'includechannels'] = opts[:'includechannels'] if opts[:'includechannels']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ChannelEntityListing')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: NotificationsApi#get_notifications_channels\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "f78a5232e51f2e2e0b96a34eedbfa55f", "score": "0.55294186", "text": "def channel_keys\n %w[ hipchat_room room channel ]\n end", "title": "" }, { "docid": "9a58ab70b7f5a40c0a0389d283e37737", "score": "0.5524433", "text": "def channels_get(opts = {})\n data, _status_code, _headers = channels_get_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "f4b19aec5d476deaa85ff1522ae8f8ed", "score": "0.5524097", "text": "def parsed_channels\n channels.inject(Hash.new([])) do |servers, url|\n begin\n uri = Addressable::URI.heuristic_parse(url, :scheme => 'irc')\n ssl = uri.scheme == 'irc' ? nil : :ssl\n servers[[uri.host, uri.port, ssl]] += [URI.decode(uri.fragment)]\n servers\n rescue\n {}\n end\n end\n end", "title": "" }, { "docid": "46005430bc2619bbd04c09450e8089cf", "score": "0.55210465", "text": "def get_channels(opts = {})\n data, _status_code, _headers = get_channels_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "59eff8fde48ec813ec832109a6164698", "score": "0.55027735", "text": "def channels_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AccountAndInfoApi.channels_get ...'\n end\n # resource path\n local_var_path = '/channels'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'ChannelResponse' \n\n # auth_names\n auth_names = opts[:auth_names] || ['auth']\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: AccountAndInfoApi#channels_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "df5b317cc932fac75c0670d9385f3d07", "score": "0.5493412", "text": "def channels\n get('/api/v1/channels').map do |channel|\n Channel.new(self, channel)\n end\n end", "title": "" }, { "docid": "a691d91647c4197143659be136e7c1da", "score": "0.54893494", "text": "def list_channels(username)\n @youtube.list_channels('contentDetails', max_results: 1, for_username: username)\n end", "title": "" }, { "docid": "138d0d4563458124610cc818adfdfbd9", "score": "0.5478652", "text": "def list_all_channels\n channels = @client.call('channel.listAllChannels', @key)\n channels.each { |ch| puts ch['label'] }\nend", "title": "" }, { "docid": "8c3264cdb4f5c72b5e01787b60a09c54", "score": "0.5475485", "text": "def list\n session[:channels] += [\"activity_#{current_user.company_id}\", \"tasks_#{current_user.company_id}\"]\n end", "title": "" }, { "docid": "35af54ea71b7a7e45046753cb4d620e7", "score": "0.5474915", "text": "def channels\n @channels\n end", "title": "" }, { "docid": "35af54ea71b7a7e45046753cb4d620e7", "score": "0.5474915", "text": "def channels\n @channels\n end", "title": "" }, { "docid": "6f74957a7d2b4f71cc9df50690768624", "score": "0.5473177", "text": "def hash\n @channel.hash\n end", "title": "" }, { "docid": "276cb5239c820b0aa8b9112f4909cd2e", "score": "0.54725766", "text": "def get_channels\n self.parser.available_channels.each do |channel|\n self.data_source.channels << channel\n end\n end", "title": "" }, { "docid": "e8dd346a3bdaca1c43cb38e1ffe3f9eb", "score": "0.54680496", "text": "def channel channel_id\n perform_get_with_object(\"/channels/#{channel_id}\", {}, Vimeo::Entities::Channel)\n end", "title": "" }, { "docid": "37636887e3cf0e0920c4333d768c1249", "score": "0.545363", "text": "def channels_info(options={})\n throw ArgumentError.new(\"Required arguments :channel missing\") if options[:channel].nil?\n post(\"channels.info\", options)\n end", "title": "" }, { "docid": "f59c4835013fda796b93463d1437af98", "score": "0.5448449", "text": "def get_channels\n response = @http.get(\"session/scenario/channels\")\n msg response, Logger::DEBUG\n return response\n end", "title": "" }, { "docid": "3f87dc2a748c09fcbb1a5a4a4b0b0363", "score": "0.54422945", "text": "def channels\n return @channels\n end", "title": "" }, { "docid": "3f87dc2a748c09fcbb1a5a4a4b0b0363", "score": "0.54422945", "text": "def channels\n return @channels\n end", "title": "" }, { "docid": "9be0e79cf2700c2fe1a41c283c2599f3", "score": "0.5432779", "text": "def channels\n return @format.channels\n end", "title": "" }, { "docid": "f5fea5aec30d70c1aa0dedf60e62b30c", "score": "0.54326504", "text": "def joined_channels\n return @joined_channels.values\n end", "title": "" }, { "docid": "f6823a657037d7f93a632cb104510f84", "score": "0.5431743", "text": "def channels\n @header.channels\n end", "title": "" }, { "docid": "576a3671bf3c02de65999647f62d10c9", "score": "0.5424915", "text": "def channels\n @format.channels\n end", "title": "" }, { "docid": "6055c7b13726a6a307112353870f64a0", "score": "0.541685", "text": "def all_channels\n return @all_channels\n end", "title": "" }, { "docid": "54555f0ee92bb25fe0ad344d287b70aa", "score": "0.54050994", "text": "def channels\n client.channels\n end", "title": "" }, { "docid": "63cb05db314e4a0375e0566190c33375", "score": "0.5404653", "text": "def available_channels\n channels = []\n # Check possible channel id numbers\n (1..max_channel_id).each do |id|\n c = channel(id)\n \n if c != \"\" && c != nil\n channels << c \n @logger.debug \"Got channel id #{c.data_source_channel_id} with name #{c.name}\"\n end\n end\n channels\n end", "title": "" }, { "docid": "5c859f98b8b99456ac767b8e0a6cd9fd", "score": "0.539977", "text": "def channels options = {}\n perform_get_with_object(\"/users/#{get_id}/channels\", options, Vimeo::Entities::Group)\n end", "title": "" }, { "docid": "6fdf3adbad5e70f3b0e123a73858c05a", "score": "0.5390586", "text": "def show\n\t\t@client = Twilio::REST::Client.new(ENV['account_sid'], ENV['auth_token'])\n\t\t# Retrieve a particular channel\n\t\tmy_channel_sid = params[:id]\n\t\tservice = @client.chat.v2.services(ENV['service_sid'])\n\t\tchannel = service.channels(my_channel_sid).fetch\n\t\tputs \"Channel #{channel.sid} has Unique Name \\\"#{channel.unique_name}\\\"\"\n\t\tchannel_response = \"{\\n\\\"sid\\\": \\\"#{channel.sid}\\\",\\n\\\"unique_name\\\": \\\"#{channel.unique_name}\\\"\\n}\"\n\t\tjson_response(channel_response)\n\tend", "title": "" }, { "docid": "809cf60db9222d9000accb0616d7281b", "score": "0.5384981", "text": "def fetch_channel(\n provider, # Provider\n token, # String, one of a channel call sign, number, or id\n date = Time.now.getutc, # Time, but will be truncated to its date component\n time_span_hours = 6, # 1 | 2 | 3 | 4 | 5 | 6\n cache: Cache.new # Cache\n) # Channel | nil\n LOG.info do\n \"Fetching single channel for token #{token} from provider #{provider} (time span: #{time_span_hours}h, date: #{date})\"\n end\n\n channels = fetch_channels(\n provider,\n date,\n time_span_hours,\n cache: cache\n )\n\n channels.find do |channel|\n (\n channel.call_sign == token ||\n channel.id == token ||\n channel.number == token\n )\n end\nend", "title": "" }, { "docid": "693d2c0e2d9e6877933f2e8ecb9bc620", "score": "0.53842556", "text": "def channel\n @query.channels.get(@name)\n end", "title": "" }, { "docid": "9137139b45ec5745ed58a56a8064c39b", "score": "0.53733474", "text": "def channel_id\n attributes[:channel_id]\n end", "title": "" }, { "docid": "1294d4b0dcd7ced38c0190a57bcf814b", "score": "0.5360806", "text": "def get_channel_catalogs_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ChannelCatalogsGlobalApi.get_channel_catalogs ...\"\n end\n # resource path\n local_var_path = \"/user/channelCatalogs/\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'storeId'] = opts[:'store_id'] if !opts[:'store_id'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['api_key']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ChannelCatalogList')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ChannelCatalogsGlobalApi#get_channel_catalogs\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "90f759826dc917995ec139d6af1ae265", "score": "0.535807", "text": "def cmd_get_channels argv\n setup argv\n response = @api.get_channels\n msg response\n return response\n end", "title": "" }, { "docid": "dade754d03a950c7755a204d6a1e74ab", "score": "0.53579956", "text": "def get_channels\n\n count = 0\n all_channels = ''\n request = Slack.channels_list\n channels_list = request[\"channels\"]\n channels_list.each do |channel| \n count += 1\n if count == channels_list.length\n all_channels += channel[\"id\"]\n else \n all_channels += channel[\"id\"] + ','\n end\n end\n\n return all_channels\n\nend", "title": "" }, { "docid": "2226665f912936a9b548359c934921c5", "score": "0.53532743", "text": "def channels *args\n user_id, subject_id, page, per_page = TibbrResource.extract_params(args, 4)\n subject_id = subject_id.id if subject_id.is_a?(ActiveResource::Base)\n (cache_lookup(user_id, \"channels\", page, per_page) if subject_id.nil?) ||\n TibbrResource.paginate_collection(get(:channels, :params => {:set_actions => true, :page=>page, :per_page=>per_page, :subject_id => subject_id}), Channel)\n end", "title": "" }, { "docid": "5896199b5aaa4fb3308d087e047cfb0d", "score": "0.53529125", "text": "def channel(name)\n get(\"/api/channels/#{name}.json\") do |response, error|\n raise ::Pigeon::NuntiumException.new error.message if error\n\n channel = JSON.parse response.body\n read_configuration channel\n with_indifferent_access channel\n end\n end", "title": "" }, { "docid": "8a5d84c8b779d55b1abb1e818606f4c0", "score": "0.5342961", "text": "def channels\n default_channels.tap do |list|\n\n end.flatten\n end", "title": "" }, { "docid": "001c47fe6f52c256b5209fa160524cc1", "score": "0.5341906", "text": "def channels\n\n @user_seed = current_user.seed\n\n # whats_hot = Slideshow.whats_hot_slideshow\n\n @channels = Slideshow.whats_hot_slideshow.results.order(created_at: :desc).map { |d| {thumb: d.thumb.sub(/https/, 'http'), uuid: d.uuid} }.compact # change .results to .nsfw for mature filter.\n\n # If a slideshow doesn't exist for a given seed, having it show up in the channel changer will produce errors if it's\n # selected as the user's channel. This happens when What's Hot has been updated, but before all the MLT results have been\n # retrieved for deviations new to the What's Hot list. Selecting channels only if the associated slideshow exists\n # prevents this error.\n @channels.select! { |c| Slideshow.exists?(seed: c[:uuid]) }\n\n end", "title": "" }, { "docid": "c8b56fe99bf3e9bd1ee580a6499a0a56", "score": "0.5328928", "text": "def [](channel_name)\n @channels[channel_name.to_sym]\n end", "title": "" }, { "docid": "e30ee020882e074e6bcfb36ea1ae2c08", "score": "0.531937", "text": "def channels\n @channels ||= []\n end", "title": "" }, { "docid": "0d5b3c923fca17ed4085a1a8b2b30216", "score": "0.53174275", "text": "def channel\n attributes[:channel]\n end", "title": "" }, { "docid": "e1f4433ecf195587795606b59bd8e2ca", "score": "0.5315937", "text": "def channels\n if self.data_source.channels.count != 0\n @logger.info \"Already found channels for this data source. If you want to update, run reload_channels\"\n return\n end\n get_channels\n end", "title": "" }, { "docid": "cdf2b837d027ba50b82719cb743921a1", "score": "0.53109616", "text": "def channels(opts={})\n return @channels if @channels && !opts[:json]\n json = get(\"channels\")\n if opts[:json]\n return json\n end\n @channels = convert_channels(json)\n end", "title": "" }, { "docid": "b18fbd7b1f2d34f4c808fe05f880326f", "score": "0.5279002", "text": "def get_channels(bot)\n \tbot.servers.flat_map {|key, server| server.channels.map {|channel| channel.name}}.join(\", \")\n end", "title": "" }, { "docid": "fae2ce43657fd3fbd64a6fcb31c20894", "score": "0.5260228", "text": "def channel\n return '#general' if @channel.nil?\n @channel\n end", "title": "" }, { "docid": "856b5224416b3b5789725fa9c66467db", "score": "0.5259771", "text": "def get_current_channels_with_http_info(store_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: V2UserChannelsApi.get_current_channels ...\"\n end\n # verify the required parameter 'store_id' is set\n fail ArgumentError, \"Missing the required parameter 'store_id' when calling V2UserChannelsApi.get_current_channels\" if store_id.nil?\n # resource path\n local_var_path = \"/v2/user/channels/\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'storeId'] = store_id\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['api_key']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<ChannelHeader>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: V2UserChannelsApi#get_current_channels\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "e1876304d9bea47bf2d0c5f57de3ead2", "score": "0.52421373", "text": "def channels\n if self.respond_to?(:project) and self.project\n self.project.collaborators.map { |collab| 'user_%d' % collab.id }\n else\n []\n end\n end", "title": "" }, { "docid": "398596decaf876a39988a457908eff9f", "score": "0.52418715", "text": "def retrieve_channels(user_id)\n return Channel.find(:all, :conditions => [\"user_id = ?\", user_id])\n end", "title": "" }, { "docid": "183f05d15f8c415683f5af8bc545f2cf", "score": "0.5241795", "text": "def channel_by(chid)\n channel_id = chid =~ /^http/ ? chid : \"http://gdata.youtube.com/feeds/api/channels/#{chid}?v=2\"\n logger.debug \"Submitting request [url=#{channel_id}].\" if logger\n parser = YouTubeG::Parser::ChannelFeedParser.new(channel_id)\n parser.parse\n end", "title": "" }, { "docid": "310c49ae6cdb05185cccf1e7edfd0935", "score": "0.52407163", "text": "def getChannelList\n begin\n channelList = []\n query = \"SELECT * FROM `#{CHANNEL_TABLE}`\"\n \n self.connect unless self.connected? # => connect to the DB server if not connected\n \n sth = @dbh.prepare(query)\n \n sth.execute()\n \n sth.fetch { |row| \n channelList << Hash[\"id\" => row[0], \"name\" => to_utf8(row[1]), \"type\" => row[2]]\n } \n \n \n sth.finish\n \n rescue DBI::DatabaseError => e\n \n puts \"-------getChannelList(#{type})\"\n puts \"An error occurred\"\n puts \"Error code: #{e.err}\"\n puts \"Error message: #{e.errstr}\"\n @dbh.rollback\n rescue Exception => e \n puts \"getchanlist:error!!! -> : #{e.to_s}\"\n \n ensure\n # disconnect from server\n @dbh.disconnect if @connected\n @connected=false\n end\n \n return channelList\n end", "title": "" }, { "docid": "84f7c013fc6d13419e3096c839a252ab", "score": "0.5234425", "text": "def channel(id)\n id = id.resolve_id\n\n raise Discordrb::Errors::NoPermission if @restricted_channels.include? id\n\n debug(\"Obtaining data for channel with id #{id}\")\n return @channels[id] if @channels[id]\n\n begin\n response = API.channel(token, id)\n channel = Channel.new(JSON.parse(response), self)\n @channels[id] = channel\n rescue Discordrb::Errors::NoPermission\n debug \"Tried to get access to restricted channel #{id}, blacklisting it\"\n @restricted_channels << id\n raise\n end\n end", "title": "" }, { "docid": "9b50be1b0db02f7e94735d1d8fb7b099", "score": "0.5232416", "text": "def channels\n @channels ||= Channel.new(self)\n end", "title": "" }, { "docid": "304b5409c3052f2906f054526b2ca79e", "score": "0.522872", "text": "def channel(channel_id)\n # Prepare the link for a given channel\n channel_link = link(:channel_id => channel_id.to_s)\n doc = get_html(channel_link)\n \n channel_name = doc.css(\".com h1\").text unless doc.nil? \n if channel_name == \"\" || channel_name == nil\n return nil\n else\n return Channel.new(:data_source_channel_id => channel_id, :name => channel_name) \n end\n end", "title": "" }, { "docid": "a7db861810d1f85a859c7ff154382383", "score": "0.5217763", "text": "def get_channel_catalogs_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: BeezUPApi.get_channel_catalogs ...\"\n end\n # resource path\n local_var_path = \"/user/channelCatalogs/\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'storeId'] = opts[:'store_id'] if !opts[:'store_id'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['api_key']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ChannelCatalogList')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: BeezUPApi#get_channel_catalogs\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "734cd257c41181f9105cc534861eb6e3", "score": "0.52077454", "text": "def channels options = {}\n perform_get_with_object(\"/me/channels\", options, Vimeo::Entities::Channel)\n end", "title": "" }, { "docid": "c0c846d7b2f123a03d4de4b41aa40e98", "score": "0.5203006", "text": "def get(channel_id, incoming={})\n HttpClient::Preconditions.assert_class('channel_id', channel_id, String)\n opts = HttpClient::Helper.symbolize_keys(incoming)\n query = {\n :id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),\n :key => (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, Array).map { |v| HttpClient::Preconditions.assert_class('key', v, String) }),\n :organization_id => (x = opts.delete(:organization_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('organization_id', x, String)),\n :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),\n :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),\n :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? \"name\" : x), String)\n }.delete_if { |k, v| v.nil? }\n r = @client.request(\"/channel/#{CGI.escape(channel_id)}/organizations\").with_query(query).get\n r.map { |x| ::Io::Flow::V0::Models::ChannelOrganization.new(x) }\n end", "title": "" }, { "docid": "04c15b0698ad71afc7d95164c444286e", "score": "0.5202897", "text": "def channel_name\n read_attribute(:channel_name)\n end", "title": "" }, { "docid": "83c80fda08f29a0fe46adbf0c6c94c6e", "score": "0.51989216", "text": "def channels\n @values[:channels] || Stream::DEFAULT_VALUES[:channels]\n end", "title": "" }, { "docid": "2d611183825ff18e42b2c854732ac398", "score": "0.519053", "text": "def channel(name)\n Marvin::IRC::Server::ChannelStore[name]\n end", "title": "" }, { "docid": "8cbb224db74e495ba170a6a40f5481e3", "score": "0.5189213", "text": "def channels_list ch_arr\n channels = build_channels ch_arr\n return channels\n end", "title": "" }, { "docid": "3e8c4fb6cf3769667da3544599d5939c", "score": "0.5182913", "text": "def channels options = {}\n perform_get_with_object(\"/channels\", options, Vimeo::Entities::Channel)\n end", "title": "" }, { "docid": "f80d2bf1c2d32bd6fcb43f5849d5dc4c", "score": "0.5180766", "text": "def channel_ids_list\n self.channels.collect &:channel_id\n end", "title": "" }, { "docid": "d1b55cb13e317a04c2bc127d809fed5b", "score": "0.5168463", "text": "def channels\n channels = []\n plural_name = self.class.name.underscore.pluralize\n\n # Add collection's channel\n channels << \"/#{plural_name}\"\n\n # Add member's channel\n channels << \"/#{plural_name}/#{to_param}\"\n\n # Find parent names from belongs_to associations\n parents = self.class.reflect_on_all_associations(:belongs_to)\n\n # Add nested channels for each parent\n parents.map(&:name).each do |parent_name|\n # Get parent record from name\n parent = send(parent_name)\n\n # Get parent class's plural underscore name\n parent_plural_name = parent_name.to_s.underscore.pluralize\n\n # Add collection's channel nested under parent's member channel\n channels << \"/#{parent_plural_name}/#{parent.to_param}/#{plural_name}\"\n\n # Add member's channel nested under parent's member channel\n channels << \"/#{parent_plural_name}/#{parent.to_param}/#{plural_name}/#{to_param}\"\n end\n\n channels\n end", "title": "" }, { "docid": "bb9a4d6ac884baaa4a8ac92fe5fdd6e1", "score": "0.5167831", "text": "def get_channel_property(name)\n ret = []\n twitch_url = TwitchGateway.path('users?login=' + name)\n data = call_twitch_url(twitch_url).parse\n # Assume user know what they're doing.\n # exist = data['_total'].positive?\n user = data['users'][0]\n\n ret << user['_id'] << user['display_name'] << user['logo']\n end", "title": "" }, { "docid": "0be3e986e3d3264e9351fbabd31bb392", "score": "0.5166687", "text": "def extract_channel_info(message)\n case message['channel']\n when '/meta/subscribe'\n return :subscribe, message['subscription'], nil\n when '/meta/unsubscribe'\n return :unsubscribe, message['subscription'], nil\n when /^\\/meta\\/.+$/\n return :meta, nil, nil\n else\n return :publish, message['channel'], message['data']['__command']\n end\n end", "title": "" }, { "docid": "c4d0731d36629b8a3ef538abca751504", "score": "0.5165531", "text": "def channels_list_by_username(service, part, **params)\n response = service.list_channels(part, params).to_json\n item = JSON.parse(response).fetch(\"items\")[0]\n\n puts (\"This channel's ID is #{item.fetch(\"id\")}. \" +\n \"Its title is '#{item.fetch(\"snippet\").fetch(\"title\")}', and it has \" +\n \"#{item.fetch(\"statistics\").fetch(\"viewCount\")} views.\")\nend", "title": "" }, { "docid": "687a25ebbf537860ec6b0b07724124ea", "score": "0.5162945", "text": "def get_phone_call_channels_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PickListItemsApi.get_phone_call_channels ...'\n end\n # resource path\n local_var_path = '/api/pick_list_items/phone_call/channels'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['apiKey']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<PickListItem>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PickListItemsApi#get_phone_call_channels\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "8c99f982d63fe04fc7e46bdeb0064227", "score": "0.51531994", "text": "def index\n manager = StreamingManager::ChannelManager.new\n @channels = manager.get_channels\n end", "title": "" }, { "docid": "5380c101c311d4a04f92aef284843b5d", "score": "0.5153146", "text": "def channel_name; end", "title": "" }, { "docid": "e52e1ecfb685f41ffff4e6575e075de5", "score": "0.5150587", "text": "def index\n @chatchannels = Chatchannel.public_channels\n end", "title": "" }, { "docid": "e64780be6ee3eb27ffa74d54f0c56c07", "score": "0.5144719", "text": "def get_guild_channels(guild_id)\n request(Route.new(:GET, '/guilds/%{guild_id}/channels', guild_id: guild_id))\n end", "title": "" } ]
85db0ca632bd4fc60d85db532e22d335
POST /ies POST /ies.json
[ { "docid": "8d2c139239af11219b9353181890e597", "score": "0.0", "text": "def create\n @category = Category.new(category_params)\n\n # myBucket = 'isaprespdf-informacionisapres-repository.s3.amazonaws.com'\n image = params[:category][:img_url].tempfile\n image_name = params[:category][:img_url].original_filename\n image_type = params[:category][:img_url].content_type\n\n # Se asigna la respuesta del helper a una variable.\n @url = uploadImageToS3(image, image_name, image_type)\n\n # Se pregunta si la variable trae datos\n if [email protected]?\n @category.img_url = @url\n end\n\n respond_to do |format|\n if @category.save\n if params[:category][:image].present?\n @img_path = ImagePathCategory.new\n @img_path.category_id = @category.id\n if [email protected]?\n @img_path.url = @url\n end\n @img_path.save\n end\n format.html { redirect_to admin_categories_path, notice: 'Categoría creada con éxito.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "22201f22e629399ac67e583badeab894", "score": "0.58461237", "text": "def post_users_json payload\n\tJSON.parse ( rest_client_request :post, HF_URL, payload ).body\nend", "title": "" }, { "docid": "23764999421105031b1d8b26a9d126b4", "score": "0.5773872", "text": "def create\n @serie = resource_params\n if @serie.save\n render json: @serie\n else\n render json: @serie.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "179e2c4ed0ee7f520c6a89d0a832385d", "score": "0.5733593", "text": "def post_body\n {\n \"item\": {\n \"name\": name\n }\n }.to_json\n end", "title": "" }, { "docid": "30fc5638df58994cbb6de8e68624670f", "score": "0.56863403", "text": "def post_json(data, action)\n response = RestClient.post \"#{@url}/#{action}\", data.merge(@auth).to_json, :content_type => :json, :accept => :json\n response.body\n end", "title": "" }, { "docid": "73ad88d1dd128ecab08019f7a4267521", "score": "0.5682325", "text": "def post_json (action, path_params, payload)\n request.env['RAW_POST_DATA'] = payload.to_json\n post action, json_format(path_params)\n end", "title": "" }, { "docid": "c30d586f01dca89d947a2a9654225742", "score": "0.5666533", "text": "def index\n @snies = Snies.all\n render json: @snies\n end", "title": "" }, { "docid": "63dc7663332383f54a31f8d5f4a6cc37", "score": "0.56414586", "text": "def create\n @company_params = company_params.to_json\n @reponse = HTTParty.post(\"https://rails-api-ipo.herokuapp.com/api/v1/companies.json\",\n :body => @company_params,\n :headers => { 'Content-Type' => 'application/json' } )\n respond_to do |format|\n format.html { redirect_to '/companies/'+(@reponse['id'].to_s), notice: 'Company was successfully created.' }\n end\n end", "title": "" }, { "docid": "88f21e3e362a42ed5c7fcb21f60cbcb3", "score": "0.5635836", "text": "def save_student(body)\n #Set the connection to the endpoint \n connection_post = Faraday.new(url: URL_POST_STUDENT)\n response = connection_post.post do |req|\n req.body = JSON.dump(body)\n end\n \n puts JSON.dump(body)\n puts response.status\n p response.body\n end", "title": "" }, { "docid": "7acdb16652feaf175da3c582691caee5", "score": "0.56103665", "text": "def post_rest(path, json) \n run_request(:POST, create_url(path), json) \n end", "title": "" }, { "docid": "52bb89bf5ef88dc06ce7ccb1c848d83d", "score": "0.5552053", "text": "def test_should_create_city\n assert_difference('City.count') do\n post :create, parse_body('{\"properties\": {\"name\": \"New City\", \"gid\": 123}}')\n end\n json = ActiveSupport::JSON.decode(@response.body)\n assert_equal 'New City', json['properties']['name']\n end", "title": "" }, { "docid": "92008bad042579793da1bda239d95223", "score": "0.55328494", "text": "def create\n api.post('', nil, 'application/json')\n end", "title": "" }, { "docid": "15504d217eb372847f7231cf132095a7", "score": "0.5525339", "text": "def index\n render json: @bowties\n end", "title": "" }, { "docid": "952dbdda660421a8408a8df37a7d860c", "score": "0.5510674", "text": "def create\n \n \tputs params.inspect\n \n\t\turi = URI.parse(Counter::Application.config.simplyurl)\n\t\thttp = Net::HTTP.new(uri.host, uri.port)\n\t\t\n\t\trequest = Net::HTTP::Post.new('/days.json')\n\t\t\n\t\t# ok, this join stuff is bogus - it encodes properly, but the other side only sees the last element and loses the array type - it's just string\n\t\t# this way, i 'split' it at the other side to recover my array\n\t\t# it should work without the join/split crap, but it doesn't\n#\t\trequest.set_form_data({:custids => ( params['custids'] || []).join(','), :acctids => ( params['acctids'] || []).join(','), :itemids => ( params['itemids'] || []).join(','), :amount => params['amount'], :type => params['type']})\n#\t\trequest.set_form_data(ActiveSupport::JSON.encode(params))\n#\t\trequest.set_form_data({:day => params['day']})\n\t\treq = ActiveSupport::JSON.encode(params);\n\t\tputs req\n\t\trequest.set_form_data(params)\n\t\t\n\t\tputs request.body\n\t\t\n\t\tresponse = http.request(request)\n\t\tputs response.body\n\n respond_to do |format|\n format.html { render :text => response.code == :ok ? \"\" : response.body, status: response.code }\n format.json { render :text => response.code == :ok ? \"\" : response.body, status: response.code }\n end\n \n=begin\n @day = Day.new(params[:day])\n\n respond_to do |format|\n if @day.save\n format.html { redirect_to @day, notice: 'Day was successfully created.' }\n format.json { render json: @day, status: :created, location: @day }\n else\n format.html { render action: \"new\" }\n format.json { render json: @day.errors, status: :unprocessable_entity }\n end\n end\n=end\n end", "title": "" }, { "docid": "b08e25ef37c01fdb7cd6d8b52916d826", "score": "0.55102134", "text": "def post(path, body, options = {})\n options[:body] = body\n json_request('POST', path, options)\n end", "title": "" }, { "docid": "658751e62138cca8e2a94212c458dc43", "score": "0.55087245", "text": "def post_json(path, body)\n uri = build_uri(path)\n puts \"*** POST #{path}\"\n puts JSON.pretty_generate(body)\n\n post_request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')\n post_request.body = JSON.generate(body)\n\n response = Net::HTTP.start(uri.hostname, uri.port, :use_ssl => true) do |http|\n http.request(post_request)\n end\n\n puts \"HTTP #{response.code}\"\n result = JSON.parse(response.body)\n puts JSON.pretty_generate(result)\n result\nend", "title": "" }, { "docid": "658751e62138cca8e2a94212c458dc43", "score": "0.55087245", "text": "def post_json(path, body)\n uri = build_uri(path)\n puts \"*** POST #{path}\"\n puts JSON.pretty_generate(body)\n\n post_request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')\n post_request.body = JSON.generate(body)\n\n response = Net::HTTP.start(uri.hostname, uri.port, :use_ssl => true) do |http|\n http.request(post_request)\n end\n\n puts \"HTTP #{response.code}\"\n result = JSON.parse(response.body)\n puts JSON.pretty_generate(result)\n result\nend", "title": "" }, { "docid": "d29e3f961726a8ec00807a1e2f728cd6", "score": "0.5496327", "text": "def post_json(path, data = {})\n client(path).post_json(path, data)\n end", "title": "" }, { "docid": "fd5469d0152ed1d73b3cd59fb8b12a07", "score": "0.54726225", "text": "def post *args\n make_request :post, *args\n end", "title": "" }, { "docid": "1bd6e51edb9af2e12ce2d639dd44c1ca", "score": "0.5471655", "text": "def create\n @selfy = Selfie.new(selfy_params)\n\n respond_to do |format|\n if @selfy.save\n format.html { redirect_to @selfy, notice: 'Selfie was successfully created.' }\n format.json { render :show, status: :created, location: @selfy }\n else\n format.html { render :new }\n format.json { render json: @selfy.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2aecd63a3df518b5d3bc1f983a26b1b9", "score": "0.54661405", "text": "def create(json, e) \n jstring = json \n unless json.is_a? String\n jstring = JSON.generate json\n end\n response = @http.post_json(e, jstring)\n msg response, Logger::DEBUG\n return response\n end", "title": "" }, { "docid": "13d5a7ffc44e4814e5fc1680243a8184", "score": "0.5463733", "text": "def create\n j = JSON.parse(request.raw_post)\n\n\n @grade = Grade.new\n @grade[:subject_id] = j['subject_id']\n @grade[:student_id] = j['student_id']\n @grade[:mark] = j['mark']\n @grade[:exam_date] = j['exam_date']\n @grade.save\n\n\n render :json => @grade , :status => 201\n end", "title": "" }, { "docid": "0ad29b2a7e498531ca3ffb98cb7574f8", "score": "0.54620844", "text": "def create\n @species = Species.new(species_params)\n\n if @species.save\n render json: @species, status: :created, location: @species\n else\n render json: @species.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "f964c15ef270d6dd4e1856e75e36c5b3", "score": "0.5452121", "text": "def create\n toy = dog.toys.create!(toy_params)\n json_response(toy, :created)\n end", "title": "" }, { "docid": "9bad5e09e567c69b754b4d0e03c103f1", "score": "0.5448163", "text": "def post_rest(path, json, headers={})\n run_request(:POST, create_url(path), headers, json) \n end", "title": "" }, { "docid": "ad8cb72cbe9ffb7ef434662a2e7d28fe", "score": "0.5439817", "text": "def post_json(path, body)\n uri = build_uri(path)\n # puts \"🤖 POST #{path}\"\n # puts JSON.pretty_generate(body)\n\n post_request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')\n post_request.body = JSON.generate(body)\n\n response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n http.request(post_request)\n end\n\n # puts \"HTTP #{response.code}\"\n result = JSON.parse(response.body)\n # puts result[:result]\n result\nend", "title": "" }, { "docid": "f6949b46ee31a36f69551d92cd9ddee9", "score": "0.5438016", "text": "def create\n @eigyosyo = Eigyosyo.new(eigyosyo_params)\n\n respond_to do |format|\n if @eigyosyo.save\n format.html { redirect_to @eigyosyo, notice: 'Eigyosyo was successfully created.' }\n format.json { render :show, status: :created, location: @eigyosyo }\n else\n format.html { render :new }\n format.json { render json: @eigyosyo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e9d0913ae7a631948940122a0936d32e", "score": "0.54345", "text": "def create\n\n request = RestClient.post File.join(API_SERVER,\"rest-api/departments\"), { \n 'name' => params['department']['name'], \n 'description' => params['department']['description'] }.to_json, :content_type => :json, :accept => :json\n redirect_to :action => :index\n end", "title": "" }, { "docid": "1dafdf6e01a657b61378c39287ce3c38", "score": "0.5432078", "text": "def post(path, json, headers = {})\n request(:POST, path, headers, json)\n end", "title": "" }, { "docid": "c1cfd20aec061bfef28813a08608f22f", "score": "0.5431692", "text": "def create\n itinerary = current_user.itineraries.create!(itinerary_params)\n itinerary_id = current_user.itineraries.last\n \n events = params[:events]\n events.each do |event|\n itinerary_id = current_user.itineraries.last[:id]\n EventsItinerary.create(itinerary_id: itinerary_id, event_id: event[\"id\"])\n end\n render json: itinerary, status: 201 # , location: [:api, itineraries]\n end", "title": "" }, { "docid": "2667e5d1f96994e85df22a0a8ef34478", "score": "0.5422142", "text": "def api_json_post(uri, data)\n json = Oj.dump(data)\n api_raw_post(uri, json, 'application/json')\n end", "title": "" }, { "docid": "c7d0c0a7e9b2fc1e7bd2c278570572c0", "score": "0.54168665", "text": "def create_doi(request_body_json)\n response = connect.post(\"/dois\") do |req|\n req.headers['Content-Type'] = 'application/vnd.api+json'\n req.body = request_body_json\n end\n logger.debug(\"API response body: #{response.body}\")\n response\n end", "title": "" }, { "docid": "11c90008c92c724ff8ee4e3beb90368a", "score": "0.54113746", "text": "def post(path, body, options = {})\r\n options[:body] = body\r\n json_request('POST', path, options)\r\n end", "title": "" }, { "docid": "1cafa8f69c2ee4fee5c6f2b4cee90f5d", "score": "0.54067445", "text": "def post_body\n {\n \"list\": {\n \"name\": name\n }\n }.to_json\n end", "title": "" }, { "docid": "1915955e58acddf2a713f6f0643b8354", "score": "0.5399681", "text": "def create\n @n_code = NCode.new(n_code_params)\n article = FederalRegister::Article.search(:conditions => {:term => @n_code.term})\n results = article.results\n toys = Array.new\n results.each do |result|\n toy = Toy.new\n toy.document_number = result.document_number\n toy.html_url = result.html_url\n toy.type = result.type\n toy.title = result.title\n toy.save\n\n toys << toy\n end\n\n render json: toys, status: 201\n end", "title": "" }, { "docid": "d3fc23223778498b65e6d9d6bef3f439", "score": "0.53923005", "text": "def create\n @article = Article.new(article_params)\n\n respond_to do |format|\n if @article.save\n @url = \"http://localhost:3000\"\n @uri = URI.parse @url\n http = Net::HTTP.new(@uri.host, @uri.port)\n req = Net::HTTP::Post.new(\"/articles\")\n req[\"Content-Type\"] = \"application/json\"\n # test_data = {'dd' => \"this is test data from mysearchapp\"}\n req.body= @article.to_json\n response=http.start do |h|\n h.request req\n end \n binding.pry\n format.html { redirect_to @article, notice: 'Article was successfully created.' }\n format.json { render action: 'show', status: :created, location: @article }\n else\n format.html { render action: 'new' }\n format.json { render json: @article.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "96ab436b868227cc8a025729b0909015", "score": "0.5389177", "text": "def create\n @foody = Foodie.new(foody_params)\n\n respond_to do |format|\n if @foody.save\n format.html { redirect_to @foody, notice: 'Foodie was successfully created.' }\n format.json { render :show, status: :created, location: @foody }\n else\n format.html { render :new }\n format.json { render json: @foody.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "58f0f4c776bd125eddbd82ac1fcba763", "score": "0.5383913", "text": "def save\n # post to API\n url = 'https://petapi-1.herokuapp.com/addPet'\n response = RestClient.post( url, { name: params[:name], type: params[:type], breed: params[:breed], location: params[:location], latitude: params[:latitude], longitude: params[:longitude] })\n\n # if we get an ok response, redirect to main list page\n if response.code <= 200\n # redirect to main page\n redirect_to '/'\n end\n end", "title": "" }, { "docid": "974cfe84b78571763c4fdfd76af4fc24", "score": "0.53784466", "text": "def post_json(expected_statuses, timeout, path_components, entity, headers={})\n response = post(\n expected_statuses,\n timeout,\n path_components,\n Yajl::Encoder.encode(entity),\n headers.merge(\"Content-Type\" => \"application/json\")\n )\n create_json_response(response)\n end", "title": "" }, { "docid": "2befafcc6f076a73b42fca9ccbe2e9dc", "score": "0.53771335", "text": "def create\n require 'net/http'\n require 'json'\n\n student = Student.new(student_params)\n\n uri = URI('http://localhost:3000/students.json')\n\n request = Net::HTTP::Post.new uri, { 'Content-Type' => 'application/json' }\n # Appending the data to the request.\n request.body = student.to_json\n\n # Hitting the endpoint.\n response = Net::HTTP.start uri.hostname, uri.port do |http|\n http.request request\n end\n\n # If successful.\n if response.code == '200'\n redirect_to students_path, notice: 'Student was successfully created.'\n else\n render :new\n end\n end", "title": "" }, { "docid": "87940b1d4cf571571c233b056a19c1a3", "score": "0.5373738", "text": "def create\n @subsidy = current_ou.subsidies.new(subsidy_params)\n\n respond_to do |format|\n if @subsidy.save\n format.html { redirect_to subsidies_path, notice: 'Subsidy was successfully created.' }\n format.json { render :show, status: :created, location: @subsidy }\n else\n format.html { render :new }\n format.json { render json: @subsidy.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "484ab5cf9c3a31130136ff2f02ee9dbf", "score": "0.5373189", "text": "def post_json(path, body)\n uri = build_uri(path)\n puts \"*** POST #{path}\"\n puts JSON.pretty_generate(body)\n\n post_request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')\n post_request.body = JSON.generate(body)\n\n response = Net::HTTP.start(uri.hostname, uri.port, :use_ssl => true) do |http|\n http.request(post_request)\n end\n\n puts \"HTTP #{response.code}\"\n result = JSON.parse(response.body)\n puts result[:result]\n result\nend", "title": "" }, { "docid": "484ab5cf9c3a31130136ff2f02ee9dbf", "score": "0.5373189", "text": "def post_json(path, body)\n uri = build_uri(path)\n puts \"*** POST #{path}\"\n puts JSON.pretty_generate(body)\n\n post_request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')\n post_request.body = JSON.generate(body)\n\n response = Net::HTTP.start(uri.hostname, uri.port, :use_ssl => true) do |http|\n http.request(post_request)\n end\n\n puts \"HTTP #{response.code}\"\n result = JSON.parse(response.body)\n puts result[:result]\n result\nend", "title": "" }, { "docid": "9fda2c661735d7925dfbe7dd22c47757", "score": "0.5372296", "text": "def post_json(uri, payload='{}')\n post(uri, payload, { \"CONTENT_TYPE\" => \"application/json\" })\n end", "title": "" }, { "docid": "31cbf80ef614bf89e74ca0f0a3fe4a2e", "score": "0.5367701", "text": "def post_json(path, body)\n uri = build_uri(path)\n puts \"*** POST #{uri}\"\n puts JSON.pretty_generate(body)\n\n post_request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')\n post_request.body = JSON.generate(body)\n\n response = Net::HTTP.start(uri.hostname, uri.port, :use_ssl => true) do |http|\n http.request(post_request)\n end\n\n puts \"HTTP #{response.code}\"\n result = JSON.parse(response.body)\n puts result[:result]\n result\nend", "title": "" }, { "docid": "efc002074337c73f5c0c8dce12744571", "score": "0.535801", "text": "def test_post_user\n json_data = '{\"id\" : 7, \"user\": {\"name\":\"juan\", \"last_name\":\"test\", \"document\" : \"123\"}}'\n post '/users', json_data\n assert_equal 201, last_response.status, 'Código de respuesta incorrecto'\n assert_equal '/users/7', last_response.headers['Location'], 'El valor del header Location es incorrecto'\n end", "title": "" }, { "docid": "a96521bd5a6b71570f3f22541c03e942", "score": "0.5352941", "text": "def create\n @jewelry = Jewelry.new(jewelry_params)\n\n respond_to do |format|\n if @jewelry.save\n format.html { redirect_to jewelries_path, notice: 'Jewelry was successfully created.' }\n format.json { render :show, status: :created, location: @jewelry }\n else\n format.html { render :new }\n format.json { render json: @jewelry.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "94bdbaba496ee9f9b5b2b03fce45fcf5", "score": "0.5349969", "text": "def post(path, json, headers = {}, options = {})\n request(:POST, path, headers, options, json)\n end", "title": "" }, { "docid": "6c0eea957a850ab456d7cc05be2b8afa", "score": "0.53461933", "text": "def create\n params_trinkets = params[:jewelry].delete(:trinkets)\n @jewelry = Jewelry.create(params[:jewelry]) do |jewelry|\n hydrate_children!(jewelry, params_trinkets, :trinkets, Trinket)\n end\n\n respond_with @jewelry\n end", "title": "" }, { "docid": "064085d2a40ba673eef65ac4f0eb3707", "score": "0.53177077", "text": "def create\n @obroty = Obroty.new(obroty_params)\n\n respond_to do |format|\n if @obroty.save\n format.html { redirect_to @obroty, notice: 'Obroty was successfully created.' }\n format.json { render :show, status: :created, location: @obroty }\n else\n format.html { render :new }\n format.json { render json: @obroty.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0f314ce78187671e2e13033f06608f43", "score": "0.53094894", "text": "def create\n @jinete = Jinete.new(jinete_params)\n\n respond_to do |format|\n if @jinete.save\n format.html { redirect_to @jinete, notice: 'Jinete was successfully created.' }\n format.json { render :show, status: :created, location: @jinete }\n else\n format.html { render :new }\n format.json { render json: @jinete.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6795eb711f0a79b5855a571e3c670389", "score": "0.5307605", "text": "def show\n render json: @snies\n end", "title": "" }, { "docid": "65c44e4e409b5da3a021f0a1731a1191", "score": "0.52873635", "text": "def create\n @amnesty = Amnesty.new(params[:amnesty])\n\n respond_to do |format|\n if @amnesty.save\n format.html { redirect_to @amnesty, notice: 'Amnesty was successfully created.' }\n format.json { render json: @amnesty, status: :created, location: @amnesty }\n else\n format.html { render action: \"new\" }\n format.json { render json: @amnesty.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7c423ce31956a9357c618b574d50b91d", "score": "0.52827305", "text": "def create\n beer = Beer.create(beer_params)\n render json: beer\n end", "title": "" }, { "docid": "6fa47f0558c64a625d3b22e0ec748983", "score": "0.528266", "text": "def update\n @serie = resource_params\n if @serie.save\n render json: @serie\n else\n render json: @serie.errors, status: :unprocessable_entity \n end\n end", "title": "" }, { "docid": "0711dbcd712092a39a31105736dc23b8", "score": "0.5281451", "text": "def create_allele(a)\n allele_data = request(\n :url => \"alleles.json\",\n :method => \"post\",\n :payload => { :allele => a }.to_json\n )\n allele = JSON.parse(allele_data)[\"allele\"]\n return allele\nend", "title": "" }, { "docid": "f7d2a113f1f55bece4a725ac2ddd25e5", "score": "0.5280132", "text": "def post_json(location, json_data)\n response = RestClient::Request.new(\n :method => :post,\n :url => location,\n :user => $username,\n :password => $password,\n :headers => { :accept => :json,\n :content_type => :json},\n :payload => json_data\n ).execute\n JSON.parse(response.to_str)\nend", "title": "" }, { "docid": "04ac50941ce75edf12180eab5c00c007", "score": "0.52684516", "text": "def post(path, params: {}, headers: {})\n request_json :post, path, params, headers\n end", "title": "" }, { "docid": "bdf990c9e5151684c021160aa92228c2", "score": "0.5265832", "text": "def create\n @soda = Soda.new(soda_params)\n\n if @soda.save\n render json: @soda, status: :created, location: @soda\n else\n render json: @soda.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "2f2100c3bac9d72584d350d26a747f36", "score": "0.52644145", "text": "def create\n spice = Spice.create(spice_params)\n render json: spice, status: :created\nend", "title": "" }, { "docid": "4c686b6f127adcc4fd3309a70e170f80", "score": "0.5260975", "text": "def make_post(url, json)\n # RestClient.post url, json, headers\n RestClient::Request.execute method: :post, url: url,payload: URI.encode_www_form(json), headers: HEADERS, cookies: cookies\n end", "title": "" }, { "docid": "c72a03a4189044dbbd12dc323b9339dd", "score": "0.52535635", "text": "def create\n @universidade = Universidade.new(universidade_params)\n respond_to do |format|\n if @universidade.save\n format.html { redirect_to @universidade, notice: 'IES cadastrada com sucesso!' }\n format.json { render :show, status: :created, location: @universidade }\n else\n format.html { render :new }\n format.json { render json: @universidade.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f10d783a085f71b688b91a0339125abf", "score": "0.5253368", "text": "def post(path, data)\n request(:post, path, JSON.dump(data))\n end", "title": "" }, { "docid": "6376ae4509ea00f319a182fd223e015e", "score": "0.52500373", "text": "def post(path, json, headers={})\n api_request(:POST, create_url(path), headers, json)\n end", "title": "" }, { "docid": "6da59822809697df805e56dab54c2531", "score": "0.5248775", "text": "def create\n encounter_id, obs_archetypes = params.require %i[encounter_id observations]\n\n encounter = Encounter.find(encounter_id)\n\n observations = obs_archetypes.collect do |archetype|\n obs, _child_obs = service.create_observation(encounter, archetype.permit!)\n obs\n end\n\n render json: observations, status: :created\n end", "title": "" }, { "docid": "24b20940b8122ab0828b457eb8345f20", "score": "0.5247366", "text": "def serie_params\n params.require(:serie).permit(:abbr, :name)\n end", "title": "" }, { "docid": "fae87e346d2fa256c5b490ea67993892", "score": "0.523903", "text": "def create\n @tyokyo = Tyokyo.new(params[:tyokyo])\n\n respond_to do |format|\n if @tyokyo.save\n format.html { redirect_to @tyokyo, :notice => 'Tyokyo was successfully created.' }\n format.json { render :json => @tyokyo, :status => :created, :location => @tyokyo }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @tyokyo.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "50bd820ba3b48285edc1504397cdb887", "score": "0.523073", "text": "def post(url, query_params = nil, body = nil)\n params = { headers: { 'Content-Type' => 'application/json' }, query: query_params, body: body }\n JSON.parse(perform('post', url, params), symbolize_names: true, quirks_mode: true)\n end", "title": "" }, { "docid": "5886ef2284654f68efe9e460906b1e23", "score": "0.5230001", "text": "def create\n @deanery = Deanery.new(deanery_params)\n\n if @deanery.save\n render json: @deanery, status: :created, location: @deanery\n else\n render json: @deanery.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "fe6ba0cacf8d6419ac8834ee2d88dec0", "score": "0.522217", "text": "def create\n @osy = Osy.new(osy_params)\n\n respond_to do |format|\n if @osy.save\n set_me\n format.html { redirect_to @osy, notice: 'Osy was successfully created.' }\n format.json { render :show, status: :created, location: @osy }\n else\n format.html { render :new }\n format.json { render json: @osy.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a5e7d413908ae9d4b5b54ebb5e521d50", "score": "0.52212864", "text": "def create\n @syaryo = Syaryo.new(syaryo_params)\n\n respond_to do |format|\n if @syaryo.save\n format.html { redirect_to @syaryo, notice: 'Syaryo was successfully created.' }\n format.json { render :show, status: :created, location: @syaryo }\n else\n format.html { render :new }\n format.json { render json: @syaryo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "50e1d8e3080e341e97f8d31a2d84a51b", "score": "0.5217451", "text": "def test_should_create_status_post_via_API_JSON\r\n get \"/logout\"\r\n post \"/status_posts.json\", :api_key => 'testapikey',\r\n :status_post => {:body => 'API Status Post 1' }\r\n assert_response :created\r\n status_post = JSON.parse(response.body)\r\n check_new_status_post(status_post) \r\n end", "title": "" }, { "docid": "8cad8d67ed733fc6c40d31116c4ac8f4", "score": "0.5211763", "text": "def create\n @selfie = Selfie.new(selfie_params)\n\n respond_to do |format|\n if @selfie.save\n format.html { redirect_to @selfie, notice: 'Selfie was successfully created.' }\n format.json { render :show, status: :created, location: @selfie }\n else\n format.html { render :new }\n format.json { render json: @selfie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "27bb6b44e7d2b827f5469ef562af3dd2", "score": "0.5211206", "text": "def test_prepare_company_correct_data\n company = {\n \"name\" => \"company name\",\n \"address\" => \"company address\",\n \"city\" => \"company city\",\n \"country\" => \"company country\"\n }\n post '/api/companies', company.to_json\n assert_equal 201, last_response.status\n end", "title": "" }, { "docid": "c36934a9f93c42885f0b71f562cdbdc4", "score": "0.5209953", "text": "def server_action(server_id, body, expects=202)\n request(\n :body => Fog::JSON.encode(body),\n :expects => expects,\n :method => 'POST',\n :path => \"servers/#{server_id}/action\"\n )\nend", "title": "" }, { "docid": "70bbcc364e7b409f10e4e9511536431f", "score": "0.5206235", "text": "def post(rectype,attribs,http)\r\n endpoint=\"#{URL_PREFIX}/t#{rectype}s.json\"\r\n req = Net::HTTP::Post.new(endpoint,initheader = {'Content-Type' =>'application/json'})\r\n req.body = attribs.to_json\r\n http.request(req)\r\nend", "title": "" }, { "docid": "a318fea357a4f157da49db8a2440f565", "score": "0.5206203", "text": "def create\n RestClient.post \"#{@uri}/api/requests\", @data.to_json, :content_type => :json\n end", "title": "" }, { "docid": "74dc66a58eb7d0d9f52cff4bb2cdeb4e", "score": "0.51964796", "text": "def post(options)\n wesabe.post(options)\n end", "title": "" }, { "docid": "f39ed348bc3ca920f3177526e0a01f12", "score": "0.5188222", "text": "def create create_json\n response = call_api method: :post, body: create_json\n ap JSON.parse(response.body)\n return response\n end", "title": "" }, { "docid": "195b0f81c412fb8eb5f517427446f7bf", "score": "0.5186661", "text": "def create\n @jigyosho = Jigyosho.new(jigyosho_params)\n\n respond_to do |format|\n if @jigyosho.save\n format.html { redirect_to @jigyosho, notice: 'Jigyosho was successfully created.' }\n format.json { render :show, status: :created, location: @jigyosho }\n else\n format.html { render :new }\n format.json { render json: @jigyosho.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "462e91c077542fc8ef939f687caceabf", "score": "0.5186081", "text": "def post_json(url, input_json)\n # we don't need the serial hash anymore so we\n # can reuse the serial json payload from the sensor\n input_json.delete \"hash\"\n\n # parse our input url\n uri = URI.parse(url)\n\n # make a new request\n req = Net::HTTP::Post.new(uri.path, {'Content-Type' =>'application/json'})\n\n\n # have to format it as json again with .to_json to avoid a\n # undefined method 'bytesize' for #<Hash: ...\n # error message.\n req.body = input_json.to_json\n\n response = Net::HTTP.new(uri.host, uri.port).start {|http| http.request(req)}\n puts \"Response #{response.code} #{response.message}: #{response.body}\"\nend", "title": "" }, { "docid": "7dbff8ada716f3038467535d75315e59", "score": "0.5185678", "text": "def create\n @json = Json.new(json_params)\n\n if @json.save\n render json: @json, status: :created, location: @json\n else\n render json: @json.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "5e889fe05b4a4a54d2067711c5921457", "score": "0.51770157", "text": "def post_json(path, data = {})\n pp data if @debug\n @res = client.post(\"#{@base_uri}#{path}\", data)\n handle_error(@res)\n JSON.parse(@res.body)\n end", "title": "" }, { "docid": "2a09fb2aa8bb2db5456420dc9cba2873", "score": "0.5170245", "text": "def index\n surgeries = Surgery.all\n if surgeries.present?\n # response to the JSON\n render json: { success: true, response: surgeries.map{ |f| SurgerySerializer.new(f).as_json( root: false ) } }\n else\n render :json=> { success: false, message: \"Surgery is not present.\" },:status=> 203\n end \n end", "title": "" }, { "docid": "096c8e055d6b1b5321f06f94cc72b23d", "score": "0.5167904", "text": "def create\n encounter_id, obs_archetypes = params.require %i[encounter_id observations]\n\n encounter = Encounter.find(encounter_id)\n\n observations = obs_archetypes.collect do |archetype|\n create_observation(archetype, encounter)[0]\n end\n\n render json: observations, status: :created\n end", "title": "" }, { "docid": "55e104bedcd518dfd9c58323e598c9c6", "score": "0.5162079", "text": "def create\n @thingie = Thingie.new(thingie_params)\n\n respond_to do |format|\n if @thingie.save\n format.html { redirect_to admin_thingies_path, notice: 'thingie was successfully created.' }\n format.json { render :show, status: :created, location: @thingie }\n else\n format.html { render :new }\n format.json { render json: @thingie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dd597ef9174092a9d593b6412f43ef96", "score": "0.5160781", "text": "def request_post(json_rules)\n payload = json_rules\n response = RestClient.post(@url, payload, {:Authorization => form_auth_header}) \n response\n end", "title": "" }, { "docid": "6cd8740b10c98fa8d33307fb765f1d6e", "score": "0.51528203", "text": "def post_json(path, params={})\n resp = post(path, params)\n JSON.parse(resp)\n end", "title": "" }, { "docid": "8dd5f9bcef71b09bf348475a5ea089bf", "score": "0.5152316", "text": "def json_body; end", "title": "" }, { "docid": "0f6b0178b722362c81934d2ca0de252a", "score": "0.5148312", "text": "def post_expense_json(expense)\n header \"Content-Type\", \"application/json\" \n post '/expenses', JSON.generate(expense)\n expect(last_response.status).to eq(200)\n\n parsed = JSON.parse(last_response.body)\n expect(parsed).to include('expense_id' => a_kind_of(Integer))\n #adds an id key to the expense hash, containing the id from the database\n expense.merge('id' => parsed['expense_id'])\nend", "title": "" }, { "docid": "499546647894fa88f63b6bcbf0a5d13a", "score": "0.5144574", "text": "def yasai_params\n params.require(:yasai).permit(:name, :quantity)\n end", "title": "" }, { "docid": "831d09e32c516f811a9fa4e7e33e3d15", "score": "0.51438046", "text": "def post_json(location, json_data)\n response = RestClient::Request.new(\n :method => :post,\n :url => location,\n :user => $username,\n :password => $password,\n :headers => { :accept => :json,\n :content_type => :json},\n :payload => json_data\n ).execute\n results = JSON.parse(response.to_str)\n end", "title": "" }, { "docid": "831d09e32c516f811a9fa4e7e33e3d15", "score": "0.51438046", "text": "def post_json(location, json_data)\n response = RestClient::Request.new(\n :method => :post,\n :url => location,\n :user => $username,\n :password => $password,\n :headers => { :accept => :json,\n :content_type => :json},\n :payload => json_data\n ).execute\n results = JSON.parse(response.to_str)\n end", "title": "" }, { "docid": "40010cc0357b5e184580ea1e29a417a7", "score": "0.5143297", "text": "def post_json(url, **options)\n JSON.parse(do_request('post', url, header: {'Content-Type' => 'application/json'}, **options).content)\n end", "title": "" }, { "docid": "845035633d004ad773ad8d0df67d69fd", "score": "0.5139093", "text": "def create\n response = Unirest.post(\"http://localhost:3000/api/orders\")\n order = response.body\n redirect_to \"/client/orders/#{order['order_id']}\"\n end", "title": "" }, { "docid": "4dae5bffafa98da4d6846fa897e239db", "score": "0.5137841", "text": "def create_user\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/users.json'\n ).to_s\n\n puts RestClient.post(\n url,\n { user: { username: \"Gizmo\"} }\n )\nend", "title": "" }, { "docid": "116fa71491c99792ffb0e855f0065eae", "score": "0.51349425", "text": "def create\n @pacient = Pacient.find(params[:pacient_id])\n @pacient.iesire.create(params[:iesire])\n\n respond_to do |format|\n if @iesire.save\n @pacient.update_attribute(:active, false)\n format.html { redirect_to @iesire, notice: 'Iesire was successfully created.' }\n format.json { render json: @iesire, status: :created, location: @iesire }\n format.js\n else\n format.html { render action: \"new\" }\n format.json { render json: @iesire.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end", "title": "" }, { "docid": "9a06aebc94994dd90f1ce1aea93dfddb", "score": "0.5134092", "text": "def create\n @society = Society.new(params[:society])\n\n respond_to do |format|\n if @society.save\n format.html { redirect_to @society, :notice => 'Society was successfully created.' }\n format.json { render :json => @society, :status => :created, :location => @society }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @society.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "59bb406935cbc8f0d2a1516ef5fcf1d6", "score": "0.5125509", "text": "def test_post_duplicate_user\n json_data = '{\"id\" : 1, \"user\": {\"name\":\"test\", \"last_name\":\"test 2\", \"document\" : \"456\"}}'\n post '/users', json_data\n assert_equal 409, last_response.status, 'No se respondió el códido esperado 404'\n end", "title": "" }, { "docid": "08ebcb70b20cae937d57c61004fb611b", "score": "0.5124819", "text": "def create\n @envy = Envie.new(envy_params)\n\n respond_to do |format|\n if @envy.save\n format.html { redirect_to @envy, notice: 'Envie was successfully created.' }\n format.json { render :show, status: :created, location: @envy }\n else\n format.html { render :new }\n format.json { render json: @envy.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "87ffcf72b79542019854e5ab7955cd99", "score": "0.51231325", "text": "def create\n @estudiante = Estudiante.new(params[:estudiante])\n\n if @estudiante.save\n render json: @estudiante, status: :created, location: @estudiante\n else\n render json: @estudiante.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "0a84b6b8e823caabc880e2a7d35e422c", "score": "0.51224256", "text": "def create\n begin\n url = URI(\"https://bookinn.ngrok.io/rooms\")\n\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n request = Net::HTTP::Post.new(url)\n request[\"Authorization\"] = \"Bearer #{session[\"access_token\"]}\"\n request[\"Content-Type\"] = \"application/json\"\n request.body = room_params.to_json\n response = http.request(request)\n puts response.read_body\n\n @response_json = JSON.parse(response.read_body)\n rescue => exception\n redirect_to new_room_path\n else\n if @response_json[\"status\"] == 200\n redirect_to new_room_path\n elsif @response_json[\"status\"] == 401\n redirect_to login_path\n else\n redirect_to new_room_path\n end\n end\n end", "title": "" } ]
dc3495ae358804a158429fe4d99af02b
POST /lifts POST /lifts.json
[ { "docid": "581733347569accee1d52c6ab52d7879", "score": "0.5391051", "text": "def create\n @lift = @user.lift.build(lift_params)\n @liftsets = params['liftsets']\n\n respond_to do |format|\n if @lift.save\n redirect_to \n else\n format.html { render action: 'new' }\n format.json { render json: @lift.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "edfb8fb5c63f3788b95d3e3063a5e37b", "score": "0.68366873", "text": "def create\n @lift = Lift.new(params[:lift])\n\n if @lift.save\n render json: @lift, status: :created, location: @lift\n else\n render json: @lift.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "3ab755b21f9735a1796a9c9f03ade8f1", "score": "0.6834178", "text": "def create\n @lifting = Lifting.new(params[:lifting])\n\n respond_to do |format|\n if @lifting.save\n format.html { redirect_to @lifting, notice: 'Lifting was successfully created.' }\n format.json { render json: @lifting, status: :created, location: @lifting }\n else\n format.html { render action: \"new\" }\n format.json { render json: @lifting.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8ca73663227a4b528a2437550353a828", "score": "0.64990586", "text": "def create\n @liftdatum = Liftdatum.new(liftdatum_params)\n\n respond_to do |format|\n if @liftdatum.save\n format.html { redirect_to @liftdatum, notice: 'Liftdatum was successfully created.' }\n format.json { render :show, status: :created, location: @liftdatum }\n else\n format.html { render :new }\n format.json { render json: @liftdatum.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c2c0913e506b082c5e83b0b06aa44d7a", "score": "0.6309719", "text": "def create\n @powerlifting = Powerlifting.new(powerlifting_params)\n\n respond_to do |format|\n if @powerlifting.save\n format.html { redirect_to @powerlifting, notice: 'Powerlifting was successfully created.' }\n format.json { render :show, status: :created, location: @powerlifting }\n else\n format.html { render :new }\n format.json { render json: @powerlifting.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "94636c7a4c457d764794cf2f8e85111a", "score": "0.6211451", "text": "def new\n @lifting = Lifting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lifting }\n end\n end", "title": "" }, { "docid": "2997c8a7e830d1b5f3e1336635fd8d95", "score": "0.60093135", "text": "def create\n @lift_req = LiftReq.new(lift_req_params)\n\n respond_to do |format|\n if @lift_req.save\n format.html { redirect_to @lift_req, notice: 'Lift req was successfully created.' }\n format.json { render :show, status: :created, location: @lift_req }\n else\n format.html { render :new }\n format.json { render json: @lift_req.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dfaf0e91af3bbd58ced379ba2117f1ab", "score": "0.5984755", "text": "def create\n @example_lift_req = ExampleLiftReq.new(example_lift_req_params)\n\n respond_to do |format|\n if @example_lift_req.save\n format.html { redirect_to @example_lift_req, notice: 'Example lift req was successfully created.' }\n format.json { render :show, status: :created, location: @example_lift_req }\n else\n format.html { render :new }\n format.json { render json: @example_lift_req.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a04c2260ac7c516e9a1c406e675a55d3", "score": "0.57974476", "text": "def create\n @lift_set = LiftSet.new(lift_set_params)\n\n if @lift_set.save\n render json: @lift_set, status: :created, location: @lift_set\n else\n render json: @lift_set.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "8204b60d75165b05c4c840b2d78b18c1", "score": "0.5740237", "text": "def create\n @lit = Lit.new(lit_params)\n\n respond_to do |format|\n if @lit.save\n format.html { redirect_to @lit, notice: 'Lit was successfully created.' }\n format.json { render action: 'show', status: :created, location: @lit }\n else\n format.html { render action: 'new' }\n format.json { render json: @lit.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f2f86d0cc59b2e3776f03afdfd437d6d", "score": "0.5668779", "text": "def create\n @trail = Trail.new(trail_params)\n\n respond_to do |format|\n if @trail.save\n format.html { redirect_to @trail, notice: 'Trail was successfully created.' }\n format.json { render :show, status: :created, location: @trail }\n else\n format.html { render :new }\n format.json { render json: @trail.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f2f86d0cc59b2e3776f03afdfd437d6d", "score": "0.5668779", "text": "def create\n @trail = Trail.new(trail_params)\n\n respond_to do |format|\n if @trail.save\n format.html { redirect_to @trail, notice: 'Trail was successfully created.' }\n format.json { render :show, status: :created, location: @trail }\n else\n format.html { render :new }\n format.json { render json: @trail.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eb560e87e3e29f5b8d25627af97e72e3", "score": "0.565703", "text": "def create\n @lt = Lt.new(params[:lt])\n\n respond_to do |format|\n if @lt.save\n format.html { redirect_to @lt, notice: 'Lt was successfully created.' }\n format.json { render json: @lt, status: :created, location: @lt }\n else\n format.html { render action: \"new\" }\n format.json { render json: @lt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "27d4f0bd64a6d401c841aed9d91c9cfe", "score": "0.5653014", "text": "def create\n @trail = Trail.new(trail_params)\n\n respond_to do |format|\n if @trail.save\n format.html { redirect_to @trail, notice: \"Trail was successfully created.\" }\n format.json { render :show, status: :created, location: @trail }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @trail.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a3f1b232b2cdb9316d5aa64149d7cdcd", "score": "0.5545134", "text": "def create\n @lunch = Lunch.new(params[:lunch])\n\n respond_to do |format|\n if @lunch.save\n format.html { redirect_to @lunch, notice: 'Lunch was successfully created.' }\n format.json { render json: @lunch, status: :created, location: @lunch }\n else\n format.html { render action: \"new\" }\n format.json { render json: @lunch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a3f1b232b2cdb9316d5aa64149d7cdcd", "score": "0.5545134", "text": "def create\n @lunch = Lunch.new(params[:lunch])\n\n respond_to do |format|\n if @lunch.save\n format.html { redirect_to @lunch, notice: 'Lunch was successfully created.' }\n format.json { render json: @lunch, status: :created, location: @lunch }\n else\n format.html { render action: \"new\" }\n format.json { render json: @lunch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ea7266779e4a2207e007a6cc6f983eef", "score": "0.55316144", "text": "def create\n puts \"%%%%%\" * 10\n puts \"IN LEGS CREATE\"\n @trip = Trip.find(params[:trip_id])\n @leg = @trip.legs.new(leg_params)\n\n respond_to do |format|\n if @leg.save\n format.html { redirect_to @leg, notice: 'Leg was successfully created.' }\n format.json { render :show, status: :created, location: @leg }\n else\n format.html { render :new }\n format.json { render json: @leg.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "65dbb87ff7f99824b2765e95024e402f", "score": "0.55254894", "text": "def create\n @lift = Lift.new(params[:lift])\n @lifts=current_user.lifts(:page => params[:page], :include => [:exercise => :muscle], :order => 'lifts.created_at DESC').sort_by(&:created_at).reverse\n @exercises = Exercise.all\n @muscleid = @lift.exercise.muscle_id\n\n respond_to do |format|\n if @lift.save\n flash[:notice] = 'Lift was successfully created.'\n format.html { redirect_to(@lift) }\n format.xml { render :xml => @lift, :status => :created, :location => @lift }\n format.js\n else\n flash[:notice] = 'This lift already exists!'\n format.html { render :action => \"new\" }\n format.xml { render :xml => @lift.errors, :status => :unprocessable_entity }\n format.js\n end\n end\n end", "title": "" }, { "docid": "3f100d7c5c1768f6826d93b20814cbe8", "score": "0.5525419", "text": "def create\n @liga_tymy = LigaTymy.new(liga_tymy_params)\n\n respond_to do |format|\n if @liga_tymy.save\n format.html { redirect_to @liga_tymy, notice: 'Liga tymy was successfully created.' }\n format.json { render :show, status: :created, location: @liga_tymy }\n else\n format.html { render :new }\n format.json { render json: @liga_tymy.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c516a6f5e789b66a5d46d512aa8dee18", "score": "0.54982287", "text": "def create\n @offspring_litter = OffspringLitter.new(params[:offspring_litter])\n\n respond_to do |format|\n if @offspring_litter.save\n format.html { redirect_to @offspring_litter, notice: 'Offspring litter was successfully created.' }\n format.json { render json: @offspring_litter, status: :created, location: @offspring_litter }\n else\n format.html { render action: \"new\" }\n format.json { render json: @offspring_litter.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9fb1142d5b0e272d59ccaa6c8fba4db4", "score": "0.54777867", "text": "def create \n @litter = Litter.new(litter_params)\n respond_to do |format|\n if @litter.save\n format.html { redirect_to @litter, notice: 'Litter was successfully created.' }\n format.json { render :show, status: :created, location: @litter }\n else\n format.html { render :new }\n format.json { render json: @litter.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "593f75cc7cdd4f99e81ca9174d9d3f39", "score": "0.54498637", "text": "def create\n @litter = Litter.new(litter_params)\n\n respond_to do |format|\n if @litter.save\n format.html { redirect_to @litter, notice: 'Litter was successfully created.' }\n format.json { render action: 'show', status: :created, location: @litter }\n else\n format.html { render action: 'new' }\n format.json { render json: @litter.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bf2aa1721c8e42e01ffcb85db5a12179", "score": "0.5446813", "text": "def create\n @thief_talent = ThiefTalent.new(thief_talent_params)\n\n if @thief_talent.save\n render json: @thief_talent, status: :created, location: @thief_talent\n else\n render json: @thief_talent.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "4719b79a34739eabf569424744b46265", "score": "0.5443873", "text": "def create\n @laptime = Laptime.new(laptime_params)\n\n respond_to do |format|\n if @laptime.save\n format.html { redirect_to @laptime, notice: 'Laptime was successfully created.' }\n format.json { render :show, status: :created, location: @laptime }\n else\n format.html { render :new }\n format.json { render json: @laptime.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f153bf23ab6d7c57b0e9f70fcd354f9f", "score": "0.54359454", "text": "def create\n @lion = Lion.new(lion_params)\n\n respond_to do |format|\n if @lion.save\n format.html { redirect_to @lion, notice: 'Lion was successfully created.' }\n format.json { render :show, status: :created, location: @lion }\n else\n format.html { render :new }\n format.json { render json: @lion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7e31fa7c838bef6415c1ba2c37a098ee", "score": "0.54182774", "text": "def create\n @lecture = Lecture.new(lecture_params)\n\n if @lecture.save\n render json: @lecture, status: :created, location: @lecture\n else\n render json: @lecture.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "d59a81c3a7b2f7f0096435a3a8d1b37f", "score": "0.54039234", "text": "def create\n @trailhead = Trailhead.new(trailhead_params)\n\n respond_to do |format|\n if @trailhead.save\n format.html { redirect_to @trailhead, notice: 'Trailhead was successfully created.' }\n format.json { render action: 'show', status: :created, location: @trailhead }\n else\n format.html { render action: 'new' }\n format.json { render json: @trailhead.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "25052670eefe31c69bfbbd10baf43046", "score": "0.5399299", "text": "def create\n puts \"\\n******** trail_create ********\"\n @trail = Trail.new(trail_params)\n\n respond_to do |format|\n if @trail.save\n puts \"+++ Trail Success +++\"\n @new_trail = Trail.order(\"created_at\").last\n puts \"+++ @new_trail: #{@new_tail} +++\"\n format.html { redirect_to trail_path(@new_trail.id)}\n format.html { redirect_to @trail, notice: 'Trail was successfully created.' }\n format.json { render :show, status: :created, location: @trail }\n else\n puts \"+++ Trail Fail +++\"\n format.html { render :new, notice: 'Trail creation failed.' }\n format.json { render json: @trail.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5f2e64222dbc754b17800fc9077df424", "score": "0.5399005", "text": "def create\n @my_lunch = MyLunch.new(my_lunch_params)\n\n respond_to do |format|\n if @my_lunch.save\n format.html { redirect_to @my_lunch, notice: 'My lunch was successfully created.' }\n format.json { render action: 'show', status: :created, location: @my_lunch }\n else\n format.html { render action: 'new' }\n format.json { render json: @my_lunch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "09a53e8fe821365332ebc3e870000d21", "score": "0.539313", "text": "def create\n @lift_location = LiftLocation.new(lift_location_params)\n\n respond_to do |format|\n if @lift_location.save\n format.html { redirect_to lift_locations_url, notice: 'Lift location was successfully created.' }\n format.json { redirect_to lift_locations_url, status: :created, location: @lift_location }\n else\n format.html { render :new }\n format.json { render json: @lift_location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d52c3c861c46bd3388495e3477932b3f", "score": "0.53897434", "text": "def create\n @loteriat = Loteriat.new(loteriat_params)\n\n respond_to do |format|\n if @loteriat.save\n format.html { redirect_to @loteriat, notice: 'Loteriat was successfully created.' }\n format.json { render :show, status: :created, location: @loteriat }\n else\n format.html { render :new }\n format.json { render json: @loteriat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2558cdb78e3e74646d2a6ad599a567ef", "score": "0.53785676", "text": "def create\n @traveller = Traveller.new(traveller_params)\n\n respond_to do |format|\n if @traveller.save\n format.html { redirect_to @traveller, notice: 'Traveller was successfully created.' }\n format.json { render :show, status: :created, location: @traveller }\n else\n format.html { render :new }\n format.json { render json: @traveller.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3d79039907e6bf705a64d919cf04b324", "score": "0.5364519", "text": "def create\n @lyric = Lyric.new(lyric_params)\n\n respond_to do |format|\n if @lyric.save\n format.html { redirect_to @lyric, notice: 'Lyric was successfully created.' }\n format.json { render :show, status: :created, location: @lyric }\n else\n format.html { render :new }\n format.json { render json: @lyric.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3d79039907e6bf705a64d919cf04b324", "score": "0.5364519", "text": "def create\n @lyric = Lyric.new(lyric_params)\n\n respond_to do |format|\n if @lyric.save\n format.html { redirect_to @lyric, notice: 'Lyric was successfully created.' }\n format.json { render :show, status: :created, location: @lyric }\n else\n format.html { render :new }\n format.json { render json: @lyric.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0173841db32d521ed18973a4914beab3", "score": "0.53627026", "text": "def create\n @trail = Trail.new(trail_params)\n @trail.user = current_user\n\n respond_to do |format|\n if @trail.save\n format.html { redirect_to trails_path, notice: 'Trail was successfully created.' }\n format.json { render :show, status: :created, location: @trail }\n else\n format.html { render :new }\n format.json { render json: @trail.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "555362854aa966a513edffb33dae1cd4", "score": "0.5355917", "text": "def create\n \n \n \n @imovel = Imovel.new(params[:imovel])\n\n respond_to do |format|\n if @imovel.save\n \n format.html { redirect_to @imovel, notice: 'Imovel was successfully created.' }\n format.json { render json: @imovel, status: :created, location: @imovel }\n else\n format.html { render action: \"new\" }\n format.json { render json: @imovel.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fb7dee2de7b0fdcefbd398e7d4a6489a", "score": "0.53519064", "text": "def create\n @time_traveller = TimeTraveller.new(time_traveller_params)\n\n respond_to do |format|\n if @time_traveller.save\n format.html { redirect_to @time_traveller, notice: 'Time traveller was successfully created.' }\n format.json { render :show, status: :created, location: @time_traveller }\n else\n format.html { render :new }\n format.json { render json: @time_traveller.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "340df21ff7113656ab4f70d1b3ae93e4", "score": "0.5348799", "text": "def create\n @traveller = Traveller.new(traveller_params)\n\n respond_to do |format|\n if @traveller.save\n format.html { redirect_to @traveller, notice: 'Traveller was successfully created.' }\n format.json { render action: 'show', status: :created, location: @traveller }\n else\n format.html { render action: 'new' }\n format.json { render json: @traveller.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1ab907ab1179a9722669f917973879a1", "score": "0.5348395", "text": "def create\n @lion_tamer = LionTamer.new(lion_tamer_params)\n\n respond_to do |format|\n if @lion_tamer.save\n format.html { redirect_to @lion_tamer, notice: 'Lion tamer was successfully created.' }\n format.json { render :show, status: :created, location: @lion_tamer }\n else\n format.html { render :new }\n format.json { render json: @lion_tamer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "975319bf87cc407ff59060a71fa97535", "score": "0.5338091", "text": "def create\n @toilet = Toilet.new(params[:toilet])\n\n respond_to do |format|\n if @toilet.save\n format.html { redirect_to @toilet, :notice => 'Toilet was successfully created.' }\n format.json { render :json => @toilet, :status => :created, :location => @toilet }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @toilet.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "78e439d431bd493592a582f19f45fe51", "score": "0.53276366", "text": "def create\n @lot = Lot.new(lot_params)\n\n respond_to do |format|\n if @lot.save\n format.html { redirect_to @lot, notice: 'Lot was successfully created.' }\n format.json { render json: @lot, status: :created }\n else\n format.html { render action: 'new' }\n format.json { render json: @lot.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a43b3a40733384e0926623699592067b", "score": "0.53250825", "text": "def liftdatum_params\n params.require(:liftdatum).permit(:exercise, :set, :rep, :weight, :user)\n end", "title": "" }, { "docid": "49adad36c3dbce82924dee1300248778", "score": "0.53248894", "text": "def create\n @illust = Illust.new(params[:illust])\n\n respond_to do |format|\n if @illust.save\n format.html { redirect_to @illust, notice: 'Illust was successfully created.' }\n format.json { render json: @illust, status: :created, location: @illust }\n else\n format.html { render action: \"new\" }\n format.json { render json: @illust.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a9d3047931a9bd7f6a6ec8683e08d11", "score": "0.5324549", "text": "def create\n @imovel = Imovel.new(params[:imovel])\n\n respond_to do |format|\n if @imovel.save\n format.html { redirect_to @imovel, notice: 'Imovel was successfully created.' }\n format.json { render json: @imovel, status: :created, location: @imovel }\n else\n format.html { render action: \"new\" }\n format.json { render json: @imovel.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "40fee819c0de0acd95f8f9020ff7176e", "score": "0.53209585", "text": "def create\n @lui = Lui.new(lui_params)\n\n respond_to do |format|\n if @lui.save\n format.html { redirect_to @lui, notice: 'Lui was successfully created.' }\n format.json { render :show, status: :created, location: @lui }\n else\n format.html { render :new }\n format.json { render json: @lui.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "26fafeab8160dd1d42e2d4ee9f5a2c2c", "score": "0.5316659", "text": "def create\n @lhfe_flight = LhfeFlight.new(params[:lhfe_flight])\n\n respond_to do |format|\n if @lhfe_flight.save\n format.html { redirect_to @lhfe_flight, :notice => 'Lhfe flight was successfully created.' }\n format.json { render :json => @lhfe_flight, :status => :created, :location => @lhfe_flight }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @lhfe_flight.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b17931dfdee3d093482dbe2c4504af50", "score": "0.5314798", "text": "def create\n @traction = Traction.new(params[:traction])\n\n respond_to do |format|\n if @traction.save\n format.html { redirect_to @traction, notice: 'Traction was successfully created.' }\n format.json { render json: @traction, status: :created, location: @traction }\n else\n format.html { render action: \"new\" }\n format.json { render json: @traction.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f90ab3b07fe54680706d18ec3ad770c0", "score": "0.5314065", "text": "def powerlifting_params\n params.require(:powerlifting).permit(:move, :result)\n end", "title": "" }, { "docid": "bc9df93e250e934e13bdba64d97ac052", "score": "0.5303685", "text": "def new\n @trailhead = Trailhead.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trailhead }\n end\n end", "title": "" }, { "docid": "c503bfdf60c9510ed71602f8bc0d383e", "score": "0.530172", "text": "def create\n @livestock = Livestock.new(livestock_params)\n respond_to do |format|\n if @livestock.save\n format.html { redirect_to @livestock, notice: 'Your animal was successfully submitted.' }\n format.json { render :show, status: :created, location: @livestock }\n else\n format.html { render :new }\n format.json { render json: @livestock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "601b61674dad286090756d4531169cb5", "score": "0.5294994", "text": "def create\n @lunchspecial = Lunchspecial.new(lunchspecial_params)\n\n respond_to do |format|\n if @lunchspecial.save\n format.html { redirect_to @lunchspecial, notice: 'Lunchspecial was successfully created.' }\n format.json { render :show, status: :created, location: @lunchspecial }\n else\n format.html { render :new }\n format.json { render json: @lunchspecial.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "049716a9e8c453a7f607050a997c6dad", "score": "0.5293563", "text": "def create\n @templet = Templet.new(templet_params)\n @templet[\"stutus\"] = 1\n respond_to do |format|\n if @templet.save\n format.html { redirect_to @templet, notice: 'Templet was successfully created.' }\n format.json { render :show, status: :created, location: @templet }\n else\n format.html { render :new }\n format.json { render json: @templet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a35f0efeddebfe3a3f5a91af80c25854", "score": "0.52894324", "text": "def create\n @toilet = Toilet.new(params[:toilet])\n\n respond_to do |format|\n if @toilet.save\n format.html { redirect_to @toilet, notice: 'Toilet was successfully created.' }\n format.json { render json: @toilet, status: :created, location: @toilet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @toilet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a35f0efeddebfe3a3f5a91af80c25854", "score": "0.52894324", "text": "def create\n @toilet = Toilet.new(params[:toilet])\n\n respond_to do |format|\n if @toilet.save\n format.html { redirect_to @toilet, notice: 'Toilet was successfully created.' }\n format.json { render json: @toilet, status: :created, location: @toilet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @toilet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "70bbcc364e7b409f10e4e9511536431f", "score": "0.52881545", "text": "def post(rectype,attribs,http)\r\n endpoint=\"#{URL_PREFIX}/t#{rectype}s.json\"\r\n req = Net::HTTP::Post.new(endpoint,initheader = {'Content-Type' =>'application/json'})\r\n req.body = attribs.to_json\r\n http.request(req)\r\nend", "title": "" }, { "docid": "c47f66008a56398c6b33a55af09b7d78", "score": "0.5282778", "text": "def create\n @lizd = Lizd.new(lizd_params)\n\n respond_to do |format|\n if @lizd.save\n format.html { redirect_to @lizd, notice: 'Lizd was successfully created.' }\n format.json { render action: 'show', status: :created, location: @lizd }\n else\n format.html { render action: 'new' }\n format.json { render json: @lizd.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9ffd03108238b4bd6f6bbed78085c010", "score": "0.52806884", "text": "def trail_params\n params.require(:trail).permit(:name, :location, :length, :status, :can_ride)\n end", "title": "" }, { "docid": "699f446c5291e145ab9cac76898b52ed", "score": "0.5277244", "text": "def create\n tire_load = create_params\n \n @tires,@errors = Tire.create_with(tire_load)\n\n render json: {:created_tires => @tires, :parse_errors => @errors } \n end", "title": "" }, { "docid": "f35bb24b4a84bd648a2315db67a9a965", "score": "0.52736646", "text": "def create\n # raise params.inspect\n @routine = Routine.new(:name => params[:routine][:name])\n @routine.date = params[:routine][:date]\n @routine.user_id = current_user.id \n if params[:routine][:bodyweight].size > 0\n @routine.bodyweight = params[:routine][:bodyweight].to_i\n else\n @routine.bodyweight = Routine.by_date.last.bodyweight\n end\n @routine.tag_list = params[:routine][:tag_list]\n @routine.save\n\n params[:lifts].each do |lift|\n lift.each do |k,v|\n exercise = Exercise.find_or_create_by_name(v[:exercise_name])\n lift = Lift.create(:exercise_id => exercise.id, :routine_id => @routine.id)\n if v[:bodyweight_exercise] == \"yes\"\n v[:infos].each do |info|\n info[:weight] = info[:weight].to_i + @routine.bodyweight\n end\n else\n end\n exercise_array = v[:infos]\n exercise_array.each do |hash_of_info|\n info = Info.create(hash_of_info)\n info.lift_id = lift.id\n info.save\n end\n end\n end\n\n # exercise_hash = params[:lifts]\n # exercise = Exercise.find(exercise_hash[:exercise_id].to_i)\n # lift = Lift.create(:exercise_id => exercise.id, :routine_id => @routine.id)\n # exercise_hash[:infos].each do |hash_of_info|\n # info = Info.create(hash_of_info)\n # info.lift_id = lift.id\n # info.save\n # end\n\n# ------------------------------------- \n# \"routine\"=>{\n# \"name\"=>\"Test Routine\"},\n# \"lifts\"=>[\n# {\"0\"=>{\n# \"exercise_id\"=>\"1\",\n# \"infos\"=>[\n# {\"weight\"=>\"155\", \"repetition\"=>\"8\"}]},\n# \"1\"=>{\n# \"exercise_id\"=>\"4\",\n# \"infos\"=>[\n# {\"weight\"=>\"205\", \"repetition\"=>\"4\"}]}}]\n# -----------------------------------------\n\n # ----------------------------- \n # :lift => {:exercise_id => 1, \n # :infos => [\n # {:weight => \"250\", :repetition => \"8\"}, \n # {:weight => \"250\", :repetition => \"8\"}\n # ]}\n # -----------------------------\n\n\n respond_to do |format|\n if @routine.persisted?\n # puts \"#\"*15\n # puts @routine.lifts\n # puts \"#\"*15\n format.html { redirect_to @routine, notice: 'Routine was successfully created.' }\n format.json { render json: @routine, status: :created, location: @routine }\n else\n format.html { render action: \"new\" }\n format.json { render json: @routine.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a4452d9370f0c42a15e78050f901425c", "score": "0.5273499", "text": "def create\n @trail_mix = TrailMix.new(trail_mix_params)\n\n respond_to do |format|\n if @trail_mix.save\n format.html { redirect_to @trail_mix, notice: 'Trail mix was successfully created.' }\n format.json { render :show, status: :created, location: @trail_mix }\n else\n format.html { render :new }\n format.json { render json: @trail_mix.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fe750811740025d660d1651b90891e28", "score": "0.5270679", "text": "def create\n @thot = Thot.new(params[:thot])\n\n respond_to do |format|\n if @thot.save\n format.html { redirect_to @thot, notice: 'Thot was successfully created.' }\n format.json { render json: @thot, status: :created, location: @thot }\n else\n format.html { render action: \"new\" }\n format.json { render json: @thot.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c6eaceb78d2bc94e0e60a773ac8aa21f", "score": "0.52667516", "text": "def new\n @trail = Trail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trail }\n end\n end", "title": "" }, { "docid": "c1cfd20aec061bfef28813a08608f22f", "score": "0.52631396", "text": "def create\n itinerary = current_user.itineraries.create!(itinerary_params)\n itinerary_id = current_user.itineraries.last\n \n events = params[:events]\n events.each do |event|\n itinerary_id = current_user.itineraries.last[:id]\n EventsItinerary.create(itinerary_id: itinerary_id, event_id: event[\"id\"])\n end\n render json: itinerary, status: 201 # , location: [:api, itineraries]\n end", "title": "" }, { "docid": "17e34eb59562815c5f7f2775d74bbe73", "score": "0.52628803", "text": "def create\n @turist = Turist.new(turist_params)\n\n respond_to do |format|\n if @turist.save\n format.html { redirect_to @turist, notice: 'Turist was successfully created.' }\n format.json { render :show, status: :created, location: @turist }\n else\n format.html { render :new }\n format.json { render json: @turist.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e676117e02d3b3798311eaef700f03f4", "score": "0.52521276", "text": "def set_lifting\n @lifting = Visit::Lifting.find(params[:id])\n end", "title": "" }, { "docid": "81234f25e5a194aa85f27adbaa090357", "score": "0.52512646", "text": "def set_lifter\n @lifter = Lifter.find(params[:id])\n end", "title": "" }, { "docid": "7f4f9aa4a30ce6911ab0231d06f35e59", "score": "0.5245249", "text": "def create\n @tiramon_training = TiramonTraining.new(tiramon_training_params)\n\n respond_to do |format|\n if @tiramon_training.save\n format.html { redirect_to @tiramon_training, notice: \"Tiramon training was successfully created.\" }\n format.json { render :show, status: :created, location: @tiramon_training }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @tiramon_training.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4c2d19a40d078b815079281640152745", "score": "0.52448285", "text": "def create\n @lot = Lot.new(lot_params)\n\n respond_to do |format|\n if @lot.save\n format.html { redirect_to @lot, notice: 'Lot was successfully created.' }\n format.json { render :show, status: :created, location: @lot }\n else\n format.html { render :new }\n format.json { render json: @lot.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "53a78346e216972d495b94236e84d0f0", "score": "0.524211", "text": "def create\n @leg = Leg.new(params[:leg])\n\n respond_to do |format|\n if @leg.save\n format.html { redirect_to @leg, :notice => 'Leg was successfully created.' }\n format.json { render :json => @leg, :status => :created, :location => @leg }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @leg.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1fcb902225ed824eda389fdba3885a26", "score": "0.5240012", "text": "def create_lifts(db, x)\n\n x.lifts {\n @lifts.each do |lift|\n begin\n x.lift {\n x.name lift\n x.svgname get_svg_lift_name(lift)\n\n x.onerm query_lift_data( db, @lift_query, lift, 1)\n x.threerm query_lift_data( db, @lift_query, lift, 3)\n x.fiverm query_lift_data( db, @lift_query, lift, 5)\n }\n ensure\n #stm.close\n end\n end\n }\n end", "title": "" }, { "docid": "ac737b3ded62c5d60e4acafcaf7649a9", "score": "0.5235807", "text": "def create\n @listrfc = Listrfc.new(listrfc_params)\n\n respond_to do |format|\n if @listrfc.save\n format.html { redirect_to @listrfc, notice: 'Listrfc was successfully created.' }\n format.json { render :show, status: :created, location: @listrfc }\n else\n format.html { render :new }\n format.json { render json: @listrfc.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aa4daa6fe2f8d16d267576133867df62", "score": "0.5223719", "text": "def create\n @trap_speed = TrapSpeed.new(params[:trap_speed])\n\n respond_to do |format|\n if @trap_speed.save\n format.html { redirect_to @trap_speed, notice: 'Trap speed was successfully created.' }\n format.json { render json: @trap_speed, status: :created, location: @trap_speed }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trap_speed.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bf7e9ab870018abac9f6a6b49c12249c", "score": "0.5220016", "text": "def create\n @imovel = Imovel.new(imovel_params)\n\n respond_to do |format|\n if @imovel.save\n format.html { redirect_to @imovel, notice: 'Imovel was successfully created.' }\n format.json { render :show, status: :created, location: @imovel }\n else\n format.html { render :new }\n format.json { render json: @imovel.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9ffc97adf9c046ac1300fc2f040e3cc", "score": "0.52167296", "text": "def create\n @travel_request = TravelRequest.find(params[:travel_request_id])\n @travel_leg = TravelLeg.new(travel_leg_params)\n @travel_leg.travel_request = @travel_request\n @flight = Flight.new\n @flight.travel_leg = @travel_leg\n @flight.landing_location = travel_leg_params[:destination_city]\n @flight.flight_date = travel_leg_params[:date_start]\n @flight.booked = false\n respond_to do |format|\n if @travel_leg.save && @flight.save\n format.html { redirect_to @travel_request, notice: 'Travel leg was successfully created.' }\n format.json { render action: 'show', status: :created, location: @travel_leg }\n else\n format.html { render action: 'new' }\n format.json { render json: @travel_leg.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "93354f6602f237716a7b97811261e8b3", "score": "0.52162653", "text": "def create\n @steplist = Steplist.new(params[:steplist])\n\n respond_to do |format|\n if @steplist.save\n format.html { redirect_to @steplist, notice: 'Steplist was successfully created.' }\n format.json { render json: @steplist, status: :created, location: @steplist }\n else\n format.html { render action: \"new\" }\n format.json { render json: @steplist.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "412474fd9fc77db0c6c6d6e372737dde", "score": "0.5198692", "text": "def create\n @lei = Lei.new(params[:lei])\n\n respond_to do |format|\n if @lei.save\n format.html { redirect_to leis_path, notice: \"Lei criada com sucesso.\" }\n format.json { render json: @lei, status: :created, location: @lei }\n else\n format.html { render action: \"new\" }\n format.json { render json: @lei.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cb3e077e43014ac2aa3db7572204f03a", "score": "0.5195902", "text": "def create\n @fuel = Fuel.new(params[:fuel])\n\n respond_to do |format|\n if @fuel.save\n format.html { redirect_to @fuel, notice: 'Fuel was successfully created.' }\n format.json { render json: @fuel, status: :created, location: @fuel }\n else\n format.html { render action: \"new\" }\n format.json { render json: @fuel.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b91ad81a887e02d66792b6c2cd2e8df5", "score": "0.51877093", "text": "def create\n @lecture = Lecture.new(lecture_params)\n if @lecture.save\n head :ok\n else\n render json: {errors: @lecture.errors.full_messages }, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "55ad964e561f9a801bab3544b6160fdc", "score": "0.5184919", "text": "def create\n @leaf_spot_imm = LeafSpotImm.new(leaf_spot_imm_params)\n\n respond_to do |format|\n if @leaf_spot_imm.save\n format.html { redirect_to @leaf_spot_imm, notice: 'Leaf spot imm was successfully created.' }\n format.json { render :show, status: :created, location: @leaf_spot_imm }\n else\n format.html { render :new }\n format.json { render json: @leaf_spot_imm.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3abf80f77359bbf116562e318affb9c4", "score": "0.5184124", "text": "def create\n @trap = Trap.new(params[:trap])\n\n respond_to do |format|\n if @trap.save\n format.html { redirect_to @trap, :notice => 'Trap was successfully created.' }\n format.json { render :json => @trap, :status => :created, :location => @trap }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @trap.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a8dcd8a1ab4bc4b526fd42a71f164f88", "score": "0.51836705", "text": "def create\n @trailhead = Trailhead.new(params[:trailhead])\n @trailhead.user = current_user\n\n respond_to do |format|\n if @trailhead.save\n format.html { redirect_to @trailhead, notice: 'Trailhead was successfully created.' }\n format.json { render json: @trailhead, status: :created, location: @trailhead }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trailhead.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "94e4ffd0d0ad9ad481431dce909e3fa3", "score": "0.51809484", "text": "def create\n @lesson_timing = LessonTiming.new()\n\n respond_to do |format|\n if @lesson_timing.save\n format.html { redirect_to @lesson_timing, notice: 'Lesson timing was successfully created.' }\n format.json { render :index, status: :created, location: @lesson_timing }\n else\n format.html { render :new }\n format.json { render json: @lesson_timing.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2e9be33b52c5afc21182e1031312e726", "score": "0.5178975", "text": "def create\n @tichet = Tichet.new(tichet_params)\n\n respond_to do |format|\n if @tichet.save\n format.html { redirect_to @tichet, notice: 'Tichet was successfully created.' }\n format.json { render :show, status: :created, location: @tichet }\n else\n format.html { render :new }\n format.json { render json: @tichet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e9b13d4b829c180996bf1a022f167382", "score": "0.5175881", "text": "def create\n @lithium = Lithium.new(params[:lithium])\n\n respond_to do |format|\n if @lithium.save\n format.html { redirect_to @lithium, notice: 'Lithium was successfully created.' }\n format.json { render json: @lithium, status: :created, location: @lithium }\n else\n format.html { render action: \"new\" }\n format.json { render json: @lithium.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fae58ffb148c77963982a9921fdec19f", "score": "0.51755005", "text": "def create\n @lolly = Lolly.new(lolly_params)\n\n respond_to do |format|\n if @lolly.save\n format.html { redirect_to @lolly, notice: 'Lolly was successfully created.' }\n format.json { render :show, status: :created, location: @lolly }\n else\n format.html { render :new }\n format.json { render json: @lolly.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "969de6efd8ada06e4a69fb0f8d64d4e0", "score": "0.5175259", "text": "def create\n @lens = Lens.new(params[:lens])\n\n respond_to do |format|\n if @lens.save\n format.html { redirect_to new_lens_url, notice: 'Lens was successfully created.' }\n format.json { render json: @lens, status: :created, location: @lens }\n else\n format.html { render action: \"new\" }\n format.json { render json: @lens.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3ac7209d403e661159ec84c62ce44e25", "score": "0.5174558", "text": "def create\n @lift_course = LiftCourse.new(lift_course_params)\n\n respond_to do |format|\n if @lift_course.save\n format.html { redirect_to lift_courses_url, notice: 'Lift course was successfully created.' }\n format.json { redirect_to lift_courses_url, status: :created, location: @lift_course }\n else\n format.html { render :new }\n format.json { render json: @lift_course.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ac9f4acd5fc0d181ebaf79a5335c23e4", "score": "0.51682407", "text": "def create\n @night_life = NightLife.new(night_life_params)\n\n respond_to do |format|\n if @night_life.save\n format.html { redirect_to @night_life, notice: 'Night life was successfully created.' }\n format.json { render action: 'show', status: :created, location: @night_life }\n else\n format.html { render action: 'new' }\n format.json { render json: @night_life.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1e2027907c0bcfa9e43d842495988ec0", "score": "0.5166123", "text": "def create\n @tire = Tire.new(params[:tire])\n\n respond_to do |format|\n if @tire.save\n format.html { redirect_to @tire, notice: 'Tire was successfully created.' }\n format.json { render json: @tire, status: :created, location: @tire }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tire.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "76777dbdcea692d90c2d2eaf00142cdc", "score": "0.5165828", "text": "def create\n @lie = Lie.new(lie_params)\n\n respond_to do |format|\n if @lie.save\n format.html { redirect_to action: 'index', notice: 'Lie was successfully created.' }\n format.json { render :show, status: :created, location: @lie }\n else\n format.html { render :new }\n format.json { render json: @lie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "29d3fc026a958f301e72c7bc1543fd1d", "score": "0.5162828", "text": "def update\n @lifting = Lifting.find(params[:id])\n\n respond_to do |format|\n if @lifting.update_attributes(params[:lifting])\n format.html { redirect_to @lifting, notice: 'Lifting was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lifting.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d5c031734f8ac3f939b1886e1b46e240", "score": "0.5161506", "text": "def create\n @shuttle = Shuttle.new(params[:shuttle])\n\n respond_to do |format|\n if @shuttle.save\n format.html { redirect_to @shuttle, notice: 'Shuttle was successfully created.' }\n format.json { render json: @shuttle, status: :created, location: @shuttle }\n else\n format.html { render action: \"new\" }\n format.json { render json: @shuttle.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b8541f2a90e5dd23b291b4a99a69165f", "score": "0.51581144", "text": "def lifter_params\n params.require(:lifter).permit(:index, :show)\n end", "title": "" }, { "docid": "bcf732d61be1594a71d516faa1a2b697", "score": "0.5156775", "text": "def create\n @tattoo = Tattoo.new(tattoo_params)\n\n respond_to do |format|\n if @tattoo.save\n format.html { redirect_to @tattoo, notice: 'Tattoo was successfully created.' }\n format.json { render :show, status: :created, location: @tattoo }\n else\n format.html { render :new }\n format.json { render json: @tattoo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "94fa2969f345be25e8855c43a475c7f2", "score": "0.515313", "text": "def create\n @travelling = Travelling.new(travelling_params)\n\n respond_to do |format|\n if @travelling.save\n format.html { redirect_to @travelling, notice: 'Travelling was successfully created.' }\n format.json { render :show, status: :created, location: @travelling }\n else\n format.html { render :new }\n format.json { render json: @travelling.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fdf8dfe21bd8a3a55b67e62b226cf74c", "score": "0.5151725", "text": "def create\n @receptionist = Receptionist.new(params[:receptionist])\n\n respond_to do |format|\n if @receptionist.save\n format.html { redirect_to @receptionist, notice: 'Receptionist was successfully created.' }\n format.json { render json: @receptionist, status: :created, location: @receptionist }\n else\n format.html { render action: \"new\" }\n format.json { render json: @receptionist.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8bd1a47f06b042db62c7d97350a8b9aa", "score": "0.5146034", "text": "def create\n @step = Step.new(step_params)\n @step.save\n render json: @step\n end", "title": "" }, { "docid": "9bad38af1fbd083d9685edba255630b2", "score": "0.5145869", "text": "def create\n @tier = Tier.new(params[:tier])\n\n respond_to do |format|\n if @tier.save\n format.html { redirect_to event_tier_path(@tier.event, @tier), notice: \"#{@tier.name} created: #{@tier.remaining_quantity} tickets added for a total of #{@tier.event.available_ticket_count} tickets still available to #{@tier.event.name}\" }\n format.json { render json: @tier, status: :created, location: @tier }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tier.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ae8c06828540b4e1b78c7de3af46a8fd", "score": "0.5145834", "text": "def create\n @lol = Lol.new(lol_params)\n\n respond_to do |format|\n if @lol.save\n format.html { redirect_to @lol, notice: 'Lol was successfully created.' }\n format.json { render :show, status: :created, location: @lol }\n else\n format.html { render :new }\n format.json { render json: @lol.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4c645982a272407e2db9a7e76813845e", "score": "0.5145158", "text": "def create\n @lot = Lot.new(lot_params)\n\n respond_to do |format|\n if @lot.save\n format.html { redirect_to @lot, notice: 'Lot criado com sucesso.' }\n format.json { render :show, status: :created, location: @lot }\n else\n format.html { render :new }\n format.json { render json: @lot.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "805168bdb3f02250679311e115b7eab1", "score": "0.51443815", "text": "def create\n @tooth = Tooth.new(params[:tooth])\n\n respond_to do |format|\n if @tooth.save\n format.html { redirect_to @tooth, notice: 'Tooth was successfully created.' }\n format.json { render json: @tooth, status: :created, location: @tooth }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tooth.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
6982cadfc9d34df4d49b8a06a515d4fa
Move file field data to keywords BY PROJECT for ANY File field (builtin or custom) and tag associated files.
[ { "docid": "8902c2fbfc3ff045628b08ef5476c7dc", "score": "0.69854355", "text": "def move_file_field_data_to_keywords_by_project(project=nil,\n target_keyword_category=nil,\n source_field=nil,\n field_separator=nil,\n batch_size=200)\n # Validate input:\n args = process_field_to_keyword_move_args('projects',\n project,\n target_keyword_category,\n source_field,\n field_separator,\n batch_size)\n\n project_found = args.container\n file_keyword_category_found = args.target_keyword_category\n source_field_found = args.source_field\n\n built_in = nil\n file_category_ids = nil\n file_ids = nil\n results = nil\n existing_keywords = nil\n existing_keyword_categories = nil\n total_file_count = 0\n total_files_updated = 0 # For better readability\n offset = 0\n iterations = 0\n limit = batch_size.to_i.abs\n op = RestOptions.new\n\n cat_id_string = ''\n query_ids = ''\n keyword_file_category_ids = ''\n \n # Check the source_field field type\n built_in = (source_field_found.built_in == '1') ? true : false\n \n # Get all the categories associated with the files in the project then using the target_keyword_category, \n # create the file keyword category in all the system categories that don't have them\n\n # Capture associated system categories\n op.add_option('limit','0')\n op.add_option('project_id',project_found.id)\n op.add_option('displayFields','id,category_id')\n\n msg = \"Retrieving files and file categories associated with project.\"\n logger.info(msg.green)\n\n # Get category ids and file ids \n results = get_files(op)\n file_category_ids = results.map { |obj| obj.category_id }.uniq\n file_ids = results.map { |obj| obj.id }\n total_file_count = file_ids.length\n\n op.clear\n \n msg = \"Total file count => #{total_file_count}\"\n logger.info(msg.green)\n\n # Get the keyword categories associated with the files in the project\n cat_id_string = file_category_ids.join(',')\n op.add_option('limit', '0')\n op.add_option('category_id', cat_id_string)\n\n existing_keyword_categories = get_keyword_categories(op)\n\n op.clear\n\n # Check if any of the file categories found in the project DO NOT CONTAIN \n # the target_keyword_category name and create it\n keyword_file_category_ids = existing_keyword_categories.map { |obj| obj.category_id.to_s }.uniq\n\n #puts keyword_file_category_ids\n \n msg = \"Detecting needed keyword categories.\"\n logger.info(msg.green)\n\n file_category_ids.each do |file_cat_id|\n \n # Look for the category id in existing keyword categories to check \n # if the file category already has the keyword category we need (target keyword category) \n unless keyword_file_category_ids.include?(file_cat_id.to_s)\n obj = KeywordCategories.new(file_keyword_category_found.name, file_cat_id)\n kwd_cat_obj = create_keyword_categories(obj, true).first\n \n unless kwd_cat_obj\n msg = \"Keyword category creation failed in #{__callee__} method.\"\n logger.error(msg.red)\n abort\n end\n\n existing_keyword_categories.push(kwd_cat_obj)\n else\n msg = \"Keyword category in category #{file_cat_id} already exists.\"\n logger.warn(msg.yellow)\n end\n\n end\n\n # Get all file keywords associated with all the file categories found in the project\n query_ids = existing_keyword_categories.map { |item| item.id }.join(',')\n \n op.add_option('keyword_category_id', query_ids)\n op.add_option('limit', '0')\n\n msg = \"Retrieving existing keywords\"\n logger.info(msg.green)\n\n existing_keywords = get_keywords(op)\n\n op.clear\n \n # Get the file count and calculate number of requests needed based on specified batch_size\n msg = \"Calulating batch size.\"\n logger.info(msg.green)\n\n if total_file_count % batch_size == 0\n iterations = total_file_count / batch_size\n else\n iterations = total_file_count / batch_size + 1 #we'll need one more iteration to grab remaining\n end\n\n # Set up loop controls\n # Create update loop using iteration limit and batch size\n iterations.times do |num|\n \n num += 1\n # More efficient than setting the offset and limit in the query\n # TO DO: Implement this in the other admin functions\n start_index = offset\n end_index = offset + limit\n ids = file_ids[start_index...end_index].join(',')\n\n op.add_option('id', ids)\n op.add_option('limit','0')\n \n # Get current batch of files => body length of response used to track total files updated\n msg = \"Batch #{num} of #{iterations} => Retrieving files.\"\n logger.info(msg.green)\n\n files = get_files(op)\n\n op.clear\n\n #puts \"File objects #{files.inspect}\"\n keywords_to_create = []\n \n msg = \"Batch #{num} of #{iterations} => Extracting Keywords from fields.\"\n logger.info(msg.green)\n\n # Iterate through the files and find the keywords that need to be created\n files.each do |file|\n #puts \"In files create keywords from field before using instance_variable_get 1\"\n field_data = nil\n field_obj_found = nil\n\n # Check if the field has any data in it\n if built_in\n field_name = source_field_found.name.downcase.gsub(' ','_')\n #puts \"Field name 1 : #{field_name}\"\n field_data = file.instance_variable_get(\"@#{field_name}\")\n field_data = field_data.strip\n next if field_data.nil? || field_data == ''\n else\n field_obj_found = file.fields.find { |f| f.id == source_field_found.id }\n if field_obj_found.nil? || field_obj_found.values.first.nil? || field_obj_found.values.first.strip == ''\n next\n end\n field_data = field_obj_found.values.first\n end\n\n # Establish link between keyword and current file\n associated_kwd_cat = existing_keyword_categories.find do |obj|\n obj.name.downcase == file_keyword_category_found.name.downcase && \n obj.category_id.to_s == file.category_id.to_s \n end\n\n unless associated_kwd_cat\n msg = \"Unable to retrieve associated keyword category!\"\n logger.fatal(msg.red)\n abort\n end\n\n # split the string using the specified separator and remove empty strings\n keywords_to_append = field_data.split(field_separator).reject { |val| val.to_s.strip.empty? }\n\n keywords_to_append.each do |val|\n\n # Check if the value exists in existing keywords\n keyword_found_in_existing = existing_keywords.find do |k|\n\n begin\n # In case we get an invalid input string like \"\\xA9\" => copyright binary representation\n # The downcase method can choke on this depending on the platform\n # It works in windows but chokes in linux and possibly mac OS\n k.name.downcase == val.downcase && k.keyword_category_id == associated_kwd_cat.id\n rescue\n k.name == val && k.keyword_category_id == associated_kwd_cat.id\n end\n\n end\n\n if !keyword_found_in_existing\n # find keyword cat id matching the category id of current file to establish the association\n #puts \"KEYWORD CATEGORIES \"\n #pp existing_keyword_categories\n obj = existing_keyword_categories.find do |item| \n item.category_id.to_s == file.category_id.to_s && \n item.name.downcase == file_keyword_category_found.name.downcase\n end\n #puts \"Existing keyword categories object\"\n #pp obj\n # Insert into keywords_to_create array\n keywords_to_create.push(Keywords.new(obj.id, val))\n\n end\n \n end\n end\n\n # Remove duplicate keywords in the same keyword category and create them\n unless keywords_to_create.empty?\n payload = keywords_to_create.uniq { |item| [item.name, item.keyword_category_id] }\n \n # Create the keywords for the current batch and set the generate objects flag to true.\n puts \"[INFO] Batch #{num} of #{iterations} => Creating Keywords.\"\n new_keywords = create_keywords(payload, true)\n\n # Append the returned keyword objects to the existing keywords array\n if new_keywords\n if new_keywords.is_a?(Array) && !new_keywords.empty? \n new_keywords.each { |item| existing_keywords.push(item) }\n else\n msg = \"An error occured creating keywords in #{__callee__}\"\n logger.error(msg.red)\n abort\n end\n end\n end\n \n # Loop though the files again and tag them with the newly created keywords.\n # This is faster than making individual requests\n msg = \"Batch #{num} of #{iterations} => Tagging files.\"\n logger.info(msg.green)\n\n files.each do | file |\n #puts \"In files tag before using instance_variable_get 2\"\n field_data = nil\n field_obj_found = nil\n\n # Look for the field and check if the field has any data in it\n if built_in\n field_name = source_field_found.name.downcase.gsub(' ','_')\n #puts \"Field name: #{field_name}\"\n field_data = file.instance_variable_get(\"@#{field_name}\")\n field_data = field_data.strip\n #puts \"Field value: #{field_data}\"\n next if field_data.nil? || field_data == ''\n else\n field_obj_found = file.fields.find { |f| f.id.to_s == source_field_found.id.to_s }\n if field_obj_found.nil? || field_obj_found.values.first.nil? || field_obj_found.values.first.strip == ''\n next\n end\n field_data = field_obj_found.values.first\n end\n\n if field_data\n \n # Remove empty strings\n keywords = field_data.split(field_separator).reject { |val| val.to_s.strip.empty? }\n\n\n # ESTABLISH LINK BETWEEN FILE AND KEYWORD\n associated_kwd_cat = existing_keyword_categories.find do |item|\n item.name.downcase == file_keyword_category_found.name.downcase &&\n item.category_id.to_s == file.category_id.to_s\n end\n\n unless associated_kwd_cat\n msg = \"Existing keyword category retrieval failure in #{__callee__}\"\n logger.fatal(msg.red)\n abort\n end\n\n # Loop through the keywords and tag the file\n keywords.each do |value|\n # Trim leading & trailing whitespace\n value = value.strip\n # Find the string in existing keywords\n keyword_obj = existing_keywords.find do |item| \n begin\n item.name.downcase == value.downcase && associated_kwd_cat.id.to_s == item.keyword_category_id.to_s\n rescue\n item.name == value && \n associated_kwd_cat.id.to_s == item.keyword_category_id.to_s\n end\n\n end\n\n if keyword_obj\n # check if current file is already tagged\n already_tagged = file.keywords.find { |item| item.to_s == keyword_obj.id.to_s }\n # Tag the file\n file.keywords.push(NestedKeywordItems.new(keyword_obj.id)) unless already_tagged\n else\n msg = \"Unable to retrieve previously created keyword! => #{value}\"\n logger.fatal(msg.red)\n abort\n end\n \n end\n \n end\n end\n\n msg = \"Batch #{num} of #{iterations} => Attempting to perform file updates.\"\n logger.info(msg.white)\n\n # Update files\n updated_obj_count = run_smart_update(files,total_files_updated)\n\n total_files_updated += updated_obj_count\n\n offset += limit\n end \n end", "title": "" } ]
[ { "docid": "f584761abfa0f149042e6706e42e2031", "score": "0.6275192", "text": "def move_file_keywords_to_field_by_project(project,\n keyword_category,\n target_field,\n field_separator,\n insert_mode=nil,\n batch_size=200)\n # Validate input\n args = process_field_to_keyword_move_args('projects',\n project,\n keyword_category,\n target_field,\n field_separator,\n batch_size,\n true)\n\n file_keyword_categories_found = \n (args.target_keyword_category.is_a?(Array)) ? args.target_keyword_category : [args.target_keyword_category]\n project_found = args.container\n target_field_found = args.source_field\n\n file_keyword_category_ids = nil\n built_in = nil\n file_ids = nil\n keywords = []\n files = []\n total_file_count = 0\n total_files_updated = 0 # For better readability\n offset = 0\n iterations = 0\n limit = batch_size.to_i.abs\n op = RestOptions.new\n\n # Validate insert mode and warn user of restricted field type\n if RESTRICTED_LIST_FIELD_TYPES.include?(target_field_found.field_display_type)\n answer = nil\n error = \"\\nInvalid input. Please enter \\\"yes\\\" or \\\"no\\\".\\n> \"\n message = \"Warning: You are inserting keywords into a restricted field type. \" +\n \"\\n Project keywords are sorted in alphabetical order. \" +\n \"\\n All file keywords will be created as options but only the first one will be displayed in the field.\" +\n \"\\nContinue? (Yes/no)\\n> \"\n\n print message\n\n while answer != 'yes' && answer != 'no'\n\n print error unless answer.nil?\n\n answer = gets.chomp.to_s.downcase\n\n abort(\"You entered #{answer.inspect}. Exiting.\\n\\n\") if answer.downcase == 'no' || answer == 'n'\n\n break if answer == 'yes' || answer == 'y'\n\n end \n \n end\n\n unless ['append','overwrite'].include?(insert_mode.to_s)\n msg = \"Argument Error: Expected \\\"append\\\" or \\\"overwrite\\\" for fourth argument \\\"insert_mode\\\" in #{__callee__}. \" +\n \"Instead got #{insert_mode.inspect}\"\n logger.error(msg.red)\n abort\n end\n\n # Check the source_field field type\n built_in = (target_field_found.built_in == '1') ? true : false\n\n # Get keywords\n msg = \"Retrieving keywords for keyword category => #{file_keyword_categories_found.first.name.inspect}.\"\n logger.info(msg.green)\n\n file_keyword_category_ids = file_keyword_categories_found.map(&:id).join(',')\n op.add_option('limit','0')\n op.add_option('keyword_category_id',file_keyword_category_ids)\n\n keywords = get_keywords(op)\n\n if keywords.empty?\n msg = \"No keywords found in keyword category => #{file_keyword_categories_found.first.name.inspect}.\"\n logger.error(msg.red) \n abort\n end\n\n op.clear\n \n # Get file ids\n msg = \"Retrieving file ids in project => #{project_found.name.inspect}.\"\n logger.info(msg.green)\n \n op.add_option('limit','0')\n op.add_option('displayFields','id')\n op.add_option('project_id',\"#{project_found.id}\") # Returns files in specified project\n\n files = get_files(op)\n\n op.clear\n\n if files.empty?\n msg = \"Project #{project_found.name.inspect} with id #{project_found.id.inspect} is empty.\"\n logger.error(msg.red)\n abort\n end\n\n # Extract file ids\n file_ids = files.map { |obj| obj.id.to_s }\n\n # Prep iterations loop\n total_file_count = file_ids.length\n\n msg = \"Calculating batch size.\"\n logger.info(msg.green)\n\n if total_file_count % batch_size == 0\n iterations = total_file_count / batch_size\n else\n iterations = total_file_count / batch_size + 1\n end\n\n iterations.times do |num|\n\n num += 1\n\n start_index = offset\n end_index = limit\n ids = file_ids[start_index...end_index].join(',')\n\n msg = \"Batch #{num} of #{iterations} => Retrieving files.\"\n logger.info(msg.green)\n\n op.add_option('limit','0')\n op.add_option('id',ids)\n\n # Get current batch of files\n files = get_files(op)\n\n # Move the file keywords to specified field\n processed_files = move_keywords_to_fields(files,keywords,target_field_found,field_separator,insert_mode)\n\n # Perform file update\n msg = \"Batch #{num} of #{iterations} => Attempting to perform file updates.\"\n logger.info(msg.white)\n\n updated_obj_count = run_smart_update(files,total_files_updated)\n\n total_files_updated += updated_obj_count\n\n offset += limit\n end\n\n end", "title": "" }, { "docid": "a6a96a64abef9dbd7386affc9c0eaf7d", "score": "0.5962434", "text": "def move_file_field_data_to_keywords_by_album(album=nil,\n target_keyword_category=nil,\n source_field=nil,\n field_separator=nil,\n batch_size=200)\n \n # Validate input:\n args = process_field_to_keyword_move_args('albums',\n album,\n target_keyword_category,\n source_field,\n field_separator,\n batch_size)\n\n album_found = args.container\n file_keyword_category_found = args.target_keyword_category\n source_field_found = args.source_field\n\n total_file_count = nil\n built_in = nil\n file_ids = nil\n file_category_ids = nil\n keyword_file_category_ids = nil\n existing_keyword_categories = nil\n existing_keywords = nil\n cat_id_string = nil\n batch_size = batch_size.to_i.abs\n\n limit = batch_size # For better readability\n total_files_updated = 0\n offset = 0\n iterations = 0\n files = []\n\n op = RestOptions.new\n\n # Get total file count\n total_file_count = album_found.files.length\n \n # Check the source_field field type\n built_in = (source_field_found.built_in == '1') ? true : false\n\n # Get all the categories associated with the files in the project then using the target_keyword_category, \n # create the file keyword category in all the system categories that don't have them\n file_ids = album_found.files.map { |obj| obj.id }\n\n op.add_option('limit','0')\n op.add_option('id', file_ids.join(',')) #create query string from file id array\n op.add_option('displayFields','category_id')\n\n # Get categories found in album\n file_category_ids = get_files(op).uniq { |obj| obj.category_id }.map { |obj| obj.category_id.to_s }\n\n op.clear\n\n # Get the keyword categories associated with the files in the album\n cat_id_string = file_category_ids.join(',')\n op.add_option('limit', '0')\n op.add_option('category_id', cat_id_string)\n existing_keyword_categories = get_keyword_categories(op)\n \n op.clear\n\n # Check if any of the system categories found in the album DO NOT CONTAIN \n # the target_keyword_category name and create it\n keyword_file_category_ids = existing_keyword_categories.reject do |obj| \n obj.name.downcase != file_keyword_category_found.name \n end.map do |obj| \n obj.category_id.to_s \n end.uniq\n\n # Make sure the keyword category is in all associated categories\n # Now loop throught the file categories, create the needed keyword categories for referencing below\n msg = \"Creating keyword categories.\"\n logger.info(msg.green)\n\n file_category_ids.each do |file_cat_id|\n \n # Look for the category id in existing keyword categories to check \n # if the file category already has a keyword category with that name\n unless keyword_file_category_ids.include?(file_cat_id.to_s)\n msg = \"Actually creating keyword categories...\"\n logger.info(msg.green)\n\n obj = KeywordCategories.new(file_keyword_category_found.name, file_cat_id)\n kwd_cat_obj = create_keyword_categories(obj, true).first\n \n unless kwd_cat_obj\n msg = \"Error creating keyword category in #{__callee__}\"\n logger.error(msg.red)\n abort\n end\n \n existing_keyword_categories.push(kwd_cat_obj)\n \n else\n msg = \"Keyword category in category #{file_cat_id} already exists\"\n logger.warn(msg.yellow)\n end\n\n end\n\n \n # Get all file keywords for the keyword category name associated with all the file categories found in the album\n query_ids = existing_keyword_categories.map { |item| item.id }.join(',')\n \n op.add_option('keyword_category_id', query_ids)\n op.add_option('limit', '0')\n\n msg = \"Getting existing keywords\"\n logger.info(msg.green)\n\n existing_keywords = get_keywords(op)\n\n op.clear\n \n # Calculate number of requests needed based on specified batch_size\n msg = \"Setting batch size.\"\n logger.info(msg.green)\n\n if total_file_count % batch_size == 0\n iterations = total_file_count / batch_size\n else\n iterations = total_file_count / batch_size + 1 #we'll need one more iteration to grab remaining\n end\n\n # Create update loop using iteration limit and batch size\n iterations.times do |num|\n\n num += 1\n \n # More efficient than setting the offset and limit in the query\n start_index = offset\n end_index = offset + limit\n ids = file_ids[start_index...end_index].join(',')\n\n op.add_option('id', ids)\n \n # Get current batch of files => body length used to track total files updated\n msg = \"Batch #{num} of #{iterations} => Retrieving files.\"\n logger.info(msg.green)\n\n files = get_files(op)\n\n op.clear\n\n msg = \"Batch #{num} of #{iterations} => Extracting keywords from \\\"#{source_field_found.name}\\\" field.\"\n logger.info(msg)\n\n keywords_to_create = []\n \n # Iterate through the files and find the keywords that need to be created\n files.each do |file|\n \n field_data = nil\n field_obj_found = nil\n\n # Check if the field has any data in it\n if built_in\n field_name = source_field_found.name.downcase.gsub(' ','_')\n #puts \"Field name 1 : #{field_name}\"\n field_data = file.instance_variable_get(\"@#{field_name}\")\n field_data = field_data.strip # In case a bunch of spaces are stored in the field\n next if field_data.nil? || field_data == ''\n else\n field_obj_found = file.fields.find { |f| f.id == source_field_found.id }\n if field_obj_found.nil? || field_obj_found.values.first.nil? || field_obj_found.values.first.strip == ''\n next\n end\n field_data = field_obj_found.values.first\n end\n\n # Split the string using the specified separator and remove empty strings\n keywords_to_append = field_data.split(field_separator).reject { |val| val.to_s.strip.empty? }\n\n # establish link between keyword and current file\n associated_kwd_cat = existing_keyword_categories.find do |obj| \n \n obj.name.downcase == file_keyword_category_found.name.downcase && \n obj.category_id.to_s == file.category_id.to_s\n \n end \n\n keywords_to_append.each do |val|\n \n val = val.strip\n\n # Check if the value exists in existing keywords\n keyword_found_in_existing = existing_keywords.find do |k|\n \n # Match the existing keywords check by the name and the category\n # id of the current file to establish the the link between the two\n\n begin\n # In case we get an invalid input string like \"\\xA9\" => copyright binary representation\n # The downcase method can choke on this depending on the platform\n # It works in windows but chokes in linux and possibly mac OS\n k.name.downcase == val.downcase && k.keyword_category_id == associated_kwd_cat.id\n rescue\n k.name == val && k.keyword_category_id == associated_kwd_cat.id\n end\n end \n\n if !keyword_found_in_existing\n\n # Insert into keywords_to_create array\n obj = Keywords.new(associated_kwd_cat.id, val)\n keywords_to_create.push(obj)\n \n end\n end\n end \n \n # Remove duplicate keywords in the same keyword category and create them\n unless keywords_to_create.empty?\n payload = keywords_to_create.uniq { |item| [item.name, item.keyword_category_id] }\n \n # Create the keywords for the current batch and set the generate objects flag to true.\n msg = \"Batch #{num} of #{iterations} => creating keywords.\"\n logger.info(msg.green)\n\n new_keywords = create_keywords(payload, true)\n # Append the returned keyword objects to the existing keywords array\n if new_keywords\n if new_keywords.is_a?(Array) && !new_keywords.empty? \n new_keywords.each { |item| existing_keywords.push(item) }\n else\n msg = \"An error occured creating keywords in #{__callee__}\"\n logger.error(msg.red)\n abort\n end\n end\n end\n\n # Loop though the files again and tag them with the newly created keywords.\n # This is faster than making individual requests\n msg = \"Batch #{num} of #{iterations} => Tagging files with keywords.\"\n logger.info(msg.green)\n\n files.each do | file |\n #puts \"In files tag before using instance_variable_get 2\"\n field_data = nil\n\n # Look for the field and check if the field has any data in it\n if built_in\n field_name = source_field_found.name.downcase.gsub(' ','_')\n field_data = file.instance_variable_get(\"@#{field_name}\")\n field_data = field_data.strip\n next if field_data.nil? || field_data == ''\n else\n field_obj_found = file.fields.find { |f| f.id.to_s == source_field_found.id.to_s }\n if field_obj_found.nil? || field_obj_found.values.first.nil? || field_obj_found.values.first.strip == ''\n next\n end\n field_data = field_obj_found.values.first\n end\n\n if field_data\n \n # Split the string using the specified separator and remove empty strings\n keywords = field_data.split(field_separator).reject { |val| val.to_s.strip.empty? }\n\n # ESTABLISH LINK BETWEEN FILE AND KEYWORD\n associated_kwd_cat = existing_keyword_categories.find do |item|\n item.name.downcase == file_keyword_category_found.name.downcase &&\n item.category_id.to_s == file.category_id.to_s\n end\n\n unless associated_kwd_cat\n msg = \"Associated keyword category retrieval failed in #{__callee__}\"\n logger.fatal(msg.red)\n abort\n end\n\n # Loop through the keywords and tag the file\n keywords.each do |value|\n # Trim leading & trailing whitespace\n value = value.strip\n # Find the string in existing keywords\n keyword_obj = existing_keywords.find do |item| \n begin\n \n item.name.downcase == value.downcase && associated_kwd_cat.id.to_s == item.keyword_category_id.to_s\n \n rescue\n item.name == value && associated_kwd_cat.id.to_s == item.keyword_category_id.to_s\n end\n end\n\n if keyword_obj\n #check if current file is already tagged\n already_tagged = file.keywords.find { |item| item.id.to_s == keyword_obj.id.to_s }\n # Tag the file\n unless already_tagged\n msg = \"Tagging #{file.filename.inspect} => #{keyword_obj.name}\"\n logger.info(msg.green)\n\n file.keywords.push(NestedKeywordItems.new(keyword_obj.id))\n end \n else\n msg = \"Unable to retrieve previously created keyword! => #{value}\"\n logger.fatal(msg.red)\n abort\n end\n \n end\n \n end\n end\n\n msg = \"Batch #{num} of #{iterations} => Attempting to perform file updates.\"\n logger.info(msg.white)\n\n # Update files\n updated_obj_count = run_smart_update(files,total_files_updated)\n\n total_files_updated += updated_obj_count\n\n offset += limit\n end \n end", "title": "" }, { "docid": "b3855694d34992fc87bf49e8cbefd1c9", "score": "0.5666987", "text": "def file_custom_fields\n group_custom_fields 'file'\n end", "title": "" }, { "docid": "b3855694d34992fc87bf49e8cbefd1c9", "score": "0.5666987", "text": "def file_custom_fields\n group_custom_fields 'file'\n end", "title": "" }, { "docid": "28983cdd6edf74eaa6bd211b65c46cc0", "score": "0.5541781", "text": "def move_file_keywords_to_field_by_album(album,\n keyword_category,\n target_field,\n field_separator,\n insert_mode=nil,\n batch_size=200)\n\n # Validate input\n args = process_field_to_keyword_move_args('albums',\n album,\n keyword_category,\n target_field,\n field_separator,\n batch_size,\n true)\n\n \n \n file_keyword_categories_found = \n (args.target_keyword_category.is_a?(Array)) ? args.target_keyword_category : [args.target_keyword_category]\n\n target_field_found = args.source_field\n album_found = args.container\n\n built_in = nil\n file_ids = nil\n file_keyword_ids = []\n file_keyword_category_ids = []\n keywords = []\n files = []\n processed_files = []\n total_file_count = 0\n total_files_updated = 0 # For better readability\n offset = 0\n iterations = 0\n limit = batch_size.to_i.abs \n op = RestOptions.new\n\n # Validate insert mode and warn user of restricted field type\n if RESTRICTED_LIST_FIELD_TYPES.include?(target_field_found.field_display_type)\n answer = nil\n error = \"\\nInvalid input. Please enter \\\"yes\\\" or \\\"no\\\".\\n> \"\n message = \"Warning: You are inserting keywords into a restricted field type. \" +\n \"\\n Project keywords are sorted in alphabetical order. \" +\n \"\\n All file keywords will be created as options but only the first one will be displayed in the field.\" +\n \"\\nContinue? (Yes/no)\\n> \"\n\n print message\n\n while answer != 'yes' && answer != 'no'\n\n print error unless answer.nil?\n\n answer = gets.chomp.to_s.downcase\n\n abort(\"You entered #{answer.inspect}. Exiting.\\n\\n\") if answer.downcase == 'no' || answer == 'n'\n\n break if answer == 'yes' || answer == 'y'\n\n end \n \n end\n\n unless ['append','overwrite'].include?(insert_mode.to_s)\n msg = \"Argument Error: Expected \\\"append\\\" or \\\"overwrite\\\" for fourth argument \\\"insert_mode\\\" in #{__callee__}. \" +\n \"Instead got #{insert_mode.inspect}\"\n logger.error(msg.red)\n abort\n end\n \n # Get keywords\n msg = \"Retrieving keywords for keyword category => #{file_keyword_categories_found.first.name.inspect}.\"\n logger.info(msg.green)\n \n file_keyword_category_ids = file_keyword_categories_found.map(&:id)\n\n op.add_option('limit','0')\n op.add_option('keyword_category_id',file_keyword_category_ids.join(','))\n\n keywords = get_keywords(op)\n\n if keywords.empty?\n msg = \"No keywords found in keyword category => #{file_keyword_category_found.name.inspect} \" +\n \"with id #{file_keyword_category_found.id.inspect}\"\n logger.error(msg.red)\n abort\n end\n\n file_keyword_ids = keywords.map(&:id)\n\n op.clear\n\n # Get file ids\n msg = \"Retrieving file ids in album #{album_found.name.inspect}.\"\n logger.info(msg.green)\n\n file_ids = album_found.files.map { |obj| obj.id.to_s }\n\n msg = \"Calculating batch size.\"\n logger.info(msg.green)\n\n total_file_count = file_ids.length\n\n if total_file_count.zero?\n msg = \"No files found in album #{album_found.name.inspect} with id #{album_found.id.inspect}.\"\n logger.error(msg.red)\n abort\n end\n\n # Set up iterations loop\n if total_file_count % batch_size == 0\n iterations = total_file_count / batch_size\n else\n iterations = total_file_count / batch_size + 1 # To grab remaining\n end\n\n iterations.times do |num|\n\n num += 1\n\n # Get file batch\n start_index = offset\n end_index = offset + limit\n ids = file_ids[start_index...end_index].join(',')\n\n msg = \"Batch #{num} of #{iterations} => Retrieving files.\"\n logger.info(msg.green)\n\n op.add_option('limit','0')\n op.add_option('id',ids)\n\n files = get_files(op)\n\n # Move the keywords\n processed_files = move_keywords_to_fields(files,keywords,target_field_found,field_separator,insert_mode)\n\n # Perform file update\n msg = \"Batch #{num} of #{iterations} => Attempting to perform file updates.\"\n logger.info(msg.white)\n\n updated_obj_count = run_smart_update(processed_files,total_files_updated)\n\n total_files_updated += updated_obj_count\n\n offset += limit\n\n end\n \n end", "title": "" }, { "docid": "7baba36ed84f1c01cc39a9d0a5da52e9", "score": "0.5501067", "text": "def replace_keywords(in_file_list)\n in_file_list .each{|src_file_and_mode|\n src_file, mode = src_file_and_mode .split(':')\n dst_file = src_file .sub(/\\.in$/, '')\n print \"creating #{dst_file} ...\"\n replace_keywords1(src_file, dst_file , @macros, mode .oct)\n print \"done.\\n\"\n }\n end", "title": "" }, { "docid": "70dde7c2d3812e29ec99072d10caa223", "score": "0.549273", "text": "def transform_files\n extract\n reorder_files\n transform @attendance_file, 'att' unless @attendance_file.blank?\n transform @enroll_file, 'enroll' unless @enroll_file.blank?\n transform @ili_file, 'ili' unless @ili_file.blank?\n end", "title": "" }, { "docid": "e7f0ea97cda94ba88899c3df0a1407dc", "score": "0.54883844", "text": "def move_file_field_data_to_keywords_by_category(category=nil,\n target_keyword_category=nil,\n source_field=nil,\n field_separator=nil,\n batch_size=200)\n \n # Validate input:\n args = process_field_to_keyword_move_args('categories',\n category,\n target_keyword_category,\n source_field,\n field_separator,\n batch_size)\n \n category_found = args.container\n file_keyword_category_found = args.target_keyword_category\n source_field_found = args.source_field\n\n built_in = nil\n total_file_count = nil\n existing_keywords = nil\n batch_size = batch_size.to_i.abs\n iterations = 0\n offset = 0\n limit = batch_size # For better readability\n total_files_updated = 0\n file_ids = nil\n op = RestOptions.new\n\n if file_keyword_category_found.category_id != category_found.id\n msg = \"Specified keyword category #{file_keyword_category_found.name.inspect} \" +\n \"with id #{file_keyword_category_found.id.inspect} not found in #{category_found.name.inspect}.\"\n logger.error(msg.red)\n abort\n end\n\n # Get ids and total file count for the category\n op.add_option('category_id', category_found.id)\n op.add_option('displayFields', 'id')\n op.add_option('limit','0')\n file_ids = get_files(op).map { |obj| obj.id.to_s }\n total_file_count = file_ids.length\n\n msg = \"Total file count => #{total_file_count}\"\n logger.info(msg.green)\n\n op.clear \n\n # Check field type\n built_in = (source_field_found.built_in == '1') ? true : false\n\n # Get all file keywords in the specified keyword category\n op.add_option('keyword_category_id', file_keyword_category_found.id)\n op.add_option('limit', '0')\n existing_keywords = get_keywords(op)\n\n op.clear\n\n # Calculate number of requests needed based on specified batch_size\n if total_file_count % batch_size == 0\n iterations = total_file_count / batch_size\n else\n iterations = total_file_count / batch_size + 1 #we'll need one more iteration to grab remaining\n end\n\n # Create update loop using iteration limit and batch size\n iterations.times do |num|\n\n num += 1\n\n # More efficient than setting the offset and limit in the query\n start_index = offset\n end_index = offset + limit\n ids = file_ids[start_index...end_index].join(',')\n \n op.add_option('id',ids)\n op.add_option('limit','0')\n # Get current batch of files\n msg = \"[INFO] Batch #{num} of #{iterations} => Retrieving files.\"\n logger.info(msg.green)\n\n files = get_files(op)\n \n op.clear\n\n keywords_to_create = []\n \n msg = \"Batch #{num} of #{iterations} => Extracting keywords from #{source_field_found.name.inspect} field.\"\n logger.info(msg.green)\n\n # Iterate through the files and find the keywords that need to be created\n files.each do |file|\n \n field_data = nil\n \n # Look for the field and check if it has any data in it\n if built_in\n field_name = source_field_found.name.downcase.gsub(' ','_')\n field_data = file.instance_variable_get(\"@#{field_name}\")\n field_data = field_data.strip\n next if field_data.nil? || field_data == ''\n else\n field_obj_found = file.fields.find { |f| f.id.to_s == source_field_found.id.to_s }\n if field_obj_found.nil? || field_obj_found.values.first.nil? || field_obj_found.values.first.strip == ''\n next\n end\n field_data = field_obj_found.values.first\n end\n\n # Split the string using the specified separator and remove empty strings\n keywords_to_append = field_data.split(field_separator).reject { |val| val.to_s.strip.empty? }\n\n keywords_to_append.each do |val|\n\n # Remove leading and trailing white space\n val = val.strip\n\n # Check if the value exists in existing keywords\n keyword_found_in_existing = existing_keywords.find do |k|\n begin \n k.name.downcase == val.downcase \n rescue\n k.name == val\n end\n end\n\n unless keyword_found_in_existing\n # Populate list of keywords that need to be created\n keywords_to_create.push(Keywords.new(file_keyword_category_found.id, val))\n end\n \n end\n \n end\n \n msg = \"Batch #{num} of #{iterations} => Creating keywords.\"\n logger.info(msg.green)\n\n # Remove duplicate keywords => just in case\n unless keywords_to_create.empty?\n \n payload = keywords_to_create.uniq { |item| item.name }\n # Create the keywords for the current batch and set the generate objects flag to true.\n new_keywords = create_keywords(payload, true)\n\n # Append the returned keyword objects to the existing keywords array\n if new_keywords\n if new_keywords.is_a?(Array) && !new_keywords.empty?\n new_keywords.each { |item| existing_keywords.push(item) }\n else\n msg = \"An error occured creating keywords in #{__callee__}\"\n logger.error(msg.red)\n abort\n end\n end\n end\n\n msg = \"Batch #{num} of #{iterations} => Tagging files.\"\n logger.info(msg.green)\n\n # Loop though the files again and tag them with the newly created keywords.\n files.each do | file |\n\n field_data = nil\n\n #9. Look for the field and check if the field has any data in it\n if built_in\n field_name = source_field_found.name.downcase.gsub(' ','_')\n field_data = file.instance_variable_get(\"@#{field_name}\")\n field_data = field_data.strip\n next if field_data.nil? || field_data == ''\n else\n field_obj_found = file.fields.find { |f| f.id.to_s == source_field_found.id.to_s }\n if field_obj_found.nil? || field_obj_found.values.first.nil? || field_obj_found.values.first.strip == ''\n next\n end\n field_data = field_obj_found.values.first\n end\n\n if field_data\n \n # Remove empty strings\n keywords = field_data.split(field_separator).reject { |val| val.to_s.strip.empty? }\n\n # Loop through the keywords and tag the file\n keywords.each do |value|\n # Trim leading & trailing whitespace\n value = value.strip\n #find the string in existing keywords\n keyword_obj = existing_keywords.find do |item| \n begin\n item.name.downcase == value.downcase \n rescue\n item.name == value \n end\n\n end\n\n if keyword_obj\n #check if current file is already tagged\n already_tagged = file.keywords.find { |item| item.id.to_s == keyword_obj.id.to_s }\n # Tag the file\n unless already_tagged\n msg = \"Tagging file #{file.filename.inspect} => #{keyword_obj.name.inspect}\"\n logger.info(msg.green)\n file.keywords.push(NestedKeywordItems.new(keyword_obj.id))\n end\n else\n msg = \"Unable to retrieve previously created keyword in #{__callee__}\"\n logger.fatal(msg.red)\n abort\n end \n end \n end\n end\n\n msg = \"Batch #{num} of #{iterations} => Attempting to perform file updates.\"\n logger.info(msg.white)\n\n # Update files\n updated_obj_count = run_smart_update(files,total_files_updated)\n\n total_files_updated += updated_obj_count\n\n offset += limit\n end \n end", "title": "" }, { "docid": "df3d80c9eee3e2a6ed99279a28583561", "score": "0.5475979", "text": "def move_project_field_data_to_keywords(target_project_keyword_category=nil,\n project_field=nil,\n field_separator=nil,\n batch_size=200)\n\n project_ids = nil\n project_field_found = nil\n built_in = nil\n project_keyword_category_found = nil\n projects = []\n existing_project_keywords = []\n total_project_count = 0\n iterations = 0\n offset = 0\n total_projects_updated = 0\n batch_size = batch_size.to_i.abs\n limit = batch_size\n nested_proj_keyword = Struct.new(:id)\n op = RestOptions.new\n\n # Validate input:\n \n # Retrieve project keyword category\n if target_project_keyword_category.is_a?(ProjectKeywordCategories) && # Object\n !target_project_keyword_category.id.nil?\n\n op.add_option('id',target_project_keyword_category.id)\n project_keyword_category_found = get_project_keyword_categories(op).first\n\n elsif (target_project_keyword_category.is_a?(String) && target_project_keyword_category.to_i > 0) || # Id\n (target_project_keyword_category.is_a?(Integer) && !target_project_keyword_category.zero?)\n\n op.add_option('id',target_project_keyword_category)\n project_keyword_category_found = get_project_keyword_categories(op).first\n\n elsif target_project_keyword_category.is_a?(String) # Name\n\n op.add_option('name',target_project_keyword_category)\n op.add_option('textMatching','exact')\n project_keyword_category_found = get_project_keyword_categories(op)\n\n unless project_keyword_category_found\n msg = \"Project keyword category with name #{target_project_keyword_category.inspect} not found in OpenAsset.\"\n logger.error(msg.red)\n abort\n end\n\n if project_keyword_category_found.length > 1\n msg = \"Error: Multiple Project keyword categories found with search query #{op.get_options.inspect}.\" +\n \" Specify an id instead.\"\n logger.error(msg.red)\n abort\n else\n project_keyword_category_found = project_keyword_category_found.first\n end\n\n else\n msg = \"Argument Error: Expected one of the following: \" +\n \"\\n 1. Valid project keyword category object.\" +\n \"\\n 2. Project keyword category id.\" +\n \"\\n 3. Project keyword category name.\" +\n \"\\nfor first argument in #{__callee__} method.\" +\n \"\\nInstead got #{target_project_keyword_category.inspect}.\"\n logger.error(msg.red)\n abort\n end\n\n # Make sure it's a project keyword catgory\n unless project_keyword_category_found.is_a?(ProjectKeywordCategories)\n msg = \"Error: Specified Project keyword category named #{project_keyword_category_found.name.inspect} with id \" +\n \"#{project_keyword_category_found.id.inspect} is actually a #{project_keyword_category_found.class.inspect}.\"\n logger.error(msg.red)\n abort\n end\n\n op.clear\n\n # Retrieve project field\n if project_field.is_a?(Fields) && !project_field.id.nil?# Object\n\n op.add_option('id',project_field.id)\n project_field_found = get_fields(op).first\n\n unless project_field_found\n msg = \"Field with id #{project_field.id.inspect} not found in OpenAsset.\"\n logger.error(msg.red)\n abort\n end\n\n elsif (project_field.is_a?(String) && !project_field.to_i.zero?) || # Id\n (project_field.is_a?(Integer) && !project_field.zero?)\n\n op.add_option('id',project_field)\n project_field_found = get_fields(op).first\n\n unless project_field_found\n msg = \"Field with id #{project_field.inspect} not found in OpenAsset.\"\n logger.error(msg.red)\n abort\n end\n\n elsif project_field.is_a?(String) # Name\n\n op.add_option('name',project_field)\n op.add_option('textMatching','exact')\n project_field_found = get_fields(op)\n\n unless project_field_found\n msg = \"Field with name #{project_field.inspect} not found in OpenAsset.\"\n logger.error(msg.red)\n abort\n end\n\n if project_field_found.length > 1\n msg = \"Error: Multiple fields found with name #{project_field.inspect}. Specify an id instead.\"\n logger.error(msg.red)\n abort\n else\n project_field_found = project_field_found.first\n end\n else \n msg = \"Error: Expected one of the following: \" +\n \"\\n 1. Valid Fields object.\" +\n \"\\n 2. Field id.\"\n \"\\n 3. Field name.\"\n \"\\nfor second argument in #{__callee__} method.\" +\n \"\\nInstead got #{project_field.inspect}.\"\n logger.error(msg.red)\n abort\n end\n\n # Make sure it's a project field\n unless project_field_found.field_type == 'project'\n msg = \"Error: Specified field #{project_field_found.name.inspect} with id \" +\n \"#{project_field_found.id.inspect} is not a project field\"\n logger.error(msg.red)\n abort\n end\n\n built_in = (project_field_found.built_in == '1') ? true : false \n\n if field_separator.nil?\n msg = \"You Must specify field separator.\"\n logger.error(msg.red)\n abort\n end\n\n if batch_size.zero?\n msg = \"Invalid batch size. Specify a positive numeric value or use default value of 200.\"\n logger.error(msg.red)\n abort\n end\n\n op.clear\n\n # Get projects keywords\n msg = \"Retrieving project keywords.\"\n logger.info(msg.green)\n\n op.add_option('limit','0')\n op.add_option('project_keyword_category_id',project_keyword_category_found.id)\n\n existing_project_keywords = get_project_keywords(op)\n \n op.clear\n\n op.add_option('limit','0')\n op.add_option('displayFields','id')\n\n project_ids = get_projects(op).map { |obj| obj.id.to_s }\n\n if project_ids.length.zero?\n msg = \"No Projects found in OpenAsset!\"\n logger.error(msg.red)\n abort\n end\n\n op.clear\n\n total_project_count = project_ids.length\n\n # Set up iterations loop\n msg = \"Calculating batch size\"\n logger.info(msg.green)\n\n if total_project_count % batch_size == 0\n iterations = total_project_count / batch_size\n else\n iterations = total_project_count / batch_size + 1 # To grab remaining\n end\n\n iterations.times do |num|\n\n num += 1\n\n start_index = offset\n end_index = offset + limit\n ids = project_ids[start_index...end_index].join(',')\n\n op.add_option('limit','0')\n op.add_option('id',ids)\n\n msg = \"Batch #{num} of #{iterations} => Retrieving projects.\"\n logger.info(msg.green)\n\n projects = get_projects(op)\n\n op.clear\n\n if projects.empty?\n msg = \"Project retrieval failure in #{__callee__} method.\"\n logger.fatal(msg.red)\n abort\n end\n\n keywords_to_create = []\n \n msg = \"Batch #{num} of #{iterations} => Extracting Keywords from field.\"\n logger.info(msg.green)\n\n # Iterate through the projects and find the project keywords that need to be created\n projects.each do |project|\n #puts \"In files create keywords from field before using instance_variable_get 1\"\n field_data = nil\n field_obj_found = nil\n\n # Check if the field has any data in it\n if built_in\n field_name = project_field_found.name.downcase.gsub(' ','_')\n #puts \"Field name 1 : #{field_name}\"\n field_data = project.instance_variable_get(\"@#{field_name}\")\n field_data = field_data.strip\n next if field_data.nil? || field_data == ''\n else\n field_obj_found = project.fields.find { |f| f.id == project_field_found.id }\n if field_obj_found.nil? || field_obj_found.values.first.nil? || field_obj_found.values.first.strip == ''\n next\n end\n field_data = field_obj_found.values.first\n end\n\n # split the string using the specified separator and remove empty strings\n project_keywords_to_append = field_data.split(field_separator).reject { |val| val.to_s.strip.empty? }\n\n project_keywords_to_append.each do |val|\n \n val = val.strip\n # Check if the value exists in existing keywords\n keyword = existing_project_keywords.find do |k|\n\n begin\n # In case we get an invalid input string like \"\\xA9\" => copyright binary representation\n # The downcase method can choke on this depending on the platform\n # It works in windows but chokes in linux and possibly mac OS\n k.name.downcase == val.downcase \n rescue\n k.name == val \n end\n\n end\n\n unless keyword\n # Insert into keywords_to_create array\n keywords_to_create.push(ProjectKeywords.new(val,project_keyword_category_found.id))\n end\n \n end\n end\n\n # Remove entries with the same name then create new keywords\n unless keywords_to_create.empty?\n\n payload = keywords_to_create.uniq { |item| item.name }\n \n # Create the project keywords for the current batch and set the generate objects flag to true.\n msg = \"Batch #{num} of #{iterations} => Creating Project Keywords.\"\n logger.info(msg.green)\n\n new_keywords = create_project_keywords(payload, true)\n\n # Append the returned project keyword objects to the existing keywords array\n if new_keywords \n new_keywords.each { |item| existing_project_keywords.push(item) }\n end\n \n end\n \n # Loop though the projects again and tag them with the newly created project keywords.\n # This is faster than making individual requests\n msg = \"Batch #{num} of #{iterations} => Tagging Projects.\"\n logger.info(msg.green)\n\n projects.each do |project|\n \n field_data = nil\n field_obj_found = nil\n\n # Look for the field and check if the field has any data in it\n if built_in\n field_name = project_field_found.name.downcase.gsub(' ','_')\n #puts \"Field name: #{field_name}\"\n field_data = project.instance_variable_get(\"@#{field_name}\")\n field_data = field_data.strip\n #puts \"Field value: #{field_data}\"\n next if field_data.nil? || field_data == ''\n else\n field_obj_found = project.fields.find { |f| f.id.to_s == project_field_found.id.to_s }\n if field_obj_found.nil? || field_obj_found.values.first.nil? || field_obj_found.values.first.strip == ''\n next\n end\n field_data = field_obj_found.values.first\n end\n\n # Remove empty strings\n keywords = field_data.split(field_separator).reject { |val| val.to_s.strip.empty? }\n\n # Loop through the keywords and tag the file\n keywords.each do |value|\n # Trim leading & trailing whitespace\n value = value.strip\n # Find the string in existing keywords\n proj_keyword_obj = existing_project_keywords.find do |item| \n begin\n item.name.downcase == value.downcase\n rescue\n item.name == value\n end\n\n end\n\n if proj_keyword_obj\n # check if current file is already tagged\n already_tagged = project.project_keywords.find { |item| item.id.to_s == proj_keyword_obj.id.to_s }\n # Tag the project\n msg = \"Tagging project #{project.code.inspect} with => #{value.inspect}.\"\n logger.info(msg.green)\n\n project.project_keywords.push(nested_proj_keyword.new(proj_keyword_obj.id)) unless already_tagged\n else\n msg = \"Unable to retrieve previously created keyword! => #{value}\"\n logger.fatal(msg.red)\n abort\n end\n \n end\n \n end\n\n # Update projects\n msg = \"Batch #{num} of #{iterations} => Attempting to perform project updates.\"\n logger.info(msg.green)\n\n updated_obj_count = run_smart_update(projects,total_projects_updated)\n\n total_projects_updated += updated_obj_count\n\n offset += limit\n\n end \n\n end", "title": "" }, { "docid": "85b1c71a5d4b0dd3108b515ec3b368b1", "score": "0.5440941", "text": "def update_file_data(task_data)\n task_data['files'].each { |f| f['name'] = f['filename'] }\n task_data\n end", "title": "" }, { "docid": "85b1c71a5d4b0dd3108b515ec3b368b1", "score": "0.5440941", "text": "def update_file_data(task_data)\n task_data['files'].each { |f| f['name'] = f['filename'] }\n task_data\n end", "title": "" }, { "docid": "0df9eb0ac8b1c06e017b56e0a9e2a10d", "score": "0.52922314", "text": "def move_file_keywords_to_field_by_category(category,\n keyword_category,\n target_field,\n field_separator,\n insert_mode=nil,\n batch_size=200)\n\n # Validate input\n args = process_field_to_keyword_move_args('categories',\n category,\n keyword_category,\n target_field,\n field_separator,\n batch_size,\n false)\n\n category_found = args.container\n file_keyword_category_found = args.target_keyword_category\n target_field_found = args.source_field\n\n built_in = nil\n file_ids = nil\n keywords = []\n files = []\n total_file_count = 0\n total_files_updated = 0 # For better readability\n offset = 0\n iterations = 0\n limit = batch_size.to_i.abs\n op = RestOptions.new\n\n # Validate insert mode and warn user of restricted field type\n if RESTRICTED_LIST_FIELD_TYPES.include?(target_field_found.field_display_type)\n answer = nil\n error = \"\\nInvalid input. Please enter \\\"yes\\\" or \\\"no\\\".\\n> \"\n message = \"Warning: You are inserting keywords into a restricted field type. \" +\n \"\\n Project keywords are sorted in alphabetical order. \" +\n \"\\n All file keywords will be created as options but only the first one will be displayed in the field.\" +\n \"\\nContinue? (Yes/no)\\n> \"\n\n print message\n\n while answer != 'yes' && answer != 'no'\n\n print error unless answer.nil?\n\n answer = gets.chomp.to_s.downcase\n\n abort(\"You entered #{answer.inspect}. Exiting.\\n\\n\") if answer.downcase == 'no' || answer == 'n'\n\n break if answer == 'yes' || answer == 'y'\n\n end \n \n end\n\n unless ['append','overwrite'].include?(insert_mode.to_s)\n msg = \"Argument Error: Expected \\\"append\\\" or \\\"overwrite\\\" for fourth argument \\\"insert_mode\\\" in #{__callee__}. \" +\n \"Instead got #{insert_mode.inspect}\"\n logger.error(msg.red)\n abort\n end\n\n # Check the source_field field type\n built_in = (target_field_found.built_in == '1') ? true : false\n\n # Get keywords\n msg = \"Retrieving keywords for keyword category => #{file_keyword_category_found.name.inspect}.\"\n logger.info(msg.green)\n\n op.add_option('limit','0')\n op.add_option('keyword_category_id',\"#{file_keyword_category_found.id}\")\n\n keywords = get_keywords(op)\n\n if keywords.empty?\n msg = \"No keywords found in keyword category => #{file_keyword_category_found.name.inspect} \" +\n \"with id #{file_keyword_category_found.id.inspect}\"\n logger.error(msg.red)\n abort\n end\n\n op.clear\n \n # Get file ids\n msg = \"Retrieving file ids in category => #{category_found.name.inspect}.\"\n logger.info(msg.green)\n\n op.add_option('limit','0')\n op.add_option('displayFields','id')\n op.add_option('category_id',\"#{category_found.id}\") # Returns files in specified project\n\n files = get_files(op)\n\n op.clear\n\n if files.empty?\n msg = \"Category #{category_found.name.inspect} with id #{category_found.id.inspect} is empty.\"\n logger.error(msg.red)\n abort\n end\n\n # Extract file ids\n file_ids = files.map { |obj| obj.id.to_s }\n\n # Prep iterations loop\n total_file_count = file_ids.length\n\n msg = \"Calculating batch size.\"\n logger.info(msg.green)\n\n if total_file_count % batch_size == 0\n iterations = total_file_count / batch_size\n else\n iterations = total_file_count / batch_size + 1\n end\n\n iterations.times do |num|\n\n num += 1\n\n start_index = offset\n end_index = limit\n ids = file_ids[start_index...end_index].join(',')\n\n msg = \"Batch #{num} of #{iterations} => Retrieving files.\"\n logger.info(msg.green)\n\n op.add_option('limit','0')\n op.add_option('id',ids)\n\n # Get current batch of files\n files = get_files(op)\n\n # Move the file keywords to specified field\n processed_files = move_keywords_to_fields(files,keywords,target_field_found,field_separator,insert_mode)\n\n # Perform file update\n msg = \"Batch #{num} of #{iterations} => Attempting to perform file updates.\"\n logger.info(msg.white)\n \n updated_obj_count = run_smart_update(files,total_files_updated)\n\n total_files_updated += updated_obj_count\n\n offset += limit\n end\n \n end", "title": "" }, { "docid": "821b7652aa68758e22ba54b5ba528e1d", "score": "0.5264385", "text": "def parse_files(*files)\n self.files = []\n seen_extra_files_marker = false\n \n files.each do |file|\n if file == \"-\"\n seen_extra_files_marker = true\n next\n end\n \n if seen_extra_files_marker\n add_extra_files(file)\n else\n self.files << file\n end\n end\n end", "title": "" }, { "docid": "77e826693ec0bed09b44c6e7f537960a", "score": "0.5246612", "text": "def prepare_files\n return if temp_files.blank?\n\n restrict_to_single_file! if pagefile?\n\n temp_files.each do |file|\n files.build(\n site: blockable.site,\n dimensions: tag.try(:dimensions),\n file: file\n )\n end\n end", "title": "" }, { "docid": "5ec256cd8f5518e82d673bb708d8d122", "score": "0.52441156", "text": "def apply_file_metadata(params)\n uploaded_file_ids = params[\"uploaded_files\"]\n return if uploaded_file_ids.nil?\n uploaded_file_ids.each do |uploaded_file_id|\n uploaded_file = find_or_create_uploaded_file(uploaded_file_id)\n next if uploaded_file.pcdm_use == \"primary\"\n apply_metadata_to_uploaded_file(uploaded_file, params)\n end\n params[\"etd\"].delete(\"supplemental_file_metadata\")\n params # return the params after processing, for ease of testing\n end", "title": "" }, { "docid": "35ba43956e5b8e1cb478e88744acfa76", "score": "0.52317786", "text": "def compute_rename_fields\n dir_fields = nil\n file_fields = nil\n\n if @path.nil?\n file_fields = %w{artist date title}\n else\n if uniq_tag?('ARTIST')\n if uniq_tag?('DATE')\n file_fields = %w{artist albumdate album index title}\n else\n file_fields = %w{artist albumdate album index title date}\n end\n\n dir_fields = %w{artist albumdate album}\n else\n file_fields = %w{album albumdate index artist title date}\n\n dir_fields = %w{album albumdate}\n end\n end\n\n return dir_fields, file_fields\n end", "title": "" }, { "docid": "3aba8256a1c618e4b7a9c9b5c32ab8cf", "score": "0.52115583", "text": "def transliterate_file_name\n\t\t\tfile_names = Array.new\n\t\t\[email protected] { |a| file_names << a if a.match(/_file_name{1}$/) }\n\t\t\tfile_names.each do |local_file_name|\n\t\t\t\tif self.send(local_file_name).present? && self.send(local_file_name+'_changed?')\n\t\t\t\t\textension = File.extname(send(local_file_name)).gsub(/^\\.+/, '')\n\t\t\t\t\tfilename = send(local_file_name).gsub(/\\.#{extension}$/, '')\n\t\t\t\t\tself.send(local_file_name.gsub(/_file_name{1}$/, '')).instance_write(:file_name, \"#{transliterate(filename)}.#{transliterate(extension)}\")\n\t\t\t\tend\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "40ff8476648422c52b5d2bd04aaf3471", "score": "0.52003855", "text": "def transform_files!(files, type) \n files.each do |file|\n parsed = \"\"\n namespace = [DEFAULT_LANGUAGE, 'txt', type] + Base.get_namespace(file, type)\n puts \"Converting: \" + file + \" into namespace: \"\n puts namespace.map {|x| \"[\\\"#{x}\\\"]\"}.join(\"\")\n \n n = Namespace.new(namespace)\n \n contents = Base.get_file_as_string(file)\n parsed << GettextI18nConvertor.string_to_i18n(contents, n)\n \n #puts parsed\n # write the file\n \n File.open(file, 'w') { |file| file.write(parsed)}\n \n \n \n n.merge(@translations)\n end\n end", "title": "" }, { "docid": "1fd29fd24b926796b53cf21f1c7e6342", "score": "0.5191023", "text": "def remove_from_project\n build_files.each(&:remove_from_project)\n super\n end", "title": "" }, { "docid": "c81aa729b87c2356fe517bf2538687ec", "score": "0.51624966", "text": "def pre_process_logger_file_upload\n @project = parent\n @data_templates = parent.managed_repository{Voeis::DataStream.all(:type => \"Sensor\")}\n @general_categories = Voeis::GeneralCategoryCV.all\n @sites = parent.managed_repository{Voeis::Site.all}\n end", "title": "" }, { "docid": "3a4666ed3b00d9080354ad9e4d24d611", "score": "0.5162058", "text": "def process_workspace_bucket_files(files)\n # first mark any files that we already know are study files that haven't changed (can tell by generation tag)\n files_to_remove = []\n files.each do |file|\n # first, check if file is in a submission directory, and if so mark it for removal from list of files to sync\n if @submission_ids.include?(file.name.split('/').first) || file.name.end_with?('/')\n files_to_remove << file.generation\n else\n directory_name = DirectoryListing.get_folder_name(file.name)\n found_file = {'name' => file.name, 'size' => file.size, 'generation' => file.generation}\n # don't add directories to files_by_dir\n unless file.name.end_with?('/')\n # add to list of discovered files\n @files_by_dir[directory_name] ||= []\n @files_by_dir[directory_name] << found_file\n end\n found_study_file = @study_files.detect {|f| f.generation.to_i == file.generation }\n if found_study_file\n @synced_study_files << found_study_file\n files_to_remove << file.generation\n end\n end\n end\n\n # remove files from list to process\n files.delete_if {|f| files_to_remove.include?(f.generation)}\n\n # next update map of existing files to determine what can be grouped together in a directory listing\n @file_extension_map = DirectoryListing.create_extension_map(files, @file_extension_map)\n\n files.each do |file|\n # check first if file type is in file map in a group larger than 10 (or 20 for text files)\n file_extension = DirectoryListing.file_extension(file.name)\n directory_name = DirectoryListing.get_folder_name(file.name)\n max_size = file_extension == 'txt' ? 20 : 10\n if @file_extension_map.has_key?(directory_name) && !@file_extension_map[directory_name][file_extension].nil? && @file_extension_map[directory_name][file_extension] >= max_size\n process_directory_listing_file(file, file_extension)\n else\n # we are now dealing with singleton files or fastqs, so process accordingly (making sure to ignore directories)\n if DirectoryListing::PRIMARY_DATA_TYPES.any? {|ext| file_extension.include?(ext)} && !file.name.end_with?('/')\n # process fastq file into appropriate directory listing\n process_directory_listing_file(file, 'fastq')\n else\n # make sure file is not actually a folder by checking its size\n if file.size > 0\n # create a new entry\n unsynced_file = StudyFile.new(study_id: @study.id, name: file.name, upload_file_name: file.name, upload_content_type: file.content_type, upload_file_size: file.size, generation: file.generation, remote_location: file.name)\n @unsynced_files << unsynced_file\n end\n end\n end\n end\n end", "title": "" }, { "docid": "f36015d55496f02892de39680e378c22", "score": "0.51551974", "text": "def file_add_field_data(file=nil,field=nil,value=nil)\n\n #validate class types\n unless file.is_a?(Files) || (file.is_a?(String) && (file.to_i != 0)) || file.is_a?(Integer)\n warn \"Argument Error: Invalid type for first argument in \\\"file_add_field_data\\\" method.\\n\" +\n \" Expected Single Files object, Numeric string, or Integer for file id\\n\" +\n \" Instead got => #{file.inspect}\"\n return \n end \n\n unless field.is_a?(Fields) || (field.is_a?(String) && (field.to_i != 0)) || field.is_a?(Integer)\n warn \"Argument Error: Invalid type for second argument in \\\"file_add_field_data\\\" method.\\n\" +\n \" Expected Single Fields object, Numeric string, or Integer for field id\\n\" +\n \" Instead got => #{field.inspect}\"\n return \n end\n\n unless value.is_a?(String) || value.is_a?(Integer) || value.is_a?(Float)\n warn \"Argument Error: Invalid type for third argument in \\\"file_add_field_data\\\" method.\\n\" +\n \" Expected a String, Integer, or Float\\n\" +\n \" Instead got => #{value.inspect}\"\n return \n end\n\n current_file = nil\n current_field = nil\n current_value = value.to_s.strip\n nested_field = Struct.new(:id,:values)\n\n file_class = file.class.to_s\n field_class = field.class.to_s\n\n #set up objects\n if file_class == 'Files'\n current_file = file\n elsif file_class == 'String' || file_class == 'Integer' \n #retrieve Projects object matching id provided\n uri = URI.parse(@uri + \"/Files\")\n option = RestOptions.new\n option.add_option(\"id\",file.to_s)\n current_file = get(uri,option).first\n unless current_file\n warn \"ERROR: Could not find Project with matching id of \\\"#{file.to_s}\\\"...Exiting\"\n return\n end\n else\n warn \"Unknown Error retrieving Files. Exiting.\"\n return\n end\n\n if field_class == 'Fields'\n current_field = field\n elsif field_class == 'String' || field_class == 'Integer'\n uri = URI.parse(@uri + \"/Fields\")\n option = RestOptions.new\n option.add_option(\"id\",field.to_s)\n current_field = get(uri,option).first\n unless current_field\n warn \"ERROR: Could not find Field with matching id of \\\"#{field.to_s}\\\"\\n\" +\n \"=> Hint: It either doesn't exist or it's disabled.\"\n return false\n end\n unless current_field.field_type == \"image\"\n warn \"ERROR: Expected a Project field. The field provided is a \\\"#{current_field.field_type}\\\" field.\"\n return false\n end \n else\n warn \"Unknown Error retrieving Field. Exiting.\"\n return\n end\n\n #Prep endpoint to be used for update\n files_endpoint = URI.parse(@uri + \"/Files/#{current_file.id}/Fields\")\n\n #Check the field type -> if its option or fixed suggestion we must make the option\n #available first before we can apply it to the Files resource\n if RESTRICTED_LIST_FIELD_TYPES.include?(current_field.field_display_type)\n \n lookup_string_endpoint = URI.parse(@uri + \"/Fields/#{current_field.id}/FieldLookupStrings\")\n\n #Grab all the available FieldLookupStrings for the specified Fields resource\n field_lookup_strings = get(lookup_string_endpoint,nil)\n\n #check if the value in the third argument is currently an available option for the field\n lookup_string_exists = field_lookup_strings.find { |item| current_value.downcase == item.value.downcase }\n\n # add the option to the restricted field first if it's not there, otherwise you get a 400 bad \n # request error saying that it couldn't find the string value for the restricted field specified \n # when making a PUT request on the FILES resource you are currently working on\n unless lookup_string_exists\n data = {:value => current_value}\n response = post(lookup_string_endpoint,data,false)\n unless response.kind_of?(Net::HTTPSuccess)\n return\n end\n end\n\n # Now that we know the option is available, we can update the File we are currently working with\n index = current_file.fields.find_index { |nested_field| nested_field.id.to_s == current_field.id.to_s }\n\n if index\n current_file.fields[index].values = [current_value]\n else\n current_file.fields << nested_field.new(current_field.id,[current_value])\n end\n\n update_files(current_file,false)\n\n elsif current_field.field_display_type == \"date\"\n #make sure we get the right date format\n #Accepts mm-dd-yyyy, mm-dd-yy, mm/dd/yyyy, mm/dd/yy\n date_regex = Regexp::new('((\\d{2}-\\d{2}-(\\d{4}|\\d{2}))|(\\d{2}\\/\\d{2}\\/(\\d{4}|\\d{2})))')\n unless (value =~ date_regex) == 0\n warn \"ERROR: Invalid date format. Expected => \\\"mm-dd-yyyy\\\" or \\\"mm-dd-yy\\\"\"\n return\n end\n\n value.gsub!('/','-')\n date_arr = value.split('-') #convert date string to array for easy manipulation\n\n if date_arr.last.length == 2 #convert mm-dd-yy to mm-dd-yyyy format\n four_digit_year = '20' + date_arr.last\n date_arr[-1] = four_digit_year\n end\n #convert date to 14 digit unix time stamp\n value = date_arr[-1] + date_arr[-3] + date_arr[-2] + '000000'\n\n #Apply the date to our current Files resource\n data = {:id => current_field.id, :values => [value.to_s]}\n put(files_endpoint,data,false)\n\n\n elsif NORMAL_FIELD_TYPES.include?(current_field.field_display_type)\n #some fields are built into Files so they can't be inserted into\n #the Files nested fields resource. We get around this by using the\n #name of the field object to access the corresponding built-in field attribute\n #inside the Files object.\n if current_field.built_in.to_s == \"1\" #For built in fields\n files_endpoint = URI.parse(@uri + '/Files') #change endpoint bc field is built_in\n field_name = current_field.name.downcase.gsub(' ','_') #convert the current field's name\n #into the associated files' built_in attribute name\n \n #access built-in field\n unless current_file.instance_variable_defined?('@'+field_name)\n warn \"ERROR: The specified attirbute \\\"#{field_name}\\\" does not\" + \n \" exist in the File. Exiting.\"\n exit\n end\n \n current_file.instance_variable_set('@'+field_name, value)\n put(files_endpoint,current_file)\n else #For regular non-built in fields\n\n data = {:id => current_field.id, :values => [value.to_s]}\n put(files_endpoint,data,false)\n \n end\n\n elsif current_field.field_display_type == 'boolean'\n\n #validate value\n unless ALLOWED_BOOLEAN_FIELD_OPTIONS.include?(value.to_s.strip)\n msg = \"Invalid value #{value.inspect} for \\\"On/Off Switch\\\" field type.\\n\" +\n \"Acceptable Values => #{ALLOWED_BOOLEAN_FIELD_OPTIONS.inspect}\"\n logger.error(msg.red)\n return\n end\n \n \n #Interpret input\n #Even indicies in the field options array are On and Odd indicies are Off\n bool_val = \"\"\n if ALLOWED_BOOLEAN_FIELD_OPTIONS.find_index(value.to_s.strip).even?\n bool_val = \"1\"\n elsif ALLOWED_BOOLEAN_FIELD_OPTIONS.find_index(value.to_s.strip).odd?\n bool_val = \"0\"\n end\n\n #Prep the endpoint\n files_endpoint = URI.parse(@uri + '/Files')\n\n current_file.fields.each do |obj| \n if obj.id == current_field.id\n obj.values[0] = bool_val\n end\n \n end\n #udatte current variable for verbose statement\n current_value = bool_val\n #Actually do the update\n put(files_endpoint,current_file,false)\n else\n msg = \"The field specified does not have a valid field_display_type.\" +\n \"Value provided => #{field.field_display_type.inspect}\"\n logger.error(msg.red)\n return\n end\n\n if @verbose\n msg = \"Setting value: \\\"#{current_value}\\\" to \\\"#{current_field.name}\\\" field \" +\n \"for file => #{current_file.filename}\"\n logger.info(msg.green)\n end\n end", "title": "" }, { "docid": "16d0186d58153cad19377e00b12c36ba", "score": "0.5145406", "text": "def move_collection_names\n @record.xpath('./datafield[@tag=\"710\"]/subfield[@code=\"5\"]').each do |subfield|\n collection = subfield.parent.at_xpath('./subfield[@code=\"a\"]').text\n\n Nokogiri::XML::Builder.with(@doc.at('record')) do |xml|\n xml.datafield('ind1' => '0', 'ind2' => '0', 'tag' => '773') do\n xml.subfield(collection, 'code' => 't')\n end\n end\n\n subfield.parent.remove\n end\n end", "title": "" }, { "docid": "b9c0ec8e6f77a330552f5611402340d4", "score": "0.5094213", "text": "def move_project_keywords_to_field(source_project_keyword_category=nil,\n target_project_field=nil,\n field_separator=nil,\n insert_mode=nil,\n batch_size=200)\n\n project_ids = nil\n projects = nil\n project_field_found = nil\n project_keyword_category_found = nil\n project_keywords = nil\n project_keyword_ids = ''\n total_project_count = 0\n iterations = 0\n offset = 0\n total_projects_updated = 0\n batch_size = batch_size.to_i.abs\n limit = batch_size\n op = RestOptions.new\n\n # Validate input:\n \n # Retrieve project keyword category\n if source_project_keyword_category.is_a?(ProjectKeywordCategories) && # Object\n !source_project_keyword_category.id.nil?\n \n op.add_option('id',source_project_keyword_category.id)\n project_keyword_category_found = get_project_keyword_categories(op).first\n \n elsif (source_project_keyword_category.is_a?(String) && source_project_keyword_category.to_i > 0) || # Id\n (source_project_keyword_category.is_a?(Integer) && !source_project_keyword_category.zero?)\n\n op.add_option('id',source_project_keyword_category)\n project_keyword_category_found = get_project_keyword_categories(op).first\n\n elsif source_project_keyword_category.is_a?(String) # Name\n\n op.add_option('name',source_project_keyword_category)\n op.add_option('textMatching','exact')\n project_keyword_category_found = get_project_keyword_categories(op)\n\n unless project_keyword_category_found\n msg = \"Project keyword category with name #{target_project_keyword_category.inspect} not found in OpenAsset.\"\n logger.error(msg.red)\n abort\n end\n\n if project_keyword_category_found.length > 1\n msg = \"Multiple Project keyword categories found with search query #{op.get_options.inspect}.\" +\n \" Specify an id instead.\"\n logger.error(msg.red) \n abort\n else\n project_keyword_category_found = project_keyword_category_found.first\n end\n\n else\n msg = \"Argument Error: Expected one of the following: \" +\n \"\\n 1. Valid project keyword category object.\" +\n \"\\n 2. Project keyword category id.\" +\n \"\\n 3. Project keyword category name.\" +\n \"\\nfor first argument in #{__callee__} method.\" +\n \"\\nInstead got #{target_project_keyword_category.inspect}.\"\n logger.error(msg.red)\n abort\n end\n\n # Make sure it's a project keyword catgory\n unless project_keyword_category_found.is_a?(ProjectKeywordCategories)\n msg = \"Error: Specified Project keyword category named #{project_keyword_category_found.name.inspect} with id \" +\n \"#{project_keyword_category_found.id.inspect} is actually a #{project_keyword_category_found.class.inspect}.\"\n logger.error(msg.red)\n abort\n end\n\n op.clear\n\n # Retrieve project field\n if target_project_field.is_a?(Fields) && !target_project_field.id.nil?# Object\n\n op.add_option('id',target_project_field.id)\n project_field_found = get_fields(op).first\n\n unless project_field_found\n msg = \"Field with id #{project_field.id.inspect} not found in OpenAsset.\"\n logger.error(msg.red)\n abort\n end\n\n elsif (target_project_field.is_a?(String) && !target_project_field.to_i.zero?) || # Id\n (target_project_field.is_a?(Integer) && !target_project_field.zero?)\n\n op.add_option('id',target_project_field)\n project_field_found = get_fields(op).first\n\n unless project_field_found\n msg = \"Field with id #{target_project_field.inspect} not found in OpenAsset.\"\n logger.error(msg.red)\n abort\n end\n\n elsif target_project_field.is_a?(String) # Name\n\n op.add_option('name',target_project_field)\n op.add_option('textMatching','exact')\n project_field_found = get_fields(op)\n\n unless project_field_found\n msg = \"Field with name #{target_project_field.inspect} not found in OpenAsset.\"\n logger.error(msg.red)\n abort\n end\n\n if project_field_found.length > 1\n msg = \"Multiple fields found with name #{target_project_field.inspect}. Specify an id instead.\"\n logger.error(msg.red)\n abort\n else\n project_field_found = project_field_found.first\n end\n else \n msg = \"Error: Expected one of the following: \" +\n \"\\n 1. Valid Fields object.\" +\n \"\\n 2. Field id.\"\n \"\\n 3. Field name.\"\n \"\\nfor second argument in #{__callee__} method.\" +\n \"\\nInstead got #{target_project_field.inspect}.\"\n logger.error(msg.red)\n abort\n end\n\n # Make sure it's a project field\n unless project_field_found.field_type == 'project'\n msg = \"Error: Specified field #{project_field_found.name.inspect} with id \" +\n \"#{project_field_found.id.inspect} is not a project field.\"\n logger.error(msg.red)\n abort\n end\n \n if RESTRICTED_LIST_FIELD_TYPES.include?(project_field_found.field_display_type)\n answer = nil\n error = \"\\nInvalid input. Please enter \\\"yes\\\" or \\\"no\\\".\\n> \"\n message = \"Warning: You are inserting keywords into a restricted field type. \" +\n \"\\n Project keywords are sorted in alphabetical order. \" +\n \"\\n All project keywords will be created as options but only the first one will be displayed in the field.\" +\n \"\\nContinue? (Yes/no)\\n> \"\n\n print message.yellow\n\n while answer != 'yes' && answer != 'no'\n\n print error unless answer.nil?\n\n answer = gets.chomp.to_s.downcase\n\n abort(\"You entered #{answer.inspect}. Exiting.\\n\\n\") if answer.downcase == 'no' || answer == 'n'\n\n break if answer == 'yes' || answer == 'y'\n\n end \n \n end\n\n if field_separator.nil?\n msg = \"You must specify a field separator.\"\n logger.error(msg)\n abort\n end\n\n unless ['append','overwrite'].include?(insert_mode.to_s)\n msg = \"Error: Expected \\\"append\\\" or \\\"overwrite\\\" for fourth argument \\\"insert_mode\\\" in #{__callee__}. \" +\n \"Instead got #{insert_mode.inspect}\"\n logger.error(msg.red)\n abort\n end\n\n if batch_size.zero?\n msg = \"Invalid batch size. Specify a positive numeric value or use default value of 200.\"\n logger.error(msg.red)\n abort\n end\n\n op.clear\n\n # Get projects keywords\n op.add_option('limit','0')\n op.add_option('project_keyword_category_id',project_keyword_category_found.id)\n\n project_keywords = get_project_keywords(op)\n\n op.clear\n\n # Get projects\n op.add_option('limit','0')\n op.add_option('displayFields','id')\n\n project_ids = get_projects(op).map { |obj| obj.id.to_s }\n\n if project_ids.length.zero?\n msg = \"No Projects found in OpenAsset!\"\n logger.error(msg.red)\n abort\n end\n\n op.clear\n\n total_project_count = project_ids.length\n\n # Set up iterations loop\n if total_project_count % batch_size == 0\n iterations = total_project_count / batch_size\n else\n iterations = total_project_count / batch_size + 1 # To grab remaining\n end\n\n iterations.times do |num|\n\n num += 1\n\n start_index = offset\n end_index = offset + limit\n ids = project_ids[start_index...end_index].join(',')\n\n op.add_option('limit','0')\n op.add_option('id',ids)\n\n msg = \"Batch #{num} of #{iterations} => Retrieving projects.\"\n logger.info(msg.green)\n\n projects = get_projects(op)\n\n op.clear\n\n # Move project keywords to field\n msg = \"Batch #{num} of #{iterations} => Extacting project keywords.\"\n logger.info(msg.green)\n\n processed_projects = move_keywords_to_fields(projects,\n project_keywords,\n project_field_found,\n field_separator,\n insert_mode)\n\n # Update projects\n msg = \"Batch #{num} of #{iterations} => Attempting to perform project updates.\"\n logger.info(msg.green)\n\n updated_obj_count = run_smart_update(processed_projects,total_projects_updated)\n\n total_projects_updated += updated_obj_count\n\n offset += limit\n\n end \n\n end", "title": "" }, { "docid": "80f1a0809b3b4b5be7e586638de70b2c", "score": "0.5084164", "text": "def initialize_fields(file)\n file.initialize_fields\n end", "title": "" }, { "docid": "80f1a0809b3b4b5be7e586638de70b2c", "score": "0.5084164", "text": "def initialize_fields(file)\n file.initialize_fields\n end", "title": "" }, { "docid": "904c4d744b7249c576ea5a72d8a5ea83", "score": "0.504667", "text": "def fields_transform \n @fields[:share] = nil\n @fields[:dst_sharename] = nil\n @fields[:src_sharename] = nil\n @fields[:sharename] = nil\n\n case @type\n when :fileBrowser_main\n case @command\n when :browse\n field_path_transform(:share,:path) \n when :move_copy\n field_path_transform(:dst_sharename,:dst_path) \n field_path_transform(:src_sharename,:src_files) \n field_path_transform(:src_sharename,:src_folders) \n when :create_folder\n field_path_transform(:share,:path) \n when :rename\n field_path_transform(:share,:new_path) \n field_path_transform(:share,:old_path) \n when :delete\n field_path_transform(:sharename,:files) \n field_path_transform(:sharename,:folders) \n when :state\n field_path_transform(:share,:path) \n end\n end\n notify \"Transformed Fields : \"\n notify @fields.inspect\n end", "title": "" }, { "docid": "a1450468076720375eb47c7ecf5f2fd0", "score": "0.50357306", "text": "def transform_files!(files, type) \n files.each do |file|\n @file = file\n @type = type\n parsed = \"\"\n @dirnames = Base.get_namespace(file,type) # directories after the app/type/ directory\n \n namespaces = LANGUAGES.collect do |lang|\n if type == 'views'\n namespace = [lang] + @dirnames\n else\n namespace = [lang, type] + @dirnames\n end\n \n puts \"Converting: \" + file + \" into namespace: \"\n puts namespace.map {|x| \"[\\\"#{x}\\\"]\"}.join(\"\")\n \n Namespace.new(namespace,lang)\n end\n\n contents = Base.get_file_as_string(file)\n parsed << GettextI18nConvertor.string_to_i18n(contents, namespaces, type)\n \n # write the app/type/file with new i18n format instead of gettext\n File.open(file, 'w') { |file| file.write(parsed)}\n \n namespaces.each do |ns|\n new_file_handler(ns)\n end\n end\n end", "title": "" }, { "docid": "aef0902b072b5983a1dfcf751400b5d5", "score": "0.50133306", "text": "def set_the_field_values\n fn = self.file_name\n unless self.file_ext && !self.file_ext.blank?\n self.file_ext = fn.split('.').last\n end\n ex = self.file_ext\n nm = self.name\n \n pic_name = fn.split('.')\n pic_name.delete(pic_name.last)\n \n pn = pic_name.join('_').to_s.to_go\n \n the_name = ( nm.blank? || nm.start_with?('dcfile_') ) ? pn.titleize : nm.to_s\n the_fname = !nm.blank? ? nm.to_s.to_go : pn\n \n self.name = the_name\n self.original_name = fn\n # => self.file_name = \"#{the_fname}.#{ex}\"\n self.file_name = \"#{ generate_dc_name }.#{ex}\"\n self.image = IMAGE_EXTS.include?( ex.to_s.downcase ) ? true : false\n self.save\n end", "title": "" }, { "docid": "18a18f3f9e95028f324506db4f9a4c9b", "score": "0.5011978", "text": "def grouped(files); end", "title": "" }, { "docid": "98f6532b1a5be22c4e76c1d2acfd713a", "score": "0.50011486", "text": "def characterize(save: true)\n [:original_file, :intermediate_file, :preservation_file].each do |type|\n target_file = @file_set.try(type)\n next unless target_file\n @file_object = Valkyrie::StorageAdapter.find_by(id: target_file.file_identifiers[0])\n new_file = target_file.new(file_characterization_attributes.to_h)\n @file_set.file_metadata = @file_set.file_metadata.select { |x| x.id != new_file.id } + [new_file]\n end\n @file_set = persister.save(resource: @file_set) if save\n @file_set\n end", "title": "" }, { "docid": "011a15435bfcc71418eec1b30f0a5d60", "score": "0.49698776", "text": "def upload_images_and_documents\n if params[:project][:images]\n params[:project][:images].each do |project_image|\n @project.images.create(image: project_image, document: false)\n end\n end\n\n if params[:project][:legal_documents]\n params[:project][:legal_documents].each do |project_doc|\n @project.images.create(image: project_doc, document: true)\n end\n end\n end", "title": "" }, { "docid": "04974fd79fad9063161c399fec841b66", "score": "0.49677396", "text": "def characterize(save: true)\n [:original_file, :intermediate_file, :preservation_file].each do |type|\n @target_file = @file_set.try(type)\n next unless @target_file\n @file_object = Valkyrie::StorageAdapter.find_by(id: @target_file.file_identifiers[0])\n @dataset_path = filename\n unzip_original_file if zip_file?\n new_file = @target_file.new(file_characterization_attributes.to_h)\n @file_set.file_metadata = @file_set.file_metadata.select { |x| x.id != new_file.id } + [new_file]\n clean_up_zip_directory if zip_file?\n end\n @file_set = persister.save(resource: @file_set) if save\n @file_set\n end", "title": "" }, { "docid": "575f47730c0508c12bb4387d0d151928", "score": "0.49621105", "text": "def update_metadata\n @generic_file.destroy_existing_nested_nodes(params[:generic_file])\n super\n end", "title": "" }, { "docid": "143336acfffcfbe727210a4bd704b6e3", "score": "0.4931138", "text": "def file_field_sets\n @file_field_sets ||= begin\n # Select only file and instantiation fields.\n file_and_instantiation_fields = fields.select { |field| file_header?(field.header) || instantiation_header?(field.header) }\n\n # Slice the selected fields into field sets for each file.\n file_and_instantiation_fields.slice_when do |prev_field, field|\n initial_file_header?(field.header) && !initial_file_header?(prev_field.header)\n end\n end\n end", "title": "" }, { "docid": "5ec34520a036c0fc4913b09db330c824", "score": "0.4921815", "text": "def process_all_primary_files\n # NOTE: I investigated concurrent processing of files\n # to speed up this process, however I didn't pursue it\n # further: This process is highly CPU intensive, so the\n # only way to get a significant speedup is to use\n # multiple CPUs/Cores. In MRI this is only possible\n # with multiple processes. I didn't want to go through\n # the trouble of IPC to collect all files' operations.\n # It would be easier if we could use threads, however\n # that would require jruby or rbx. So I'm sticking with\n # sequential processing for now.\n Dir.glob(\n File.join(@repository.base_dir, '**/content/**/*.at')\n ).map { |absolute_file_path|\n next nil if !@file_list.any? { |e| absolute_file_path.index(e) }\n # Skip non content_at files\n unless absolute_file_path =~ /\\/content\\/.+\\d{4}\\.at\\z/\n raise \"shouldn't get here\"\n end\n\n # Note: @any_content_type may be the wrong one, however finding\n # corresponding STM CSV file will still work as it doesn't rely\n # on config but das regex replacements on file path only.\n content_at_file_to = Repositext::RFile::ContentAt.new(\n File.read(absolute_file_path),\n @language,\n absolute_file_path,\n @any_content_type\n )\n\n @logger.info(\" - process #{ content_at_file_to.repo_relative_path(true) }\")\n\n soff = SubtitleOperationsForFile.new(\n content_at_file_to,\n @repository.base_dir,\n {\n from_git_commit: @from_git_commit,\n to_git_commit: @to_git_commit,\n prev_last_operation_id: @prev_last_operation_id,\n execution_context: @execution_context,\n }\n ).compute\n\n if soff.operations.any?\n @prev_last_operation_id = soff.last_operation_id\n soff\n else\n # Return nil if no subtitle operations exist for this file\n nil\n end\n }.compact\n end", "title": "" }, { "docid": "0ad4e18e21237c75e8798cd216341e01", "score": "0.49199128", "text": "def properties_subfolders_docs_documentnames_for_move_to_function(mf,af,pid)\n master_folders = Folder.find(:all,:conditions=> [\"portfolio_id = ? and parent_id = ? and is_deleted = ?\",pid,mf.id,false])\n master_files = Document.find(:all,:conditions=> [\"folder_id = ? and is_deleted = ?\",mf.id,false])\n master_folders.each do |mfldr|\n fol = Folder.new\n fol.attributes = mfldr.attributes\n fol.parent_id = af.id\n fol.user_id = current_user.id\n fol.real_estate_property_id = af.real_estate_property_id\n fol.portfolio_id = af.portfolio_id\n fol.save\n properties_subfolders_docs_documentnames_for_move_to_function(mfldr,fol,pid)\n end\n master_files.each do |fl|\n path =\"#{Rails.root.to_s}/public\"+fl.public_filename.to_s\n temfile = Tempfile.new(fl.filename)\n begin\n temfile.write(File.open(path).read)\n temfile.flush\n upload_data = ActionDispatch::Http::UploadedFile.new({:filename=>fl.filename,:type=>fl.content_type, :tempfile=>temfile})\n d= Document.new\n d.attributes = fl.attributes\n d.uploaded_data = upload_data\n d.user_id = current_user.id\n d.folder_id = af.id\n d.real_estate_property_id = af.real_estate_property_id\n d.save\n ensure\n temfile.close\n temfile.unlink\n end\n @task_and_variance_task = false\n @loop =1\n end\nend", "title": "" }, { "docid": "6d791ac4738e54e693e9e6317fb54989", "score": "0.4917293", "text": "def parse_project_files(project)\r\n @files = []\r\n @server.projects.each{ |p|\r\n next if project != '*' and project != p.name\r\n p.views.each { |v|\r\n parse_folder(v.rootfolder)\r\n #break\r\n }\r\n }\r\n end", "title": "" }, { "docid": "fbfd8571bbb9363d19e72409114c0f11", "score": "0.4915196", "text": "def reorder_files\n files = Dir.glob(File.join(@dir,\"*\"))\n files.each{|f|\n @enroll_file = f if f.downcase.index('enroll')\n @attendance_file = f if f.downcase.index('att')\n @ili_file = f if f.downcase.index('ili') || f.downcase.index('h1n1')\n }\n end", "title": "" }, { "docid": "50577d4f68f34da7a8807153fde962fa", "score": "0.49122396", "text": "def file_fields\n @file_fields ||= []\nend", "title": "" }, { "docid": "89d29f0f2a7585646ab0489c40786549", "score": "0.49121395", "text": "def process()\n @file_info = FileInfoFile.new(@file_info_file)\n @namespace = @file_info.default_namespace\n \n namespaces_file = NamespacesFile.new(@uploads_directory, @scan_only)\n namespaces_file.add_namespace(@namespace)\n namespaces_file.write()\n @prefix = namespaces_file.prefix(@namespace)\n \n create_image_files_where_needed()\n end", "title": "" }, { "docid": "c03fa61b809c267b178a68071fe1e741", "score": "0.4898207", "text": "def initialize_fields(attributes, file)\n file.terms_for_editing.each do |key|\n # if value is empty, we create an one element array to loop over for output\n file[key] = attributes[key].empty? ? [''] : attributes[key]\n end\n end", "title": "" }, { "docid": "eec13b0e994dbab170cfece8cebaf123", "score": "0.4891139", "text": "def file_name_all(file_name)\n result = {}\n regex = /^p(\\d+)_s(\\d+)_u(\\d+)_d(\\d{4})(\\d{2})(\\d{2})_t(\\d{2})(\\d{2})(\\d{2})Z\\.([a-zA-Z0-9]+)$/\n file_name.scan(regex) do |project_id, site_id, uploader_id, year, month, day, hour, min, sec, extension|\n result[:raw] = {\n project_id:, site_id:, uploader_id:,\n year:, month:, day:,\n hour:, min:, sec:,\n offset: 'Z', ext: extension\n }\n\n result[:project_id] = project_id.to_i\n result[:site_id] = site_id.to_i\n result[:uploader_id] = uploader_id.to_i\n\n result[:utc_offset] = 'Z'\n result[:recorded_date_local] =\n Time.new(year.to_i, month.to_i, day.to_i, hour.to_i, min.to_i, sec.to_i, nil).iso8601(3)\n result[:recorded_date] =\n Time.new(year.to_i, month.to_i, day.to_i, hour.to_i, min.to_i, sec.to_i, 'Z').iso8601(3)\n result[:prefix] = ''\n result[:separator] = '_'\n result[:suffix] = ''\n result[:extension] = extension.blank? ? '' : extension\n end\n result\n end", "title": "" }, { "docid": "e9299830708d225d002b62a49a79ab4a", "score": "0.48732904", "text": "def file_fields\n self.fields.select { |field| field.type == :file }\n end", "title": "" }, { "docid": "c76161888c04e35751c0122268f7a5e6", "score": "0.48701894", "text": "def pull_data args\n already_seen = {}\n File.open args[:output_file_name], 'w' do |f|\n key = args[:fields].shift\n @collection.find().each do |doc|\n primary_field = doc[key]\n already_seen[primary_field] = args[:fields].map { |f| doc[f] }\n end\n already_seen.keys.sort.each do |key|\n f.puts key\n already_seen[key].each do |v|\n f.puts v\n end\n end\n end\n end", "title": "" }, { "docid": "e8d3e6d2394f401a80f198fb09eb473c", "score": "0.4859036", "text": "def process_file(file)\n @first_comment = false\n \n d = CodeFile.create_or_update_by_full_name :name => file.file_relative_name, :full_name => file.file_absolute_name\n\n @containers << d.id\n orig_file = File.new(file.file_absolute_name)\n lines = orig_file.readlines\n CLASSES[file.file_absolute_name].each do |key, klass|\n CLASSES[file.file_absolute_name][key][:line] = lines[klass[:line_no] - 1]\n end if CLASSES[file.file_absolute_name]\n MODULES[file.file_absolute_name].each do |key, mod|\n MODULES[file.file_absolute_name][key][:line] = lines[mod[:line_no] - 1]\n end if MODULES[file.file_absolute_name]\n\n # Process all of the objects that this file contains\n file.method_list.each { |child| process_method(child, file) }\n file.aliases.each { |child| process_alias(child, file) }\n file.constants.each { |child| process_constant(child, file) }\n file.requires.each { |child| process_require(child, file) }\n file.includes.each { |child| process_include(child, file) }\n file.attributes.each { |child| process_attribute(child, file) } \n\n # Recursively process contained subclasses and modules\n @file = file\n RDoc::TopLevel.all_classes_and_modules.each do |child| \n process_type_or_module(child, file) \n end\n \n comment = CodeComment.create_or_update_by_owner_id_and_owner_type_and_owner_type :exported_body => file.comment, :owner_id => d.id, :owner_type => d.class unless file.comment.blank? || Digest::MD5.hexdigest(file.comment) == @first_comment\n @comments << comment.id if comment\n \n end", "title": "" }, { "docid": "7595dcd3c4c5e97025786586bc0b3888", "score": "0.4858689", "text": "def file_field; end", "title": "" }, { "docid": "cb9d31cf8b20a189676fe5486830c2f9", "score": "0.48544496", "text": "def file_args(upload, upload_metadata)\n args = {\n external_identifier: upload.signed_id,\n label: ::File.basename(upload.filename),\n filename: upload.filename\n }\n args.merge!(upload_metadata)\n # Symbolize\n args.transform_keys(&:to_sym)\n end", "title": "" }, { "docid": "2a980c65123643c858a86527a5ae4be8", "score": "0.4843304", "text": "def rebuild_files\n @project.rebuild_files()\n end", "title": "" }, { "docid": "895b4ce03a871a7dd280133bdb554730", "score": "0.48402876", "text": "def altered_files\n parse!\n @altered_files\n end", "title": "" }, { "docid": "2b85ff75e0be7d855bf8114fccc65149", "score": "0.48373613", "text": "def parse_files(*files); end", "title": "" }, { "docid": "68e600437bd8334ca618b5af405577bc", "score": "0.48348194", "text": "def process_file\n instance_variable_get(:@fields).keys.each do |locale|\n request = Request.new(\n \"/#{space.id}/assets/#{id}/files/#{locale}/process\",\n {},\n nil,\n version: sys[:version]\n )\n request.put\n end\n sys[:version] += 1\n self\n end", "title": "" }, { "docid": "dd4c50fac228dd991c6a9ce8a0073057", "score": "0.48315144", "text": "def upgrade_file_keys(*keys)\n cname = self.collection_name\n\n self.find_each do |object|\n keys.each do |key|\n object.upgrade_file_key(key, false)\n end\n\n object.save(:validate => false)\n end\n\n self.database.drop_collection(cname+\".files\")\n self.database.drop_collection(cname+\".chunks\")\n end", "title": "" }, { "docid": "799d58ac13a8781e7a5fa9a1b355912a", "score": "0.48298526", "text": "def characterize(save: true)\n [:original_file, :intermediate_file, :preservation_file].each do |type|\n target_file = @file_set.try(type)\n next unless target_file\n @file_object = Valkyrie::StorageAdapter.find_by(id: target_file.file_identifiers[0])\n next unless image_valid?\n new_file = target_file.new(file_characterization_attributes.to_h)\n @file_set.file_metadata = @file_set.file_metadata.select { |x| x.id != new_file.id } + [new_file]\n end\n @file_set = persister.save(resource: @file_set) if save\n @file_set\n end", "title": "" }, { "docid": "39e8bcdc1960dfe0f93399fbb53c0890", "score": "0.4820657", "text": "def file_entities\n @world.plugins.reduce(core_file_entities) do |files, plugin|\n plugin.process(@world, files, @migration_id_generator)\n end\n end", "title": "" }, { "docid": "23c45251dbd8226432f439a758d699ba", "score": "0.48178473", "text": "def process_primary_files_with_changes_only\n # We get the diff only so that we know which files have changed.\n # It's ok to use the reference commits because we're dealing with\n # content AT files only.\n diff = @repository.diff(@from_git_commit, @to_git_commit, context_lines: 0)\n fwc = []\n diff.patches.each { |patch|\n file_name = patch.delta.old_file[:path]\n # Skip non content_at files\n next if !@file_list.include?(file_name)\n # next if !file_name.index('63-0728')\n unless file_name =~ /\\/content\\/.+\\d{4}\\.at\\z/\n raise \"shouldn't get here: #{ file_name.inspect }\"\n end\n\n @logger.info(\" - process #{ file_name }\")\n\n absolute_file_path = File.join(@repository.base_dir, file_name)\n # Initialize content AT file `to` with contents as of `to_git_commit`.\n # It's fine to use the reference sync commit as the sync operation\n # doesn't touch content AT files, only STM CSV ones.\n content_at_file_to = Repositext::RFile::ContentAt.new(\n '_', # Contents are initialized later via `#as_of_git_commit`\n @language,\n absolute_file_path,\n @any_content_type\n ).as_of_git_commit(@to_git_commit)\n\n compute_st_ops_attrs = {\n from_git_commit: @from_git_commit,\n to_git_commit: @to_git_commit,\n prev_last_operation_id: @prev_last_operation_id,\n execution_context: @execution_context,\n }\n\n compute_st_ops_attrs = refine_compute_st_ops_attrs(\n compute_st_ops_attrs,\n {\n from_table_release_version: @from_table_release_version,\n to_table_release_version: @to_table_release_version,\n absolute_file_path: absolute_file_path\n }\n )\n soff = SubtitleOperationsForFile.new(\n content_at_file_to,\n @repository.base_dir,\n compute_st_ops_attrs\n ).compute\n\n if soff.operations.any?\n # Only collect files that have subtitle operations\n @prev_last_operation_id = soff.last_operation_id\n fwc << soff\n end\n }\n\n # Then we add any files that have st_sync_required set to true and are\n # not in fwc already.\n @file_list.each { |content_at_filename|\n # Skip files that we have captured already\n next if fwc.any? { |soff| soff.content_at_file.repo_relative_path == content_at_filename }\n # Skip files that don't have st_sync_required set to true at to_git_commit\n dj_filename = content_at_filename.sub(/\\.at\\z/, '.data.json')\n # We use dj file contents at to_git_commit :at_child_or_ref\n dj_file = Repositext::RFile::DataJson.new(\n '_', # Contents are initialized later via #as_of_git_commit\n @language,\n dj_filename,\n @any_content_type\n ).as_of_git_commit(\n @to_git_commit,\n :at_child_or_ref\n )\n next if(dj_file.nil? || !dj_file.read_data['st_sync_required'])\n # This file is not in the list of fwc yet, and it has st_sync_required.\n # We add an soff instance with no operations. This could be a file\n # that has changes to subtitle timeslices only.\n content_at_file_from = Repositext::RFile::ContentAt.new(\n '_', # Contents are initialized later via `#as_of_git_commit`\n @language,\n content_at_filename,\n @any_content_type\n ).as_of_git_commit(@from_git_commit)\n soff = Repositext::Subtitle::OperationsForFile.new(\n content_at_file_from,\n {\n file_path: content_at_file_from.repo_relative_path,\n from_git_commit: @from_git_commit,\n to_git_commit: @to_git_commit,\n },\n [] # No operations\n )\n fwc << soff\n }\n # Return list of unique files with changes\n fwc.uniq\n end", "title": "" }, { "docid": "54173f3011c4da5ccd586c461cf7afc6", "score": "0.48162588", "text": "def build_ftk_file_items(coll_pid, ftk_report, ftk_xml_file_dir, display_derivative_dir)\n assembler = FtkItemAssembler.new(:collection_pid => coll_pid)\n assembler.process(ftk_report, ftk_xml_file_dir, display_derivative_dir)\nend", "title": "" }, { "docid": "5476acf4d6d8ea6f71ce0cc14034ca38", "score": "0.47906688", "text": "def compound_fields\n %i[file_data emma_data]\n end", "title": "" }, { "docid": "29ceade992a13fac65ee9aa0c25d4c92", "score": "0.47877315", "text": "def add_extra_files(*files); end", "title": "" }, { "docid": "b1e5b0e57e12e46461d589bf7b2afd10", "score": "0.47869465", "text": "def map_type_import_body(uploaded_file)\n { 'fileUpload' => UploadIO.new(uploaded_file, uploaded_file.content_type, uploaded_file.original_filename) }\n end", "title": "" }, { "docid": "2eed42d0b03bc109c37bdccf95778bc6", "score": "0.478361", "text": "def carve_undelete_file_info\n files = catalog_tree.search_using_journal(leaf_file_record, journal)\n \n for leaf in attribute_tree.search_using_journal\n wrapped_file_key, protection_class = attribute_tree.search_using_journal(leaf_filekey_record, journal)\n file_key = unwrap_using_class_keys_acquired_from_plist(wrapped_file_key, protection_class)\n file_keys << file_key\n end\n \n return files, file_keys\nend", "title": "" }, { "docid": "ddc8eefa2c34507385b23b0dd0320a09", "score": "0.4774793", "text": "def metadata_group(upload_group)\n upload_group.each_with_object({}) do |upload, obj|\n obj[upload.filename] = metadata.for(upload.filename)\n end\n end", "title": "" }, { "docid": "bfac8f12ce26da0cb5f888364728ebb1", "score": "0.47727993", "text": "def sync_many_files(files, user, api)\n files.group_by(&:project).each do |project, project_files|\n project_files.each_slice(FILES_CHUNK_SIZE) do |files_chunk|\n results = find_files_on_platform(files_chunk.map(&:dxid), project, api)\n\n files_chunk.each do |file|\n res = results.find { |r| r[:id] == file.dxid }\n # means that file doesn't exist on the platform anymore\n remove_local_file(file, user) unless res\n sync_file_state(res, file, user)\n end\n end\n end\n end", "title": "" }, { "docid": "9111d59f438f6201159a5f2934d381dc", "score": "0.47633982", "text": "def file\n # Se busca el proyecto\n @project = Project.find(params[:id])\n # Se archiva, seteandole un atributo del mismo en true\n @project.update_column(:filed, true)\n redirect_to :back, flash: {success: t('project.filed')}\n end", "title": "" }, { "docid": "31c30063f110c89387b417942496ca6f", "score": "0.47574702", "text": "def manipulate_file\n\t\tref = \"<w:attachedTemplate r:id=\\\"rId1\\\"/>\"\n\n\t\tif not File.stat(datastore['SOURCE']).readable?\n\t\t\tprint_error(\"Not enough rights to read the file. Aborting.\")\n\t\t\treturn nil\n\t\tend\n\n\t\t#lets extract our docx and store it in memory\n\t\tzip_data = unzip_docx\n\n\t\t#file to check for reference file we need\n\t\tfile_content = zip_data[\"word/settings.xml\"]\n\t\tif file_content.nil?\n\t\t\tprint_error(\"Bad \\\"word/settings.xml\\\" file, check if it is a valid .docx.\")\n\t\t\treturn nil\n\t\tend\n\n\t\t#if we can find the reference to our inject file, we don't need to add it and can just inject our unc path.\n\t\tif not file_content.index(\"w:attachedTemplate r:id=\\\"rId1\\\"\").nil?\n\t\t\tvprint_status(\"Reference to rels file already exists in settings file, we dont need to add it :)\")\n\t\t\tzip_data[\"word/_rels/settings.xml.rels\"] = @rels_file_data\n\t\t\t# lets zip the end result\n\t\t\tzip_docx(zip_data)\n\t\telse\n\t\t\t#now insert the reference to the file that will enable our malicious entry\n\t\t\tinsert_one = file_content.index(\"<w:defaultTabStop\")\n\n\t\t\tif insert_one.nil?\n\t\t\t\tinsert_two = file_content.index(\"<w:hyphenationZone\") # 2nd choice\n\t\t\t\tif not insert_two.nil?\n\t\t\t\t\tvprint_status(\"HypenationZone found, we use this for insertion.\")\n\t\t\t\t\tfile_content.insert(insert_two, ref )\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tvprint_status(\"DefaultTabStop found, we use this for insertion.\")\n\t\t\t\tfile_content.insert(insert_one, ref )\n\t\t\tend\n\n\t\t\tif insert_one.nil? && insert_two.nil?\n\t\t\t\tprint_error(\"Cannot find insert point for reference into settings.xml\")\n\t\t\t\treturn nil\n\t\t\tend\n\n\t\t\t#update the files that contain the injection and reference\n\t\t\tzip_data[\"word/settings.xml\"] = file_content\n\t\t\tzip_data[\"word/_rels/settings.xml.rels\"] = @rels_file_data\n\t\t\t#lets zip the file\n\t\t\tzip_docx(zip_data)\n\t\tend\n\t\treturn 0\n\tend", "title": "" }, { "docid": "6c7b0d4fa84460397bbd975922b8db20", "score": "0.4757313", "text": "def update\n DOCUMENT_PATHS.each do |attr_name, path|\n if path.match(/\\*/)\n instance_variable_get(\"@#{attr_name}\").each do |simple_file_name, contents|\n replace_entry(\"word/#{simple_file_name}.xml\", contents.serialize(save_with: 0))\n end\n else\n xml_document = instance_variable_get(\"@#{attr_name}\")\n replace_entry path, xml_document.serialize(save_with: 0) if xml_document\n end\n end\n end", "title": "" }, { "docid": "969607ee6ff95babab24eb2931766f86", "score": "0.4739145", "text": "def referenced_files\r\n\t\t(\r\n\t\t\t[file] +\r\n\t\t\t%w[sourcepath importfile].flat_map do |att|\r\n\t\t\t\tfind(att=>/./).flat_map do |asset|\r\n\t\t\t\t\tasset[att].values.compact.map do |path|\r\n\t\t\t\t\t\tpath.sub!(/#.+/,'')\r\n\t\t\t\t\t\tabsolute_path(path) unless path.empty?\r\n\t\t\t\t\tend.compact\r\n\t\t\t\tend\r\n\t\t\tend +\r\n\t\t\tfind.flat_map do |asset|\r\n\t\t\t\tasset.properties.select{ |name,prop| prop.type=='Texture' }.flat_map do |name,prop|\r\n\t\t\t\t\tasset[name].values.compact.uniq.map{ |path| absolute_path(path) }\r\n\t\t\t\tend\r\n\t\t\tend +\r\n\t\t\tfind(_type:'Text').flat_map do |asset|\r\n\t\t\t\tasset['font'].values.compact.map{ |font| absolute_path(font) }\r\n\t\t\tend +\r\n\t\t\[email protected]('/UIP/Project/Classes/*/@sourcepath').map{ |att| absolute_path att.value }\r\n\t\t).uniq\r\n\tend", "title": "" }, { "docid": "b3fc7b8b1ef9aecc64d6b3040000f335", "score": "0.4738697", "text": "def do_stuff_with_files(extension=\".rb\")\n start_dir = START_PATH\n Dir.each_child(\"./\") do |file|\n if File.file?(file)\n keyword = find_keyword(file, extension)\n next unless keyword\n key = make_key(keyword)\n key_path = search_for_path(start_dir, key, keyword)\n next unless key_path\n unless key_location_exist?(key_path)\n FileUtils.mkdir(key_path)\n end\n FileUtils.mv file, key_path\n end\n end\nend", "title": "" }, { "docid": "cdae932091e6f8b3793c1366ea1c54be", "score": "0.47297454", "text": "def tidy_up\n Dir[\"*nin\"].each do |file|\n File.delete(file)\n end\n Dir[\"*nhr\"].each do |file|\n File.delete(file)\n end\n Dir[\"*nsq\"].each do |file|\n File.delete(file)\n end\n Dir[\"*blast\"].each do |file|\n File.delete(file)\n end\n end", "title": "" }, { "docid": "9864882618f51b6366129cf48dc962f5", "score": "0.4727", "text": "def retrieve_cloud_files(files); end", "title": "" }, { "docid": "17519ea35d740a31f99457d97da10235", "score": "0.47256303", "text": "def parse(data)\n data = Ox.parse(data)\n \n return unless data\n\n data = data.root if data.is_a?(Ox::Document)\n\n data.locate('Project').each do |project|\n attrs = project.attributes\n name = attrs[:name]\n next if options[:filter].is_a?(Array) && !options[:filter].include?(name)\n if self.projects.has_key? name\n self.projects[name].import attrs\n else\n self.projects[name] = Project.new attrs\n end\n end\n end", "title": "" }, { "docid": "0ffc7b9741cb4299dab7d87901f23be3", "score": "0.47249308", "text": "def process_file(file, files)\n # puts \"processing file #{file.to_s}\"\n case check_file_ext(file)\n when 'atp'\n files << file unless files.include?(file)\n when 'avc'\n files << file unless files.include?(file)\n when 'list'\n parse_list(file, files)\n end\n end", "title": "" }, { "docid": "9818bac6060a7eca5a0befe103644b23", "score": "0.4722721", "text": "def parse_in_order(*files); end", "title": "" }, { "docid": "ba74660c869d55a8530540e5915fa555", "score": "0.47149017", "text": "def characterize(save: true)\n new_file = original_file.new(file_characterization_attributes.to_h)\n @file_node.file_metadata = @file_node.file_metadata.select { |x| x.id != new_file.id } + [new_file]\n @persister.save(resource: @file_node) if save\n @file_node\n end", "title": "" }, { "docid": "5dffc9fcaa6d4ddec025414ecf713990", "score": "0.4710439", "text": "def uploaded_file=(file_field)\n self.filename = base_part_of(file_field.original_filename)\n\n f_str = Iconv.conv('utf-8', self.encoding, file_field.read)\n\n f = StringIO.new(f_str)\n\n if self.format == 'OBT'\n it = OBNOTextIterator.new(f, self.sentence_delimiter == 'delimiter')\n elsif self.format == 'VRT'\n it = VRTReader.new(f)\n else\n raise RuntimeError\n end\n\n it.each_sentence {|s| sentences << s}\n f.close()\n\n # add postamble stored in iterator after parsing last sentence\n # TODO add support for arbitrary data for OBT format\n if self.format = 'VRT'\n self.postamble = it.postamble\n end\n end", "title": "" }, { "docid": "2f10ce25117e4ae02b6522087aff4f2c", "score": "0.47094864", "text": "def upload_file=(file_name)\n self.file_field(:id=>\"multifile_upload\").set(File.expand_path(File.dirname(__FILE__)) + \"/../../data/sakai-oae/\" + file_name)\n end", "title": "" }, { "docid": "d34af1cd8fc51219286da493f9f78595", "score": "0.46836963", "text": "def process_and_import(data_file)\n items = JSON.load(File.open(data_file))[\"result\"]\n\n items.each do |item|\n date = item[\"/film/film/initial_release_date\"]\n\n next unless date\n\n case date.length\n when 4\n date = date + \"-01-01\"\n when 7\n date = date + \"-01\"\n end\n\n date = Date.parse(date)\n\n # Query current database so that we backfill/update information if the\n # film already exists\n film = Film.where(\n freebase_id: item[\"/type/object/mid\"]\n ).first\n film = Film.where(\n title: item[\"/type/object/name\"],\n year: date.year\n ).first unless film\n\n film = Film.new unless film\n film.title = valid_item?(item[\"/type/object/name\"]) unless film.title\n film.release_date = valid_item?(date) unless film.release_date\n film.year = date.year unless film.year\n film.freebase_id = item[\"/type/object/mid\"] unless film.freebase_id\n film.freebase_guid = item[\"/type/object/guid\"] unless film.freebase_guid\n film.save\n end\n end", "title": "" }, { "docid": "427a193d2b1b2b2e29f6e963b4712a24", "score": "0.46829978", "text": "def create_upload_files(record)\n return unless record.mapper.respond_to?(:files)\n files_to_attach = record.mapper.files\n return [] if files_to_attach.nil? || files_to_attach.empty?\n\n uploaded_file_ids = []\n files_to_attach.each do |filename|\n file = File.open(find_file_path(filename))\n uploaded_file = Hyrax::UploadedFile.create(user: depositor, file: file)\n uploaded_file_ids << uploaded_file.id\n file.close\n end\n uploaded_file_ids\n end", "title": "" }, { "docid": "78df5b349d679b8858b6ce5d3dc4846f", "score": "0.4681891", "text": "def rearrange_docs!\n docs_table = {}\n custom_order = {}\n\n # pre-sort to normalize default array across platforms and then proceed to create a Hash\n # from that sorted array.\n docs.sort.each do |doc|\n docs_table[doc.relative_path] = doc\n end\n\n metadata[\"order\"].each do |entry|\n custom_order[File.join(relative_directory, entry)] = nil\n end\n\n result = Jekyll::Utils.deep_merge_hashes(custom_order, docs_table).values\n result.compact!\n self.docs = result\n end", "title": "" }, { "docid": "9ba7fb875266bd1476905d58204f0c95", "score": "0.46665448", "text": "def process_other_source_files\n files = @options[:include_source_files].flatten\n files.each do |f|\n FileUtils.cp Dir[f], @working_dir\n end\n end", "title": "" }, { "docid": "975a4023acc38be4018157e9bf7f72c5", "score": "0.4657848", "text": "def initialize_fields(attributes, file)\n terms.each do |key|\n file[key] = attributes[key]\n end\n end", "title": "" }, { "docid": "527c1b4168aaeefcb280a38e6f2c0daa", "score": "0.46488672", "text": "def files2table(files)\n files.map { |f|\n f.to_hash([:name, :path, :status, :error_string, :namespace,\n :version, :docbook, :tag, :ts, :size, :checksum,\n :mime, :includes, :included_by, :references, :referenced_by])\n }\n end", "title": "" }, { "docid": "9888fef2c98d2a30f83fe33305bd016f", "score": "0.46443793", "text": "def map_activestorage_files_as_file_objects\n files.map do |file|\n path = file_path_for(file)\n original_filename = file.filename.to_s\n File.open(path) do |f|\n # We're exploiting the fact that Hydra-Works calls original_filename on objects passed to it, if they\n # respond to that method, in preference to looking at the final portion of the file path, which,\n # because we fished this out of ActiveStorage, is just a hash. In this way we present Fedora with the original\n # file name of the object and not a hashed or otherwise modified version temporarily created during ingest\n f.send(:define_singleton_method, :original_filename, -> { original_filename })\n yield f\n end\n end\n end", "title": "" }, { "docid": "1bb4a65d6a41094d7396a08cb8719265", "score": "0.4643317", "text": "def project_params\n params.require(:project).permit(:title, :description, :category, :project_type, :dossier, :dossier_url,\n project_files_attributes: [ :id, :name, :attachment, :_destroy ])\n end", "title": "" }, { "docid": "d4d3585698e358537fe8bbeea3a8c8e5", "score": "0.4637415", "text": "def index(data)\n indexH = Hash.new { |hash, key| hash[key] = [] }\n data.each_pair do |filename, tags|\n tags.each do |tag|\n if tag.is_a? Symbol\n indexH[tag] << filename\n elsif tag.is_a? Hash\n tag.each_pair do |sub_key, sub_value|\n #key = tag.keys.first\n #value = tag[key]\n value = sub_key\n indexH[sub_key] << sub_value #in case of project and sample it store (samples|projects) [(samples|projects)_name]\n indexH[sub_value]<< filename #stores for each (sample|project) name its filename so i can search directly for its name\n end\n end\n end #tags\n end #data\n indexH.each_pair do |key, value|\n indexH[key].uniq!\n end\n end", "title": "" }, { "docid": "762dd1bd9372405974ef507bb949b484", "score": "0.46349922", "text": "def diff_project_files(group)\n find_fs_files(group.real_path)\n\n group.groups.each do |child|\n diff_project_files(child)\n end\n\n group.files.each do |file_ref|\n path = file_ref.real_path\n entry = track_file(path)\n entry.in_target = true\n entry.ref = file_ref\n\n if path.file?\n entry.in_source = true\n end\n end\n end", "title": "" }, { "docid": "ac35e9c498eae4d42d5f8d9d9911ac04", "score": "0.46337602", "text": "def file_categories(project_id)\n records \"attachment-category\", \"/projects/#{project_id}/attachment_categories\"\n end", "title": "" }, { "docid": "84f8368ee02ff437e04e082c8e5561e7", "score": "0.46298137", "text": "def test_update_document_fields\n local_file_name = 'test_multi_pages.docx'\n remote_file_name = 'TestUpdateDocumentFields.docx'\n\n upload_file File.join(local_test_folder, 'Common/' + local_file_name), remote_data_folder + '/' + remote_file_name\n\n request = UpdateFieldsRequest.new(name: remote_file_name, folder: remote_data_folder)\n\n result = @words_api.update_fields(request)\n assert_equal false, result.nil?\n end", "title": "" }, { "docid": "329595217da1779ef5df93a0614f35df", "score": "0.46202034", "text": "def processField500s(field, index)\n dataFields = []\n field.find_all do |subfield| \n if subfield.code == \"a\"\n text = cleanField(subfield.value)\n results = annotate(text)\n unless results.nil? \n \n if results[\"found_terms\"].length > 0 # for each found term present, we add a subfield for each date...\n results[\"dates\"].each_with_index do |date, date_index| # iterate through the dates and make them into 981\n df = MARC::DataField.new(\"981\", \"\", \"\", [\"a\", date ], [ \"b\", field.tag], [\"c\", index], [\"e\", \"a\"], [\"f\", date_index] ) \n if field.tag == \"500\" # we add all the terms a d subfiled to the 500 field, but not the others. \n results[\"found_terms\"].each { |ft| df.subfields << MARC::Subfield.new(\"d\", ft ) }\n end\n dataFields << df\n end\n end\n end\n end\n end\n dataFields\n end", "title": "" }, { "docid": "199f95ccc8bcc3d4e2ad8946d6551306", "score": "0.4618045", "text": "def add_from_upload\n\t\tbegin\n\t\t\tproject = Project.editable(current_user).find_by_name(params[:project_id])\n\t\t\traise \"The project does not exist, or you are not authorized to make a change to the project.\\n\" unless project.present?\n\t\t\traise ArgumentError, \"sourcedb is not specified.\" unless params[\"sourcedb\"].present?\n\n\t\t\tsourcedb = params[\"sourcedb\"]\n\t\t\tfilename = params[:upfile].original_filename\n\t\t\text = File.extname(filename)\n\t\t\traise ArgumentError, \"Unknown file type: '#{ext}'.\" unless ['.txt'].include?(ext)\n\n\t\t\traise \"Up to 10 jobs can be registered per a project. Please clean your jobs page.\" unless project.jobs.count < 10\n\n\t\t\tfilepath = File.join('tmp', \"add-docs-to-#{params[:project_id]}-#{Time.now.to_s[0..18].gsub(/[ :]/, '-')}#{ext}\")\n\t\t\tFileUtils.mv params[:upfile].path, filepath\n\n\t\t\t# AddDocsToProjectFromUploadJob.perform_now(project, sourcedb, filepath)\n\n\t\t\tactive_job = AddDocsToProjectFromUploadJob.perform_later(project, sourcedb, filepath)\n\t\t\tjob = Job.find_by(active_job_id: active_job.job_id)\n\t\t\tmessage = \"The task, '#{active_job.job_name}', is created.\"\n\n\t\t\trespond_to do |format|\n\t\t\t\tformat.html {redirect_back fallback_location: root_path, notice: message }\n\t\t\t\tformat.json {render json: {message: message, task_location: project_job_url(project.name, job.id, format: :json)}, status: :ok}\n\t\t\tend\n\t\trescue => e\n\t\t\trespond_to do |format|\n\t\t\t\tformat.html {redirect_back fallback_location: root_path, notice: e.message }\n\t\t\t\tformat.json {render json: {message: e.message}, status: :unprocessable_entity}\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "9ab0f399b3f1f1b82bc69bc93099dc6a", "score": "0.46165735", "text": "def file_add_keywords(files=nil,keywords=nil)\n \n #1.validate class types\n #Looking for File objects or an array of File objects\n unless files.is_a?(Files) || (files.is_a?(Array) && files.first.is_a?(Files))\n warn \"Argument Error: Invalid type for first argument in \\\"file_add_keywords\\\" method.\\n\" +\n \" Expected one the following:\\n\" +\n \" 1. Single Files object\\n\" +\n \" 2. Array of Files objects\\n\" +\n \" Instead got => #{files.inspect}\"\n return false \n end \n\n unless keywords.is_a?(Keywords) || (keywords.is_a?(Array) && keywords.first.is_a?(Keywords))\n warn \"Argument Error: Invalid type for second argument in \\\"file_add_keywords\\\" method.\\n\" +\n \" Expected one the following:\\n\" +\n \" 1. Single Keywords object\\n\" +\n \" 2. Array of Keywords objects\\n\" +\n \" Instead got => #{keywords.inspect}\"\n return false \n end \n \n #2.build file json array for request body\n #There are four acceptable combinations for the arguments.\n \n if files.is_a?(Files) \n if keywords.is_a?(Keywords) #1. Two Single objects\n uri = URI.parse(@uri + \"/Files/#{files.id}/Keywords/#{keywords.id}\")\n post(uri,{})\n else #2. One File object and an array of Keywords objects\n #loop through keywords objects and append the new nested keyword to the file\n keywords.each do |keyword|\n files.keywords << NestedKeywordItems.new(keyword.id)\n end \n uri = URI.parse(@uri + \"/Files\")\n put(uri,files)\n end\n else \n if keywords.is_a?(Array) #3. Two arrays\n keywords.each do |keyword|\n uri = URI.parse(@uri + \"/Keywords/#{keyword.id}/Files\")\n data = files.map { |files_obj| {:id => files_obj.id} }\n post(uri,data)\n end\n else #4. Files array and a single Keywords object\n uri = URI.parse(@uri + \"/Keywords/#{keywords.id}/Files\")\n data = files.map { |files_obj| {:id => files_obj.id} }\n post(uri,data)\n end\n end\n \n end", "title": "" }, { "docid": "5cfb6a82b8ebcc7d3f6508ab629e0a4e", "score": "0.46138984", "text": "def map_activestorage_files_as_file_objects\n files.map do |file|\n path = file_path_for(file)\n original_filename = file.filename.to_s\n File.open(path) do |f|\n # We're exploiting the fact that Hydra-Works calls original_filename on objects passed to it, if they\n # respond to that method, in preference to looking at the final portion of the file path, which,\n # because we fished this out of ActiveStorage, is just a hash. In this way we present Fedora with the original\n # file name of the object and not a hashed or otherwise modified version temporarily created during ingest\n f.send(:define_singleton_method, :original_filename, ->() { original_filename })\n yield f\n end\n end\n end", "title": "" }, { "docid": "25b9ca343f1428b86b8de70b25321ad8", "score": "0.46104887", "text": "def normalize_multipart_upload(params)\n fname = params[:key].split('/').last\n if fname == '${filename}'\n # Can't change original name. Just rename key\n params[:key].sub!('${filename}', params[:file].original_filename)\n # Rebuild s3_uri with new key\n rebuild_uri(params)\n else\n # Change stored filename for more flexibility\n params[:file].original_filename = fname\n end\n end", "title": "" }, { "docid": "958a06f83622cf9606a99ce90ff6ee9c", "score": "0.46093106", "text": "def process_input_file\n\t\t\tinput_file = File.open(@params[:input_file], 'r')\n\t\t\tfile_terms = convert_contents_to_search_string(input_file.read)\n\t\t\tadd_terms(file_terms)\n\t\tend", "title": "" }, { "docid": "cd08eba386053f7424130a0bbdd0dae8", "score": "0.4607601", "text": "def test_delete_document_fields\n local_file_name = 'test_multi_pages.docx'\n remote_file_name = 'TestDeleteSectionParagraphFields.docx'\n\n upload_file File.join(local_test_folder, 'Common/' + local_file_name), remote_data_folder + '/' + remote_file_name\n\n request = DeleteFieldsRequest.new(name: remote_file_name, node_path: '', folder: remote_data_folder)\n\n @words_api.delete_fields(request)\n end", "title": "" }, { "docid": "d2eef845c68f2a65fac9d00535dcd58c", "score": "0.4599243", "text": "def filtered(files); end", "title": "" }, { "docid": "6aa3255fb94bd56d3823f9e510046c3d", "score": "0.45974055", "text": "def post_process(file)\n if File.basename(file.to_s).match(/library/)\n oldfile = file\n file = file.to_s.sub(\"library\", @options[:lib_name_u])\n FileUtils.mv(oldfile, file)\n end\n if File.dirname(file.to_s).split(\"/\").last == \"library\"\n origdir = File.dirname(file.to_s)\n dirarr = origdir.split(\"/\")\n dirarr[dirarr.size-1] = @options[:lib_name_u]\n new_dir = File.join(dirarr)\n mkdir(new_dir)\n oldfile = file\n file = File.join(new_dir, File.basename(file))\n FileUtils.mv(oldfile, file)\n FileUtils.rmdir(origdir)\n end\n if file.to_s.match(/\\.seed$/)\n out_file = Pathname.new(file.to_s.sub(/\\.seed$/, ''))\n # Don't overwrite a file of the same name, unless they --force\n if copy_check(out_file)\n template = ::ERB.new(File.read(file))\n # This binding has access to any instance variables of\n # the ProjectCreator instance\n result = template.result(binding)\n File.open(file.to_s.sub(/\\.seed$/,''), 'w+') do |io|\n io.puts result\n end\n end\n # Remove the seed file whether we copied or not\n FileUtils.rm_f(file)\n end\n end", "title": "" }, { "docid": "8509b86f408c1fd0a5cf1a7e2f043c6a", "score": "0.4595524", "text": "def move_custom_provenance_value\n @record.xpath('./datafield[@tag=\"650\"]/subfield[@code=\"a\"]').each do |subfield|\n next unless subfield.text.start_with?('PRO ')\n\n # Move value to 561$a\n provenance = subfield.text.gsub(/^PRO /, '')\n Nokogiri::XML::Builder.with(@doc.at('record')) do |xml|\n xml.datafield('ind1' => ' ', 'ind2' => ' ', 'tag' => '561') do\n xml.subfield(provenance, 'code' => 'a')\n end\n end\n\n # Remove field\n subfield.parent.remove\n end\n end", "title": "" }, { "docid": "e98d94d2c0c7acca7e2ed3de5ac729ef", "score": "0.45946386", "text": "def project_code_arrays\n [:controller_files, :model_files, :view_files, :lib_files]\n end", "title": "" }, { "docid": "95e488c40aed89c59d458db7aab33f99", "score": "0.4591029", "text": "def characterize(save: true)\n unzip_original_file if zip_file?\n new_file = original_file.new(file_characterization_attributes.to_h)\n @file_set.file_metadata = @file_set.file_metadata.select { |x| x.id != new_file.id } + [new_file]\n @file_set = @persister.save(resource: @file_set) if save\n clean_up_zip_directory if zip_file?\n @file_set\n end", "title": "" } ]
1b5b833c954f4a6ca1fddfd9de0170d9
create a file with the name self.git_name into the keydir of the local repo gitosisadmin
[ { "docid": "47be16e1f5657d6515c8b41a394c96bd", "score": "0.731282", "text": "def add_key_to_git\n path =GITOSIS_ADMIN_LOCAL_PATH + \"/keydir/\" + self.git_name.to_s+\".pub\" \n puts path\n File.open(path,'w'){ |f| f.write(self.value)}\n apply_changes(\"Added #{self.git_name.to_s}.pub file to the repos\")\n end", "title": "" } ]
[ { "docid": "cf010b9136bc0a124068e71d569ba91a", "score": "0.6503538", "text": "def create_in_repo(repo, base_dir)\n repo.chdir do\n # do not create if already exists!\n next if (File.exist? base_dir) && (File.directory? base_dir)\n create_dir_for_modelitem(base_dir)\n\n # create main JSON file in repo\n fname = File.join(base_dir, FILE_JSON)\n buf = self.to_core_hash.to_json + \"\\n\"\n File.open(fname, 'w') { |f| f.write buf }\n repo.add fname\n end\n self\n end", "title": "" }, { "docid": "3dbfba984d8159f714dc6e989d1e0256", "score": "0.64951396", "text": "def execute\n @gitRepository.create(@path)\n end", "title": "" }, { "docid": "55b3d2e92d5fd6ece4bfefe71ef1e93c", "score": "0.64803684", "text": "def repo_make(name)\n path = repo_path(name)\n path.mkpath\n Dir.chdir(path) do\n `git init`\n repo_make_readme_change(name, 'Added')\n `git add .`\n `git commit -m \"Initialized.\"`\n end\n path\n end", "title": "" }, { "docid": "67ab35c2f988b69236a7982a9b5ae19a", "score": "0.64746654", "text": "def key\n \"git-#{name}\"\n end", "title": "" }, { "docid": "67ab35c2f988b69236a7982a9b5ae19a", "score": "0.64746654", "text": "def key\n \"git-#{name}\"\n end", "title": "" }, { "docid": "8af5ab0c7463ab7f4b012587b9ae3444", "score": "0.6352728", "text": "def git_path() = Pathname.new('.')", "title": "" }, { "docid": "1e4525ee1c64c9fa0d4691a74b777811", "score": "0.6276577", "text": "def git_filename\n File.join(GalleryConfig.directories.repo, git_basename)\n end", "title": "" }, { "docid": "1d1d5a7da32a8320a0a3da2630df321b", "score": "0.6226694", "text": "def make_file(path, file_data, author)\n # Get the file path to write to using the ruby File module.\n abs_path = File.join(@repos_path, path)\n # Actually create the file.\n File.open(abs_path, 'w+') do |file|\n file.write file_data.force_encoding('UTF-8')\n end\n\n # Get the hash of the file we just created and added\n oid = Rugged::Blob.from_workdir(@repos, path)\n index = @repos.index\n index.add(path: path, oid: oid, mode: 0100644)\n index.write\n Rugged::Commit.create(@repos, commit_options(@repos, author, 'Add file'))\n g = Git.open(@repos.workdir)\n g.push\n end", "title": "" }, { "docid": "17d258ace0eea0187e8c2e34b73e0f47", "score": "0.6193123", "text": "def git\n @git ||= \"#{Dawn::Account.current.username}~#{name}.git\"\n end", "title": "" }, { "docid": "b173d6bba42dc1271856a9257b0715de", "score": "0.6191977", "text": "def repo_directory_setup repo\n\n Dir.chdir \"HER-data\"\n name = repo.id.to_s + \"_\" + repo.repo_name.to_s\n system(\"mkdir\", name)\n Dir.chdir \"../HER-core\"\n system('sh', 'Scripts/set_up.sh', \"../HER-data/\" + name)\n\n Dir.chdir \"../\"\n\n end", "title": "" }, { "docid": "71a937d21611f52b852d0f996fc20a7f", "score": "0.61891246", "text": "def write_git_setup\n remove_file target.join('.gitignore')\n template 'git/gitignore.erb', target.join('.gitignore')\n\n template 'git/puppet-git-hooks-pre-commit.erb', target.join('.git_hooks/pre-commit')\n template 'git/branch-prefix-prepare-commit-msg.erb', target.join('.git_hooks/prepare-commit-msg')\n chmod target.join('.git_hooks/pre-commit'), 0755\n chmod target.join('.git_hooks/prepare-commit-msg'), 0755\n\n unless File.exists?(target.join('.git'))\n inside target do\n run 'git init', capture: true\n run 'git add -A', capture: true\n end\n template 'git/puppet-git-hooks-pre-commit.erb', target.join('.git/hooks/pre-commit')\n template 'git/branch-prefix-prepare-commit-msg.erb', target.join('.git/hooks/prepare-commit-msg')\n chmod target.join('.git/hooks/pre-commit'), 0755\n chmod target.join('.git/hooks/prepare-commit-msg'), 0755\n\n create_file target.join('.git_hooks_installed')\n end\n end", "title": "" }, { "docid": "9d5a2e6fcaa76c17c423a329bd84908e", "score": "0.6155585", "text": "def gitconfig_installer\n template_file = \"gitconfig.erb\"\n output_file = ENV[\"HOME\"] + \"/.gitconfig\"\n\n # If we find an older install with the symlink in place,\n # clean that up first\n if File.symlink?(output_file)\n File.unlink(output_file)\n puts \" deleted symlink #{output_file}...\"\n end\n\n unless File.exists?(output_file)\n\n puts \"\"\n puts \"=== Creating #{output_file} ===\"\n puts \"\"\n\n print \" Name: \"\n $git_name = STDIN.gets.chomp\n\n print \" Email address: \"\n $git_email = STDIN.gets.chomp\n\n print \" GitHub username: \"\n $github_username = STDIN.gets.chomp\n\n print \" GitHub API token: \"\n $github_api_token = STDIN.gets.chomp\n\n template = ERB.new(File.read(template_file))\n File.open(output_file, \"w\") do |f|\n f.write(template.result())\n end\n\n ret = File.chmod(0600, output_file)\n if ret != 1\n puts \"WARN: chmod of #{output_file} failed!\"\n end\n\n end\nend", "title": "" }, { "docid": "dc540d92462ad1a315132acaa7a91518", "score": "0.61249495", "text": "def repo\n \"#{creator.username}/#{name}\"\n end", "title": "" }, { "docid": "dc540d92462ad1a315132acaa7a91518", "score": "0.61249495", "text": "def repo\n \"#{creator.username}/#{name}\"\n end", "title": "" }, { "docid": "ed8ae5980aedd28bf04f347c6a1cb9ca", "score": "0.60960186", "text": "def add_to_git\n cmd = `git --git-dir=#{GITOSIS_ADMIN_LOCAL_PATH}/.git --work-tree=#{GITOSIS_ADMIN_LOCAL_PATH} add .`\n logger.info \"Added changes to gitosis-admin in keys\"\n end", "title": "" }, { "docid": "0f3c9f50f2dbfc6226ae28c9dcf0a479", "score": "0.605611", "text": "def create_ssh_keys\n\n ssh_loc = lambda { |str| File.join('~/.ssh', str) }\n\n user = ARGV[1]\n raise \"File name is not defined.\" unless user\n\n names = []\n names << (priv = \"#{user}.private\")\n names << (pub = \"#{user}.pub\")\n names << (base = \"#{user}\")\n\n files = names.map { |str| ssh_loc.call(str) }\n\n # Make sure we don't overwrite existing files.\n files.each do |old_file|\n if File.file?( old_file )\n raise( \"Can't overwrite existing file: #{old_file}\" )\n end \n end \n\n sh \"ssh-keygen -t rsa -f #{ssh_loc.call base}\"\n\n sh \"mv #{ssh_loc.call base } #{ssh_loc.call base }.private\"\n sh \"mv #{ssh_loc.call base }.pub #{ssh_loc.call base }\" \n sh \"chmod 700 ~/.ssh\"\n\n [base, priv].each do | str |\n sh \"chmod 600 #{ssh_loc.call str}\"\n end \n end", "title": "" }, { "docid": "be783789896bd8d604d830dc00b4332c", "score": "0.603403", "text": "def setup_git_ssh(key)\n info :setup_git_ssh\n path, conf = '~/.dpl/git-ssh', asset(:dpl, :git_ssh).read % expand(key)\n open(path, 'w+') { |file| file.write(conf) }\n chmod(0740, path)\n ENV['GIT_SSH'] = expand(path)\n end", "title": "" }, { "docid": "c5901621fe63c45a66e43b9dad0244d1", "score": "0.5983505", "text": "def write\n open\n\n # TODO lock\n \n # Yield to the block, which will access the working directory.\n yield @git\n\n # TODO unlock\n end", "title": "" }, { "docid": "79d65295af214236cd16940d0b9e623c", "score": "0.59750634", "text": "def create\n unless File.exists?(ssh_dir)\n FileUtils.mkdir_p(ssh_dir)\n FileUtils.chmod(0770, ssh_dir)\n end\n\n if File.exists?(file_path)\n Rails.logger.debug(\"Found existing authorized_keys file: #{file_path}\")\n else\n Rails.logger.debug(\"Creating authorized_keys file: #{file_path}\")\n FileUtils.touch(file_path)\n end\n\n # TODO\n # FileUtils.chmod doesn't set correct permissions\n # FileUtils.chmod(0660, authorized_keys_file())\n App.call_os_cmd(\"chmod 0660 #{file_path}\")\n App.call_os_cmd(\"chgrp #{app_group} #{file_path}\")\n\n if File.exists?(file_path)\n Rails.logger.debug('authorized_keys file initialization: [ OK ]')\n else\n Rails.logger.debug('authorized_keys file initialization: [ FAILED ]')\n end\n end", "title": "" }, { "docid": "a320e69045b578bfa189ef9fae3f8963", "score": "0.596745", "text": "def create_repo!(repo_name)\n repo_dir_path = repo_dir_path(repo_name)\n\n repo_dir_path.mkpath\n\n FileUtils.cd(repo_dir_path) do\n system \"git init --bare\"\n end\n\n FileUtils.chown_R(git_user, git_group, repo_dir_path)\n end", "title": "" }, { "docid": "833f83a98119f0d86aabaefd4977cbfd", "score": "0.59566444", "text": "def write_deploy_key\n # Check if we have a local path or some actual content\n return if new_resource.deploy_key_is_local?\n file new_resource.deploy_key_path do\n owner new_resource.user\n group new_resource.group\n mode '600'\n content new_resource.deploy_key\n sensitive true\n end\n end", "title": "" }, { "docid": "59fc167735fbd42de740e42924adc0bb", "score": "0.5946744", "text": "def create_key(repo_full_name, pr_num)\n Digest::MD5.hexdigest(\"#{repo_full_name}\\n#{pr_num}\")\n end", "title": "" }, { "docid": "fcdf8b57cd9fce85791713f6a26d8e0c", "score": "0.5942455", "text": "def create_local_repository\n # TODO: background job.\n @grit_repo = Grit::Repo.init_bare local_path\n FileUtils.chmod_R 0770, local_path\n begin\n FileUtils.chown_R ConfigVar['git_user'], nil, local_path\n rescue ArgumentError\n # Happens in unit testing, when the git user isn't created yet.\n raise unless Rails.env.test?\n rescue Errno::EPERM\n # Not root, not allowed to chown. \n end\n \n @grit_repo\n end", "title": "" }, { "docid": "7a27b422697618c3151b856190f3ba58", "score": "0.5936651", "text": "def save_new\n base.in_branch do |wd|\n base.logger.info \"saving #{ticket_name}\"\n \n Dir.mkdir(ticket_name)\n Dir.chdir(ticket_name) do\n base.new_file('TICKET_ID', ticket_name)\n base.new_file('ASSIGNED_' + email, email)\n base.new_file('STATE_' + state, state)\n base.new_file('TICKET_TITLE',self.title)\n base.new_file('TICKET_DESCRIPTION',self.description) if self.description\n\n # add initial comment\n #COMMENT_080315060503045__schacon_at_gmail\n base.new_file(comment_name(email), opts[:comment]) if opts[:comment]\n\n # add initial tags\n if opts[:tags] && opts[:tags].size > 0\n opts[:tags] = opts[:tags].map { |t| t.strip }.compact\n opts[:tags].each do |tag|\n if tag.size > 0\n tag_filename = 'TAG_' + Ticket.clean_string(tag)\n if !File.exists?(tag_filename)\n base.new_file(tag_filename, tag_filename)\n end\n end\n end\n end \n end\n\t \n base.git.add\n base.git.commit(\"added ticket #{ticket_name}\")\n end\n # ticket_id\n end", "title": "" }, { "docid": "359cfb82c65e5512ed3ebfdc637beea2", "score": "0.5935006", "text": "def gitconfig_installer\n\ttemplate_file = 'gitconfig.erb'\n\toutput_file = \"#{ENV['HOME']}/.gitconfig\"\n\tcache_file = \"#{output_file}.cache\"\n\tgitconfig_params = Hash.new\n\n\t# If we find an older install with the symlink in place,\n\t# clean that up first\n\tif File.symlink?(output_file)\n\t\tFile.unlink output_file\n\t\tputs \" deleted symlink #{output_file}\"\n\tend\n\n\tunless File.exists? cache_file\n\n\t\tputs ' creating ~/.gitconfig.cache'\n\t\tputs\n\t\tputs 'Enter .gitconfig data'\n\t\tputs '(press enter to leave a value blank.)'\n\t\tputs\n\n\t\tprint 'Name: '\n\t\tgitconfig_params['git_name'] = STDIN.gets.chomp\n\n\t\tprint 'Email address: '\n\t\tgitconfig_params['git_email'] = STDIN.gets.chomp\n\n\t\tprint 'GitHub username: '\n\t\tgitconfig_params['github_username'] = STDIN.gets.chomp\n\n\t\tprint 'GitHub API token: '\n\t\tgitconfig_params['github_api_token'] = STDIN.gets.chomp\n\n\t\tFile.open(cache_file, 'w') { |out| YAML.dump(gitconfig_params, out) }\n\n\t\tret = File.chmod(0600, cache_file)\n\t\tif ret != 1\n\t\t\tputs \"WARN: chmod of #{cache_file} failed!\"\n\t\tend\n\tend\n\n\tputs ' generating ~/.gitconfig'\n\n\t$template_vars = YAML.load_file cache_file\n\n\ttemplate = ERB.new(File.read(template_file), nil, '<>')\n\tFile.open(output_file, 'w') { |f| f.write template.result }\n\n\tret = File.chmod(0600, output_file)\n\tif ret != 1\n\t\tputs \"WARN: chmod of #{output_file} failed!\"\n\tend\n\nend", "title": "" }, { "docid": "1f2089caa321655d2e1d26a11375e04f", "score": "0.5927757", "text": "def create_dotssh\n directory ::File.expand_path(\"~#{new_resource.user}/.ssh\") do\n owner new_resource.user\n group new_resource.group\n mode '755'\n end\n end", "title": "" }, { "docid": "278b1c7c08e258b8ac343df8434a756c", "score": "0.59176236", "text": "def create_app_repo (name, path)\n raise 'Target path already exist' if File.exist?(path)\n path = File.expand_path(path)\n Dir.chdir(File.join(SAMPLE_APPS_PATH, name)) do\n raise 'Already a git repository' if File.exist?('.git')\n git = Git.init('.')\n git.add('.')\n git.commit('Initial commit')\n git.config('core.bare', true)\n FileUtils.mv '.git', path\n end\n end", "title": "" }, { "docid": "5938275eec1757779f7f29422934433e", "score": "0.5914259", "text": "def write_file(filename, hash)\n config.cd do\n dir = File.dirname(filename)\n unless [\".\", \"/\"].include?(dir) || File.directory?(dir)\n FileUtils.mkdir_p(File.join(config.repo_path, dir))\n end\n\n File.open(File.join(config.repo_path, filename), \"w\") do |f|\n f.write( (hash.is_a?(Hash))? hash.to_json : hash )\n end\n repo.add(File.join(config.repo_path, filename))\n config.log.info(\"[NSYNC] Updated file '#{filename}'\")\n end\n true\n end", "title": "" }, { "docid": "d10fccd7052c264598bd854f1854569d", "score": "0.590201", "text": "def create_repo\n repo = params[:repo]\n \n if !repo || repo == \"\"\n error(\"invalid repository name\")\n return\n end\n \n r = system \"cd #{$SETTINGS[:repo_root]}\\n\n git init --bare #{repo}.git\n chown -R git:git #{repo}.git\"\n \n p \"system call return #{r}\"\n \n success('OK', {:ret=>r})\n end", "title": "" }, { "docid": "3d2ed04fe9bd8dc0700f4f4374402384", "score": "0.58966017", "text": "def clone_dir\n \"#{RdocInfo.config[:tmp_dir]}/#{@project.owner}/#{@project.name}/blob/#{@project.commit_hash}\"\n end", "title": "" }, { "docid": "5e4231599e16163bde796b2874c47e15", "score": "0.58913076", "text": "def create_repo\n cli.inside(app_path) { cli.run \"git init\" }\n end", "title": "" }, { "docid": "f30bab170ad3c6e1ec6884be9a1d3b83", "score": "0.5883452", "text": "def git_dir(path)\n \"#{path}/.git\"\n end", "title": "" }, { "docid": "92234aecf20591a065878f14aa4cefec", "score": "0.5878546", "text": "def create_gitignore\n \n puts \"===== Setting up .gitignore\"\n gitignore_file = @settings['local']['application_root']+\"/.gitignore\"\n if !File.exist?(gitignore_file) || force? || confirmation(\"overwrite #{gitignore_file}\")\n run \"cp #{File.dirname(__FILE__)+'/gitignore_template'} #{gitignore_file}\"\n end \n \n end", "title": "" }, { "docid": "37c77b8392e72c4461b649f0d768729d", "score": "0.58757126", "text": "def generate\n\n FileUtils.mkdir_p @props[:key_dir] unless\n File.directory? @props[:key_dir]\n\n FileUtils.cd(@props[:key_dir]) do\n FileUtils.touch @props[:key_index]\n File.open(\"serial\", \"w\") {|f| f.write \"01\" }\n end\n\n FileUtils.chown_R(\n @props[:key_dir_owner],\n @props[:key_dir_group],\n @props[:key_dir]\n )\n\n FileUtils.chmod_R(\n @props[:key_dir_permission],\n @props[:key_dir]\n )\n\n end", "title": "" }, { "docid": "6abe33a983430369fa5095194b37fa17", "score": "0.58691126", "text": "def create_authorized_keys_file(connection, stdout)\n connection.exec!(\"touch ~/.ssh/authorized_keys\")\n stdout << \"- Created ~/.ssh/authorized_keys\\n\"\nend", "title": "" }, { "docid": "5169f70b1d3ed768396242907c0e9f32", "score": "0.5850594", "text": "def export_repo\n if not @gitman\n self.init\n end\n @gitman.export_repo\n end", "title": "" }, { "docid": "5d2b43e6a1b1841fb2ab9f80ee2395f4", "score": "0.5847087", "text": "def file_path\n return @file_path if defined? @file_path\n @file_path = Pathname.new(\"#{CONF[:db_dir]}/#{@info_hash.unpack('H*').first}.pstore\")\n @file_path.dirname.mkpath\n @file_path\n end", "title": "" }, { "docid": "5b13f5e3e654865439b3fe8f861506b2", "score": "0.58467627", "text": "def write_file(path, file_data)\n # Get directory path of file (one level higher)\n dir = File.dirname(path)\n abs_path = File.join(tmp_repo, dir)\n # Create the folder (if not present), creating parents folders if necessary.\n # This will not overwrite the folder if it's already present.\n FileUtils.mkdir_p(abs_path)\n # Create a file and commit it. This will overwrite the\n # file on disk if it already exists, but will only make a\n # new commit if the file contents have changed.\n abs_path = File.join(tmp_repo, path)\n File.write(abs_path, file_data.force_encoding('UTF-8'))\n non_bare_repo.index.add(path)\n end", "title": "" }, { "docid": "c99d599bd0434cd76e705d3e1a6c77ce", "score": "0.58445734", "text": "def create_git\n branchs = ['develop', 'hotfixes', 'release']\n gitlabapi = Apiexternal::Gitlabapi.new\n\n begin\n self.gitlab_id = gitlabapi.create_project(name, gitpath)\n create_rootfolder\n branchs.each {|branch| gitlabapi.create_branch(gitlab_id, branch, 'master')}\n gitlabapi.unprotect_branch(gitlab_id, 'master')\n users.each {|user| gitlabapi.add_user_to_project(gitlab_id, user.gitlab_id, user.access_level)}\n rescue Exceptions::NextDeployException => me\n me.log\n end\n end", "title": "" }, { "docid": "74c4cc9a9144ab02017bbf3ecd475d3a", "score": "0.5839498", "text": "def generate_path!\n self.path = \"#{Time.new.to_i}_#{File.basename(self.git)}\"\n end", "title": "" }, { "docid": "fb297e71dd14cb7348357196f427ef80", "score": "0.5838138", "text": "def construct_temporary_repo(repo_path)\n FileUtils.mkdir_p(File.join(repo_path, 'root'))\n repo = Git.init(repo_path)\n FileUtils.touch(File.join(repo_path, 'root', 'zero'))\n\n create_random_file!(File.join(repo_path, 'root', '1K'), '1k', 1)\n create_random_file!(File.join(repo_path, 'root', '2M'), '1024k', 2)\n\n repo.add\n repo.commit('Initial commit')\nend", "title": "" }, { "docid": "43a4e3307ba787ce3e8fac6916db97df", "score": "0.58379215", "text": "def write_git_setup\n remove_file target.join('.gitignore')\n template 'git/gitignore.erb', target.join('.gitignore')\n\n unless File.exists?(target.join('.git'))\n inside target do\n run 'git init', capture: true\n run 'git add -A', capture: true\n end\n end\n end", "title": "" }, { "docid": "81cb44b539eba8adaeea138d69fb0592", "score": "0.5836565", "text": "def git_work_dir; end", "title": "" }, { "docid": "6102adb1a9ae8723313700d0321fdab1", "score": "0.58329934", "text": "def create_repo\n repo = params[:repo]\n \n if !repo || repo == \"\"\n error(\"invalid repository name\")\n return\n end\n p \"cd #{$SETTINGS[:repo_root]}\\n\n git init --bare #{repo}.git\n chown -R git:git #{repo}.git\"\n \n r = system \"cd #{$SETTINGS[:repo_root]}\\n\n git init --bare #{repo}.git\n chown -R git:git #{repo}.git\"\n \n p \"system call return #{r}\"\n \n success('OK', {:ret=>r})\n end", "title": "" }, { "docid": "60d785e56d64249e147674320777bf17", "score": "0.5828252", "text": "def create_key\n self.extra ||= {}\n if !extra[:key]\n # kinda lame\n t = Tempfile.new('rd_rsa')\n path = t.path\n t.unlink\n \n system(\"ssh-keygen -t rsa -N '' -f #{path}\")\n self.extra[:key] = File.read(path)\n self.extra[:pubkey] = File.read(path+'.pub')\n File.unlink(path)\n File.unlink(path+'.pub')\n save\n end\n end", "title": "" }, { "docid": "1554dbd58e8275ad274a0f018f973129", "score": "0.58263564", "text": "def store name, what, where\n FileUtils.mkdir_p(File.dirname(where))\n File.open(where, 'wb') do |f|\n f << what\n end\n if `git status --porcelain \"#{where}\"`.strip.length > 0\n @changed_services << name\n puts \" #{name} CHANGED\"\n else\n puts \" #{name} OK\"\n end\nend", "title": "" }, { "docid": "eb652fb6b104a13913085d5604f547bb", "score": "0.58146596", "text": "def data_dir\n current_dir = Dir.pwd\n path = \"#{current_dir}/.#{repository_name}\"\n FileUtils.mkdir_p path\n path\n end", "title": "" }, { "docid": "ed381160862ed0d9f29d612dc77b4c22", "score": "0.5813254", "text": "def ssh_path\n \"#{profile.name}/#{name}.git\"\n end", "title": "" }, { "docid": "ed381160862ed0d9f29d612dc77b4c22", "score": "0.5813254", "text": "def ssh_path\n \"#{profile.name}/#{name}.git\"\n end", "title": "" }, { "docid": "ade63aaa95fd1317ad6039b3e8b5e9cc", "score": "0.5803599", "text": "def create_repository identifier, &block\n path = repository_path identifier\n Dir.mkdir path\n run \"git init --bare #{path}\"\n at_path path, &block\nend", "title": "" }, { "docid": "7004cac65dd88ced470827362c8db8b2", "score": "0.5790407", "text": "def create_local_repository\n # TODO: background job.\n @grit_repo = Grit::Repo.init_bare local_path\n FileUtils.chmod_R 0770, local_path\n begin\n FileUtils.chown_R ConfigVar['git_user'], nil, local_path\n rescue ArgumentError\n # Happens in unit testing, when the git user isn't created yet.\n raise unless Rails.env.test?\n rescue Errno::EPERM\n # Not root, not allowed to chown.\n end\n\n @grit_repo\n end", "title": "" }, { "docid": "9fe69a61a836730fe4b81fd9a7c46eb8", "score": "0.5787131", "text": "def github_create_file(repo, path, message, contents)\n contents = Base64.encode64 contents\n body = { \n \"message\" => message, \n \"commiter\" => { \"name\" => \"Scott Chamberlain\", \"email\" => \"[email protected]\" },\n \"content\" => contents\n }\n url_path = '/repos/%s/contents/%s' % [repo, path]\n res = $github_conn.put url_path, MultiJson.dump(body)\n res.github_raise\n MultiJson.load(res.body)\nend", "title": "" }, { "docid": "051843b72bd2601b6f7b86e8a4de2abf", "score": "0.57787997", "text": "def file_name\n file_name = (\"tmp/insert_internals_hash.txt\")\n end", "title": "" }, { "docid": "55de16d97a36f8eda77372425fd59d07", "score": "0.5772706", "text": "def initialize_git\n copy_template \".gitignore\"\n Dir.chdir(root) do\n execute_quietly(\"git init; git add .; git commit -a -m 'Initial Commit'\")\n end\n \n git = \"#{dir_name}.git\"\n commands = [\n \"rm -r #{config[:remote_root]}\",\n \"mkdir -p #{config[:remote_root]}\",\n \"cd #{config[:remote_root]}\",\n \"git init --bare #{git}\",\n \"touch #{git}/git-daemon-export-ok\",\n \"cd #{config[:remote_root]}/#{git}/hooks\",\n \"mv post-update.sample post-update\",\n \"chmod a+x post-update\"\n ]\n ssh(commands.join(\";\"))\n \n Dir.chdir(root) do\n execute_quietly(\"git remote add origin ssh://#{config[:user]}@#{config[:host]}:#{config[:port] || 22}#{config[:remote_root]}/#{dir_name}.git; git push origin master\")\n end\n end", "title": "" }, { "docid": "b43c248992163bf52041fdff4e478840", "score": "0.5759085", "text": "def state_file\n fname = \"be_repo_#{name}.txt\"\n File.expand_path(File.join(File.dirname(__FILE__), '..', 'db', fname))\n end", "title": "" }, { "docid": "79a202206f82fbeb9111fea9ab6fedd0", "score": "0.5741734", "text": "def gitdir\n\t\t\td=infos[:gitdir] and ShellHelpers::Pathname.new(d)\n\t\tend", "title": "" }, { "docid": "0b971d1d1f1f41d9c22f09e5f54b7837", "score": "0.57368606", "text": "def make_version_dir_path(name)\n dir_path = File.join(data_path, \"docs\", name, \"versions\")\n FileUtils.mkdir_p(dir_path)\n dir_path\nend", "title": "" }, { "docid": "31aceaf73ca4766240c2b0e020e7f1ec", "score": "0.5732842", "text": "def fs_write(file, contents)\n path = File.join(self.git_dir, file)\n FileUtils.mkdir_p(File.dirname(path))\n File.open(path, 'w') do |f|\n f.write(contents)\n end\n end", "title": "" }, { "docid": "31aceaf73ca4766240c2b0e020e7f1ec", "score": "0.5732842", "text": "def fs_write(file, contents)\n path = File.join(self.git_dir, file)\n FileUtils.mkdir_p(File.dirname(path))\n File.open(path, 'w') do |f|\n f.write(contents)\n end\n end", "title": "" }, { "docid": "4574f97b9ab41dd8ac69a7e0ff79fdf6", "score": "0.57316655", "text": "def create\n File.write(resource[:target_file], decrypt(resource[:name]))\n end", "title": "" }, { "docid": "4a3a4248727334717bf6126af453113d", "score": "0.5731082", "text": "def create_file(name)\n\t\tfile = self[name].create\n\t\tfile.write('')\n\t\tfile\n\tend", "title": "" }, { "docid": "00f0948219dda93fc4b7559915ac24ee", "score": "0.57307446", "text": "def create!\n return if path.exist?\n FileUtils.mkdir_p path\n in_repository do\n # TODO: Add a way to hook into the results of creating the repository.\n # E.g. so we can have post-create hooks.\n cmd(:git, '--bare', :init).ok?\n end\n end", "title": "" }, { "docid": "a6ac94f8b0178804b29ab1335eb012f6", "score": "0.57303417", "text": "def repo_path\n File.join(RepoPath, self.full_name)\n end", "title": "" }, { "docid": "6d88c9b5a410d1e3ff9013bb26bbf9aa", "score": "0.57298356", "text": "def git\n\tsystem(\"git add .\")\n\tsystem(\"git commit -m 'first commit init project folder'\")\n\tsystem(\"git push origin master\")\n\t\nend", "title": "" }, { "docid": "ea0c10f188244c21badbb8029dae1a65", "score": "0.572664", "text": "def addToGitAndCreateBlob(device, dev_path, filename, prev_devfile, savePath)\n \n # If git repository doesn't yet exist for this device, create it\n if not File.exists?(\"#{dev_path}.git\")\n # Create new repo\n repo = Grit::Repo.init_bare(\"#{dev_path}.git\")\n else\n # Repo already existed\n repo = Grit::Repo.new(\"#{dev_path}.git\")\n end\n \n puts \"XOXOXO: \" + \"#{dev_path}#{savePath}\"\n \n # Add file to repo and make a commit\n repo.add(\"#{dev_path}#{savePath}\") \n repo.commit_all(\"new commit\")\n\n if repo.commits.first == nil\n puts \"Repository was empty?\".background(:red)\n repo = Grit::Repo.init_bare(\"#{dev_path}.git\", {:bare => false})\n# @repo = Grit::Repo.init_bare(\"#{@dev_path}.git\", {:bare => false})\n # @git = Grit::Git.new(\"#{@dev_path}.git\")\n #return false\n # Add file to repo and make a commit\n repo.add(\"#{dev_path}#{filename}\") \n repo.commit_all(\"new commit\")\n end\n\n commit_hash = repo.commits.first.id\n commited_blob = repo.commits.first.tree.contents.first.contents.first.contents.last\n \n \n # Check type of file\n contenttype = \"unknown\" \n if not MIME::Types.type_for(filename).to_s.empty?\n contenttype = MIME::Types.type_for(filename).to_s\n end\n \n # Create thumbnail\n thumbnail_name = createThumbnail(commited_blob, contenttype, device)\n \n \n # Add blob to database\n blob = Blob.create(:size => commited_blob.size,\n :filedate => DateTime.now,\n :uploaded => 1,\n :version => 0,\n :blob_hash => commited_blob.id,\n :thumbnail_name => thumbnail_name)\n \n if blob == nil\n raise Exception.new(\"Problem creating blob\")\n end \n \n # This is used for making sure old blob won't end up in blobs_in_commit table\n old_blob = nil\n \n # If first version of file, create devfile\n if prev_devfile == nil \n # Add devfile to database\n devfile = Devfile.create(:device_id => device.id,\n :name => filename,\n :path => '/',\n :filetype => contenttype,\n :privatefile => 1,\n :blob_id => blob.id)\n # If adding new version of file, update link to new blob\n else\n old_blob_id = prev_devfile.blob_id\n \n # Update version number of blob\n old_blob = Blob.find_by_id(old_blob_id)\n old_blob.follower_id = blob.id\n old_blob.save\n blob.version = old_blob.version.to_i+1\n blob.predecessor_id = old_blob_id\n blob.save\n \n # Update old devfile\n devfile = prev_devfile\n devfile.blob_id = blob.id\n devfile.save\n end\n \n if devfile == nil\n raise Exception.new(\"Problem creating devfile\")\n end\n\n\n @devf_id = devfile.id\n \n # Tell blob which devfile it belongs to \n blob.devfile_id = devfile.id\n blob.save\n \n previous_commit = device.commit_id\n \n # Create commit\n commit = Commit.create(:device_id => device.id,\n :commit_hash => commit_hash,\n :previous_commit_id => previous_commit)\n \n if commit == nil\n raise Exception.new(\"Problem creating commit\")\n end\n\n # create new link between blob and commit\n blobInCommit = BlobsInCommit.create(:blob_id => blob.id,\n :commit_id => commit.id)\n\n if blobInCommit == nil\n raise Exception.new(\"Problem creating blob in commit\")\n end\n \n # Link old blobs into new commit\n if previous_commit != nil \n old_blobs = BlobsInCommit.find_all_by_commit_id(previous_commit)\n if old_blobs != nil\n old_blobs.each do |x|\n if x.blob_id != old_blob_id\n BlobsInCommit.find_or_create_by_blob_id_and_commit_id(x.blob_id, commit.id)\n end\n end\n end\n end\n \n # update device info\n device.update_attribute(:last_seen, DateTime.now)\n device.update_attribute(:commit_id, commit.id)\n return devfile\n end", "title": "" }, { "docid": "93fd2943de5ceff3698fbf6e0f8483ea", "score": "0.5725805", "text": "def setup\n # create folder if it doesn't exist\n unless Dir.exists? @path\n @log.info \"[#{@name}] creating directory for repo\"\n FileUtils.mkdir(@path)\n end\n\n # create repo if there isn't one\n unless Dir.exists? File.join(@path, \".git\")\n @log.info \"[#{@name}] creating repository for repo\"\n\n # somehow Git.init doesn't work if the path is in a git repo.\n #Git.init(@path, :log => @log)\n `git init \"#@path\"`\n end\n\n @git = Git.open(@path, :log => @log)\n end", "title": "" }, { "docid": "0a2058d3fe2325ba2bb9429fdf122d59", "score": "0.5721851", "text": "def create_repo_snapshot name, repo_name\n create_snapshot name, 'repo', :resource_name => repo_name\n end", "title": "" }, { "docid": "a3f300d5ab2d8d0957985296b2ab3f8e", "score": "0.57190305", "text": "def setup_repo(name, type, marker, clone_command)\n dir = File.expand_path(\"tmp/hold/#{type}\")\n dst = File.expand_path(\"tmp/repo/#{type}\")\n\n unless File.exist?(\"#{dir}/#{name}/#{marker}\")\n $stderr.puts(\" #{clone_command}\")\n `mkdir -p #{dir}` unless File.directory?(dir)\n `cd #{dir}; #{clone_command}`\n end\n\n unless File.directory?(\"#{dst}/#{name}\")\n `mkdir -p #{dst}`\n `cp -r #{dir}/#{name} #{dst}/#{name}`\n end\n\n @working_directory = \"#{dst}/#{name}\"\n end", "title": "" }, { "docid": "e3a2f1abc9f4be16590ab6158fce9185", "score": "0.5714398", "text": "def save_file(file, name = '')\n if name.size > 0\n filename = name + File.extname(file[:filename])\n else\n filename = file[:filename]\n end\n FileUtils.mkdir_p(@attach_dir) if !File.exists?(@attach_dir)\n new_file = File.join(@attach_dir, filename)\n\n f = File.new(new_file, 'w')\n f.write(file[:tempfile].read)\n f.close\n \n commit_message = \"uploaded #{filename} for #{@name}\"\n begin\n $repo.add(new_file)\n $repo.commit(commit_message)\n rescue \n nil\n end\n end", "title": "" }, { "docid": "8f5fe6b4ad812a68f46900a0b0c813ef", "score": "0.57131886", "text": "def directory_name\n @directory_name ||= \"#{repository.identifier}.git\"\n end", "title": "" }, { "docid": "42fec742a82d4985c37a1b023876e52b", "score": "0.57045907", "text": "def create_revision_info(git_path, info_file_path, tag)\n\tDir.chdir(git_path) do |path|\n\t\tcommit = `git show-ref --tags --hash=7 #{tag}`.strip\n\t\tputs \"Writing '#{tag} ~ #{commit}' to #{info_file_path}\" \n\t\tFile.open(info_file_path, \"w\") do |f|\n\t\t\tf.puts tag\n\t\t\tf.puts commit\n\t\tend\n\tend\nend", "title": "" }, { "docid": "e93b2cc8ce573cb4e08186becd05cb1e", "score": "0.5698918", "text": "def new_file(filename)\n @open_files[filename] = File.new(\"#{@db_directory.path}/#{filename}\", 'w+')\n end", "title": "" }, { "docid": "db315f431aa7635f8d1e19dda7a6c6c1", "score": "0.5694901", "text": "def git_init\n Dir.chdir(@git_local_directory)\nend", "title": "" }, { "docid": "361b53a445f7227bec2413775ff2ac0c", "score": "0.56914896", "text": "def setup(model_name)\n root = defined?( RAILS_ROOT ) ? RAILS_ROOT : \"/.data\"\n @repository = File.join( root, \"git_store\" )\n @versioned_fields = []\n end", "title": "" }, { "docid": "4fc1f540acbac9a37eb05ff952dcda21", "score": "0.5689675", "text": "def new_repo\n @new_repo_name ||= MOCK_WEB ? 'new_repo' : \"new_repo#{Time.now.strftime(\"%Y%m%d-%H%M%S\")}\"\n end", "title": "" }, { "docid": "8b6cbd7b59f93f2337b046ada2b5a073", "score": "0.568872", "text": "def write_version_file\n return if File.exists?(\"VERSION\")\n git_tag = \"UNKNOWN\"\n Dir.chdir(cached_download) do\n ver = `./version.sh`.chomp\n if not $?.success? or ver == \"UNKNOWN\"\n # fall back to git\n ver = `git describe --tags --match N --always`.chomp\n if not $?.success?\n opoo \"Could not determine build version from git repository - set to #{git_tag}\"\n else\n git_tag = \"git-#{ver}\"\n end\n else\n git_tag = ver\n end\n end\n File.open(\"VERSION\",\"w\") {|f| f.puts git_tag}\n end", "title": "" }, { "docid": "523c1aa33c98a6d71cedd6c098506a1c", "score": "0.5681184", "text": "def create_gitswitch_file\n user = get_git_user_info({:global => true})\n if user[:name].empty? && user[:email].empty?\n puts \"ERROR: You must set up a default git user.name and user.email first.\"\n else\n puts \"Adding your global .gitconfig user info to the \\\"default\\\" tag...\"\n set_gitswitch_entry('default', user[:email], user[:name])\n save_gitswitch_file\n end\n end", "title": "" }, { "docid": "467250a01eec608508ef8b1836399a6f", "score": "0.56783634", "text": "def init\n File.open(GIT_CLONER_FILE, 'w') { |f|f.puts(GIT_CLONER_TEMPLATE) }\n end", "title": "" }, { "docid": "1ac8c5938697a91485fdc4e1c3be9ea7", "score": "0.56706184", "text": "def commit\n\n\t\t# XXX: have to do this twice :-(\n\t\t# need to make this path relative to the source dir\n\t\tmozdist = Pathname.new( @user_opts[@opts.mode]['MOZDIST'] )\n\t\tif( mozdist.absolute? )\n\t\t\t@user_opts[@opts.mode]['MOZDIST'] = mozdist.relative_path_from( Pathname.new(@opts.path) )\n\t\tend\n\t\tfiredist = Pathname.new( @user_opts[@opts.mode]['FIREBIRDDIST'] )\n\t\tif( firedist.absolute? )\n\t\t\t@user_opts[@opts.mode]['FIREBIRDDIST'] = firedist.relative_path_from( Pathname.new(@opts.path) )\n\t\tend\n\n\t\tputs \"Creating config/make.config\"\n\t\tputs @user_opts[@opts.mode]['MOZDIST']\n\t\terb = ERB.new(File.open(\"config/make.erb\",\"r\").read,0, \"<>\")\n\t\tFile.open(\"config/make.config\",\"w\").write( erb.result( self.get_binding ) )\n\t\tBuild.commit( @makefiles )\n\tend", "title": "" }, { "docid": "0397c4a25c2349b3a5c1925eb3b54b51", "score": "0.5668832", "text": "def add_pipe_name(name)\n\n # check unique filename/key\n filename = get_file_name_from_key name\n raise Exception if @pipe_keys.include? filename\n raise Exception if File.exist? 'pipes/' + filename + '.sh'\n\n # delete previous temp file, create new one with name\n File.delete 'temp' if File.exist? 'temp'\n File.open('temp', 'w') { |file| file.write(name) }\n end", "title": "" }, { "docid": "a274dd09b6fcd132963a40abd07a24c4", "score": "0.5654852", "text": "def after_create\n #creo el directorio\n #git = \"#{ruta}/.git\"\n #Dir.mkdir(ruta)\n #Dir.mkdir(git)\n #git = Grit::Git.new(ruta)\n #creo el repositorio\n #git.init({})\n #creo el documento raiz\n c = Contenido.new\n c.documento = self\n c.nombre= \"==#{self.to_s}==\"\n c.save\n end", "title": "" }, { "docid": "11b266e51591b9bb9a22cce647f39306", "score": "0.5654221", "text": "def save_git_version\n File.write(git_filename, notebook.to_git_format(uuid))\n end", "title": "" }, { "docid": "1c71e4319f43735621aba801ae173e59", "score": "0.5645829", "text": "def write_file(path, file_data = nil, author)\n\n # Get directory path of file (one level higher)\n dir = File.dirname(path)\n abs_path = File.join(@repos_path, dir)\n\n # Create the folder (if not present), creating parents folders if necessary.\n # This will not overwrite the folder if it's already present.\n FileUtils.mkdir_p(abs_path)\n\n # Create and commit the file\n make_file(path, file_data, author)\n end", "title": "" }, { "docid": "db283aa5d9c217177ad0c9bfb97eeb31", "score": "0.5632315", "text": "def path\n @path ||= Pathname.new(\"#{GIT_SOURCES_DIR}/#{@source_key}\")\n end", "title": "" }, { "docid": "0c8022996c08619e902b044c53971504", "score": "0.56303585", "text": "def generate_filename\n # add a timestamp if requested\n name = if @cmd[:timestamp]\n \"updaterepo-#{Time.new.strftime('%y%m%d-%H%M%S')}.log\"\n else\n 'updaterepo.log'\n end\n # log to local directory instead of home directory if requested\n if @cmd[:log_local]\n File.expand_path(File.join('./', name))\n else\n File.expand_path(File.join('~/', name))\n end\n end", "title": "" }, { "docid": "377049d31a76b8311f4429461a6dd1b6", "score": "0.56253636", "text": "def write(file, data)\n path = repo_dir.join(file)\n path.dirname.mkdir_p\n path.write(\n data\n )\n\n self\n end", "title": "" }, { "docid": "a8463364bb6845edc39a89309c12d957", "score": "0.5623297", "text": "def create\n svncmd \"checkout\", resource[:name], resource[:path]\n #svncmd \"checkout\", resource[:source], resource[:path]\n #svncmd \"checkout\", <my_repo_src>, <send_my_repo_here>\n end", "title": "" }, { "docid": "846d70cdc4de1af02ced55cc2f8aea7d", "score": "0.56190145", "text": "def init\n `git init`\n `echo \".version50\\n.version50-warps\" > .gitignore`\n end", "title": "" }, { "docid": "8d19ffbf4a166ab5a27b62da36bdf360", "score": "0.5616103", "text": "def private_file\n File.join @ssh_home, @ssh_id\n end", "title": "" }, { "docid": "41f616ba06421deae58022d1064de95c", "score": "0.56072825", "text": "def git_index_file; end", "title": "" }, { "docid": "746ca084bd7f297bdb8d71b5ccec0aee", "score": "0.55914146", "text": "def create_version_file\n create_file('.version', '0.0.1')\n end", "title": "" }, { "docid": "6de91f6db4e22fabffd4bc643d7cab33", "score": "0.558323", "text": "def createReleaseOnSFNET\n log_debug 'Creating Release on SF.NET ...'\n ssh(\"mkdir -p #{@SFReleaseDir}\")\n end", "title": "" }, { "docid": "f96d96d67402665d6e78bf90e2947e07", "score": "0.5582538", "text": "def ssh_keygen(name, file)\n shell %(ssh-keygen -t rsa -N \"\" -C #{name} -f #{file})\n end", "title": "" }, { "docid": "8b7fcadca033529d7e512b5e6e758a1d", "score": "0.5577407", "text": "def create_working_directory(curriculum, user)\n working_repo = Git.clone(::GitFunctionality::Path.new.get_bare_path(curriculum), ::GitFunctionality::Path.new.get_working_path(curriculum))\n working_repo.config('user.name', user.username)\n working_repo.config('user.email', user.email)\n end", "title": "" }, { "docid": "d277a60e3c988ad940920cd2176d3c52", "score": "0.55758125", "text": "def path\n (self.class.base_path + @repository.cache_key).tap{ |o| o.mkpath }\n end", "title": "" }, { "docid": "c3a7be29d2423972e894a0b57cb84e77", "score": "0.55742955", "text": "def build_gitbook_files\n puts '[-] '.bold + \"Creating gitbook's main files.'\"\n prj_files = %w[book.json SUMMARY.md README.md]\n prj_files.each do |file|\n File.write(file, \"# #{file.split('.').first.capitalize}\\n\\n\")\n end\n end", "title": "" }, { "docid": "49b7ba85647b858fb239b7d6a883e484", "score": "0.5571552", "text": "def git_add(file)\n system(\"cd #{CONTENT_ROOT}; git add -v #{file}\")\nend", "title": "" }, { "docid": "fd61012445749210ce9d44d287b79897", "score": "0.5567473", "text": "def git_path\n File.join(\n assignment.course.storage_path,\n assignment.term.url_part,\n 'assignments',\n assignment.url_part)\n end", "title": "" }, { "docid": "09eb1350888c7ca5964388af2e53dd85", "score": "0.5564428", "text": "def __create(file, name, project)\n end", "title": "" }, { "docid": "a8703bcb15853bfc77da19e5860e5c9e", "score": "0.55595595", "text": "def save_file(file, name = '')\n if name.size > 0\n filename = name + File.extname(file[:filename])\n else\n filename = file[:filename]\n end\n FileUtils.mkdir_p(attach_dir) if !File.exists?(attach_dir)\n new_file = File.join(attach_dir, filename)\n\n f = File.new(new_file, 'w')\n f.write(file[:tempfile].read)\n f.close\n\n commit_message = \"uploaded #{filename} for #{@name}\"\n begin\n $repo.add(new_file)\n $repo.commit(commit_message)\n rescue\n # FIXME why!??\n nil\n end\n end", "title": "" } ]
3bc098059349a1e31f95a86f167eaf86
fetch initial from Aspaway
[ { "docid": "c824a06c171ec54b8501f6431f448708", "score": "0.7169366", "text": "def fetch\n AspawayImporter.fetch(@initial_path)\n end", "title": "" } ]
[ { "docid": "eae37117c6d22f08ecf89029793eaea6", "score": "0.6222056", "text": "def fetch\n end", "title": "" }, { "docid": "4cf1dbcd0106243f9d28f81eccaa53df", "score": "0.6135375", "text": "def fetch\n neography\n self\n end", "title": "" }, { "docid": "a9ca0c3587153526d0763bba7427bf99", "score": "0.6134504", "text": "def fetch\r\n end", "title": "" }, { "docid": "3413a2492b6f5d7e4d638ca4f83b6f07", "score": "0.6016996", "text": "def fetch\n end", "title": "" }, { "docid": "796d346752fdcccc214fa113fa18e80d", "score": "0.5965197", "text": "def fetch\n confugure_request.get(headers: @headers, params: @query_params)\n end", "title": "" }, { "docid": "ef57ca615743b89fad9369f85157ad86", "score": "0.58942723", "text": "def fetch_and_parse\n # TODO\n end", "title": "" }, { "docid": "73f0ea40dd48ccd4da3b59f571c9047c", "score": "0.581586", "text": "def fetch\n\n end", "title": "" }, { "docid": "167b340e2a53946fce55078a88313bd1", "score": "0.57980293", "text": "def main_page\n agent.get(@url)\n end", "title": "" }, { "docid": "12bbad59a7863efd247436e7d48aeba4", "score": "0.5783901", "text": "def get_elink_today\n set_home_menu\n get_config\n \n #request=\"http://#{@ip}:#{@port}/QueryByAccessionNO/A11R4C02738\"\n #request=\"http://#{@ip}:#{@port}/QueryByChartNO/8006154\"\n #request=\"http://#{@ip}:#{@port}/QueryByExamDate/2012/10/25\"\n #request=\"http://#{@ip}:#{@port}/test\"\n dt=Time.now().strftime(\"%Y/%m/%d\")\n request=\"http://#{@ip}:#{@port}/QueryByExamDate/#{dt}\"\n res = Rho::AsyncHttp.get(\n :url => request\n )\n \n @elinks = Rho::JSON.parse(res[\"body\"])\n \n render :action => :home\n end", "title": "" }, { "docid": "399128f1ffbc5a052b6a354bbfb942fc", "score": "0.5770568", "text": "def fetch\n raise \"implement me!\"\n end", "title": "" }, { "docid": "5190e21feb3c5afbb6ed4497a06f8a59", "score": "0.57620054", "text": "def result; fetch; end", "title": "" }, { "docid": "f684305ae1f7f08790e9bc0e34ad7120", "score": "0.5724575", "text": "def fetch\n fetch_response['results']\n end", "title": "" }, { "docid": "f684305ae1f7f08790e9bc0e34ad7120", "score": "0.5724575", "text": "def fetch\n fetch_response['results']\n end", "title": "" }, { "docid": "30b24f0a92c8a7f9dd1411b860d95ef4", "score": "0.5716344", "text": "def fetch; end", "title": "" }, { "docid": "30b24f0a92c8a7f9dd1411b860d95ef4", "score": "0.5716344", "text": "def fetch; end", "title": "" }, { "docid": "30b24f0a92c8a7f9dd1411b860d95ef4", "score": "0.5716344", "text": "def fetch; end", "title": "" }, { "docid": "30b24f0a92c8a7f9dd1411b860d95ef4", "score": "0.5716344", "text": "def fetch; end", "title": "" }, { "docid": "30b24f0a92c8a7f9dd1411b860d95ef4", "score": "0.5716344", "text": "def fetch; end", "title": "" }, { "docid": "30b24f0a92c8a7f9dd1411b860d95ef4", "score": "0.5716344", "text": "def fetch; end", "title": "" }, { "docid": "30b24f0a92c8a7f9dd1411b860d95ef4", "score": "0.5716344", "text": "def fetch; end", "title": "" }, { "docid": "30b24f0a92c8a7f9dd1411b860d95ef4", "score": "0.5716344", "text": "def fetch; end", "title": "" }, { "docid": "6474a0dc428147b566e3b9a649651530", "score": "0.5688484", "text": "def fetch_look_up_data\n fetch(\"lookUpData\",\"element\")\n end", "title": "" }, { "docid": "d995de510308ab508729eaf1cca0d4b4", "score": "0.56863236", "text": "def first_page\n get(@first_page_options_or_url)\n end", "title": "" }, { "docid": "d995de510308ab508729eaf1cca0d4b4", "score": "0.56863236", "text": "def first_page\n get(@first_page_options_or_url)\n end", "title": "" }, { "docid": "1d7c56447e39af8cd61c4e89a2700e30", "score": "0.5661356", "text": "def fetch\n get_data(url)\n end", "title": "" }, { "docid": "18620589e04e6eaca55f4cfc2b145057", "score": "0.5651444", "text": "def get_elink_byaccno\n set_home_menu\n get_config\n \n accno=@params['accno'] \n request=\"http://#{@ip}:#{@port}/QueryByAccessionNO/#{accno}\"\n res = Rho::AsyncHttp.get(\n :url => request\n )\n \n @elinks = Rho::JSON.parse(res[\"body\"])\n \n render :action => :home\n end", "title": "" }, { "docid": "16a255e8c43ac9f45838c5bbf4ae1312", "score": "0.5649575", "text": "def fetch_landing_page_content\n fetch_data(cache_name: :landing_page_content, ttl: 30.minutes)\n end", "title": "" }, { "docid": "0f8069a61a77092cca57f638e2a626af", "score": "0.5628371", "text": "def fetch\n ComicVine::API.get_details_by_url(self.api_detail_url)\n end", "title": "" }, { "docid": "feb2a9c0626403b7acbbd81f8603ec2e", "score": "0.5611838", "text": "def fetch(rest_of_the_url)\n request :get, \"#{@root_endpoint}#{rest_of_the_url}/#{rest_of_the_url}\"\n end", "title": "" }, { "docid": "0cf1cd753d76b9a8d8098f1804e48123", "score": "0.5587427", "text": "def first\n return fetch(:first)\n end", "title": "" }, { "docid": "59f22983e9741f9f18ee7715e201c850", "score": "0.5583283", "text": "def fetch(rest_of_the_url)\n request :get, \"#{ROOT_ENDPOINT}#{@entity_name}/#{rest_of_the_url}\"\n end", "title": "" }, { "docid": "d827dc825e62fc11e5a992d776c8d520", "score": "0.55560046", "text": "def isoFetch(request, pageName, initialData)\n # We need to grab the hostname from the URL. There's probably a better way to do this.\n request.url =~ %r{^https?://([^/:]+)} or fail\n host = $1\n\n # Post the initial data to our little Node Express app, which will run it through React.\n req = Net::HTTP::Post.new(\"/#{pageName}\", initheader = {'Content-Type' =>'application/json'})\n req.body = initialData.to_json\n response = Net::HTTP.new(host, 4002).start {|http| http.request(req) }\n response.code == \"200\" or fail\n\n # Return the resulting HTML\n return response.body\nend", "title": "" }, { "docid": "a7201df84404d4b52c3f95c6cc32b4e7", "score": "0.5550896", "text": "def initialization\n adhoc(method: 'get', path: 'initialization').json\n end", "title": "" }, { "docid": "1ee8b37f9f9885e2e4577196522cb0e2", "score": "0.5536815", "text": "def get_elink_bydate\n set_home_menu\n get_config\n \n date=@params['date'] \n request=\"http://#{@ip}:#{@port}/QueryByExamDate/#{date}\"\n res = Rho::AsyncHttp.get(\n :url => request\n )\n \n @elinks = Rho::JSON.parse(res[\"body\"])\n \n render :action => :home\n end", "title": "" }, { "docid": "7105c3ab02854590cb3a6274eddf74c9", "score": "0.5510651", "text": "def fetch_page_data\n mechanizer = Mechanize.new.tap { |m| m.user_agent_alias = USER_AGENT }\n mechanizer.get(ENV['PRODUCT_PATH'] + @asin)\n end", "title": "" }, { "docid": "762d27e0486b03ca03b024baa79d685e", "score": "0.55053735", "text": "def fetch\n \t\tbegin\n \t\t\tself.result = JSON.parse(RestClient.get(url))\n \t\trescue Exception => e\n \t\t\traise e\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "b035025aad7b004c5c88563a56270c93", "score": "0.5503454", "text": "def load_details \n self.attributes = self.request(:get, self.href).body\n self\n end", "title": "" }, { "docid": "a0f1ebd03093a731888b46c996fb88f2", "score": "0.5498015", "text": "def home\n @happykid = OpeningTime.all\n @promo = Promo.all\n\n @news = News.all\n\n @meta = News.last\n\n @siteinfo = SiteInfo.all\n \n end", "title": "" }, { "docid": "d72e5cb49134d17183265f7f504c8e6a", "score": "0.54968387", "text": "def fetch_entity\n # log the element, get the api singleton, and trigger the api call\n log \"Processing #{@element.namespace.to_s.singularize} #{@element.permalink.inspect}\"\n api(@element.data_source).fetch_entity(@element.namespace, @element.permalink)\n end", "title": "" }, { "docid": "4994a8030c611dafde157faaf9083a43", "score": "0.54960954", "text": "def show\n\t\t@state = State.find(params[:id])\n\n\t\tputs '============================'\n\t\t# this is where i get the state initials so i can put them in the api call to get the right state data\n\t\tputs @state.initials\n\t\tputs '============================'\n\t\tda_key = ENV['SUN_LIGHT_KEY']\n\t\tstate = @state.initials\n\n\t\turi = \"https://congress.api.sunlightfoundation.com/legislators?title=Sen&state=#{state}&in_office=true&apikey=#{da_key}\" \n\t\t@response = HTTParty.get(uri) \n\t\t@results = @response['results']\n\n\t\turi = \"https://congress.api.sunlightfoundation.com/legislators?title=Rep&state=#{state}&in_office=true&apikey=#{da_key}\" \n\t\t@response1 = HTTParty.get(uri) \n\t\t@results1 = @response1['results']\n\tend", "title": "" }, { "docid": "ee12a0fca9b1f7f2ca07fbb562e139ee", "score": "0.5491984", "text": "def fetch\n @data ||= get\n end", "title": "" }, { "docid": "5358ce55604f1c780975e1bcee0b7210", "score": "0.5461543", "text": "def fetch_first_page query\n if query then\n search query\n else\n random\n end\n end", "title": "" }, { "docid": "cb1a8321a396b181b6946a56a897805f", "score": "0.54580164", "text": "def get(first)\n \t\tparams = {:q => \"site:\" + @domain, :first => first, :FORM => \"PERE\" }\n\t\t@bing_uri.query = URI.encode_www_form(params)\n\t\tresponse = Net::HTTP.get_response(@bing_uri)\n\t\treturn response.body\n\tend", "title": "" }, { "docid": "adfeb1e5d8b1dd440be72780ca9a9b99", "score": "0.54496026", "text": "def show\n @ensembl = HTTParty.get('http://rest.ensembl.org' + '/lookup/id/' + @abundance.target_id[/[^.]+/],\n :headers =>{'Content-Type' => 'application/json'} )\n if @ensembl[\"display_name\"].nil? \n @name = \"1\"\n else\n @name = @ensembl[\"display_name\"][0..-5]\n\n @wikis = HTTParty.get('https://webservice.wikipathways.org/findPathwaysByText?query=' + @name + '&species=homo+sapiens&format=json',\n :headers =>{'Content-Type' => 'application/json'} )\n\n @pubs = HTTParty.get('https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&retmode=json&term='+ @name,\n :headers =>{'Content-Type' => 'application/json'} )\n \n @omim = HTTParty.get('https://api.omim.org/api/entry/search?search='+ @name+ '&start=0&limit=1&include=text:description&apiKey=6-p06gbQTZiAWNOpPn-CSw&format=xml',:headers =>{'Content-Type' => 'application/xml'} )\n \n \n\n end\nend", "title": "" }, { "docid": "f3eeb79233f0736eb4a896312eec6a37", "score": "0.5422778", "text": "def fetched?; end", "title": "" }, { "docid": "1e3b7f7e650e6a1a7c90ee9228c80651", "score": "0.54201454", "text": "def first(conditions = {})\n new_with_client(\n conditions.merge(\n @client.get(\n create_route(:get, conditions)\n ).body['data']\n )\n )\n end", "title": "" }, { "docid": "18d96d192d6001ddd575576b96162dfa", "score": "0.5414632", "text": "def fetch_data\n return @data if @data[\"/type/reflect/any_master\"]\n @data = Basuco.search.mqlread(define_query.merge!(:id => id))\n end", "title": "" }, { "docid": "dc3fe684c378362a3eb7c7a9b18d12aa", "score": "0.54070896", "text": "def fetch\n super\n end", "title": "" }, { "docid": "ef1b4723e78cd7fc59700ff5cd14f6d1", "score": "0.53793114", "text": "def fetch\n Orientdb::ORM::Queries::Select.new.from(self).execute.first\n end", "title": "" }, { "docid": "f5a4357595d23cab3257b4ae73e99c53", "score": "0.5353981", "text": "def fetch\n if params['external_url']\n url = ExternalWork.format_url(params['external_url'])\n @external_work = ExternalWork.find(:first, :conditions => {:url => url})\n end \n end", "title": "" }, { "docid": "63d669ff82804241f4319e7916e8d05c", "score": "0.5352223", "text": "def home\n # Grab the first (and only) front page in the database\n @front_page = Page.first\n end", "title": "" }, { "docid": "7d26a8ee33d1278b1e6cabec23f34a77", "score": "0.53439677", "text": "def fetch_live_show\n find_show(fetch_live_show_slug)\n end", "title": "" }, { "docid": "c27f8ee42f636380b0cc36c53a76ae5e", "score": "0.5310603", "text": "def fetch!\n @fetched = true\n end", "title": "" }, { "docid": "b1c6fcd5bd08a4bd275bfb5849d8bc5c", "score": "0.5297576", "text": "def fetch\n client.get(unencoded_url).to_s\n end", "title": "" }, { "docid": "80d5984ff106d3b5a2e580233b568769", "score": "0.52917916", "text": "def head; get; end", "title": "" }, { "docid": "aa9d25faacab4c1ceb6676b0797166e0", "score": "0.5288572", "text": "def fetch\n @fetch ||= un_bib_item\n end", "title": "" }, { "docid": "4bb486766a8961b68a0e5dfa8cabda64", "score": "0.5288078", "text": "def find\n url = @url_helper.entity_url\n request(:get, url)\n end", "title": "" }, { "docid": "8a151004d074854ee07b27b1525230d5", "score": "0.5282482", "text": "def fetch_table\n self.class.get('/premier-league/table')\n end", "title": "" }, { "docid": "63bc31efef2859770c03d1c60f08cfda", "score": "0.5271795", "text": "def fetch_patron_data(api_client)\n api_client.fetch_campaign_and_patrons.data.first\nend", "title": "" }, { "docid": "a10e293958f9e2d923d6556349c0a253", "score": "0.526061", "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": "2b314ff6217773b2a7fc895ce6b3c066", "score": "0.5257882", "text": "def fetch(page = '')\n begin\n opened_uri = open(\"http://www.washington.edu/students/timeschd/#{@quarter}/#{page}\")\n #opened_uri = open(\"http://www.washington.edu/students/timeschd/T/#{@quarter}/#{page}\")\n #opened_uri = open(\"http://www.washington.edu/students/timeschd/#{@quarter}/95index.html\")\n #opened_uri = open(\"http://www.uwb.edu/students/registration/time/spr2008.xhtml\")\n Hpricot(opened_uri)\n rescue OpenURI::HTTPError\n Hpricot(\"\")\n end\n end", "title": "" }, { "docid": "1fd6a739ab1c429d0cd79f4d1e90b3c1", "score": "0.5256559", "text": "def fetch\n @response ||= Net::HTTP.get_response(URI.parse(url)).body\n end", "title": "" }, { "docid": "c8cff68840f642fdc528e43d0c9b2140", "score": "0.52558404", "text": "def load_page\n logger.info 'Loading UCJEPS homepage'\n get ConfigUCJEPS.base_url\n when_exists(page_heading, Config.medium_wait)\n end", "title": "" }, { "docid": "8a791b0102740e5bfada49e16395731e", "score": "0.52555066", "text": "def home(query = {})\n self.class.get(\"/plans/home.json\", :query => query)\n end", "title": "" }, { "docid": "f8edf5a89d7ea55d02b49bcbc6389e0a", "score": "0.5245836", "text": "def fetch\n responses\n end", "title": "" }, { "docid": "3607a8433f9433a7dbd7c183e22779cf", "score": "0.524081", "text": "def first\n first_page.first\n end", "title": "" }, { "docid": "8dd05f77038dce7e1ebfb704ae8b48ae", "score": "0.52366793", "text": "def fetch_guest\n id = params[:guest_id]\n\n @guest = Guest.where(guestId: id).first\n head :not_found unless @guest\n end", "title": "" }, { "docid": "b20698a4187fd0d86aa9a8e951ce2dfc", "score": "0.52305424", "text": "def show\n @lead = Lead.retrieve_remote(params[:id])\n @lead_followup = LeadFollowup.new(recipient_id: @lead.recipient_id)\n if cookies[:initials].present?\n @lead_followup.initials = cookies[:initials]\n end\n end", "title": "" }, { "docid": "05aaf302f3f1f007dd2f8fcb053e7554", "score": "0.5221295", "text": "def fetch\n raise LoginError unless HTTP.loggedin?\n\n resp, @data = HTTP.get(\"/my/logs.aspx?s=1\")\n @doc = Nokogiri::HTML.parse(@data, nil, 'UTF-8')\n end", "title": "" }, { "docid": "21197d225844e7ee4042639d1761f2c0", "score": "0.522093", "text": "def first\n fetch_results(:offset => 0, :limit => 1).first\n end", "title": "" }, { "docid": "ef97909722656748c7b905db28733693", "score": "0.52120996", "text": "def query\n\n EventMachine.run do\n\n Fiber.new{\n result = fetch(params) \n if result\n render :json => result\n end\n }.resume\n end\n end", "title": "" }, { "docid": "39f4bf204300468eeddc4ed54dda0de0", "score": "0.5211945", "text": "def fetch(*args)\n AlmaHours.fetch(alma_url(*args))\n end", "title": "" }, { "docid": "13a7ff6097ab9f593f1a318180d67734", "score": "0.5210177", "text": "def fetch\n\t\tbegin\n\t\t\toutput current_session.user.client.rentals.find(params[:id])\n\t\trescue Exception => exception\n\t\t\terror exception.message, :not_found\n\t\tend\n\tend", "title": "" }, { "docid": "f15714b19ba34b2c0bd8b285822b5811", "score": "0.52088934", "text": "def request_item\n\t\tif [email protected]\n\t\t\[email protected]_cookies\n\n\t\t\[email protected]_homepage # no need to check if valid; it is assumed\n\t\t\t\t\t\t\t # to be so if a class is being requested\n\t\tend\n\n\t\tc = @client.get(@url,\n\t\t\t\t:header => {'Referer' => 'https://www.edline.net/pages/Brebeuf'})\n\n\t\t@headers = [c.headers]\n\t\t@contents = [c.content]\n\t\t@urls = [@url]\n\n\t\treturn c\n\tend", "title": "" }, { "docid": "459afe36acee6ed28fefaf549c7b3532", "score": "0.5197739", "text": "def fetch_from_handle(handle, request)\n mounted_on = \"#{Locomotive.mounted_on}/#{handle}/preview\"\n logged_in = request.env['warden'].try(:user).present?\n\n request.env['locomotive.mounted_on'] = request.env['steam.mounted_on'] = mounted_on\n request.env['locomotive.path'] = request.path_info.gsub(mounted_on, '')\n\n request.env['steam.live_editing'] = logged_in\n\n request.env['steam.private_access_disabled'] = logged_in\n\n Locomotive::Site.where(handle: handle).first\n end", "title": "" }, { "docid": "899cf0a506acae285756f8f037c84665", "score": "0.5195312", "text": "def fetch_client\n\n client_fetch_resp = Util::EntityHelper.fetch_and_validate_client(@client_id, 'j_sakidmj')\n return client_fetch_resp unless client_fetch_resp.success?\n\n @client = client_fetch_resp.data\n\n success\n\n end", "title": "" }, { "docid": "3099021780b9c06d14b9b222f2a48882", "score": "0.5192817", "text": "def fetch(url)\r\n end", "title": "" }, { "docid": "37dd2d3463c5faf32687e19b99d11473", "score": "0.5192155", "text": "def fetch( oid )\n\t\treturn self.retrieve( oid )\n\tend", "title": "" }, { "docid": "e0a5ac336db25c57173da074647d9ff3", "score": "0.51902866", "text": "def fetch_client_web_host\n @client_web_host = ClientWebHostDetail.get_from_memcache_by_client_id(@client_id)\n end", "title": "" }, { "docid": "7e4d2ac38e860991f5c162e5ae542d48", "score": "0.51884943", "text": "def homepage_data\n @refcode = params[:refcode]\n @mortgage_aprs = HomepageRateServices::GetMortgageAprs.call\n @last_updated = nil\n if @mortgage_aprs['updated_at'].present?\n @last_updated = Time.zone.parse(@mortgage_aprs['updated_at'].to_s).strftime('%b %d, %G %I:%M %p %Z')\n @last_updated = @last_updated.gsub(\"PDT\", \"PST\")\n end\n end", "title": "" }, { "docid": "1692d839e5a4d50ac2b2223436414e4b", "score": "0.51873875", "text": "def retrieve\n # Nothing.\n end", "title": "" }, { "docid": "9eba3760beaed3cbc1ea392bfabeecee", "score": "0.5177872", "text": "def load_site\n nsc = add_response\n Site.load(nsc, 2)\n end", "title": "" }, { "docid": "a013303674d7be9ba1ce56ba50c60524", "score": "0.5173754", "text": "def fetch\n open(to_url) { |io| io.read }\n end", "title": "" }, { "docid": "a013303674d7be9ba1ce56ba50c60524", "score": "0.5173754", "text": "def fetch\n open(to_url) { |io| io.read }\n end", "title": "" }, { "docid": "df5b832d69e8a46c13c94e60c7cfc2dd", "score": "0.51732695", "text": "def prev\n @client.get(@request[:url], {}, :query => (@request[:query]).merge(:max_id => @first_id))\n end", "title": "" }, { "docid": "db22128d0a0667809e8db1a0b99bd4bf", "score": "0.5172817", "text": "def fetch\n raise \"Not ready\" unless @state == :ready\n @state = :fetching\n send_command(@body)\n @data\n end", "title": "" }, { "docid": "f346e3ee6df654e2233bd350430d0fd8", "score": "0.5171355", "text": "def fetch(url)\n\t\tresponse = self.request('GET', url)\n\t\treturn response['data']\n\tend", "title": "" }, { "docid": "efcc94332203fb40898f84d749f59027", "score": "0.5169726", "text": "def opening_url\n fetch('jera.openings')\n end", "title": "" }, { "docid": "3affd9388e1736536224df7e9b684e7d", "score": "0.51691127", "text": "def get_installazione\n id_clienti_cliente = session['ente_corrente'].is_a?(Hash) ? session['ente_corrente']['clienti_cliente_id'] : session['ente_corrente'].clienti_cliente_id\n #return ClientiCliente.find(id_clienti_cliente).clienti_installazioni[0]\n return ClientiInstallazione.installazione_ruby(id_clienti_cliente)[0]\n \n end", "title": "" }, { "docid": "d825f43beee437bb538b1dbdfe818731", "score": "0.51683706", "text": "def coach\n fetch('volleyball.coach')\n end", "title": "" }, { "docid": "796f14adf939b087c56b2344d1a50663", "score": "0.5167118", "text": "def fetch_remote_data\n Net::HTTP.start(@url1, 80 ) do |http|\n @@fetched_data = ( http.get(@ext1).body )\n end\n self\n end", "title": "" }, { "docid": "a882abdb7129aebb05f9c84139c201de", "score": "0.5165926", "text": "def load_page\n logger.info 'Loading PAHMA homepage'\n get ConfigPAHMA.base_url\n when_exists(page_heading, Config.medium_wait)\n end", "title": "" }, { "docid": "4b9bb9d9b4b6ff44e5ce1018446fddb0", "score": "0.5163072", "text": "def get_home_page\n Nokogiri::HTML(RestClient.get 'http://news.ycombinator.com')\n end", "title": "" }, { "docid": "1c5eabfd0288072e73a0ea6f26123b37", "score": "0.5161024", "text": "def fetch(env); end", "title": "" }, { "docid": "4a3948ffa9a10b9d7b666660d62a1a57", "score": "0.5159468", "text": "def fetch\n self.bc.next\n end", "title": "" }, { "docid": "8e07ffd8d2c6f12b9f94dfd16051246b", "score": "0.5159231", "text": "def full_details\n\n # if url data api call has already been made, then return the obj\n # else make the api call to populate the data\n update_url_info unless requested\n self\n end", "title": "" }, { "docid": "41a85696181cca9adf8248fa6e9a0eaf", "score": "0.5159166", "text": "def fetch()\n source = ''\n hostname = \"balloo.jp\";\n url = \"/balloo/cgi/getthread.php?thread_id=#{@channel_code}&lastno=#{@lastno}\";\n\n Net::HTTP.new(hostname).start do |w|\n source = w.get(url).body\n end\n\n return source\n end", "title": "" }, { "docid": "8f6254793ac0d93273456318981a12bd", "score": "0.5158672", "text": "def fetch_client_details\n if is_ost_kyc_default_client?\n @campaign_api_key = GlobalConstant::PepoCampaigns.api_key\n @campaign_api_secret_d = GlobalConstant::PepoCampaigns.api_secret\n success\n else\n @client = Client.get_from_memcache(@hook.client_id)\n @client_pepo_campaign_detail_obj = ClientPepoCampaignDetail.get_from_memcache(@hook.client_id)\n @campaign_api_key = @client_pepo_campaign_detail_obj.api_key\n decrypt_api_secret\n end\n end", "title": "" }, { "docid": "346df7a785e28c243a03543a9930d295", "score": "0.51582885", "text": "def fetch!\n @response = Nokogiri::HTML(open(@url))\n end", "title": "" }, { "docid": "344d1cd38a3df64435a017527bc66f9b", "score": "0.5158013", "text": "def fetch_details\n\t\tself.send(\"fetch_details_from_#{self.provider.downcase}\")\n\tend", "title": "" } ]
a6450c675cf20b589e742eaa7f298e2a
GET /bests/1 GET /bests/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "80e9574bf90ff8068900e6f22ae352d4", "score": "0.7182183", "text": "def index\n @bests = Best.all\n end", "title": "" }, { "docid": "afcdc3ea6a73c4cc60fe0ee216373f44", "score": "0.6738199", "text": "def show\n @bestgame = Bestgame.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bestgame }\n end\n end", "title": "" }, { "docid": "a4979c2303097ed12e87c7fc06a95787", "score": "0.6618545", "text": "def index\n @best_evers = BestEver.all\n end", "title": "" }, { "docid": "d2657530299c0a38ea4485a81357f87a", "score": "0.6433257", "text": "def create\n @best = Best.new(best_params)\n\n respond_to do |format|\n if @best.save\n format.html { redirect_to @best, notice: 'Best was successfully created.' }\n format.json { render :show, status: :created, location: @best }\n else\n format.html { render :new }\n format.json { render json: @best.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f5bc3427945f5e977a1940e130598640", "score": "0.62579066", "text": "def best\n @best = User.find_paginated_best_bands_and_deejays :page => params[:page], :per_page => 3\n render :partial => 'best'\n end", "title": "" }, { "docid": "172c3e60bbf1915605edf4556b5c96e1", "score": "0.6172376", "text": "def set_best\n @best = Best.find(params[:id])\n end", "title": "" }, { "docid": "b06b50031d93a9f0b72a7fdfce267b35", "score": "0.60916805", "text": "def show\n @needed_good = NeededGood.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @needed_good }\n end\n end", "title": "" }, { "docid": "fc9b9ffb53bd7db285df48aedd87e626", "score": "0.6029882", "text": "def index\n @best_users = BestUser.all\n end", "title": "" }, { "docid": "9557fc58f3e251435eed596e21875dc2", "score": "0.5998323", "text": "def index\n @besties = get_besties\n @videos = get_videos\n @interactions = get_interactions\n end", "title": "" }, { "docid": "31382a74a978d17fbbb1c9b352dd03c1", "score": "0.5993436", "text": "def index\n @witnesses = Witness.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @witnesses }\n end\n end", "title": "" }, { "docid": "22d2c9f639ed24d575f54e118aa40c7c", "score": "0.5945167", "text": "def index\n @bet_scores = @match.bet_scores\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bet_scores }\n end\n end", "title": "" }, { "docid": "60528cd7ab53148df76a39e37b8f70e9", "score": "0.59386903", "text": "def index\n info = Aws.get_recipes_from_db\n render :json => info\n end", "title": "" }, { "docid": "da5ce0830da6eb1d7bfee14266fe191d", "score": "0.5882725", "text": "def show\n @mostsmallresource = Mostsmallresource.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mostsmallresource }\n end\n end", "title": "" }, { "docid": "d82ac1234702a8e97d5e415ccff9f25c", "score": "0.5865184", "text": "def index\n @appraisal_best_stats = AppraisalBestStat.all\n end", "title": "" }, { "docid": "82b321ca003f88f88b22299875672ce7", "score": "0.5852749", "text": "def show\n @good = Good.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @good }\n end\n end", "title": "" }, { "docid": "62319ef5d8b23cb011ff5239579b7d80", "score": "0.5819599", "text": "def index\n render json: {\n status: :success,\n urls: ShortUrl::top_100\n }\n end", "title": "" }, { "docid": "5016d8f41cc30cefeafebb09a9d3d7bf", "score": "0.5806113", "text": "def serv_json\n \"http://api.dribbble.com/shots/popular?page=1\"\n end", "title": "" }, { "docid": "cd4c61ea9bdde46b6b0bb592f68611a4", "score": "0.58002484", "text": "def index\n @super_bowl_picks = SuperBowlPick.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @super_bowl_picks }\n end\n end", "title": "" }, { "docid": "419c55bdaf3c1e033350ab5dcd3660b3", "score": "0.5797904", "text": "def show\n render json: @used_bike, serializer: Web::V1::UsedBikeSerializer\n end", "title": "" }, { "docid": "64a1d8cd57f324bbed1d8cba265de5fa", "score": "0.578973", "text": "def update\n respond_to do |format|\n if @best.update(best_params)\n format.html { redirect_to @best, notice: 'Best was successfully updated.' }\n format.json { render :show, status: :ok, location: @best }\n else\n format.html { render :edit }\n format.json { render json: @best.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0f9244bb568d7a26f1c5a9146796e924", "score": "0.578629", "text": "def show\n @prefer = Prefer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @prefer }\n end\n end", "title": "" }, { "docid": "927a88434eebf542849d63be51c5b7e9", "score": "0.5772759", "text": "def show\n #@bet_score = @match.bet_scores.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bet_score }\n end\n end", "title": "" }, { "docid": "6a9c6504041b9c3483220c011c16517f", "score": "0.5766206", "text": "def index\n @used_bikes = UsedBike.all\n\n render json: @used_bikes, each_serializer: Web::V1::UsedBikeSerializer\n end", "title": "" }, { "docid": "f3c747b8ebfc5e6f9ef4229ec16aef03", "score": "0.5765718", "text": "def index\n @urls = Url.get_top(25)\n # render json: @urls\n end", "title": "" }, { "docid": "693abeb40ddfe64dd972b8014614fe45", "score": "0.5763441", "text": "def show\n @mostsmallroad = Mostsmallroad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mostsmallroad }\n end\n end", "title": "" }, { "docid": "1c00b1f8ed55042cf6b529d329e4cd8f", "score": "0.5753238", "text": "def index\n @bounties = Bounty.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @bounties }\n end\n end", "title": "" }, { "docid": "7fd81d7b0f1950694d154f8f465a9203", "score": "0.5725997", "text": "def index\n @winners = Winner.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @winners }\n end\n end", "title": "" }, { "docid": "d3b1c48289d21917702bf57ce592f91e", "score": "0.57201594", "text": "def show\n @go_slim = GoSlim.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @go_slim }\n end\n end", "title": "" }, { "docid": "a613f6e6f0318023e97fa4ad7cee0b91", "score": "0.57105696", "text": "def index\n base_url = 'https://www.googleapis.com/books/v1/volumes?q=fiction&maxResults=20'\n and_key = '&key='\n key = ENV['GOOGLE_BOOKS_API_KEY'] \n googleurl = base_url + and_key + key\n\n response = RestClient.get(googleurl)\n @books = JSON.parse(response)\n\n respond_to do |format|\n format.html\n format.json { render json: @books }\n end\n\nend", "title": "" }, { "docid": "3d46c62c7250529d62fe894fd79eec0b", "score": "0.57067835", "text": "def index\n @games = Game.available\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end", "title": "" }, { "docid": "963dc7a6eef3fdde1e4caa982e2b42bd", "score": "0.56975853", "text": "def show\n @brain = Brain.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @brain }\n end\n end", "title": "" }, { "docid": "dc1fd0930fa2abd885543937f876ceac", "score": "0.5687548", "text": "def index\n @tunes = Tune.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tunes }\n end\n end", "title": "" }, { "docid": "b02dd838eb36ed042717526a50422341", "score": "0.56824505", "text": "def index\n @candidates = Candidate.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @candidates }\n end\n end", "title": "" }, { "docid": "06416cbdbe5caf6961052fdac4414c9e", "score": "0.5681979", "text": "def index\n @bikes = Bike.all.order(\"display_order\")\n render json: @bikes.includes(:specifications) #each_serializer: Web::V1::BikeSerializer\n end", "title": "" }, { "docid": "ca56c257f6ca997e89a0a161174fc93d", "score": "0.5681047", "text": "def set_best_ever\n @best_ever = BestEver.find(params[:id])\n end", "title": "" }, { "docid": "4a6c5ebcd80879dd238d2b4c4cb31516", "score": "0.56796455", "text": "def show\n @high_score = HighScore.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @high_score }\n end\n end", "title": "" }, { "docid": "8e711ef13cb1187832cfe6aebc57cdfe", "score": "0.56743646", "text": "def show\n @bet = Bet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bet }\n end\n end", "title": "" }, { "docid": "2f0a2ac6847a6614eb3281f5ec3d13e6", "score": "0.5668941", "text": "def index\n @mini_games = MiniGame.all\n render json: @mini_games, status: :ok\n end", "title": "" }, { "docid": "fce634c01069b34d6ca894329867b38b", "score": "0.5668801", "text": "def index\n @title = \"All the Best Recipes in the World and on the Web\"\n if params[:search]\n @recipes_best_before = Recipe.where(\"king = ?\", true)\n @search = @recipes_best_before.search(params[:search])\n @recipes_search = @search.all # load all matching records\n \n elsif params[:category]\n @category_dish = Dish.tagged_with(\"#{params[:category]}\")\n @category_mapping = @category_dish.map {|dish| dish.id}\n @category_recipes = Recipe.where(\"king = ? AND dish_id IN (?)\", true, @category_mapping)\n else\n @recipes_best = Recipe.where(\"king = ?\", true)\n end\n @recipes_challengers = Recipe.where(\"king = ?\", false)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @recipes }\n end\n end", "title": "" }, { "docid": "12ea101542bab3130880457a7ba2bafe", "score": "0.5667345", "text": "def index\n @buisnesses = Buisness.all\n\n render json: @buisnesses \n end", "title": "" }, { "docid": "24743a4fe19e45305f2ac9cd74e0bbad", "score": "0.56660175", "text": "def show\n @broad = Broad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @broad }\n end\n end", "title": "" }, { "docid": "b047439b902c1e6ded344f7bc6c3ab9e", "score": "0.565766", "text": "def index\n @high_scores = HighScore.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @high_scores }\n end\n end", "title": "" }, { "docid": "b64c4a7da322fc26dea8d0ad09418c41", "score": "0.5652702", "text": "def index\n @trips = Trip.desc.all\n @latest_trip = @trips.first\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trips }\n end\n end", "title": "" }, { "docid": "d8b6dcb88892dd53faa48bb30099de31", "score": "0.5651062", "text": "def show\n @gig = Gig.find(params[:id])\n\n respond_to do |format|\n format.html {render json: @gig, status: :ok}\n format.json { render json: @gig, status: :ok }\n end\n end", "title": "" }, { "docid": "d61b8c5d5cdc624fed90ecdc5a7fa5c2", "score": "0.56488156", "text": "def show\n @mosttwo = Mosttwo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mosttwo }\n end\n end", "title": "" }, { "docid": "76a96804f2117432d5d0d99e0e9c50a6", "score": "0.5647447", "text": "def index\n @brochures = Brochure.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @brochures }\n end\n end", "title": "" }, { "docid": "b3f491d0df1efbc0376183320db9c922", "score": "0.5637724", "text": "def index\n recipes = Recipe.all\n render status: :ok, json: recipes\n end", "title": "" }, { "docid": "2eb8f125f258e723204eeb7cef12a21e", "score": "0.5636106", "text": "def best\n load\n end", "title": "" }, { "docid": "4436df930a9ecefa8d509e1c5fc8d3f1", "score": "0.563389", "text": "def index\n @neighborhoods = Neighborhood.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @neighborhoods }\n end\n end", "title": "" }, { "docid": "e6eb83a4a3182740e167fe8d6f8d8103", "score": "0.5632244", "text": "def show\n @training = trainings.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @training }\n end\n end", "title": "" }, { "docid": "1e24cf5cb9e47ca72ab3203d139d50c8", "score": "0.56302536", "text": "def show\n @benthic_cover = BenthicCover.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @benthic_cover }\n end\n end", "title": "" }, { "docid": "3a4729c9d39818a67b836955ffe66f50", "score": "0.56252587", "text": "def show\n @mosttinytrial = Mosttinytrial.find(params[:id], :include => [:def_user, :atk_user, :def_strategy, :atk_strategy, :map])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mosttinytrial }\n end\n end", "title": "" }, { "docid": "48745810d72bd5a045369f2d5d9b7d30", "score": "0.5619469", "text": "def index_single_gift\n render json: @gift, include: :ages, status: :ok\n end", "title": "" }, { "docid": "68564fc65985d8cfe3e2eb70e6515689", "score": "0.56152743", "text": "def index\n @military_battle_rounds = Military::BattleRound.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @military_battle_rounds }\n end\n end", "title": "" }, { "docid": "0382563017f71f768645d1909a3a3ff7", "score": "0.5613939", "text": "def index\n @shop_section = ShopSection.find_by_short_url(\"brands\")\n @brands = Brand.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @brands }\n end\n end", "title": "" }, { "docid": "1c5a666f01b09d045d75aac81893a464", "score": "0.5607961", "text": "def index\n @bourbons = Bourbon.all\n\n @bourbons.each do |bourbon|\n bourbon.find_similar\n end\n\n respond_to do |format|\n format.html \n format.json { render json: @bourbons, :include => [:ratings, :similar], :methods => [:similar_id, :similarity, :all_similar] }\n end\n end", "title": "" }, { "docid": "b8c8223f4b53cb320cf9b625444069d5", "score": "0.5593839", "text": "def show\n @belief = Belief.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @belief }\n end\n end", "title": "" }, { "docid": "83f5ed46108714702f1c9a2ffa3d80ad", "score": "0.5593808", "text": "def show\n @supermarket = Supermarket.find(params[:id])\n respond_to do |format|\n format.json { render json: @supermarket, status: :ok } \n end \n end", "title": "" }, { "docid": "1f226a4e02b359e4d00b18d23c050030", "score": "0.559307", "text": "def show\n @gopy = Gopy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gopy }\n end\n end", "title": "" }, { "docid": "09c5a2d5d889f1b511c41e16c2508cf9", "score": "0.55921763", "text": "def index\n @strategies = Strategy.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @strategies }\n end\n end", "title": "" }, { "docid": "536873467717fc6bf310a76f16b665d6", "score": "0.55833834", "text": "def index\n @recent = Highfive.recent.approved\n @leaders = User.leaders\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @highfives }\n end\n end", "title": "" }, { "docid": "a5373f16077decaef11b83cedd4952c0", "score": "0.5582192", "text": "def index\n @bottlings = handle_sorting(:bottling, :sku, :wine, :bottle_size)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bottlings }\n end\n end", "title": "" }, { "docid": "d9df8ff25e53c93a66a7824b102234d4", "score": "0.55806655", "text": "def index\n @best_of_days = BestOfDay.all\n end", "title": "" }, { "docid": "700172c0fe7acafe12a8448e116bcc34", "score": "0.5580311", "text": "def index\n @supermarkets = Supermarket.all\n respond_to do |format|\n format.json { render json: @supermarkets, status: :ok } \n end \n end", "title": "" }, { "docid": "5426b424fe55836323b7f1c5ca6314d9", "score": "0.5577552", "text": "def index\n @choices = Choice.all\n\n render json: @choices\n end", "title": "" }, { "docid": "0f227ad6cafd2dd0bb14ba44faf38370", "score": "0.5577479", "text": "def show\n @gift = Gift.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gift }\n end\n end", "title": "" }, { "docid": "211b9096b4615d1f876d62a0b878e037", "score": "0.5575506", "text": "def show\n @recommendation = Recommendation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recommendation }\n end\n end", "title": "" }, { "docid": "28b7580ef4f7ac543e36e7eb6ef9e2a8", "score": "0.5568078", "text": "def show\n @weight = Weight.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @weight }\n end\n end", "title": "" }, { "docid": "c828ad30558fa0cd8265aad783d812d7", "score": "0.55655986", "text": "def rating(food)\n url = 'https://thereportoftheweek-api.herokuapp.com/reports'\n uri = URI(url)\n response = Net::HTTP.get(uri)\n result = JSON.parse(response)\n puts result[7]['product']\n \n end", "title": "" }, { "docid": "cee1011ff340d9af25db4ffe7fe2106a", "score": "0.55621654", "text": "def show\n @mostsmallskill = Mostsmallskill.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mostsmallskill }\n end\n end", "title": "" }, { "docid": "4204a601b939b718f5732dc2a17131ad", "score": "0.55606717", "text": "def index\n @shorties = Shorty.per_user(current_user).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shorties }\n end\n end", "title": "" }, { "docid": "bf7aeb2e696b95c09bdda52c0a8d6fb8", "score": "0.55596054", "text": "def show\n @best_lap = BestLap.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @best_lap }\n end\n end", "title": "" }, { "docid": "d68cdff1fd47502857a704022fe1d772", "score": "0.55561286", "text": "def index\n @textures = Texture.find(:all, :limit => 20, :order=> 'created_at desc')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @textures }\n end\n end", "title": "" }, { "docid": "e7dea11b4d3a0e7603149941905f76df", "score": "0.5556031", "text": "def index\n @beverages = Beverage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @beverages }\n end\n end", "title": "" }, { "docid": "381f228778d3343e3e046de490404528", "score": "0.5555503", "text": "def index\n @harvestings = Harvesting.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @harvestings }\n end\n end", "title": "" }, { "docid": "b78302b068048b7d43ec3cee820ff4dd", "score": "0.5544786", "text": "def index\n @contests = Contest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contests }\n end\n end", "title": "" }, { "docid": "284a2cb82d21bb2c835bb48a661aec03", "score": "0.55446374", "text": "def show\n response = Aws.list_recipe(params[:id])\n render :json => response\n end", "title": "" }, { "docid": "ebf74c060332d6c923be38765e2eae32", "score": "0.5543911", "text": "def index\n @best_laps = BestLap.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @best_laps }\n end\n end", "title": "" }, { "docid": "d4b1a15f0c3fe527a4d864d112e7cefb", "score": "0.5543834", "text": "def show\n @bowl = Bowl.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @bowl }\n end\n end", "title": "" }, { "docid": "4b862462beb1d6d10506f73daf71f18c", "score": "0.5539221", "text": "def index\n sighting = Sighting.all \n render json: SightingSerializer.new(sighting)\n end", "title": "" }, { "docid": "00a226c4fd18011541ec66f182878c71", "score": "0.55327564", "text": "def show\n render \"api/v1/bounties/show\"\n end", "title": "" }, { "docid": "a3ddfa7b84a8d639e7c14a1f4c73e71b", "score": "0.5529013", "text": "def show\r\n\r\n url = URI(\"https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/#{params[:id]}/information\")\r\n\r\n http = Net::HTTP.new(url.host, url.port)\r\n http.use_ssl = true\r\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\r\n\r\n request = Net::HTTP::Get.new(url)\r\n request[\"x-rapidapi-key\"] = ENV[\"SPOONACULAR_API_KEY\"] # hidden API key\r\n request[\"x-rapidapi-host\"] = 'spoonacular-recipe-food-nutrition-v1.p.rapidapi.com'\r\n\r\n response = http.request(request)\r\n @recipe = JSON.parse response.read_body # gets the recipe\r\n\r\n p url_ingredients = URI(\"https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/#{params[:id]}/ingredientWidget.json\")\r\n\r\n http_ingredients = Net::HTTP.new(url_ingredients.host, url_ingredients.port)\r\n http_ingredients.use_ssl = true\r\n http_ingredients.verify_mode = OpenSSL::SSL::VERIFY_NONE\r\n\r\n request_ingredients = Net::HTTP::Get.new(url_ingredients)\r\n request_ingredients[\"x-rapidapi-key\"] = ENV[\"SPOONACULAR_API_KEY\"]\r\n request[\"x-rapidapi-host\"] = 'spoonacular-recipe-food-nutrition-v1.p.rapidapi.com'\r\n\r\n response_ingredients = http.request(request_ingredients)\r\n # puts response_ingredients.read_body\r\n @ingredients = JSON.parse # data is a string (which looks like a hash -> convert to hash) response_ingredients.read_body\r\n p \"RECIPES\"\r\n # p @recipe\r\n p \"INGREDIENTS\"\r\n p @ingredients\r\n\r\n end", "title": "" }, { "docid": "8280760adc8a3b0a3eafee0551aecc1d", "score": "0.5526467", "text": "def show\n @mostsmalliteminfo = Mostsmalliteminfo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mostsmalliteminfo }\n end\n end", "title": "" }, { "docid": "389e5f4a14cfd02b2adbd8eebcef7f08", "score": "0.55225736", "text": "def show\n @rink_league = RinkLeague.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rink_league }\n end\n end", "title": "" }, { "docid": "f4e216129cd91fbf0e61ba566e94f9b1", "score": "0.55209416", "text": "def show\n respond_to do |format|\n format.html { render :layout => \"ai_contest\" }\n #format.json { render json: @ai_contest }\n end\n end", "title": "" }, { "docid": "70d0af0333897dedf5c177c7e03b188c", "score": "0.552074", "text": "def index\n @pots = Pot.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pots }\n end\n end", "title": "" }, { "docid": "1b51acc17639ea2a29cdb49f2a0d9ea5", "score": "0.55204636", "text": "def show\n @beverage = Beverage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @beverage }\n end\n end", "title": "" }, { "docid": "ea85ad4eb9415e5c9bbd0a1cbb0af9a1", "score": "0.55139536", "text": "def show\n @mostsmallmission = Mostsmallmission.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mostsmallmission }\n end\n end", "title": "" }, { "docid": "4a2b45925a115751df0545dedf8f60b6", "score": "0.55131894", "text": "def get_brandings\n request :get, \"/v3/brandings.json\"\n end", "title": "" }, { "docid": "4d24af29d361b4bcd24e795c98ea28b9", "score": "0.5511058", "text": "def index\n @neighborhoods = Neighborhood.alphabetical.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @neighborhoods }\n end\n end", "title": "" }, { "docid": "7bf278041bd23f7564ff918e871cb1cc", "score": "0.55078226", "text": "def index\n @sightings = Sighting.all\n render json: @sightings\n end", "title": "" }, { "docid": "be94c0d025e84b9958a69b065a8520cf", "score": "0.550488", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @neuropsychologist }\n end\n end", "title": "" }, { "docid": "35cf22a8902a50c01d5112eba4db4e82", "score": "0.5504858", "text": "def index\n render :json => UserInterest.all\n end", "title": "" }, { "docid": "9c5001d47f218e96dea40e0db65944a7", "score": "0.5501476", "text": "def index\n @interests = Interest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @interests }\n end\n end", "title": "" }, { "docid": "fef000927f7b3bb3bc02d94e82b72390", "score": "0.5501074", "text": "def show\n @mostsmallitemcategory = Mostsmallitemcategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mostsmallitemcategory }\n end\n end", "title": "" }, { "docid": "7eed0cea923c842ed286b367bdbc5b4d", "score": "0.5498292", "text": "def index\n @contests = Contest.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contests }\n end\n end", "title": "" }, { "docid": "d2b5c1571d30d242a6547c20553c08a1", "score": "0.54979545", "text": "def index\n @recipes = Recipe.all\n render json: @recipes\n end", "title": "" }, { "docid": "e456a95e9ed892f959bfa443c02c9584", "score": "0.5497501", "text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @interests }\n end\n end", "title": "" }, { "docid": "b1d591a747dd71044b121dc194f95007", "score": "0.5495177", "text": "def show\n @nugget = Nugget.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @nugget }\n end\n end", "title": "" }, { "docid": "67826590f868d52f4754d6e83c089ff2", "score": "0.5494143", "text": "def index\n @interests = Interest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @interests }\n end\n end", "title": "" }, { "docid": "bf4586a7eba4c93fe22dff857539a49d", "score": "0.54913116", "text": "def personal_best\n personal_top_three.first\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "9367b2fdf756150c14d4805e2299daab", "score": "0.0", "text": "def set_promotion\n @promotion = Promotion.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163754", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045816", "text": "def action_hook; end", "title": "" }, { "docid": "b8b36fc1cfde36f9053fe0ab68d70e5b", "score": "0.5944853", "text": "def run_actions; end", "title": "" }, { "docid": "3e521dbc644eda8f6b2574409e10a4f8", "score": "0.59169096", "text": "def define_action_hook; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.58892167", "text": "def actions; end", "title": "" }, { "docid": "bfb8386ef5554bfa3a1c00fa4e20652f", "score": "0.58342934", "text": "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "title": "" }, { "docid": "6c8e66d9523b9fed19975542132c6ee4", "score": "0.5776148", "text": "def add_actions; end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.57057375", "text": "def callbacks; end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.57057375", "text": "def callbacks; end", "title": "" }, { "docid": "6ce8a8e8407572b4509bb78db9bf8450", "score": "0.56534296", "text": "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "title": "" }, { "docid": "1964d48e8493eb37800b3353d25c0e57", "score": "0.56209534", "text": "def define_action_helpers; end", "title": "" }, { "docid": "5df9f7ffd2cb4f23dd74aada87ad1882", "score": "0.54244673", "text": "def post_setup\n end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.54101455", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.54101455", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.54101455", "text": "def action_methods; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.53951085", "text": "def before_setup; end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.5378493", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.53563684", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "0464870c8688619d6c104d733d355b3b", "score": "0.53399915", "text": "def define_action_helpers?; end", "title": "" }, { "docid": "0e7bdc54b0742aba847fd259af1e9f9e", "score": "0.5338049", "text": "def set_actions\n actions :all\n end", "title": "" }, { "docid": "5510330550e34a3fd68b7cee18da9524", "score": "0.53307265", "text": "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "title": "" }, { "docid": "97c8901edfddc990da95704a065e87bc", "score": "0.5312121", "text": "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "title": "" }, { "docid": "210e0392ceaad5fc0892f1335af7564b", "score": "0.5298173", "text": "def setup_handler\n end", "title": "" }, { "docid": "4f9a284723e2531f7d19898d6a6aa20c", "score": "0.5296388", "text": "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "title": "" }, { "docid": "83684438c0a4d20b6ddd4560c7683115", "score": "0.52952695", "text": "def before_actions(*logic)\n self.before_actions = logic\n end", "title": "" }, { "docid": "a997ba805d12c5e7f7c4c286441fee18", "score": "0.5258086", "text": "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "1d50ec65c5bee536273da9d756a78d0d", "score": "0.52430934", "text": "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5237911", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5237911", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5237911", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5237911", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5237911", "text": "def action; end", "title": "" }, { "docid": "e34cc2a25e8f735ccb7ed8361091c83e", "score": "0.52335346", "text": "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "title": "" }, { "docid": "635288ac8dd59f85def0b1984cdafba0", "score": "0.5232943", "text": "def workflow\n end", "title": "" }, { "docid": "78b21be2632f285b0d40b87a65b9df8c", "score": "0.5226392", "text": "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52221715", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "923ee705f0e7572feb2c1dd3c154b97c", "score": "0.5217978", "text": "def process_action(...)\n send_action(...)\n end", "title": "" }, { "docid": "b89a3908eaa7712bb5706478192b624d", "score": "0.52136153", "text": "def before_dispatch(env); end", "title": "" }, { "docid": "d89a3e408ab56bf20bfff96c63a238dc", "score": "0.52076435", "text": "def setup\n # override and do something appropriate\n end", "title": "" }, { "docid": "7115b468ae54de462141d62fc06b4190", "score": "0.52067244", "text": "def after_actions(*logic)\n self.after_actions = logic\n end", "title": "" }, { "docid": "62c402f0ea2e892a10469bb6e077fbf2", "score": "0.5175402", "text": "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "title": "" }, { "docid": "72ccb38e1bbd86cef2e17d9d64211e64", "score": "0.5174649", "text": "def setup(_context)\n end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.5173085", "text": "def setup(resources) ; end", "title": "" }, { "docid": "1fd817f354d6cb0ff1886ca0a2b6cce4", "score": "0.5165201", "text": "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "title": "" }, { "docid": "5531df39ee7d732600af111cf1606a35", "score": "0.5162052", "text": "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "title": "" }, { "docid": "bb6aed740c15c11ca82f4980fe5a796a", "score": "0.5157932", "text": "def determine_valid_action\n\n end", "title": "" }, { "docid": "b38f9d83c26fd04e46fe2c961022ff86", "score": "0.5152905", "text": "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "title": "" }, { "docid": "199fce4d90958e1396e72d961cdcd90b", "score": "0.5152353", "text": "def startcompany(action)\n @done = true\n action.setup\n end", "title": "" }, { "docid": "994d9fe4eb9e2fc503d45c919547a327", "score": "0.5150909", "text": "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "title": "" }, { "docid": "62fabe9dfa2ec2ff729b5a619afefcf0", "score": "0.514719", "text": "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.5138596", "text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "title": "" }, { "docid": "adb8115fce9b2b4cb9efc508a11e5990", "score": "0.51333916", "text": "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "title": "" }, { "docid": "e1dd18cf24d77434ec98d1e282420c84", "score": "0.51139015", "text": "def setup(&block)\n define_method(:setup, &block)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5113431", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5113431", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5109581", "text": "def action\n end", "title": "" }, { "docid": "f54964387b0ee805dbd5ad5c9a699016", "score": "0.51066816", "text": "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "title": "" }, { "docid": "35b302dd857a031b95bc0072e3daa707", "score": "0.5091428", "text": "def config(action, *args); end", "title": "" }, { "docid": "bc3cd61fa2e274f322b0b20e1a73acf8", "score": "0.5089407", "text": "def setup\n @setup_proc.call(self) if @setup_proc\n end", "title": "" }, { "docid": "246840a409eb28800dc32d6f24cb1c5e", "score": "0.5082971", "text": "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "title": "" }, { "docid": "5c3cfcbb42097019c3ecd200acaf9e50", "score": "0.50822043", "text": "def before_action \n end", "title": "" }, { "docid": "dfbcf4e73466003f1d1275cdf58a926a", "score": "0.50668514", "text": "def action\n end", "title": "" }, { "docid": "36eb407a529f3fc2d8a54b5e7e9f3e50", "score": "0.5055155", "text": "def matt_custom_action_begin(label); end", "title": "" }, { "docid": "b6c9787acd00c1b97aeb6e797a363364", "score": "0.50525695", "text": "def setup\n # override this if needed\n end", "title": "" }, { "docid": "9fc229b5b48edba9a4842a503057d89a", "score": "0.50499475", "text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "title": "" }, { "docid": "9fc229b5b48edba9a4842a503057d89a", "score": "0.50499475", "text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "title": "" }, { "docid": "fd421350722a26f18a7aae4f5aa1fc59", "score": "0.5034445", "text": "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "title": "" }, { "docid": "d02030204e482cbe2a63268b94400e71", "score": "0.50249445", "text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "title": "" }, { "docid": "4224d3231c27bf31ffc4ed81839f8315", "score": "0.5022226", "text": "def after(action)\n invoke_callbacks *options_for(action).after\n end", "title": "" }, { "docid": "24506e3666fd6ff7c432e2c2c778d8d1", "score": "0.50167644", "text": "def pre_task\n end", "title": "" }, { "docid": "0c16dc5c1875787dacf8dc3c0f871c53", "score": "0.5014211", "text": "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "title": "" }, { "docid": "c99a12c5761b742ccb9c51c0e99ca58a", "score": "0.4999924", "text": "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "title": "" }, { "docid": "791f958815c2b2ac16a8ca749a7a822e", "score": "0.49996212", "text": "def setup_signals; end", "title": "" }, { "docid": "0cff1d3b3041b56ce3773d6a8d6113f2", "score": "0.49978727", "text": "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "title": "" }, { "docid": "6e44984b54e36973a8d7530d51a17b90", "score": "0.4989682", "text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "title": "" }, { "docid": "6e44984b54e36973a8d7530d51a17b90", "score": "0.4989682", "text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "title": "" }, { "docid": "5aa51b20183964c6b6f46d150b0ddd79", "score": "0.49851838", "text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "title": "" }, { "docid": "67e7767ce756766f7c807b9eaa85b98a", "score": "0.49817684", "text": "def after_set_callback; end", "title": "" }, { "docid": "7647b99591d6d687d05b46dc027fbf23", "score": "0.4979687", "text": "def initialize(*args)\n super\n @action = :set\nend", "title": "" }, { "docid": "2a2b0a113a73bf29d5eeeda0443796ec", "score": "0.49787104", "text": "def setup\n #implement in subclass;\n end", "title": "" }, { "docid": "63e628f34f3ff34de8679fb7307c171c", "score": "0.49688423", "text": "def lookup_action; end", "title": "" }, { "docid": "a5294693c12090c7b374cfa0cabbcf95", "score": "0.49664098", "text": "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "title": "" }, { "docid": "4aceccac5b1bcf7d22c049693b05f81c", "score": "0.49564412", "text": "def around_hooks; end", "title": "" }, { "docid": "57dbfad5e2a0e32466bd9eb0836da323", "score": "0.49561828", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "5b6d613e86d3d68152f7fa047d38dabb", "score": "0.49547398", "text": "def release_actions; end", "title": "" }, { "docid": "2318410efffb4fe5fcb97970a8700618", "score": "0.4953481", "text": "def save_action; end", "title": "" }, { "docid": "64e0f1bb6561b13b482a3cc8c532cc37", "score": "0.4952925", "text": "def setup(easy)\n super\n easy.customrequest = @verb\n end", "title": "" }, { "docid": "fbd0db2e787e754fdc383687a476d7ec", "score": "0.4946049", "text": "def action_target()\n \n end", "title": "" }, { "docid": "b280d59db403306d7c0f575abb19a50f", "score": "0.494379", "text": "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "title": "" }, { "docid": "9f7547d93941fc2fcc7608fdf0911643", "score": "0.49319315", "text": "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "title": "" }, { "docid": "da88436fe6470a2da723e0a1b09a0e80", "score": "0.49313048", "text": "def before_setup\n # do nothing by default\n end", "title": "" }, { "docid": "21d75f9f5765eb3eb36fcd6dc6dc2ec3", "score": "0.49269778", "text": "def default_action; end", "title": "" }, { "docid": "3ba85f3cb794f951b05d5907f91bd8ad", "score": "0.49263066", "text": "def setup(&blk)\n @setup_block = blk\n end", "title": "" }, { "docid": "17ffe00a5b6f44f2f2ce5623ac3a28cd", "score": "0.49257493", "text": "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "title": "" }, { "docid": "80834fa3e08bdd7312fbc13c80f89d43", "score": "0.4924526", "text": "def callback_phase\n super\n end", "title": "" }, { "docid": "f1da8d654daa2cd41cb51abc7ee7898f", "score": "0.49212465", "text": "def advice\n end", "title": "" }, { "docid": "99a608ac5478592e9163d99652038e13", "score": "0.49173486", "text": "def _handle_action_missing(*args); end", "title": "" }, { "docid": "0fe8b3b5573f8eb57ec1752658a62e4e", "score": "0.4915802", "text": "def call\n setup_context\n super\n end", "title": "" }, { "docid": "9e264985e628b89f1f39d574fdd7b881", "score": "0.49151486", "text": "def duas1(action)\n action.call\n action.call\nend", "title": "" }, { "docid": "0dccebcb0ecbb1c4dcbdddd4fb11bd8a", "score": "0.49150333", "text": "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "title": "" }, { "docid": "6e0842ade69d031131bf72e9d2a8c389", "score": "0.49147308", "text": "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend", "title": "" } ]
5df92ecf5fd4a3a461f42aa74e64e795
GET /cubes/new GET /cubes/new.json
[ { "docid": "1d86cbf6f04bb91cf7c632560c3b5289", "score": "0.7468796", "text": "def new\n @cube = Cube.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cube }\n end\n end", "title": "" } ]
[ { "docid": "47dc48e4ad78e8f9cc75895963646fdc", "score": "0.74299556", "text": "def new\n @cuba = Cuba.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cuba }\n end\n end", "title": "" }, { "docid": "81e148fb290ca5d7b2ad2270cff2a059", "score": "0.69961214", "text": "def new\n @cube = @tray.cubes.new\n end", "title": "" }, { "docid": "0148c3808641b7dd7b3bb1a8f97f35c2", "score": "0.68148524", "text": "def create\n @cube = @tray.cubes.new(cube_params)\n respond_to do |format|\n if @cube.save\n url = tray_cube_path(@cube.tray.profile, @cube.tray, @cube)\n format.html { redirect_to url, notice: \"Cube was successfully created.\" }\n format.json { render :show, status: :created, location: url }\n else\n format.html { render :new }\n format.json { render json: @cube.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c6d74d149e45fcf09dd0e47c57599273", "score": "0.6808258", "text": "def create\n @cube = Cube.new(params[:cube])\n\n respond_to do |format|\n if @cube.save\n format.html { redirect_to @cube, notice: 'Cube was successfully created.' }\n format.json { render json: @cube, status: :created, location: @cube }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cube.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9700f7ac397c9678b1fdaf5f43c4b80a", "score": "0.67871135", "text": "def create\n @cuba = Cuba.new(params[:cuba])\n\n respond_to do |format|\n if @cuba.save\n format.html { redirect_to @cuba, notice: 'Cuba was successfully created.' }\n format.json { render json: @cuba, status: :created, location: @cuba }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cuba.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "00ca273d0eb10e035381cc2fe9569784", "score": "0.66954505", "text": "def new\n @box = Box.new\n 3.times { @box.things.build }\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @box }\n end\n end", "title": "" }, { "docid": "5b271433961c6a649627afae3340f9ee", "score": "0.6503949", "text": "def new\n @clube = Clube.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @clube }\n end\n end", "title": "" }, { "docid": "1cdc93ed63dd60a140ed447272f15435", "score": "0.6464821", "text": "def new\n @box = Box.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @box }\n end\n end", "title": "" }, { "docid": "b58ab3a99d2b690bc59787400bf9aadf", "score": "0.6428573", "text": "def new\n @cluster = Cluster.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cluster }\n end\n end", "title": "" }, { "docid": "b58ab3a99d2b690bc59787400bf9aadf", "score": "0.6428573", "text": "def new\n @cluster = Cluster.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cluster }\n end\n end", "title": "" }, { "docid": "59833f0a8eb7e6a3307a9aa0e972fc64", "score": "0.62821615", "text": "def create\n\n #Let's make sure the cube is not already created\n sigfox_id = params[:sigfox_id]\n cube = Cube.where(sigfox_id: sigfox_id)\n\n if(cube.any?)\n flash[:danger] = \"Cube already exists with this ID\"\n render 'new'\n end\n\n @cube = Cube.new(cube_params)\n if(@cube.save)\n flash[:success] = \"Cube created!\"\n redirect_to cubes_path\n else\n flash[:danger] = \"Problem creating cube. Please try again\"\n render 'new'\n \n end\n end", "title": "" }, { "docid": "03ac734055d019ddcf22f93d1fd5e3be", "score": "0.6276021", "text": "def create\n @clube = Clube.new(clube_params)\n\n respond_to do |format|\n if @clube.save\n format.html { redirect_to clubes_url }\n format.json { render :show, status: :created, location: @clube }\n else\n format.html { render :new }\n format.json { render json: @clube.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2618a72280b8a2f073efecde734a8197", "score": "0.6270088", "text": "def new\n @club = Club.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @club }\n end\n end", "title": "" }, { "docid": "2618a72280b8a2f073efecde734a8197", "score": "0.6270088", "text": "def new\n @club = Club.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @club }\n end\n end", "title": "" }, { "docid": "2618a72280b8a2f073efecde734a8197", "score": "0.6270088", "text": "def new\n @club = Club.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @club }\n end\n end", "title": "" }, { "docid": "2618a72280b8a2f073efecde734a8197", "score": "0.6270088", "text": "def new\n @club = Club.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @club }\n end\n end", "title": "" }, { "docid": "511cbed446587297a4c801570ae1a1a9", "score": "0.6198529", "text": "def new\n @user = User.where(\"username = ?\", params[:user_id]).first\n @box = @user.boxes.new(:kind => params[:box_kind], :parent=>params[:parent_box])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @box }\n end\n end", "title": "" }, { "docid": "616e712c54d073315271cc6dc47338dd", "score": "0.61840254", "text": "def new\n @clipping = Clipping.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clipping }\n end\n end", "title": "" }, { "docid": "2e5a2e0b2f2a4731cb174a6a4348de28", "score": "0.61833906", "text": "def new\n @club = Club.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @club }\n end\n end", "title": "" }, { "docid": "9d67bece19ca4be0d3f93382ff07670f", "score": "0.6179219", "text": "def new\n @cloud = Cloud.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cloud }\n end\n end", "title": "" }, { "docid": "6e62666bc32a2117d3c557da3a3cd072", "score": "0.61684155", "text": "def create\n @clube = Clube.new(params[:clube])\n\n respond_to do |format|\n if @clube.save\n format.html { redirect_to @clube, :notice => 'Clube was successfully created.' }\n format.json { render :json => @clube, :status => :created, :location => @clube }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @clube.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "320ed4187496b908bbdb6ad59e5ee90e", "score": "0.61683494", "text": "def new\n @square = Square.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @square }\n end\n end", "title": "" }, { "docid": "bb368224e5f8b73a2eb2de5a6188c9a7", "score": "0.61273307", "text": "def new\n @boxing = Boxing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @boxing }\n end\n end", "title": "" }, { "docid": "38827075db0242896a9ed20d960ee044", "score": "0.61207885", "text": "def new\n @guild = Guild.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @guild }\n end\n end", "title": "" }, { "docid": "be60113a9d4e1e319ec043bb11b13448", "score": "0.6118528", "text": "def new\n @collection = Collection.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @collection }\n end\n end", "title": "" }, { "docid": "be60113a9d4e1e319ec043bb11b13448", "score": "0.61181027", "text": "def new\n @collection = Collection.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @collection }\n end\n end", "title": "" }, { "docid": "f41329da2e5516c8af24124c9576a625", "score": "0.61160743", "text": "def new\n @mix = Mix.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mix }\n end\n end", "title": "" }, { "docid": "f41329da2e5516c8af24124c9576a625", "score": "0.61160743", "text": "def new\n @mix = Mix.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mix }\n end\n end", "title": "" }, { "docid": "f41329da2e5516c8af24124c9576a625", "score": "0.61160743", "text": "def new\n @mix = Mix.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mix }\n end\n end", "title": "" }, { "docid": "c977e2253f6f26b4fc987b39da8babb9", "score": "0.60960025", "text": "def new\n @lab_scene = LabScene.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lab_scene }\n end\n end", "title": "" }, { "docid": "ba60e6cfd605e8a73a73e183b2313546", "score": "0.6084688", "text": "def new\n @color_surface = ColorSurface.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @color_surface }\n end\n end", "title": "" }, { "docid": "74f19387dff7d618e4802c1073693348", "score": "0.6082827", "text": "def new\n @mosaic = Mosaic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mosaic }\n end\n end", "title": "" }, { "docid": "3fcc9981c150d8df854b3b3ada73622d", "score": "0.60801923", "text": "def new\n @cut = Cut.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cut }\n end\n end", "title": "" }, { "docid": "082eec75647cd163a90459ca07d187c1", "score": "0.60799026", "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": "6c9c7c49738b58ce31271fcf3e4cddd0", "score": "0.6075477", "text": "def new\n @boxer = Boxer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @boxer }\n end\n end", "title": "" }, { "docid": "78d2969d0054f4adc2cd8fb0986912ea", "score": "0.607276", "text": "def new\n @routine = Routine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @routine }\n end\n end", "title": "" }, { "docid": "78d2969d0054f4adc2cd8fb0986912ea", "score": "0.607276", "text": "def new\n @routine = Routine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @routine }\n end\n end", "title": "" }, { "docid": "30190aa5002fc777f544933995d5bcda", "score": "0.606032", "text": "def new\n @collection = Collection.new\n @project = Project.find params[:project_id]\n @collection.project = @project\n @collection.client_id = @project.client_id\n @collection.space = current_space\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @collection }\n end\n end", "title": "" }, { "docid": "fc7e42745bd88d648c099ba0a1c592bf", "score": "0.6059038", "text": "def new\n @division = @project.divisions.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @division }\n end\n end", "title": "" }, { "docid": "3a6f4831bbf9e247d63619c2ffbc91fb", "score": "0.6053897", "text": "def new\n @clustermap = Clustermap.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clustermap }\n end\n end", "title": "" }, { "docid": "f3ad78e1de822e0712ba16b0b3fe5b28", "score": "0.60503066", "text": "def new\n @collection = Collection.new\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @collection }\n end\n end", "title": "" }, { "docid": "e1a775e22775c35a906bb69fb64adc01", "score": "0.60479695", "text": "def new\n @collage = Collage.new\n get_all_categories\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @collage }\n end\n end", "title": "" }, { "docid": "0f91a60c626a836ed78bf24e46763612", "score": "0.604265", "text": "def new\n @vet_lab = VetLab.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vet_lab }\n end\n end", "title": "" }, { "docid": "79c959cc9ec0bd694197cb50d2d8704d", "score": "0.60410476", "text": "def new\n @player_color_bucket = PlayerColorBucket.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @player_color_bucket }\n end\n end", "title": "" }, { "docid": "29d873fbc76bc40f0154a4dd285716b7", "score": "0.60309225", "text": "def new\n @pool = Pool.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pool }\n end\n end", "title": "" }, { "docid": "29d873fbc76bc40f0154a4dd285716b7", "score": "0.60309225", "text": "def new\n @pool = Pool.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pool }\n end\n end", "title": "" }, { "docid": "8073373132431077ac4abe6ba689cece", "score": "0.60267144", "text": "def new\n @carton_box = CartonBox.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @carton_box }\n end\n end", "title": "" }, { "docid": "ac593c4fb70014b1cfe4cdabecbe7fc5", "score": "0.6025481", "text": "def new\n @box_style = BoxStyle.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @box_style }\n end\n end", "title": "" }, { "docid": "308440994fb11a73abafde6eb02c460b", "score": "0.5994433", "text": "def new\n @ice = Ice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @ice }\n end\n end", "title": "" }, { "docid": "8a577dea3f385627046e543e204f20f7", "score": "0.59889156", "text": "def new\n @lab = Lab.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lab }\n end\n end", "title": "" }, { "docid": "8a577dea3f385627046e543e204f20f7", "score": "0.59889156", "text": "def new\n @lab = Lab.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lab }\n end\n end", "title": "" }, { "docid": "8a577dea3f385627046e543e204f20f7", "score": "0.59889156", "text": "def new\n @lab = Lab.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lab }\n end\n end", "title": "" }, { "docid": "c79a62bcce1e3be95e0c695de434f62b", "score": "0.59869474", "text": "def new\n @face = @cube.faces.new\n end", "title": "" }, { "docid": "6287b2f999646811a5bc932ac2963f5a", "score": "0.5981341", "text": "def list_cubes()\n url = \"#{base_url}/mondrian/cubecrudapi/cubes\"\n resp = Net::HTTP.get_response(URI.parse(url))\n response_xml = resp.body.strip\n parse_response(response_xml)\n response_xml\n end", "title": "" }, { "docid": "315d5bcda50284b78768ae305525efe4", "score": "0.5979684", "text": "def new\n @bilder = Bilder.new(:catalog_id => params[:catalog_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bilder }\n end\n end", "title": "" }, { "docid": "6c3609f862d6da620b0c50becc4343ba", "score": "0.59786147", "text": "def new\n @lens = Lens.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lens }\n end\n end", "title": "" }, { "docid": "a1e75f3e172e6f3ee83bf557dd876936", "score": "0.5975762", "text": "def new\n @pack = Pack.new\n\n render json: @pack\n end", "title": "" }, { "docid": "2799c05ff543af091379c07094d497ae", "score": "0.5971711", "text": "def new\r\n @pool = Pool.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @pool }\r\n end\r\n end", "title": "" }, { "docid": "37474aa19908f22213dfe0c864060009", "score": "0.5968696", "text": "def new\n \t\"puts get carts new\"\n @cart = Cart.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cart }\n end\n end", "title": "" }, { "docid": "9494f630e7a2c52e389654557ed21f70", "score": "0.5962346", "text": "def new\n @computer = @client.computers.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @computer }\n end\n end", "title": "" }, { "docid": "df44f3e4d5c26b4b20875b5f82536186", "score": "0.59600836", "text": "def new\n @layer = Layer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @layer }\n end\n end", "title": "" }, { "docid": "df44f3e4d5c26b4b20875b5f82536186", "score": "0.59600836", "text": "def new\n @layer = Layer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @layer }\n end\n end", "title": "" }, { "docid": "df44f3e4d5c26b4b20875b5f82536186", "score": "0.59600836", "text": "def new\n @layer = Layer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @layer }\n end\n end", "title": "" }, { "docid": "dcd9c90616df23c5b1305b4355eaaf80", "score": "0.59565586", "text": "def create\n @borg_cube = BorgCube.new(borg_cube_params)\n\n respond_to do |format|\n if @borg_cube.save\n format.html { redirect_to @borg_cube, notice: 'Borg cube was successfully created.' }\n format.json { render action: 'show', status: :created, location: @borg_cube }\n else\n format.html { render action: 'new' }\n format.json { render json: @borg_cube.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "68939f8c93cd8f588df7f5f174b0a89f", "score": "0.5955072", "text": "def new\n @stuff = current_user.stuffs.new\n 5.times do\n @stuff.assets.build\n end\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stuff }\n end\n end", "title": "" }, { "docid": "131180d9bf4390f15ae2a0718327c74d", "score": "0.5952871", "text": "def new\n @collect = Collect.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @collect }\n end\n end", "title": "" }, { "docid": "47c36f3c6b8e33227d2e840df44cab48", "score": "0.5950836", "text": "def new\n @surface = Surface.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @surface }\n end\n end", "title": "" }, { "docid": "baf442ed728a847b711b6070aa276e36", "score": "0.5950373", "text": "def new\n @mongotest = Mongotest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mongotest }\n end\n end", "title": "" }, { "docid": "ccbf0c4c2191da38ecd94435d1c0415d", "score": "0.59452176", "text": "def new\n @composition = @mint_coin.compositions.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @composition }\n end\n end", "title": "" }, { "docid": "e494c0ae849819bddf23fce82a0b3d83", "score": "0.59436035", "text": "def new\n @siz = Siz.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @siz }\n end\n end", "title": "" }, { "docid": "6312d86cbbd1889d84b429f2d3ce93d4", "score": "0.59324574", "text": "def new\n\t\t@network = Network.new\n\t\trender json: @network\n\tend", "title": "" }, { "docid": "92d927c3aac206057a5f80de9c067398", "score": "0.59314024", "text": "def new\n @lab_cat = LabCat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lab_cat }\n end\n end", "title": "" }, { "docid": "621003e7abc453e246efb6483bc10456", "score": "0.59308976", "text": "def new\n @cabinet = Cabinet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cabinet }\n end\n end", "title": "" }, { "docid": "928b6b9469f2a16d2b2785ef888ae9ec", "score": "0.5920073", "text": "def new\n @layer = Layer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @layer }\n end\n end", "title": "" }, { "docid": "01e18b8382427565dab85586f46c4937", "score": "0.5918628", "text": "def new\n @threej = Threej.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @threej }\n end\n end", "title": "" }, { "docid": "8c024f7f9ea869871ead44d3ea9bbd5a", "score": "0.5916228", "text": "def new\n @division = Division.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @division }\n end\n end", "title": "" }, { "docid": "f99a90842fe02d0c93f14c4746b40ffc", "score": "0.59156746", "text": "def new\r\n @jet = Jet.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @jet }\r\n end\r\n end", "title": "" }, { "docid": "873238a6dbafc5be9f0e075dfd4ff800", "score": "0.5911736", "text": "def new\n @model = Model.find(params[:model_id])\n @composite = Composite.new\n @composite.model = @model\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @composite }\n end\n end", "title": "" }, { "docid": "18dbb3beb47e811572c6dd9a0b33b41e", "score": "0.5911373", "text": "def new\n @subdivision = Subdivision.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subdivision }\n end\n end", "title": "" }, { "docid": "15fe0e17cf45b8cb384ea78ad2975fd5", "score": "0.5909558", "text": "def new\n @uploadgame = Uploadgame.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @uploadgame }\n end\n end", "title": "" }, { "docid": "eaf7c079c97688813129e7d4a515be0c", "score": "0.5906884", "text": "def new\n @materials_collection = MaterialsCollection.new\n respond_to do |format|\n format.html # new.html.haml\n format.json { render json: @materials_collection }\n end\n end", "title": "" }, { "docid": "9dab028e19ad100b715d5c321b11504a", "score": "0.5906791", "text": "def new\n @earth = Earth.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @earth }\n end\n end", "title": "" }, { "docid": "03a2b2716e891286f0c4cb5bd9147c2a", "score": "0.59029984", "text": "def new\n @club_image = ClubImage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @club_image }\n end\n end", "title": "" }, { "docid": "0592b528f31f9c6f0f68b7688f25e592", "score": "0.59024227", "text": "def new\n @clubber = Clubber.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clubber }\n end\n end", "title": "" }, { "docid": "3d7365390250d16899a6653044ca2e6c", "score": "0.5901986", "text": "def new\n @puzzle = Puzzle.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @puzzle }\n end\n end", "title": "" }, { "docid": "3d7365390250d16899a6653044ca2e6c", "score": "0.5901986", "text": "def new\n @puzzle = Puzzle.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @puzzle }\n end\n end", "title": "" }, { "docid": "fcdc143582ce45e5a74cc405c443fd93", "score": "0.5892564", "text": "def new\n @labour = Labour.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @labour }\n end\n end", "title": "" }, { "docid": "5dde1baca8234e5dc1a42f98e7477cb3", "score": "0.58854717", "text": "def new\n @f5_cluster = F5Cluster.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @f5_cluster }\n end\n end", "title": "" }, { "docid": "f15a876cd963252de0fa53be7134f863", "score": "0.5879053", "text": "def new\n @crush = Crush.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @crush }\n end\n end", "title": "" }, { "docid": "96d5acd86950d64a32e645f9322379cb", "score": "0.5875488", "text": "def new\n @blab = Blab.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @blab }\n end\n end", "title": "" }, { "docid": "bcca282fd1c372e4580efde673e8b858", "score": "0.58747095", "text": "def new\n @computation = Computation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @computation }\n end\n end", "title": "" }, { "docid": "8647ee4413a69f52ea148b2d4fe6051c", "score": "0.58735234", "text": "def new\n @clone = Clone.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clone }\n end\n end", "title": "" }, { "docid": "37b554e78634e7dc16941e9634c5362a", "score": "0.5871638", "text": "def new\n @blit = Blit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @blit }\n end\n end", "title": "" }, { "docid": "628d154cb2c0203b112c2fdaecd946ab", "score": "0.58681834", "text": "def new\n @game = Game.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @game }\n end\n end", "title": "" }, { "docid": "628d154cb2c0203b112c2fdaecd946ab", "score": "0.58681834", "text": "def new\n @game = Game.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @game }\n end\n end", "title": "" }, { "docid": "628d154cb2c0203b112c2fdaecd946ab", "score": "0.58681834", "text": "def new\n @game = Game.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @game }\n end\n end", "title": "" }, { "docid": "628d154cb2c0203b112c2fdaecd946ab", "score": "0.58681834", "text": "def new\n @game = Game.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @game }\n end\n end", "title": "" }, { "docid": "628d154cb2c0203b112c2fdaecd946ab", "score": "0.58681834", "text": "def new\n @game = Game.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @game }\n end\n end", "title": "" }, { "docid": "628d154cb2c0203b112c2fdaecd946ab", "score": "0.58681834", "text": "def new\n @game = Game.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @game }\n end\n end", "title": "" }, { "docid": "628d154cb2c0203b112c2fdaecd946ab", "score": "0.58681834", "text": "def new\n @game = Game.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @game }\n end\n end", "title": "" } ]
6e26582c9400672f79d482ae25df2343
GET /higher_education_institutions GET /higher_education_institutions.json
[ { "docid": "20cbbf55675bb91b544e4f24626bf76b", "score": "0.7149614", "text": "def index\n authorize HigherEducationInstitution\n @higher_education_institutions = HigherEducationInstitution.order(:name).search(params[:search]).page(params[:page])\n end", "title": "" } ]
[ { "docid": "2967b0eb6ed7eca2c523512e1df4eb03", "score": "0.6843123", "text": "def get_institutions\r\n # Prepare query url.\r\n _path_url = '/institutions'\r\n _query_builder = Configuration.get_base_uri\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\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)\r\n decoded.map { |element| Institution.from_hash(element) }\r\n end", "title": "" }, { "docid": "23307c1cfeeb3492560001ae1e34aced", "score": "0.65354705", "text": "def institutions(pageIndex=0, options={})\n options.merge!({:query => {:pageIndex => pageIndex}})\n self.class.get(\"/Institutions.json\", options)\n end", "title": "" }, { "docid": "eba7d2fa63cd0100aed6da69e9e2088b", "score": "0.6318119", "text": "def index\n @educations = Education.all\n render json: @educations\n end", "title": "" }, { "docid": "c9dcac7a4175e111469f980537af97f4", "score": "0.6256282", "text": "def index\n @one_reg_institutions = OneRegInstitution.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @one_reg_institutions }\n end\n end", "title": "" }, { "docid": "402125e0c02043c0b17001c87b5044ff", "score": "0.62074935", "text": "def index\n @employer_studies = @university.employer_studies.page(params[:page])\n @studies = @employer_studies\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employer_studies }\n end\n end", "title": "" }, { "docid": "567a100fd9b8bf687d8ba70e69d01b3c", "score": "0.6185518", "text": "def institution(institution, options={})\n self.class.get(\"/Institution/#{institution}.json\", options)\n end", "title": "" }, { "docid": "387106d3cc065065f9d5fdfd482e20f7", "score": "0.6174362", "text": "def show\n @institute_admin = InstituteAdmin.includes(:profile).find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @institute_admin }\n end\n end", "title": "" }, { "docid": "227e2acc5b471c997bf88e32f2313515", "score": "0.61639804", "text": "def show\n @institution = Institution.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @institution }\n end\n end", "title": "" }, { "docid": "227e2acc5b471c997bf88e32f2313515", "score": "0.61639804", "text": "def show\n @institution = Institution.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @institution }\n end\n end", "title": "" }, { "docid": "0336d76b2d015a934f3cc9e595a1297d", "score": "0.61545956", "text": "def index\n @education_levels = EducationLevel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @education_levels }\n end\n end", "title": "" }, { "docid": "1b3c4770a07d6ac6835e5f60a24b6388", "score": "0.61310637", "text": "def show\n @education_level = EducationLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @education_level }\n end\n end", "title": "" }, { "docid": "e93acc2ea3437dc146a8e103068c5729", "score": "0.6129439", "text": "def show\n @inschool = Inschool.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @inschool }\n end\n end", "title": "" }, { "docid": "967c1e05b3d0af3437c301331c176827", "score": "0.6115881", "text": "def index\n @undergraduate_majors = UndergraduateMajor.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @undergraduate_majors }\n end\n end", "title": "" }, { "docid": "b45389a061ca5e64e8d1042195ec2a2c", "score": "0.60983914", "text": "def new\n @institution = Institution.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @institution }\n end\n end", "title": "" }, { "docid": "f61cc93c970cd988102be2cc56d34fbd", "score": "0.60973513", "text": "def index\n @educational_institutions = EducationalInstitution.all\n end", "title": "" }, { "docid": "e5623d6de330ebbbadf2dad7082975b4", "score": "0.6085545", "text": "def index\n @expertises = Expertise.all\n\n render json: @expertises\n end", "title": "" }, { "docid": "6e7628e0cf9ab390808b82db53697b0d", "score": "0.6043627", "text": "def index\n @universities = University.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @universities }\n end\n end", "title": "" }, { "docid": "4cf27a14c85a45c5f5e676d18b23c922", "score": "0.6038814", "text": "def show\n @university = University.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @university }\n end\n end", "title": "" }, { "docid": "4cf27a14c85a45c5f5e676d18b23c922", "score": "0.6038814", "text": "def show\n @university = University.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @university }\n end\n end", "title": "" }, { "docid": "b491a918fc7bd9aa7052c6d130ba4659", "score": "0.60105777", "text": "def new\n @inschool = Inschool.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @inschool }\n end\n end", "title": "" }, { "docid": "fd71ac4cea4e79920cfddda087510471", "score": "0.59886426", "text": "def show\n @university_profile = UniversityProfile.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @university_profile }\n end\n end", "title": "" }, { "docid": "775bfd49f551148ed6f5068d0fb9bdcf", "score": "0.59764224", "text": "def index\n @institute_admins = case current_user.rc\n when 'EA'\n InstituteAdmin.includes(:profile).page(params[:page])\n when 'IA'\n InstituteAdmin.includes(:profile).where(:id=>current_user.institute_admin).page(params[:page])\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @institute_admins }\n end\n end", "title": "" }, { "docid": "6f6586c72a01f834f375d6b72633de45", "score": "0.5954551", "text": "def show\n render json: serializer_class.new(ecf_school, params: { cohort: }).serializable_hash.to_json\n end", "title": "" }, { "docid": "e77a1c98e19fd351eb792c671504de9d", "score": "0.5946095", "text": "def set_higher_education_institution\n @higher_education_institution = HigherEducationInstitution.find(params[:id])\n end", "title": "" }, { "docid": "6eba6c4bc4a7390e15b29a893af9cdc6", "score": "0.59416777", "text": "def uni_years\n @uni_years = UniYear.where(university_id: params[:university_id])\n \n respond_to do |format|\n format.json { render json: @uni_years }\n end\n end", "title": "" }, { "docid": "9f8429376e92b785ba96f3939a19bfc4", "score": "0.59187645", "text": "def show\n @institution_ad = InstitutionAd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @institution_ad }\n end\n end", "title": "" }, { "docid": "379c2bff895e96bc61d2459ed68471d1", "score": "0.5916051", "text": "def show\n @institution = Institution.find(params[:id])\n\n render json: @institution\n\n rescue ActiveRecord::RecordNotFound\n render json: {message: 'Resource not found'}, status: 404\n\n end", "title": "" }, { "docid": "d803da937a0b30bd1842647a70a83bbe", "score": "0.5907924", "text": "def index\n @institutions = current_user.institutions\n end", "title": "" }, { "docid": "953aa973b7a619d4a27862a7bab05a7a", "score": "0.5893874", "text": "def show\n @undergraduate_major = UndergraduateMajor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @undergraduate_major }\n end\n end", "title": "" }, { "docid": "9dd0ec504035c8d1713d4dc48ca87f21", "score": "0.588916", "text": "def overview_json\n safe_params = params.permit(:force_querying_on_demand)\n force_querying_on_demand = safe_params.has_key?(:force_querying_on_demand)\n query = SchoolOverviewQueries.new(force_querying_on_demand: force_querying_on_demand)\n overview_json = query.json_for_overview(current_educator, @school)\n\n render json: overview_json\n end", "title": "" }, { "docid": "9502b0882715ea874b7af565fcd09fd9", "score": "0.5882398", "text": "def new\n @institution_ad = InstitutionAd.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @institution_ad }\n end\n end", "title": "" }, { "docid": "df5d039a552ac5dcd574afd4c5d72b24", "score": "0.5881353", "text": "def index\n @issuing_institutions = IssuingInstitution.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @issuing_institutions }\n end\n end", "title": "" }, { "docid": "6c3bff3ce183f394d7893752791310ea", "score": "0.5873456", "text": "def show\n @university = UniversityDecorator.decorate @employer_study.university\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employer_study }\n end\n end", "title": "" }, { "docid": "76f2f3456786acb4fa66dbaec6ca1c4b", "score": "0.5835835", "text": "def show\n @solutions = @profile.solutions.paginate(page: params[:page], per_page: 10 ).order('created_at DESC')\n respond_with @profile\n end", "title": "" }, { "docid": "b0f07ca3a387c41f59cd1315be810e0d", "score": "0.58269477", "text": "def show\n @one_reg_institution = OneRegInstitution.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @one_reg_institution }\n end\n end", "title": "" }, { "docid": "c84b7ef3112172517c183d6e7f81b214", "score": "0.5815527", "text": "def new\n @student = Student.find(params[:student_id])\n @inschool = @student.inschools.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @inschool }\n end\n end", "title": "" }, { "docid": "15872a05f7e25fadf6b8f04810dc5f02", "score": "0.5790846", "text": "def index\n @other_studies = @university.other_studies.page(params[:page])\n @studies = @other_studies\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @other_studies }\n end\n end", "title": "" }, { "docid": "461fa1901603d48c7d842aef501acaac", "score": "0.57734823", "text": "def new\n @university = University.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @university }\n end\n end", "title": "" }, { "docid": "461fa1901603d48c7d842aef501acaac", "score": "0.57734823", "text": "def new\n @university = University.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @university }\n end\n end", "title": "" }, { "docid": "7c3b23bae92f8eb3933506783a7a114e", "score": "0.57456976", "text": "def new\n @institucional = Institucional.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @institucional }\n end\n end", "title": "" }, { "docid": "f639bd40026f7c0f88d9ff2ce977b13c", "score": "0.5734615", "text": "def show\n @institutions = @tesda_course.institutions\n end", "title": "" }, { "docid": "a791b6fb10fce8877390e58257720251", "score": "0.5728916", "text": "def show\n render json: @laboratory\n end", "title": "" }, { "docid": "bab1bd5a1796f04841696cf3d88dc905", "score": "0.5722694", "text": "def show\n @admin_interview = Interview.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_interview }\n end\n end", "title": "" }, { "docid": "965c5f01dc277b4a8c9dc539f31ff9df", "score": "0.571788", "text": "def index\n @general_frames = @university.general_frames.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @general_frames }\n end\n end", "title": "" }, { "docid": "0c4d68ef8aa983c741662d8f77122222", "score": "0.5700992", "text": "def show\n @medium_research_allotment = MediumResearchAllotment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @medium_research_allotment }\n end\n end", "title": "" }, { "docid": "1eead861759c8e878bdcd2dc85646706", "score": "0.5673634", "text": "def show\n render json: @expertise\n end", "title": "" }, { "docid": "b609ed3f42dd827824350f788dccb695", "score": "0.56715", "text": "def show\n authorize HigherEducationInstitution\n end", "title": "" }, { "docid": "4b542034d739a3e0c1fa36d97cf5b287", "score": "0.5669963", "text": "def show\n @institucional = Institucional.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @institucional }\n end\n end", "title": "" }, { "docid": "52f706bf825a2325e99fd776a7a9ef8b", "score": "0.566534", "text": "def new\n @education_level = EducationLevel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @education_level }\n end\n end", "title": "" }, { "docid": "3bda7a4593b20511d4cb5238de519221", "score": "0.56633335", "text": "def show\n @interest = Interest.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @interest }\n end\n end", "title": "" }, { "docid": "db5130b77af6cc9444748ae8bed1abd2", "score": "0.56514424", "text": "def show\n @hospitalization = Hospitalization.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @hospitalization }\n end\n end", "title": "" }, { "docid": "5a2fc0b8672d868fd67f4d80c29d239a", "score": "0.5650055", "text": "def show\n @person_interest = PersonInterest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person_interest }\n end\n end", "title": "" }, { "docid": "427a0e4f49687f66354d96f4620ab242", "score": "0.56425", "text": "def new\n @holding_institution = HoldingInstitution.new\n \n\n respond_to do |format|\n format.html {render layout: false} # new.html.erb\n format.json { render json: @holding_institution }\n end\n end", "title": "" }, { "docid": "507b561e1cb306db1c9e94eb4df5097d", "score": "0.5635512", "text": "def show\n @laboratory = Laboratory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @laboratory }\n end\n end", "title": "" }, { "docid": "e007300b85b52ab90ee639281786c7d2", "score": "0.56330097", "text": "def index\n render json: serializer_class.new(paginate(ecf_schools), params: { cohort: }).serializable_hash.to_json\n end", "title": "" }, { "docid": "536873467717fc6bf310a76f16b665d6", "score": "0.5627429", "text": "def index\n @recent = Highfive.recent.approved\n @leaders = User.leaders\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @highfives }\n end\n end", "title": "" }, { "docid": "964fc69fe23c07815ff1b3c14794c6cd", "score": "0.5618287", "text": "def new\n @institute_admin = InstituteAdmin.new\n @institute_admin.build_profile\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @institute_admin }\n end\n end", "title": "" }, { "docid": "70135aa901962acfd59b8691e64fc66a", "score": "0.56164724", "text": "def higher_education_institution_params\n params.require(:higher_education_institution).permit(:code, :name, :acronym, :university_id)\n end", "title": "" }, { "docid": "664f2486e613b707a8b438b20b0e3d38", "score": "0.56148607", "text": "def show\n institution = Institution.find(params[:id])\n render json: { status: '200', message: \"Loaded Institution with id #{params[:id]}\", data: institution }, status: :ok\n rescue ActiveRecord::RecordNotFound\n render json: { status: '404', error: \"No Institution with id #{params[:id]}\", data: institution }, status: :not_found\n end", "title": "" }, { "docid": "b354e179ba97332ffdc8d7c4d35be81e", "score": "0.5607695", "text": "def show\n @interview = Interview.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @interview }\n end\n end", "title": "" }, { "docid": "dd3b5d8b2d1a125a343ef616c39fe851", "score": "0.5605264", "text": "def index\n @infrastructures = getmydata(\"Infrastructure\")\n pagination\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @infrastructures }\n end\n end", "title": "" }, { "docid": "49ad1b463f60bf2126880165717d9b52", "score": "0.5594916", "text": "def institution\n ::HubEdos::StudentApi::V2::StudentRecord::Institution.new(@data['institution']) if @data['institution']\n end", "title": "" }, { "docid": "eb832de36c4f8af947b19a0cb3bd49ec", "score": "0.5583345", "text": "def show\n @university = UniversityDecorator.decorate @other_study.university\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @other_study }\n end\n end", "title": "" }, { "docid": "927ac206ca0f5937a379f082dd75048f", "score": "0.5583102", "text": "def show\n @college = College.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @college }\n end\n end", "title": "" }, { "docid": "d79df5cc9cedc354609007e751b95a4c", "score": "0.5576151", "text": "def show\n @institution = Institution.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @institution }\n format.json {render :json => {\"success\"=>true,\"data\"=>@institution} }\n \n end\n end", "title": "" }, { "docid": "c180d5afa426adc76b9be05cd3d4c946", "score": "0.5561289", "text": "def create\n authorize HigherEducationInstitution\n @higher_education_institution = HigherEducationInstitution.new(higher_education_institution_params)\n\n respond_to do |format|\n if @higher_education_institution.save\n format.html { redirect_to @higher_education_institution, notice: 'Visokošolski zavod uspešno dodan.' }\n format.json { render :show, status: :created, location: @higher_education_institution }\n else\n format.html { render :new }\n format.json { render json: @higher_education_institution.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "671004a546084dff435f3f762eafd570", "score": "0.555902", "text": "def test_get_skills_route\n render :json => get_profile_skills_for_profile(\"https://www.linkedin.com/in/marissamayer\").to_json\n end", "title": "" }, { "docid": "bbb7d0896d349eb8424fdc344357b3e7", "score": "0.5554586", "text": "def new\n @person_interest = PersonInterest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person_interest }\n end\n end", "title": "" }, { "docid": "5a04dc9341820731aa6de04fdc45ea5c", "score": "0.55536133", "text": "def new\n @financial_institution = FinancialInstitution.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @financial_institution }\n end\n end", "title": "" }, { "docid": "44949df1c33e66ddb379bfae6e6cb8ce", "score": "0.5549872", "text": "def show\n @research = Research.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @research }\n end\n end", "title": "" }, { "docid": "af82a978464c8d11b11928cdef06f40d", "score": "0.5547593", "text": "def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @life_insurance }\n end\n end", "title": "" }, { "docid": "abac24e3c03af970251788107d9310ac", "score": "0.5539019", "text": "def index\n @laboratories = Laboratory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @laboratories }\n end\n end", "title": "" }, { "docid": "044f84dcd52b9cff765e76e8fabfe067", "score": "0.5536988", "text": "def new\n @admin_interview = Interview.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_interview }\n end\n end", "title": "" }, { "docid": "4bfe8a843f323980fad02e587514730b", "score": "0.5536975", "text": "def show\n @interest = Interest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @interest }\n end\n end", "title": "" }, { "docid": "ea50ad8911d9ca4113506ded566c3c41", "score": "0.5536342", "text": "def show\n @exhibition = Exhibition.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exhibition }\n end\n end", "title": "" }, { "docid": "ad71389d6b1a9f3fc4624a03b5c58549", "score": "0.55305225", "text": "def show\n @early_pregnancy = EarlyPregnancy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @early_pregnancy }\n end\n end", "title": "" }, { "docid": "a45173e3a2db8f7d1cc7054bfc3d0178", "score": "0.55294794", "text": "def new\n @hospitalization = Hospitalization.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @hospitalization }\n end\n end", "title": "" }, { "docid": "f4610260ce59399be29821ae74c1e5b8", "score": "0.5526873", "text": "def educations\r\n @education_levels = Education.find(:all)\r\n end", "title": "" }, { "docid": "2bc27759945a2a8fb9db4c6a2a6ac55a", "score": "0.5525785", "text": "def show\n render json: @educations\n end", "title": "" }, { "docid": "7e0dd8f5525760e020a014651ae365b9", "score": "0.5523153", "text": "def show\n raise Exceptions::EducatorNotAuthorized unless current_educator.districtwide_access\n educator = Educator.find(params[:id])\n render json: educator.as_json({\n :only => [\n :id,\n :email,\n :full_name,\n :staff_type,\n :restricted_to_sped_students,\n :restricted_to_english_language_learners,\n :can_view_restricted_notes,\n :schoolwide_access,\n :districtwide_access,\n :grade_level_access,\n :admin\n ],\n :methods => [:labels],\n :include => {\n :school => { :only => [:id, :name] },\n :sections => {\n :only => [:id, :section_number],\n :methods => [:course_description]\n },\n :homeroom => { :only => [:id, :name] }\n }\n })\n end", "title": "" }, { "docid": "a1c84b356f08da46562d56417c8ab16e", "score": "0.5521702", "text": "def show\n @interest = Interest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @interest }\n end\n end", "title": "" }, { "docid": "0cb12dd9c03619a96044e3d3a1886571", "score": "0.5520696", "text": "def show\n @financial_institution = FinancialInstitution.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @financial_institution }\n end\n end", "title": "" }, { "docid": "cc9e82559bebc955c5af8abd56761c87", "score": "0.55037904", "text": "def events\n url = 'https://api.artic.edu/api/v1/exhibitions?limit=35'\n\n res = RestClient.get(url)\n JSON.parse(res)\nend", "title": "" }, { "docid": "7c2d1379fb496bde4fddb484bb9e1ae1", "score": "0.5494631", "text": "def show\n @socioeconomic_study = SocioeconomicStudy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n\n\n format.json { render json: @socioeconomic_study }\n end\n end", "title": "" }, { "docid": "c6d170f091eb158f096c05bd9e3e8c02", "score": "0.5490525", "text": "def new\n @undergraduate_major = UndergraduateMajor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @undergraduate_major }\n end\n end", "title": "" }, { "docid": "41348066b4d1d3881f4c9986854c8bc2", "score": "0.5484537", "text": "def index\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @life_insurances }\n end\n end", "title": "" }, { "docid": "7d8a1b2ee7ff8ede7bbb5850a67b9022", "score": "0.5476321", "text": "def index\n @medical_practitioners_profiles = MedicalPractitionersProfile.all\n render json: @medical_practitioners_profiles\n end", "title": "" }, { "docid": "6a522772a4fc415cd93d67670848f2cc", "score": "0.54744625", "text": "def show\n respond_to do |format|\n format.html\n format.json { render json: @person_equipment }\n end\n end", "title": "" }, { "docid": "5047b1e504ea21a60802218f2eb7ea8a", "score": "0.5471064", "text": "def index\n @education_levels = EducationLevel.all\n end", "title": "" }, { "docid": "b05184576f36a846b09061fba069f04e", "score": "0.54689753", "text": "def index\n @resumes = Resume.all\n render json: @resumes, include: %i[headers educations work_experiences skills]\n end", "title": "" }, { "docid": "9b8d5853b9c2e090dab5983e255b588a", "score": "0.5467815", "text": "def show\n @educational_level = EducationalLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @educational_level }\n end\n end", "title": "" }, { "docid": "06fa86df2e18bc92bfcbc8c5b47c1d74", "score": "0.5463716", "text": "def show\n\t\trecords = University.where(['name LIKE ?', \"#{params[:name]}%\"])\n\t\tschools = Array.new\n\n\t\trecords.each do |record|\n\t\t\tcents_rating = RatesSchool.find_by_sql [\n\t\t\t\t'SELECT avg(rating) AS average\n\t\t\t\tFROM rates_schools\n\t\t\t\tWHERE university_id = ?',\n\t\t\t\trecord.id\n\t\t\t]\n\t\t\trecord = record.as_json\n\t\t\trecord[:average_rating] = cents_rating[0][:average].to_f\n\t\t\tschools << record.except('id', 'created_at', 'updated_at')\n\t\tend\n\n\t\tif schools.present?\n\t\t\treturn render json: schools, status: 200\n\t\telse\n\t\t\treturn render json: [], status: 404\n\t\tend\n\tend", "title": "" }, { "docid": "e13a867ce0f65a4950edd3e316095a0e", "score": "0.546281", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @interest }\n end\n end", "title": "" }, { "docid": "f93b34d9549be268b09061e6784f1fd2", "score": "0.5458764", "text": "def new\n @laboratory = Laboratory.new\n @municipalities = Municipality.all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @laboratory }\n end\n end", "title": "" }, { "docid": "46bd58886258c63e6e0c91db50ac1c35", "score": "0.54577404", "text": "def show\n @jurisdiction = Jurisdiction.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @jurisdiction }\n end\n end", "title": "" }, { "docid": "f4c39b7d33c3363372ac4d4760e30250", "score": "0.545731", "text": "def index\n @assessment_olympiads = AssessmentOlympiad.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json:@assessment_olympiads }\n end\n end", "title": "" }, { "docid": "f576ca9b988b115e6992d84d0fa109b5", "score": "0.54566175", "text": "def new\n @university_profile = UniversityProfile.new\n @university_profile.university_courses || @user.build_university_courses\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @university_profile }\n end\n end", "title": "" }, { "docid": "24c4b72ae809167a23cc47cddd400a71", "score": "0.5454392", "text": "def students_with_low_grades_json\n safe_params = params.permit(:educator_id, :time_now, :limit)\n educator = current_educator_or_doppleganger(safe_params[:educator_id])\n time_now = time_now_or_param(safe_params[:time_now])\n limit = safe_params[:limit].to_i\n time_threshold = time_now - 45.days\n grade_threshold = 69\n\n insight = InsightStudentsWithLowGrades.new(educator)\n students_with_low_grades_json = insight.students_with_low_grades_json(time_now, time_threshold, grade_threshold)\n render json: {\n limit: limit,\n total_count: students_with_low_grades_json.size,\n students_with_low_grades: students_with_low_grades_json.first(limit)\n }\n end", "title": "" }, { "docid": "3706f8fd8dabb73d351e21be902be459", "score": "0.54524297", "text": "def new\n @exhibition = Exhibition.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @exhibition }\n end\n end", "title": "" }, { "docid": "3759b1a695bec94f28815927bf1b71cd", "score": "0.5450049", "text": "def show\n @assessment_olympiad = AssessmentOlympiad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json:@assessment_olympiad }\n end\n end", "title": "" } ]
c3d4de1b4984acee72914c89b12026be
finds a channel input: aUser_input (String) Returns a found channel (Channel Object)
[ { "docid": "1778cd32d8324cab3e19c380202535d2", "score": "0.8656159", "text": "def find_channel(aUser_input)\n found_channel = nil\n self.channels.each do |channel|\n if (aUser_input == channel.id) || (aUser_input == channel.name)\n return channel\n end\n end\n return found_channel\n end", "title": "" } ]
[ { "docid": "d5a2c08876b3a06e75771f18b4488c98", "score": "0.763307", "text": "def select_channel(user_input)\n @channels.each do |channel|\n if channel.id == user_input\n @selected = channel\n elsif channel.name == user_input\n @selected = channel\n end\n end\n return @selected\n end", "title": "" }, { "docid": "d43f37d6873e6a1e5085a31d6135173a", "score": "0.6447916", "text": "def find(channel_name)\n @channels.find { |c| c.name.downcase == channel_name.downcase }\n end", "title": "" }, { "docid": "9d1914804f3f06c1b0cebefa80822db7", "score": "0.6426849", "text": "def channel\n return @channel if @channel\n if regular_command? and params.first.start_with?(\"#\")\n @channel = params.first\n end\n end", "title": "" }, { "docid": "e8e006e39c241503ccc50baa37b7cd76", "score": "0.63103575", "text": "def get_input(channel)\n send_command([8, channel, 0], true)\n end", "title": "" }, { "docid": "14f1d1eb6ef3a46cf172a258135ebec2", "score": "0.6270482", "text": "def matches_channel?(search_term)\n channel.downcase == search_term\n end", "title": "" }, { "docid": "8dcccfbad4518eeb62f286933f216168", "score": "0.6109598", "text": "def select_channel(search)\n\t\t\[email protected] do |channel|\n\t\t\t\tif channel.slack_id.upcase == search.upcase\n\t\t\t\t\t@selected = channel\n\t\t\t\telsif channel.name.upcase == search.upcase\n\t\t\t\t\t@selected = channel\n\t\t\t\telse\n\t\t\t\t\t@selected == nil\n\t\t\t\tend\n\t\t\tend\n\t\t\t\n\t\t\tputs \"No such channel found based on search.\" if @selected == nil\n\t\tend", "title": "" }, { "docid": "049d81efa50ec51615b38f916f5b54e6", "score": "0.6094839", "text": "def find_input(input_name)\n consumables.find { |c| c.input_name == input_name }\n end", "title": "" }, { "docid": "03fcd197dfe5a9a3be285c7ed84b6b40", "score": "0.60120195", "text": "def get_channel inout, channels\n ret = nil\n channels.each do |channel|\n if channel.from == inout || channel.to == inout\n ret = channel\n break\n end\n end\n ret\n end", "title": "" }, { "docid": "03fcd197dfe5a9a3be285c7ed84b6b40", "score": "0.60120195", "text": "def get_channel inout, channels\n ret = nil\n channels.each do |channel|\n if channel.from == inout || channel.to == inout\n ret = channel\n break\n end\n end\n ret\n end", "title": "" }, { "docid": "03fcd197dfe5a9a3be285c7ed84b6b40", "score": "0.60120195", "text": "def get_channel inout, channels\n ret = nil\n channels.each do |channel|\n if channel.from == inout || channel.to == inout\n ret = channel\n break\n end\n end\n ret\n end", "title": "" }, { "docid": "03fcd197dfe5a9a3be285c7ed84b6b40", "score": "0.60120195", "text": "def get_channel inout, channels\n ret = nil\n channels.each do |channel|\n if channel.from == inout || channel.to == inout\n ret = channel\n break\n end\n end\n ret\n end", "title": "" }, { "docid": "eb6bba377c1e97385e5e2abb436401fc", "score": "0.59687424", "text": "def find_user(aUser_input)\n found_user = nil\n self.users.each do |user|\n if (aUser_input == user.id) || (aUser_input == user.name)\n return user\n end\n end\n return found_user\n end", "title": "" }, { "docid": "ba863716b7b4485d7c1b45058b4a5304", "score": "0.5954508", "text": "def lookup_channel(channel)\n return network.lookup_or_create_channel(channel)\n end", "title": "" }, { "docid": "c1efcd0bc6a0128b6afa6c8688a30be5", "score": "0.5933578", "text": "def get_channel(channel)\n channel = channel.to_s if channel.kind_of?(Symbol)\n raise \"Channel not found: #{channel} (expected one of #{self.keys.inspect})\" unless self.keys.include?(channel)\n self[channel]\n end", "title": "" }, { "docid": "d4fbd4978da0c276ce3a4aebb0416996", "score": "0.589953", "text": "def find_by_name( name )\n Network.channels.find do |c|\n c.name == name\n end\n end", "title": "" }, { "docid": "c17b73e1bc426e9c022a6213fde68854", "score": "0.58734673", "text": "def channel_by_name name\n @channels.find { |channel| channel.name == name }\n end", "title": "" }, { "docid": "c17b73e1bc426e9c022a6213fde68854", "score": "0.58734673", "text": "def channel_by_name name\n @channels.find { |channel| channel.name == name }\n end", "title": "" }, { "docid": "2ce65e5e08418be28d3b5b333239b70c", "score": "0.58638585", "text": "def channel\n /(?<ch>\\d)/.match(@fields[0])[:ch].to_i\n end", "title": "" }, { "docid": "95c48a67b5e43bdf2c66427c3030204a", "score": "0.5861297", "text": "def select_channel(param)\n raise ArgumentError, \"Channel name or id must be a string\" unless param.is_a?(String)\n\n @selected = @channels.find { |channel| channel.id == param || channel.name == param }\n raise ArgumentError, \"Channel not found\" if @selected == nil\n end", "title": "" }, { "docid": "fe46a3ae094a10ef1daea920b8bd61ca", "score": "0.5849995", "text": "def find_channel(cid)\n return self.channels[cid]\n end", "title": "" }, { "docid": "ab59181a6be5a75cd35d873a2f1a8ce3", "score": "0.5824254", "text": "def find_channel_by_name(name)\n response = get(\"/api/v1/channels/find_by_name/#{name}\")\n Channel.new(self, response) if response\n end", "title": "" }, { "docid": "693d2c0e2d9e6877933f2e8ecb9bc620", "score": "0.5806571", "text": "def channel\n @query.channels.get(@name)\n end", "title": "" }, { "docid": "281de795d67be59cafe5acb20e31efe9", "score": "0.57967067", "text": "def selector(user_input)\n case user_input\n when \"List of users\"\n # tp = To print the intances in a table.\n puts \"\\n\"\n tp @workspace.users, :name, :real_name, :id\n puts \"\\n\"\n when \"List of channels\"\n puts \"\\n\"\n tp @workspace.channels, :name, :topic, :member_count, :id\n puts \"\\n\"\n when \"Select Channel\"\n print \"Please enter the channel name or ID: \"\n user_selection = @workspace.select_channel\n if user_selection == nil \n puts \"Invalid entry - the channel does not exist.\".red\n else\n puts \"#{user_selection} Has been chose\".blue\n end\n puts \"\\n\"\n when \"Select User\"\n print \"Please enter the channel name or ID: \"\n user_selection = @workspace.select_user\n if user_selection == nil \n puts \"Invalid entry - the user does not exist.\".red\n else\n puts \"#{user_selection} Has been chose\".blue\n end\n puts \"\\n\"\n when \"Details\"\n \n if @workspace.selected == nil\n puts \"\\n\"\n puts \"Invalid entry - You selected an invalid channel or User.\"\n else\n puts \"\\n\"\n @workspace.show_details\n user_input = nil\n end\n \n when \"Send message\"\n if @workspace.selected == nil\n puts \"\\n\"\n puts \"Invalid entry\"\n else\n puts \"\\n\"\n @workspace.selected.send_message(@workspace.selected.name)\n puts \"Your message has been sent\".blue\n user_input = nil\n end\n when \"Exit\"\n puts \"Bye!! Thank you for using Ada slack CLI\".yellow\n exit\n end\nend", "title": "" }, { "docid": "fd1fe3aa3c64863e8489e7b96a86e883", "score": "0.57950807", "text": "def search_for_character(channel, person)\r\n if @rooms[channel]['characters'].include? person\r\n return person\r\n else\r\n re = /\\A#{Regexp.escape(person)}\\z/i\r\n @rooms[channel]['characters'].each { |char|\r\n if char =~ re\r\n return char\r\n end\r\n }\r\n end\r\n return nil\r\n end", "title": "" }, { "docid": "19965f3c34cb857739d201eefea2636f", "score": "0.57821685", "text": "def receive_channel\n @input.channel\n end", "title": "" }, { "docid": "e73f565044f2ec39955ee1b9a612998c", "score": "0.57632226", "text": "def search_for_character(channel, person)\n if @rooms[channel]['characters'].include? person\n return person\n else\n re = /\\A#{Regexp.escape(person)}\\z/i\n @rooms[channel]['characters'].each { |char|\n if char =~ re\n return char\n end\n }\n end\n return nil\n end", "title": "" }, { "docid": "4fcb9ad390e0e0630baa9c3809758ff4", "score": "0.5762201", "text": "def channel(name)\n obj = channels.select do |_k, hsh|\n hsh[\"name\"].to_s.casecmp(name.to_s).zero?\n end\n\n obj&.keys&.first\n end", "title": "" }, { "docid": "42923d9a147dae6a560caf2428127de4", "score": "0.57580334", "text": "def get_user_input\n puts \"Choose an action from the following list:\n 1. View Users => Enter: users\n 2. View Channels => Enter: channels \n 3. Quit => Type: quit \"\n return gets.chomp.upcase\nend", "title": "" }, { "docid": "f959b7b1522b1e62d715076324b02e07", "score": "0.57464856", "text": "def retrieve_channel\n if params[:channel_id].blank?\n @channel = Channel.first\n else\n @channel = Channel.find_by(name: params[:channel_id])\n end\n end", "title": "" }, { "docid": "b9fd3f1d256a57944c3fa075a6579d83", "score": "0.57188416", "text": "def get_player_by_user(input_user)\n #current_name=self.playing_user_names.select{|name| self.user_hash[name] == input_user}.first\n current_name=input_user.nick #this uses user.nick, but other places use this too\n return self.player_hash[current_name] #could return nil if user doesn't exist\n end", "title": "" }, { "docid": "937839549541df48427d36b337998a22", "score": "0.56760854", "text": "def lookup_channel(name)\r\n channel = @chandb[@server_key, name]\r\n if channel.nil?\r\n channel = Channel.new(@server_key, name)\r\n @chandb.add(channel)\r\n end\r\n return channel\r\n end", "title": "" }, { "docid": "9277111c1c1c43be67e3cb3219bae745", "score": "0.5645036", "text": "def find(channel_user, what)\n Alice::Util::Mediator.reply_to(channel_user, Alice::Handlers::ItemFinder.process(channel_user, what).content)\n end", "title": "" }, { "docid": "b76ec865ab5b6fda017b0f5a59d884b7", "score": "0.56414896", "text": "def input(name = nil)\n # Ensure name is a symbol.\n name = HDLRuby.uniq_name unless name\n name = name.to_sym\n # Ensure the port is not already existing.\n if @read_port then\n raise \"Read port already declared for channel instance: \" +\n self.name\n end\n\n # Create a read port for the encaspulted channel.\n real_port = @channelI.read_port\n real_port = @channelI.input unless real_port\n\n # Wrap it to a new port using.\n chp = real_port.wrap(read: @args_read)\n\n HDLRuby::High.space_reg(name) { chp }\n # Save the port in the channe to avoid conflicting declaration.\n @read_port = chp\n return chp\n end", "title": "" }, { "docid": "95e296d175573fade80beba8d0225c59", "score": "0.5618544", "text": "def find_channel_id(channel_name)\n channel = channels.find {|c| c['name'] == channel_name}\n channel ? channel['id'] : nil\n end", "title": "" }, { "docid": "d0f0685dce31a44fcd80b0b87c5aad91", "score": "0.5607177", "text": "def chat_with_hamcco(input)\n reply = @hamcco.chat(input[:feel], input[:message])\n reply ? { message: reply[:reply], feel: reply[:level] } : nil\n end", "title": "" }, { "docid": "0849b564d8c34ab277c910fdb3c1848d", "score": "0.5576665", "text": "def lookup_channel(name) \n return @channels[Channel.new(:network => self, :name => name).key]\n end", "title": "" }, { "docid": "1afad41c14e29ccbc74ecc665e0f84ce", "score": "0.55681556", "text": "def channel_with_destination(destination)\n found_call = Adhearsion.active_calls.to_a.find do |call|\n call.variables[:destination].include? destination\n end\n if found_call\n found_call.variables[:channel]\n else\n nil\n end\n end", "title": "" }, { "docid": "3c38f0540a905ecb179aec2203d83cdf", "score": "0.5556576", "text": "def find_user_by_channel_id(channel_id = 1)\n object_from_response(User, :get, \"userChannel?channelCustomerId=#{channel_id}\")\n end", "title": "" }, { "docid": "e40b5dbc5a5c0576ef79417ce06fc4af", "score": "0.5555857", "text": "def get_channel!(channel_name)\n data_provider = get_data_provider!\n channel = data_provider.data_provider_channels.detect do |channel|\n channel.name == channel_name\n end\n unless channel\n raise DataProviderChannelNotFound, \"Clearspring data provider channel not found: #{channel_name} - is db seeded?\"\n end\n channel\n end", "title": "" }, { "docid": "ca7aa09ebb91ee958e69299c2851480d", "score": "0.55542403", "text": "def analyze_input(s)\n if s =~ /^:(.+?)!(.+?)@(.+?)\\sPRIVMSG\\s(\\S+)\\s:([\\s\\S]*)$/i\n nick = $1\n channel = $4\n message = $5\n end\n return [nick,channel,message]\n end", "title": "" }, { "docid": "90495a910d40e61617a2fb2b4221e98c", "score": "0.55506", "text": "def get_channel(param1,param2,ws)\n\t param1,param2=arrange_caller_and_calee(param1,param2)\n\t return nil if instance_variable_get(\"@channel_#{param1}_#{param2}\").nil?\n\t #set_channel(param1,param2,ws)\n\t #return nil\n\t #end\n\t instance_variable_get(\"@channel_#{param1}_#{param2}\")\n\tend", "title": "" }, { "docid": "e153a94cafff4e87994fd3372839a1e3", "score": "0.5515321", "text": "def get_channel(arg)\n server.get_channel(arg)\n end", "title": "" }, { "docid": "ea113139059c8b5f7b08dc9cd55e4fc4", "score": "0.54877824", "text": "def main\n workspace = SlackBot::Workspace.new\n valid_inputs = [\"list users\", \"list channels\", \"select user\", \"select channel\", \"details\", \"send_message\", \"quit\"]\n user_input = nil\n \n until valid_inputs.include?(user_input)\n puts \"\\nPlease make a selection:\"\n puts \"List Users\"\n puts \"List Channels\"\n puts \"Select User\"\n puts \"Select Channel\"\n puts \"Details\"\n puts \"Send Message\"\n puts \"Quit\"\n print \"Selection: \"\n user_input = gets.chomp.downcase\n \n case user_input\n when \"list users\"\n tp workspace.users, \"slack_id\", \"name\", \"real_name\"\n user_input = nil\n when \"list channels\"\n tp workspace.channels, \"slack_id\", \"name\", \"topic\", \"member_count\"\n user_input = nil\n when \"select user\"\n print \"Enter a Username or Slack ID: \"\n user_criteria = gets.chomp\n workspace.select_user(user_criteria)\n user_input = nil\n when \"select channel\"\n print \"Enter a Channel Name or Slack ID: \"\n channel_criteria = gets.chomp\n workspace.select_channel(channel_criteria)\n user_input = nil\n when \"details\"\n if workspace.selected == nil\n puts \"No user or channel has been selected.\".colorize(:red)\n user_input = nil\n else\n workspace.show_details\n user_input = nil\n end\n when \"send message\"\n if workspace.selected == nil\n puts \"No user or channel has been selected.\".colorize(:red)\n user_input = nil\n else\n puts \"What message you would like to send to #{workspace.selected.name}: \"\n message = gets.chomp\n workspace.send_message(message: message)\n user_input = nil\n end\n when \"quit\"\n puts \"\\nThank you for using the Ada Slack CLI\".colorize(:yellow)\n exit\n end\n end\nend", "title": "" }, { "docid": "bfeab7c137363b5f919a6f9b33d8e9b7", "score": "0.5486578", "text": "def input(input_name)\n components.find { |c| c.input_name == input_name }\n end", "title": "" }, { "docid": "bfeab7c137363b5f919a6f9b33d8e9b7", "score": "0.5486578", "text": "def input(input_name)\n components.find { |c| c.input_name == input_name }\n end", "title": "" }, { "docid": "183f05d15f8c415683f5af8bc545f2cf", "score": "0.54773027", "text": "def channel_by(chid)\n channel_id = chid =~ /^http/ ? chid : \"http://gdata.youtube.com/feeds/api/channels/#{chid}?v=2\"\n logger.debug \"Submitting request [url=#{channel_id}].\" if logger\n parser = YouTubeG::Parser::ChannelFeedParser.new(channel_id)\n parser.parse\n end", "title": "" }, { "docid": "d0b5ef875b6afb5a0e175dce3042e735", "score": "0.5463095", "text": "def determine_channel(channel)\n channel || default_channel\n end", "title": "" }, { "docid": "fe163690a2c03663caa16e349acf8994", "score": "0.5439979", "text": "def channel_name(channel_or_name)\n case channel_or_name\n when Channel\n channel_or_name.name\n when String\n channel_or_name\n end\n end", "title": "" }, { "docid": "d89919e941cf0df057766ad926d269db", "score": "0.5431156", "text": "def channel\n DiscourseChatIntegration::Channel.find_by(id: channel_id)\n end", "title": "" }, { "docid": "340f87b8e3b19ed913a7ff057e99a16f", "score": "0.54247123", "text": "def user_by_name(name_input)\n name_info = name_input.tickets.first.user_id\n name_with_band = name_input.tickets.first.band_name\n puts \"-- Looks like #{User.find(name_info).name} has a ticket for #{name_with_band}.\".colorize(:blue)\n puts \"*\"*60\n puts \"-- Would you like to message #{User.find(name_info).name}? Y/N\".colorize(:blue)\n response = gets.chomp\n if\n response.downcase == \"y\"\n puts \"-- We're working to let you message them soon!\".colorize(:blue)\n puts \" \"\n self.user_menu(user)\n else\n self.user_menu(user)\n end\n end", "title": "" }, { "docid": "7068fe64ed237283831a5205d3033119", "score": "0.5415489", "text": "def candidate_channels_for_ao(message)\n get_channels \"/api/candidate/channels.json?#{to_query message}\"\n end", "title": "" }, { "docid": "99bbc4d6f3b16fc6137639fc4723aea1", "score": "0.54116875", "text": "def input(input_name)\n components.find { |c| c.input_name == input_name }\n end", "title": "" }, { "docid": "99bbc4d6f3b16fc6137639fc4723aea1", "score": "0.54116875", "text": "def input(input_name)\n components.find { |c| c.input_name == input_name }\n end", "title": "" }, { "docid": "4d5d18bf8e8e8d0a51fc2a904c144dca", "score": "0.5407798", "text": "def find_command(input)\n available_commands.find { |cmd| cmd.signature.matches? input }\n end", "title": "" }, { "docid": "67150e3b512be409f8c82eb34a48507a", "score": "0.5394304", "text": "def channel\n if params['channel']\n params['channel'].gsub('/','')\n else\n if params['prerelease'] == 'true' || params['nightlies'] == 'true'\n 'current'\n else\n 'stable'\n end\n end\n end", "title": "" }, { "docid": "f53c1dc615a4290fd77640426a4f9132", "score": "0.5358268", "text": "def lookup_or_create_channel(name, password = nil) \n return lookup_channel(name) || create_channel(name, password)\n end", "title": "" }, { "docid": "1393facc56af1a2a96645a2442fd4bf9", "score": "0.53482044", "text": "def faq\n if session[:user_id]\n @check = Channel.where(user: session[:user_id])\n end\n end", "title": "" }, { "docid": "7c085e5ccffe087faea543d5120130a4", "score": "0.5343961", "text": "def channel_by_id channel_id\n @channels.find{ |channel| channel.id == channel_id }\n end", "title": "" }, { "docid": "0f731e5262144311a96dc966835231db", "score": "0.5325583", "text": "def find_slack_channel(object, notification_type)\n channels = []\n # In all case except for review request, the general channel\n # (default configured with the Vulcan instance) will be notified\n channels << Settings.slack.channel_id unless object.is_a?(Rule)\n # Usecase: requesting a review, revoking review request, approving or requesting changes on a control\n case object\n when Rule\n # Getting the component or project slack channel\n comp = object.component\n channels << (comp.metadata&.dig('Slack Channel ID') || comp.project.metadata&.dig('Slack Channel ID'))\n # Getting the slack user id of the user who initially requested the review\n channels << latest_reviewer_slack_id(object) unless notification_type.to_s == 'request_review'\n when Membership\n # Usecase: updating project/component membership role\n channels << object.user.slack_user_id\n when User\n # Usecase: updating Vulcan role (admin/user)\n channels << object.slack_user_id\n when Project\n # Usecase: Project creation, removal, & renaming\n channels << object.metadata&.dig('Slack Channel ID')\n when Component\n # Usecase: Component creation and removal\n channels << (object.metadata&.dig('Slack Channel ID') || object.project.metadata&.dig('Slack Channel ID'))\n end\n\n channels.compact.uniq\n end", "title": "" }, { "docid": "19668b35c71ba96513062d70697a6968", "score": "0.5311627", "text": "def fetch_channel_id(name, token)\n channel_url = \"https://slack.com/api/channels.list?token=#{token}&pretty=1\"\n r = HTTP.get(channel_url)\n j = JSON.parse(r)\n channels = j[\"channels\"]\n ch_search = channels.select { |c| c[\"name\"] == name }[0]\n ch_search.nil? ? \"C4P3DTTL7\" : ch_search[\"id\"]\nend", "title": "" }, { "docid": "dea61289fdd6c3c43000293d86da0665", "score": "0.53089887", "text": "def channel\n if (channel = Thread.current[CHANNEL_KEY]).try(:open?)\n channel\n else\n new_channel = connection.channel\n new_channel.confirm_select\n new_channel.prefetch(Isimud.prefetch_count) if Isimud.prefetch_count\n Thread.current[CHANNEL_KEY] = new_channel\n end\n end", "title": "" }, { "docid": "e8ab2e4fb24cbf6d3eee1d16e29d5f9e", "score": "0.5307128", "text": "def channel_params\n params[:channel]\n end", "title": "" }, { "docid": "816047a8529a9af5c0ee6b277a397995", "score": "0.53069746", "text": "def get_channel_id_by_name(name)\n channel = Slack.channels_list['channels'].find{ |c| c['name'] == name } ||\n Slack.channels_create({:name => name})['channel']\n return channel['id']\n end", "title": "" }, { "docid": "93092241d24a841cef5490110db2822f", "score": "0.530401", "text": "def channelHasUser?(nick, channel)\n return @channels[channel].has_key?(nick)\n end", "title": "" }, { "docid": "202a671a20756f33079feebce993308c", "score": "0.5283804", "text": "def find_chan(chan)\r\n return @cdb.find(@irc_proto.server_key, chan)\r\n end", "title": "" }, { "docid": "7ea9e9f52d104c7d9bc8438cccb7ef9f", "score": "0.52803636", "text": "def handle_input(input)\n if input.nil?\n return\n end\n\n input.chomp!\n\n # Print functions clear the current line, so if we're handling input, we need\n # to move down a few lines so we can see what we entered on our screen.\n $win.addstr(\"\\n\\n\")\n\n if input.length == 0\n print_line(\"Please enter a valid command. A list of commands is available by typing 'commands'.\\n\")\n return nil\n end\n\n # See if we can find a command key that matches the first word of the input\n matches = $commands.select { |c| c =~ /\\A#{Regexp.escape(input.split.first)}/i }\n command = matches.first\n\n unless command.nil?\n # We have a match! Call the method associated with the command\n return command[1].call($player, input)\n else\n print_line(\"\\\"#{input}\\\" is not a valid command. A list of commands is available by typing 'commands'.\\n\")\n end\nend", "title": "" }, { "docid": "839529dfac2cbaa8b2e41b9260838fe1", "score": "0.5266472", "text": "def take_input\n\tp \"Enter the String to be searched: \"\n\tinput = gets.chomp\nend", "title": "" }, { "docid": "9c99cacd924d197cb82c3423e1a96e83", "score": "0.52489984", "text": "def can_subcribe_channel? channel_name\n\n if self.id == channel_name\n true\n else\n false\n end\n\n end", "title": "" }, { "docid": "81d5ac490cba86f7e07c849bd3f53240", "score": "0.52472246", "text": "def user\n User.get(@channel.name)\n end", "title": "" }, { "docid": "dfe2aaba283222b08b3f82c05124bed8", "score": "0.5240742", "text": "def prompt_recipient\n puts \"Do you want to continue using -name- or -id- ?\"\n key = gets.chomp.downcase \n\n until VALID_SEARCH.include? key\n puts \"Invalid command- Please input name or id to continue.\"\n key = gets.chomp.downcase \n end \n \n puts \"Please enter #{key} to continue\"\n input = gets.chomp\n \n key == 'name' ? {name: input} : {slack_id: input}\nend", "title": "" }, { "docid": "677157d08242e30e6ac75bf3783f4ea7", "score": "0.5238562", "text": "def channel\n @channel ||= bunny.create_channel\n end", "title": "" }, { "docid": "1856240d765a48f986a193e3750566f9", "score": "0.52344453", "text": "def find_channel(channel_name, server_name = nil)\n results = []\n\n @servers.values.each do |server|\n server.channels.each do |channel|\n results << channel if channel.name == channel_name && (server_name || server.name) == server.name\n end\n end\n\n results\n end", "title": "" }, { "docid": "0ee1acf6ff2712ccbb0e4b9f92769e7a", "score": "0.5226345", "text": "def get_required_primary_channel(channel,variant_suffix,copy_from)\n # variant_suffix is probably something like '-5.6.Z'\n # It's because the variants are named with that suffix for RHEL-5.6.Z\n matches = copy_from.primary_channels.select do |copy_channel|\n ( \"#{copy_channel.variant.name}#{variant_suffix}\" == channel.variant.name &&\n copy_channel.arch_id == channel.arch_id )\n end\n raise \"non-unique!\" if matches.length > 1\n raise \"not found!\" if matches.empty?\n matches.first\n end", "title": "" }, { "docid": "57e92f68416a3bee648b3ec12568406d", "score": "0.52110225", "text": "def channel_from\n Channel.find(channel_id_from)\n end", "title": "" }, { "docid": "48bbc2192cf0f056094d68135a6f0f0f", "score": "0.520889", "text": "def user_entered channel, user\n cache[:names] << user.nick unless cache[:names].include? user.nick\n\n @megahal.tell! random_greeting do |response|\n channel.say \"#{user.nick}: #{response}\"\n end\n end", "title": "" }, { "docid": "36797875b12ef817a6dd933d27225622", "score": "0.52037096", "text": "def channel_search\n is_cug = params[:channel] == \"true\" ? true:false\n channels = Channel.includes(:channel_aliases, :subscriptions => :user).searched_channels(is_cug, params[:query], current_user.id)\n render :json => { :query => params[:query],\n :suggestions => channels.blank? ? [\"No #{params[:is_channel_view]== \"true\" ? \"Channels\" : \"CUGs\"} Found\"] : channels.map{|channel| \"#{ChannelAlias.select(\"name,id\").where(:user_id => current_user.id, :channel_id => channel.id).first.try(:name) || channel.name}\"},\n :data => channels.blank? ? [0] : channels.map{|channel| channel.id} }\n end", "title": "" }, { "docid": "5941fe425a6dfe46e6a39d78a95cfbcf", "score": "0.5202543", "text": "def user\n @query.users.get(@channel.name)\n end", "title": "" }, { "docid": "d78028029fcc599a00a56fe885c9fcaf", "score": "0.5194681", "text": "def change_channel\n\t\tprint \"Channel choice: \"\n\t\t\tchannel_choice = gets.chomp.to_i\n\t\t\t\tif channel_choice >= 1 || channel_choice <= 100\n\t\t\t\t\t\tputs \"Now watching channel #{channel_choice}\"\n\t\t\t\telsif channel_choice < 1 || channel_choice >= 100\n\t\t\t\t\tputs \"To access additional channels, please contact your cable service provider. Please select another channel.\"\n\t\t\t\t\tchannel_choice = gets.chomp.to_i\n\t\t\t\t\tchange_channel\n\t\t\t\tend\n\tend", "title": "" }, { "docid": "21736621c4784c2e8eb308d031b8b20e", "score": "0.5186521", "text": "def get_user_input(message)\n puts message\n gets.chomp\n end", "title": "" }, { "docid": "fae2ce43657fd3fbd64a6fcb31c20894", "score": "0.5179656", "text": "def channel\n return '#general' if @channel.nil?\n @channel\n end", "title": "" }, { "docid": "0c703df4e65bdc2910ec4629ac7845ef", "score": "0.517507", "text": "def recipient\n return @channel if @channel\n return params.first if regular_command? \n end", "title": "" }, { "docid": "e430d4343c43943efc4e3a207dc62367", "score": "0.5148821", "text": "def select(type, input)\n instance_variable_get(\"@#{type}s\").each do |item|\n if item.slack_id.upcase == input.upcase || item.name.upcase == input.upcase\n @selected = item\n break\n else \n @selected = \"\"\n end\n end\n end", "title": "" }, { "docid": "4294f836f971e9eb807a9eea2b8ba8b4", "score": "0.514073", "text": "def selectinput(pNm,mId,params)\r\n SendToPlayer(\"browse/play_stream?#{params[\"inputnumber\"]}&pid=#{@@playerDB[pNm][:HeosId]}\")\r\n \r\n return {}\r\nend", "title": "" }, { "docid": "c4d752c9fee1c5bfc1039ab51643d9e7", "score": "0.512702", "text": "def find_characters_by_name\n # binding.pry\n puts \"Please enter a character name\".blue\n search = gets.chomp.downcase\n name = search.split.each { |name| name.capitalize! }.join(' ')\n CLI.current_result = Character.find_by(name: name)\n if CLI.current_result == nil\n puts <<-EOF\n That is not a characters name.\n\n EOF\n\n reroute_name_search(reroute_name_search_prompt)\n else\n search_results(CLI.current_result)\n adopt?\n end\n\nend", "title": "" }, { "docid": "2d611183825ff18e42b2c854732ac398", "score": "0.51205206", "text": "def channel(name)\n Marvin::IRC::Server::ChannelStore[name]\n end", "title": "" }, { "docid": "a62af04e34a15a3aecbe2e96555f7066", "score": "0.5119016", "text": "def valid_channel?(str)\n !str.match(pattern(:channel)).nil?\n end", "title": "" }, { "docid": "f20b88c97c8f137710facba94d747ec7", "score": "0.5116607", "text": "def remove(channel_or_channel_name)\n @mutex.synchronize do\n if channel_or_channel_name.is_a?(String)\n channel_or_channel_name = find(channel_or_channel_name)\n end\n \n @channels.delete(channel_or_channel_name)\n end\n end", "title": "" }, { "docid": "0d5b3c923fca17ed4085a1a8b2b30216", "score": "0.51090544", "text": "def channel\n attributes[:channel]\n end", "title": "" }, { "docid": "5fb198f671130f01a7cfb95f1d54f620", "score": "0.51016915", "text": "def process_channel_event(event)\n user = event.connection.user\n user_id = user.try(:id)\n Rails.logger.info \"*** Board#process_channel_event #{uid} #{event.name} #{user_id}\"\n\n cmd_name = event.name.to_s\n ok = can_process_channel_command?(cmd_name, user) && process_channel_command(cmd_name, event.data, user_id)\n\n unless ok\n Rails.logger.error \"!!! Board#process_channel_event #{uid} #{event.name} #{event.connection.id} #{user_id}\"\n end\n\n ok\n end", "title": "" }, { "docid": "e123bd23ec3c2ceeebf974d850e75fe0", "score": "0.51005113", "text": "def joinChannel(idUser,idChannel)\n \n end", "title": "" }, { "docid": "04c15b0698ad71afc7d95164c444286e", "score": "0.50992566", "text": "def channel_name\n read_attribute(:channel_name)\n end", "title": "" }, { "docid": "15cf601af01640e4d453afb51c21a566", "score": "0.5098862", "text": "def process_channel_command(cmd_name, cmd_data, user_id = nil)\n ok = true\n\n case cmd_name\n when 'object:create'\n obj = cmd_data['object']\n if valid_object?(obj)\n # Assign 'object_id'\n cmd_data['object_id'] = save_object(obj, user_id)\n else\n ok = false\n end\n\n when 'object:modified'\n obj = cmd_data['object']\n obj_id = cmd_data['object_id'].to_i\n\n if valid_object?(obj) && obj_id > 0\n cmd_data['object_id'] = obj_id\n ok = update_object(obj_id, obj, user_id)\n else\n ok = false\n end\n\n when 'option:change'\n options = cmd_data['options']\n if valid_options?(options)\n ok = update_canvas_options(options, user_id)\n else\n ok = false\n end\n\n when 'board:clear'\n clear_objects\n\n when 'laser:move', 'laser:flash'\n #TODO prevent flood\n\n when 'chat:message'\n #TODO prevent flood\n\n else\n # Block all other messages\n ok = false\n end\n\n ok\n end", "title": "" }, { "docid": "5221c9343b576e5ff8cee9e96a49c634", "score": "0.50949436", "text": "def got_CIU(message)\n #Annoyingly, the json for this varies for public and private rooms.\n #So just try both and call it a day.\n self.send('JCH',message['name'])\n self.send('JCH',message['channel'])\n end", "title": "" }, { "docid": "ba228d5d76f4717f73790a57e729581f", "score": "0.5091135", "text": "def is_channel?\n self.match /^([#&]+)(.+)$/\n end", "title": "" }, { "docid": "398596decaf876a39988a457908eff9f", "score": "0.5087957", "text": "def retrieve_channels(user_id)\n return Channel.find(:all, :conditions => [\"user_id = ?\", user_id])\n end", "title": "" }, { "docid": "edd27a2ab206e47b2535f1e131b71172", "score": "0.5084901", "text": "def got_name_reply network, message\n name = message.parameters[2] # Channel name.\n nicks = message.parameters[3].split.map do |nick|\n # Slice the nick if the first character is a user mode prefix.\n nick.slice! 0 if network.user_prefixes.include? nick.chr\n\n nick\n end\n\n return unless (channel = find_or_create_channel(name, network))\n\n users = nicks.map { |nick| find_or_create_user nick, network }\n users.each do |user|\n user.channels << channel\n channel.users << user unless channel.users.include? user\n end\n\n emit :channel_who_reply, channel\n end", "title": "" }, { "docid": "8f99986587e644f41f9424be3faafe71", "score": "0.5079022", "text": "def channel(*args)\n @state.channel = args.first unless args.empty?\n @state.channel\n end", "title": "" }, { "docid": "481c2262eb701e5cf042dd27718785cd", "score": "0.5078334", "text": "def command(input)\n Regexp.new(\"#{$config['irc']['nick']}_?:?\\s?#{input}\")\nend", "title": "" }, { "docid": "481c2262eb701e5cf042dd27718785cd", "score": "0.5078334", "text": "def command(input)\n Regexp.new(\"#{$config['irc']['nick']}_?:?\\s?#{input}\")\nend", "title": "" }, { "docid": "831eea63dbcee1d599363dc2d29c4502", "score": "0.5078192", "text": "def parse(input)\n log.debug \"[isaac] Received #{input.chomp}\" if @bot.config.verbose\n puts \"<< #{input.unpack('A' * input.length).join(\",\")}\" if @bot.config.verbose\n msg = Message.new(input)\n\n if (\"001\"..\"004\").include? msg.command\n @registration << msg.command\n if registered?\n @queue.unlock\n @bot.dispatch(:connect)\n end\n elsif msg.command == \"PRIVMSG\"\n if msg.params.last == \"\\001VERSION\\001\"\n message \"NOTICE #{msg.nick} :\\001VERSION #{@bot.config.version}\\001\"\n end\n\n type = msg.channel? ? :channel : :private\n @bot.dispatch(type, msg)\n elsif msg.error?\n @bot.dispatch(:error, msg)\n elsif msg.command == \"PING\"\n @queue.unlock\n message \"PONG :#{msg.params.first}\"\n elsif msg.command == \"PONG\"\n @queue.unlock\n else\n event = msg.command.downcase.to_sym\n @bot.dispatch(event, msg)\n end\n end", "title": "" } ]
adfa0d7a94a403ba91f57f6ec591c1c6
list = [ 0, 3, 5, 4, 5, 10, 1, 90 ] p my_min_2(list) => 5
[ { "docid": "cabb940f99bc4de3fb39d010df4f5ade", "score": "0.0", "text": "def largest_contiguous_subsum(list) #O(n ^ 2)\n largest_sum = list.first\n (0...list.length).each do |i|\n (i...list.length).each do |j|\n if j >= i && list[i..j].sum > largest_sum\n largest_sum = list[i..j].sum\n end\n end\n end\n largest_sum\nend", "title": "" } ]
[ { "docid": "ca93761f2aa64b603bae9794e0ffa9b7", "score": "0.87082946", "text": "def my_min_2(list)\n current_min = 0\n list.each do |el|\n current_min = el if el < current_min\n end\n current_min\nend", "title": "" }, { "docid": "0b015fced50d909c0a168a4a825597a2", "score": "0.85822344", "text": "def my_min_2(list)\n min = list.first\n list.each { |num| min = num if num < min }\n min\nend", "title": "" }, { "docid": "a73454595d27356bdc4357de29539354", "score": "0.857006", "text": "def my_min_2(list)\n min_num = list.first\n\n list.each { |num| min_num = num if num < min_num }\n\n min_num\nend", "title": "" }, { "docid": "6db07a29734a274af7b0badc73aceba3", "score": "0.8499556", "text": "def my_min2(list)\n min = 0\n list.each do |ele|\n min = ele if min >= ele\n end\n min\nend", "title": "" }, { "docid": "a02611c02d9784edc17749ee3a024e30", "score": "0.8457801", "text": "def my_min2(list)\n list.inject {|accum, num| accum < num ? accum : num }\nend", "title": "" }, { "docid": "6cdd27e8229241e909641ca88bee6140", "score": "0.8457622", "text": "def my_min2(list)\n min = list.first\n list.each do |e|\n if e < min\n min = e\n end\n end\n min\nend", "title": "" }, { "docid": "55000ce7de872ef50ae221cfd169ee67", "score": "0.8441159", "text": "def my_min2(list)\n min = list.first\n\n list[1..-1].each do |num|\n min = num if num < min\n end\n\n min\nend", "title": "" }, { "docid": "eafda94bdb61c56376e365cff750a37c", "score": "0.83937526", "text": "def my_min_2(list)\n min_ele = list.first\n (1...list.length).each do |i|\n ele = list[i]\n min_ele = ele if ele < min_ele\n end\n min_ele\nend", "title": "" }, { "docid": "8e310fa9c54b1f7f5e45816759187a75", "score": "0.8384364", "text": "def my_min2(list)\n min = list[0]\n (1...list.length).each do |i|\n min = list[i] if list[i] < min\n end\n min\nend", "title": "" }, { "docid": "cb4bd204d40048f70fcdb745d227932c", "score": "0.83813024", "text": "def my_min_2(list)\n minimum = list[0]\n\n list.each_with_index do |int, i|\n minimum = int if minimum > int\n end\n\n minimum\nend", "title": "" }, { "docid": "07582ec7a964e823857023661562a138", "score": "0.8342781", "text": "def my_min2(list)\n found = list[0]\n (0...list.length).each do |ele|\n if list[ele] < found\n found = list[ele]\n end\n end\n found\nend", "title": "" }, { "docid": "c523e717595b755a85082eed1b340313", "score": "0.83044714", "text": "def my_min_2(list)\n smallest_num = list[0]\n list.each {|num| smallest_num = num if num < smallest_num}\n smallest_num\nend", "title": "" }, { "docid": "a001949e1c1698ef19bc19478712a501", "score": "0.8284899", "text": "def my_min2(list)\n cur_min = list.first\n list.each do |el|\n cur_min = el if el < cur_min\n end\n cur_min\nend", "title": "" }, { "docid": "46031b80d3b7dba10b9a3297c2e53af7", "score": "0.8267685", "text": "def my_min(list)\n min = list.first\n list.each do |num|\n min = num if num < min\n end\n min\nend", "title": "" }, { "docid": "635d856661dad7c49fc77d8babd09f72", "score": "0.82587904", "text": "def my_min(list)\n min = nil\n list.each do |num|\n min = num if min.nil? || num < min\n end\n min\nend", "title": "" }, { "docid": "1944b9524259f16979202668744a443b", "score": "0.82419205", "text": "def my_min2(list)\n lowest = list.first\n\n list.drop(1).each do |el|\n lowest = el if el < lowest\n end\n\n lowest\nend", "title": "" }, { "docid": "7b32f3d293b64135894fb0255a5ba9e5", "score": "0.8232914", "text": "def my_min2(list)\n min = list[0]\n list.each do |ele|\n if ele < min \n min = ele \n end\n end\n min \nend", "title": "" }, { "docid": "7792c3e17ead416b20a649f4b8ad88b9", "score": "0.8232146", "text": "def my_min_v2(list)\n min = list[0]\n (1...list.length).each do |idx|\n min = list[idx] if min > list[idx]\n end\n min\nend", "title": "" }, { "docid": "dc38e827c43170f82f84bd89c3bb4120", "score": "0.8219876", "text": "def my_min2(list)\n min = list.shift\n list.each do |ele|\n min = ele if ele < min\n end\n min\nend", "title": "" }, { "docid": "8f2f0297dc98f554f05ce77b9d1d4126", "score": "0.8216165", "text": "def my_min1(list)\n list.each_with_index do |num1, idx1| \n min = num1 \n list.each_with_index do |num2, idx2|\n if idx2 > idx1\n min = num2 if num2 < num1\n end\n end\n return min\n end\nend", "title": "" }, { "docid": "3da60f6c9cd129eeb3e1262d1b430aa5", "score": "0.8214894", "text": "def my_min(list)\n ans = list.first \n list.each do |ele|\n if ele < ans \n ans = ele \n end \n end \n ans \nend", "title": "" }, { "docid": "b31994840a544d568475704886d3644b", "score": "0.81829333", "text": "def my_min_1(list)\n min = list.first\n (0...list.length).each do |i|\n (i+1...(list.length-1)).each do |j|\n min = list[j] if list[j] < min\n end\n end\n min\n end", "title": "" }, { "docid": "f51d13093239e84a7e93c1594825ba96", "score": "0.8179187", "text": "def my_min2(list)\n min = list.first\n list.each_with_index do |el, i|\n next if i == 0\n min = el if el < min\n end\n min\nend", "title": "" }, { "docid": "e51aebcb1fd0d2ee06ebbfcdc22561d7", "score": "0.81749374", "text": "def my_min_1(list)\n\n list.each do |num_1|\n return num_1 if list.all? { |num_2| num_1 <= num_2 }\n end\nend", "title": "" }, { "docid": "6df12de21cc9c7fbc52327208a522d0a", "score": "0.81531537", "text": "def my_min_2(list)\n # min = list.first # constant O(1)\n # list.each {|num| min = num if num < min } # O(n)\n # min \n list.min\n end", "title": "" }, { "docid": "9367133543ebdece9852d47751fcc68e", "score": "0.8150954", "text": "def my_min_2(list)\n smallest = list.first\n list.each do |el|\n if el < smallest\n smallest = el\n end\n end\n smallest\nend", "title": "" }, { "docid": "89658e6179940a05a92ba4fa083c891e", "score": "0.8148926", "text": "def my_min_2(list) #O(n)\n min = list[0]\n list[1..-1].each do |ele|\n min = ele if ele < min\n end\n min\nend", "title": "" }, { "docid": "bd74d8a4a2e8bd74594aafdda4b5b572", "score": "0.81312597", "text": "def my_min2(list)\n\n smallest = list[0]\n list.each do |element|\n smallest = element if element < smallest\n end\n smallest\nend", "title": "" }, { "docid": "ca8fbf0b7085a5c59c0977f58f704581", "score": "0.8126027", "text": "def my_min_2(list)\n smallest = list.first \n\n list.each do |num|\n smallest = num if num < smallest\n end\n \n smallest\nend", "title": "" }, { "docid": "03cc015da3b0e4878bfa0531af170687", "score": "0.811703", "text": "def my_min(list)\n list.each_with_index do |ele, i|\n num = ele\n if list.all? { |l| num <= l }\n return num\n end\n end\nend", "title": "" }, { "docid": "dc48827ff8e08e4490abad73a6f9d0d5", "score": "0.81089115", "text": "def my_min_1(list)\n\n (0...list.length).each do |i|\n return list[i] if list.all? {|ele| ele >= list[i]} \n end\n\nend", "title": "" }, { "docid": "a930156962b7159f511e783bc336de87", "score": "0.81062865", "text": "def my_min1(list) # N time\n min = list[0]\n list.each do |el|\n min = el if el < min\n end\n min\nend", "title": "" }, { "docid": "eaa947f9fcba09d7f03f8bf270ed78a0", "score": "0.80591995", "text": "def my_min_1(list)\n list.each_with_index do |num1, idx1|\n min = true\n\n list.each_with_index do |num2, idx2|\n next if idx1 == idx2\n min = false if num2 < num1\n end\n return num1 if min\n end\nend", "title": "" }, { "docid": "f3998dfcdcbc705d28832be8b6046ee0", "score": "0.8048375", "text": "def my_min(list)\n min = list[0]\n\n (0...list.length-1).each do |i|\n if list[i] < list[i+1] && list[i] < min\n min = list[i]\n end\n end\n\n min\n end", "title": "" }, { "docid": "418ba91d952f33f5b59f3f7e069f7473", "score": "0.8028451", "text": "def my_min2(list)\n smallest = list[0]\n list.drop(1).each do |el|\n if el < smallest\n smallest = el\n end\n end\n smallest\nend", "title": "" }, { "docid": "e66faf900bd8c13665607b0fce353608", "score": "0.8024648", "text": "def my_min(list)\n min = list[0]\n list.each do |ele|\n min = ele if ele < min\n end\n min\nend", "title": "" }, { "docid": "36d8405bde760ae7c2f32479a95516c9", "score": "0.7993662", "text": "def my_min(list)\n min = list.first\n list.each do |el|\n min = el if el < min\n end\n min\nend", "title": "" }, { "docid": "8f28fc0e3565b72235cd57e0e7c1c7c0", "score": "0.79868984", "text": "def my_min3(list)\n min\nend", "title": "" }, { "docid": "f86c05792b55df01f10ee74959d701c7", "score": "0.7961926", "text": "def minimum(list)\n min = list[0]\n list.each do |x|\n if x < min\n min = x\n end\n end\n return min\nend", "title": "" }, { "docid": "d69fc550a7f05733cef06131f62aad14", "score": "0.7939194", "text": "def my_min(list)\n min = list.first\n list.each do |el|\n min = el if el < min \n end \n min \nend", "title": "" }, { "docid": "91bfff3efb6a98fba1d3b7d00f966127", "score": "0.79375374", "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": "c6a79b6d28200272e9af1132c25621df", "score": "0.7931087", "text": "def my_min(list)\n current_min = list.first\n\n list.each do |el|\n current_min = el if el < current_min\n end\n\n current_min\nend", "title": "" }, { "docid": "a78ce5b2426495a0c33ada3437f88158", "score": "0.79168206", "text": "def my_min2(array)\n best_min = 0\n array.each do |el|\n best_min = el if el < best_min\n end\n best_min\nend", "title": "" }, { "docid": "7ab6673660bee6edbaf689e5ffe4d3ac", "score": "0.7908503", "text": "def min(list)\nend", "title": "" }, { "docid": "70cd7f63a2e98d0b103708da32344194", "score": "0.789284", "text": "def my_min(list)\n result = 0\n list.each do |i|\n result = i if list.all? {|ele| i <= ele}\n end\n result\nend", "title": "" }, { "docid": "e7b935e8f2a8216ce8135f0448777e81", "score": "0.7887557", "text": "def my_min_1b(list)\n list.each_with_index do |num1, i1|\n min = true\n list.each_with_index do |num2, i2|\n next if i1 == i2\n min = false if num2 < num1\n end\n return num1 if min\n end\nend", "title": "" }, { "docid": "987265ee268afe86d37f590a6beb1967", "score": "0.78858066", "text": "def my_min_1(list)\n smallest = nil\n list.each do |el1|\n smallest = el1 if smallest == nil\n list.each do |el2|\n if el2 < el1 && el2 < smallest\n smallest = el2\n end\n end\n end\n smallest\nend", "title": "" }, { "docid": "cadee7a87382aa1819ddbbdc55fa6b46", "score": "0.78809845", "text": "def my_min(list)\n list.reduce { |min, el| min > el ? el : min}\nend", "title": "" }, { "docid": "1e4b1dd4bbabe2ce10a0634e5afba791", "score": "0.7841735", "text": "def min(list)\n min_so_far = list.first # or, equivalently, list[0]\n list.each do |item| # or, equivalently, for item in list\n if item < min_so_far # if current item is less than min so far\n min_so_far = item\n end\n end\n\n return min_so_far\nend", "title": "" }, { "docid": "4b376476099c97b97f44546ef1dcc61c", "score": "0.78407973", "text": "def minimum(list)\n list.min\nend", "title": "" }, { "docid": "465e2ac8850c6b48a81b496d5d8a5a19", "score": "0.7826549", "text": "def my_min_1b(list)\n smallest = list[0]\n\n list.each do |num|\n smallest = num if smallest > num\n end\n\n smallest\nend", "title": "" }, { "docid": "ca19075dbe4a52aa3237f099f22342e6", "score": "0.78233814", "text": "def my_min2(list)\n smallest = list[0]\n list.each do |ele|\n smallest = ele if smallest > ele\n end \n smallest\nend", "title": "" }, { "docid": "caed03b2eaeb978db0248a84a533458d", "score": "0.78221494", "text": "def my_min(list)\n min = list[0]\n list.each do |ele_1|\n list.each do |ele_2|\n if ele_1 < ele_2\n min = ele_1 if ele_1 < min\n else\n min = ele_2 if ele_2 < min\n end\n end\n end\n min\nend", "title": "" }, { "docid": "c4a11134bb1ae0fccbc6fecb4d7354a4", "score": "0.781413", "text": "def my_min_1a(list)\n min_num = nil\n\n list.each do |num1|\n dup_list = list.dup\n dup_list.delete(num1)\n min_num = num1 if dup_list.all? { |num2| num2 > num1 }\n end\n\n min_num\nend", "title": "" }, { "docid": "d9ca7f3b6543235d2e8f8eb372ec05c3", "score": "0.7804215", "text": "def my_min(list)\n smallest = list[0]\n list[0...-1].each do |ele1|\n list[1..-1].each do |ele2|\n smallest = ele2 if ele2 < ele1\n end\n end\n smallest\nend", "title": "" }, { "docid": "68a1067e3ff1fbd6fdc2b034c8461d34", "score": "0.78013223", "text": "def my_min(list)\n min = 0\n list.each do |ele1|\n min = ele1 if list.all? do |ele2|\n ele1 <= ele2\n end\n end\n min\nend", "title": "" }, { "docid": "93a3afb37628ac9e5947d80dc42e265c", "score": "0.7801157", "text": "def my_min_2(array)\n smallest = nil\n array.each do |num|\n smallest ||= num\n smallest = num if num < smallest\n end\n smallest\nend", "title": "" }, { "docid": "8f821a70ea6fa0af7c958a4dd33b600f", "score": "0.7800414", "text": "def my_min(list)\n smallest = list.first\n list.each do |num1|\n smallest = num1 unless num1 > smallest\n end\n smallest\nend", "title": "" }, { "docid": "1280174c6a9efb66c5c9ef7acbeb91f3", "score": "0.7792853", "text": "def secondSmallest(list)\n mn = list.min\n mx = list.max\n list.map! { |e| e == mn ? mx : e }\n num = list.min\n arr = list.each_index.select{|i| list[i] == num}\n val = 0\n if arr.count() > 1\n val = arr[1]\n else\n val = arr[0]\n end\n return val\nend", "title": "" }, { "docid": "ab2cd448b7687652ddef3d11acff75bf", "score": "0.7773783", "text": "def find_smallest(list)\n return list.min\n end", "title": "" }, { "docid": "bdcefae96707dc6163737dd3b964e4a6", "score": "0.775994", "text": "def my_list2(list)\n min = list.first\n\n list.each do |item|\n if min > item\n min = item\n end\n end\n\n min \nend", "title": "" }, { "docid": "31355426dbb55bf18ba7aad5f3fe3519", "score": "0.7745887", "text": "def my_min2(list) #Time complexity is O(n)\r\n list.inject {|acc, ele| ele < acc ? ele : acc}\r\nend", "title": "" }, { "docid": "4f7f69743960b436ea7126cf4e1c8c00", "score": "0.77328485", "text": "def my_minI(list)\n smallest = list.first \n list.each do |num1|\n list.each do |num2|\n smallest = num1 if num1 < num2 && num1 < smallest \n end\n end\n smallest \nend", "title": "" }, { "docid": "6e149ac8a43ca7f9b14ba9f5ff97e69d", "score": "0.77266675", "text": "def my_min_2(array)\n my_min = array.first\n array.drop(1).each do |num|\n my_min = num if num < my_min\n end\n my_min\nend", "title": "" }, { "docid": "bf706b866e91b03c0bcd5f954764e37a", "score": "0.7724867", "text": "def min(list)\n list.sort_by{|a| a}[0] \nend", "title": "" }, { "docid": "9b43164d3cacf98c14f9d569eaa98188", "score": "0.7700867", "text": "def good_my_min(list)\n min_el = nil\n list.each do |el1|\n min_el = el1 if min_el.nil? || el1 < min_el\n end\n\n min_el\nend", "title": "" }, { "docid": "e66dd7cf3d73b2b132fede1296afdf3d", "score": "0.77000433", "text": "def my_min(list) # O(n)\n min = list.first # 1\n list.each do |ele| # n \n min = ele if ele < min # 1 \n end\n min # 1\nend", "title": "" }, { "docid": "cfa9afadcc4c3b965f28962042e4b011", "score": "0.76899844", "text": "def my_min(list)\n min = list[0]\n\n list.each_with_index do |ele_1, idx_1|\n list.each_with_index do |ele_2, idx_2|\n min = ele_1 if (min > ele_1 && idx_2 > idx_1)\n end\n end\n\n min\nend", "title": "" }, { "docid": "8786fa9128c39a1a881614c92a880a25", "score": "0.7685705", "text": "def my_minII(list)\n list.inject { |smallest, current| current < smallest ? current : smallest }\nend", "title": "" }, { "docid": "6463bed5dcd36c540df85ef6a61394bb", "score": "0.76759547", "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": "0a4d6df4e6f870cb710ae2a465770c3a", "score": "0.7659203", "text": "def my_min2(list)\n list.each_with_index do |ele1, i1|\n min = true\n list.each_with_index do |ele2, i2|\n next if i1 == i2\n min = false if ele2 < ele1\n end\n\n return ele1 if min\n end\nend", "title": "" }, { "docid": "1e669ad2b0eb367d9fcb62680084e0dd", "score": "0.76542", "text": "def my_min(list)\n smallest_element = list[0]\n list.each do |ele|\n smallest_element = ele if ele < smallest_element\n end\n smallest_element\nend", "title": "" }, { "docid": "968ea964e29b8902e92fe34ccc4cb1be", "score": "0.76441056", "text": "def my_min(list)\n current_min = nil #o(1)\n list.each_with_index do |el, i| #O(n)\n list.each_with_index do |el2, j| #O(n)\n if j > i #O(1)\n current_min ||= el #O(1)\n current_min = (current_min < el2) ? current_min : el2 #O(1)\n current_min = (current_min < el) ? current_min : el #O(1)\n end\n end\n end\n current_min #O(1)\nend", "title": "" }, { "docid": "81d9eadbc5abdc17e32f0f1aee0e27f1", "score": "0.7640224", "text": "def my_min(list) #time complexity = O(n^2)\n min = list[0] \n \n list.each_with_index do |el1, idx1|\n list.each_with_index do |el2, idx2|\n next if idx1 == idx2\n if el1 < el2 && el1 < min\n min = el1\n elsif el2 < min\n min = el2\n end\n end\n end\n\n min\nend", "title": "" }, { "docid": "d9c7f0d0e4e3e440b9447452aec822c5", "score": "0.7638106", "text": "def my_slow_min(list)\n list.each_with_index do |base_num|\n return base_num if list.all? { |num| base_num <= num }\n end\nend", "title": "" }, { "docid": "d6c28ea19fc5b3aebf95eff54c564cdd", "score": "0.76376235", "text": "def my_min(list)\n smallest = list.first\n list.each do |el|\n smallest = el if el < smallest\n end\n smallest\nend", "title": "" }, { "docid": "690dad069997cf16bf7f55479906d142", "score": "0.76298547", "text": "def smallest_integer(list_of_nums)\n list_of_nums.min\nend", "title": "" }, { "docid": "690dad069997cf16bf7f55479906d142", "score": "0.76298547", "text": "def smallest_integer(list_of_nums)\n list_of_nums.min\nend", "title": "" }, { "docid": "42d82233bf9fb6cace54ab09c9f54e55", "score": "0.76101065", "text": "def min_by list, &block\n list.min {|num| block.call(num)}\nend", "title": "" }, { "docid": "4aa8bceb3bb4738aef5f0a3f0e9ade21", "score": "0.75677073", "text": "def smallest_integer(list_of_nums)\n\tlist_of_nums.min\nend", "title": "" }, { "docid": "1a7d593a5367991e7b691c61391e8c0d", "score": "0.7565376", "text": "def smallest_integer(list_of_nums)\n min = list_of_nums[0]\n\n list_of_nums.each do |num|\n if num < min\n min = num\n end\n end\n\n return min\n\nend", "title": "" }, { "docid": "e721a491aa7489a85f3176c05f44bef9", "score": "0.7563971", "text": "def my_min_iter(list)\n minimum = nil\n list.each do |num|\n if minimum.nil? || num < minimum\n minimum = num\n end\n end\n minimum\nend", "title": "" }, { "docid": "a2ba808e6ff0401483e3cb8c3d9eac49", "score": "0.75616306", "text": "def my_min_phase2(list)\n min = list.first \n list.each do |el1| #O(n)\n if el1 < min\n min = el1\n end\n end\n min\nend", "title": "" }, { "docid": "91fb2f898138462155531aa014ffb645", "score": "0.75551397", "text": "def my_min_2(array)\n array.inject(0) do |acc,ele|\n acc > ele ? ele : acc\n end\nend", "title": "" }, { "docid": "c00e22477c2d503abcdd9536f8fef462", "score": "0.75541794", "text": "def smallest_integer(list_of_nums)\n return list_of_nums.min\nend", "title": "" }, { "docid": "46c1cbb5f283040d4f5855c8551ce737", "score": "0.7553377", "text": "def find_my_min2(arr)\n arr.inject do |acc, ele| \n if acc < ele\n acc\n else\n ele\n end\n end\nend", "title": "" }, { "docid": "834198df56879c983bcaefcfda5f6537", "score": "0.7552841", "text": "def my_min_2(array)\n min_val = array[0]\n\n array.each_index do |idx|\n array[idx] < min_val ? min_val = arr[idx] : next\n end\n min_val\nend", "title": "" }, { "docid": "7845a74dab7867bb4cdb5729f58353f7", "score": "0.7546209", "text": "def my_min_2(arr)\n min = arr.first\n arr.each do |num|\n min = num if min > num\n end\n min\nend", "title": "" }, { "docid": "1a0b12712962266ef825f6ccc8edd7bd", "score": "0.7542409", "text": "def my_min2(array) #O(n)\n min = array.first\n array.each do |num|\n min = num if num < min\n end\n min\nend", "title": "" }, { "docid": "dbac7876f8bfa09894687eaac6a40ae6", "score": "0.7541835", "text": "def my_min_optimized(list)\n smallest = nil\n list.each do |el|\n smallest = el if smallest.nil? || el < smallest\n end\n smallest\nend", "title": "" }, { "docid": "d41509544025e953fcc345660ae6b025", "score": "0.7539755", "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": "339110d5d63b3d80982a2b48d6defe9b", "score": "0.75357217", "text": "def my_min_2(array)\n my_min = array.first\n (1..array.length-1).each do |i| \n my_min = array[i] if array[i] < my_min\n end\n \n my_min\nend", "title": "" }, { "docid": "a25fc8f4814ff51adc48692998dfe822", "score": "0.75310576", "text": "def my_min_2(arr)\n min = arr.first\n\n arr.each do |el|\n if el < min\n min = el\n end\n end\n\n min\n\nend", "title": "" }, { "docid": "19c05ef28a8b7b22253278f426ac7040", "score": "0.7523798", "text": "def my_min_2(arr)\n\n min = arr.first\n\n arr.each do |el|\n min = el if el < min\n end\n min\n\nend", "title": "" }, { "docid": "bfc40413fb864f3812040d39bc6ab746", "score": "0.75229615", "text": "def my_min(list) # O(n^2)\n min = list.first # 1\n list.each_with_index do |ele_1, i| # n\n list.each_with_index do |ele_2, j| # n\n min = ele_2 if ele_2 < min && j > i # 1\n end\n end\n return min # 1\nend", "title": "" }, { "docid": "f808b5c32f8541a64aca828a61ce0b42", "score": "0.7518949", "text": "def my_min_v1(list)\n list.each do |l|\n flag = true\n list.each do |k|\n flag = false if l > k\n end\n return l if flag == true\n end\nend", "title": "" }, { "docid": "4692315fcd43795513246d0614da664c", "score": "0.751445", "text": "def my_min_1a(list)\n list.each_with_index do |int1, i1|\n min_count = false\n\n list.each_with_index do |int2, i2|\n next if i1 == i2\n min_count = true if int1 > int2\n end\n\n return int1 if min_count == false\n end\nend", "title": "" }, { "docid": "16d97cb78b88c79ec7a581144dbc94f4", "score": "0.7513324", "text": "def my_min_2(arr)\n min = arr.first\n arr.each do |ele|\n min = ele if ele < min \n end \n min \nend", "title": "" }, { "docid": "f24977c9cb946d07dc7c6e9ef4747ce2", "score": "0.75025594", "text": "def my_min1(list)\n # min = list.first \n # list.length.times do |i|\n # el1 = list[i] \n # (i+1...list.length).each do |el2| \n # min = el2 if el2 < el1 \n # end\n # end\n # min\n \n list.each_with_index do |el1, i|\n smallest = true\n list.each_with_index do |el2, j|\n next if i == j\n \n smallest = false if el2 < el1\n end\n return el1 if smallest == true\n end\nend", "title": "" }, { "docid": "fbcc67af6ed25fb155d142ff034ff66b", "score": "0.74996775", "text": "def my_min_two(array)\n min = array[0]\n array.each do |num|\n min = num if num < min\n end\n min\n end", "title": "" }, { "docid": "c011c409662bebf05210f14d25664f8e", "score": "0.74950606", "text": "def smallest_integer(list_of_nums)\n min = list_of_nums[0] #my variable min is equal to the first position in the array\n list_of_nums.each do |num| #iterate over each num in the array\n if num < min #if a given num is less than the first position in the array\n num = min #set num equal to the first position in the array\n end\n end\n \treturn min #return the min value or first position in the array.\n end", "title": "" } ]
6aaff03eeefc3d4d7853d1655c0d8042
use explicit return statement when you have to
[ { "docid": "30bf267986966c0742d4c3c55ef07ad5", "score": "0.0", "text": "def change_my_name\n name = \"John\"\n name.reverse\n return name\nend", "title": "" } ]
[ { "docid": "dd68931a1a7f77eb4fd41ce35988a9bb", "score": "0.80254245", "text": "def returns; end", "title": "" }, { "docid": "5f8a25b50efbe7dbcbbe60f560fdc30e", "score": "0.7418965", "text": "def return_value; end", "title": "" }, { "docid": "cbfd9f8702c76d3c76641c3a542bc91b", "score": "0.72739184", "text": "def method_with_explicit_return\n :a_non_return_value\n return :return_value\n :another_non_return_value\n end", "title": "" }, { "docid": "0f16d380955f7ac7329bd3ba245bce18", "score": "0.7250078", "text": "def return(&block); end", "title": "" }, { "docid": "7f31526357cfa93e2839ac5537db9349", "score": "0.70215803", "text": "def result?; end", "title": "" }, { "docid": "069a040ddabe58818775ebd05b5246e6", "score": "0.68636477", "text": "def return!(&block); end", "title": "" }, { "docid": "509b59dbf2b53df5bb3658b34205bbe1", "score": "0.68261415", "text": "def returns=(_arg0); end", "title": "" }, { "docid": "bf65a49f4705a32f0f5a0085509c0fea", "score": "0.6769525", "text": "def returnsomething\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 18 )\n\n begin\n # at line 613:5: expression\n @state.following.push( TOKENS_FOLLOWING_expression_IN_returnsomething_848 )\n expression\n @state.following.pop\n # --> action\n\n \trt = @stack_operands.pop\n rt_t = @stack_types.pop\n if(rt_t != @current_method.return_type)\n raise \"Invalid return type #{rt_t} in the #{@current_method.return_type} type method #{@current_class.name}::#{@current_method.name}\"\n end\n generate('ret', nil, nil ,rt )\n @is_returning = true\n free_avail(rt)\n free_avail_const(rt)\n \n \n # <-- action\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 18 )\n\n end\n \n return \n end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.67585546", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.67585546", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.67585546", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.67585546", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.67585546", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.67585546", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.67585546", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.67585546", "text": "def result; end", "title": "" }, { "docid": "8e1da4f8611e0e2ba502175237bf1754", "score": "0.67582977", "text": "def returns_something?; @return_type || !@returned_arguments.empty? end", "title": "" }, { "docid": "10ae046a9e605694c5bcaf1d99b2c1a2", "score": "0.6750605", "text": "def return_a_value\n \"Nice\"\nend", "title": "" }, { "docid": "061b4ec068182f551a27612b65c671bb", "score": "0.6719006", "text": "def return_type; end", "title": "" }, { "docid": "061b4ec068182f551a27612b65c671bb", "score": "0.6719006", "text": "def return_type; end", "title": "" }, { "docid": "061b4ec068182f551a27612b65c671bb", "score": "0.6719006", "text": "def return_type; end", "title": "" }, { "docid": "d12fd9b1835870bb9d0cf60a85a7cf3d", "score": "0.6693546", "text": "def return_statement(num)\n puts \"this is before the explicit return...\"\n if num != 1\n return \"yeah you entered something other than 1 !\"\n end\n puts \"this is after explicit return so you must have entered 1!\"\nend", "title": "" }, { "docid": "c226d06808f669b6e06c8731361e21c5", "score": "0.6689532", "text": "def a \n return 1\nend", "title": "" }, { "docid": "d72fff9d18bc0e92c65bc23f36199c99", "score": "0.66823334", "text": "def returns_nil; end", "title": "" }, { "docid": "0307a6466c19ba4993d2628e56f10357", "score": "0.6573301", "text": "def metodo_con_return\n return 2 + 5\nend", "title": "" }, { "docid": "b1b3fa78e5484c765e795017684a0b24", "score": "0.6567347", "text": "def foo\n\treturn 'bar'\nend", "title": "" }, { "docid": "ecc966296ad330be810e6ea96968518f", "score": "0.65333724", "text": "def returns val = nil\n @returns = val\n self\n end", "title": "" }, { "docid": "c6ca8b555b492f316cea865dffc92912", "score": "0.65233386", "text": "def return_10\n return 10\nend", "title": "" }, { "docid": "41ae1a74b2960303ed6a7cd274798b8e", "score": "0.647781", "text": "def myreturn\n @myreturn\n end", "title": "" }, { "docid": "9f0d18f8c499db81f29131777a671190", "score": "0.64499325", "text": "def five\n return 5 # Some people choose to use the return statement just to be clear, \n end", "title": "" }, { "docid": "5886a0842caa1a3a0382d8bb3827f910", "score": "0.6403619", "text": "def result()\n end", "title": "" }, { "docid": "ab16c0cf65b6732ba4028afe7218416b", "score": "0.64026105", "text": "def add(a, b)\n a + b; # 'return' is implicit\nend", "title": "" }, { "docid": "126a9b118b3fb3f9015e3619115b6e27", "score": "0.6401577", "text": "def return_a_value\n name = \"Austin\"\n return name\n name = \"Brian\"\nend", "title": "" }, { "docid": "84410a8d1daca48e2bb51b00a1c43735", "score": "0.63648516", "text": "def returnin_early(early)\n return \"left early\" if early\n \"left late\"\nend", "title": "" }, { "docid": "939c30194d8c973e1fa2d9d0dace7ac1", "score": "0.63577324", "text": "def otherwise\n self\n end", "title": "" }, { "docid": "c3e454ba393b0faf3ad2b2e49190e84a", "score": "0.63198245", "text": "def supports_returning?\n false\n end", "title": "" }, { "docid": "9d66971c4d6b524f4a87e692bf64d1f8", "score": "0.6313406", "text": "def return!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 25 )\n\n type = RETURN\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 327:10: '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__, 25 )\n\n end", "title": "" }, { "docid": "0e3fa84590c32d787e8064806578e921", "score": "0.63090396", "text": "def ret!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 1)\n\n type = RET\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 7:7: 'returns'\n match(\"returns\")\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": "e927a5113f6de6e6a378fc2b2da4f44d", "score": "0.6278915", "text": "def return!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 20 )\n\n type = RETURN\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 141:10: '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__, 20 )\n\n end", "title": "" }, { "docid": "a7e46056aae02404670c78192ffb8f3f", "score": "0.62608176", "text": "def original_result; end", "title": "" }, { "docid": "265b7a1309605155ecaba6d42819711d", "score": "0.624598", "text": "def a\n return true\nend", "title": "" }, { "docid": "509eb312f855345ebf8315d1ba98ad0e", "score": "0.62435424", "text": "def return!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 45 )\n\n\n\n type = RETURN\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 223:9: 'return'\n match( \"return\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 45 )\n\n\n end", "title": "" }, { "docid": "c575c50f4a952bcca9d6cf29aea3cf59", "score": "0.62337446", "text": "def add_explicit_return(x, y)\n return x + y\nend", "title": "" }, { "docid": "b8559b07956fe4ad52ebb5f21a2a9548", "score": "0.6206218", "text": "def maybe; end", "title": "" }, { "docid": "e2a315215845ff2a57b172f1c420885c", "score": "0.62013435", "text": "def return_value=(_arg0); end", "title": "" }, { "docid": "470eee2c4a976f7d1cd6a538a2d25250", "score": "0.62011576", "text": "def returns_nil_bad\n 3 # error: Returning value that does not conform to method result type\n end", "title": "" }, { "docid": "61600a7dde5d6099da98159b930ea804", "score": "0.61824644", "text": "def success?() end", "title": "" }, { "docid": "05bcfa3ca95797d2625eeb08d92b5536", "score": "0.61817116", "text": "def result=(_); end", "title": "" }, { "docid": "f2dfdd98bddcb54d93902799930a0dc7", "score": "0.6148218", "text": "def test_method\n return \"The method will return this string here!\"\n puts \"This line of code will not run.\"\nend", "title": "" }, { "docid": "debc1118c06a15262009b8cbf9dd7fed", "score": "0.6146139", "text": "def print_me\n return \"I'm printing the return value!\"\nend", "title": "" }, { "docid": "f9fb4412192e529927d5a183e0838181", "score": "0.6139291", "text": "def generic_return(code)\n code.call\n return \"generic_return method finished\"\nend", "title": "" }, { "docid": "10d53e012e30109ca8a6bf03a9a2f233", "score": "0.61223257", "text": "def exMethod\r\n # explicitly the last line will be the return\r\n\t# return var is also allowed but this also works\r\n $var\r\nend", "title": "" }, { "docid": "2fa7893344e3ded3ce874bb79262e763", "score": "0.61130154", "text": "def return\n @v_return\n end", "title": "" }, { "docid": "0223f06626f1be8ce92d294f3f0ebbc4", "score": "0.6107973", "text": "def more_than_one\n\treturn 1, 2, 3\nend", "title": "" }, { "docid": "4310cfe3413a793b4fed8b6c3b0f1e08", "score": "0.6092071", "text": "def add(a, b)\n a + b # implicit return\nend", "title": "" }, { "docid": "50bf6e89cd9976060b8ae88e8a60e423", "score": "0.6078136", "text": "def success?(*) end", "title": "" }, { "docid": "23e2d3bf1056f6fe1cae6764c21012fe", "score": "0.60678047", "text": "def returns_from(node); end", "title": "" }, { "docid": "23e2d3bf1056f6fe1cae6764c21012fe", "score": "0.60678047", "text": "def returns_from(node); end", "title": "" }, { "docid": "2392708c77a8651ffcb8d383a7993083", "score": "0.60441124", "text": "def return_value\n @return_value\n end", "title": "" }, { "docid": "d203870f12445d44335bb27ebd68d722", "score": "0.60355395", "text": "def sum(a, b)\n points = 100\n return points # => Never give bottom of 'return'\n a + b + points\n puts \"This is after the expicit return statement\"\nend", "title": "" }, { "docid": "ca3072f6b62639af3cb008ae169a5000", "score": "0.60335565", "text": "def returning(value)\n yield(value)\n value\n end", "title": "" }, { "docid": "98f39dd200d60f107b8670efd6f427ce", "score": "0.6031841", "text": "def meal \n puts 'Dinner'\n return 'Breakfast'\nend", "title": "" }, { "docid": "68a3dd7faf49ea65ce0d5401c9a04f57", "score": "0.60018283", "text": "def result_of_checking; end", "title": "" }, { "docid": "ec52c9ab4783144aff409e86363f0e7b", "score": "0.5995444", "text": "def returnstmt\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 17 )\n\n begin\n # at line 608:4: 'return' ( returnsomething )? ';'\n match( T__43, TOKENS_FOLLOWING_T__43_IN_returnstmt_820 )\n # at line 608:13: ( returnsomething )?\n alt_21 = 2\n look_21_0 = @input.peek( 1 )\n\n if ( look_21_0.between?( IDENTIFIER, INTEGER ) || look_21_0.between?( FLOAT, NULL ) || look_21_0 == T__28 || look_21_0 == T__41 || look_21_0.between?( T__49, T__51 ) )\n alt_21 = 1\n end\n case alt_21\n when 1\n # at line 608:13: returnsomething\n @state.following.push( TOKENS_FOLLOWING_returnsomething_IN_returnstmt_822 )\n returnsomething\n @state.following.pop\n\n end\n match( T__31, TOKENS_FOLLOWING_T__31_IN_returnstmt_825 )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 17 )\n\n end\n \n return \n end", "title": "" }, { "docid": "805b2f1eb417c6a76c9ef1b4078a96ec", "score": "0.5990111", "text": "def return_10\n\t\treturn 10\n\tend", "title": "" }, { "docid": "cae0b6cee58832c46d32b864a66a868a", "score": "0.5978083", "text": "def acceptable_return?(return_val, element_name); end", "title": "" }, { "docid": "d60e5992e6f23f9af5b26476094ed761", "score": "0.5972408", "text": "def meal\n puts 'Dinner'\n return 'Breakfast'\nend", "title": "" }, { "docid": "d60e5992e6f23f9af5b26476094ed761", "score": "0.5972408", "text": "def meal\n puts 'Dinner'\n return 'Breakfast'\nend", "title": "" }, { "docid": "d60e5992e6f23f9af5b26476094ed761", "score": "0.5972408", "text": "def meal\n puts 'Dinner'\n return 'Breakfast'\nend", "title": "" }, { "docid": "d60e5992e6f23f9af5b26476094ed761", "score": "0.5972408", "text": "def meal\n puts 'Dinner'\n return 'Breakfast'\nend", "title": "" }, { "docid": "d60e5992e6f23f9af5b26476094ed761", "score": "0.5972408", "text": "def meal\n puts 'Dinner'\n return 'Breakfast'\nend", "title": "" }, { "docid": "d60e5992e6f23f9af5b26476094ed761", "score": "0.5972408", "text": "def meal\n puts 'Dinner'\n return 'Breakfast'\nend", "title": "" }, { "docid": "d60e5992e6f23f9af5b26476094ed761", "score": "0.5972408", "text": "def meal\n puts 'Dinner'\n return 'Breakfast'\nend", "title": "" }, { "docid": "d60e5992e6f23f9af5b26476094ed761", "score": "0.5972408", "text": "def meal\n puts 'Dinner'\n return 'Breakfast'\nend", "title": "" }, { "docid": "d60e5992e6f23f9af5b26476094ed761", "score": "0.5972408", "text": "def meal\n puts 'Dinner'\n return 'Breakfast'\nend", "title": "" }, { "docid": "d60e5992e6f23f9af5b26476094ed761", "score": "0.5972408", "text": "def meal\n puts 'Dinner'\n return 'Breakfast'\nend", "title": "" }, { "docid": "d60e5992e6f23f9af5b26476094ed761", "score": "0.5972408", "text": "def meal\n puts 'Dinner'\n return 'Breakfast'\nend", "title": "" }, { "docid": "d60e5992e6f23f9af5b26476094ed761", "score": "0.5972408", "text": "def meal\n puts 'Dinner'\n return 'Breakfast'\nend", "title": "" }, { "docid": "d60e5992e6f23f9af5b26476094ed761", "score": "0.5972408", "text": "def meal\n puts 'Dinner'\n return 'Breakfast'\nend", "title": "" }, { "docid": "1cb50211b30ab0d59677608ef00ea6f6", "score": "0.5960429", "text": "def meal\n puts \"Dinner\"\n return \"Breakfast\"\nend", "title": "" }, { "docid": "2326c4187187002de43c8b57ca0e4671", "score": "0.5949873", "text": "def return_block\n yield\nend", "title": "" }, { "docid": "389b3ecd0625efd7639bb9696cac91c6", "score": "0.59414715", "text": "def with_block_returning\n 42.times do |i|\n return i if i > 20\n end.to_s\n#> ---xxxxx\n end", "title": "" }, { "docid": "6eb972203336284325a21641b5a5c3e4", "score": "0.5938807", "text": "def soft_return\n <<-CODE\n t1 = stack_pop();\n cpu_simple_return(state, c, t1);\n CODE\n end", "title": "" }, { "docid": "f4b00b4c87dbccd20d31a6ae79aa5328", "score": "0.59372383", "text": "def maybe\n self\n end", "title": "" }, { "docid": "192d99bcea1cdd0c49c7dbcbe6d804e8", "score": "0.59368265", "text": "def say_hi\n # output \"hi\" to console\n puts \"hi\"\n # return 10 (implicit return)\n 10\nend", "title": "" }, { "docid": "9c1c6314ffc9a462a9ca537988d6aed7", "score": "0.5930958", "text": "def success?; end", "title": "" }, { "docid": "9c1c6314ffc9a462a9ca537988d6aed7", "score": "0.5930958", "text": "def success?; end", "title": "" }, { "docid": "9c1c6314ffc9a462a9ca537988d6aed7", "score": "0.5930958", "text": "def success?; end", "title": "" }, { "docid": "9c1c6314ffc9a462a9ca537988d6aed7", "score": "0.5930958", "text": "def success?; end", "title": "" }, { "docid": "9c1c6314ffc9a462a9ca537988d6aed7", "score": "0.5930958", "text": "def success?; end", "title": "" }, { "docid": "9c1c6314ffc9a462a9ca537988d6aed7", "score": "0.5930958", "text": "def success?; end", "title": "" }, { "docid": "6ec0ad57f97ea6e6b45adeab7a3c710e", "score": "0.5927659", "text": "def multiply(num1, num2)\n puts \"hey you!\"\n return 'I am cool'\n num1 * num2\nend", "title": "" }, { "docid": "b2b04cf723db5c736280aa8ce6538e46", "score": "0.59196806", "text": "def capture_return\n @returns = @code.split(/\\(/).first !~ /void/ \n end", "title": "" }, { "docid": "f978120f620c1ca1eeae9ba7dc496812", "score": "0.5913613", "text": "def my_name() # Start of a function declaration\n return(\"Zoo Lander\") # Explicit return with parenthesis\nend", "title": "" }, { "docid": "a0b32679b71f739de9840096e0167aa1", "score": "0.5897447", "text": "def demonstrate_early_return\n return\n puts \"You will never see this, because we never get here.\"\nend", "title": "" }, { "docid": "b567df89dee42f250660a8289d832027", "score": "0.5894371", "text": "def meal \n return 'Breakfast'\n 'Dinner'\n puts 'Dinner'\nend", "title": "" }, { "docid": "8ca5f60607e4a3eece554886a00e2eda", "score": "0.5891075", "text": "def add_two_numbers(num1, num2)\r\n puts \"OK, I'm solving your math problem!\"\r\n return num1 + num2\r\n #anything after the return keyword will not be evaluated\r\nend", "title": "" }, { "docid": "6603fc47b3e80254b4f17af54199d5a8", "score": "0.5885425", "text": "def cube(num)\n return num * num * num #this is an official return statement\n # after return, it will break and jump out from the method\n # nothing after it wiil be executed\n 8\n puts \"print this line\"\nend", "title": "" }, { "docid": "3ed6c5e0003b97bc4cfcdd6fa832d0ea", "score": "0.58731174", "text": "def make_return_value\n @return_values.compact!\n @return_values.uniq!\n\n if @return_values.empty?\n Sexp.new(:nil)\n elsif @return_values.length == 1\n @return_values.first\n else\n @return_values.reduce do |value, sexp|\n make_or value, sexp\n end\n end\n end", "title": "" }, { "docid": "0bbc081241e929bd0bb182832392a504", "score": "0.5870453", "text": "def return_value(x)\n\tif x > 1\n\t\treturn x\n\telse\n\tend\nend", "title": "" }, { "docid": "cf8abd6a6d2d77008e7d328578e26cbd", "score": "0.58694595", "text": "def process_return(exp)\n return \"return #{process exp.shift}\"\n end", "title": "" } ]
996346535126e40218a7cc94817e0d79
Returns the Redis database file name
[ { "docid": "f0d0507fe488fe8339d3c53492f4f0b5", "score": "0.7608348", "text": "def database\n \"#{ name }.rdb\"\n end", "title": "" } ]
[ { "docid": "d8db4b25fc8b1693e53fdfe78bc5d90d", "score": "0.7666538", "text": "def filepath db_name\n \"#{@path}/#{filename db_name}\"\n end", "title": "" }, { "docid": "a011c8355a676e44937f113719c0441d", "score": "0.7478078", "text": "def filename db_name\n @file || \"#{db_name}_#{Time.now.to_i}.sql\"\n end", "title": "" }, { "docid": "625b6050d6394a52f7fd3cb022bb880c", "score": "0.7005737", "text": "def backup_filename\n \"#{@config[:mariadb][:database]}_#{Time.now.strftime('%Y-%m-%dT%H%M%S')}.sql\"\n end", "title": "" }, { "docid": "698e5b90b483f734657bf4733b682271", "score": "0.68588144", "text": "def db_filename\n return @db_filename unless @db_filename.nil?\n\n path = Pathname.new heap_filename\n @db_filename = File.join(path.dirname, path.basename(path.extname)) + \".sqlite3\"\n end", "title": "" }, { "docid": "44672e3bb66e3c46d2ca075532cb8811", "score": "0.67950153", "text": "def db_name\n result = @uri.path.scan(/^\\/?([-_+%()$a-z0-9]+?)\\/?$/).flatten[0]\n if result != nil\n return Addressable::URI.unencode_component(result)\n else\n raise StandardError, \"Invalid database path: '#{@uri.path}'\"\n end\n end", "title": "" }, { "docid": "104204fc06a1d1f608f449b8b2b50a5c", "score": "0.674392", "text": "def database_name\n @database_name ||= self.connection.execute('select database()').first.first\n end", "title": "" }, { "docid": "e6b2330aa20ace351601e17f22886638", "score": "0.6719568", "text": "def dbfile\n swish_result_property_str @result, \"swishdbfile\" \n end", "title": "" }, { "docid": "6dd494f88914e3fed0e2813cf23dc311", "score": "0.6690388", "text": "def database_name\n (m = /\\/(.*)/.match(URI.parse(uri).path)) && m[1]\n end", "title": "" }, { "docid": "d07499b709509773319e18a78bc4ac41", "score": "0.66891813", "text": "def path\n @backend.db_path(@name)\n end", "title": "" }, { "docid": "dba262b7fb3fd5fb2796065540e7493a", "score": "0.66727674", "text": "def database_name\n self.class.to_s.sub('Backup::', '')\n end", "title": "" }, { "docid": "e842684fdd3a1f0f69519acdabab9137", "score": "0.66515076", "text": "def database_name\n @database_name ||= __database_name__\n end", "title": "" }, { "docid": "62336070b1b32e5d1550496f7450ba3a", "score": "0.6636584", "text": "def db_name\n dump_all? ? '--all-databases' : name\n end", "title": "" }, { "docid": "94a8f6f6e13c2d4e0ce0e1e0f9d705a9", "score": "0.6627621", "text": "def filename\n if (file = @configuration_options[:file])\n if file == :memory\n \":memory:\"\n else\n file\n end\n else\n create_default_database_file\n end\n end", "title": "" }, { "docid": "bfd4b1d6360d9c66d9555231f89a6f8f", "score": "0.6627539", "text": "def db_path(db_name)\n File.join(@path, db_name)\n end", "title": "" }, { "docid": "d9e6e9af00d038911b82524e1b44544d", "score": "0.66228503", "text": "def database_name\n __evaluate__(database_name_option) || client.database.name\n end", "title": "" }, { "docid": "9755e08f7bb51667204c751a6b3173da", "score": "0.662008", "text": "def database_name\n @connection.database_name\n end", "title": "" }, { "docid": "9755e08f7bb51667204c751a6b3173da", "score": "0.662008", "text": "def database_name\n @connection.database_name\n end", "title": "" }, { "docid": "5de8b7afc45c983fd88474ebeb7366db", "score": "0.6612204", "text": "def db_filename(package)\n package['checksum']\n end", "title": "" }, { "docid": "89c125a93f0becd3678945ebdc26ffb3", "score": "0.66088676", "text": "def database_name\n @cluster.db_name\n end", "title": "" }, { "docid": "314eccf52899b92ecbaa6248f739fae1", "score": "0.6603328", "text": "def filename\n @filename ||= \"#{@backup.database}_#{Time.now.strftime('%Y%m%d_%H%M%S')}.tar.gz\"\n end", "title": "" }, { "docid": "6f9540897113ddd195248e3a8fc120d9", "score": "0.6556147", "text": "def dump_filename\n dump_all? ? 'all-databases' : name\n end", "title": "" }, { "docid": "73886bc326cc706089f5e206dcf36360", "score": "0.6524213", "text": "def database_file\n ENV[\"YAML_DATABASE\"]\n end", "title": "" }, { "docid": "955da1a6ef195e200173dccf52b3a31b", "score": "0.6514627", "text": "def db_name\n spec[DB_NAME]\n end", "title": "" }, { "docid": "3fc5137725eee01b06b1ef602c629a5f", "score": "0.6472922", "text": "def database_name\n Sequel::Deprecation.deprecate(\"Database#database_name\", \"Instead, use .get(Sequel.function(:DATABASE))\")\n u = URI.parse(uri.sub(/\\Ajdbc:/, ''))\n (m = /\\/(.*)/.match(u.path)) && m[1]\n end", "title": "" }, { "docid": "037065a0f78343a3a96aa4f30eccda03", "score": "0.6455862", "text": "def database_name; @@database_name; end", "title": "" }, { "docid": "da11b60002279c3c5aee335790f2890a", "score": "0.64529705", "text": "def database_name\n application['database_name']\n end", "title": "" }, { "docid": "812d0344eeb197c5493298261ab2d2c0", "score": "0.64167154", "text": "def db_path\n path = Pathname(csv)\n (path.dirname + (path.basename(\".csv\").to_s + \".db\")).to_s\n end", "title": "" }, { "docid": "b057f4c78c51a46e000d2069ce47eb37", "score": "0.6413512", "text": "def db_file\n \"#{Dir.tmpdir}#{File::SEPARATOR}.fake_consul.m\"\n end", "title": "" }, { "docid": "6cbcc39a194206674c373742cac0e051", "score": "0.64077824", "text": "def database_name\n opts[:database]\n end", "title": "" }, { "docid": "d29534ef939f38b812d00c9256b2862c", "score": "0.6407506", "text": "def public_filename\n full_filename.sub cached_db_file_root, ''\n end", "title": "" }, { "docid": "6b2fd32c47a49d238faa56ad7b536715", "score": "0.63879186", "text": "def cache_path\n \"#{dbm_file_path}.db\"\n end", "title": "" }, { "docid": "c2b5c2567afdb7c4fa5bdb2b8850016f", "score": "0.63847953", "text": "def filename(db_name = T.unsafe(nil)); end", "title": "" }, { "docid": "b1c370dea23552b6c7f4e75e7e1013fe", "score": "0.6373392", "text": "def __database_name__\n if storage_options && name = storage_options[:database]\n name.to_sym\n else\n Mongoid.sessions[__session_name__][:database]\n end\n end", "title": "" }, { "docid": "29e370a648105df0e3d86c202484110c", "score": "0.6271771", "text": "def filename name\n timestamp = Time.now.to_i.to_s << \"_\"\n File.join(DB_MIGRATIONS_DIR, timestamp + name.downcase + '.rb')\n end", "title": "" }, { "docid": "d7033b1a9840e35a20e88f7aee15ce92", "score": "0.6260799", "text": "def file\n File.join(Config.sql_dir, \"#{name}.sql\")\n end", "title": "" }, { "docid": "a4835eeb9bbbc74070eea31a68a06cba", "score": "0.62604094", "text": "def file_name\n file_name = (\"tmp/database_dones/dones_internals/insert_internals-01.txt\")\n end", "title": "" }, { "docid": "b87812d022f4ae696845ccf14641e256", "score": "0.6233039", "text": "def query_db(metric)\n File.expand_path(\"#{dataset.name}.#{metric}.db\", home)\n end", "title": "" }, { "docid": "b87812d022f4ae696845ccf14641e256", "score": "0.6233039", "text": "def query_db(metric)\n File.expand_path(\"#{dataset.name}.#{metric}.db\", home)\n end", "title": "" }, { "docid": "f2f687fdb8a09433e29bff974bc4884d", "score": "0.62212867", "text": "def database_name\n data['apps'][0]['name']\n end", "title": "" }, { "docid": "818cb34af13f81271ab09d1bad8f04c1", "score": "0.6188031", "text": "def dbName\n item = self\n dbNames = Array.new\n while not item.nil?\n dbNames.unshift(item.name)\n item = item.parent\n end\n return dbNames.join(\"::\")\n end", "title": "" }, { "docid": "2473fb8e74d4bceae8c77f7c19209ba4", "score": "0.61876893", "text": "def db_name\n mongo_collection.db.name\n end", "title": "" }, { "docid": "a5d723e8e18804bf30432957614a98e6", "score": "0.6182803", "text": "def database_name\n persistence_context.database_name\n end", "title": "" }, { "docid": "c07e054dac761b9c13cd1af71de85d99", "score": "0.6176031", "text": "def database_dir\n return @cfg_store.server_mode ? SERVER_RSRC_DIR+\"db/\" : dir(:db)\n end", "title": "" }, { "docid": "360d782c4cfad362186b6a7aa2b7c704", "score": "0.61748636", "text": "def db_file\n \"#{Dir.tmpdir}#{File::SEPARATOR}.fake_consul_services.m\"\n end", "title": "" }, { "docid": "974b8c63cb424851a8d28f46a1b4db77", "score": "0.6137493", "text": "def database_name\n @event_data['database_name']\n end", "title": "" }, { "docid": "974b8c63cb424851a8d28f46a1b4db77", "score": "0.6137493", "text": "def database_name\n @event_data['database_name']\n end", "title": "" }, { "docid": "e8dbb1d05204825156c6c963be7e6f6a", "score": "0.61174756", "text": "def file\n TestIds.database_file(id)\n end", "title": "" }, { "docid": "e8dbb1d05204825156c6c963be7e6f6a", "score": "0.6115723", "text": "def file\n TestIds.database_file(id)\n end", "title": "" }, { "docid": "fd641aab497fa5b86788daa78ba815d9", "score": "0.6113246", "text": "def db_file_path\n @db_file_path ||= ::File.join(WebProfiler.config.tmp_dir, \"rack-webprofiler.db\")\n end", "title": "" }, { "docid": "2d013fcb72335be855e74cb027c005dd", "score": "0.6111085", "text": "def dbfiles\n\t\t #todo: make this cleaner\n\t\t Pathname.new(@file.to_s.sub('.db.', '.files.'))\n\t\tend", "title": "" }, { "docid": "770fddc359a5c6a6263fb256860425e2", "score": "0.6102842", "text": "def db_inst_name\n \"#{DbInstance.getname(db_instance_id)} - #{DbName.getname(db_name_id)}\"\n end", "title": "" }, { "docid": "734d132aa66c62d78a19134286b04fe4", "score": "0.61000913", "text": "def database_name\n Sequel::Deprecation.deprecate(\"Database#database_name\", \"Instead, use .get(Sequel.function(:DATABASE))\")\n @opts[:database]\n end", "title": "" }, { "docid": "4f8d2891fcaad2976e5300c0711de0f9", "score": "0.6085895", "text": "def redis_channel_name\n\t\t\t@redis_channel_name ||= \"#{File.basename($0, '.*')}_redis_channel\"\n\t\tend", "title": "" }, { "docid": "8b56b71599591fbed1c5acfdf29dee1a", "score": "0.6085611", "text": "def database_yml_file\n shared_path.join('config/database.yml')\n end", "title": "" }, { "docid": "b2fdf26dcf383b101a8fcec4e245df32", "score": "0.607343", "text": "def db_file_path\n @db_file_path ||= ::File.join(WebProfiler.config.tmp_dir, \"rack-webprofiler.db\")\n end", "title": "" }, { "docid": "5dcabcfec7e6904255b605716680d21e", "score": "0.6044834", "text": "def db\n unless defined?(@db)\n if /Database *\\: *(.*)/m =~ @f0database then\n a = $1.split(/^/)\n a.pop if a.size > 1\n @db = a.collect { |x| x.sub(/\\s+\\z/, '') }.join(' ')\n end\n end #unless\n @db\n end", "title": "" }, { "docid": "03676adce7cdde7bb6f6f2cf54d53c59", "score": "0.60379195", "text": "def filename\n @filename ||= File.basename(Backup::Model.file)\n end", "title": "" }, { "docid": "78ce0505d5e1852308c7628b131078b0", "score": "0.6027688", "text": "def dump_filename\n @dump_filename ||=\n begin\n unless database_id\n if model.databases.select { |d| d.class == self.class }.count > 1\n sleep 1\n @database_id = Time.now.to_i.to_s[-5, 5]\n Logger.warn Error.new(<<-EOS)\n Database Identifier Missing\n When multiple Databases are configured in a single Backup Model\n that have the same class (MySQL, PostgreSQL, etc.), the optional\n +database_id+ must be specified to uniquely identify each instance.\n e.g. database MySQL, :database_id do |db|\n This will result in an output file in your final backup package like:\n databases/MySQL-database_id.sql\n\n Backup has auto-generated an identifier (#{database_id}) for this\n database dump and will now continue.\n EOS\n end\n end\n\n self.class.name.split(\"::\").last +\n (database_id ? \"-#{database_id}\" : \"\")\n end\n end", "title": "" }, { "docid": "a9700d34b6e3c56145570d6c139329b0", "score": "0.60202855", "text": "def database_from_path; end", "title": "" }, { "docid": "503ad89aae07cf9de49df05c8e0304c3", "score": "0.6005843", "text": "def database\n @uri.match(/.*\\/(.*)$/)[1]\n end", "title": "" }, { "docid": "92898e0eb634d367bfdfd0c68c6fd0f0", "score": "0.59956884", "text": "def identity\n @name || \"redis://#{@password}@#{@current_host}:#{@current_port}/#{@db} #{@data_type}:#{@key}\"\n end", "title": "" }, { "docid": "92898e0eb634d367bfdfd0c68c6fd0f0", "score": "0.59956884", "text": "def identity\n @name || \"redis://#{@password}@#{@current_host}:#{@current_port}/#{@db} #{@data_type}:#{@key}\"\n end", "title": "" }, { "docid": "92898e0eb634d367bfdfd0c68c6fd0f0", "score": "0.59956884", "text": "def identity\n @name || \"redis://#{@password}@#{@current_host}:#{@current_port}/#{@db} #{@data_type}:#{@key}\"\n end", "title": "" }, { "docid": "5edbb85ebad7a6552803e78d096b0fec", "score": "0.5995464", "text": "def get_db name\n if db_pool[name].nil?\n db_conf = file[name]\n if db_conf['proxy'].nil?\n db = connect_database db_conf\n else\n db = connect_database_by_proxy db_conf\n end\n db_pool[name] = Database.new(db)\n end\n return db_pool[name]\n end", "title": "" }, { "docid": "229e3935f19f0ae10fa389d3ab7158dc", "score": "0.5984461", "text": "def cached_filename\n raise RuntimeError, \"Can't get cached_filename of a new record, save the record first\" if new_record?\n @cached_filename ||= File.expand_path(File.join(cached_db_file_root, cached_db_file_path, id_path, timestamped_filename))\n end", "title": "" }, { "docid": "027b8262cd09454b71094a26155ce9a8", "score": "0.5972066", "text": "def backup_file db_name\n # Grab the backup file or the latest backup from the backups directory\n backup = @backup || Dir.glob(\"#{@path}/#{db_name}_*.sql\").last\n raise \"Restore failed: backup not found\" unless File.file?(backup.to_s)\n backup\n end", "title": "" }, { "docid": "4c00ea1000b93c14feadc9a40cd64d06", "score": "0.5971673", "text": "def database_name\n EY.metadata.app_name\n end", "title": "" }, { "docid": "08849f780ce902273594fdba709a04b5", "score": "0.5952578", "text": "def database_installation_files_s3_prefix\n data[:database_installation_files_s3_prefix]\n end", "title": "" }, { "docid": "fc42e8bb88bf6f928c8ecff30097d824", "score": "0.5951454", "text": "def data_path\n \"#{config.data_path}/db\"\n end", "title": "" }, { "docid": "d0b201ee92262635f0d8f7264720c654", "score": "0.59511495", "text": "def fileDBConverter(fileName)#Just to make some things a bit simpler in terms of the database.\n\t\treturner=fileName\n\t\tx=File.expand_path($0)\n\t\tx.slice!(__FILE__.split(\"/\")[-1])\n\t\tx.slice!(x.split(\"/\")[-1]+\"/\")\n\t\tunless(returner.slice!(x).nil?)\n\t\t\treturner=\"../\"+returner\n\t\tend\n\t\treturn returner\n\tend", "title": "" }, { "docid": "a357fded5e3a362d39cddf80bab27f93", "score": "0.59475845", "text": "def worker_database\n \"deep_test_worker_#{@worker.number}_pid_#{Process.pid}\" \n end", "title": "" }, { "docid": "c1539c3f183731a8aaaacdbfc1f9ccb4", "score": "0.592734", "text": "def filename\n File.basename(self.key)\n end", "title": "" }, { "docid": "22c0f45ce3bec31df74c122d6b6a17ad", "score": "0.5916296", "text": "def identity\n @name || \"redis://#{@password}@#{@current_host}:#{@current_port}/#{@db} list:#{@key}\"\n end", "title": "" }, { "docid": "8b28cc54e4700bc298dc93835e80d610", "score": "0.5913973", "text": "def filename\n SecureDB.decrypt(filename_secure)\n end", "title": "" }, { "docid": "62a4c24864bf0f9a76d467ec8f56a0ff", "score": "0.5909883", "text": "def to_s\n DATASOURCE_NAME\n end", "title": "" }, { "docid": "62a4c24864bf0f9a76d467ec8f56a0ff", "score": "0.5909883", "text": "def to_s\n DATASOURCE_NAME\n end", "title": "" }, { "docid": "62a4c24864bf0f9a76d467ec8f56a0ff", "score": "0.5909883", "text": "def to_s\n DATASOURCE_NAME\n end", "title": "" }, { "docid": "62a4c24864bf0f9a76d467ec8f56a0ff", "score": "0.5909883", "text": "def to_s\n DATASOURCE_NAME\n end", "title": "" }, { "docid": "62a4c24864bf0f9a76d467ec8f56a0ff", "score": "0.5909883", "text": "def to_s\n DATASOURCE_NAME\n end", "title": "" }, { "docid": "62a4c24864bf0f9a76d467ec8f56a0ff", "score": "0.5909883", "text": "def to_s\n DATASOURCE_NAME\n end", "title": "" }, { "docid": "62a4c24864bf0f9a76d467ec8f56a0ff", "score": "0.5909883", "text": "def to_s\n DATASOURCE_NAME\n end", "title": "" }, { "docid": "62a4c24864bf0f9a76d467ec8f56a0ff", "score": "0.5909883", "text": "def to_s\n DATASOURCE_NAME\n end", "title": "" }, { "docid": "62a4c24864bf0f9a76d467ec8f56a0ff", "score": "0.5909883", "text": "def to_s\n DATASOURCE_NAME\n end", "title": "" }, { "docid": "75e58d1d0063cdda00220a709bea7f8b", "score": "0.59032184", "text": "def database_installation_files_s3_bucket_name\n data[:database_installation_files_s3_bucket_name]\n end", "title": "" }, { "docid": "a0330deca2ca94df4ab7c3734456280b", "score": "0.5897252", "text": "def rsync_name\n RRRSpec.redis.hget(key, 'rsync_name')\n end", "title": "" }, { "docid": "3adfa9735733dd879d0baed0f098127d", "score": "0.58960366", "text": "def filename\n Vips.vips_connection_filename self\n end", "title": "" }, { "docid": "d83ec710a26d255e54e43a2c6994b057", "score": "0.58735096", "text": "def dump_db\n filename = Time.now.strftime(\"#{@backup_dir}/#{@db_name}.%Y%m%d.%H%M%S.sql.gz\")\n mysqldump = `which mysqldump`.to_s.strip\n `#{mysqldump} --host='#{config['dump_host']}' --user='#{config['dump_user']}' --password='#{config['dump_pass']}' '#{@db_name}' | gzip > #{filename}`\n @s3utils.store(filename, config['remote_dir'])\n filename\n end", "title": "" }, { "docid": "50a65f4acfcc2bf48f86d9f77994b3b6", "score": "0.586746", "text": "def fixture_db_name\n if match_data = name.match(/([^:]+)::/)\n match_data[1].to_sym\n else\n :default\n end\n end", "title": "" }, { "docid": "299bbf10e7bce637fdab7b6f4661c80d", "score": "0.5864348", "text": "def redis_key(name)\n \"#{REDIS_KEY_PREFIX}:#{name}\"\n end", "title": "" }, { "docid": "4f09e41ede3d14ab912e1085281fb78b", "score": "0.58605736", "text": "def get_resource_database\n\n unless @resource[:name] =~ /^([^@]+)@(.+)\\/(.+)$/\n raise Puppet::Error, \"Invalid name (user@host/db required)\"\n end\n\treturn $3\n end", "title": "" }, { "docid": "dbbc9fafca6b2e4e07aac9d3fdf5ed84", "score": "0.58475757", "text": "def record_path(db_name, collection_name, filename)\n File.join(@path, db_name, collection_name, 'data', filename)\n end", "title": "" }, { "docid": "1acb62da4d75551b7f03307708d1c975", "score": "0.58336794", "text": "def database_application_name\n return self.class.startup_database_application_name\n end", "title": "" }, { "docid": "f71272e0bdb317be1e43e999895d6d47", "score": "0.583247", "text": "def current_database\n database(current_db_name)\n end", "title": "" }, { "docid": "cc4a47643ed8d24e0983461c77bcd061", "score": "0.582711", "text": "def filename\n # return Log file name\n return \"#{@model.day_id( @time )}.yaml\" if @time\n\n sn = split_name\n file = \"#{sn[0]}_#{sn[-1]}s.yaml\"\n end", "title": "" }, { "docid": "79336b8337b5077fcd7beb3922f2e2e7", "score": "0.5822708", "text": "def identity\n # \"redis://#{@password}@#{@current_host}:#{@current_port}/#{@db} #{@data_type}:#{@key}\"\n 'rethinkdb://TODO'\n end", "title": "" }, { "docid": "078122daad514f7000d015c2efc9714e", "score": "0.58219177", "text": "def table_name\n if @options[:table_name].nil?\n fn = @options[:file_name]\n @options[:table_name] = File.basename(fn).gsub(File.extname(fn), '')\n end\n @options[:table_name]\n end", "title": "" }, { "docid": "bb05106d7e6e5b1a30e6542a2c4376c6", "score": "0.58074397", "text": "def name\n \"Sequel #{@params[:adapter]}:#{@params[:user]}@#{@params[:host]}/#{@params[:database]}\"\n end", "title": "" }, { "docid": "7005d9c442bf8176a6b30beadc1c1f31", "score": "0.5803892", "text": "def db_file( type = configuration.type )\n unless defined? @db_file then\n @db_file = case type\n when \"memory-hash\" then \"*\"\n when \"memory-tree\" then \"+\"\n when \"hash\" then File.join( data_dir, \"#{name}.tch\" )\n when \"tree\" then File.join( data_dir, \"#{name}.tcb\" )\n when \"fixed\" then File.join( data_dir, \"#{name}.tcf\" )\n when \"table\" then File.join( data_dir, \"#{name}.tct\" )\n else\n raise Error, \"Unknown configuration type [#{configuration.type}]\"\n end\n end\n return @db_file\n end", "title": "" }, { "docid": "f620fdef0468a27f8f3cc110af65049d", "score": "0.57984257", "text": "def find_db_file(filename)\n files = find_db_files(filename)\n raise \"Found multiple files matching #{filename}:\\n\\t#{files * \"\\n\\t\"}\" if files.length > 1\n raise \"No file found matching #{filename}\" if files.empty?\n files.first\n end", "title": "" } ]
5e1ea368fbb0046dc42dde2070d9023b
Update quantity of item in order/cart
[ { "docid": "cabb30932daf56c4d9729368efee6f73", "score": "0.0", "text": "def update\n save_update(@order_item)\n end", "title": "" } ]
[ { "docid": "c875d59c840ae54061bcfabf07430322", "score": "0.84870017", "text": "def updateqty\r\n # Assume user is logged in to be viewing cart\r\n # get the product based on the id passed in\r\n product = Product.find(params[:id])\r\n newquantity = params[:newqty].to_i\r\n # get the users current cart\r\n cart = @current_user.cart\r\n \r\n # Find order item in cart\r\n order_items = cart.order_items.select { |item| item.product_id == product.id }\r\n order_item = order_items[0]\r\n \r\n if(order_item) # if it is found\r\n if newquantity > 0\r\n order_item.quantity = newquantity\r\n order_item.save\r\n else\r\n OrderItem.destroy(order_item)\r\n end \r\n end\r\n \r\n # Refresh the cart \r\n cart.order_items.push(order_item)\r\n \r\n # Redirect back to the cart\r\n redirect_to :action =>\"edit\", :id => cart.id\r\n end", "title": "" }, { "docid": "66f0db34ce8ca61c407ab2d10d4782c8", "score": "0.8457737", "text": "def update_quantity\n cart_item = CartItem.find(params[:id])\n category_id = MenuItem.find(cart_item.menu_item_id).menu_category_id\n if params[:act] == \"add\"\n cart_item.temp_price += cart_item.menu_item_price\n cart_item.quantity += 1\n else\n if (cart_item.quantity == 1)\n cart_item.quantity = 1\n else\n cart_item.temp_price -= cart_item.menu_item_price\n cart_item.quantity -= 1\n end\n end\n cart_item.save!\n redirect_to show_menu_items_path(id: category_id)\n end", "title": "" }, { "docid": "41b92cdc495a359a5db82e0426269f63", "score": "0.8436246", "text": "def update_quantity\n cart = Cart.find(cookies[:cart])\n cart.products[params[:idx].to_i]['quantity'] = params[:quantity]\n cart.save\n end", "title": "" }, { "docid": "959ddc6321e7aa673cc05164d39f2ec0", "score": "0.83653075", "text": "def update_quantity(q, i)\n line_item = self.line_items.find_by(item_id: i.id)\n line_item.quantity += q\n line_item.save\n end", "title": "" }, { "docid": "a950b75b8261c29bc44037cec8ffc78f", "score": "0.8310309", "text": "def edit_cart(item_id, quantity: 1)\n quantity = 1 if quantity < 1\n cart_items.find(item_id).update!(quantity: quantity)\n end", "title": "" }, { "docid": "bdb02e28986b0dbc6f0ada675d62de98", "score": "0.8225603", "text": "def update_quantity\n\t\tcart = current_cart\n\t\tcart_item = cart.cart_items.find(params[:cart_item_id])\n\t\t\tif(update_quantity?(cart_item_params , cart_item))\n\t\t\t\tcart_item.update_attributes(cart_item_params)\n\t\t\t\tflash[:notice] = 'Cart Updated'\n\t\t\telse\n\t\t\t\tflash[:error] = 'Cannot Order with quantity higher than the available in stock.'\n\t\t\tend\n\t\tredirect_to :back\n\tend", "title": "" }, { "docid": "79ab7c4b81ba7e38a3fd7d23b6fa0cbe", "score": "0.8194637", "text": "def update_item(item,options)\n cart_item = find_cart_item(item)\n if cart_item\n cart_item.quantity = options[:quantity]\n cart_item.save!\n self.reload\n end\n end", "title": "" }, { "docid": "3c9a6c9fc7bb30067e31ac855582b9d3", "score": "0.81753206", "text": "def update_qty(shopping_list, item, quantity)\n\n\tadd_item(shopping_list, item, quantity)\n\nend", "title": "" }, { "docid": "149ca2269bf28d98ca92f611f955e26c", "score": "0.81686735", "text": "def update\n find_cart\n item = @cart.cart_items.find(params[:cart_item_id])\n if item\n item.update_attributes(:quantity => params[:qty])\n end\n redirect_to cart_path\n end", "title": "" }, { "docid": "0e51d41d2be82dd5d7bb106e39768c74", "score": "0.8133829", "text": "def update_quantity(quantity, item)\n item_id = item.to_i\n line_item = line_items.find_by(item_id: item_id)\n line_item.quantity += quantity\n # Inventory can never be negative\n line_item.quantity = 0 if line_item.quantity.negative?\n line_item.save\n end", "title": "" }, { "docid": "0e51d41d2be82dd5d7bb106e39768c74", "score": "0.81333035", "text": "def update_quantity(quantity, item)\n item_id = item.to_i\n line_item = line_items.find_by(item_id: item_id)\n line_item.quantity += quantity\n # Inventory can never be negative\n line_item.quantity = 0 if line_item.quantity.negative?\n line_item.save\n end", "title": "" }, { "docid": "08c36e141ce64452df1c1263e7a46cdc", "score": "0.80628765", "text": "def update_quantity(q)\n self.quantity=q\n self.save\n end", "title": "" }, { "docid": "2ad6278a1ad75067f577e628fc6e947f", "score": "0.8041969", "text": "def update_cart_item(product_id, item_quantity)\n item_quantity = item_quantity.to_i\n validate_item_in_stock(product_id, item_quantity)\n validate_cart_item(product_id)\n cart_item = cart_items.find_by!(product_id: product_id.to_i)\n cart_item.update!(item_quantity: item_quantity)\n end", "title": "" }, { "docid": "33832774d735c016b48d859c5d99d170", "score": "0.8025092", "text": "def update_quantity_for(object, new_quantity)\n item = item_for(object)\n item.update_quantity(new_quantity) if item\n end", "title": "" }, { "docid": "e00f59aedb6e5130bdfdd6ea8a83d4ed", "score": "0.8004409", "text": "def update_quantity(amount)\n self.quantity = amount\n self.save\n end", "title": "" }, { "docid": "e7d80fc27211377f62e72a979a774a83", "score": "0.8003817", "text": "def update_quantity(quantity)\n @quantity += quantity\n initialize(@product, @quantity)\n end", "title": "" }, { "docid": "ba2f1799c1c805455f1c6dbb8e87e2cc", "score": "0.7998645", "text": "def update_stock(item, quantity)\n @item_list[find(item)][2] += quantity\n end", "title": "" }, { "docid": "2ab6f21c7c8cda20afd3e988da9c1e48", "score": "0.79966295", "text": "def update_cart_item(product_id, item_quantity)\n item_quantity = item_quantity.to_i\n validate_item_in_stock(product_id, item_quantity)\n validate_cart_item(product_id)\n\n cart_item = cart_items.find_by!(product_id: product_id.to_i)\n cart_item.update!(item_quantity: item_quantity)\n end", "title": "" }, { "docid": "526bd20a1ee487c7ddd2f38466ae3e6b", "score": "0.79649055", "text": "def item_update_quantity(target_item_id)\n item_update_qty_link(target_item_id).click\n end", "title": "" }, { "docid": "f2d3dc2ee5b7f5a1f8053de954ad7062", "score": "0.7946902", "text": "def update_quantity_for(new_quantity)\n self.quantity = new_quantity\n self.save\n end", "title": "" }, { "docid": "2be716b4f75a72dcea15f3eea4b2deda", "score": "0.7924452", "text": "def update_quantity\n\t\titem_id = params[:cart_item_id]\n\t\tif (cart_params[:quantity].to_i > temporary_cart[item_id][4])\n\t\t\tflash[:error] = 'Cannot Order with quantity higher than the available in stock.'\n\t\telse\n\t\t\tflash[:notice] = 'Cart Updated'\n\t\t\ttemporary_cart[item_id][1] = cart_params[:quantity]\n\t\tend\n\t\tredirect_to :back\n\tend", "title": "" }, { "docid": "12ab8bb8fa99eb8ada6a178fbda6028b", "score": "0.7924312", "text": "def update_cart_item_quantity\n @cart_item = CartItem.find(params[:cart_item_id])\n\n if params[:type] == \"increase\"\n cart_item.update(quantity: cart_item.quantity + 5)\n cart_item.price = cart_item.quantity * cart_item.unit_price\n cart_item.save\n elsif params[:type] == \"decrease\" && cart_item.quantity != 1\n cart_item.update(quantity: cart_item.quantity - 3)\n cart_item.price = cart_item.quantity * cart_item.unit_price\n cart_item.save\n end\n end", "title": "" }, { "docid": "6f882f7b14cb2d7ba91cb8a2bd521d6e", "score": "0.79017866", "text": "def update_item(item_id, quantity)\n li = line_items.find_by(item_id: item_id)\n li.quantity = quantity\n li.save\n end", "title": "" }, { "docid": "03d31581459a960f32c2b8541d6b05ce", "score": "0.78935874", "text": "def update\n quantity = params[:quantity].to_i\n @item = Item.find(params[:id])\n\n @item.quantity = quantity\n @item.save\n\n render_items_and_discounts\n end", "title": "" }, { "docid": "97a8bea71d43fb6f4ecd5e11dc56919a", "score": "0.7865263", "text": "def update_quantity(new_quantity)\n self.quantity = new_quantity\n save\n end", "title": "" }, { "docid": "0f440c549e11861e33945c097a2b796b", "score": "0.78488714", "text": "def change_quantity(cart_item_id, quantity)\n return remove(cart_item_id) if quantity == 0\n\n cart_item = cart_items.find_by_id(cart_item_id)\n index = cart_items.index(cart_item)\n\n cart_item[:quantity] = quantity\n\n cart_items[index] = cart_item\n cart_item\n end", "title": "" }, { "docid": "99355be0a351d303d39c708270d86acc", "score": "0.7847743", "text": "def update_quantity\n\t\t@user_basket = UserBasket.find(params[:id])\n\t\t@shop_product = ShopProduct.find_by(id: @user_basket.shop_product_id)\n\n\t\t# Calling method updating_quantity_in_user_basket from Model\n\t\tUserBasket.updating_quantity_in_user_basket(@shop_product, @user_basket, flash, user_baskets_params, params)\n\t\tredirect_to edit_user_basket_path\n\tend", "title": "" }, { "docid": "2797a75bc65451e0075c70dd30e4afe1", "score": "0.7828416", "text": "def update_quantity(list_name, item, quantity)\n add_item_and_quantity(list_name, item, quantity)\nend", "title": "" }, { "docid": "d8311df2818f919107b2d43dd54db2a7", "score": "0.782475", "text": "def increment_item\n \titem.pending_orders += quantity\n \titem.save!\n end", "title": "" }, { "docid": "ccd1e39792c6c8f5df2542996fe0f5be", "score": "0.78068566", "text": "def update\n if(params[:intent] == \"quantity\") then\n @qte = @cart_item.quantity + params[:value].to_i\n @cart_item.update(quantity: @qte)\n end\n @cart = Cart.find(@cart_item.cart_id)\n respond_to do |format|\n format.html { }\n format.js { }\n end\n end", "title": "" }, { "docid": "f3d30ce7f11ae282cca44a5b97654894", "score": "0.78065544", "text": "def add_quantity_to_existing_item(item, quantity)\n @relationship = shopping_carts.find_by_item_id(item.id)\n @relationship.quantity += Integer(quantity)\n @relationship.save\n end", "title": "" }, { "docid": "47a4890cc67fa26234b625fc67f144aa", "score": "0.77939546", "text": "def update_inventory\n self.line_items.each do |item|\n update_qty = item.product_size.quantity - item.quantity\n item.product_size.update quantity: update_qty\n end\n end", "title": "" }, { "docid": "c9e13e543f84b0784ed1ae0c5a807079", "score": "0.77610755", "text": "def update_quantity(shopping_list, item_name, qty)\n\tshopping_list[item_name] = qty\nend", "title": "" }, { "docid": "38c51bf2446870d7993148a3559ae170", "score": "0.7741685", "text": "def update\n # Find the product using :product_id param\n @product = Product.find(params[:product_id])\n\n # Find the order-item using a diff parameter of :id\n @order_item = OrderItem.find(params[:id])\n\n # Update the quantity\n @order_item.update(form_params)\n\n flash[:success] = \"Thanks for updating your cart.\"\n\n redirect_to cart_path\n end", "title": "" }, { "docid": "16979a0f3c7786c0763eb59659677acb", "score": "0.76746684", "text": "def update_item\n\n quantity=params[:quantity].to_i\n\n # if the added quantity is less than zero, cancel the operation and notify that it's invalid\n if quantity < 0\n redirect_to items_path, :notice => \"Quantity is not correct\"\n # if the quantity is 0 just remove the item\n elsif quantity == 0\n redirect_to cart_item_remove_path\n else #if the quantity is valid, update the quantity of the item in CartItem database.\n cart_item=current_user.cart.cart_items.where(:item_id => params[:id]).first_or_create\n cart_item.update_quantity(quantity)\n redirect_to carts_path\n end\n end", "title": "" }, { "docid": "43e219fe224960aa7c1f9dcac9eea96f", "score": "0.7666969", "text": "def qty_increment\n @quantity += 1\n end", "title": "" }, { "docid": "c386f2e35a2e7f503fc7ab2c745d5769", "score": "0.76432467", "text": "def update_quantity_line_item\n @line_item.assign_attributes(quantity: @line_item.quantity + @quantity)\n end", "title": "" }, { "docid": "cbc6df930f8fb1157481d691f3a21fc6", "score": "0.7642698", "text": "def update_q(item,quantity)\n\t add_item(item,quantity)\nend", "title": "" }, { "docid": "58c0d6cce4393a35768273d2fd42b500", "score": "0.7639301", "text": "def update_quantity(list,item,quantity)\r\n\tadd_item(list,item,quantity)\r\nend", "title": "" }, { "docid": "1d3f10938445e62c7fdb5235b439a6ea", "score": "0.76271176", "text": "def update_quantity(updated_count)\n # prevent negative quantities from being set\n self.quantity = updated_count if updated_count >= 0\n # Since quantity is an instance variable, the setter method needs us to\n # point at self. Or, we could not add the setter method and point at \n # @quantity.\n end", "title": "" }, { "docid": "6c4ca9a8288fe7c35cb0d7555beacf43", "score": "0.76169187", "text": "def update\n @cart_item = CartItem.find(params[:id])\n #binding.pry\n if params[:qty].present?\n @cart_item.quantity -= 1\n else\n @cart_item.quantity += 1\n end\n respond_to do |format|\n if @cart_item.save\n format.html { redirect_to :back, notice: 'Cart item was successfully updated.' }\n format.json { render :show, status: :ok, location: @cart_item }\n format.js\n else\n format.html { render :edit }\n format.json { render json: @cart_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fbaa3a23ba55d679b73ef261b243592b", "score": "0.7611383", "text": "def update\n begin\n orderitem = Orderitem.find(params[:id])\n if params[:add_to_cart] # From item page - increase # of items in cart\n if params[:add_to_cart][:quantity].to_i <= orderitem.product.stock - orderitem.quantity\n orderitem.update(quantity: orderitem.quantity += params[:add_to_cart][:quantity].to_i)\n flash[:notice] = \"Item added to cart! Total quantity: #{orderitem.quantity}\"\n redirect_to products_show_path(orderitem.product)\n else\n flash[:notice] = \"Sorry, you cannot add that many items to your cart because your cart would exceed available stock. Your cart already contains #{orderitem.quantity} of this item.\"\n redirect_to products_show_path(orderitem.product)\n end\n elsif params[:change_quantity] # From cart page - reset # of items to newly input value\n if params[:change_quantity][:quantity].to_i <= orderitem.product.stock\n orderitem.update(quantity: params[:change_quantity][:quantity].to_i)\n flash[:notice] = \"Quantity updated! Quantity: #{orderitem.quantity}\"\n redirect_to carts_index_path\n else\n flash[:notice] = \"Sorry, you cannot put that many items in your cart because the quantity would exceed available stock.\"\n redirect_to carts_index_path\n end\n end\n rescue ActiveRecord::RecordNotFound\n flash[:notice] = \"Sorry, that item in your order was not updated because it could not be found. Please try again.\"\n if params[:add_to_cart]\n redirect_to categories_index_path\n else\n redirect_to carts_index_path\n end\n end\n end", "title": "" }, { "docid": "6098260544d6250b4facfc27eb1adf6a", "score": "0.7607102", "text": "def update_quantity(list, updated_item, quantity=1)\n\tlist[updated_item] = quantity\nend", "title": "" }, { "docid": "fc597f16cafcc4ac8c83d1c1fd4a4b5a", "score": "0.76037204", "text": "def update_quantity quantity, accessory\n self.quantity = quantity\n self.cart_item_accessory.quantity = quantity unless accessory.blank?\n end", "title": "" }, { "docid": "c9522b3b82b6897d3b72430112ad6b15", "score": "0.7588186", "text": "def update_quantity(item, qty, list)\n\tlist[item] = qty\n\tlist\nend", "title": "" }, { "docid": "4c0719d941f1dcc1cf1209cc55ecefdd", "score": "0.758718", "text": "def update(thing, quantity, options={})\n if thing.is_a?(CartLineItem)\n self.update_cart_line_item(thing, quantity, options)\n else\n self.update_product(thing, quantity, options)\n end\n end", "title": "" }, { "docid": "6af858f7993c04e4098de19a101d0947", "score": "0.7566241", "text": "def update_quantity\n id = params[:id]\n cart = session[:cart]\n qty = \"#{params[:qty]}\".to_i\n \n @item = Item.find(params[:id])\n @qty_instock = @item.quantity_instock\n \n if @qty_instock < qty\n cart[id] = cart[id]\n flash[:error] = \"There are not enough items in stock!\"\n else\n cart[id] = qty\n end\n \n redirect_to :action => :index\n \n end", "title": "" }, { "docid": "c4c8250c08da0e79ddf7710cf0eb0718", "score": "0.75435203", "text": "def increment_quantity\n self.quantity += 1\n end", "title": "" }, { "docid": "a82b1f0286741e0e421b34dcb3423aab", "score": "0.7534743", "text": "def update\n line_item = @order.line_items.where(id: params[:id]).first\n format_response({ success: false, message: \"Item ##{line_item.id} could not be found\" }) and return if line_item.blank?\n\n line_item.quantity = params[:quantity].to_i\n if line_item.save\n format_response({ success: true, message: \"Item ##{line_item.id} has been updated\" }) and return\n else\n format_response({ success: false, message: line_item.errors.full_messages.to_sentence }) and return\n end\n end", "title": "" }, { "docid": "7b0578e385c1f6c5673057e739d6c370", "score": "0.75267124", "text": "def update\n @cart_item = CartItem.find(params[:id])\n @direction = params[:direction]\n @items_change_quantity = params[:quantity]\n\n if @direction==\"+\"\n @cart_item.quantity += @items_change_quantity.to_i\n else #decreasing cart item quantity\n if @cart_item.quantity<=@items_change_quantity.to_i\n @cart_item.destroy\n else # if decreasing cart item quantity NOT to 0\n @cart_item.quantity-=@items_change_quantity.to_i\n end\n end\n @cart_item.save\n \n #refresh cart\n render_cart\n end", "title": "" }, { "docid": "e92c9be5d452c90b4d9a1f05df96da15", "score": "0.75265294", "text": "def update\n @cart = current_cart\n @cart_item = @cart.cart_items.find_by(product_id: params[:id])\n if @cart_item.product.stock >=cart_item_params[:quantity].to_i\n @cart_item.update(cart_item_params)\n flash[:notice] = \"成功变更数量\"\n else\n flash[:warning] = \"数量不足以加入购物车\"\n end\n redirect_to carts_path\n end", "title": "" }, { "docid": "b3175c05530c476d6645fd4607ca6306", "score": "0.7522701", "text": "def update_quantity(list, item, quantity)\r\n add_to_list(list, item, quantity)\r\nend", "title": "" }, { "docid": "8f043cf10191cbe3b4fe0ddc1573b2e4", "score": "0.7514201", "text": "def update_quantity(list, item, quantity)\n list.store(item, quantity)\nend", "title": "" }, { "docid": "2b1914a97a16f9de2d7f4faf6953d211", "score": "0.75102156", "text": "def set_product_quantity qty\n #Debut mobile version\n if (has_selector?(\"button.btn.cart__edit--active\"))\n #Click edit item\n find('button.btn.cart__edit--active',match: :first).click\n #Set quantity\n find('input.cart__qty-input',match: :first,wait: 2).set(qty.to_i)\n #Click update cart\n find(\"input.btn.cart__update-control,button.btn.cart__update-control,input.btn--secondary.cart__update\",match: :first).click\n else\n find(cart_qty_input_selector,match: :first).set(qty.to_i)\n change_page_focus(1)\n end\n\n has_selector?(\"#will_ensure_wait\",wait: 2)\n end", "title": "" }, { "docid": "f7bcc3c4e78d5f1a5a5abd623c734e00", "score": "0.7492512", "text": "def update_stock_on_transaction(item, quantity)\n @item_list[find(item)][2] -= quantity\n end", "title": "" }, { "docid": "ce399393eae18425d582b06cc901b571", "score": "0.7490262", "text": "def adjust(item, qty)\n item = Item.find_by(id: item) unless item.is_a?(Item)\n item.update(qty: qty) if line_items.include?(item)\n end", "title": "" }, { "docid": "12512adda5958dc2a50a870df6b6c7ed", "score": "0.7433642", "text": "def update_quantity(item, quantity)\n\tNew_list[item] = quantity\nend", "title": "" }, { "docid": "1644e5ff40e023cdaf59f54def2c2ee6", "score": "0.74239343", "text": "def update_quantity(list, item, quantity)\n if quantity == 0\n remove_item(list, item)\n else\n list[item] = quantity\n end\nend", "title": "" }, { "docid": "5bcaf9bb9b31d67d8df3a5dfa26ee060", "score": "0.7405652", "text": "def update_quantity_of_an_item(item, items_bought)\n @items[:cellphones][item.to_sym][:quantity] -= items_bought\n end", "title": "" }, { "docid": "1e235b0f406f11815c4555da65f6638e", "score": "0.7396357", "text": "def update_quantity(shopping_list, item_name, qty)\r\n\tshopping_list[item_name] = qty\r\nend", "title": "" }, { "docid": "3db35d55a82bf5bb2c16599abb912189", "score": "0.73841226", "text": "def update_quantity(item,original_list,quantity)\n\toriginal_list[item] = quantity\nend", "title": "" }, { "docid": "2ed7e7ad90521995450aa8269143ecf0", "score": "0.7384002", "text": "def update_quantity(item, grocery_list, quantity)\n\tgrocery_list[item] = quantity\n\tgrocery_list\nend", "title": "" }, { "docid": "e768d5ce1fdd25473aa51bf0173f83f2", "score": "0.738036", "text": "def update\n @order_item = OrderItem.find_by(id: params[:id])\n respond_to do |format|\n if order_quantity_set_to_zero?\n @order_item.destroy\n format.html { redirect_to @order_item.order, notice: 'Item was removed from the order.' }\n else\n @order_item.update(quantity: params[:order_item][:quantity].to_i)\n format.html { redirect_to @order_item.order, notice: 'Order item was successuflly updated.' }\n end\n end\n end", "title": "" }, { "docid": "9944ca8d3642df4705246ec1adf83e41", "score": "0.73800373", "text": "def save\n valid? && @cart[@item.id] = @quantity.to_i\n end", "title": "" }, { "docid": "676ceaf44c50bbb2f63a8ddaf0d91c9c", "score": "0.73781663", "text": "def update_quantity(list, item, quantity)\n add_item(list, item, quantity)\n list\nend", "title": "" }, { "docid": "e18eb217df61df99f9b0a08c0da20d7a", "score": "0.7377408", "text": "def update_quantity(list, item, new_qty)\n list[item] = new_qty\nend", "title": "" }, { "docid": "2fb37fe76b0c11a7a41905a5ac807b05", "score": "0.73771197", "text": "def update_cart(item, quantity = 1, options = {})\n if @storage_engine.include?(item)\n index = @storage_engine.index(item)\n diff = quantity - @storage_engine.at(index).quantity\n \n if diff < 0\n return remove_from_cart(item, -1 * diff, options)\n else\n return add_to_cart(item, diff, options)\n end\n else\n return add_to_cart(item, quantity, options)\n end\n end", "title": "" }, { "docid": "057d2056272b3f60dfc17e151b08da30", "score": "0.73757595", "text": "def update_quantity(item_name, quantity, groc_list)\n\t\tgroc_list[item_name] = quantity\n\t\tgroc_list\n\tend", "title": "" }, { "docid": "8dafe741e6e7b38197b500aec282a71f", "score": "0.73710895", "text": "def update\n quantity = 1\n @cart_item = CartItem.find(params[:id])\n @product = Product.find(params[:product_id])\n \n if params.include?(:quantity)\n current_quantity = params[:quantity].to_i\n previous_quantity = @cart_item.quantity\n quantity = current_quantity - previous_quantity\n end\n \n if params[:qty] == \"minus\" \n @cart_item.quantity -= quantity\n elsif params[:qty] == \"plus\"\n @cart_item.quantity += quantity\n else\n @cart_item.quantity += quantity\n end\n\n respond_to do |format|\n if @cart_item.save\n @cart_sub_total, @shipping_cost1, @tax, @discount, @total = amount(current_customer)\n\n format.html { redirect_to :back, notice: 'Cart item was successfully updated.' }\n format.js\n format.json { render :back, status: :ok, location: @cart_item }\n else\n format.html { render :back }\n format.json { render json: @cart_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e2b1fb39923285fa4fa03c923a835a14", "score": "0.73570895", "text": "def update_item_quantity!(list, item, quantity=0)\n# steps: list and then index into the item name = quantity\n add_item!(list, item, quantity) \n# output:\nend", "title": "" }, { "docid": "2bb634d8651a96d7414be0324f22e4b0", "score": "0.7356661", "text": "def quantity= num\n update_quantity num\n end", "title": "" }, { "docid": "60068f0f289176a384f1c3fd373ac1fa", "score": "0.73461646", "text": "def update\n @line_item.quantity = params[:quantity]\n @line_item.save\n render json: @line_item\n end", "title": "" }, { "docid": "60e2dcc023204a033fc1fc50c6d3deb3", "score": "0.73449326", "text": "def update_item_quantity(item, new_quantity)\n\titem_removed_hash = remove_item(\"cereal\")\n\titem_removed_hash[item] = new_quantity\n\tupdate_quantity_hash = item_removed_hash\nend", "title": "" }, { "docid": "ce4d8dfc014fb7b97b4f39e054a12a65", "score": "0.7343163", "text": "def update\n @cart = current_cart\n to_add = Integer(params[:to_add])\n product = Product.find(params[:product_id])\n @removed = false;\n\n if( to_add > 0 )\n @cart.add_product(product.id, to_add)\n elsif( to_add == 0 )\n logger.error \"Unexpected quantity to add\"\n else\n @removed = @cart.remove_product(product.id, -to_add)\n end\n\n respond_to do |format|\n format.html { redirect_to store_path, notice: \"changed quantity of #{params[:pr_title]}\" }\n @removed ? format.js : format.js{ @current_item = LineItem.find(params[:id]) }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "25664d9494f5189b27b0383c5af9af8a", "score": "0.73431605", "text": "def remove\n order_item_id = params[:order_item].to_i\n order_item = OrderItem.find_by(id: order_item_id)\n order_item.product.quantity += order_item.quantity\n order_item.product.save\n order_item.destroy\n redirect_to cart_path\n end", "title": "" }, { "docid": "65b19b67a01fe2ec53f27d3cacb46091", "score": "0.73398244", "text": "def update_quantity(shopping_cart, item, quantity)\n shopping_cart[item] = quantity \n return shopping_cart\nend", "title": "" }, { "docid": "893fac6f2a3605c0aa7618877e1ff472", "score": "0.73293984", "text": "def add_item\n product_id = params[:product_id].to_s\n\n item = cart[product_id] || { \"quantity\" => 0 }\n item[\"quantity\"] += 1\n cart[product_id] = item\n update_cart cart\n\n redirect_to :back\n end", "title": "" }, { "docid": "785ad73d351659e1146cc91540636b4c", "score": "0.7323974", "text": "def UpdateQtyOfItem(itemName, quantity)\n inventory = @@db_instant.GetAllInventoryItemsByFilters(itemName)\n bExist = false\n inventory.each do |row|\n itemID = row[\"item_id\"]\n item_qty = row[\"quantity\"]\n if item_qty < quantity\n puts \"#{itemName} is not in stock. Max avaialable pieces: #{item_qty}\"\n else\n #Item is avaialable in stock, add to the baseket\n @@db_instant.AddOrUpdateItemToCart(itemID, quantity)\n totalPrice = quantity * row[\"price\"]\n puts \"#{itemName}\\tadded to the cart\\t(#{quantity} piece(s)).\\tTotal Price: #{totalPrice}\"\n end\n\n if !bExist\n bExist = true\n end\n end\n if !bExist\n puts \"Product with name #{itemName} doesnot exist. Perhaps add it to Inventory first?\"\n end\n end", "title": "" }, { "docid": "6a341382c40d47d721ad97a99a985b28", "score": "0.731103", "text": "def update(values)\n self.quantity = values[:quantity]\n end", "title": "" }, { "docid": "9df77e909babf99582c29a3b748911a6", "score": "0.7293313", "text": "def update\n user_item = UserItem.find(params[:id])\n user_item.update(quantity: user_item_params[:quantity])\n render json: user_item\n end", "title": "" }, { "docid": "e6815221d6b606b7049975a206fd16a3", "score": "0.7289949", "text": "def update\r\n\t\t@cart = find_cart\r\n\t\tif params[:qty]\r\n\t\t\tparams[:qty].each_pair do |i, q|\r\n\t\t\t\tif q.match(/^[0-9]+$/)\r\n\t\t\t\t\[email protected][i.to_i].quantity = q.to_i\r\n\t\t\t\tend\r\n\t\t\tend\r\n\t\tend\r\n\r\n\t\tif params[:option]\r\n\t\t\tparams[:option].each_pair do |item_i, option|\r\n\t\t\t\[email protected][item_i.to_i].clear_options\r\n\r\n\t\t\t\toption.each_pair do |option_i, option_value|\r\n\t\t\t\t\to_v = OptionValue.find(option_value.to_i)\r\n\t\t\t\t\[email protected][item_i.to_i].set_option(o_v)\r\n\t\t\t\tend\r\n\t\t\tend\r\n\t\tend\r\n\r\n\t\tif params[:delete] && params[:select]\r\n\t\t\tparams[:select].keys.each do |k|\r\n\t\t\t\[email protected][k.to_i].quantity = 0\r\n\t\t\tend\r\n\t\tend\r\n\r\n\t\[email protected]_product(@cart.items.select { |i| i.quantity.zero? })\r\n\r\n\t\tif params[:checkout]\r\n\t\t\tredirect_to :action => :checkout\r\n\t\telse\r\n\t\t\tredirect_to :action => :show\r\n\t\tend\r\n\tend", "title": "" }, { "docid": "b719e85d6cd013e4381a1d0dc9e56694", "score": "0.7280144", "text": "def update\n\n quantity, @cart_sub_total = 1,0\n @cart_item = CartItem.find(params[:id])\n @product = Product.find(params[:product_id])\n \n if params.include?(:quantity)\n qty = params[:quantity].to_i\n qty1 = @cart_item.quantity\n quantity = qty - qty1\n end\n \n if params[:qty] == \"minus\" \n \n if @cart_item.quantity > 1\n @cart_item.quantity -= quantity\n @product.quantity += quantity\n end\n\n elsif params[:qty] == \"plus\"\n \n if @product.quantity > 0\n @cart_item.quantity += quantity\n @product.quantity -= quantity\n end\n\n else\n \n if quantity > 0\n \n if @product.quantity >= quantity\n @cart_item.quantity = @cart_item.quantity + quantity\n @product.quantity -= quantity\n end\n\n else \n @cart_item.quantity += quantity\n @product.quantity -= quantity\n end\n\n end\n\n respond_to do |format|\n if @cart_item.save\n @product.save\n @cart_items = CartItem.where(customer_id: current_customer.id)\n\n @cart_items.each do |item|\n @cart_sub_total += item.quantity*item.product.price\n end\n\n @tax = (@cart_sub_total*7.5)/100\n format.html { redirect_to :back, notice: 'Cart item was successfully updated.' }\n format.js { }\n format.json { render :show, status: :ok, location: @cart_item }\n else\n format.html { render :edit }\n format.json { render json: @cart_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e3d67beeece5cd8dbf2f976e4588ce93", "score": "0.7273672", "text": "def update\n respond_to do |format|\n if @purchase_order.update(purchase_order_params)\n @purchase_order.quantities.each do |quantity|\n ## fix amount fields\n quantity.amount_received = 0\n quantity.amount_remaining = quantity.amount\n quantity.save\n ### end fix amount fields\n @item = Item.find(quantity.item_id)\n if @item.on_order_qty.nil?\n @item.on_order_qty = 0\n @item.save\n end\n @item.on_order_qty += quantity.amount\n @item.save\n end\n format.html { redirect_to @purchase_order, notice: 'Purchase order was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @purchase_order.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f0170334bbde63f8a8ecaf749c404add", "score": "0.72707164", "text": "def update_quantity(quantity)\n subscription.guard_against_incomplete\n\n stripe_subscription_item = as_stripe_subscription_item\n stripe_subscription_item.quantity = quantity\n stripe_subscription_item.payment_behavior = payment_behavior\n stripe_subscription_item.proration_behavior = proration_behavior\n stripe_subscription_item.save\n\n update(quantity: quantity)\n\n subscription.update(quantity: quantity) if subscription.single_plan?\n\n self\n end", "title": "" }, { "docid": "d2bc0dd141df33140a8954da5b4ffa98", "score": "0.7266536", "text": "def update\n cart_item = CartItem.find(params[:id])\n if cart_item.update(edit_item_amount_params)\n redirect_to cart_items_path\n end\n end", "title": "" }, { "docid": "21f01df0b52f61aff815168e2c02513d", "score": "0.72596073", "text": "def update\n @cart_total = 0\n @product = Product.find(params[:product_id])\n @cart_item = CartItem.find(params[:id])\n if params[:quantity_update] == \"plus\" && @product.quantity > 0\n @cart_item.quantity +=1\n elsif params[:quantity_update] == \"minus\" && @cart_item.quantity > 1\n @cart_item.quantity -=1\n elsif params[:quantity].present?\n @cart_item.quantity = params[:quantity].to_i\n end\n respond_to do |format|\n if @cart_item.save\n # method called cart_sum for cart total\n cart_sum\n @update_msg = 'Item successfully updated.'\n format.html { redirect_to :back, notice: 'Item successfully updated.' }\n format.json { render :show, status: :ok, location: @cart_item }\n format.js \n else\n format.html { render :edit }\n format.json { render json: @cart_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1691f5383a27e88f9e455f00e216e633", "score": "0.72590166", "text": "def update_quantity(items_list, item, quantity)\r\n\tif items_list.key?(item)\r\n\t\titems_list[item] = quantity\r\n\tend\r\nend", "title": "" }, { "docid": "986be5d60b00b909d4d1bcdfa4379701", "score": "0.7258522", "text": "def change_qty(new_qty)\n \told_qty = self.qty\n \tself.qty = new_qty\n \tself.product.qty_in_stock = self.product.qty_in_stock + old_qty - new_qty\n \tself.save\n \tself.product.save\n end", "title": "" }, { "docid": "3c1947470a88a78f4ba7d456fe8a36ad", "score": "0.72569764", "text": "def update_quantity(item, quant)\n @grocery_hash[item] = quant\nend", "title": "" }, { "docid": "784f53c554d6cbf37ed8d7e02ff173c4", "score": "0.7256148", "text": "def add_quantity(q)\n self.quantity+=q\n self.save\n end", "title": "" }, { "docid": "9b45c5c0e6cdd71d910af5c544e0bb9e", "score": "0.7255486", "text": "def increase_quantity\n @products[selection_for_in_out].increment(in_new[:in_out_qty])\n write_product\n end", "title": "" }, { "docid": "6f1df82d24f05d23c2f3bfc926d270cc", "score": "0.72522527", "text": "def update_quantity(grocery_list,item_name,quantity)\n\t \n\t grocery_list[item_name] = quantity\n\nend", "title": "" }, { "docid": "dd08a39d02eea0e83a2b26ed6828e544", "score": "0.72477543", "text": "def update_quantity(list, item, quantity)\n\tlist[item] = quantity\n\tlist\nend", "title": "" }, { "docid": "0a58f8079b699c51fd6bafd73b65116f", "score": "0.7242801", "text": "def update_item(item, quantity = 1, &block)\n if quantity == 0\n delete_item(item, &block)\n else\n add_item(item, quantity, quantity_change: :update, &block)\n end\n end", "title": "" }, { "docid": "c33ef33a5679cf3d7c00aecc0318355d", "score": "0.72257584", "text": "def update_quantity(item,quantity)\r\n $grocery_list.store(item,quantity)\r\n puts \" You have added #{quantity} #{item} to your grocery list \"\r\n \r\nend", "title": "" }, { "docid": "24b3bb356df252a995b57d0cb8730f15", "score": "0.72252595", "text": "def update_quantity(list, item, quantity)\n\tlist[item] = quantity\nend", "title": "" }, { "docid": "24b3bb356df252a995b57d0cb8730f15", "score": "0.72252595", "text": "def update_quantity(list, item, quantity)\n\tlist[item] = quantity\nend", "title": "" }, { "docid": "c2c1ba8ed891ebd3588dcc0a5ed82e19", "score": "0.722258", "text": "def update_quantity(item_hash, quantity_to_add)\n item_hash[\"quantity\"] += quantity_to_add\n return item_hash\nend", "title": "" }, { "docid": "13862e036ff3875c897ccd1504298710", "score": "0.7219122", "text": "def update_quantity(list, item, updated_quantity=1)\r\n\tlist[item] = updated_quantity\r\n\tlist\r\nend", "title": "" }, { "docid": "3726440c2a360769ffb6d6c9950b4401", "score": "0.72171456", "text": "def update_item(cart, item, quantity)\n cart[item] = quantity\n puts \"Ok, updated #{item} to #{quantity}\"\n cart\nend", "title": "" }, { "docid": "106833f4c3b85919cd49ac9af782680a", "score": "0.7214378", "text": "def quantity_update(grocery_list, item, new_quantity)\n\tgrocery_list[item] = new_quantity\n\tgrocery_list\nend", "title": "" } ]
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "7f583de77ad96f3e5dfbf54ab4477375", "score": "0.0", "text": "def browsertype_params\n params.require(:browsertype).permit(:browser, :device_type, :remote, :human_name, :active)\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": "" } ]
8d8a2af37d0d6de308db6afbd4ade598
Add a white list of extensions which are allowed to be uploaded.
[ { "docid": "bb3ddec98a824d97bb8752bd94c3776b", "score": "0.0", "text": "def extension_white_list\n %w(jpg jpeg gif png)\n end", "title": "" } ]
[ { "docid": "dedd34d73a25e418139b8cd2116fb452", "score": "0.78198254", "text": "def extension_whitelist\n ['jpg', 'jpeg', 'gif', 'png']\n end", "title": "" }, { "docid": "95059183f635e6d4c51d4dd70d9ee8c3", "score": "0.7744172", "text": "def extension_white_list\n allowed_types = if model.image?\n %w(jpg jpeg png)\n elsif model.video?\n %w(mp4 m4v mov)\n elsif model.document?\n %w(pdf)\n end\n\n ExtensionWhiteList.new allowed_types if allowed_types.present?\n end", "title": "" }, { "docid": "cc70b01df8525b98443b8cd6a355cfb6", "score": "0.76881593", "text": "def extension_whitelist\n %w[jpg jpeg gif png svg mp3 mp4 m4v ogg webm pdf css js zip]\n end", "title": "" }, { "docid": "40a7399e920801aa4963aabc5543d316", "score": "0.76694924", "text": "def extension_white_list\n %w(jpg jpeg gif png) # Gives error message on webpage if upload a different filetype.\n end", "title": "" }, { "docid": "732dd1ce0f26891c7577a7b46da86cb7", "score": "0.7628144", "text": "def extension_whitelist\n %w[jpg jpeg png svg 3gp mp4 wmv rmvb]\n end", "title": "" }, { "docid": "63ed8fe5bf45f4eb3f91c81ddd1b5a63", "score": "0.76131314", "text": "def extension_whitelist\n %w(jpg jpeg gif png).push('')\n end", "title": "" }, { "docid": "fb7758e49d741eaf8ebc218908a3e461", "score": "0.7587462", "text": "def extension_whitelist\n %w[jpg pdf csv]\n end", "title": "" }, { "docid": "63f4bb53f6a1bd7cebf5fad2c31590ce", "score": "0.7565395", "text": "def extension_whitelist\n %w[jpg jpeg gif png pdf jp2 jpeg2 tiff]\n end", "title": "" }, { "docid": "550029d03f5836b648c9189e7fdb5aed", "score": "0.75528187", "text": "def extension_whitelist\n %w(JPG jpg jpeg gif png)\n end", "title": "" }, { "docid": "02795d857fa79476f606534175986f09", "score": "0.7531304", "text": "def extension_whitelist\n\t\t%w(jpg jpeg gif png)\n\tend", "title": "" }, { "docid": "02795d857fa79476f606534175986f09", "score": "0.7531304", "text": "def extension_whitelist\n\t\t%w(jpg jpeg gif png)\n\tend", "title": "" }, { "docid": "26a0e743f2ac38e0ba494825cd54ee4c", "score": "0.7494953", "text": "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "title": "" }, { "docid": "26a0e743f2ac38e0ba494825cd54ee4c", "score": "0.7494953", "text": "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "title": "" }, { "docid": "8d74b6ed6b957973e63e12a7eff8153d", "score": "0.748765", "text": "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "title": "" }, { "docid": "8d74b6ed6b957973e63e12a7eff8153d", "score": "0.7487196", "text": "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "title": "" }, { "docid": "8d74b6ed6b957973e63e12a7eff8153d", "score": "0.7487196", "text": "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "title": "" }, { "docid": "8d74b6ed6b957973e63e12a7eff8153d", "score": "0.7487196", "text": "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "title": "" }, { "docid": "8d74b6ed6b957973e63e12a7eff8153d", "score": "0.7487196", "text": "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "title": "" }, { "docid": "8d74b6ed6b957973e63e12a7eff8153d", "score": "0.7487196", "text": "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "title": "" }, { "docid": "8d74b6ed6b957973e63e12a7eff8153d", "score": "0.7487196", "text": "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "title": "" }, { "docid": "8d74b6ed6b957973e63e12a7eff8153d", "score": "0.7487196", "text": "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "title": "" }, { "docid": "8d74b6ed6b957973e63e12a7eff8153d", "score": "0.7487196", "text": "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "title": "" }, { "docid": "8d74b6ed6b957973e63e12a7eff8153d", "score": "0.7487196", "text": "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "title": "" }, { "docid": "8d74b6ed6b957973e63e12a7eff8153d", "score": "0.7487196", "text": "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "title": "" }, { "docid": "8d74b6ed6b957973e63e12a7eff8153d", "score": "0.7487196", "text": "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "title": "" }, { "docid": "8d74b6ed6b957973e63e12a7eff8153d", "score": "0.7487196", "text": "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "title": "" }, { "docid": "8d74b6ed6b957973e63e12a7eff8153d", "score": "0.7487196", "text": "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "title": "" }, { "docid": "8d74b6ed6b957973e63e12a7eff8153d", "score": "0.7487196", "text": "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "title": "" }, { "docid": "8d74b6ed6b957973e63e12a7eff8153d", "score": "0.7487196", "text": "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "title": "" }, { "docid": "8d74b6ed6b957973e63e12a7eff8153d", "score": "0.7487196", "text": "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "title": "" }, { "docid": "8d74b6ed6b957973e63e12a7eff8153d", "score": "0.7487196", "text": "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "title": "" }, { "docid": "8d74b6ed6b957973e63e12a7eff8153d", "score": "0.7487196", "text": "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "title": "" }, { "docid": "8d74b6ed6b957973e63e12a7eff8153d", "score": "0.7487196", "text": "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "title": "" }, { "docid": "45bb1270f46383e88029da828116a803", "score": "0.74853015", "text": "def extension_whitelist\n %w[jpg jpeg gif png]\n end", "title": "" }, { "docid": "45bb1270f46383e88029da828116a803", "score": "0.74853015", "text": "def extension_whitelist\n %w[jpg jpeg gif png]\n end", "title": "" }, { "docid": "45bb1270f46383e88029da828116a803", "score": "0.74853015", "text": "def extension_whitelist\n %w[jpg jpeg gif png]\n end", "title": "" }, { "docid": "45bb1270f46383e88029da828116a803", "score": "0.74853015", "text": "def extension_whitelist\n %w[jpg jpeg gif png]\n end", "title": "" }, { "docid": "45bb1270f46383e88029da828116a803", "score": "0.74853015", "text": "def extension_whitelist\n %w[jpg jpeg gif png]\n end", "title": "" }, { "docid": "2a214ea8a339764d075a8b00df308bd6", "score": "0.7468734", "text": "def extension_whitelist\n %w[jpg jpeg]\n end", "title": "" }, { "docid": "4b1c6f63a7636ed1a718d7c03fe517f2", "score": "0.7466417", "text": "def extension_whitelist\n %w(jpg jpeg gif png)\n end", "title": "" }, { "docid": "c24d4e279be3f911b51449620ce999bb", "score": "0.7456481", "text": "def extension_whitelist\n %w[jpg jpeg png]\n end", "title": "" }, { "docid": "ea44626ebd88b8eeb005711adeb6b046", "score": "0.74479824", "text": "def valid_file_extensions\n # This uses the list of the content_type_allowlist and alias_content_type to translate it into texts.\n # @see locales/defaults/en.yml to learn about where this is getting the translated texts from, which is\n # used as the allow list of suffixes for file uploads.\n valid_content_types.map { |name| \".#{I18n.t(\"label_#{name}\")}\" }\n end", "title": "" }, { "docid": "88eb47e5c112f9133d6433d00b3f3e57", "score": "0.74473137", "text": "def extension_whitelist\n %w(jpg jpeg png)\n end", "title": "" }, { "docid": "88eb47e5c112f9133d6433d00b3f3e57", "score": "0.74473137", "text": "def extension_whitelist\n %w(jpg jpeg png)\n end", "title": "" }, { "docid": "88eb47e5c112f9133d6433d00b3f3e57", "score": "0.74473137", "text": "def extension_whitelist\n %w(jpg jpeg png)\n end", "title": "" }, { "docid": "88eb47e5c112f9133d6433d00b3f3e57", "score": "0.74473137", "text": "def extension_whitelist\n %w(jpg jpeg png)\n end", "title": "" }, { "docid": "592d2a9010795613a11a5283a2fb6caa", "score": "0.7425423", "text": "def extension_whitelist\n %w(jpg)\n end", "title": "" }, { "docid": "a1057765ed425b5b4d6937cdb40971a0", "score": "0.7416863", "text": "def extension_whitelist\n %w(jpg jpeg png doc docx pdf xls xml )\n end", "title": "" }, { "docid": "f390c5d8bd6fd2febcbe4ed02ac9f311", "score": "0.7382878", "text": "def extension_whitelist\n %w(jpg gif png)\n end", "title": "" }, { "docid": "991304e4a27816f0b8612e3b03995314", "score": "0.7369532", "text": "def extension_white_list\n ['jpg', 'jpeg', 'gif', 'png', '']\n end", "title": "" }, { "docid": "8c93d2d31367812836c971fde3d21f76", "score": "0.7356552", "text": "def extension_white_list\n EXTENSIONS\n end", "title": "" }, { "docid": "e6627fe07158e2dd6f283ec7b53954e7", "score": "0.7334725", "text": "def extension_white_list\n [\"jpg\", \"jpeg\", \"gif\", \"png\", \"ico\"]\n end", "title": "" }, { "docid": "8ff21d5b7bd9b0acb06375fca0b60f91", "score": "0.73302203", "text": "def extension_whitelist\n %w[png jpg jpeg gif svg mp3]\n end", "title": "" }, { "docid": "daa7cf8823cc962f098e548f6c6812a7", "score": "0.73187584", "text": "def extension_white_list\n %w(gif jpg jpeg png tif) #allowed avatar filetypes\n end", "title": "" }, { "docid": "fdbaf1c847107fa456a331a45aa30d6a", "score": "0.7313423", "text": "def extension_allowlist\n %w[jpg jpeg gif png webp avif]\n end", "title": "" }, { "docid": "33e284c3bdc81852301f812f8b223ac5", "score": "0.73085546", "text": "def extension_whitelist\n %w(jpg png)\n end", "title": "" }, { "docid": "366ee3e77bb8fe1a9a248c09c86f729a", "score": "0.73060787", "text": "def extension_whitelist\n %w[jpg jpeg png svg svgz]\n end", "title": "" }, { "docid": "366ee3e77bb8fe1a9a248c09c86f729a", "score": "0.73060787", "text": "def extension_whitelist\n %w[jpg jpeg png svg svgz]\n end", "title": "" }, { "docid": "25ef660c95c90983df3efc660c4fc211", "score": "0.72961813", "text": "def extension_white_list\n\n # TODO: Use a conditional for whitelisting:\n #if category type is image:\n # %w(jpg jpeg gif png pdf)\n # elsif category type is video:\n # %w(mp4 flv webm)\n # elsif category type is docs:\n # %w(pdf docx)\n\n %w(jpg jpeg gif png pdf mov mp3 mp4 webm avi)\n end", "title": "" }, { "docid": "ace82cd3044457824caa7a931087c5e9", "score": "0.72896045", "text": "def extension_whitelist\n %w[png jpg jpeg]\n end", "title": "" }, { "docid": "ace82cd3044457824caa7a931087c5e9", "score": "0.72896045", "text": "def extension_whitelist\n %w[png jpg jpeg]\n end", "title": "" }, { "docid": "ace82cd3044457824caa7a931087c5e9", "score": "0.72896045", "text": "def extension_whitelist\n %w[png jpg jpeg]\n end", "title": "" }, { "docid": "4c2e067463777026ef29463473824880", "score": "0.72778744", "text": "def extension_whitelist\n %w[gif jpg jpeg png]\n end", "title": "" }, { "docid": "c415b041b6883a240af708c0d1966e7e", "score": "0.7246854", "text": "def extension_white_list\n model.skip_extension_check ? nil : %w(jpg jpeg gif png)\n end", "title": "" }, { "docid": "4b5b57c51930ed734433bf0962499d25", "score": "0.7245175", "text": "def extension_whitelist\n %w[jpg jpeg gif png pdf doc docx]\n end", "title": "" }, { "docid": "9b1e2dabf89af27bff5e3785e2290475", "score": "0.72145736", "text": "def extension_allowlist\n %w(jpg jpeg gif png)\n end", "title": "" }, { "docid": "5f72b8cf4010a671a4756fc310906edc", "score": "0.72069836", "text": "def extension_white_list\n %w(\n jpg jpeg gif png\n txt csv\n wav mp3\n )\n end", "title": "" }, { "docid": "42741cedc7e24fb607cd261cf6a9b1b4", "score": "0.7188717", "text": "def extension_white_list\n %w(jpg jpeg gif png mp4)\n end", "title": "" }, { "docid": "42741cedc7e24fb607cd261cf6a9b1b4", "score": "0.71876323", "text": "def extension_white_list\n %w(jpg jpeg gif png mp4)\n end", "title": "" }, { "docid": "98336266e3c35b615b86e5a7b1db557e", "score": "0.7186141", "text": "def extension_white_list\n %w(jpg JPG jpeg JPEG gif GIF png PNG)\n end", "title": "" }, { "docid": "1410befd21ff9523e9762738399c0d45", "score": "0.7180965", "text": "def extension_white_list\n %w(fa fasta fq fastq gz tar.gz)\n end", "title": "" }, { "docid": "7c42ca10c8336dc8afe59bbe712a0980", "score": "0.71732837", "text": "def extension_white_list\n %w(jpg jpeg gif png jpg_or_png)\n end", "title": "" }, { "docid": "7076ab8811d3d9b69133ce15ba5d5d4a", "score": "0.71468896", "text": "def extension_white_list\n %w(jpg jpeg gif png)\n end", "title": "" }, { "docid": "7076ab8811d3d9b69133ce15ba5d5d4a", "score": "0.71468896", "text": "def extension_white_list\n %w(jpg jpeg gif png)\n end", "title": "" }, { "docid": "86064af647560a732fa6bade9329a7be", "score": "0.7146662", "text": "def extension_white_list\n %w(zip pdf blend u int upk gz tar tar.gz tga)\n end", "title": "" }, { "docid": "af0866be1e46226c83181df9d9fe68a5", "score": "0.71451515", "text": "def extension_white_list\n %w(jpg jpeg png gif)\n end", "title": "" }, { "docid": "af0866be1e46226c83181df9d9fe68a5", "score": "0.71451515", "text": "def extension_white_list\n %w(jpg jpeg png gif)\n end", "title": "" }, { "docid": "af0866be1e46226c83181df9d9fe68a5", "score": "0.71451515", "text": "def extension_white_list\n %w(jpg jpeg png gif)\n end", "title": "" }, { "docid": "df7c7c6a7f99106bf3382e1dda2d4cea", "score": "0.7143773", "text": "def extension_white_list\n %w(jpg jpeg png bmp gif)\n end", "title": "" }, { "docid": "b6a459e9f2e66eae9da8a5abf28d9d5f", "score": "0.7142079", "text": "def extension_white_list\n %w(jpg jpeg gif png JPG GIF PNG JPEG)\n end", "title": "" }, { "docid": "c32bcc1dc0a63d1ee263efe6c8d33586", "score": "0.71356857", "text": "def extension_white_list\n %w(jpg jpeg png)\n end", "title": "" }, { "docid": "9eb2d31c28c0831f2857c43926e7a809", "score": "0.713216", "text": "def extension_white_list\n #Este simbolo %w hace que lo que este despues entre parentesis\n #lo pone en un array cada espacio significa un elemento nuevo\n %w(jpg jpeg gif png)\n end", "title": "" }, { "docid": "270a800053d1a06e16a9107a2c4b97d7", "score": "0.7121185", "text": "def extension_white_list\n %w(jpg jpeg gif)\n end", "title": "" }, { "docid": "8ed39fad78b8bcdf746048f9f5abe4cf", "score": "0.711973", "text": "def extension_whitelist\n %w(mov mpeg mpg mp4 avi mp3)\n end", "title": "" }, { "docid": "a1e18089b71c1e851a4cf8e0e56f54db", "score": "0.7115518", "text": "def extension_white_list\n %w(JPG JPEG GIF PNG jpg jpeg gif png)\n end", "title": "" }, { "docid": "fcb282652d4bccfbf81b84afe8a04bfc", "score": "0.7113234", "text": "def extension_white_list\n %w(jpg jpeg png gif)\n end", "title": "" }, { "docid": "30a53f359090e200436d6e09d67877fb", "score": "0.7108514", "text": "def extension_white_list\n %w{ mp3 }\n end", "title": "" }, { "docid": "6ec64118f5925466983472d43601dd0f", "score": "0.71084934", "text": "def extension_white_list\n %w(jpg jpeg gif png JPG JPEG GIF PNG)\n end", "title": "" }, { "docid": "c68c5416275e753802e51d766b70dfaf", "score": "0.710748", "text": "def extension_white_list\n %w(jpg jpeg gif png)\n end", "title": "" }, { "docid": "5fa85012293eedc37a841cb97277df97", "score": "0.7094718", "text": "def extension_white_list\n # ['application/x-shockwave-flash', 'application/x-shockwave-flash', 'application/flv', 'video/x-flv', 'video/mp4', 'video/x-m4v']\n %w(mov mp4)\n end", "title": "" }, { "docid": "c7ac48ad1b6e072729c1868091dc0ba3", "score": "0.70923936", "text": "def extension_white_list\n %w(jpg jpeg gif png)\n end", "title": "" }, { "docid": "01d8fcf087c5bbacd7a0acadbe6d7787", "score": "0.70737326", "text": "def extension_whitelist\n %w(zip cab)\n end", "title": "" }, { "docid": "5af56f2fb003196bb04abe7925d02cbe", "score": "0.7071849", "text": "def extension_white_list\n %w[jpg jpeg gif png]\n end", "title": "" }, { "docid": "5af56f2fb003196bb04abe7925d02cbe", "score": "0.7071849", "text": "def extension_white_list\n %w[jpg jpeg gif png]\n end", "title": "" }, { "docid": "5af56f2fb003196bb04abe7925d02cbe", "score": "0.7071034", "text": "def extension_white_list\n %w[jpg jpeg gif png]\n end", "title": "" }, { "docid": "ea3297f3c6ad47916282c074b68d8a58", "score": "0.7069734", "text": "def extension_white_list\n %w(jpg jpeg gif png)\n end", "title": "" }, { "docid": "ea3297f3c6ad47916282c074b68d8a58", "score": "0.7069734", "text": "def extension_white_list\n %w(jpg jpeg gif png)\n end", "title": "" }, { "docid": "671c54e4c2f3c22d3a1bbb2244e4c008", "score": "0.706769", "text": "def extension_white_list\n %w(jpg jpeg gif png pdf mp4 m4v ogv webm flv otf)\n end", "title": "" }, { "docid": "7169e096258366a1c61b88609c5bda89", "score": "0.705956", "text": "def extension_allowlist\n %w[csv txt]\n end", "title": "" }, { "docid": "0e7cbec694482fd613fad3c100999714", "score": "0.7058927", "text": "def extension_white_list\n EXTENSION_WHITE_LIST\n end", "title": "" }, { "docid": "3b7448d6ada469c90d40a9596423cf0b", "score": "0.70469314", "text": "def extension_white_list\n %w(jpg jpeg gif png)\n end", "title": "" } ]
5574c5c804c8b325820e49fc70d5ba83
PATCH/PUT /tag_devises/1 PATCH/PUT /tag_devises/1.json
[ { "docid": "9b023e9680511bdaf495a99f5a025b64", "score": "0.6203567", "text": "def update\n respond_to do |format|\n if @tag_devise.update(tag_devise_params)\n format.html { redirect_to @tag_devise, notice: 'Tag devise was successfully updated.' }\n format.json { render :show, status: :ok, location: @tag_devise }\n else\n format.html { render :edit }\n format.json { render json: @tag_devise.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "2c1d562ec964eee9463cfb7293ea74da", "score": "0.72218037", "text": "def update\n @tag.update(tag_params)\n render json: @tag\n end", "title": "" }, { "docid": "24d02e126cea8aced7fe6f374c2aa286", "score": "0.709797", "text": "def update\n if tag.update(tag_params)\n render json: tag, status: :ok\n else\n render json: {errors: tag.errors}, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "0c5999319eabb285bfee400e9418c8fc", "score": "0.69867206", "text": "def update\n if @tag.update(update_tag_params)\n render json: @tag, status: :ok\n else\n render json: {errors: @tag.errors}, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "2630f0ef272ef5070065909506fa3a9b", "score": "0.695061", "text": "def update\n begin\n tag = Tagger::Tag.find(params[:id])\n tag.update({ name: params[:name] })\n render json: tag, status: 201\n rescue Exception => e\n render json: { error: \"Unprocessable entity\" }, status: 422\n end\n end", "title": "" }, { "docid": "ba8b04a337a547c603175a5bf4feb203", "score": "0.67754453", "text": "def update\n respond_to do |format|\n# params[:tag].delete :_id\n# params[:tag].delete :keywords\n# params[:tag].delete :index\n# params[:tag].delete :name\n# puts params[:tag]\n puts tag_params\n sleep(1)\n if @tag.update(tag_params)\n format.json { render json: @tag }\n else\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0047e1443afeae480f62c7720303712c", "score": "0.67613626", "text": "def update\n tp = tag_params\n # Only update the name group\n if @tag.update(name: tp[:name].downcase)\n render json: @tag.as_json(\n only: [],\n methods: %i[id name taggings_count]\n ), status: :ok\n else\n render json: {\n errors: Stitches::Errors.from_active_record_object(@tag)\n }, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "03d46ff97d9cda4f71098457e4c65694", "score": "0.67214304", "text": "def update\n @tag = Tag.find(params[:id])\n\n if @tag.update(tag_params)\n render :create, status: :ok\n else\n render json: {errors: @tag.errors}, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "2fef7e6e53566cfc783254c1d8101796", "score": "0.6687662", "text": "def update\n if @tag.update(tag_params)\n render :show, status: :ok, location: @tag\n else\n render json: @tag.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "14c4b53a0799d7f4e7b05071c00131a0", "score": "0.6660997", "text": "def update\n respond_to do |format|\n if @resource_tag.update(resource_tag_params)\n format.html { redirect_to @resource_tag, notice: 'Resource tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @resource_tag }\n else\n format.html { render :edit }\n format.json { render json: @resource_tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0abe85e0aed539ec7c826ad3344716b6", "score": "0.6630579", "text": "def update\n respond_to do |format|\n if @tag.update_attributes(params[:tag])\n format.html { redirect_to @tag, :notice => 'Tag was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @tag.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1533dae5d46dda760b1abefaaed16836", "score": "0.66262865", "text": "def update\n respond_to do |format|\n if @official_tag.update(tag_params)\n format.html { redirect_to admin_official_tag_path(@official_tag), notice: 'tag was successfully updated.' }\n format.json { render :show, status: :ok, location: admin_tag_path(@official_tag) }\n else\n format.html { render :edit }\n format.json { render json: @official_tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4a9265df132d6cf03e098a6fb96476e6", "score": "0.65751976", "text": "def update\n @tag = tag.find(params[:id])\n respond_to do |format|\n if @tag.update(tag_params)\n format.html { redirect_to @tag, notice: 'tag was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "911bd61c5036b98a11c01c1650fa0563", "score": "0.65584826", "text": "def update\n respond_to do |format|\n if @tag.update(tag_params)\n format.html { redirect_to @tag, notice: 'tag was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cd265dadd984a6c8ea298437f33066af", "score": "0.6557057", "text": "def update\n @tag = Tag.find(params[:id])\n\n respond_to do |format|\n if @tag.update_attributes(params[:tag])\n format.xml { head :ok }\n format.json { head :ok }\n else\n format.xml { render :xml => @tag.errors, :status => :unprocessable_entity }\n format.json { render :json => @tag.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4937ca60ac6c2aa2dc153f23a587cb97", "score": "0.6548291", "text": "def update\n unless @tag.nil?\n respond_to do |format|\n if @tag.update(tag_params)\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "title": "" }, { "docid": "b6eff3d4e0810ebf6e6a03dc78b6b17b", "score": "0.6535294", "text": "def update\n if request.method_symbol == :patch\n @tag = Tag.new\n @tag[:image_id] = params[:image_id]\n @tag[:str] = params[:str]\n @tag.save\n render json:{'tag_id' => @tag[:id]} \n else\n respond_to do |format|\n @tag = Tag.find(params[:id])\n puts @tag.inspect\n puts Tag.find(@tag.id).inspect\n if Tag.update(@tag.id, 'str' => params[:text])\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.' }\n format.json { render json: {'success' => 'true'} , status: :ok }\n else\n format.html { render :edit }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "title": "" }, { "docid": "ead26d9776738a51fad41263cacd09d6", "score": "0.6523463", "text": "def update\n respond_to do |format|\n if @tag.update(tag_params)\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ead26d9776738a51fad41263cacd09d6", "score": "0.6523463", "text": "def update\n respond_to do |format|\n if @tag.update(tag_params)\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ead26d9776738a51fad41263cacd09d6", "score": "0.6523463", "text": "def update\n respond_to do |format|\n if @tag.update(tag_params)\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ead26d9776738a51fad41263cacd09d6", "score": "0.6523463", "text": "def update\n respond_to do |format|\n if @tag.update(tag_params)\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ead26d9776738a51fad41263cacd09d6", "score": "0.6523463", "text": "def update\n respond_to do |format|\n if @tag.update(tag_params)\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ead26d9776738a51fad41263cacd09d6", "score": "0.6523463", "text": "def update\n respond_to do |format|\n if @tag.update(tag_params)\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a9ed18d8a39317e8b4c2c86f537566fa", "score": "0.65074015", "text": "def update\n render json: @meta_tag.errors unless @meta_tag.update(meta_tag_params)\n end", "title": "" }, { "docid": "d0e668f6492006c902eff9ed16641eb6", "score": "0.64844966", "text": "def update\n respond_to do |format|\n if @tag.update(tag_params)\n format.html { redirect_to :tags, notice: \"Tag, #{@tag} updated.\" }\n format.json { render :show, status: :ok, location: @tag }\n else\n format.html { render :edit }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ea41288b27f39bb272c138d009225559", "score": "0.64834446", "text": "def update\n respond_to do |format|\n if @tag.update_attributes(params[:tag])\n format.html { redirect_to Tag, notice: 'Tag was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5b951a1804aae167d6337fff8bfca570", "score": "0.6478704", "text": "def update\n @tag = @business.tags.find(params[:id])\n\n respond_to do |format|\n if @tag.update_attributes(tag_params || {})\n format.html { redirect_to business_tag_path(@business, @tag), notice: 'Tag was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "da1a73de60ed3fb5ab600d1f37316a37", "score": "0.6475707", "text": "def update\n @tag = @business.tags.find(params[:id])\n\n respond_to do |format|\n if @tag.update_attributes(params[:tag])\n format.html { redirect_to business_tag_path(@business, @tag), notice: 'Tag was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "27b9dc3c5996fc18cc9967735307ec92", "score": "0.6468965", "text": "def update\n respond_to do |format|\n if @event_tag.update(event_tag_params)\n format.html { redirect_to @event_tag, notice: 'Event tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @event_tag }\n else\n format.html { render :edit }\n format.json { render json: @event_tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a6c67f731479f8c0dc449a59e8b9eb9a", "score": "0.64658856", "text": "def update\n respond_to do |format|\n if @tag.update(tag_params)\n format.html { redirect_to @tag.tag_object.metamorphosize, notice: 'Tag was successfully created.' }\n format.json { render json: @tag, status: :created, location: @tag }\n else\n format.html { redirect_to :back, notice: 'Tag was NOT successfully updated.' }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4d2c13af8d490209cbf8fb1d11c5debf", "score": "0.6462926", "text": "def update\n authorize! :manage, Instrument\n\n respond_to do |format|\n if @influxdb_tag.update(influxdb_tag_params)\n format.html { redirect_to @influxdb_tag, notice: 'Influxdb tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @influxdb_tag }\n else\n format.html { render :edit }\n format.json { render json: @influxdb_tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "61a695842c5133141f0a7fd4afea8a40", "score": "0.64593565", "text": "def update\n @tag.update(tag_params)\n end", "title": "" }, { "docid": "f13facfc67fc23fa8a9b73bffddc8c5c", "score": "0.6457361", "text": "def update\n @event_tag = EventTag.find(params[:id])\n\n respond_to do |format|\n if @event_tag.update_attributes(params[:event_tag])\n format.html { redirect_to @event_tag, notice: 'Event tag was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event_tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fcdd6240dcb27d04e2998b16b3c41758", "score": "0.64461493", "text": "def update\n respond_to do |format|\n if @tag.update(tag_params)\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.', status: :ok }\n format.json { render :show, status: :ok, location: @tag }\n else\n format.html { render :edit }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cc777a1c55dea168fb4e92b19b326339", "score": "0.6445641", "text": "def update\n @tag = Tag.find(params[:id])\n\n respond_to do |format|\n if @tag.update_attributes(params[:tag])\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cc777a1c55dea168fb4e92b19b326339", "score": "0.6445499", "text": "def update\n @tag = Tag.find(params[:id])\n\n respond_to do |format|\n if @tag.update_attributes(params[:tag])\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cc777a1c55dea168fb4e92b19b326339", "score": "0.6445499", "text": "def update\n @tag = Tag.find(params[:id])\n\n respond_to do |format|\n if @tag.update_attributes(params[:tag])\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cc777a1c55dea168fb4e92b19b326339", "score": "0.6445499", "text": "def update\n @tag = Tag.find(params[:id])\n\n respond_to do |format|\n if @tag.update_attributes(params[:tag])\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cc777a1c55dea168fb4e92b19b326339", "score": "0.6445499", "text": "def update\n @tag = Tag.find(params[:id])\n\n respond_to do |format|\n if @tag.update_attributes(params[:tag])\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cc777a1c55dea168fb4e92b19b326339", "score": "0.6445499", "text": "def update\n @tag = Tag.find(params[:id])\n\n respond_to do |format|\n if @tag.update_attributes(params[:tag])\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cc777a1c55dea168fb4e92b19b326339", "score": "0.6445499", "text": "def update\n @tag = Tag.find(params[:id])\n\n respond_to do |format|\n if @tag.update_attributes(params[:tag])\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "49829efc6cec9f0b41e81f63a5dd2c06", "score": "0.6443543", "text": "def update\n @tag = Tag.find(params[:id])\n\n respond_to do |format|\n if @tag.update_attributes(params[:tag])\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "792ad41e2a69e11f977bbd4e567909b7", "score": "0.6434672", "text": "def update\n respond_to do |format|\n if @tag.update(tag_params)\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @tag }\n else\n format.html { render :edit }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "792ad41e2a69e11f977bbd4e567909b7", "score": "0.6434672", "text": "def update\n respond_to do |format|\n if @tag.update(tag_params)\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @tag }\n else\n format.html { render :edit }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "792ad41e2a69e11f977bbd4e567909b7", "score": "0.6434672", "text": "def update\n respond_to do |format|\n if @tag.update(tag_params)\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @tag }\n else\n format.html { render :edit }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "792ad41e2a69e11f977bbd4e567909b7", "score": "0.6434672", "text": "def update\n respond_to do |format|\n if @tag.update(tag_params)\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @tag }\n else\n format.html { render :edit }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "792ad41e2a69e11f977bbd4e567909b7", "score": "0.6434672", "text": "def update\n respond_to do |format|\n if @tag.update(tag_params)\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @tag }\n else\n format.html { render :edit }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "792ad41e2a69e11f977bbd4e567909b7", "score": "0.6434672", "text": "def update\n respond_to do |format|\n if @tag.update(tag_params)\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @tag }\n else\n format.html { render :edit }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "792ad41e2a69e11f977bbd4e567909b7", "score": "0.6434672", "text": "def update\n respond_to do |format|\n if @tag.update(tag_params)\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @tag }\n else\n format.html { render :edit }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "792ad41e2a69e11f977bbd4e567909b7", "score": "0.6434672", "text": "def update\n respond_to do |format|\n if @tag.update(tag_params)\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @tag }\n else\n format.html { render :edit }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "792ad41e2a69e11f977bbd4e567909b7", "score": "0.6434672", "text": "def update\n respond_to do |format|\n if @tag.update(tag_params)\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @tag }\n else\n format.html { render :edit }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "792ad41e2a69e11f977bbd4e567909b7", "score": "0.6434672", "text": "def update\n respond_to do |format|\n if @tag.update(tag_params)\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @tag }\n else\n format.html { render :edit }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "792ad41e2a69e11f977bbd4e567909b7", "score": "0.6434672", "text": "def update\n respond_to do |format|\n if @tag.update(tag_params)\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @tag }\n else\n format.html { render :edit }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "792ad41e2a69e11f977bbd4e567909b7", "score": "0.6434672", "text": "def update\n respond_to do |format|\n if @tag.update(tag_params)\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @tag }\n else\n format.html { render :edit }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "792ad41e2a69e11f977bbd4e567909b7", "score": "0.6434672", "text": "def update\n respond_to do |format|\n if @tag.update(tag_params)\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @tag }\n else\n format.html { render :edit }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a54350b8f6a77b89d97e8d51d10322ac", "score": "0.63946956", "text": "def update\n respond_to do |format|\n if @tag.update_attributes(tag_params)\n format.html { redirect_to group_tag_path(@group, @tag), notice: 'Tag was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render group_tag_edit_path(@group, @tag) }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ad2d7b4167cd5bb616058a22c1c2c7d9", "score": "0.6392187", "text": "def update\n respond_to do |format|\n if @fact_tag.update(fact_tag_params)\n format.html { redirect_to @fact_tag, notice: 'Fact tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @fact_tag }\n else\n format.html { render :edit }\n format.json { render json: @fact_tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9ff97f802b30e5eca85209319f30d845", "score": "0.6388802", "text": "def update_tag(tag_name, info = {})\n wrap_response do\n self.class.post \"/api2/tags/#{tag_name}\",\n { :body => JSON(info) } | default_options\n end\n end", "title": "" }, { "docid": "d3ac050250f3fa7f55910d5a9fd2ffeb", "score": "0.6383464", "text": "def update\n respond_to do |format|\n if @pet_tag.update(pet_tag_params)\n format.html { redirect_to @pet_tag, notice: 'Pet tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @pet_tag }\n else\n format.html { render :edit }\n format.json { render json: @pet_tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "edca0cf10db91d3022d02db7fae3a7b4", "score": "0.63771737", "text": "def update\n respond_to do |format|\n if @tag.update(tag_params)\n format.html do\n redirect_to @tag,\n notice: t('shared.msgs.success_updated',\n obj: t('activerecord.models.tag', count: 1))\n end\n format.json { render :show, status: :ok, location: @tag }\n else\n format.html { render :edit }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "155ecce89c1a472f03a0293e53426f81", "score": "0.6375653", "text": "def update\n respond_to do |format|\n if @tag.update(tag_params(params[\"tag\"]))\n if params[:caller] == 'reg'\n format.html { redirect_to '/'}\n else\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.' }\n end\n format.json { render :show, status: :ok, location: @tag }\n format.js\n else\n format.html { render :edit }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4269135b0f73ca43a721cc20f49d22dd", "score": "0.63725734", "text": "def replace_tag\n begin\n entity = Tagger::EntityTag.create_entity_tags(params)\n render json: { \"#{Tagger.tagged_resource}\": entity, tags: entity.tags }, status: 201\n rescue Exception => e\n render json: { error: \"Unprocessable entity\" }, status: 422\n end\n end", "title": "" }, { "docid": "15c0021fc2d8012338552bb75657fecb", "score": "0.6361273", "text": "def update\r\n @tag = Tag.find_by_id(params[:id])\r\n\r\n respond_to do |format|\r\n if @tag.update_attributes(params[:tag])\r\n format.html { redirect_to @tag, notice: 'Tag 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: @tag.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "09e947b88bfab8fe7ac6f2ef52be8587", "score": "0.636029", "text": "def update\n @post_tag = PostTag.find(params[:id])\n\n respond_to do |format|\n if @post_tag.update_attributes(params[:post_tag])\n format.html { redirect_to @post_tag, notice: 'Post tag was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post_tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fb93b0b179c9c1c69b93aec0c6dbc9b5", "score": "0.63563335", "text": "def update\n @tag = Tag.find(params[:id])\n respond_to do |format|\n if @tag.update(tag_params)\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @tag }\n else\n format.html { render :edit }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7fa212750f963271626f2e74d348141e", "score": "0.6354822", "text": "def update\n respond_to do |format|\n if @asset_tag.update(asset_tag_params)\n format.html { redirect_to @asset_tag, notice: 'Asset tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @asset_tag }\n else\n format.html { render :edit }\n format.json { render json: @asset_tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d8d0833ad3b3d750a500ade34bedd809", "score": "0.6352196", "text": "def update\n respond_to do |format|\n if @tag.update(tag_params)\n format.html {redirect_to tags_path, notice: 'Tag atualizada com sucesso.'}\n format.json {render :show, status: :ok, location: @tag}\n else\n format.html {render :edit}\n format.json {render json: @tag.errors, status: :unprocessable_entity}\n end\n end\n end", "title": "" }, { "docid": "fc229e3c8372f2f700721e8d3506a302", "score": "0.6352102", "text": "def update\n @recipe_tag = RecipeTag.find(params[:id])\n\n respond_to do |format|\n if @recipe_tag.update_attributes(params[:recipe_tag])\n format.html { redirect_to @recipe_tag, notice: 'Recipe tag was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @recipe_tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d0febaa26a675c359bfa2d5e77621fbf", "score": "0.6348123", "text": "def update\n respond_to do |format|\n if @tag.update(tag_params)\n format.html {\n flash[:success] = \"Tag was successfully updated.\"\n redirect_to( @tag )\n }\n format.json { render :show, status: :ok, location: @tag }\n else\n format.html { render :edit }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b479aef21e1cea32bc52c19dc25a723a", "score": "0.6346744", "text": "def update\n respond_to do |format|\n if @conceptual_tag.update(conceptual_tag_params)\n format.html { redirect_to @conceptual_tag, notice: 'Conceptual tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @conceptual_tag }\n else\n format.html { render :edit }\n format.json { render json: @conceptual_tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6eff84447327c480d5769a7b1d24f46c", "score": "0.63423073", "text": "def update\n @tags = Tag.all\n respond_to do |format|\n if @resource.update(resource_params)\n format.html { redirect_to @resource, notice: 'Resource was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5b77005e66d84ae0dccf7e98d44f2406", "score": "0.6336255", "text": "def update\n respond_to do |format|\n if @person_tag.update(person_tag_params)\n format.html { redirect_to @person_tag, notice: \"Person tag was successfully updated.\" }\n format.json { render :show, status: :ok, location: @person_tag }\n else\n format.html { render :edit }\n format.json { render json: @person_tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8c32cffdb7dab9afa5005b28189e47f6", "score": "0.63353044", "text": "def update\n respond_to do |format|\n if @tag.update(tag_params)\n format.html { redirect_to url_for(@tag.tag_object.metamorphosize),\n notice: 'Tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @tag }\n else\n format.html { redirect_back(fallback_location: (request.referer || root_path),\n notice: 'Tag was NOT successfully updated.') }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b756a4208c30c8148a319de2ec48b28b", "score": "0.6327008", "text": "def update\n respond_to do |format|\n if @person_tag.update(person_tag_params)\n format.html { redirect_to @person_tag, notice: 'Person tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @person_tag }\n else\n format.html { render :edit }\n format.json { render json: @person_tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a5a99eb9cb270c8f9432cfcc47fc60e8", "score": "0.63253003", "text": "def update\n if @tag_type.update(update_params)\n head :no_content\n else\n render json: @tag_type.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "754bafb5bafa2db52d267cde42258078", "score": "0.6324879", "text": "def update\n respond_to do |format|\n if @tag.update(tag_params)\n format.html { redirect_to edit_editor_site_tag_path(@site, @tag), notice: 'Tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @tag }\n else\n @errors = @tag.errors\n format.html {render :edit}\n format.json {render json: @tag.errors, status: :unprocessable_entity}\n end\n end\n end", "title": "" }, { "docid": "7e5d7065ba903565875e5988b2189b0d", "score": "0.63141966", "text": "def update\n respond_to do |format|\n if @instance_tag.update(instance_tag_params)\n format.html { redirect_to @instance_tag, notice: 'Instance tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @instance_tag }\n else\n format.html { render :edit }\n format.json { render json: @instance_tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "84a40d92c70271285e5212b42b158e8e", "score": "0.63129705", "text": "def update\n respond_to do |format|\n if @recipes_diet_tag.update(recipes_diet_tag_params)\n format.html { redirect_to @recipes_diet_tag, notice: 'Recipes diet tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @recipes_diet_tag }\n else\n format.html { render :edit }\n format.json { render json: @recipes_diet_tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "420abb85a6a7a790ad44d20a31eaabb7", "score": "0.63121337", "text": "def tag\n @scenario = Scenario.find(params[:id]);\n tl = @scenario.tag_list\n tl << Tag.find_by_id(params[:tag]).name;\n @scenario.tag_list = tl\n respond_to do |format|\n if @scenario.update_attributes(@scenario)\n format.json { render :json => { :success => true } }\n else\n format.json { render :json => { :success => false} }\n end\n end\n end", "title": "" }, { "docid": "5d09467de5aeed08197add655f6006f5", "score": "0.6310348", "text": "def update\n respond_to do |format|\n if @insta_tag.update(insta_tag_params)\n format.html { redirect_to @insta_tag, notice: 'Insta tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @insta_tag }\n else\n format.html { render :edit }\n format.json { render json: @insta_tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1308e2aec2b24f8d3f1fbc1a120db8f6", "score": "0.6301237", "text": "def update\n respond_to do |format|\n if @tag.update_attributes(params[:post])\n format.xml { head :ok }\n else\n format.xml { render :xml => @tag.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d6b9d0172f0d0c0ef8f689ef1096acbb", "score": "0.62915003", "text": "def update\n respond_to do |format|\n if @tag.update_attributes(tag_params)\n format.html { redirect_to [@user, @tag], notice: 'Tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @tag }\n else\n format.html { render :edit }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "adabff440587ba4a06096a125bd88831", "score": "0.6288592", "text": "def update\n respond_to do |format|\n if @org_tag.update(org_tag_params)\n format.html { redirect_to @org_tag, notice: 'Org tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @org_tag }\n else\n format.html { render :edit }\n format.json { render json: @org_tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "61ed9d766d391bfcf95f3b45cb24049f", "score": "0.62852836", "text": "def update\n respond_to do |format|\n if @tag_association.update(tag_association_params)\n format.html { redirect_to @tag_association, notice: 'Tag association was successfully updated.' }\n format.json { render :show, status: :ok, location: @tag_association }\n else\n format.html { render :edit }\n format.json { render json: @tag_association.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b9acc43df4c8a56c563442d443f909be", "score": "0.628245", "text": "def update\n @koozy_tag = KoozyTag.find(params[:id])\n\n respond_to do |format|\n if @koozy_tag.update_attributes(params[:koozy_tag])\n format.html { redirect_to(@koozy_tag, :notice => 'Koozy tag was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @koozy_tag.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "82a0c9c14a47c6f6b73b6d95420686e6", "score": "0.62798893", "text": "def update\n @tag.update(tag_params)\n respond_with(@tag, :flash => true)\n end", "title": "" }, { "docid": "603a6f89f8fd9b49a08e69b5f87a6fd7", "score": "0.6270075", "text": "def update\n respond_to do |format|\n if @planet_tag.update(planet_tag_params)\n format.html { redirect_to @planet_tag, notice: 'Planet tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @planet_tag }\n else\n format.html { render :edit }\n format.json { render json: @planet_tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c52d8726bdf16805461040042b776f8a", "score": "0.62652427", "text": "def update\n \n @pet.name = params[:pet][\"name\"]\n @pet.status = (StatusModel.where(\"name\" => params[:pet][\"status\"]).first).as_json\n @pet.breed = (BreedModel.where(\"_id\" => params[:breed]).first).as_json\n @pet.address = Address.new(\"address\" => params[:pet][\"address\"])\n if params[:pet][\"ok\"].nil?\n @pet.ok = false\n else\n @pet.ok = params[:pet][\"ok\"]\n end\n \n @tagPet = []\n tag_ids = params[:tag]\n \n if !tag_ids.nil?\n for t in tag_ids \n @tagPet.push(TagModel.where(\"_id\" => t).first)\n end\n @pet.tag = @tagPet\n end\n \n respond_to do |format|\n if @pet.update\n # if @pet.update(pet_params)\n format.html { redirect_to @pet, notice: 'Seu Pet foi atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @pet }\n else\n format.html { render :edit }\n format.json { render json: @pet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a22265c704ad6f6d1e93e3320406fc7f", "score": "0.6254642", "text": "def update\n params[:tag][:status_ids] ||= []\n @tag = current_user.tags.find(params[:id])\n\n respond_to do |format|\n if @tag.update_attributes(params[:tag])\n format.html { redirect_to etykiety_path, notice: 'Zmodyfikowano etykietę.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\", notice: 'Nie zmodyfikowano etykiety.' }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "09fe5bfc3c7a772b6e095f1623895c2c", "score": "0.62462604", "text": "def update\n # debugger\n @post = Post.find(params[:id])\n tag = find_param_tag\n # post_tag = @post.tags.map(&:id)\n # post_tag_size = post_tag.size\n respond_to do |format|\n @post.taggings.destroy_all\n tag.each do |t|\n @post.taggings.create(tag_id: t)\n end\n if @post.update_attributes(params[:post])\n # if tag && post_tag_size == tag.size && (post_tag <=> tag) == 0\n # elsif true\n # else\n # end\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n\n end\n end", "title": "" }, { "docid": "d0b400593c9dbb15cdb89a64d9485404", "score": "0.62325794", "text": "def update\n respond_to do |format|\n if @photo_tag.update(photo_tag_params)\n format.html { redirect_to @photo_tag, notice: \"Photo tag was successfully updated.\" }\n format.json { render :show, status: :ok, location: @photo_tag }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @photo_tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c6b276557ba6fa051d8bf2b9a5aafa8d", "score": "0.62281585", "text": "def update\n respond_to do |format|\n if @tag.update_attributes(tag_params)\n format.html { redirect_to tag_path(@tag), notice: 'タグ名を更新しました.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dc7ea17b55534ee64e1728bf08e34025", "score": "0.62213117", "text": "def update\n if concept_params[:tag_ids].present?\n new_tag_ids = []\n concept_params[:tag_ids].each do |tag_id|\n if tag_id.length > 0 and Tag.exists?(tag_id)\n new_tag_ids << tag_id\n else\n if tag_id.present?\n t = Tag.find_or_create_by(name: tag_id)\n new_tag_ids << t.id\n end\n end\n end\n end\n @concept.user_id = current_user.id\n respond_to do |format|\n if @concept.update(concept_params.except(:tag_ids))\n new_tag_ids.each do |new_tag_id|\n ConceptTag.find_or_create_by(concept_id: @concept.id, tag_id: new_tag_id)\n end\n format.html { redirect_to @concept, notice: 'Definicja pojęcia została zmieniona.' }\n format.json { render :show, status: :ok, location: @concept }\n else\n format.html { render :edit }\n format.json { render json: @concept.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "79ab94e4111258f5781d23b127e60d10", "score": "0.62103266", "text": "def update\n respond_to do |format|\n if @sub_tag.update(sub_tag_params)\n format.html { redirect_to @sub_tag, notice: 'Sub tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @sub_tag }\n else\n format.html { render :edit }\n format.json { render json: @sub_tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e9e8bc4cfb425fb6776dfc06921bd1ae", "score": "0.62062865", "text": "def update\n respond_to do |format|\n if @organization_tag.update(organization_tag_params)\n format.html { redirect_to @organization_tag, notice: 'Organization tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization_tag }\n else\n format.html { render :edit }\n format.json { render json: @organization_tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8bfa04718316d2eccab4c04a33ccc650", "score": "0.62055236", "text": "def update\n respond_to do |format|\n if @gesture_tag.update(gesture_tag_params)\n format.html { redirect_to @gesture_tag, notice: 'Gesture tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @gesture_tag }\n else\n format.html { render :edit }\n format.json { render json: @gesture_tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "98c797cd419cafbf2c8d514cf96e5ec5", "score": "0.6204887", "text": "def update\n respond_to do |format|\n if @tag_object.update(tag_object_params)\n format.html { redirect_to @tag_object, notice: 'Tag object was successfully updated.' }\n format.json { render :show, status: :ok, location: @tag_object }\n else\n format.html { render :edit }\n format.json { render json: @tag_object.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a413df523c293ad4f88ae0790202ad67", "score": "0.62040406", "text": "def update\n @routine = Routine.find(params[:id])\n #@routine.update_tags(params[:routine][:tags])\n @tags = []\n @tag_ids = params[:tokens].split(\",\")\n @tag_ids.each do |tag|\n @tags << Tag.find(tag).name\n end\n params[:routine][:tags] = @tags\n respond_to do |format|\n if @routine.update_attributes(params[:routine])\n format.html { redirect_to @routine, notice: 'Routine was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @routine.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "534348dbb8284a83d255fc0fd50e29dd", "score": "0.62033147", "text": "def update2\n @tagging = Tagging.where(entity_type: params[:entity_type], entity_id: params[:entity_id]).first\n\n if @tagging.present?\n tags_elements = get_tags_elements\n \n if @tagging.update(entity_type: tagging_params[:entity_type], entity_id: tagging_params[:entity_id], tags: tags_elements)\n render :show, status: :ok, location: @tagging \n else\n render json: @tagging.errors, status: :unprocessable_entity\n end\n end\n\n end", "title": "" }, { "docid": "827d43556574397c2aa5378d72f408b5", "score": "0.6196567", "text": "def update\n respond_to do |format|\n if @tagged.update(tagged_params)\n format.html { redirect_to @tagged, notice: 'Tagged was successfully updated.' }\n format.json { render :show, status: :ok, location: @tagged }\n else\n format.html { render :edit }\n format.json { render json: @tagged.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7f08851a8c4803ef50730efc12a6c4e5", "score": "0.61927", "text": "def update\n respond_to do |format|\n if @tag_definition.update(tag_definition_params)\n format.html { redirect_to @tag_definition, notice: 'Tag definition was successfully updated.' }\n format.json { render :show, status: :ok, location: @tag_definition }\n else\n format.html { render :edit }\n format.json { render json: @tag_definition.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
17139cc5705d2ffef441c427e9f96290
Returns the help String for this option. source://pry//lib/pry/slop/option.rb124
[ { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.0", "text": "def to_s; end", "title": "" } ]
[ { "docid": "cabbd835b97c236b5349f2b37061a832", "score": "0.8621852", "text": "def help_message\n option_parser.to_s\n end", "title": "" }, { "docid": "d32b37a1d5e5d41db00772cbce54cff5", "score": "0.8584885", "text": "def option_help\n @options ? option_parser.to_s : ''\n end", "title": "" }, { "docid": "8ff0ec725d6fdd302891e808b4d9a344", "score": "0.8513963", "text": "def help_string\r\n\t$options_parser.help\r\nend", "title": "" }, { "docid": "1425f007801e92924fc4b25a8f67748d", "score": "0.82743305", "text": "def help\n @opt.help\n end", "title": "" }, { "docid": "18d46574cd7ec5f8383009fe1f0e759a", "score": "0.810319", "text": "def help(fmt: nil)\n opts[:help].to_s\n end", "title": "" }, { "docid": "18d46574cd7ec5f8383009fe1f0e759a", "score": "0.810319", "text": "def help(fmt: nil)\n opts[:help].to_s\n end", "title": "" }, { "docid": "d5d4b4f442fe2acdfd16ec4ee8b147a5", "score": "0.77491874", "text": "def to_s #::nodoc::\n help\n end", "title": "" }, { "docid": "c9b5784eac397bc326a28f6ea0ea89ba", "score": "0.7693842", "text": "def usage\n @optparse.help\n end", "title": "" }, { "docid": "db535312b616c8af9e0b60833d29675b", "score": "0.7624969", "text": "def usage\n @optparse.help\n end", "title": "" }, { "docid": "b4d2bdbed3f800da72148e8e7b43329d", "score": "0.7521678", "text": "def help\n \"#{@description}: #{usage}\"\n end", "title": "" }, { "docid": "87369ea8a9ed81e2bda260c8edffc117", "score": "0.7493419", "text": "def help\n ''\n end", "title": "" }, { "docid": "acb6baf107b2a0d9039d3d88713664c2", "score": "0.74325526", "text": "def help\n parser.to_s\n end", "title": "" }, { "docid": "7f84c7670fd8cabf773d3e7eaada3422", "score": "0.7432504", "text": "def help_message\n \"For help use the -h option (e.g., #{$PROGRAM_NAME} -h)\"\n end", "title": "" }, { "docid": "acbbef3e80186f48d83dd37ea3948f8f", "score": "0.74038655", "text": "def help\n slop.help\n end", "title": "" }, { "docid": "86afd83132ca26a7973b30e581600ff2", "score": "0.74024963", "text": "def help\n @slop.help\n end", "title": "" }, { "docid": "f07bbdcad86220317cb072e800e00e29", "score": "0.73461366", "text": "def help_arg_explanation\n \"`#{File.basename($PROGRAM_NAME)} --help` for more information.\"\n end", "title": "" }, { "docid": "b85a745044ddf0df56b08f0781066e13", "score": "0.72518563", "text": "def help\n usage\n puts\n puts \"Options are ...\"\n puts\n OPTIONS.sort.each do |long, short, mode, desc|\n if mode == GetoptLong::REQUIRED_ARGUMENT\n if desc =~ /\\b([A-Z]{2,})\\b/\n long = long + \"=#{$1}\"\n end\n end\n printf \" %-20s (%s)\\n\", long, short\n printf \" %s\\n\", desc\n end\n end", "title": "" }, { "docid": "bc69480ab27c586c151ec11ade26ff67", "score": "0.7249055", "text": "def help\n out = \"\"\n if banner\n out << \"#{banner}\\n\"\n else\n out << \"Usage:\\n\"\n end\n\n order.each do |option|\n line = sprintf(\"-%-2s --%-#{@longest}s \",\n option.short,\n option.long.to_s.gsub('_', '-'))\n\n out << line\n if line.length + option.description.length <= 80\n out << option.description\n else\n rem = 80 - line.length\n desc = option.description\n i = 0\n while i < desc.length\n out << \"\\n\" if i > 0\n j = [i + rem, desc.length].min\n while desc[j..j] =~ /[\\w\\d]/\n j -= 1\n end\n chunk = desc[i..j].strip\n out << \" \" * line.length if i > 0\n out << chunk\n i = j + 1\n end\n end\n\n if option.has_default?\n out << \" (default: #{option.default})\"\n end\n\n if option.required?\n out << \" REQUIRED\"\n end\n out << \"\\n\"\n end\n out\n end", "title": "" }, { "docid": "199fff7d45e96ece51c7f90544895338", "score": "0.7247765", "text": "def show_help\n abort option_parser.to_s\n end", "title": "" }, { "docid": "199fff7d45e96ece51c7f90544895338", "score": "0.7247765", "text": "def show_help\n abort option_parser.to_s\n end", "title": "" }, { "docid": "199fff7d45e96ece51c7f90544895338", "score": "0.7247765", "text": "def show_help\n abort option_parser.to_s\n end", "title": "" }, { "docid": "2063cabb69a4bd02e0f46eba7d43ea79", "score": "0.72388536", "text": "def generic_help\n ''\n end", "title": "" }, { "docid": "71fa123ee4a80822e855990f6b574a2f", "score": "0.71953356", "text": "def help_s\n HOMEBREW_HELP\n end", "title": "" }, { "docid": "9ee548a1194832c5218c7a2c82f29800", "score": "0.71952975", "text": "def help\n text = ''\n\n # Append usage\n text << usage + \"\\n\"\n\n # Append aliases\n unless aliases.empty?\n text << \"\\n\"\n text << \"aliases: #{aliases.join(' ')}\\n\"\n end\n\n # Append short description\n text << \"\\n\"\n text << short_desc + \"\\n\"\n\n # Append long description\n text << \"\\n\"\n text << long_desc.wrap_and_indent(78, 4) + \"\\n\"\n\n # Append options\n all_option_definitions = base.global_option_definitions + option_definitions\n unless all_option_definitions.empty?\n text << \"\\n\"\n text << \"options:\\n\"\n text << \"\\n\"\n all_option_definitions.sort { |x,y| x[:long] <=> y[:long] }.each do |opt_def|\n text << sprintf(\" -%1s --%-10s %s\\n\", opt_def[:short], opt_def[:long], opt_def[:desc])\n end\n end\n\n # Return text\n text\n end", "title": "" }, { "docid": "bfd6ad07c54dd4208c3c7b48037eb759", "score": "0.7179696", "text": "def help(fmt: nil)\n (opts[:help] || \"Exit if # seconds elapse with no VNC viewer connections\").to_s\n end", "title": "" }, { "docid": "0c87343bc864861d21b8259498e1f747", "score": "0.7177243", "text": "def help\n output = ''\n output << help_banner\n output << help_short_desc\n output << help_long_desc\n output << help_commands\n output << help_arguments\n output << help_options('Options (take precedence over global options)', options)\n output << help_options('Global Options', command_parser.global_options)\n end", "title": "" }, { "docid": "0ae45cef54a126aabfe6e0c024ad3129", "score": "0.71663636", "text": "def help\n usage\n puts\n puts \"Options are ...\"\n puts\n OPTIONS.sort.each do |long, short, mode, desc|\n if mode == GetoptLong::REQUIRED_ARGUMENT\n if desc =~ /\\b([A-Z]{2,})\\b/\n long = long + \"=#{$1}\"\n end\n end\n printf \" %-20s (%s)\\n\", long, short\n printf \" %s\\n\", desc\n end\n end", "title": "" }, { "docid": "0ae45cef54a126aabfe6e0c024ad3129", "score": "0.71663636", "text": "def help\n usage\n puts\n puts \"Options are ...\"\n puts\n OPTIONS.sort.each do |long, short, mode, desc|\n if mode == GetoptLong::REQUIRED_ARGUMENT\n if desc =~ /\\b([A-Z]{2,})\\b/\n long = long + \"=#{$1}\"\n end\n end\n printf \" %-20s (%s)\\n\", long, short\n printf \" %s\\n\", desc\n end\n end", "title": "" }, { "docid": "fb6c23ab483fc16b868f7a9f89053521", "score": "0.71663237", "text": "def help\n help = ::Haxe::Cli::Proxy::Constants::OPTION_HELP\n execute \"#{HAXE} #{help}\"\n end", "title": "" }, { "docid": "892275c6684f71c2378fe0966090a5c8", "score": "0.71656615", "text": "def help_string\n map(&:help_string).join(', ')\n end", "title": "" }, { "docid": "1c976ddd302099e166440435cb0adf0e", "score": "0.7147498", "text": "def short_desc\n 'Show help for a command'\n end", "title": "" }, { "docid": "81627253a35426bf9820cc98c6c1c789", "score": "0.7145982", "text": "def help( task_or_option = nil )\n if task_or_option.nil?\n help_overview\n else\n token_help(task_or_option.to_sym)\n end\n end", "title": "" }, { "docid": "f50e9b8355ee3b6fcd2124897ec9b4fd", "score": "0.71310645", "text": "def get_help\n @help_msg\n end", "title": "" }, { "docid": "5de865cedd1db366816c4747ae4070c2", "score": "0.71089554", "text": "def usage\n STDERR.puts $opt_parser.help()\nend", "title": "" }, { "docid": "ef7d8ab22bf4af3509786e2eba9ef970", "score": "0.7058552", "text": "def help?\n @option_config.name == 'help'\n end", "title": "" }, { "docid": "0f69551d173d59736aba9f07445ebf65", "score": "0.70555687", "text": "def to_s\n return @helpText + \"\\n\"\n end", "title": "" }, { "docid": "5e3ba261d74cbad916fbe1c2dfa37a71", "score": "0.70438534", "text": "def help\n puts HELP_TEXT\n end", "title": "" }, { "docid": "967ac4384d8f8364f17cb017b3327052", "score": "0.7030351", "text": "def help\n @optparse.on_tail('-h', '--help', 'Show this message') do\n show_help\n end\n end", "title": "" }, { "docid": "41eea2cf604081abafc2cff0c11bce82", "score": "0.7028224", "text": "def help\n parse_command_line(['--help'])\n end", "title": "" }, { "docid": "41eea2cf604081abafc2cff0c11bce82", "score": "0.7028224", "text": "def help\n parse_command_line(['--help'])\n end", "title": "" }, { "docid": "41eea2cf604081abafc2cff0c11bce82", "score": "0.7028224", "text": "def help\n parse_command_line(['--help'])\n end", "title": "" }, { "docid": "41eea2cf604081abafc2cff0c11bce82", "score": "0.7028224", "text": "def help\n parse_command_line(['--help'])\n end", "title": "" }, { "docid": "41eea2cf604081abafc2cff0c11bce82", "score": "0.7028224", "text": "def help\n parse_command_line(['--help'])\n end", "title": "" }, { "docid": "41eea2cf604081abafc2cff0c11bce82", "score": "0.7028224", "text": "def help\n parse_command_line(['--help'])\n end", "title": "" }, { "docid": "41eea2cf604081abafc2cff0c11bce82", "score": "0.7028224", "text": "def help\n parse_command_line(['--help'])\n end", "title": "" }, { "docid": "41eea2cf604081abafc2cff0c11bce82", "score": "0.7028224", "text": "def help\n parse_command_line(['--help'])\n end", "title": "" }, { "docid": "587559a5c7fa6339cbc7d943aedaeac4", "score": "0.7021695", "text": "def help\n out = \"\"\n if banner\n out << \"#{banner}\\n\"\n else\n out << \"Usage:\\n\"\n end\n\n order.each do |option|\n out << \"#{option.usage}\\n\"\n end\n out\n end", "title": "" }, { "docid": "f53142e854dd3ef78e508262919af087", "score": "0.701196", "text": "def cmd_help argv\n help\n end", "title": "" }, { "docid": "777f12c0dba2f6d182fd6a4d7d1a3e56", "score": "0.7010108", "text": "def to_s\n self.class.help.to_s # usage ?\n end", "title": "" }, { "docid": "beb6b00d6a00f3dff895352623edcf76", "score": "0.69922936", "text": "def optionDesc(option)\n option[:description].sub(/\\n.*$/,'')\n end", "title": "" }, { "docid": "4929606983008ea5348d8d067b89bba3", "score": "0.69903374", "text": "def usage_options\n (options.options_defined? ? ' [options]' : '')\n end", "title": "" }, { "docid": "5f2c4b7fd70bc40dd8e5fc895923e9ed", "score": "0.6989639", "text": "def help\n puts HELP_TEXT\n end", "title": "" }, { "docid": "d593f5bf1a7ed6b801f4347cabf8d1ae", "score": "0.6983416", "text": "def cmd_help argv\n help\n end", "title": "" }, { "docid": "d593f5bf1a7ed6b801f4347cabf8d1ae", "score": "0.6983416", "text": "def cmd_help argv\n help\n end", "title": "" }, { "docid": "d593f5bf1a7ed6b801f4347cabf8d1ae", "score": "0.6983416", "text": "def cmd_help argv\n help\n end", "title": "" }, { "docid": "ff1ee419876e1b592e15b0e39b2aa53b", "score": "0.6976961", "text": "def to_s\n banner = \"#{@banner}\\n\" if @banner\n (banner || '') + options.to_help\n end", "title": "" }, { "docid": "ff1ee419876e1b592e15b0e39b2aa53b", "score": "0.6976961", "text": "def to_s\n banner = \"#{@banner}\\n\" if @banner\n (banner || '') + options.to_help\n end", "title": "" }, { "docid": "f0eea58bae922bca0e8cd056515c0cec", "score": "0.6968239", "text": "def usage()\n @header + @optdesc\n end", "title": "" }, { "docid": "901ba24341334b0a67aab2765cdcb1bf", "score": "0.6952479", "text": "def command_help\n GoHiring::Config[\"messages\"][\"command_help\"]\n end", "title": "" }, { "docid": "c7bd219e0d273bdb2d0f637eb764f8c9", "score": "0.6947511", "text": "def usage\n\t\ttxt = \"\\nOPTIONS:\\n\\n\"\n\n\t\tfmt.sort.each { |entry|\n\t\t\tfmtspec, val = entry\n\n\t\t\ttxt << \" #{fmtspec}\" + ((val[0] == true) ? \" <opt> \" : \" \")\n\t\t\ttxt << val[1] + \"\\n\"\n\t\t}\n\n\t\ttxt << \"\\n\"\n\n\t\treturn txt\n\tend", "title": "" }, { "docid": "4c287a1db8a19941ab2c1bff487f4460", "score": "0.6880124", "text": "def generate_help_message(command = \"\")\n specifications = @input_tool_specifications\n output_help_message = \"\"\n if command.eql?(\"\")\n output_help_message += \"usage: #{specifications[\"name\"]}\\n\"\n output_help_message += \"\\n\"\n output_help_message += \"#{specifications[\"description\"]}\"\n end\n return output_help_message\n end", "title": "" }, { "docid": "3be43ddcf3b72974c7eaaa6054cb3820", "score": "0.6879279", "text": "def help\n # flagrant hack\n definition_context = self\n lambda do\n # the actual ability object might have changed if the\n # definition was re-opened up\n ability = definition_context.ability\n by_type = ability.parameters.by_cli_type\n orig_optparser = definition_context.optparse_proxy.option_parser\n optparse = orig_optparser.dup\n class << optparse;\n attr_accessor :stack\n def last; @stack[2].instance_variable_get('@list').last end\n def _banner; @banner end\n end\n unless optparse._banner\n banner =\n [ ability.desc.length > 0 ? (ability.desc*\"\\n\"+\"\\n\\n\") : \"\",\n \"usage: #{optparse.program_name}\",\n \"#{definition_context.ability.name}\",\n by_type[:switch].map{|x| x.cli_unparse}*' ',\n by_type[:required].map{|x| x.cli_unparse}*' ',\n by_type[:optional].map{|x| x.cli_unparse}*' '\n ].reject{|x|\"\"==x} * ' ' + \"\\n\\n\"\n optparse.banner = banner\n end\n optparse.stack = orig_optparser.instance_variable_get('@stack').dup\n these = [:required, :optional, :splat]\n if these.map{|x| by_type[x].size }.reduce(:+) > 0\n these.each do |cli_type|\n by_type[cli_type].each do |param|\n # we need to give the swith a unique name even tho we rewrite it\n optparse.on(\"--#{param.name}\", *param.desc)\n switch = optparse.last\n switch.instance_variable_set('@long',[param.cli_unparse])\n end\n end\n end\n response = optparse.help\n Cli.add_linebreaks_to_syntax_summary! response\n throw :cli_early_exit, response\n end\n end", "title": "" }, { "docid": "acb8b81a30073a37b47bbe4b9aa777fa", "score": "0.68551934", "text": "def help_options(title, options)\n summary = ''\n summary_width = command_parser.main_options.summary_width\n options.summarize([], summary_width, summary_width - 1, '') do |line|\n summary << format(line, width: command_parser.help_line_width - command_parser.help_indent,\n indent: summary_width + 1, indent_first_line: false) << \"\\n\"\n end\n cond_format_help_section(title, summary, condition: !summary.empty?, preformatted: true)\n end", "title": "" }, { "docid": "7f5cf770ce893c7c6c4add93175a8465", "score": "0.6853092", "text": "def long_desc\n 'Show help for the given command, or show general help. When no ' +\n 'command is given, a list of available commands is displayed, as ' +\n 'well as a list of global command-line options. When a command is ' +\n 'given, a command description as well as command-specific ' +\n 'command-line options are shown.'\n end", "title": "" }, { "docid": "5b0aec6fceb7de54261b7a47aeabf644", "score": "0.68474483", "text": "def option_text\n \"#{self.number} - #{self.desc}\"\n end", "title": "" }, { "docid": "e87addf4695e52d60582e06e1def517f", "score": "0.6846618", "text": "def dispatch_help\n colorized_help = @optparse.to_s.split(\"\\n\").map do |l|\n if l.start_with?(\"Usage:\")\n lc = l.split(\" \")\n \"#{c lc[0]} #{c lc[1], :blue} #{c lc[2..-1].join(\" \"), :cyan}\"\n elsif l.start_with?(\"#\")\n c(l, :blue)\n elsif l.strip.start_with?(\"-\")\n \"#{c l.to_s[0...33], :cyan}#{c l[33..-1]}\"\n else\n c(l)\n end\n end\n puts nil, colorized_help, nil\n puts c(\"The current config directory is #{c core_cfg_path.to_s, :magenta}\"), nil\n end", "title": "" }, { "docid": "ec2adaf618dc675c03f958a482d6b59a", "score": "0.68338984", "text": "def help\n write_command('HELP')\n end", "title": "" }, { "docid": "9ec1a8ecc71b305225d48fb125ee56e4", "score": "0.6831972", "text": "def help\n @cmd.map{|c| c.split(\"_\")}.flatten.map do |c|\n case\n when c == c.downcase then c\n when c == \"Val\" then \"<ID or name>\"\n when c == \"Json\" \"<JSON>\"\n when c == \"String\" \"<string>\"\n else \"<#{c}>\"\n end\n end.join(\" \")\n end", "title": "" }, { "docid": "b82d7272ce3c7903340ad22cf0fa3c37", "score": "0.68308187", "text": "def print_help()\n puts self.desc\n puts \"Parameters:\"\n self.conf.each { |y|\n print \"#{y[:name]}\"\n print \" (#{BlackStack::SimpleCommandLineParser.type_name(y[:type])}. optional)\" if !y[:mandatory]\n print \" (#{BlackStack::SimpleCommandLineParser.type_name(y[:type])})\" if !y[:mandatory]\n print \": \"\n print y[:description]\n puts \"\"\n puts \"\"\n }\n end", "title": "" }, { "docid": "0bd06353bd18dd5ad22b6bfe25c9eb41", "score": "0.6824201", "text": "def help(*args)\n # Not used but tested for.\n end", "title": "" }, { "docid": "00933986e979a5e64df6667f5643be3a", "score": "0.6814828", "text": "def options_help(parser, options)\n parser.on_tail(\"--help\", \"display this help message\") do\n puts opt\n exit\n end\n end", "title": "" }, { "docid": "60dbd8dfbab83af204495da59356552c", "score": "0.68104726", "text": "def help_text\n build_html do\n p <<-'P1'\n Not much help needed here. This is just the source file that\n was pulled from CMVC.\n P1\n end\n end", "title": "" }, { "docid": "f2be7b1f35b7aa167315925fe9486b8e", "score": "0.68026274", "text": "def help\n super + subcommand_list.to_s\n end", "title": "" }, { "docid": "1ddee1f061bd41e25d93be58cefdf2d1", "score": "0.68015295", "text": "def help_info\n <<-EOH\nUsage: #{program_name} [options]\n #{short_hand_options}\n\n Options:\n#{option_details}\n#{version_info}\n EOH\n end", "title": "" }, { "docid": "64234bcd2ad8f4b7c87cbc260d3632a7", "score": "0.68002796", "text": "def help\n @parser\n end", "title": "" }, { "docid": "650f167394a4d56b9d9ca6e49d534fcb", "score": "0.6795435", "text": "def options(command_help, global_options, position = 2)\n str = \"\"\n options = command_help.options.merge(global_options)\n\n options.each do |name, opt|\n name = name.to_s.gsub(\"_\", \"-\")\n\n if opt.type == :boolean\n str << \"(--#{name})--#{name}[#{opt.description}]\\n\"\n else\n str << \"(--#{name})--#{name}=-[#{opt.description}]:#{opt.banner}:#{possible_values_for_opt(opt)}\\n\"\n end\n end\n return str\n end", "title": "" }, { "docid": "de2e4beb7b0cab63fad8946d7cd72c49", "score": "0.6788582", "text": "def help\n @commands_and_opts.unshift COMMANDS[:help]\n include_multiple_commands?\n self\n end", "title": "" }, { "docid": "5cb9a0a265add52ec2e17402b79eb044", "score": "0.6752119", "text": "def help_message()\n return 'I\\'ll give you a list of all available commands.'\n end", "title": "" }, { "docid": "19185d41494343dbe8f5c7d3e54fd7db", "score": "0.67480034", "text": "def help_text\n @attributes[:help_text]\n end", "title": "" }, { "docid": "1d75fe0a3599cee98ea01da5e9b21b81", "score": "0.67388093", "text": "def _help\n # make necessary configurations from app options\n end", "title": "" }, { "docid": "7c04c2e144845f741e204670b824edb5", "score": "0.6729429", "text": "def to_s\n out = \" \"\n out += short_flag ? \"-#{short_flag}, \" : ' ' * 4\n\n if long_flag\n out += \"--#{long_flag}\"\n if help.respond_to? :to_str\n out += \" #{help}\"\n size = long_flag.size + help.size + 1\n else\n size = long_flag.size\n end\n diff = @slop.longest_flag - size\n out += \" \" * (diff + 6)\n else\n out += \" \" * (@slop.longest_flag + 8)\n end\n\n \"#{out}#{description}\"\n end", "title": "" }, { "docid": "b39341617e5adfdbb569b310237f2246", "score": "0.67234004", "text": "def to_s\n out = \" \"\n out += @short_flag ? \"-#{@short_flag}, \" : ' ' * 4\n\n if @long_flag\n out += \"--#{@long_flag}\"\n if @help.respond_to? :to_str\n out += \" #{@help}\"\n size = @long_flag.size + @help.size + 1\n else\n size = @long_flag.size\n end\n diff = @slop.longest_flag - size\n out += \" \" * (diff + 6)\n else\n out += \" \" * (@slop.longest_flag + 8)\n end\n\n \"#{out}#{@description}\"\n end", "title": "" }, { "docid": "a2cc1825c71e6dc10347bf5c9f711c7a", "score": "0.6718372", "text": "def usage\n puts \"\\n#{@option_parser}\\n\"\n end", "title": "" }, { "docid": "e8bcb42b332f93f9eae209f4e92f6613", "score": "0.6709124", "text": "def usage_options\n label_width = @parser.options.collect{ |opt| opt.forms.length }.sort.last + 3\n String.new.tap do |s|\n s << \"Options:\"\n @parser.options.each do |opt|\n s << \"\\n \"\n s << sprintf(\"%-#{label_width}s\", opt.forms)\n s << opt.description\n end\n end\n end", "title": "" }, { "docid": "fc9ce37b33b0cfc2a0b4e61532780c31", "score": "0.6706121", "text": "def _help\n # make necessary configurations from app options\n parse\n end", "title": "" }, { "docid": "ab167bf157b00a67834020fce6d13028", "score": "0.67051065", "text": "def help\n\n # Global help\n help = @app.nil? ? \"\" : \"#{banner}\\n\"\n if [email protected]? && [email protected]?\n newline = @examples.strip_color[-1] != \"\\n\" ? \"\\n\" : \"\"\n help += \"Examples:\\n#{@examples}\\n#{newline}\"\n end\n app = @app || @app_default\n help += \"Usage: ./#{app} [commands] [options]\\n\"\n help += @config.find{|x| x.name == @k.global}.help\n help += \"COMMANDS:\\n\"\n @config.select{|x| x.name != @k.global}.each{|x| help += \" #{x.name.ljust(@just)}#{x.desc}\\n\" }\n help += \"\\nsee './#{app} COMMAND --help' for specific command help\\n\"\n\n return help\n end", "title": "" }, { "docid": "5c0b68be4d2ca98d238ee563540f2c1a", "score": "0.668818", "text": "def options\n @cmd.option_definition.table.values.sort{|a,b| a.long <=> b.long} + [HelpOption.help]\n end", "title": "" }, { "docid": "cee7e03ff1439319357f9bc80ebe320d", "score": "0.66727555", "text": "def help\n raise(\"help() not implemented by #{self.class} \")\n end", "title": "" }, { "docid": "12c2f8dabbb35fe1cbca08e2452c0bfe", "score": "0.66586363", "text": "def config_help_options()\n data = subscription_manager(['config', '--help'])\n opts = conf_help_parse(data) unless data.nil?\n unless opts.nil?\n Puppet.debug(\"Valid config parameters were #{opts}\")\n opts\n end\n end", "title": "" }, { "docid": "845b43000b0d026f910a047ff6e708e7", "score": "0.66567165", "text": "def default_help\n s = ['Wavefront CLI',\n '',\n 'Usage:',\n \" #{CMD} command [options]\",\n \" #{CMD} --version\",\n \" #{CMD} --help\",\n '',\n 'Commands:']\n\n cmds.sort.each do |k, v|\n s << format(' %-18<command>s %<desc>s',\n command: k,\n desc: v.description)\n end\n\n s << ''\n s << \"Use '#{CMD} <command> --help' for further information.\"\n s.join(\"\\n\")\n end", "title": "" }, { "docid": "d596c98af715bc4caff8705c00810d28", "score": "0.6652359", "text": "def help_with(short, long=\"--help\")\n @help_short = short\n @help_long = long\n end", "title": "" }, { "docid": "53cd9e9913e58b4d55ce815644ad8d5e", "score": "0.66479194", "text": "def usage_help\n\t \treturn <<-USAGE\nusage: help [command]\n\nProvides usage information for player commands. If called without parameters, shows the player usage.\n\nExamples:\n\nTo see all the commands availables in the player:\n\thelp\n\nTo see the usage for play command:\n\thelp play\n\n\t \tUSAGE\n\t end", "title": "" }, { "docid": "6cfb23c500f50e748df8c42540253aec", "score": "0.6644743", "text": "def usage\n \"store help [command]\"\n end", "title": "" }, { "docid": "1f72cc1964c48004e46e0a2f9955acf3", "score": "0.66355395", "text": "def class_options_help(shell, groups = T.unsafe(nil)); end", "title": "" }, { "docid": "1dcc6586a0bdf8fa5712826e2e969e52", "score": "0.6627071", "text": "def help\n commands.map(&:help).reject(&:blank?).join(\"\\n\")\n end", "title": "" }, { "docid": "392e61d83e20caa8378b209796525c9b", "score": "0.6625221", "text": "def to_usage\n name = option? ? to_option_name : to_arg_name\n desc = @desc.blank? ? '(no description)' : @desc\n [name, desc]\n end", "title": "" }, { "docid": "fe7c88bf6aae4969ff097e4f00c6a6f9", "score": "0.66171116", "text": "def help\n puts(Resources::HELP_MESSAGE)\n end", "title": "" }, { "docid": "ac86b135958a5c247acbb22b95af4de5", "score": "0.6608651", "text": "def getHelpComplex\n # help text\n # help text\n _(\n \"<p>Assign system services to runlevels by selecting the list entry of the respective service then\\nchecking or unchecking the <b>check boxes B-S</b> for the runlevel.</p>\\n\"\n ) +\n # help text\n _(\n \"<p><b>Start/Stop/Refresh:</b> Use this to start or stop services individually.</p>\"\n ) +\n # help text\n _(\n \"<P><B>Set and Reset:</B>\\n\" +\n \"Select runlevels in which to run the currently selected service.<ul>\\n\" +\n \"<li><b>Enable the service:</b> Activates the service in the standard runlevels.</li>\\n\" +\n \"<li><b>Disable the service:</b> Deactivates service.</li>\\n\" +\n \"<li><b>Enable all services:</b> Activates all services in their standard runlevels.</li>\\n\" +\n \"</ul></p>\\n\"\n ) +\n # The change does not occur immediately. After a reboot the system boots into the specified runlevel.\n _(\n \"<p>Changes to the <b>default runlevel</b> will take effect next time you boot your computer.</p>\"\n )\n end", "title": "" }, { "docid": "ed7b4307e6c18c4487ac400ab63f9c46", "score": "0.6606542", "text": "def usage\n return '' if options.nil? && args.nil?\n usage_args = args && @options && !has_splat_args? ?\n (@default_option ? [[@default_option.to_s, @file_parsed_args ? ''.inspect : '']] + args[0..-2] :\n args[0..-2]) : args\n str = args ? usage_args.map {|e|\n (e.size < 2) ? \"[#{e[0]}]\" : \"[#{e[0]}=#{@file_parsed_args ? e[1] : e[1].inspect}]\"\n }.join(' ') : '[*unknown]'\n str + option_help\n end", "title": "" }, { "docid": "33f832259d93d9956174990e65a3d625", "score": "0.6598415", "text": "def help_command(command_spec)\n self.class.get_help_formatter.help_command(command_spec)\n end", "title": "" }, { "docid": "31f0cd4b7c707db4bb3a44317ebcb809", "score": "0.6596007", "text": "def show_help\n puts @@long_desc\n exit 0\n end", "title": "" } ]
a66ac6ad586a5888370cefd4d670c63a
The idea of 'supplied' means it was provided to the object and not calculated in any way. This is used when determining the value for the endpoint, in the context of a github user vs github organization
[ { "docid": "83df7c76941055001eb4bdb38e68c641", "score": "0.56746244", "text": "def supplied_org\n @org\n end", "title": "" } ]
[ { "docid": "96cdf3f5a2a01b8259bfffaa4b1a356c", "score": "0.66620266", "text": "def user_provided_value; end", "title": "" }, { "docid": "96cdf3f5a2a01b8259bfffaa4b1a356c", "score": "0.66620266", "text": "def user_provided_value; end", "title": "" }, { "docid": "20409c4518c24811766c367dd3c7f4d1", "score": "0.55907404", "text": "def given_value=(value)\n @value = value\n @given = true\n end", "title": "" }, { "docid": "1214df8d8ef914cdfe4aec5b65cf46f2", "score": "0.55237937", "text": "def argument_in_value; end", "title": "" }, { "docid": "1214df8d8ef914cdfe4aec5b65cf46f2", "score": "0.55237937", "text": "def argument_in_value; end", "title": "" }, { "docid": "858789cc16b8ccd0dbfd46513232268f", "score": "0.5497806", "text": "def given\n @given\n end", "title": "" }, { "docid": "858789cc16b8ccd0dbfd46513232268f", "score": "0.5497806", "text": "def given\n @given\n end", "title": "" }, { "docid": "c3474b21bc91be3a322e03c50d30b91d", "score": "0.5358589", "text": "def required=(_arg0); end", "title": "" }, { "docid": "63ff9357f680a6827fc45b075a638dce", "score": "0.53027487", "text": "def given\r\n @given\r\n end", "title": "" }, { "docid": "51c599584ff357cdfa2babc5e873c923", "score": "0.528261", "text": "def provided_values\n @provided_values ||=\n begin\n values = @scenario_data[:user_values] || {}\n\n values.each_with_object({}) do |(key, value), collection|\n collection[key.to_s] = coerce_provided_value(key, value)\n end\n end\n end", "title": "" }, { "docid": "54fd54a94d6ab722ca604873be35c39a", "score": "0.5276296", "text": "def update!(**args)\n @original_value = args[:original_value] if args.key?(:original_value)\n @resolved_value = args[:resolved_value] if args.key?(:resolved_value)\n end", "title": "" }, { "docid": "5707fef7be448d59637c1ea66ed444ee", "score": "0.5264632", "text": "def assigned_name(name ='Bob')\n name\nend", "title": "" }, { "docid": "0b7cffbc0c78b76d74504cb5a0e59c8e", "score": "0.5258326", "text": "def desired=(_arg0); end", "title": "" }, { "docid": "558a3ebb43005ecff4cc64f06ca8db93", "score": "0.5243625", "text": "def argument_in_value=(_arg0); end", "title": "" }, { "docid": "558a3ebb43005ecff4cc64f06ca8db93", "score": "0.5243625", "text": "def argument_in_value=(_arg0); end", "title": "" }, { "docid": "ddf5ff0f744e8759c0751b3a17fc9cf0", "score": "0.52160037", "text": "def setupNewParam(_varied)\n return _varied ;\n end", "title": "" }, { "docid": "1a04e1912fce1db32cc9383803b3136b", "score": "0.5196262", "text": "def expected_from=(_arg0); end", "title": "" }, { "docid": "39f2383595ffb53447c04fb231f6e67a", "score": "0.5190866", "text": "def version_supplied=(_arg0); end", "title": "" }, { "docid": "39f2383595ffb53447c04fb231f6e67a", "score": "0.5190866", "text": "def version_supplied=(_arg0); end", "title": "" }, { "docid": "53d2bc2f550f8117a36e81c65775e478", "score": "0.51677865", "text": "def provided_variables; end", "title": "" }, { "docid": "c43ca25e885527842057d670d420eef1", "score": "0.51259", "text": "def check_arguments(provided_arguments)\n required_arguments.inject({}) do |checked_arguments, argument|\n raise ArgumentError, \"#{self} is missing required argument #{argument[:name]} from #{provided_arguments.inspect}\" unless provided_arguments.member?(argument[:name]) || argument.member?(:default)\n\n provided_argument = provided_arguments[argument[:name]] || argument[:default]\n # TODO check that provided_argument is serializable as json\n\n checked_arguments[argument[:name]] = provided_argument\n checked_arguments\n end\n end", "title": "" }, { "docid": "41515981d44cfa1febd9775595dc38a2", "score": "0.51225114", "text": "def redacted_argument_value(argument); end", "title": "" }, { "docid": "59eba12668691a7a058565612252f7a1", "score": "0.510629", "text": "def default_args\n {id: @id, username: @connection.username}\n end", "title": "" }, { "docid": "494ab5155533c3e1658b098f096797e2", "score": "0.5101415", "text": "def get(requested_property)\n \n end", "title": "" }, { "docid": "0f4df752781bb675ab7be8db0f211d16", "score": "0.50907636", "text": "def party_bonus(value, param = nil)\n value\n end", "title": "" }, { "docid": "2d32252b1b06324e62f203200593b53c", "score": "0.5089979", "text": "def method_missing(name, *arguments)\n if arguments.empty? && set?(name)\n get(name)\n else\n super\n end\n end", "title": "" }, { "docid": "984991907b90ed66d56c05eba51e92a8", "score": "0.50766116", "text": "def provided?(value)\n if value.is_a?(String)\n value.strip.size > 0\n else\n !value.nil?\n end\n end", "title": "" }, { "docid": "37ab1674592f0ca62d5ea4ab6aaab396", "score": "0.5065489", "text": "def rest_argument?; end", "title": "" }, { "docid": "37ab1674592f0ca62d5ea4ab6aaab396", "score": "0.5065489", "text": "def rest_argument?; end", "title": "" }, { "docid": "d3f1a9178d6b3b005fe373e8a772717b", "score": "0.505662", "text": "def party_bonus(value, param = nil); value; end", "title": "" }, { "docid": "88a4328e25cc6fabbaa25d074c3b876c", "score": "0.5048399", "text": "def context= supplied_context\n @context = supplied_context\n end", "title": "" }, { "docid": "ce55e06f3606fc9d1b13eb9f5a66e688", "score": "0.5044576", "text": "def argument; end", "title": "" }, { "docid": "ce55e06f3606fc9d1b13eb9f5a66e688", "score": "0.5044576", "text": "def argument; end", "title": "" }, { "docid": "ce55e06f3606fc9d1b13eb9f5a66e688", "score": "0.5044576", "text": "def argument; end", "title": "" }, { "docid": "ce55e06f3606fc9d1b13eb9f5a66e688", "score": "0.5044576", "text": "def argument; end", "title": "" }, { "docid": "ce55e06f3606fc9d1b13eb9f5a66e688", "score": "0.5044576", "text": "def argument; end", "title": "" }, { "docid": "321820abccaec4996f350ddf371369f6", "score": "0.5043209", "text": "def expects_argument?; end", "title": "" }, { "docid": "321820abccaec4996f350ddf371369f6", "score": "0.5043209", "text": "def expects_argument?; end", "title": "" }, { "docid": "9eefc0a5a1bc7af3356f789c8120a1df", "score": "0.5038118", "text": "def argument(value)\n case value\n when :required\n @required = true\n when :optional\n @required = false\n end\n self\n end", "title": "" }, { "docid": "f7e8f5c630d590972565d51a0b3093a5", "score": "0.5030944", "text": "def update!(**args)\n @required = args[:required] if args.key?(:required)\n end", "title": "" }, { "docid": "f43fb58a9994038ddaa897de12901510", "score": "0.5022604", "text": "def default_arguments\n\t\t{\n\t\t\t:version => @version,\n\t\t\t:api_key => @api_key\n\t\t}\n\tend", "title": "" }, { "docid": "8ba772292e090d540ac970b6f3f5f2e2", "score": "0.50184315", "text": "def update!(**args)\n @required = args[:required] unless args[:required].nil?\n end", "title": "" }, { "docid": "83a6fe1cdbadc05481d3b7901a5e6f04", "score": "0.4997859", "text": "def context= supplied_context\n @context = supplied_context\n end", "title": "" }, { "docid": "83a6fe1cdbadc05481d3b7901a5e6f04", "score": "0.4997859", "text": "def context= supplied_context\n @context = supplied_context\n end", "title": "" }, { "docid": "2160d6fae8230e54d353a43331aad772", "score": "0.49971014", "text": "def provide( expected )\n Provide.new( expected )\n end", "title": "" }, { "docid": "a3dc8b6db1e6584a8305a96ebb06ad21", "score": "0.49960512", "text": "def need_params\n end", "title": "" }, { "docid": "8fef7dba1118b94ddd1522e46e4999eb", "score": "0.49959323", "text": "def customised(value)\n _customised(value) or fail ArgumentError, \"Unknown value for customised: #{value}\"\n end", "title": "" }, { "docid": "50d75320d61efacda9310391f68a06b6", "score": "0.49821743", "text": "def sanitize_params(supplied='', allowed=[], default=nil)\n raise ArgumentError, \"A default value is required.\" unless default\n return default if supplied.blank? || allowed.blank? || ! allowed.include?(supplied)\n return supplied\n end", "title": "" }, { "docid": "df2496c6c0a3648b3ef8345b8c5f34b5", "score": "0.49584764", "text": "def user=(_arg0); end", "title": "" }, { "docid": "df2496c6c0a3648b3ef8345b8c5f34b5", "score": "0.49584764", "text": "def user=(_arg0); end", "title": "" }, { "docid": "df2496c6c0a3648b3ef8345b8c5f34b5", "score": "0.49584764", "text": "def user=(_arg0); end", "title": "" }, { "docid": "df2496c6c0a3648b3ef8345b8c5f34b5", "score": "0.49584764", "text": "def user=(_arg0); end", "title": "" }, { "docid": "df2496c6c0a3648b3ef8345b8c5f34b5", "score": "0.49584764", "text": "def user=(_arg0); end", "title": "" }, { "docid": "9545be664c54cba67a8999b87aec019f", "score": "0.49529535", "text": "def user(arg=nil)\n set_or_return(\n :user,\n arg,\n :kind_of => [ String ]\n )\n end", "title": "" }, { "docid": "602bb0877be0ed1458fb554735125ea9", "score": "0.4943848", "text": "def update!(**args)\n @direct_user_request = args[:direct_user_request] if args.key?(:direct_user_request)\n @ip_address = args[:ip_address] if args.key?(:ip_address)\n @user_agent = args[:user_agent] if args.key?(:user_agent)\n @user_id = args[:user_id] if args.key?(:user_id)\n end", "title": "" }, { "docid": "c9f1af465866d59613fd9e2e2442c2f0", "score": "0.49383134", "text": "def param; end", "title": "" }, { "docid": "c9f1af465866d59613fd9e2e2442c2f0", "score": "0.49383134", "text": "def param; end", "title": "" }, { "docid": "c9f1af465866d59613fd9e2e2442c2f0", "score": "0.49383134", "text": "def param; end", "title": "" }, { "docid": "c9f1af465866d59613fd9e2e2442c2f0", "score": "0.49383134", "text": "def param; end", "title": "" }, { "docid": "c9f1af465866d59613fd9e2e2442c2f0", "score": "0.49383134", "text": "def param; end", "title": "" }, { "docid": "a3adca4fc2b7c37e925bfb841ee3d419", "score": "0.49305746", "text": "def set_fuel_supplied\n @fuel_supplied = FuelSupplied.find(params[:id])\n end", "title": "" }, { "docid": "a3adca4fc2b7c37e925bfb841ee3d419", "score": "0.49305746", "text": "def set_fuel_supplied\n @fuel_supplied = FuelSupplied.find(params[:id])\n end", "title": "" }, { "docid": "6720f29f8a8aff1bd5a197ccda3a7254", "score": "0.49271032", "text": "def update!(**args)\n @effective_value = args[:effective_value] if args.key?(:effective_value)\n @etag = args[:etag] if args.key?(:etag)\n @local_value = args[:local_value] if args.key?(:local_value)\n @metadata = args[:metadata] if args.key?(:metadata)\n @name = args[:name] if args.key?(:name)\n end", "title": "" }, { "docid": "4166c0637f1de38c3f80e0a7a32d713d", "score": "0.49264944", "text": "def set_value(raw_value, product = nil, extract=\"\", author=nil)\n self.value_genuine = raw_value # trigger the method value_genuine=\n self.product = product if product\n self.author = author || User.get_user_system \n self.extract = extract\n self.save\n self\n end", "title": "" }, { "docid": "da0bdaed6d9d314822e1ba679083bc0f", "score": "0.49225077", "text": "def method_missing(name, *args)\n @test = name\n @value = args.first\n end", "title": "" }, { "docid": "e03036159c55062749d91cfdef648dd1", "score": "0.49194744", "text": "def inspect\n desc = dry_initializer.params.first.desc || \"A resulting value\"\n \"Output: #{desc}\\n\"\n end", "title": "" }, { "docid": "56ecefec7a484bcd269955dfa31e2bce", "score": "0.49193728", "text": "def provisional=(_arg0); end", "title": "" }, { "docid": "5512aa3c4245af6ad3449cc188e6ef2b", "score": "0.49174803", "text": "def requester_managed\n data[:requester_managed]\n end", "title": "" }, { "docid": "0e6b935deebcddddd8cd1a65c98ef4f4", "score": "0.49171677", "text": "def resolved_value=(_arg0); end", "title": "" }, { "docid": "0e6b935deebcddddd8cd1a65c98ef4f4", "score": "0.49171677", "text": "def resolved_value=(_arg0); end", "title": "" }, { "docid": "47a6927f20009e564947553abf3987d1", "score": "0.49156582", "text": "def assign_updated_by_user\n self.updated_by = RequestStore.store[:current_user] if RequestStore.store[:current_user].present?\n end", "title": "" }, { "docid": "758a2e4483d795b6dc527caf8c37b5df", "score": "0.4907222", "text": "def update!(**args)\n @object_value = args[:object_value] if args.key?(:object_value)\n end", "title": "" }, { "docid": "758a2e4483d795b6dc527caf8c37b5df", "score": "0.4907222", "text": "def update!(**args)\n @object_value = args[:object_value] if args.key?(:object_value)\n end", "title": "" }, { "docid": "b6bdc99fe694f2d843c1840fe67c8904", "score": "0.49053892", "text": "def resolved_value; end", "title": "" }, { "docid": "b6bdc99fe694f2d843c1840fe67c8904", "score": "0.49053892", "text": "def resolved_value; end", "title": "" }, { "docid": "b3e719fa240215bd66d7e03516f04316", "score": "0.4894541", "text": "def sanitize_params(supplied='', allowed=[], default=nil)\n raise ArgumentError, \"A default value is required.\" unless default\n return default.to_s if supplied.blank? || allowed.blank? || ! allowed.map{ |x| x.to_s }.include?(supplied.to_s)\n return supplied\n end", "title": "" }, { "docid": "18258908649263e22022f27f0275cfb8", "score": "0.48908007", "text": "def request_params=(_arg0); end", "title": "" }, { "docid": "096231763ba01b4adbe04fba4528a596", "score": "0.48891523", "text": "def update!(**args)\n @display_name = args[:display_name] unless args[:display_name].nil?\n @email = args[:email] unless args[:email].nil?\n @id_token = args[:id_token] unless args[:id_token].nil?\n @kind = args[:kind] unless args[:kind].nil?\n @provider_user_info = args[:provider_user_info] unless args[:provider_user_info].nil?\n end", "title": "" }, { "docid": "59fb77a0a26b512d1662dd5222488075", "score": "0.48890933", "text": "def bound_value\n end", "title": "" }, { "docid": "50cbb668fd328660a28d48b60787f3c8", "score": "0.48882386", "text": "def provided?\n value.present? && predicate.present?\n end", "title": "" }, { "docid": "0a457ff54f6163cb201218377ac4ab42", "score": "0.48761794", "text": "def user_param\n params[Clearance.configuration.user_parameter] || Hash.new\n end", "title": "" }, { "docid": "e7041f1b205e1c270283d94646cb7bd9", "score": "0.48741466", "text": "def default_value(arg = nil)\n return self[__method__] unless arg\n #log :debug, \"Declaring #{name}.default_value: #{arg}\"\n debug{\"Declaring #{name}.default_value: #{arg}\"}\n self[:default_value] = arg\n end", "title": "" }, { "docid": "da0142e6baf9aa3b3e98d43680e26197", "score": "0.48728096", "text": "def update!(**args)\n @http_request = args[:http_request] if args.key?(:http_request)\n @report_location = args[:report_location] if args.key?(:report_location)\n @source_references = args[:source_references] if args.key?(:source_references)\n @user = args[:user] if args.key?(:user)\n end", "title": "" }, { "docid": "406277c1327bb8bca031cca4577e2783", "score": "0.486995", "text": "def user_info(chosen_user)\n\n puts \"chosen parameter #{chosen_user}\"\n puts \"#{chosen_user[:name]} ID: #{chosen_user[:id]}\"\n \nend", "title": "" }, { "docid": "9edb24ef64df4c623a52317b4acb899d", "score": "0.4860482", "text": "def asked_with_id(_key, _options={}, &_block)\n _chain_context(Canned::Context::Value, _block) do |stack|\n param = @ctx.params[_key]\n break false if param.nil?\n stack.push :value, _options.fetch(:as, _key), param.to_i\n end\n end", "title": "" }, { "docid": "e7014e3b4536082742b59c8281979155", "score": "0.48570773", "text": "def execute(*args)\n super['value']\n end", "title": "" }, { "docid": "22cedc7bf6749c5a730c17ddb7c38970", "score": "0.48538652", "text": "def used_by=(_arg0); end", "title": "" }, { "docid": "0a310ed82f7e1f3a0292f9825e070cf4", "score": "0.4853504", "text": "def permitted=(_arg0); end", "title": "" }, { "docid": "13375ecab781ad3c87e987814c5311ad", "score": "0.48495358", "text": "def request_parameters; end", "title": "" }, { "docid": "064db40434d3118fcf11f794e1fc7dcb", "score": "0.48454186", "text": "def default_value\n args.fetch(:default, nil)\n end", "title": "" }, { "docid": "aee943085b60e8f1ed25285eb6072b1b", "score": "0.4843301", "text": "def update!(**args)\n @value = args[:value] unless args[:value].nil?\n end", "title": "" }, { "docid": "bf468f414ee3a8426edc6c0e286a2221", "score": "0.48410118", "text": "def PO304=(arg)", "title": "" }, { "docid": "b47b1031f61d77dddd71c11d352e53ac", "score": "0.48406583", "text": "def given_name=(value)\n @given_name = value\n end", "title": "" }, { "docid": "b47b1031f61d77dddd71c11d352e53ac", "score": "0.48406583", "text": "def given_name=(value)\n @given_name = value\n end", "title": "" }, { "docid": "b47b1031f61d77dddd71c11d352e53ac", "score": "0.48406583", "text": "def given_name=(value)\n @given_name = value\n end", "title": "" }, { "docid": "b47b1031f61d77dddd71c11d352e53ac", "score": "0.48406583", "text": "def given_name=(value)\n @given_name = value\n end", "title": "" }, { "docid": "b47b1031f61d77dddd71c11d352e53ac", "score": "0.48406583", "text": "def given_name=(value)\n @given_name = value\n end", "title": "" }, { "docid": "47da1d5f7123b0d3cf0c39a55a26fb92", "score": "0.48277462", "text": "def arguments_with_default_values; end", "title": "" }, { "docid": "f4bbcb87d44102736aaec6cc5ac6f357", "score": "0.48260358", "text": "def provided?(attribute)\n @attributes.is_a?(Hash) && !(@attributes[attribute].blank? && @attributes[\"#{attribute}_id\"].blank?)\n end", "title": "" }, { "docid": "cd0ca5b657e618278f0cb7cb242e3075", "score": "0.48130554", "text": "def value_used?; end", "title": "" } ]
7e3cbf1b1f47fb5db469799f76858ddc
Updates the indexed keys for the given node. If the node's attribute has changed since it was added to the collection, the old indexed keys will be replaced with the updated ones.
[ { "docid": "179d82fc8ace7efc755a8d11e4218007", "score": "0.6716597", "text": "def update(node)\n @index_names.each { |name| update_index(name, node) }\n end", "title": "" } ]
[ { "docid": "c921171e634719c4540b654a3e8ce0f1", "score": "0.6955184", "text": "def update_index(name, node)\n index = self.index(name)\n old_key = index.key(node)\n new_key = value(node, name)\n\n # Only replace the key if it's changed\n if old_key != new_key\n remove_from_index(name, old_key)\n add_to_index(name, new_key, node)\n end\n end", "title": "" }, { "docid": "4e632372411045bce3d75f559a9f72ab", "score": "0.63617617", "text": "def update_with_cert_info!(indexed_node_objects) \n @indexed_cert_keys = indexed_node_objects.inject({}) do |h, (component_type, node_object)| \n h.merge(component_type => node_object.cert_keys_indexed_by_component_index)\n end\n self\n end", "title": "" }, { "docid": "1e3ae8da8b8eb547b05ad2b9ba02dcfa", "score": "0.5747079", "text": "def update_node!(node)\n node.remove()\n @store.append(node.key, node.val)\n end", "title": "" }, { "docid": "67c9635ba7d91514b3efc10117d8d135", "score": "0.5743119", "text": "def update_node!(node)\n node.remove\n @store.append(node.key, node.val)\n end", "title": "" }, { "docid": "d9592a772c49f2a02139ca6812f1eeb2", "score": "0.5731498", "text": "def reindex(node)\n @nodes_to_be_reindexed[node.neo_node_id] = node\n end", "title": "" }, { "docid": "cf695dbfc5fd596ed7ba92bfb0f177a3", "score": "0.573065", "text": "def set(full_key, node); end", "title": "" }, { "docid": "c10d6a8845db2e4be014b80347458099", "score": "0.57267445", "text": "def update_key_map; end", "title": "" }, { "docid": "009c4fb5fc652ab3b496ce8d407d8c25", "score": "0.57173985", "text": "def add_to_index(name, key, node)\n index(name)[key] = node\n index(:\"#{name}_to_s\")[key.to_s] = node\n index(:\"#{name}_to_sym\")[:\"#{key}\"] = node if to_sym?(key)\n end", "title": "" }, { "docid": "634721ef8431a1c61f897bf54082c922", "score": "0.56890994", "text": "def []=(full_key, node); end", "title": "" }, { "docid": "0598a5b8a767a3d8b5d49dea157d27d6", "score": "0.5634767", "text": "def update_keys hash\n\t\t\t\told_keys = self.list.keys \n\t\t\t\tnew_keys = (old_keys + hash.keys.map(&:to_s)).uniq \n\t\t\t\tself.list.keys = new_keys #we are updating the first row.\n\t\t\tend", "title": "" }, { "docid": "4411da2fb80400d47e2c0356454d2c7b", "score": "0.55087376", "text": "def update_keys(project_id, req_params)\n name = 'Keys'\n params = { query: project_id, req: req_params.to_array_obj(:keys) }\n\n data = endpoint(name: name, params: params).do_put\n\n collection name, data\n end", "title": "" }, { "docid": "7999491f554a46f9920e0c92e40929b8", "score": "0.54555106", "text": "def update_keys\n KeyManager.update_keys\n end", "title": "" }, { "docid": "b4e14edb354b0cb5066edea6f2ec5fdc", "score": "0.5444889", "text": "def update(key)\n index = @indexes[key]\n sift(index) if index\n end", "title": "" }, { "docid": "27af4cb1e7773d7d9f7fa8dacab4171c", "score": "0.5394448", "text": "def key_will_change!(attribute)\n changed_keys[attribute] = clone_key_value(attribute)\n end", "title": "" }, { "docid": "9be9bbda657286cab110d95253607773", "score": "0.53628063", "text": "def update_key(args)\n\tupdate_rec = JSON.parse(get_the_json(\"#{args[:collection]}-#{args[:key]}-update-#{args[:jmc]}-record\"))\n\toriginal_rec = JSON.parse(args[:client].get_key(collection: args[:collection], key: args[:key]))\n\tupdate_rec.keys.each do |k|\n\t\tunless k == args[:update_idx]\n\t\t\toriginal_rec[k] = update_rec[k]\n\t\tend\n\tend\n\tjson = JSON.generate(original_rec)\n\targs[:client].put_key(collection: args[:collection], key: args[:key], json: json)\nend", "title": "" }, { "docid": "71406c6ee3c879f3af9bab6a1af05d3b", "score": "0.53419495", "text": "def update(object)\n @index.key_persisted(object)\n end", "title": "" }, { "docid": "5c414d4fdbc25bec6d3d56b09cf216db", "score": "0.53278947", "text": "def add_key(key)\n self << key\n @key_indexes[key] = @key_indexes.size\n end", "title": "" }, { "docid": "7de60268c44e83fc43720d9ed3931a4f", "score": "0.5303834", "text": "def update_node(key, value)\n remove_node(key)\n add_node(key, value)\n end", "title": "" }, { "docid": "5d62b2981eea730c52db4f759dbbeba9", "score": "0.5220775", "text": "def update_in_index\n remove_from_index\n add_to_index\n end", "title": "" }, { "docid": "4f193f4d550380d0f99ee36dfc89247e", "score": "0.5201673", "text": "def __update_indices\n model.indices.values.each do |index|\n __robject.indexes[index.riak_name] = index.value_from(attributes)\n end\n end", "title": "" }, { "docid": "1ba2615a6d00af69147d131cbe8e2513", "score": "0.51941293", "text": "def set_node_attributes(job, nodes, attribute_keys, state)\n nodes.concurrent_map do |node|\n node.reload\n attribute_keys.each do |attribute_key|\n job.set_status(\"Setting node attribute '#{attribute_key}' to #{state.nil? ? 'nil' : state} on #{node.name}\")\n node.set_chef_attribute(attribute_key, state)\n end\n node.save\n end\n end", "title": "" }, { "docid": "3ba05159d9c9f2f8164b9f303c4eaf7e", "score": "0.51915413", "text": "def normalize_keys(node)\n case node\n when Hash\n node.inject({}) {|normalized, (key, val)| normalized.merge({normalize_key(key) => normalize_keys(val)})}\n \n when Array\n node.map(&method(:normalize_keys))\n \n else\n node\n end\nend", "title": "" }, { "docid": "642e1ce75f65b5826afb92f697b1f40a", "score": "0.5185419", "text": "def manipulate_keys!(&block)\n @store.keys.each do |old_name|\n new_name = block.call(old_name)\n unless new_name == old_name\n @store[new_name] = @store[old_name]\n @store.delete(old_name)\n end\n end\n end", "title": "" }, { "docid": "ceb2fc7b82fe382175b66fe64e2b8951", "score": "0.51419353", "text": "def key_change(attribute)\n [changed_keys[attribute], __send__(attribute)] if key_changed?(attribute)\n end", "title": "" }, { "docid": "e056565008c9f92ffe111efac487dc6d", "score": "0.50980574", "text": "def regenerate_node_lookup\n @nodes_hash = {}\n\n nodes.each do |node|\n @nodes_hash[node.key] = node\n end\n end", "title": "" }, { "docid": "05b9c7ab9a756fa40d1683872cc04b76", "score": "0.50965846", "text": "def []=(idx,*args)\n if String === idx or Symbol === idx\n idx = @keys.key_pos(idx) || @keys.add_key(idx.to_sym)\n end\n super(idx, *args)\n end", "title": "" }, { "docid": "ad218ea6e6a96d168c6fbab0ef9e2609", "score": "0.5062994", "text": "def change_index(key)\n @data_repository.create_index(key)\n end", "title": "" }, { "docid": "d74a1ff95a0526f4539a253a96ded0bb", "score": "0.5037292", "text": "def unupdatable_keys(resource)\n if resource.respond_to?(:unupdatable_keys)\n # TODO: deprecation warning about Resource#unupdatable_keys\n resource.unupdatable_keys\n else\n resource.model.key.map { |property| property.name } << delete_key\n end\n end", "title": "" }, { "docid": "f31e41ead64e60127fada07376e970d0", "score": "0.50301796", "text": "def updateKey(n, new_key)\r\n\t\tif(new_key < n.key)\r\n\t\t\tn.key = new_key\r\n\t\t\tn.pos = bubble_up(n.pos) #swap to bubble_down for maxheap\r\n\t\telse\r\n\t\t\tn.key = new_key\r\n\t\t\tn.pos = bubble_down(n.pos)\r\n\t\tend\r\n\tend", "title": "" }, { "docid": "ea3e2467cb54da37d10c434e2f7700f5", "score": "0.5016148", "text": "def reindex\n @indexes = {}\n add_to_indexes( @records )\n end", "title": "" }, { "docid": "b850fdb7eba79d7da58d0f4d8b17d50a", "score": "0.5000603", "text": "def update_index\n if self.is_dirty\n job = KeywordIndexUpdateJob.new(self.class.name, object_key)\n Delayed::Job.enqueue job, :priority => 10\n self.is_dirty = false\n end\n end", "title": "" }, { "docid": "952dfc56a34436475bed1566479c4872", "score": "0.49967664", "text": "def unupdatable_keys\n model.key.to_a.map { |property| property.name } << :_delete\n end", "title": "" }, { "docid": "08867acc731b3473d650672f0cd62811", "score": "0.49962562", "text": "def []=(key,value)\n @dirty_keys << key\n @delete_keys -= [key]\n super\n end", "title": "" }, { "docid": "427aa797eb6fd7aac43d96804272210a", "score": "0.49815625", "text": "def update(model, item)\n model[name] ||= { 'data': [], 'index': {} }\n model[name]['data'] << item.stringify_keys\n index(model)\n end", "title": "" }, { "docid": "a20b424c99278d39a41dafa9839b993a", "score": "0.4976743", "text": "def cache_node(key, node, node_hash)\n node_hash.each do |property, value|\n next if property == 'ServiceID'\n\n update_cache(key, value, property, node)\n end\n end", "title": "" }, { "docid": "cf5959e8afe3e556b0109e5b209de796", "score": "0.49715847", "text": "def reindex\n return unless search_data.keys.detect { |key| send(\"#{key}_changed?\") }\n Rails.logger.debug \"User #{id} is gonna be re-indexed\"\n super\n end", "title": "" }, { "docid": "c5aea7a00dc102dae3721b093453d67c", "score": "0.49475777", "text": "def update_headers\n process_headers\n\n # TODO: sign with some server key?\n update_columns(node_headers: node_headers)\n end", "title": "" }, { "docid": "071b2c7db6831a9388ce6ce1babfd822", "score": "0.4941316", "text": "def incr(key); end", "title": "" }, { "docid": "071b2c7db6831a9388ce6ce1babfd822", "score": "0.4941316", "text": "def incr(key); end", "title": "" }, { "docid": "887d133b0b0c722d1a9d70f0cbfdc14d", "score": "0.49280807", "text": "def key_mapping(table, field)\n @key_mappings << KeyMapping.new(table, field)\n end", "title": "" }, { "docid": "1d3dbdcab4c8a0e34e92da08df5c518f", "score": "0.49265304", "text": "def change_key_info(current_list)\n updated_list = Marshal.load(Marshal.dump(current_list))\n updated_list.each do |folder,folder_info|\n folder_info['keys'].each do |key,key_info|\n if key_info['value'].is_a?(Array) || key_info['value'].is_a?(String)\n key_info['value'] = key_info['value'] + key_info['value']\n end\n\n if key_info['value'].is_a?(TrueClass) || key_info['value'].is_a?(FalseClass)\n key_info['value'] = ! key_info['value']\n end\n\n if key_info['value'].is_a?(Hash)\n key_info['value']['new_key'] = 'new string elem'\n end\n\n if key_info['value'].is_a?(Numeric)\n key_info['value'] *= 10\n end\n\n key_info['metadata']['version'] = 2\n end\n end\n\n updated_list\n end", "title": "" }, { "docid": "93a31cf57365a80f6da45603be36c565", "score": "0.4918034", "text": "def update_keys(project_id, params)\n c_r Lokalise::Resources::Key, :update, project_id, params, :keys\n end", "title": "" }, { "docid": "bcbcd9ea5bbe7891ca5ea212ba6cea71", "score": "0.49167234", "text": "def old_cluster_keys\n @old_cluster_keys ||= @old_cluster.keys(\"*\")\n end", "title": "" }, { "docid": "0120c7e2970a2488614028f361fe602c", "score": "0.491477", "text": "def rekey_all!\r\n # rekey keys for each root. will do children\r\n _pos = 1\r\n root_rational = RationalNumber.new\r\n self.roots.each do |root|\r\n new_rational = root_rational.child_from_position(_pos)\r\n if new_rational != root.rational_number\r\n root.move_to_rational_number(new_rational.nv, new_rational.dv, {:force => true})\r\n root.save_with_force_rational_numbers!\r\n # root.reload # Should caller be responsible for reloading?\r\n end\r\n root.rekey_children\r\n _pos += 1\r\n end\r\n end", "title": "" }, { "docid": "06e35d3b1602c711040b6771007fed35", "score": "0.4905827", "text": "def keys=(keys)\n extend ArrayKeys::KeyAccess if keys\n @keys = keys.frozen? ? keys.dup : keys\n unless @keys.respond_to?(:key_pos)\n @keys.extend(ArrayKeys::KeySet)\n end\n end", "title": "" }, { "docid": "a0d4db2b88047178290bd6262be33d97", "score": "0.48938224", "text": "def changed_keys\n @changed_keys ||= {}\n end", "title": "" }, { "docid": "420697cc8f08d5657123fe592182804d", "score": "0.48927653", "text": "def update\n raise Textdb::UpdateOnKey, \"Key cannot be updated.\"\n end", "title": "" }, { "docid": "b0b798314563dcda7d7a3cb124d3c6f9", "score": "0.48871377", "text": "def update_indexed_attributes(hash)\n hash.each do |k, v|\n @hash[k.first] = Array(v)\n end\n end", "title": "" }, { "docid": "b0b798314563dcda7d7a3cb124d3c6f9", "score": "0.48871377", "text": "def update_indexed_attributes(hash)\n hash.each do |k, v|\n @hash[k.first] = Array(v)\n end\n end", "title": "" }, { "docid": "6e0abd30a72b91337e703df732d7aff4", "score": "0.48867095", "text": "def rekey!(oldkey, newkey)\n if self.has_key? oldkey\n self[newkey] = self.delete(oldkey)\n end\n \n nil\n end", "title": "" }, { "docid": "5c1404aa2e3075cac4fe019f7832ae0e", "score": "0.48671713", "text": "def key=(new_key)\n if new_key\n @key = new_key\n end\n @key\n end", "title": "" }, { "docid": "5c1404aa2e3075cac4fe019f7832ae0e", "score": "0.48671713", "text": "def key=(new_key)\n if new_key\n @key = new_key\n end\n @key\n end", "title": "" }, { "docid": "8b4a908633eb08620d81074ce91e751d", "score": "0.4862849", "text": "def update\n super\n update_key_scan\n end", "title": "" }, { "docid": "92be5dd5203fe515e0903872543c2571", "score": "0.48493004", "text": "def touch(key)\n\n @lru_keys.delete(key)\n @lru_keys << key\n end", "title": "" }, { "docid": "cf24cbd23d96ca4d6ad6c3b781e4b891", "score": "0.48409563", "text": "def key=(key)\n key.push(*key.dup) until key.count >= self.count\n\n self.zip(key).map do |note,key|\n note.key = key\n end\n end", "title": "" }, { "docid": "5c66a4f5460c2f9ae54854807355114d", "score": "0.48407072", "text": "def rebuild_index_nodes\n # Delete all old indices\n IndexTree::IndexNode.delete_all({:root_element => self})\n\n # Creates index node for the current tree node, and invokes recursive call for the children of the node\n create_index_nodes_for_children(self)\n end", "title": "" }, { "docid": "c81b6e5603f3e9669696fcf321111d1b", "score": "0.48343453", "text": "def add_keys(key)\n @keys.add_keys(key)\n end", "title": "" }, { "docid": "78331a2bce076e8121f4a8b1b5abcfe0", "score": "0.48276436", "text": "def add_to_index \n return false unless ::Mebla.context.index_exists? # only try to index if the index exists \n return false unless ::Mebla.context.indexed_models.include?(self.class.name)\n \n # Prepare attributes to hash\n to_index_hash = {:id => self.id.to_s}\n \n # If the document is embedded set _parent to the parent's id\n if self.embedded?\n parent_id = self.send(self.class.embedded_parent_foreign_key.to_sym).id.to_s \n to_index_hash.merge!({ \n (self.class.embedded_parent_foreign_key + \"_id\").to_sym => parent_id,\n :_parent => parent_id\n })\n end\n \n # Add indexed fields to the hash\n self.class.search_fields.each do |sfield|\n if self.class.fields[sfield.to_s]\n to_index_hash[sfield] = self.attributes[sfield.to_s]\n else\n to_index_hash[sfield] = self.send(sfield)\n end\n end\n \n # Add indexed relations to the hash \n self.class.search_relations.each do |relation, fields| \n entries = self.send(relation.to_sym)\n \n next if entries.nil?\n \n if entries.is_a?(Array) || entries.is_a?(Mongoid::Relations::Targets::Enumerable)\n next if entries.empty?\n to_index_hash[relation] = []\n entries.each do |entry|\n if fields.is_a?(Array)\n to_index_hash[relation] << entry.attributes.reject{|key, value| !fields.include?(key.to_sym)}\n else\n to_index_hash[relation] << { fields => entry.attributes[fields.to_s] }\n end\n end\n else \n to_index_hash[relation] = {}\n if fields.is_a?(Array)\n to_index_hash[relation].merge!(entries.attributes.reject{|key, value| !fields.include?(key.to_sym)})\n else\n to_index_hash[relation].merge!({ fields => entries.attributes[fields.to_s] })\n end\n end\n end \n \n ::Mebla.log(\"Indexing #{self.class.slingshot_type_name}: #{to_index_hash.to_s}\", :debug)\n \n # Index the data under its correct type\n response = ::Mebla.context.slingshot_index.store(self.class.slingshot_type_name.to_sym, to_index_hash)\n \n ::Mebla.log(\"Response for indexing #{self.class.slingshot_type_name}: #{response.to_s}\", :debug)\n \n # Refresh the index\n ::Mebla.context.refresh_index\n return true\n rescue => error\n raise_synchronization_exception(error)\n \n return false\n end", "title": "" }, { "docid": "80b65c0a985fbb4a170a4d7d49dfafbe", "score": "0.48117885", "text": "def []=(i, key)\n return key if @keys[i] == key\n return @keys[i] = key unless @keys[i]\n oldkey = @keys[i]\n raise 'detected duplicated key' if @h[key]\n @keys[i] = key\n @h[key] = @h.delete(oldkey)\n key\n end", "title": "" }, { "docid": "a781b1e6395419602aef3709302bff8f", "score": "0.48113403", "text": "def sync_keys\n @mutex.synchronize do\n @sync_keys.clone\n end\n end", "title": "" }, { "docid": "9e355b9ef225c71feb26c62eeccc37df", "score": "0.47965837", "text": "def addKey(key) \n if(key > @lastNode)\n nodeKeys = @keysTable[@firstNode]\n nodeKeys.push(key)\n else\n for i in key .. @lastNode\n if( (@keysTable[i] != nil) && (@keysTable[i] != \"\") )\n nodeKeys = @keysTable[i]\n nodeKeys.push(key)\n @keysTable[i] = nodeKeys\n break\n end\n end\n end\n end", "title": "" }, { "docid": "9633e38ad53d03f634b04a45068e48ae", "score": "0.47860488", "text": "def inc(key)\n \n end", "title": "" }, { "docid": "53e126dfeeadd2d67927c566ec2fd3f1", "score": "0.47840083", "text": "def update_keys!(&block)\n @copied_object = copied_object.each_with_object({}) do |pair, memo|\n key = pair.first\n new_key = block.call(key)\n value = pair.last\n if value.is_a?(Footing::Hash)\n memo[new_key] = value.update_keys!(&block)\n elsif value.is_a?(::Array)\n memo[new_key] = value.map do |val|\n if val.is_a?(Footing::Hash)\n val.update_keys!(&block)\n else\n val\n end\n end\n else\n memo[new_key] = value\n end\n end\n\n self\n end", "title": "" }, { "docid": "52a25b3fbb7f716b90df917b9c631eac", "score": "0.47731838", "text": "def incr\n @nc_index.incr()\n end", "title": "" }, { "docid": "93017a46e388075f090df8c5faebfc41", "score": "0.477242", "text": "def add_node_to_index(neo, index_name, key, value, node)\n neo.add_node_to_index(index_name, key, value, node)\nrescue Neography::NotFoundException\n neo.create_node_index(index_name)\n retry\nend", "title": "" }, { "docid": "2fccc0e4d4623b0764177255e6cb2119", "score": "0.47523308", "text": "def increment_hits!\n Node.without_search_reindex do # No update of the search index is necessary.\n Node.increment_counter :hits, self.id\n end\n end", "title": "" }, { "docid": "1b3a906992de1d0c5b6953703164e055", "score": "0.47486138", "text": "def update!(**args)\n @attribute_keys = args[:attribute_keys] if args.key?(:attribute_keys)\n end", "title": "" }, { "docid": "635df89b35030e7027d0e1e5efbb04eb", "score": "0.4746954", "text": "def indexed_cert_keys\n self.keys_handle.indexed_cert_keys\n end", "title": "" }, { "docid": "0c4325dc5f2e41b9557b1d80bfbf97fe", "score": "0.47462255", "text": "def set_attribute_on_node(node, key, value)\n key_parts = key.split('.')\n output_entry = key_parts[0...-1].inject(node.override) { |element, k| element[k] }\n output_entry[key_parts.last] = value\n end", "title": "" }, { "docid": "5f75c2cc007f57e6857b27e07a7b3ab1", "score": "0.47451475", "text": "def add_to_index(lineno, field_name, index_name, key)\n #p \"#{lineno}: Add key #{key} to index #{index_name} to field #{field_name} of #{@class_stack.last[0]}\"\n #There are many cases where there can be multiple records of the same GEDCOM type, in the parent record, so we store these in an array.\n #e.g. CHIL xrefs can occur multiple times in FAM record.\n add_to_class_field(lineno, field_name, Xref.new(index_name, *key) )\n end", "title": "" }, { "docid": "54cdcc62d33301e53677d0289b8d59ce", "score": "0.47428438", "text": "def assoc key\n\n\t\[email protected] key\n\tend", "title": "" }, { "docid": "138ef93d97780d28025a2d6524bcf524", "score": "0.47428238", "text": "def inc(key)\r\n \r\n end", "title": "" }, { "docid": "073deb43a813580c68617cee838b6eb8", "score": "0.47399136", "text": "def integerize_keys!\n\t\tself.keys.each do |key|\n\t\t\tself[key.to_i] = self[key]\n\t\t\tself.delete key\n\t\tend\n\t\tself\n\tend", "title": "" }, { "docid": "9a918b5fb340bad69d191cb3c551804c", "score": "0.4732664", "text": "def []=(key, value)\n index = index(key, @size)\n if @items[index] && @items[index].value != value\n if key == @items[index].key\n # existing key with different value, ignore insertion\n return\n else\n # collision\n new_index = next_open_index(index)\n if new_index == -1\n # no empty space\n resize()\n self[key] = value\n else\n # insertion at new index\n @items[new_index] = Node.new(key, value)\n #print()\n end\n end\n else\n # new or duplicated insertion at empty location\n \t@items[index] = Node.new(key,value)\n \t#print()\n end\n end", "title": "" }, { "docid": "b61fea4f922ca4217ec5d3095a501e1b", "score": "0.47295508", "text": "def xkeys_on_final (node, key, value)\n\tmeter node, key\n end", "title": "" }, { "docid": "e68156ba37df08f99d63ce5d5fe52583", "score": "0.47271365", "text": "def old_key=(value)\n @old_key = value\n end", "title": "" }, { "docid": "9ac93581f106460529b6067633591e9a", "score": "0.47257388", "text": "def add_keys(new_keys)\n if new_keys.is_a? KeySet\n add_keys(new_keys.keys)\n else\n [*new_keys].each { |new_key| @key_map[new_key.kid] = new_key }\n end\n end", "title": "" }, { "docid": "1b3ae89639f55392b98c88f901a34d4a", "score": "0.47246015", "text": "def rekey_children\r\n _pos = 1\r\n this_rational_number = self.rational_number\r\n self.children.each do |child|\r\n new_rational_number = this_rational_number.child_from_position(_pos)\r\n move_node_and_save_if_changed(child, new_rational_number)\r\n _pos += 1\r\n end\r\n end", "title": "" }, { "docid": "0ece98bd71a92cad01e28d9b4bf75786", "score": "0.47216466", "text": "def key_ids=(value)\n @key_ids = value\n end", "title": "" }, { "docid": "a5a719760233cf02867ec859afbdd6b7", "score": "0.47172982", "text": "def touch_keys\n [ \"executive_instance:#{@instance_id}\",\n \"event_counters:#{@instance_id}\",\n \"event_counters:#{@instance_id}\",\n \"event_counters:#{@instance_id}\",\n \"event_counters:#{@instance_id}\" ].each {|key|\n @redis.expire(key, 1036800)\n }\n end", "title": "" }, { "docid": "a5a719760233cf02867ec859afbdd6b7", "score": "0.47172982", "text": "def touch_keys\n [ \"executive_instance:#{@instance_id}\",\n \"event_counters:#{@instance_id}\",\n \"event_counters:#{@instance_id}\",\n \"event_counters:#{@instance_id}\",\n \"event_counters:#{@instance_id}\" ].each {|key|\n @redis.expire(key, 1036800)\n }\n end", "title": "" }, { "docid": "22666c2dc255aad6528bf6d01b65999c", "score": "0.47142875", "text": "def normalize_keys(mapping); end", "title": "" }, { "docid": "9637c8238a833eb7df720edd97af25a7", "score": "0.4709845", "text": "def key=(new_key)\n if !new_key.nil?\n @key = new_key\n end\n @key\n end", "title": "" }, { "docid": "9637c8238a833eb7df720edd97af25a7", "score": "0.4709845", "text": "def key=(new_key)\n if !new_key.nil?\n @key = new_key\n end\n @key\n end", "title": "" }, { "docid": "9637c8238a833eb7df720edd97af25a7", "score": "0.4709845", "text": "def key=(new_key)\n if !new_key.nil?\n @key = new_key\n end\n @key\n end", "title": "" }, { "docid": "7c5d3b694f22828c07a1fd0b2f042ef4", "score": "0.47079888", "text": "def []=(key, value)\n arr_index = index(key, size)\n if @items[arr_index] == nil #no existing object at index\n @items[arr_index] = Node.new(key, value)\n @item_count += 1\n elsif (@items[arr_index].key == key) &&\n (@items[arr_index].value == value)\n return @items\n else #exisitng element at index\n nextIndex = next_open_index(arr_index)\n if (@items[arr_index].key == key) && #element has same key\n (@items[arr_index].value != value) && #element has different value\n (nextIndex == -1) #no space in the array\n resize\n arr_index = index(key, size)\n @items[arr_index] = Node.new(key, value)\n @item_count += 1\n elsif nextIndex == -1 # no additional space\n resize\n self[key] = value\n else # exisitng elemet but there is space in the array\n @items[nextIndex] = Node.new(key, value)\n @item_count += 1\n end\n end\n end", "title": "" }, { "docid": "c984168ff08d0652837f0c1cd813d325", "score": "0.47048366", "text": "def node_update(node, facts)\n logger.debug \" updating #{node}\"\n connection[nodes_collection].find(_id: node).replace_one(facts,\n upsert: true,\n bypass_document_validation: true,\n check_keys: false,\n validating_keys: false)\n rescue ::Mongo::Error::OperationFailure => e\n logger.warn \" updating #{node} failed with: #{e.message}\"\n # mongodb doesn't support keys with a dot\n # see https://docs.mongodb.com/manual/reference/limits/#Restrictions-on-Field-Names\n # as a dirty workaround we delete the document and insert it ;-)\n # The dotted field .. in .. is not valid for storage. (57)\n # .. is an illegal key in MongoDB. Keys may not start with '$' or contain a '.'.\n # (BSON::String::IllegalKey)\n raise e unless e.message =~ /The dotted field / || e.message =~ /is an illegal key/\n logger.warn \" we transform the dots into underline characters\"\n begin\n facts = Hash[facts.map { |k, v| [k.tr('.', '_'), v] }]\n connection[nodes_collection].find(_id: node).replace_one(facts,\n upsert: true,\n bypass_document_validation: true,\n check_keys: false,\n validating_keys: false)\n rescue\n logger.error \" inserting node #{node} failed again with: #{e.message}\"\n end\n end", "title": "" }, { "docid": "6c031d20c243340113f3baa497e4b613", "score": "0.47028834", "text": "def update_index\n if should_be_in_index?\n mapper.process_with([record]) do |context|\n writer.put(context)\n end\n else\n writer.delete(record.ark_id)\n end\n end", "title": "" }, { "docid": "9bb15f54655a9166a67f0ae92c168837", "score": "0.469794", "text": "def reindex\n add_primary_key unless primary_key?\n column_key_index = column_index(partition_key)\n\n if column_key_index.present?\n connection.remove_index(table_name, name: column_key_index.name)\n end\n connection.add_index(table_name, partition_key, using: 'btree')\n end", "title": "" }, { "docid": "a64dd1c905208950f8f8f2a2b3937384", "score": "0.4694805", "text": "def inc(key)\n\n end", "title": "" }, { "docid": "41cbf52daaa9a3cff4ee9ddd68ca0682", "score": "0.4693552", "text": "def root_key!\n @_key = true\n @_key_for_collection = true\n end", "title": "" }, { "docid": "197d8a5771dce2a442d20a10c57850c7", "score": "0.46893233", "text": "def map_attrib!(hash, old_key, new_key)\n unless hash[old_key].nil?\n hash[new_key] = hash[old_key].to_i\n hash.delete(old_key)\n end\n end", "title": "" }, { "docid": "1d8a7d8573e6cfe701223b82c336237c", "score": "0.46848398", "text": "def rename_key(old_key, new_key)\n @driver.rename_key old_key, new_key\n end", "title": "" }, { "docid": "56c643b157349c2b8933640ccd482cbd", "score": "0.46808672", "text": "def add_attribute_to_indexes(id_dbs, key_dbs, value_dbs)\n \n return unless @use_idx\n \n db_add_to_value @idx1, value_dbs + DB_SEP + key_dbs, id_dbs\n db_add_to_value @idx2, id_dbs + DB_SEP + value_dbs, key_dbs\n\n return unless @use_add_idx\n \n db_add_to_value @k_idx, key_dbs, id_dbs\n db_add_to_value @v_idx, value_dbs, id_dbs\n db_add_to_value @id_idx, id_dbs, key_dbs\n end", "title": "" }, { "docid": "3889436363baa66ea137740070be303b", "score": "0.46790496", "text": "def updateable(keys, context = nil)\n keys\n end", "title": "" }, { "docid": "9a47d5dcbb9c6e544b88e6253298a626", "score": "0.46739388", "text": "def rename_store_key(old, new)\n mod_store[new] = mod_store.delete old\n end", "title": "" }, { "docid": "be42b3ebca73554ad58c488cab99e264", "score": "0.467357", "text": "def updates_index\n return {} if ticket.nil? or !new_record?\n \n ticket.changed.inject({}) do |result, name|\n old_value, new_value = ticket.send(:attribute_change, name)\n store_changes!(result, name.to_s, old_value, new_value)\n result\n end\n end", "title": "" }, { "docid": "55d1d6635f81ef681e74de2b89e19abe", "score": "0.46639788", "text": "def key_for entry\n @indexer.call entry\n end", "title": "" }, { "docid": "1251cd32781c360d303a6ad86ac56fc3", "score": "0.46622467", "text": "def update_search_index\r\n permission_hash = self.to_permission_hash\r\n if permission_hash\r\n permission_hash.each{|key, value| permission_hash[key] = Artifact.stem(value)}\r\n update_index(permission_hash) unless permission_hash.empty?\r\n end\r\n end", "title": "" }, { "docid": "98252f38a01a50cd6d6aafe0696bf38a", "score": "0.46593472", "text": "def update(index_writer)\n index_writer.updateDocument(java_key_term, java_document)\n end", "title": "" } ]
b9eb89693687fd06cf47fea5cc4ba8a1
Test 3: Populated group, populated description, populated media
[ { "docid": "cd6834a9789b9b49234dde025387c8a7", "score": "0.5337723", "text": "def test03_EmptyGPopDMPublish\n\t\t\tloginPost\n\t\t\t$browser.goto($patch_media)\n\t\t\tsleep 2\n\t\t\tif $post_media_description.exists?\n\t\t\t\t$post_media_description.set(\"Media Description #{random}.\")\n \t\t\t\tpostGroupPop\n\t\t\t\t$post_media_button.click\n\t\t\t\t$post_media_file_upload.set(\"#{$post_media_username}/patch-automation/test/TestData/GlacierBasinTrailMtRainier.JPG\")\n\t\t\t\tpostPublishLater\n\t\t\t\t$post_now.fire_event(\"onclick\")\n\t\t\telse puts \"PPL04T03: FAILED! User unable to locate Post button.\"\n\t\t\tend\n\t\t\t\n\t\t\tbegin\n\t\t\tsleep 2\n\t\t\tassert $post_scheduled_post.exists?\n\t\t\t\trescue => e\n\t\t\t\tputs (\"PPL04T03: FAILED! User unable to Post.\")\n\t\t\t\tputs e\n\t\t\tend\t\n\t\tend", "title": "" } ]
[ { "docid": "9c42d539cef1bb09f2b445669302f510", "score": "0.6182834", "text": "def test03_MediaAllFields\n\t\tloginPost\n\t\t$browser.goto($patch_media)\n\t\t\t\n\t\t\tsleep 2\n\t\t\tif $post_media_description.exists?\n\t\t\t\t$post_media_description.set(\"pictures of hiking mr. rainier #{random}.\")\n \t\t\t\tpostGroupPop\n \t\t\t\tpostGroupPop2\n\t\t\t\t$post_media_button.click\n\t\t\t\t$post_media_file_upload.set(\"#{$post_media_username}/patch-automation/test/TestData/GlacierBasinTrailMtRainier.JPG\")\n\t\t\t\t$post_media_button.click\n\t\t\t\t$post_media_file_upload.set(\"#{$post_media_username}/patch-automation/test/TestData/GlacierBasinTrailMtRainier.JPG\")\n\t\t\t\t$post_now.fire_event(\"onclick\")\n\t\t\telse puts \"P01T03: FAILED! User unable to locate Post button.\"\n\t\t\tend\n\t\t\t\n\t\tbegin\n\t\tsleep 2\n\t\tassert $post_new_post.exists?\n\t\t\trescue => e\n\t\t\tputs (\"P01T03: FAILED! User unable to Post.\")\n\t\t\tputs e\n\t\tend\t\n\tend", "title": "" }, { "docid": "1ac03a3807eb028410f2e77c17ddc435", "score": "0.59075284", "text": "def prepare\n insert_recording_reporter\n link_example_groups\n end", "title": "" }, { "docid": "fad3349ae054bd997f2b25cd9cd677de", "score": "0.5896443", "text": "def test04_group_photo_all\n\t\n\t\tloginGroup\n\t\t$browser.goto($patch_mongooses_settings)\n\t\t$group_image_1.fire_event(\"onclick\")\n\t\t$post_media_file_upload.set(\"#{$post_media_username}/patch-automation/test/TestData/GlacierBasinTrailMtRainier.JPG\")\n\t\t$span_3_frames.click\n\t\t$upload_frames_save.click\t\n\tend", "title": "" }, { "docid": "88d6ac74feea7885839353f1cd2cfb56", "score": "0.5869768", "text": "def test_data_extraction\n\t\tYAML.load_file('test/groups.yml')[\"groups\"].each do |g_data|\n\t\t\tstub_request(:get, g_data[\"url\"]).\n\t\t\tto_return(:status => 200, :body => File.read(\"test/yahoo_pages/#{g_data['id']}.html\"), :headers => {})\n\n\t\t\tgroup = YahooGroupData.new(g_data[\"url\"])\n\t\t\tassert_equal g_data[\"age_restricted\"], group.age_restricted?\n\t\t\tassert_equal g_data[\"private\"], group.private?\n\t\t\tassert_equal g_data[\"not_found\"], group.not_found?\n\t\t\tassert_equal g_data[\"name\"], group.name\n\t\t\tassert_equal g_data[\"description\"], group.description\n\t\t\tassert_equal g_data[\"post_email\"], group.post_email\n\t\t\tassert_equal g_data[\"subscribe_email\"], group.subscribe_email\n\t\t\tassert_equal g_data[\"owner_email\"], group.owner_email\n\t\t\tassert_equal g_data[\"unsubscribe_email\"], group.unsubscribe_email\n\t\t\tassert_equal g_data[\"founded\"], group.founded\n\t\t\tassert_equal g_data[\"language\"], group.language\n\t\t\tassert_equal g_data[\"num_members\"], group.num_members\n\t\t\tassert_equal g_data[\"category\"], group.category\n\t\tend\n\tend", "title": "" }, { "docid": "71db08dfb05dbd3d5dac57ce4179525e", "score": "0.5866028", "text": "def print_group(group)\n puts \"Name: \" + group.name\n puts \"Description: \" + (group.description.nil? ? \"None\" : group.description)\n puts \"Status: \" + group.status\n puts \"Href: \" + group.href\nend", "title": "" }, { "docid": "466ac64cd2ed16b3c19d83570db2db38", "score": "0.58597565", "text": "def create_new_media(data_set)\n enter_media_info_data data_set\n click_save_button\n when_exists(delete_button, Config.short_wait)\nend", "title": "" }, { "docid": "48ba3099a4af0fcc332d3ea12e4ada5e", "score": "0.58203477", "text": "def test02_MediaTwoComments\n\t\tcommentMediaPop\n\t\tcommentPopSubmit\n\tend", "title": "" }, { "docid": "12367f916a05f8a1852a6377fe86b696", "score": "0.579718", "text": "def test04_MediaPhotoVideo\n\t\tlogin $editor_1_email, $master_password\n\t\t$browser.goto($patch_boards_pre_closed_article_new)\n\t\t\n#\t\t$post_activate_note.when_present.fire_event(\"onclick\")\n#\t\t$post_media_description.set(\"mt townsend is my favorite mountain #{random}.\")\n\t\tif $environment == 'nixon'\t\n\t\t\trepostGroupPop #category already selected in staging\n\t\tend\n\t\t$post_article_title.set(\"Mountain #{random}\")\n \t\t$browser.execute_script(\"jQuery('iframe.wysihtml5-sandbox').contents().find('body').prepend('mt townsend is my favorite mountain #{random}.')\")\n\t\tsleep 2\n\t\t$post_add_media_article.click\n\t\tfile_upload \"DungenessSpit102.26.2012.mov\"\n\t\tsleep 2\n\t\t$post_add_media_article.click\n\t\tfile_upload \"GlacierBasinTrailMtRainier.JPG\"\n if $environment == 'staging'\n\t\t\tsleep 10 #loads \n\t\tend\n\t\t$post_now_edit.fire_event(\"onclick\")\n\n\t\tsleep 2\n\t\tassert $post_new_post.exists?\n\tend", "title": "" }, { "docid": "e22a89c40481132481bbcfc796b37f7a", "score": "0.5786218", "text": "def test03_MediaOneComment_TC_24319\n\t\tcommentMediaPop\n\t\tcommentPopSubmit\n\tend", "title": "" }, { "docid": "f2909fa01e4e42d9eaf966b71859bc66", "score": "0.5750121", "text": "def test_10b\r\n db = build\r\n nm = File.join(test_data,'image-1.jpg')\r\n db['group1'].store(nm)\r\n assert File.exists?(File.join(db.root,'groups',\r\n 'group1','originals',\r\n 'image-1.jpg'))\r\n end", "title": "" }, { "docid": "4af0a4e31f6310fa9a86d6c5b33692ae", "score": "0.5724611", "text": "def test_initialize_group\r\n \ttest_group = ProspectorGroup.new\r\n \ttest_group.intialize_group(33, 3)\r\n \tassert_equal 3, test_group.num_prospectors\r\n \tassert_equal 0 , test_group.iteration_count\r\n end", "title": "" }, { "docid": "e333b3273e521589f2d2c9dd907fce54", "score": "0.56800336", "text": "def test_10d\r\n db = build\r\n nm = File.join(test_data,'image-1.jpg')\r\n nm2 = File.join(test_data,'image-2.jpg')\r\n db['group1']['group2'].store(nm)\r\n assert File.exists?(File.join(db.root,'groups',\r\n 'group1','groups','group2',\r\n 'originals','image-1.jpg'))\r\n assert !File.exists?(File.join(db.root,'groups',\r\n 'group1','originals',\r\n 'image-1.jpg'))\r\n db['group1'].store(nm)\r\n assert File.exists?(File.join(db.root,'groups',\r\n 'group1','originals',\r\n 'image-1.jpg'))\r\n end", "title": "" }, { "docid": "72ca5454f8c396456ed7a4b5664bc7a4", "score": "0.56672174", "text": "def creating_experimental_media(media_hash)\n media_hash.each { |media, quant|\n log_info 'media', media\n if media != -1\n show {\n title \"Creating Experimental Induction Media\"\n separator\n if media.include? 'Kan'\n check \"In an appropriate container, aliquot <b>#{(quant * 3.3).round(2)}mL</b> of <b>M9 + Kan Media</b> and label: <b>#{MEDIA_LABEL_HASH[media]}</b>\"\n else\n check \"In an appropriate container, aliquot <b>#{(quant * 3.3).round(2)}mL</b> of <b>M9 Media</b> and label: <b>#{MEDIA_LABEL_HASH[media]}</b>\"\n end\n if media.include? 'IPTG'\n check \"To the tube labeled #{MEDIA_LABEL_HASH[media]}, add <b>#{(quant * 3.3 * 0.25).round(2)}µl</b> of <b>1M IPTG</b>\" # calculates inducer per 1mL of media\n end\n if media.include? 'arab'\n check \"To the tube labeled #{MEDIA_LABEL_HASH[media]}, add <b>#{(quant * 3.3 * 25).round(2)}µl</b> of <b>1M Arabinose</b>\" # calculates inducer per 1mL of media\n end\n }\n end\n }\n end", "title": "" }, { "docid": "911bf0e5a3e82328069c0269efa69198", "score": "0.5660328", "text": "def create_samples data\n data.each do |line|\n if !line.empty?\n if line[0].include? \"sample\"\n # check and see if this sample exists in inventory\n sample_array = line[0].partition(\":\")\n sample_name = sample_array[2].strip #removes leading and trailing whitespace.\n sample_check = Sample.find_by_name(sample_name)\n if sample_check.nil?\n # create the media\n sample = createMedia(sample_name, \"new sample\", \"media\")\n show do\n title \"Sample Created\"\n \n note \"The sample #{sample_name} has been sucessfully created in Aquarium\"\n end\n end\n end\n end\n end \n \n show do\n title \"Samples Created\"\n \n note \"The samples in #{FILENAME} have been sucessfully created in Aquarium.\"\n note \"Please double check and see if you include the word \\\"sample:\\\" before your sample name.\"\n end\n end", "title": "" }, { "docid": "2aaa701ca40769966b14cabd7d1e8a9f", "score": "0.56449544", "text": "def test02_EmptyMPopGD\n\t\t\tloginPost\n\t\t\t$browser.goto($patch_media)\n\t\t\tsleep 2\n\t\t\tif $post_pick_group.exists?\n\t\t\t\tpostGroupPop\n\t\t\t\t$post_media_description.set(\"Media Description #{random}.\")\n\t\t\t\t$post_now.fire_event(\"onclick\")\n\t\t\telse puts \"PEV04T02: FAILED! User unable to locate Post button.\"\n\t\t\tend \t\t\t\t\n\t\t\t\n\t\t\tbegin\n\t\t\tassert $post_now.exists?\n\t\t\t\trescue => e\n\t\t\t\tputs (\"PEV04T02: FAILED! User able to Post.\")\n\t\t\t\tputs e\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "400f73662b77c95d2a37f6e4cb70208d", "score": "0.56371725", "text": "def test_groupdetail_constructor_and_accessors\n\n obj = SmsCountryApi::Group::GroupDetail.new\n refute_nil obj, \"Object wasn't created successfully.\"\n assert_kind_of SmsCountryApi::Group::GroupDetail, obj, \"Object isn't the correct type.\"\n assert_nil obj.id, \"ID isn't nil.\"\n assert_nil obj.name, \"Name isn't nil.\"\n assert_nil obj.tiny_name, \"Tiny name isn't nil.\"\n assert_nil obj.start_call_on_enter, \"Start call on enter isn't nil.\"\n assert_nil obj.end_call_on_exit, \"End call on exit isn't nil.\"\n assert_nil obj.members, \"Members isn't nil.\"\n\n end", "title": "" }, { "docid": "60fa9fe3e677f90c3028a32703076f80", "score": "0.5613941", "text": "def create_fake\n record = MediaElement.new\n record.title = params[:title_placeholder] != '0' ? '' : params[:title]\n record.description = params[:description_placeholder] != '0' ? '' : params[:description]\n record.tags = params[:tags_value]\n record.user_id = current_user.id\n record.save_tags = true\n record.valid?\n @errors = convert_media_element_error_messages record.errors\n @errors[:media] = t('forms.error_captions.media_file_too_large').downcase\n end", "title": "" }, { "docid": "e85521f84ab6d13c221d13abd3da9070", "score": "0.56070447", "text": "def test02_group_photo_center\n\t\n\t\tloginGroup\n\t\t$browser.goto($patch_mongooses_settings)\n\t\t$group_image_2.fire_event(\"onclick\")\n\t\t$post_media_file_upload.set(\"#{$post_media_username}/patch-automation/test/TestData/GlacierBasinTrailMtRainier.JPG\")\n\t\t$upload_frames_save.click\t\t\n\tend", "title": "" }, { "docid": "439b040e6503820ee6eb724abe3e7d0d", "score": "0.5587021", "text": "def test_attributes\n assert_equal \"Gallery 1\", @gallery.title\n assert @gallery.active?\n assert_equal \"f82dd0bd-4711-4578-ac47-4661257e69a6\", @gallery.guid\n end", "title": "" }, { "docid": "b49891db4d7bf75fd28cf81a5531b708", "score": "0.5580887", "text": "def createMedia(nameStr, descriptionStr, projectStr)\n s = Sample.creator(\n {\n sample_type_id: SampleType.find_by_name(\"Media\").id,\n description: descriptionStr,\n name: nameStr, \n project: projectStr\n }, User.find(1) )\n end", "title": "" }, { "docid": "7e70f95a82497a24d412dc6cfe58a823", "score": "0.55749774", "text": "def test04_post_closed_board_GroupRepostMedia\n\t\trepostMediaPop\n\t\tsleep 3\n\t\tgroupAddRemoveAdd \"Repost text #{random}.\"\n \t\tsleep 3\n\t\t\n\t\tassert $repost_confirmation.exists?\n\tend", "title": "" }, { "docid": "577937035ef3bb2c647421905b0682a6", "score": "0.5557129", "text": "def test03_EmptyGPopDM\n\t\t\tloginPost\n\t\t\t$browser.goto($patch_media)\n\t\t\tsleep 2\n\t\t\tif $post_media_description.exists?\n\t\t\t\t$post_media_description.set(\"Media Description #{random}.\")\n \t\t\t\tpostGroupPop\n\t\t\t\t$post_media_button.click\n\t\t\t\t$post_media_file_upload.set(\"#{$post_media_username}/patch-automation/test/TestData/GlacierBasinTrailMtRainier.JPG\")\n\t\t\t\t$post_now.fire_event(\"onclick\")\n\t\t\telse puts \"PEV04T03: FAILED! User unable to locate Post button.\"\n\t\t\tend\n\t\t\t\n\t\t\tbegin\n\t\t\tsleep 2\n\t\t\tassert $post_new_post.exists?\n\t\t\t\trescue => e\n\t\t\t\tputs (\"PEV04T03: FAILED! User unable to Post.\")\n\t\t\t\tputs e\n\t\t\tend\t\n\t\tend", "title": "" }, { "docid": "38f28f93dfa909f2d0d74a112f803a17", "score": "0.5545012", "text": "def show\n @ordered_group_members = sort_by_name(admins) + sort_by_name(@group.users - admins)\n @group_users = (@group.users - admins).size > NUMBER_OF_SHOWN_USERS ? (@group.users - admins).shuffle : sort_by_name(@group.users - admins)\n @group_admins = admins.size > NUMBER_OF_SHOWN_USERS ? sort_by_name(admins) : admins.shuffle\n\n # RECOMMENDATIONS\n sorted_recommendations = @group.recommendations.sort_by(&:created_at).reverse!\n @recommendations = sorted_recommendations.first(NUMBER_OF_SHOWN_RECOMMENDATIONS)\n @number_of_recommendations = sorted_recommendations.length\n @provider_logos = AmazonS3.instance.provider_logos_hash_for_recommendations(@recommendations)\n\n @group_picture = Group.group_images_hash_for_groups [@group]\n\n # ACTIVITIES\n @activities = PublicActivity::Activity.order(Arel.sql('created_at desc')).select {|activity| (@group.users.collect(&:id).include? activity.owner_id) && activity.group_ids.present? && (activity.group_ids.include? @group.id) }\n @activity_courses = {}\n @activity_courses_bookmarked = {}\n if @activities.present?\n @activities.each do |activity|\n @activity_courses[activity.id] = case activity.trackable_type\n when 'Recommendation' then Recommendation.find(activity.trackable_id).course\n when 'Course' then Course.find(activity.trackable_id)\n when 'Bookmark' then Bookmark.find(activity.trackable_id).course\n end\n @activity_courses_bookmarked[activity.id] = @activity_courses[activity.id].bookmarked_by_user? current_user if @activity_courses[activity.id].present?\n # privacy settings\n if activity.key == 'course.enroll'\n @activities -= [activity] unless activity.owner.course_enrollments_visible_for_group(@group)\n end\n end\n end\n\n # PICTURES\n @profile_pictures = User.author_profile_images_hash_for_activities(@activities)\n @profile_pictures = User.user_profile_images_hash_for_users(@group.users, @profile_pictures)\n end", "title": "" }, { "docid": "e5c7a4c9cbb021119b796610c22bdf57", "score": "0.55406666", "text": "def album\r\n #prepare_new_album extracted for reuse from spec\r\n prepare_new_album unless @content\r\n end", "title": "" }, { "docid": "a0734020a6fd51894f401e72df297785", "score": "0.5505871", "text": "def test_creating_public_description\n # We want to create an empty, default public description for a name that\n # doesn't have any descriptions yet -- simplest possible case.\n @name = Name.find_by(text_name: \"Strobilurus diminutivus\")\n assert_equal([], @name.descriptions)\n @description_data = {\n source_type: \"public\",\n source_name: nil,\n readable: true,\n writable: true,\n notes: \"I like this mushroom.\"\n }\n @group_expectations = {\n admins: [UserGroup.reviewers],\n writers: [UserGroup.all_users],\n readers: [UserGroup.all_users],\n authors: [],\n editors: [mary]\n }\n\n admin = open_admin_session(dick)\n reviewer = open_normal_session(rolf)\n owner = open_normal_session(mary)\n random_user = open_normal_session(katrina)\n lurker = open_lurker_session\n\n reviewer.should_be_reviewer\n owner.should_not_be_reviewer\n random_user.should_not_be_reviewer\n\n # sets (not checks) the abilities\n admin.should_be_able_to_do_anything\n reviewer.should_be_able_to_do_anything_but_change_permissions\n owner.should_be_able_to_edit_and_change_name\n random_user.should_be_able_to_edit_text_only\n lurker.should_be_able_to_see_but_needs_to_login\n\n owner.create_name_description\n owner.check_name_description\n\n admin.check_abilities\n reviewer.check_abilities\n owner.check_abilities\n random_user.check_abilities\n lurker.shouldnt_be_able_to_do_anything\n end", "title": "" }, { "docid": "256deba64f76fd422cead4b26c42363e", "score": "0.5489862", "text": "def setup_group(new_group)\n # original alignment\n @altered_alignment = false\n # set new own group\n @group = new_group\n # set up enemy groups\n @negative = $game_system.alignments[@group].enemies.clone\n # set up ally groups\n @positive = $game_system.alignments[@group].allies.clone\n # set up always-neutral groups\n @neutral = $game_system.alignments[@group].neutral.clone\n end", "title": "" }, { "docid": "82ed2beb1e0bdaca47b6bbb5ec27ef3c", "score": "0.54737115", "text": "def test04_post_closed_news_TwoGroupsRepostMedia\n\t\trepostMediaPop\n\t\tsleep 3\n\t\ttwoGroupSelect\n\t\tsleep 3\n\t\t\n\t\tassert $repost_confirmation.exists?\n\tend", "title": "" }, { "docid": "4e479ea2fddba22c5c7c365923eb71b3", "score": "0.54635686", "text": "def test03_4GroupsRepostMedia\n\t\trepostMediaPop\n\t\tsleep 3\n\t\tfourGroupSelect\n\t\tsleep 3\n\t\t\n\t\tbegin \n\t\tassert $repost_confirmation.exists?\n\t\t\trescue => e\n\t\t\tputs \"RS06T03: FAILED! User unable to repost!\"\n\t\t\tputs e\n\t\tend\n\tend", "title": "" }, { "docid": "998a2a8837ab3b518327f94c8f5d9e0d", "score": "0.5463395", "text": "def full_description(example_group)\n example_group.metadata.fetch(:full_description)\n end", "title": "" }, { "docid": "8875da20d1a489ad2629be8c7bb9b38e", "score": "0.54346174", "text": "def test_12a\r\n db = build\r\n db.not_found_image = 'image-1.jpg'\r\n assert_equal 'image-1.jpg',db.not_found_image\r\n assert_equal 'image-1.jpg',db['group1'].not_found_image\r\n assert_equal 'image-1.jpg',db['group1']['group2'].not_found_image\r\n\r\n db['group1'].not_found_image = 'image-2.jpg'\r\n assert_equal 'image-2.jpg',db['group1'].not_found_image\r\n end", "title": "" }, { "docid": "b65570b6a36e5ef571b089035d89618b", "score": "0.54293805", "text": "def list_media_details(gallery_name = \"test\", _browser = @browser)\n wait = Selenium::WebDriver::Wait.new(:timeout => 15)\n Log.logger.info(\"Listing Media properties and ids to edit it (for Gallery: #{gallery_name.inspect})\")\n self.open_gallery(gallery_name)\n wait.until { _browser.find_element(:xpath => @galmgr.edit_media) }.click\n frame = wait.until { _browser.find_element(:xpath => @galmgr.edit_overlay_frame) }\n _browser.switch_to.frame(frame)\n edit_media_ids = Hash.new\n i = 1\n wait.until { _browser.find_element(:xpath => \"//div[contains(@id, 'media-edit-')]\") }\n med_ct = Integer(_browser.find_elements(:xpath => \"//div[contains(@id, 'media-edit-')]\").size)\n Log.logger.info(\"Found editable images: #{med_ct}\")\n while i < med_ct+1\n media_url = _browser.find_element(:xpath => \"//div[contains(@id, 'media-edit-#{i}')]//img[contains(@class, '')]\").attribute(\"src\")\n Log.logger.info(\"Working on image number #{i}: #{media_url.inspect}\")\n if (i == 1)\n if(_browser.find_elements(:xpath => \"//select[@id = 'edit-field-license-und']\").size < 1)\n media_license_setting = \"\"\n media_type = \"video\"\n else\n media_license_setting = \"//select[@id = 'edit-field-license-und']\"\n media_type = \"image\"\n end\n media_title = \"//input[@id = 'edit-media-title-und-0-value']\"\n media_description = \"//textarea[@id = 'edit-media-description-und-0-value']\"\n media_tag = \"//input[@id = 'edit-field-tags-und']\"\n else\n if(_browser.find_elements(:xpath => \"//select[@id = 'edit-field-license-und--#{i}']\").size < 1)\n media_license_setting = \"\"\n media_type = \"video\"\n else\n media_license_setting = \"//select[@id = 'edit-field-license-und--#{i}']\"\n media_type = \"image\"\n end\n media_title = \"//input[@id = 'edit-media-title-und-0-value--#{i}']\"\n media_description = \"//textarea[@id = 'edit-media-description-und-0-value--#{i}']\"\n media_tag = \"//input[@id = 'edit-field-tags-und--#{i}']\"\n end\n\n Log.logger.info(\"image number #{i} media-type: #{media_type.inspect}\")\n Log.logger.info(\"image number #{i} media-title: #{media_title.inspect}\")\n edit_media_ids[media_url] = Hash.new() unless (edit_media_ids[media_url])\n edit_media_ids[media_url][:license] = media_license_setting\n edit_media_ids[media_url][:tag] = media_tag\n edit_media_ids[media_url][:desc] = media_description\n edit_media_ids[media_url][:title] = media_title\n edit_media_ids[media_url][:type] = media_type\n i += 1\n end\n return edit_media_ids\n end", "title": "" }, { "docid": "941becda24d091d8702c0e675e9feca2", "score": "0.5426741", "text": "def test02_ArticleAllFields\n\t\tloginPost\n\t\t$browser.goto($patch_article)\n\t\t\t\n\t\t\tsleep 2\n\t\t\tif $post_pick_group.exists?\n \t\t\t\tpostGroupPop\n \t\t\t\tpostGroupPop2\n \t\t\t\t$post_article_title.set(\"Article #{random}\")\n \t\t\t\t$browser.execute_script(\"jQuery('iframe.wysihtml5-sandbox').contents().find('body').prepend('lava is hot.')\")\n \t\t\t\t$post_add_media.click\n\t\t\t\t$post_media_file_upload.set(\"#{$post_media_username}/patch-automation/test/TestData/GlacierBasinTrailMtRainier.JPG\")\n\t\t\t\t$post_add_media.click\n\t\t\t\t$post_media_file_upload.set(\"#{$post_media_username}/patch-automation/test/TestData/GlacierBasinTrailMtRainier.JPG\")\n\t\t\t\t$post_now.fire_event(\"onclick\")\n\t\t\telse puts \"PS01T02: FAILED! User unable to locate Post button.\"\n\t\t\tend\n\t\t\t\n\t\tbegin\n\t\tsleep 2\n\t\tassert $post_new_post.exists?\n\t\t\trescue => e\n\t\t\tputs (\"P01T02: FAILED! User unable to Post.\")\n\t\t\tputs e\n\t\tend\n\tend", "title": "" }, { "docid": "ed745c991ab2489cc22895460e97cacf", "score": "0.541357", "text": "def create\n songs = get_kexp_songs()\n idx = 0\n\n while idx < songs['results'].length\n if songs['results'][idx]['playtype']['name'] != \"Media play\"\n idx += 1\n next\n end\n song_title = songs['results'][idx]['track']['name']\n song_artist = songs['results'][idx]['artist']['name']\n \n if !songs['results'][idx]['release']\n song_album = \"\"\n song_release_year = 0\n song_album_img = \"https://cdn.pixabay.com/photo/2019/04/04/18/50/cassette-4103530_1280.jpg\"\n else\n if song_album_img = songs['results'][idx]['release']['largeimageuri'] == nil\n song_album_img = \"https://cdn.pixabay.com/photo/2019/04/04/18/50/cassette-4103530_1280.jpg\"\n else\n song_album_img = songs['results'][idx]['release']['largeimageuri']\n end\n song_album = songs['results'][idx]['release']['name']\n song_release_year = songs['results'][idx]['releaseevent']['year'].to_i\n end\n \n song_is_local = songs['results'][idx]['artist']['islocal']\n #if song|artist|album don't exist -> create \n if Album.find_by(title: song_album) == nil\n song_artist = song_artist.split('feat.')[0]\n mod_artist = song_artist.strip().gsub(/[^0-9a-z ]/i, '').split(' ').join('+')\n parsed_response = get_song_genre(mod_artist)\n \n #if bad status code -> query by song instead\n if parsed_response[\"status_code\"] > 299 || parsed_response[\"status_code\"] < 200 || parsed_response[\"genre\"] == \"\"\n mod_song = song_title.strip().gsub(/[^0-9a-z ]/i, '').split(' ').join('+')\n parsed_response = get_song_genre(mod_song)\n end\n @album = Album.new(title: song_album, album_img: song_album_img, year: song_release_year, genre: parsed_response[\"genre\"])\n @album.save()\n else \n @album = Album.find_by(title: song_album)\n end\n\n if Artist.find_by(name: song_artist) == nil\n @artist = Artist.new(name: song_artist, is_local?: song_is_local, album: @album)\n @artist.save()\n else \n @artist = Artist.find_by(name: song_artist)\n @artist.update(album: @album)\n end\n if Song.find_by(title: song_title) == nil\n @song = Song.new(title: song_title, artist: @artist)\n @song.save()\n else \n @song = Song.find_by(title: song_title)\n @song.update(artist: @artist)\n end\n idx += 1\n end\n redirect_to songs_path\n end", "title": "" }, { "docid": "e23f6767336f69d451abd5f360c68f68", "score": "0.5392433", "text": "def test03_GroupRepostMedia\n\t\trepostMediaPop\n\t\tsleep 3\n\t\tgroupAddRemoveAdd\n \t\tsleep 3\n\t\t\n\t\tbegin \n\t\tassert $repost_confirmation.exists?\n\t\t\trescue => e\n\t\t\tputs \"RS2T03: FAILED! User unable to repost!\"\n\t\t\tputs e\n\t\tend\n\tend", "title": "" }, { "docid": "f36570c287d18801e7d9174f2719f426", "score": "0.5386459", "text": "def load_media(outputPlate)\r\n show do \r\n title \"Filling new 96-deep well Item ##{outputPlate.id}\" \r\n \r\n note \"In a clean & sterile multichannel reservoir, pour aliquoted media.\" \r\n check \"Grab a new 96-deep well plate and label with the Item ID ##{outputPlate.id}.\" \r\n note \"Using a multichannel P1000 transfer 999uL of media to the following wells.\" \r\n # CollectionDisplay library\r\n table highlight_non_empty(outputPlate) { |r,c| \"999uL\" } \r\n end \r\n end", "title": "" }, { "docid": "79bd775b2e7a9a777dca1e87eb2a1830", "score": "0.5382243", "text": "def full_description(example_group)\n example_group.metadata.fetch(:example_group).fetch(:full_description)\n end", "title": "" }, { "docid": "518fe9d0c6be3e2b0877cec26a9c2e1d", "score": "0.537698", "text": "def show\n @contentBlock = ContentBlock.find(@group.chunk_id)\n @characterTags = CharacterTag.all\n @characters = GroupHasCharacter.where(:group_id => @group.id)\n @storylineTags = StorylineTag.all\n @storylines = GroupHasStoryline.where(:group_id => @group.id)\n\n end", "title": "" }, { "docid": "765f8fcc918de3542a2bf0f2c4fda54c", "score": "0.53735894", "text": "def test04_news_OpenPolitics\n\t\tlogin $editor_1_email, $master_password\n\t\t$browser.goto($patch_new_news_group)\n\t\tsleep 5\n\n\t\t$group_name.set(\"Politics Group #{random}\")\n\t\t$group_nickname.set(\"Nickname #{random}\")\n\t\t$group_description.set(\"Description #{random}\")\n\t\t$category_politics.click\n\t\tsleep 2\n\t\t$boards_arts_ent_image.when_present.fire_event(\"onclick\")\n\t\t$create_group.click\n\t\t\n\t\tcheckIfIncorrectErrorDisplays\n\t\t\n\tend", "title": "" }, { "docid": "e8b03e4ba7c0aed19dccd3d4da3e38c9", "score": "0.5372622", "text": "def description\n [@group.description,@description].join(' ')\n end", "title": "" }, { "docid": "737559eb05816b43aaa8facd11bb3fea", "score": "0.5360693", "text": "def test03_group_photo_right\n\t\n\t\tloginGroup\n\t\t$browser.goto($patch_mongooses_settings)\n\t\t$group_image_3.fire_event(\"onclick\")\n\t\t$post_media_file_upload.set(\"#{$post_media_username}/patch-automation/test/TestData/GlacierBasinTrailMtRainier.JPG\")\n\t\t$upload_frames_save.click\t\n\tend", "title": "" }, { "docid": "8abd59495d95eb3ca9c185ee1ea1959f", "score": "0.5352962", "text": "def prefill_media_cuvettes op, media_vol, op_collection\n op_collection_item = Item.find(op_collection.id)\n output_obj_type = op_collection_item.object_type.name\n type_of_media = op.input(MEDIA_TYPE).val\n display_matrix = []\n matrix = op_collection.matrix\n show do\n note \"matrix: #{matrix}\"\n end\n \n flattened_matrix = matrix.flatten\n flattened_matrix.each_slice(op_collection.dimensions[1]) do |slice|#matrix.each_slice(collection.dimensions[1]).map{|slice| Array.new(op_collection.dimensions[1]) { |i| media_vol}}.each do |slice| \n display_matrix.push(slice)\n end\n \n op_collection.get_non_empty.each do |tuple|\n display_matrix[tuple[0]][tuple[1]] = media_vol\n end\n \n display_matrix.each do |row|\n row.reject! do |cell|\n cell == -1\n end\n end\n \n # Tells the technician to fill with media.\n show do\n title \"Fill #{output_obj_type} with #{type_of_media} Media\"\n \n check \"Grab a clean <b>#{output_obj_type}</b>.\"\n check \"Label the #{output_obj_type} => <b>#{op_collection_item.id}</b>.\"\n if media_vol != 0\n # note \"Follow the table to transfer the samples from the input collection to the output collection.\"\n note \"The coordinates in the following table are coordinates from the input collection\"\n note \"Fill each well with #{media_vol} uL of #{type_of_media}\"\n table highlight_matrix display_matrix\n end\n end\n\n end", "title": "" }, { "docid": "52b7b702b3b993bd411549cb9bda7db6", "score": "0.5345641", "text": "def setupGroupsOfThumbnails(items, header)\n \n lastItem = items.size - 1\n currItem = 0\n\n retval = \"\"\n items.each do |item|\n #if a new row should be made\n if (currItem%3 == 0)\n retval << InitializeRow\n\n #if this is the first item, add the section heading\n if (currItem == 0)\n retval << createHeader(header)\n end\n\n retval << BeginThumbnailSet\n end\n\n \n retval << startIndivThumbnail(item.picture) \n case header\n when \"Organizations\"\n retval << createOrganizationCaption(item)\n when \"People to Know\"\n retval << createLeaderCaption(item) \n end\n\n retval << CreateEndThumbnailItem\n\n\n if (currItem == lastItem || currItem%3 == 2)\n retval << FinishThumbnailList\n end\n\n currItem += 1\nend \n\nreturn retval.html_safe \n end", "title": "" }, { "docid": "9db0e35ebc91619ab89f77f43d34fbc2", "score": "0.53425276", "text": "def attach_info # :nodoc:\n unless self.info_added\n rsp = @flickr.send_request('flickr.groups.getInfo', :group_id => self.nsid)\n self.info_added = true\n self.description = rsp.group.description.to_s.strip\n self.member_count = rsp.group.members.to_s.strip\n self.icon_server = rsp.group[:iconserver]\n self.icon_farm = rsp.group[:iconfarm]\n end\n end", "title": "" }, { "docid": "ddc8eefa2c34507385b23b0dd0320a09", "score": "0.53411263", "text": "def metadata_group(upload_group)\n upload_group.each_with_object({}) do |upload, obj|\n obj[upload.filename] = metadata.for(upload.filename)\n end\n end", "title": "" }, { "docid": "744bae890661cbd634f066bd7ecd2d0a", "score": "0.5327049", "text": "def test05_news_OpenPoliticsSports\n\t\tlogin $editor_1_email, $master_password\n\t\t$browser.goto($patch_new_news_group)\n\t\tsleep 5\n\n\t\t$group_name.set(\"Politics/Sports Group #{random}\")\n\t\t$group_nickname.set(\"Nickname #{random}\")\n\t\t$group_description.set(\"Description #{random}\")\n\t\t$category_politics.click\n\t\t$category_sports.click\n\t\t$boards_arts_ent_image.when_present.fire_event(\"onclick\")\n\t\t$create_group.click\n\t\t\n\t\tcheckIfIncorrectErrorDisplays\n\t\t\n\tend", "title": "" }, { "docid": "61b4606e4f959431a954d6e13664e7de", "score": "0.53250366", "text": "def setup\n # create a page_part containing a part storing the gallery\n new_page = Page.new(:title => 'Test Gallery', :slug => 'gallery-test', :breadcrumb => 'gallery', :behavior_id => 'Gallery')\n new_page.save\n @page_part_gallery= PagePart.new(:name => 'gallery', \n :content => 'test-gallery',\n :page_id => new_page.id)\n @page_part_gallery.save\n @page_part_body = PagePart.new(:name => 'body', \n :content => '<r:gallery/>',\n :page_id => new_page.id)\n @page_part_body.save\n @page = Page.find_by_id(new_page.id)\n end", "title": "" }, { "docid": "fce0ce8f6045a3410a8115b2066d5f73", "score": "0.53112197", "text": "def prepare_attributes\n if media.present? && will_save_change_to_media?\n self.media_content_type = media.file.content_type\n self.media_file_size = media.file.size\n end\n\n if new_record?\n self.folder = folder.sanitize_filename\n tag_list.add(folder)\n tag_list.add(media.file.extension)\n end\n end", "title": "" }, { "docid": "79bf994a05db8a28a104b646f5237f40", "score": "0.5304479", "text": "def test01()\n sourceMovie = File.join($directory, \"images/418_clip5_sd.m4v\")\n begin\n # 1. Get the possible track media types.\n getMediaTypes = CommandModule.make_get_nonobjectproperty(property: :mediatypes,\n type: :movieimporter)\n theResult = Smig.perform_command(getMediaTypes)\n mt = \"soun clcp meta muxx sbtl text tmcd vide\"\n raise 'Different list of media types: ' + theResult unless theResult.eql? mt\n \n # Create the list of commands object, ready to have commands added to it.\n theCommands = CommandModule::SmigCommands.new\n theCommands.saveresultstype = :lastcommandresult\n\n # 2.1. Create a movie importer, get the movie importers base object reference.\n movieImporterName = SecureRandom.uuid\n\n movieObject = theCommands.make_createmovieimporter(sourceMovie,\n name: movieImporterName,\n addtocleanup: false)\n\n # 2.2. Create the get_objectproperty command.\n getReferenceCommand = CommandModule.make_get_objectproperty(movieObject,\n property: :objectreference)\n theCommands.add_command(getReferenceCommand)\n theResult = Smig.perform_commands(theCommands)\n \n # We now use that reference for getting other properties of the movie.\n # 3. So we got the result without an exception being thrown. We have the ref.\n movieObject = SmigIDHash.make_objectid(objectreference: theResult.to_i)\n\n # 4. Get the movie importer object name.\n getObjectTypeCommand = CommandModule.make_get_objectproperty(movieObject,\n property: :objectname)\n res = Smig.perform_command(getObjectTypeCommand)\n raise 'Movie importer name is wrong' unless res.eql? movieImporterName\n\n # 5. Get the movie importer object type.\n getObjectTypeCommand = CommandModule.make_get_objectproperty(movieObject,\n property: :objecttype)\n res = Smig.perform_command(getObjectTypeCommand)\n raise 'Movie importer type not :movieimporter' unless res.eql? 'movieimporter'\n\n # 6. Get the movie importer metadata.\n getObjectTypeCommand = CommandModule.make_get_objectproperty(movieObject,\n property: :metadata)\n res = Smig.perform_command(getObjectTypeCommand)\n meta = '[{\"key\":\"@cmt\",\"keyspace\":\"itsk\",\"stringValue\":\"iTunes metadata: Exported to preset AVAssetExportPresetAppleM4VCellular using avexporter at: 20 Nov 2014 13:25\"}]'\n raise 'Movie metadata has changed' unless res.eql? meta\n \n # 7. Get the number of tracks in the movie\n getObjectTypeCommand = CommandModule.make_get_objectproperty(movieObject,\n property: :numberoftracks)\n res = Smig.perform_command(getObjectTypeCommand).to_i\n raise 'Movie should have 2 tracks: ' unless res.eql? 2\n\n # 8. Get the number of video tracks in the movie\n getObjectTypeCommand = CommandModule.make_get_objectproperty(movieObject,\n property: :numberoftracks)\n getObjectTypeCommand.add_option(key: :mediatype, value: :vide)\n res = Smig.perform_command(getObjectTypeCommand).to_i\n raise 'Movie should have 1 video tracks: ' unless res.eql? 1\n\n # 9. Get the number of audio tracks in the movie\n getObjectTypeCommand = CommandModule.make_get_objectproperty(movieObject,\n property: :numberoftracks)\n getObjectTypeCommand.add_option(key: :mediatype, value: :soun)\n res = Smig.perform_command(getObjectTypeCommand).to_i\n raise 'Movie should have 1 audio track: ' unless res.eql? 1\n\n getPropertiesCommand = CommandModule.make_get_objectproperties(movieObject,\n saveresultstype: :jsonstring)\n res = Smig.perform_command(getPropertiesCommand)\n props = '{\"objectname\":\"67ea7e99-b0c8-413a-9688-9020b4ddf53d\",' +\n '\"objecttype\":\"movieimporter\",\"metadataformats\":\"com.apple.itunes org.mp4ra\",\"file\":' +\n '\"/Volumes/MacintoshHD/Users/ktam/gitlab/movingimages/testing/images/418_clip5_sd.m4v\",' +\n '\"duration\":{\"flags\":1,\"value\":9000,\"timescale\":600,\"epoch\":0},\"objectreference\":1,' +\n '\"numberoftracks\":2}'\n propsH = JSON.parse(props)\n resH = JSON.parse(res)\n unless propsH[:objecttype].eql? propsH[:objecttype]\n raise \"Movie importer object type is wrong: #{res}\"\n end\n\n unless propsH[:file].eql? propsH[:file]\n raise \"file is different: #{res}\"\n end\n\n unless propsH[:duration].eql? propsH[:duration]\n raise \"duration is different: #{res}\"\n end\n\n unless propsH[:numberoftracks].eql? propsH[:numberoftracks]\n raise \"number of tracks is different: #{res}\"\n end\n\n rescue RuntimeError => e\n $errorcode = Smig.exitvalue\n unless $errorcode.zero?\n puts \"Exit string: \" + Smig.exitstring\n puts \" Exit status: \" + $errorcode.to_s\n end\n puts e.message\n puts e.backtrace.to_s\n ensure\n # 11. Close the movie object\n Smig.close_object_nothrow(movieObject)\n end\nend", "title": "" }, { "docid": "687dded7cd202c9b1252e142312a03c4", "score": "0.52867", "text": "def groups; end", "title": "" }, { "docid": "687dded7cd202c9b1252e142312a03c4", "score": "0.52867", "text": "def groups; end", "title": "" }, { "docid": "687dded7cd202c9b1252e142312a03c4", "score": "0.52867", "text": "def groups; end", "title": "" }, { "docid": "9a97faba171cb511f1b623c324df8229", "score": "0.5281032", "text": "def test05_news_OpenSports\n\t\tlogin $editor_1_email, $master_password\n\t\t$browser.goto($patch_new_news_group)\n\t\tsleep 5\n\n\t\t$group_name.set(\"Sports Group #{random}\")\n\t\t$group_nickname.set(\"Nickname #{random}\")\n\t\t$group_description.set(\"Description #{random}\")\n\t\t$category_sports.click\n\t\t$boards_arts_ent_image.when_present.fire_event(\"onclick\")\n\t\t$create_group.click\n\t\t\n\t\tcheckIfIncorrectErrorDisplays\n\t\t\n\tend", "title": "" }, { "docid": "33bf2d8b039691f651f79d517364af38", "score": "0.5280994", "text": "def test_media_find_all\n assert_not_nil @rdigg.media.find_all\n end", "title": "" }, { "docid": "4be32df9bf5d0f3935558ac3f8432024", "score": "0.52786934", "text": "def test_media_find_by_type\n assert_not_nil @rdigg.media.find_by_type(\"news\")\n end", "title": "" }, { "docid": "41f043480f2e7af6de9db6e1d3d17bd8", "score": "0.52773917", "text": "def test02_EmptyMPopGDPublish\n\t\t\tloginPost\n\t\t\t$browser.goto($patch_media)\n\t\t\tsleep 2\n\t\t\tif $post_pick_group.exists?\n\t\t\t\tpostGroupPop\n\t\t\t\t$post_media_description.set(\"Media Description #{random}.\")\n\t\t\t\tpostPublishLater\n\t\t\t\t$post_now.fire_event(\"onclick\")\n\t\t\telse puts \"PPL04T02: FAILED! User unable to locate Post button.\"\n\t\t\tend \t\t\t\t\n\t\t\t\n\t\t\tbegin\n\t\t\tassert $post_now.exists?\n\t\t\t\trescue => e\n\t\t\t\tputs (\"PPL04T02: FAILED! User able to Post.\")\n\t\t\t\tputs e\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "a885271b9cb6b0df15fe1cba6c8d65e2", "score": "0.5269101", "text": "def test04_post_open_news_EmptyGPopDM\n\t\t\tlogin $user_1_email, $master_password\n\t\t\t$browser.goto($patch_media)\n\t\t\tsleep 2\n\t\t\t\n\t\t\tassert $post_media_description.exists?\n\t\t\t$post_media_description.set(\"Media Description #{random}.\")\n\t\t\t$post_media_button.click\n\t\t\tfile_upload \"GlacierBasinTrailMtRainier.JPG\"\n\t\t\t$post_now.fire_event(\"onclick\")\n\n\t\t\tassert $post_now.exists?\n\t\tend", "title": "" }, { "docid": "52bca5df0a24ddacc84506fd020ab6fd", "score": "0.5267101", "text": "def create\n cu = User.find params[:user_id]\n\n @group = Group.new(params[:group])\n cu.groups << @group\n\n case params[:group_type].to_i\n when 1\n @group.groupable = ArtistGroup.create\n\n if defined?(params[:instr_id]) && (not params[:instr_id].nil?)\n m = Membership.where \"group_id = #{@group.id}\n AND userable_id = #{cu.id}\n AND userable_type = 'User'\"\n params[:instr_id].each do |i|\n m.first.instruments << Instrument.find(i)\n end\n end\n when 2\n @group.groupable = FanGroup.create :artist_group => ArtistGroup.find(params[:art_group_id].to_i)\n when 3\n @group.groupable = HostGroup.create\n end\n\n\n\n respond_to do |format|\n if @group.save\n format.html { redirect_to @group, notice: 'Die Gruppe wurde erfolgreich angelegt.' }\n format.json { render json: @group, status: :created, location: @group }\n else\n format.html { render action: \"new\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bf9efdb7e431de9f40a32df7ef877273", "score": "0.5266122", "text": "def test_10a\r\n db = build\r\n assert_equal [],db.groups\r\n end", "title": "" }, { "docid": "5469c19ecf56fbeadf3feeb273c4514c", "score": "0.52638346", "text": "def prepare\n [ \"alpha\", \"bravo\", \"charly\" ].each do |name|\n\n @engine.register_participant(name) do |workitem|\n\n workitem.attributes[name] = true\n workitem.attributes[\"key\"] = name\n end\n end\n\n #@engine.register_participant(\"display_workitem\") do |workitem|\n # puts\n # puts\n #end\n end", "title": "" }, { "docid": "19d571e1381b62a5d6dbb4ab2b36cb5d", "score": "0.52620554", "text": "def test04_MediaPDF\n\t\tlogin $editor_1_email, $master_password\n\t\t$browser.goto($patch_boards_pre_closed_article_new)\n\t\t\n#\t\t$post_activate_note.when_present.fire_event(\"onclick\")\n#\t\t$post_media_description.set(\"mt townsend is my favorite mountain #{random}.\")\n\t\tif $environment == 'nixon'\t\n\t\t\trepostGroupPop #category already selected in staging\n\t\tend\n\t\t$post_article_title.set(\"Mountain #{random}\")\n \t\t$browser.execute_script(\"jQuery('iframe.wysihtml5-sandbox').contents().find('body').prepend('mt townsend is my favorite mountain #{random}.')\")\n\t\tsleep 2\n\t\t$post_add_media_article.click\n\t\tfile_upload \"PDFDocument.pdf\"\n\t\t$post_now_edit.fire_event(\"onclick\")\n\t\tif $environment == 'staging'\n\t\t\tsleep 10 #loads \n\t\tend\n\t\tsleep 2\n\t\tassert $post_new_post.exists?\n\tend", "title": "" }, { "docid": "b0407bab7f3fa0f3dbae3e098f692ab4", "score": "0.526119", "text": "def test03_post_open_blog_MediaVideo\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_blogs_post_open)\n\t\t\t\n\t\tsleep 2\n\t\tassert $post_media_description.exists?\n\t\t$post_media_description.set(\"the elwah river original flow was recently restored #{random}.\")\n \t\trepostGroupPop\n\t\t$post_media_button.click\n\t\tfile_upload \"DungenessSpit102.26.2012.mov\"\n\t\t$post_now.fire_event(\"onclick\")\n\t\t\t\n\t\tsleep 2\n\t\tassert $post_new_post.exists?\n\tend", "title": "" }, { "docid": "8b24582375d19a253bf4f88bc3c90641", "score": "0.5252665", "text": "def build_demo_data\n @artist = FactoryGirl.create :artist\n @genre = FactoryGirl.create :genre\n end", "title": "" }, { "docid": "1993a139cf34a77c2358f90623bb20bf", "score": "0.5249858", "text": "def populateGroup(group_id)\n database = SQLite3::Database.new( @database )\n group = $gm.get(\"/groups/#{group_id}\", @token)['response']\n\n if group['image_url'].nil?\n group['image_url'] = 'img/groupme.png'\n elsif group['image_url'].empty?\n group['image_url'] = 'img/groupme.png'\n else\n group['image_url'] = \"#{group['image_url']}.avatar\"\n end\n\n group_info = Hash.new\n user_info = Hash.new\n user_group_info = Hash.new\n \n #Adds new group if they don't exist, and updates the group if they do \n if database.execute( \"SELECT * FROM groups WHERE group_id='#{group['group_id']}'\").empty? \n group_info[group['group_id']] = [group['created_at'], group['name'], group['image_url'], group['creator_user_id'], false ]\n $logger.info \"Adding new group #{group['name']} to the database\"\n else\n group_info[group['group_id']] = [group['created_at'], group['name'], group['image_url'], group['creator_user_id'], true ]\n end\n \n #Adds any new members to the group, and updates any members who have made changes \n group['members'].each do | member |\n\n if member['image_url'].nil?\n member['image_url'] = 'img/groupme.png'\n elsif member['image_url'].empty?\n member['image_url'] = 'img/groupme.png'\n else\n member['image_url'] = \"#{member['image_url']}.avatar\"\n end\n\n if database.execute( \"SELECT * FROM users WHERE user_id='#{member['user_id']}'\").empty?\n user_info[member['user_id'] ] = [member['image_url'], false ]\n else\n user_info[member['user_id'] ] = [member['image_url'], true ]\n end\n if database.execute( \"SELECT * FROM user_groups WHERE user_id='#{member['user_id']}' AND group_id='#{group['group_id']}'\").empty?\n user_group_info[member['user_id']] = [group['group_id'], member['nickname'], false]\n else\n user_group_info[member['user_id']] = [group['group_id'], member['nickname'], true]\n end\n end\n\n database.transaction\n group_info.each do | key, value |\n if value[4]\n database.execute( \"UPDATE groups SET name=?, image=?, creator=?, created_at=datetime('#{value[0]}','unixepoch') WHERE group_id='#{key}'\",\n value[1],\n value[2],\n value[3] ) \n else \n database.execute( \"INSERT INTO groups(group_id, name, image, creator, created_at) VALUES (?, ?, ?, ?, datetime('#{value[0]}','unixepoch'))\",\n\t\t key,\n value[1],\n value[2],\n value[3] )\n end\n end\n \n user_info.each do | key, value |\n if value[1]\n database.execute( \"UPDATE users SET avatar_url=? WHERE user_id='#{key}'\",\n value[0] )\n else\n database.execute( \"INSERT INTO users(user_id, avatar_url) VALUES (?, ?)\",\n key,\n value[0] )\n end \n end\n\n user_group_info.each do | key, value |\n if value[2]\n database.execute( \"UPDATE user_groups SET name=? WHERE user_id='#{key}' AND group_id='#{value[0]}'\",\n value[1] )\n else\n database.execute( \"INSERT INTO user_groups(user_id, group_id, name) VALUES (?, ?, ?)\",\n key,\n value[0],\n value[1] )\n end\n end\n database.commit\n end", "title": "" }, { "docid": "70110314073fef7314f9b94cdb856180", "score": "0.5248007", "text": "def test03_pre_closed_news_NoteVideoPhotoPDF_TC_24302_TC_24304\n\t\tlogin $editor_1_email, $master_password\n\t\t$browser.goto($patch_news_pre_open)\n\t\tsleep 2\n\t\t\n\t\tassert $post_pick_group.exists?\n \t\t$post_pick_group.when_present.fire_event(\"onclick\")\n\t\t$post_media_description.when_present.set(\"All fishing is off limits in the olympic national park.\")\n \t\trepostGroupPop\n \t\t#sleep 2\n \t\t#$post_media_button\n\t\t$post_add_media.when_present.click\n\t\tfile_upload \"DungenessSpit102.26.2012.mov\"\n\t\t$post_add_media.click\n\t\tfile_upload \"GlacierBasinTrailMtRainier.JPG\"\n\t\t$post_add_media.click\n\t\tfile_upload \"PDFDocument.pdf\"\n\t\t$post_add_media.click\n\t\tfile_upload \"PDF2.pdf\"\n\t\t$post_now.fire_event(\"onclick\")\n\t\t\t\n\t\tsleep 2\n\t\tassert $post_new_post.exists?\n\tend", "title": "" }, { "docid": "afb312534889b13bd631d0e12fff7409", "score": "0.5244411", "text": "def group_items\n @group_items ||= Product.includes(:pictures)\n .where(group: group.presence || '_ZZZZ_', active: true, hidden: false)\n .order(:option_sort, :option_title)\n end", "title": "" }, { "docid": "885d4f3432b104ba2012808995c8a530", "score": "0.52397335", "text": "def test_all\n query = \"iphone5s\"\n\n products = ProductHelper.crawl(query)\n products.each do |product|\n #STDERR.puts product\n end\n pgroups = ProductHelper.clustering(products)\n pgroups.each do |pgroup|\n info = \"\"\n unless pgroup.spu.nil?\n info = pgroup.spu['Title']\n end\n STDERR.puts \"#{pgroup.size},#{info}\"\n end\n end", "title": "" }, { "docid": "88f31bddba00b667fc5b381745903e65", "score": "0.5237576", "text": "def test04_EmptyGPopDM\n\t\t\tloginPost\n\t\t\t$browser.goto($patch_media)\n\t\t\tsleep 2\n\t\t\tif $post_media_description.exists?\n\t\t\t\t$post_media_description.set(\"Media Description #{random}.\")\n\t\t\t\t$post_media_button.click\n\t\t\t\t$post_media_file_upload.set(\"#{$post_media_username}/patch-automation/test/TestData/GlacierBasinTrailMtRainier.JPG\")\n\t\t\t\t$post_now.fire_event(\"onclick\")\n\t\t\telse puts \"PEV03T04: FAILED! UUser unable to locate Post button.\"\n\t\t\tend\n\t\t\t\n\t\t\tbegin\n\t\t\tassert $post_now.exists?\n\t\t\t\trescue => e\n\t\t\t\tputs (\"PEV03T04: FAILED! User able to Post.\")\n\t\t\t\tputs e\n\t\t\tend\t\n\t\tend", "title": "" }, { "docid": "3a0f45544a3b0a189874711025535d8e", "score": "0.5234247", "text": "def load_group group_id, info_level = \"Full\", include_children = \"true\"\n\t\t\t@response = api_request 'LoadGroup', [group_id, info_level, include_children]\n\t\t\traise ZenfolioAPI::ZenfolioAPISessionError, @response['error']['message'] if @response['result'].nil? && @response['error'].length > 0\n\n\t\t\telements = []\n\t\t\t@response['result']['Elements'].each do |element|\n\t\t\t\tif element['$type'] == \"PhotoSet\"\n\t\t\t\t\telements << ZenfolioAPI::Model::Gallery.new(:id => element['Id'], :type => element['$type'], :caption => element['Caption'], \n\t\t\t\t\t\t:created_on => element['CreatedOn']['Value'], :modified_on => element['ModifiedOn']['Value'], :photo_count => element['PhotoCount'],\n\t\t\t\t\t\t:image_count => element['ImageCount'], :video_count => element['VideoCount'], :photo_bytes => element['PhotoBytes'], :views => element['Views'],\n\t\t\t\t\t\t:featured_index => element['FeaturedIndex'], :is_random_title_photo => element['IsRandomTitlePhoto'], :upload_url => element['UploadUrl'],\n\t\t\t\t\t\t:video_upload_url => element['VideoUploadUrl'], :page_url => element['PageUrl'], :mailbox_id => element['MailboxId'], :text_cn => element['TextCn'], \n\t\t\t\t\t\t:photo_list_cn => element['PhotoListCn'], :group_index => element['GroupIndex'], :title => element['Title'], :owner => element['Owner'])\n\t\t\t\telse\n\t\t\t\t\t#group_elements = load_group element['Id']\n\t\t\t\t\telements << ZenfolioAPI::Model::Group.new(:id => element['Id'], :created_on => element['CreatedOn']['Value'], :modified_on => element['ModifiedOn']['Value'], \n\t\t\t\t\t\t:page_url => element['PageUrl'], :mailbox_id => element['MailboxId'], :immediate_children_count => element['ImmediateChildrenCount'], :text_cn => element['TextCn'], \n\t\t\t\t\t\t:caption => element['Caption'], :collection_count => element['CollectionCount'], :sub_group_count => element['SubGroupCount'], :gallery_count => element['GalleryCount'],\n\t\t\t\t\t\t:featured_index => element['FeaturedIndex'], :is_random_title_photo => element['IsRandomTitlePhoto'], :upload_url => element['UploadUrl'],\n\t\t\t\t\t\t:photo_count => element['PhotoCount'], :parent_groups => element['ParentGroups'], :title => element['Title'])\n\t\t\t\tend\n\t\t\tend\n\n\t\t\t@group = ZenfolioAPI::Model::Group.new(:id => @response['result']['Id'], :created_on => @response['result']['CreatedOn']['Value'], :modified_on => @response['result']['ModifiedOn']['Value'], \n\t\t\t\t:page_url => @response['result']['PageUrl'], :mailbox_id => @response['result']['MailboxId'], :immediate_children_count => @response['result']['ImmediateChildrenCount'], \n\t\t\t\t:text_cn => @response['result']['TextCn'], :caption => @response['result']['Caption'], :collection_count => @response['result']['CollectionCount'], \n\t\t\t\t:sub_group_count => @response['result']['SubGroupCount'], :gallery_count => @response['result']['GalleryCount'], :featured_index => @response['result']['FeaturedIndex'], \n\t\t\t\t:is_random_title_photo => @response['result']['IsRandomTitlePhoto'], :upload_url => @response['result']['UploadUrl'], :photo_count => @response['result']['PhotoCount'], \n\t\t\t\t:parent_groups => @response['result']['ParentGroups'], :title => @response['result']['Title'], :elements => elements)\n\n\t\t\t@group\n\t\tend", "title": "" }, { "docid": "d8694242933b2f4d28dcef3925007c60", "score": "0.5229111", "text": "def test02_news_OpenEducationFamily\n\t\tlogin $editor_1_email, $master_password\n\t\t$browser.goto($patch_new_news_group)\n\t\tsleep 5\n\n\t\t$group_name.set(\"Education/Family Group #{random}\")\n\t\t$group_nickname.set(\"Nickname #{random}\")\n\t\t$group_description.set(\"Description #{random}\")\n\t\t$category_education.click\n\t\t$category_family.click\n\t\t$boards_arts_ent_image.when_present.fire_event(\"onclick\")\n\t\t$create_group.click\n\t\t\n\t\tcheckIfIncorrectErrorDisplays\n\t\t\n\tend", "title": "" }, { "docid": "7ad09f8d3002ca4e436bc79ea586c5f5", "score": "0.521199", "text": "def set_content_defaults\r\n @content.user_id = @user.id\r\n @content.user = @user\r\n @content.is_in_startpage = [email protected]{|a| !a.featured_album?}\r\n @content.is_in_gallery = true\r\n @content_kind_displayname = \"New #{@content.entity_name_for_human.titleize}\".t\r\n @title = @user.login + ' :: ' + @content_kind_displayname\r\n #'New Music Album'.t\r\n #'New Music Contest'.t\r\n end", "title": "" }, { "docid": "bc41f520315f21eaf1ccff7e06555260", "score": "0.52074814", "text": "def initialize(media_options={})\n @id = media_options[\"id\"]\n @format_type_id= media_options[\"format_type_id\"]\n @anime_series_id= media_options[\"anime_series_id\"]\n @cover_name= media_options[\"cover_name\"]\n end", "title": "" }, { "docid": "5e2ef7a2bafd595647413997abec8dc6", "score": "0.52054036", "text": "def test05_news_OpenLiving_TC_24397\n\t\tlogin $editor_1_email, $master_password\n\t\twait_for_ajax\n\t\t\n\t\t$header_tools_icon.click\n\t\tsleep 2\n\t\t$header_tools_start_news.click\n\n\t\t$group_name.set(\"Living Group #{random}\")\n\t\t$boards_group_nickname.set(\"Nickname #{random}\")\n\t\t$group_description.set(\"Description #{random}\")\n\t\t$group_category_living.click\n\t\t$boards_arts_ent_image.when_present.fire_event(\"onclick\")\n\t\t$group_create.click\n\t\t\n\t\tcheckIfIncorrectErrorDisplays\t\n\t\t\n\t\t#edit group type settings\n\t\twait_for_ajax\n \t\tsleep 2\n \t\t$group_basic_information_link.click\n \t\t$group_group_type.click \n \t\twait_for_ajax\n \t\t$group_setting_pre_moderated.click #make blog pre-moderated\n \t\tsleep 2\n \t\t$group_settings_save.click\n \t\tsleep 3\n \t\t\n \t\tassert $browser.text.include? \"group updated successfully\"\n \t\t\n \t\t$group_back_group.click\n \t\twait_for_ajax\n \t\t$browser.text.include? \"Posts awaiting your approval\"\n\tend", "title": "" }, { "docid": "06b8194e094570d5efcb6c78fc8e0e7e", "score": "0.52041566", "text": "def fill_plate_with_media(op, collection, rc_list)\n count = 0\n rc_list.each { |media_coords, med_type|\n media_vol = ((media_coords.length + 2) * op.input(MEDIA_DILU_VOL).val.to_i)/1000#mL\n show {\n title \"Filling #{Item.find(collection.id).object_type.name} #{collection.id}\"\n separator\n (count == 0) ? (check \"Obtain a <b>#{Item.find(collection.id).object_type.name}</b> and label with #<b>#{collection.id}</b>\") : nil\n check \"Aliquot <b>#{media_vol.round(2)}mL</b> of <b>#{med_type}</b> into a clean reservoir.\"\n note \"Follow the table below to fill Deep Well plate #{collection.id} with <b>#{op.input(MEDIA_DILU_VOL).val.to_i}µl</b> the appropriate media:\"\n table highlight_rc(collection, media_coords) {|r,c| med_type}\n }\n count += 1\n }\n end", "title": "" }, { "docid": "1b530a89a97a7b03e07ca4fe477ac092", "score": "0.5200541", "text": "def test03_post_open_news_251RepostMedia\n\t\trepostMediaPop\n\t\tsleep 3\n\t\trepostPopulate251\n\t\tsleep 3\n\n\t\tassert $repost_confirmation.exists?\n\tend", "title": "" }, { "docid": "7c4a32bfef61cf47453315721bc6605b", "score": "0.5198142", "text": "def test_monkey_multi_enhanced_mip_setting_tags\n # Setup\n image1 = upload_and_link_image('int_xxid', @int_xxid, @user.oauth_token)\n image2 = upload_and_link_image('int_xxid', @int_xxid, @user.oauth_token)\n tags1 = {\n 'cover' => true,\n 'profile' => true,\n 'logo' => true,\n 'stock' => true\n }\n tags2 = {\n 'cover' => true,\n 'profile' => [true, false].sample,\n 'logo' => false,\n 'stock' => true\n }\n\n # Step 1\n params = {\n 'api_key' => @api_key,\n 'tags' => tags1\n }\n\n post \"/b_image/#{image1}/int_xxid/#{@int_xxid}\", params\n assert_response(@response, :success)\n\n get_images_from_int_xxids(@int_xxid)\n assert_response(@response, :success)\n assert_equal(2, @parsed_response['relations'].length, @parsed_response)\n\n image1_data = @parsed_response['relations'].find { |rel| rel['id'] == image1 }\n refute_nil(image1_data, \"Expected image1 to be returned /b_image/int_xxid/#{@int_xxid}\")\n image2_data = @parsed_response['relations'].find { |rel| rel['id'] == image2 }\n refute_nil(image2_data, \"Expected image1 to be returned /b_image/int_xxid/#{@int_xxid}\")\n\n tags1.each_key { |k|\n assert_includes(image1_data['tags'], k)\n refute_includes(image2_data['tags'], k)\n }\n\n # Step 2\n params = {\n 'api_key' => @api_key,\n 'tags' => tags2\n }\n\n post \"/b_image/#{image2}/int_xxid/#{@int_xxid}\", params\n assert_response(@response, :success)\n\n get_images_from_int_xxids(@int_xxid)\n assert_response(@response, :success)\n assert_equal(2, @parsed_response['relations'].length, @parsed_response)\n\n image1_data = @parsed_response['relations'].find { |rel| rel['id'] == image1 }\n refute_nil(image1_data, \"Expected image1 to be returned /b_image/int_xxid/#{@int_xxid}\")\n image2_data = @parsed_response['relations'].find { |rel| rel['id'] == image2 }\n refute_nil(image2_data, \"Expected image1 to be returned /b_image/int_xxid/#{@int_xxid}\")\n\n tags2.each do |k, v|\n if v\n if k == 'stock'\n assert_includes(image2_data['tags'], k)\n assert_includes(image1_data['tags'], k)\n else\n assert_includes(image2_data['tags'], k)\n refute_includes(image1_data['tags'], k)\n end\n else\n refute_includes(image2_data['tags'], k)\n assert_includes(image1_data['tags'], k)\n end\n end\n end", "title": "" }, { "docid": "01a0ffb5794502dd7ea042cc5635b8bf", "score": "0.5194817", "text": "def build_content_metadata record, tags\n # TODO: Further enrich the structured data by marking up FAQ accordions, Video Carousels, Image Galleries, etc.\n # Also ItemList metadata for the meditations archive\n # See here: https://developers.google.com/search/docs/data-types/article\n []\n end", "title": "" }, { "docid": "e4d95a18d834a1266afefed4f7f8acbf", "score": "0.5194658", "text": "def medium_names\n primary_media | secondary_media | component_media\n end", "title": "" }, { "docid": "e19310d6bca40a70bb188bbe5908813f", "score": "0.51943237", "text": "def test04_post_open_blog_MediaTwoVideo\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_blogs_post_open)\n\t\t\t\n\t\tsleep 2\n\t\tassert $post_media_description.exists?\n\t\t$post_media_description.set(\"whiskey bend road has been closed #{random}.\")\n \t\trepostGroupPop\n\t\t$post_media_button.click\n\t\tfile_upload \"DungenessSpit102.26.2012.mov\"\n\t\t$post_media_button.click\n\t\tfile_upload \"DungenessSpit202.26.2012.mpg\"\n\t\t$post_now.fire_event(\"onclick\")\n\t\t\t\n\t\tsleep 2\n\t\tassert $post_new_post.exists?\n\tend", "title": "" }, { "docid": "6fe4e6885430bb587c75f184976eeb09", "score": "0.51936114", "text": "def group; end", "title": "" }, { "docid": "198d51244c00abaa85479580b084aaec", "score": "0.5189435", "text": "def testDontShareLocalMetadata\n execute_Deliver_WithConf({\n :WaveFiles => {\n :FilesList => [\n { :Name => 'Wave1.wav' },\n { :Name => 'Wave2.wav' }\n ] },\n :Mix => {\n 'Mix1' => { :Tracks => { 'Wave1.wav' => {} } },\n 'Mix2' => { :Tracks => { 'Wave2.wav' => {} } }\n },\n :Deliver => {\n :Metadata => {\n :MDParam1 => 'MDValue1',\n :MDParam2 => 'MDValue2'\n },\n :Formats => {\n 'Test' => {\n :FileFormat => 'Test'\n }\n },\n :Deliverables => {\n 'Deliverable1' => {\n :Mix => 'Mix1',\n :Format => 'Test',\n :Metadata => {\n :MDParam2 => 'MDValue2.1',\n :MDParam3 => 'MDValue3.1'\n }\n },\n 'Deliverable2' => {\n :Mix => 'Mix2',\n :Format => 'Test',\n :Metadata => {\n :MDParam2 => 'MDValue2.2',\n :MDParam3 => 'MDValue3.2'\n }\n }\n }\n }\n },\n :PrepareFiles => getPreparedFiles(:Mixed_Wave1, :Mixed_Wave2)\n ) do |iStdOUTLog, iStdERRLog, iExitStatus|\n assert_exitstatus 0, iExitStatus\n assert_rb_content({\n :SrcFileName => 'Wave1.wav',\n :DstFileName => '06_Deliver/Deliverable1/Track.test.rb',\n :FormatConf => {},\n :Metadata => {\n :FileName => 'Track',\n :MDParam1 => 'MDValue1',\n :MDParam2 => 'MDValue2.1',\n :MDParam3 => 'MDValue3.1'\n }\n }, '06_Deliver/Deliverable1/Track.test.rb')\n assert_rb_content({\n :SrcFileName => 'Wave2.wav',\n :DstFileName => '06_Deliver/Deliverable2/Track.test.rb',\n :FormatConf => {},\n :Metadata => {\n :FileName => 'Track',\n :MDParam1 => 'MDValue1',\n :MDParam2 => 'MDValue2.2',\n :MDParam3 => 'MDValue3.2'\n }\n }, '06_Deliver/Deliverable2/Track.test.rb')\n end\n end", "title": "" }, { "docid": "1b6365602f1c5be434675294d893fb5e", "score": "0.51893336", "text": "def before_save\n prepare_attributes\n find_song_groups!\n end", "title": "" }, { "docid": "3e2ef26a5244060106d5136502e27a99", "score": "0.5188236", "text": "def test03_news_OpenLivingNews\n\t\tlogin $editor_1_email, $master_password\n\t\t$browser.goto($patch_new_news_group)\n\t\tsleep 5\n\n\t\t$group_name.set(\"Living/News Group #{random}\")\n\t\t$group_nickname.set(\"Nickname #{random}\")\n\t\t$group_description.set(\"Description #{random}\")\n\t\t$category_living.click\n\t\t$category_news.click\n\t\t$boards_arts_ent_image.when_present.fire_event(\"onclick\")\n\t\t$create_group.click\n\t\t\n\t\tcheckIfIncorrectErrorDisplays\n\t\t\n\tend", "title": "" }, { "docid": "b01f0bf11d24f701504aa8375ee1073b", "score": "0.5182876", "text": "def test_ownprovidergroups\n groupnames.each { |group|\n gobj = nil\n comp = nil\n fakeresource = fakeresource(:group, group)\n assert_nothing_raised {\n gobj = @provider.new(fakeresource)\n }\n\n assert(gobj.gid, \"Failed to retrieve gid\")\n }\n end", "title": "" }, { "docid": "7761f180565a5db7bb24a6b194154be1", "score": "0.51799315", "text": "def ensure_correct_media_id\n # only fandoms tags must have medias\n return unless self[:type] == 'Fandom'\n\n uncategorized = Media.uncategorized\n\n # get the first media of the current tag which is not \"Uncategorized Fandoms\"\n current_media = ([self.media] + self.medias).compact\n media = (current_media - [uncategorized]).first\n\n # if we have a media, we don't need \"Uncategorized Fandoms\" as a media\n if media \n self.remove_media(uncategorized) if self.medias.include?(uncategorized)\n self.update_attribute(:media_id, media.id) if self.media == uncategorized\n end\n\n # make sure the tag has a media id\n if !self.media_id # we don't have a media id\n if !media # and we don't have a media\n # we don't have anything, but we're being wrangled, so add \"Uncategorized Fandoms\"\n self.update_attribute(:media_id, uncategorized.id)\n self.parents << uncategorized unless self.parents.include?(uncategorized)\n else # we do have a media\n # use the one for our first media\n self.update_attribute(:media_id, media.id)\n end\n end\n\n # if the media id isn't for our first media or \"Uncategorized Fandoms\", verify that it's a real media\n if !(self.media_id == uncategorized.id || (media && self.media_id == media.id))\n listed_media = Media.find(self.media_id)\n # it's not a real media or it's been removed\n if !listed_media.is_a?(Media) || !self.medias.include?(listed_media)\n if media\n self.update_attribute(:media_id, media.id)\n else\n self.update_attribute(:media_id, uncategorized.id)\n end\n end\n end\n\n end", "title": "" }, { "docid": "0e855a80eb04a530b057c56f31b0c3b3", "score": "0.5179358", "text": "def build_demo_data\n @album = FactoryGirl.create(:album)\n end", "title": "" }, { "docid": "1342c1bc0c010b57b01ae6bae34f0600", "score": "0.51735836", "text": "def test_show_single_photo\n photo_set = photo_sets('lonely_photo_set')\n photo = photos('lonely_photo')\n get :set, { :photo_set => photo_set, :photo => photo }\n assert_response :success\n \n assert long_title = \"#{photo_set.title} - #{photo.title}\"\n assert_select 'h1', long_title\n\n assert_select \"li.thumbs\", false\n assert_select \"#thumbnav\", false\n end", "title": "" }, { "docid": "6956db7cc884316ae09feeae63ea9ed2", "score": "0.51660585", "text": "def test05_post_open_news_250RepostMedia\n\t\trepostMediaPop\n\t\tsleep 3\n\t\trepostPopulate250\n\t\tsleep 3\n\n\t\tassert $repost_confirmation.exists?\n\tend", "title": "" }, { "docid": "63400ad8ba95432dfb7ec1761563d8a0", "score": "0.5164064", "text": "def test02_post_open_blog_MediaTwoVideoClips\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_blogs_post_open)\n\t\t\t\n\t\tsleep 2\n\t\tassert $post_media_description.exists?\n\t\t$post_media_description.set(\"hiking mt st helens isnt as cool #{random}.\")\n \t\trepostGroupPop\n\t\t$post_media_button.click\n\t\tfile_upload \"DungenessSpit102.26.2012.mov\"\n\t\t$post_media_button.click\n\t\tfile_upload \"DungenessSpit202.26.2012.mpg\"\n\t\t$post_now.fire_event(\"onclick\")\n\t\t\t\n\t\tsleep 2\n\t\tassert $post_new_post.exists?\n\tend", "title": "" }, { "docid": "9097f59c180b7e0336c83c34ee39816f", "score": "0.5158928", "text": "def description\n start = Time.now\n debug \"Checking description for device group: \\\"#{resource[:full_path]}\\\"\"\n connection = self.class.get_connection(resource[:account])\n device_group = get_device_group(connection, resource[:full_path],'description')\n debug \"Finished in #{(Time.now-start)*1000.0} ms\"\n device_group['description']\n end", "title": "" }, { "docid": "912049b7895b18fa2fec86d8461dbc30", "score": "0.5156244", "text": "def test03_news_OpenOther\n\t\tlogin $editor_1_email, $master_password\n\t\t$browser.goto($patch_new_news_group)\n\t\tsleep 5\n\n\t\t$group_name.set(\"Other Group #{random}\")\n\t\t$group_nickname.set(\"Nickname #{random}\")\n\t\t$group_description.set(\"Description #{random}\")\n\t\t$category_other.click\n\t\t$boards_arts_ent_image.when_present.fire_event(\"onclick\")\n\t\t$create_group.click\n\t\t\n\t\tcheckIfIncorrectErrorDisplays\n\t\t\n\tend", "title": "" }, { "docid": "aa0e36a42817a92f68a0186dc1632060", "score": "0.514756", "text": "def enter_groups(test_data)\n test_groups = test_data[Org::GROUPS.name]\n test_groups = [{ Org::GROUP.name => ''}] unless test_groups\n prep_fieldsets_for_test_data([fieldset(Org::GROUPS.name)], test_groups)\n\n test_groups.each_with_index do |test_grp, index|\n wait_for_element_and_type(group_input(index), test_grp[Org::GROUP.name])\n end\n end", "title": "" }, { "docid": "4c12b478b3a9936f0324567e4928194f", "score": "0.514588", "text": "def run_mdc_content_tests\n assert_not_nil Strain.find(:all)\n # Check strains loaded, start with the first strain in the test file\n strain = Strain.find_by_mdc_id('MDC-03-08')\n assert_not_nil strain\n assert_equal 228, Strain.count\n \n # the last strain in the file\n strain2 = Strain.find_by_mdc_id('MDC-05-90')\n assert_not_nil strain2\n # make sure it loaded the data\n strain2_genotypes = Genotype.find_all_by_strain_id(strain2.id)\n assert_equal 9, strain2_genotypes.size\n \n snp = Snp.find_by_symbol('J500418')\n assert_not_nil snp\n assert_equal 'C/T', snp.target_allele\n \n assert_not_nil Genotype.count\n \n assert_equal (228*9), Genotype.count\n genotypes = Genotype.find_all_by_genotypable_id(snp.id)\n assert_not_nil genotypes\n assert_equal 228, genotypes.size\n \n # Get genotype data for J500418 in strain MDC-03-08\n last_genotype = Genotype.find_by_genotypable_id_and_strain_id(snp.id, strain.id)\n assert_not_nil last_genotype\n assert_equal 'TT',last_genotype.genotype_allele\n end", "title": "" }, { "docid": "ed90f23212af1bb0d4812df3673516da", "score": "0.5145023", "text": "def ensure_magic_descriptor_presence(ad_group)\n # Use exceptions as activedirectory gem will throw an ArgumentError if no description exists.\n # AD groups don't have to have description fields but we will add one if needed.\n begin\n g_desc = ad_group.description\n rescue ArgumentError\n # description not set\n g_desc = \"\"\n end\n\n unless g_desc and g_desc.index MAGIC_DESCRIPTOR\n ad_group.description = \"#{MAGIC_DESCRIPTOR} #{g_desc}\"\n ad_group.save\n end\nend", "title": "" }, { "docid": "b31a9a4b612695d339c695fcdfb9a81a", "score": "0.5143806", "text": "def add_display_only_data(group)\n group[:id] = SecureRandom.uuid\n group[:controls].collect!.with_index do |c, i|\n # i is zero-indexed, and we want the display one-indexed\n c[:sequence_number] = i + 1\n c\n end\n group\n end", "title": "" }, { "docid": "d4da848ac0f4776024fe6c66b75b4388", "score": "0.5138007", "text": "def test_should_associate_images\n a_product = items(:lightsaber)\n assert_equal a_product.images.count, 3\n\n lightsabers_image = substruct_fixture_file(\"lightsabers.jpg\")\n\n an_image = Image.new\n an_image.upload = lightsabers_image\n assert an_image.save\n \n a_product.images << an_image\n assert_equal a_product.images.count, 4\n \n # We must erase the record and its files by hand, just calling destroy.\n assert an_image.destroy\n end", "title": "" }, { "docid": "ac836d5dcc19dc0aad8e251170c54d33", "score": "0.51376075", "text": "def videos_test\n end", "title": "" }, { "docid": "6ef322d63a74a7e98d626795ecedc354", "score": "0.5134919", "text": "def test_assign_groups_to_reviews\n\n post(:assign_groups_to_reviews,\n { :review_type => {\n # 1-Final, 2-Routing, 3-Pre-Art, 4-Placement, 5-Release\n '5_1'=>'1', '5_2'=>'0', '5_3'=>'1', '5_4'=>'0', '5_5'=>'0', #HWENG\n '6_1'=>'1', '6_2'=>'1', '6_3'=>'1', '6_4'=>'0', '6_5'=>'1', #VALOR\n '7_1'=>'1', '7_2'=>'1', '7_3'=>'0', '7_4'=>'1', '7_5'=>'1', #CE-DFT\n '8_1'=>'0', '8_2'=>'0', '8_3'=>'1', '8_4'=>'0', '8_5'=>'1', #DFM\n '9_1'=>'1', '9_2'=>'0', '9_3'=>'1', '9_4'=>'1', '9_5'=>'0', #TDE\n '10_1'=>'1', '10_2'=>'0', '10_3'=>'1', '10_4'=>'1', '10_5'=>'0', #MECHANICAL\n '11_1'=>'0', '11_2'=>'1', '11_3'=>'1', '11_4'=>'1', '11_5'=>'0', #MECH-MFG\n '12_1'=>'1', '12_2'=>'0', '12_3'=>'0', '12_4'=>'0', '12_5'=>'1', #PCB DESIGN\n '13_1'=>'1', '13_2'=>'0', '13_3'=>'1', '13_4'=>'0', '13_5'=>'0', #PLANNING\n '14_1'=>'1', '14_2'=>'0', '14_3'=>'0', '14_4'=>'0', '14_5'=>'0', #PCB IG\n '15_1'=>'1', '15_2'=>'0', '15_3'=>'0', '15_4'=>'0', '15_5'=>'0', #LIBRARY\n '16_1'=>'0', '16_2'=>'0', '16_3'=>'1', '16_4'=>'1', '16_5'=>'1', #PCB MECH\n '17_1'=>'1', '17_2'=>'1', '17_3'=>'1', '17_4'=>'1', '17_5'=>'1', #SLM BOM\n '18_1'=>'0', '18_2'=>'1', '18_3'=>'1', '18_4'=>'1', '18_5'=>'0', #SLM-Vendor\n '19_1'=>'1', '19_2'=>'0', '19_3'=>'0', '19_4'=>'0', '19_5'=>'1' #OPS MGR\n } },\n cathy_admin_session)\n\n post :review_type_role_assignment, {}, cathy_admin_session\n\n assert_response :success\n\n roles = assigns(roles)['roles']\n review_types = assigns(review_types)['review_types']\n\n expected_values = [\n {:name => 'Hardware Engineering Manager',\n :review_types => []},\n {:name => 'Operations Manager',\n :review_types => ['Final', 'Release']},\n {:name => 'PCB Design',\n :review_types => ['Final', 'Release']},\n {:name => 'Program Manager',\n :review_types => []},\n {:name => 'DFM',\n :review_types => ['Pre-Artwork', 'Release']},\n {:name => 'CE-DFT',\n :review_types => ['Final', 'Placement', 'Release', 'Routing']},\n {:name => 'Compliance - EMC', \n :review_types => []},\n {:name => 'Compliance - Safety', \n :review_types => []},\n {:name => 'Library',\n :review_types => ['Final']},\n {:name => 'ECN',\n :review_types => []},\n {:name => 'HWENG',\n :review_types => ['Final', 'Pre-Artwork']},\n {:name => 'Mechanical',\n :review_types => ['Final', 'Placement', 'Pre-Artwork']},\n {:name => 'Mechanical-MFG',\n :review_types => ['Placement', 'Pre-Artwork', 'Routing']},\n {:name => 'Planning',\n :review_types => ['Final', 'Pre-Artwork']},\n {:name => 'PCB Input Gate',\n :review_types => ['Final']},\n {:name => 'PCB Mechanical',\n :review_types => ['Placement', 'Pre-Artwork', 'Release']},\n {:name => 'SLM BOM',\n :review_types => ['Final', 'Placement', 'Pre-Artwork', 'Release', 'Routing']},\n {:name => 'SLM-Vendor',\n :review_types => ['Placement', 'Pre-Artwork', 'Routing']},\n {:name => 'TDE',\n :review_types => ['Final', 'Placement', 'Pre-Artwork']},\n {:name => 'Valor', \n :review_types => ['Final', 'Pre-Artwork', 'Release', 'Routing']}\n ]\n\n #assert_equal(expected_values, roles)\n assert_equal(expected_values.size, roles.size)\n assert_equal(5, review_types.size)\n\n roles.each_with_index { |role, i|\n expected_role = expected_values[i]\n assert_equal(expected_role[:name], role.name)\n \n returned_rts = role.review_types.collect { |rt| rt.name }\n\n returned_rts = returned_rts.sort_by { |rt| rt }\n returned_rts.each_with_index { |review_type, j|\n expected_name = expected_role[:review_types][j]\n assert_equal(expected_role[:name]+'::'+expected_name.to_s,\n role.name+'::'+review_type)\n }\n\n }\n\n expected_values = [\n {:name => 'Pre-Artwork',\n :role_names => ['DFM', 'HWENG', 'Mechanical', 'Mechanical-MFG', 'PCB Mechanical', 'Planning', 'SLM BOM', 'SLM-Vendor', 'TDE', 'Valor']},\n {:name => 'Placement', \n :role_names => ['CE-DFT', 'Mechanical', 'Mechanical-MFG', 'PCB Mechanical', 'SLM BOM', 'SLM-Vendor', 'TDE']},\n {:name => 'Routing', \n :role_names => ['CE-DFT', 'Mechanical-MFG', 'SLM BOM', 'SLM-Vendor', 'Valor']},\n {:name => 'Final',\n :role_names => ['CE-DFT', 'HWENG', 'Library', 'Mechanical', 'Operations Manager', 'PCB Design', 'PCB Input Gate', 'Planning', 'SLM BOM', 'TDE', 'Valor']},\n {:name => 'Release', \n :role_names => ['CE-DFT', 'DFM', 'Operations Manager', 'PCB Design', 'PCB Mechanical', 'SLM BOM', 'Valor']}\n ]\n review_types.each { |review_type| \n expected_rt = expected_values.shift\n\n returned_roles = []\n review_type.roles.each { |role| returned_roles.push(role.name) }\n\n returned_roles.sort.each { |role|\n expected_role = expected_rt[:role_names]\n expected_name = expected_role.shift\n assert_equal(expected_rt[:name]+'::'+expected_name, \n review_type.name+'::'+role)\n }\n }\n\n end", "title": "" }, { "docid": "a175963f647403c675cd3b0a7645fcd4", "score": "0.5134767", "text": "def test_get_group_collection_basic_success\n\n client = create_mock_client\n refute_nil client, \"Client object couldn't be created.\"\n\n g1 = {\n 'Id' => 1,\n 'Name' => 'group 1',\n 'TinyName' => 'sample short name',\n 'StartGroupCallOnEnter' => '91XXXXXXXXXX',\n 'EndGroupCallOnExit' => '91XXXXXXXXXX',\n 'Members' => [\n {\n 'Id' => 1567,\n 'Name' => 'someone',\n 'Number' => '91XXXXXXXXXX'\n },\n {\n 'Id' => 1568,\n 'Name' => 'xyzzy',\n 'Mobile' => '971XXXXXXXX'\n }\n ] }\n g2 = {\n 'Id' => 2,\n 'Name' => 'group 2',\n 'TinyName' => 'sample short name',\n 'StartGroupCallOnEnter' => '91XXXXXXXXXX',\n 'EndGroupCallOnExit' => '91XXXXXXXXXX',\n 'Members' => [\n {\n 'Id' => 1561,\n 'Name' => 'someone',\n 'Number' => '91XXXXXXXXXX'\n },\n {\n 'Id' => 1562,\n 'Name' => 'xyzzy',\n 'Mobile' => '971XXXXXXXX'\n }\n ] }\n group_list = [g1, g2]\n\n stub_request(:get, mock_uri('Groups'))\n .to_return(status: 200, body: { 'Success' => true,\n 'Message' => \"Operation succeeded\",\n 'ApiId' => API_ID,\n 'Groups' => group_list }.to_json)\n\n status, details_list, _, _ = client.group.get_group_collection\n refute_nil status, \"No status object returned.\"\n assert status.success, \"Status did not indicate success: \" + status.message\n refute_nil details_list, \"No list of group detail objects returned.\"\n assert_kind_of Array, details_list, \"Details list isn't an array.\"\n assert_equal 2, details_list.length, \"Details list is the wrong length.\"\n assert_equal \"group 1\", details_list[0].name, \"First group name isn't correct.\"\n assert_equal \"group 2\", details_list[1].name, \"Second group name isn't correct.\"\n\n end", "title": "" }, { "docid": "92fa2f3eb7232e3aa3e8011093703956", "score": "0.5130239", "text": "def test03_publish_media_draft\n\t\tloginPost\n\t\t$browser.goto($patch_media)\n\t\tsleep 2\n\t\tif $post_media_description.exists?\n\t\t\t$post_media_description.set(\"Media Description #{random}.\")\n \t\t\tpostGroupPop\n\t\t\t$post_media_button.click\n\t\t\t$post_media_file_upload.set(\"#{$post_media_username}/patch-automation/test/TestData/GlacierBasinTrailMtRainier.JPG\")\n\t\t\t$post_save_draft.fire_event(\"onclick\")\n\t\telse puts \"PD04T03: FAILED! User unable to save draft.\"\n\t\tend\n\t\t\n\t\tif $post_draft_success.exists?\n\t\t\tcancel_delete\n\t\telse puts \"PD04T01: FAILED! Unable to delete draft.\"\n\t\tend\n\tend", "title": "" }, { "docid": "fe63fde6272d9217ed5ab59068ea7338", "score": "0.51226264", "text": "def enter_media_info_data(data_set)\n hide_notifications_bar\n enter_media_id_num data_set\n end", "title": "" } ]
4c67f8ca0ff772dc36f7a421e9b8f191
temporory file path with name
[ { "docid": "6f6ba67699530afbaf32f9eaf6c89fc7", "score": "0.6454865", "text": "def tmp_file_path\n File.join(Dir.tmpdir, \"#{tmp_name}.csv\")\n end", "title": "" } ]
[ { "docid": "bbb589a9494c8cb48c25904a50a78781", "score": "0.76767373", "text": "def file_name\n Pathname(\"#{dir_name}temporaryfile\")\n end", "title": "" }, { "docid": "7f67b9627d33c58de9bdc8a175adbe57", "score": "0.7655763", "text": "def path\n File.join @@temp, name.gsub(NEITHER_A_WORD_CHARACTER_NOR_A_DOT, '')\n end", "title": "" }, { "docid": "21d85fb04d64616bd5622db4c7b97cc7", "score": "0.7548771", "text": "def tmpfile_pathname(name)\n tmpfile_dir_pathname.join(name)\n end", "title": "" }, { "docid": "b5fc50251c588dd2df0683f0e3dbfb79", "score": "0.7412622", "text": "def path\n @mutex.synchronize { @tmpname.dup }\n end", "title": "" }, { "docid": "021b4262b92d650bdb8dde2fb51e18df", "score": "0.7324611", "text": "def temp_path(basename)\n File.join(\n @temp_dir,\n \"#{::SecureRandom.hex(7)}__#{basename}\"\n )\n end", "title": "" }, { "docid": "37e6faddf0d9f1d9ab5ca8e2fa46ba07", "score": "0.730604", "text": "def sample_path name=nil\n return TMP_DIR.join(FILES[context]).to_s unless name\n TMP_DIR.join(FILES[name]).to_s\n end", "title": "" }, { "docid": "d175fe1754bb2e8ccccf383950a95275", "score": "0.73014367", "text": "def tmp_filepath\n private_filepath(self.filename)\n end", "title": "" }, { "docid": "0b7b26c4be84e9881719b94d4f5addc1", "score": "0.7279122", "text": "def temp_path(*args, &block)\n ext = extname\n self.class.temp_file_path([basename(ext).to_s, ext], *args, &block)\n end", "title": "" }, { "docid": "c7952e15fe9d84521356b95697f63b48", "score": "0.7219464", "text": "def file_path\n File.join base_path , name\n end", "title": "" }, { "docid": "ecea5be73c2cf5c4a2c5e5eb0777eacd", "score": "0.7184471", "text": "def tmp_file(file)\n File.expand_path(file, tmp)\n end", "title": "" }, { "docid": "8f4167ac8a4cb4cbe47fefe34d0fec91", "score": "0.70674485", "text": "def temp_file(file)\n temp_dir = SystemProperties::getTempFilesPath\n\n unless File.directory?(temp_dir)\n FileUtils.mkdir_p(temp_dir)\n end\n\n \"#{temp_dir}/#{file}\"\n end", "title": "" }, { "docid": "06e2cbb5e8d44ccb473452a34beb1781", "score": "0.7035811", "text": "def tmp_file(filename)\n File.expand_path File.join(File.dirname(__FILE__), \"tmp\", filename)\n end", "title": "" }, { "docid": "ecc0ef05186d9b38e7c65f8cfda71875", "score": "0.70117813", "text": "def set_temp_path(value)\n self.size = value.is_a?(String) || !value.respond_to?(:size) ? File.size(value) : value.size\n self.filename ||= basename_for value\n @temp_path = value\n end", "title": "" }, { "docid": "a25d39f642887db0ce1c55d0a8eeb77b", "score": "0.70116866", "text": "def generate_temp_path\n path = Tempfile.new($$).path\n rm_f path\n path\n end", "title": "" }, { "docid": "053eae90d6d3179569d5113de29355bf", "score": "0.7010167", "text": "def create_temp_file\n copy_to_temp_file full_filename\n end", "title": "" }, { "docid": "d1fc0166b370e2dfd9dcea41cbbdce14", "score": "0.7005636", "text": "def temp_file_name prefix='', suffix=''\n Dir::Tmpname.create( [prefix,suffix], @sandbox_dir ){}\n end", "title": "" }, { "docid": "7c4adcda4d4de2bf90116b67b606547a", "score": "0.70056087", "text": "def full_path\n\n File.join TEMPLATE_DIR, filename\n\n end", "title": "" }, { "docid": "3b81d1d8f8d57bc785c2a946759c91d3", "score": "0.69912785", "text": "def make_temp_name(file_name)\n \"#{Rails.root}/tmp/_fwsc_#{File.basename(file_name)}.#{$$}.#{Time.now.to_f}\"\n end", "title": "" }, { "docid": "907b8859cbf5572b2d5e77b7be883884", "score": "0.69666225", "text": "def tf(name)\n path = \"/tmp/#{name}\"\n @tempfiles << path\n path\nend", "title": "" }, { "docid": "f63b2a7737cc955b3a81900dbbf90662", "score": "0.6958153", "text": "def generate_temp_file(name, content)\n Tempfile.open(name) do |file|\n file.write(content)\n return file.path\n end\nend", "title": "" }, { "docid": "e119176169c87b6d1eaf9cd650c97de1", "score": "0.69442", "text": "def generate_file\n name = nil\n i = 1\n loop do\n name = \"#{temp_dir}/#{i}\"\n break if !File.exist?(name)\n i += 1\n end\n name = File.expand_path(name)\n FileUtils.touch name\n clean_up name\n name\n end", "title": "" }, { "docid": "bbe9e4dd8e4801040ae8555b15b47580", "score": "0.6927917", "text": "def path\n @fname.dup\n end", "title": "" }, { "docid": "df0b9dbd19f70064605507422bedfde5", "score": "0.6920014", "text": "def create_temp_file() end", "title": "" }, { "docid": "df0b9dbd19f70064605507422bedfde5", "score": "0.6920014", "text": "def create_temp_file() end", "title": "" }, { "docid": "41a57c40d466b9040e7a90cf442b4e1b", "score": "0.6914803", "text": "def temp_file(part)\n file_name = filename?(part)\n File.expand_path(File.join(msg_tmp_dir(),File.basename(file_name)))\n end", "title": "" }, { "docid": "c1a22d8dfe9f1931d30a28d48d806f55", "score": "0.6893468", "text": "def tmp_path=(_arg0); end", "title": "" }, { "docid": "6b7d28f3da8fe2f9733dc2c10cb5cf2f", "score": "0.6889734", "text": "def temp_file_path(*args)\n if block_given?\n temp_file(*args) do |file|\n yield file.path\n end\n else\n file = temp_file(*args)\n file.close\n path = file.path\n path.instance_variable_set(:@__temp_file, file)\n path\n end\n end", "title": "" }, { "docid": "b1cfd44b15bc3efb9f09ccbf9a484808", "score": "0.6881591", "text": "def temp_output_file(file_type)\n \"#{File.dirname(__FILE__)}/../../tmp/spec.#{file_type}.tmp\" \n end", "title": "" }, { "docid": "b72b247ffea0902bf91af8b244b4740b", "score": "0.6859953", "text": "def path\n @tmpname\n end", "title": "" }, { "docid": "b9a55c122b09488db546f05f748befe2", "score": "0.683996", "text": "def f(name)\n tmpdir + name\n end", "title": "" }, { "docid": "b9a55c122b09488db546f05f748befe2", "score": "0.683996", "text": "def f(name)\n tmpdir + name\n end", "title": "" }, { "docid": "30e57853f4eb1b44c2a34d40cc0eeb3c", "score": "0.6834927", "text": "def file_name(n)\n \"temp/#{n}.temp\"\n end", "title": "" }, { "docid": "3c15c708518e5b238006473eaabcdfe5", "score": "0.68002814", "text": "def temp_path\n \"#{UPLOAD_PATH}/#{@date_time_created}\"\n end", "title": "" }, { "docid": "3c15c708518e5b238006473eaabcdfe5", "score": "0.68002814", "text": "def temp_path\n \"#{UPLOAD_PATH}/#{@date_time_created}\"\n end", "title": "" }, { "docid": "670e519614ddbce85eba6d54a278809b", "score": "0.6794807", "text": "def tmp_path\n Default.tmp_path / pool.name / name\n end", "title": "" }, { "docid": "670e519614ddbce85eba6d54a278809b", "score": "0.6794807", "text": "def tmp_path\n Default.tmp_path / pool.name / name\n end", "title": "" }, { "docid": "389190d2f6f0050066f8697c3205124d", "score": "0.67732406", "text": "def real_path_to(file); end", "title": "" }, { "docid": "389190d2f6f0050066f8697c3205124d", "score": "0.67732406", "text": "def real_path_to(file); end", "title": "" }, { "docid": "eabd49ab4ab9d75247f1f15fdce8c6db", "score": "0.6749201", "text": "def path\n tempfile.path\n end", "title": "" }, { "docid": "874dd0e56fc00784b2a324bc0580f0af", "score": "0.67461693", "text": "def tmp_path(ext)\n tf = Tempfile.new(ext)\n tf.unlink\n tf.to_path\n end", "title": "" }, { "docid": "e3b66d5b9ca5374b84b9999aaa11d45b", "score": "0.6735992", "text": "def convert_to_path(file, name); end", "title": "" }, { "docid": "101d8f31f6c7653a25830a18357aef12", "score": "0.6724955", "text": "def tmp_path\n @tmpfile.path\n end", "title": "" }, { "docid": "d2bcefc5779fa6b6ea3383e2472d141e", "score": "0.6717779", "text": "def temp_file_name\n begin\n result = File.join(Dir.tmpdir, \"#{self.class.name}-#{Random.rand}.pstore\")\n end while File.exists?(result)\n result\n end", "title": "" }, { "docid": "8562f7e2b4a046b5c72b78631832ce84", "score": "0.6703117", "text": "def temp_output_file(file_type)\n File.expand_path(\"#{File.dirname(__FILE__)}/../../tmp/spec.#{file_type}.tmp\")\n end", "title": "" }, { "docid": "ddbd54d0947a99b306c040dc7091534d", "score": "0.6699493", "text": "def tempfile(filename, ext)\n @@temp_id += 1\n return Pathname.new(@temp_dir) + \"gz#{@@temp_id}_#{@pid}_#{filename}#{ext}\"\n end", "title": "" }, { "docid": "326f3c20f3f72811726729b520a74331", "score": "0.6685813", "text": "def path(name)\n File.join(prepared_root, name.to_s)\n end", "title": "" }, { "docid": "4e76cbcefa0295bbdea0881cfc2c6b2b", "score": "0.66653734", "text": "def tmp(path = nil)\n File.join(*[Chef::Config[:file_cache_path], path].compact)\n end", "title": "" }, { "docid": "96c3bbaab3ba53f2b4ab1655dd73bc50", "score": "0.6648884", "text": "def local_path_for_file(file)\n if file.respond_to?(:path)\n file.path\n else\n Tempfile.open('') do |t|\n t.binmode\n t.write(file)\n t.close\n t.path\n end\n end\n end", "title": "" }, { "docid": "19b0b900266414e2e835abd8d717f2f1", "score": "0.66482997", "text": "def _get_tmp_filename(name)\n file = Tempfile.new(name.to_s)\n retval = file.path\n file.close\n file.unlink\n return retval\n end", "title": "" }, { "docid": "6e6f891acef2b6ee9659264bbb89058f", "score": "0.6646553", "text": "def temporary_file\n # Ensure this is unique so that is doesn't clash with parallel compile processes\n Pathname.new \"#{Origen.root}/tmp/model_#{id}_compiler_#{Process.pid}_#{Time.now.to_f}\"\n end", "title": "" }, { "docid": "4aecf025b854adc5d75b75f37b3dc7e4", "score": "0.6644223", "text": "def temp_file(ext = T.unsafe(nil)); end", "title": "" }, { "docid": "4aecf025b854adc5d75b75f37b3dc7e4", "score": "0.6644223", "text": "def temp_file(ext = T.unsafe(nil)); end", "title": "" }, { "docid": "ac3afcf22c6fd2ebf1375fdf8a69d3a1", "score": "0.66351336", "text": "def destination_path\n name = File.basename @filepath\n dir = File.dirname @filepath\n additive = Time.now.to_i\n temp_name = \"#{additive}_#{name}\"\n\n \"#{dir}/#{temp_name}\"\n end", "title": "" }, { "docid": "ea84e676244970edfcec5a47b784413f", "score": "0.6633449", "text": "def photo_temp_path(style)\n \"tmp/#{self.code}-#{style}.jpg\" \n end", "title": "" }, { "docid": "04960954cdb0c59534d3b8c589a01932", "score": "0.6631974", "text": "def make_tempname\n Rails.root.join( \"public\", \"forms\", Dir::Tmpname.make_tmpname(\"\", \".pdf\"))\n end", "title": "" }, { "docid": "52e39af266d5f226acc0608f4edab700", "score": "0.66290575", "text": "def file_path\n dir_name + file_name\n end", "title": "" }, { "docid": "95d375fcef23595e7f92f76575b9353b", "score": "0.6627855", "text": "def create_temp_file_with(base_name, content)\n file = Tempfile.new(base_name)\n file.write(content)\n file.close\n file.path\n end", "title": "" }, { "docid": "5645d455c805d854781057442c7b436d", "score": "0.66223675", "text": "def temp_it(filename, data)\n ext = filename.split('.')\n file = Tempfile.new([filename, \".#{ext[1]}\"]).tap do |f|\n f.rewind\n f.write(data)\n f.close\n end\n @temp_files[ext[0].to_sym] = file\n file.path\n end", "title": "" }, { "docid": "b69ceb3d69b6f0e35c146f12b1f2782a", "score": "0.66220367", "text": "def temp(ext = nil, temp_path = nil, config: Config.new)\n temp_path ||= config.settings['temp_path']\n ext ||= config.settings['ext']\n\n to_path = File.join(\n temp_path,\n [@name, ext].join('.')\n )\n FileUtils.mkdir_p temp_path\n symlink to_path\n to_path\n end", "title": "" }, { "docid": "a1a9813328ca2fc86ff383f5476c768f", "score": "0.66213346", "text": "def path_file\n @root.join FILE_NAME\n end", "title": "" }, { "docid": "a1a9813328ca2fc86ff383f5476c768f", "score": "0.66213346", "text": "def path_file\n @root.join FILE_NAME\n end", "title": "" }, { "docid": "85ca1ce050df0eb8255c5bff6e647f10", "score": "0.6614961", "text": "def get_temp_filename\n rand_name = \"#{rand(10000000)}\" # A longish string\n if FileTest.exist?(rand_name)\n rand_name = get_temp_filename\n end\n\n return rand_name\nend", "title": "" }, { "docid": "85ca1ce050df0eb8255c5bff6e647f10", "score": "0.6614961", "text": "def get_temp_filename\n rand_name = \"#{rand(10000000)}\" # A longish string\n if FileTest.exist?(rand_name)\n rand_name = get_temp_filename\n end\n\n return rand_name\nend", "title": "" }, { "docid": "73b33fd8eba646261fccc3dd4773975f", "score": "0.66144484", "text": "def create_tempfile(basename); end", "title": "" }, { "docid": "d3521b3bfa0f945e24ff9132e539965e", "score": "0.6603325", "text": "def temp_path\n nil\n end", "title": "" }, { "docid": "92f848b48590d7d98b9628990a468798", "score": "0.6601762", "text": "def sprint_temp_file(type)\n file_name = \"#{Time.now.to_f}.#{self.class.default_ext(type)}\"\n File.join(msg_tmp_dir(),File.basename(file_name))\n end", "title": "" }, { "docid": "8c47d42a93ba721e6816e4993464e07b", "score": "0.65946424", "text": "def temporary_path(path=nil)\n if path\n File.join(temporary_directory, path)\n else\n temporary_directory\n end\n end", "title": "" }, { "docid": "a7c0d93560d126d4d8dbac8345efb174", "score": "0.6590205", "text": "def tmp_file(ext = nil)\n @_tmp_count ||= 0\n ext ||= \"#{@_tmp_count += 1}.tmp\"\n File.expand_path(\"#{dataset.name}.#{ext}\", tmp)\n end", "title": "" }, { "docid": "f6a602e6b5ed3e5474c55243e69157d6", "score": "0.658781", "text": "def temporary_filename\n @iotmp ? @iotmp.path : nil\n end", "title": "" }, { "docid": "13a92af9c2d764e1ae20b4c85f367b99", "score": "0.6587735", "text": "def tmp_path\n end", "title": "" }, { "docid": "13a92af9c2d764e1ae20b4c85f367b99", "score": "0.6587735", "text": "def tmp_path\n end", "title": "" }, { "docid": "d750172bfb2a692a3775457f695b1677", "score": "0.65712935", "text": "def tmppath\n '/tmp/' + random_string\n end", "title": "" }, { "docid": "d750172bfb2a692a3775457f695b1677", "score": "0.65712935", "text": "def tmppath\n '/tmp/' + random_string\n end", "title": "" }, { "docid": "c1a38596ed592725edfc33ef49fc40b9", "score": "0.65574306", "text": "def store_path(for_file = T.unsafe(nil)); end", "title": "" }, { "docid": "5f152b6381f32f68fc79abd626effc9f", "score": "0.65536207", "text": "def in_temp_dir(path)\n File.join(temp_dir, path)\n end", "title": "" }, { "docid": "01541936cc1bbe59e93e2cea21c3fe5b", "score": "0.6538631", "text": "def tmp_output_path(filename)\n path = File.expand_path(File.basename(filename), TMP_OUTPUT_DIR)\n\n if block_given?\n FileUtils.mkdir_p(TMP_OUTPUT_DIR)\n yield path\n FileUtils.rm_f(path)\n else\n path\n end\n end", "title": "" }, { "docid": "e17ce2b1d7ddabd4613373675cb6465c", "score": "0.6532918", "text": "def create_temp_file\n unless File.directory?(File.dirname(@file_path))\n FileUtils.mkdir_p(File.dirname(@file_path))\n end\n File.open(\"#{@file_path}.tmp\", 'wb') {}\n end", "title": "" }, { "docid": "c30ac18a78dd8123add8e0fb912a03ac", "score": "0.6531557", "text": "def rename_newfile\n File.rename self.temp_path, self.path\n end", "title": "" }, { "docid": "c30ac18a78dd8123add8e0fb912a03ac", "score": "0.6531557", "text": "def rename_newfile\n File.rename self.temp_path, self.path\n end", "title": "" }, { "docid": "b059580db5eae142159e03442f8bbd2f", "score": "0.65279245", "text": "def temp_path\n caller_file = Sprout.file_from_caller caller.first\n @temp_path ||= make_temp_folder File.dirname(caller_file)\n end", "title": "" }, { "docid": "c85f000fc2da3b90b81407a546a5dbd2", "score": "0.6527298", "text": "def temp_path\n p = temp_paths.first\n p.respond_to?(:path) ? p.path : p.to_s\n end", "title": "" }, { "docid": "f0fac752d2d190c52bd6c9745a14457f", "score": "0.65250146", "text": "def tmp_filename source:, format:, prefix: nil\n ext = File.extname(source)\n source_filename_without_ext = File.basename(source, ext)\n File.join File.dirname(source), \"tmp#{prefix.present? ? '_' + prefix : ''}_#{source_filename_without_ext}_#{Time.now.to_i}.#{format}\"\n end", "title": "" }, { "docid": "49eaa0e549e958374ab64cb394eb9ef7", "score": "0.65243673", "text": "def make_template_path(filename)\n return File.join(templates_dir, filename)\n end", "title": "" }, { "docid": "470bdef11ef6b1f7d5489495aaf23389", "score": "0.652364", "text": "def file_cache_path(file_name)\n path = Msf::Config.loot_directory\n path << '/'\n ws = (db ? myworkspace.name[0, 16] : 'default').to_s\n path << ws + '/'\n host = framework.db.normalize_host(host)\n path << \"#{host}/\"\n path << 'filesystem/'\n path << file_name.to_s\n ::File.expand_path(path)\n end", "title": "" }, { "docid": "a2d67bc4488e12c65b6f68b76c68014b", "score": "0.65218544", "text": "def file_root; \"#{self.class.to_s}/#{self.id || 'tmp'}\"; end", "title": "" }, { "docid": "1adc8c959b6fa990be4ea4965adfde4f", "score": "0.6516778", "text": "def final_temp_path\n chunk_path(FinalFilenameSuffix)\n end", "title": "" }, { "docid": "eebbb67decbe352d7398021d918b64c7", "score": "0.6495083", "text": "def standardized_tmp_file_name(file_set, file_name)\n CurationConcerns::WorkingDirectory.send(:full_filename, file_set.id, file_name).tap do |path|\n # and make it's parents so we can open a file in it later.\n FileUtils.mkdir_p(File.dirname(path))\n end\n end", "title": "" }, { "docid": "0d91e10de5a5b4bbdfdc06f267443b08", "score": "0.6485009", "text": "def temporary_file(contents=nil)\n f = Tempfile.new(\"vagrant-unit\")\n\n if contents\n f.write(contents)\n f.flush\n end\n\n # Store the tempfile in an instance variable so that it is not\n # garbage collected, so that the tempfile is not unlinked.\n @_temp_files << f\n\n return Pathname.new(f.path)\n end", "title": "" }, { "docid": "7139d4576d78f01039c4032874589cd1", "score": "0.6481966", "text": "def temporary_file(contents=nil)\n f = Tempfile.new(\"vagrant-unit\")\n\n if contents\n f.write(contents)\n f.flush\n end\n\n return Pathname.new(f.path)\n end", "title": "" }, { "docid": "206a995e9a683ea5f6dcf72e4f6064f5", "score": "0.64816654", "text": "def temp_path\n p = temp_paths.first\n p.respond_to?(:path) ? p.path : p.to_s\n end", "title": "" }, { "docid": "206a995e9a683ea5f6dcf72e4f6064f5", "score": "0.64816654", "text": "def temp_path\n p = temp_paths.first\n p.respond_to?(:path) ? p.path : p.to_s\n end", "title": "" }, { "docid": "e3a855cd124ebe694b8ac73fe3cdf974", "score": "0.64815813", "text": "def with_named_temp final_name\n tmp_name = make_temp_name(final_name)\n yield tmp_name\n ::File.rename tmp_name, final_name if ::File.exists?(tmp_name)\n ensure\n ::File.unlink tmp_name if ::File.exists?(tmp_name)\n end", "title": "" }, { "docid": "2d07af37c12f4adf27c42606c1330c67", "score": "0.6480125", "text": "def generate_tmp_file_name(x)\n File.join(self.tmp_directory,\"#{self.otm_target_table}_#{self.otm_timestamp.to_i}_#{self.object_id}_#{Process.pid}_#{x}\")\n end", "title": "" }, { "docid": "6b4ed91edf6c356a5d44aa380de7c443", "score": "0.6469473", "text": "def tmp_file_path(origin, type)\n File.join(Rails.root, file_path(origin, type))\n end", "title": "" }, { "docid": "58bc0ea038dc4c4b4aa4c6f412efb318", "score": "0.64623654", "text": "def path\n @path ||= File.expand_path name\n end", "title": "" }, { "docid": "449d956efe3c75eae26e0df982e88aef", "score": "0.6459273", "text": "def tmp_path(*paths)\n root = File.expand_path('../..', __FILE__)\n File.join('tmp', *paths)\nend", "title": "" }, { "docid": "381d7b74af435c69386f036d24e2a330", "score": "0.6444864", "text": "def temp_file\n \"#{AppConfig.tmp_dir}/crossword-#{id}.txt\"\n end", "title": "" }, { "docid": "df4773f90169623c5f206d4037f5725a", "score": "0.64413613", "text": "def temp_file(filename, prefix = '')\n dir = Dir.mktmpdir(prefix)\n open(File.join(dir, filename), 'w+')\n end", "title": "" }, { "docid": "7e3c488a0c12658bd450b633c446aba7", "score": "0.64401203", "text": "def file_path\n File.join(dir, file_name)\n end", "title": "" }, { "docid": "1062eb93ced25acb819df643598d1a1e", "score": "0.6434807", "text": "def local_path\n \"#{Hopper.temp_dir}/#{directory_name}\"\n end", "title": "" } ]
7760c5a2b1ddfbb5f801bd7f4971e578
enable :sessions For secured endpoints only config.client_ips = ''
[ { "docid": "80a50546dfef150460bdbf4acc793e56", "score": "0.0", "text": "def index\n if current_user.sexual_preference == \"male\" && current_user.gender == \"male\"\n @user = User.where(gender: \"male\").where(sexual_preference: \"male\")\n elsif current_user.sexual_preference == \"female\" && current_user.gender == \"female\"\n @user = User.where(gender: \"female\").where(sexual_preference: \"female\")\n else\n @user = User.where(gender: current_user.sexual_preference)\n end\n\n if params[:search].present?\n if params[:search][:age_from].present? && params[:search][:age_to].present?\n @user = @user.where(\"age > ? and age < ?\",params[:search][:age_from].to_i,params[:search][:age_to].to_i)\n elsif params[:search][:children].present? && params[:search][:children] == \"yes\"\n @user = @user.where.not(children: \"\")\n elsif params[:search][:height_from].present? && params[:search][:height_to].present?\n @user = @user.where(\"height > ? and height < ?\",params[:search][:height_from], params[:search][:height_to])\n elsif params[:search][:ethnicity].present?\n @user = @user.where(ethnicity: params[:search][:ethnicity])\n end\n end\n end", "title": "" } ]
[ { "docid": "73f742418c6593897fc8b7281077de45", "score": "0.6204667", "text": "def session_endpoint_public(_options)\n nil\n end", "title": "" }, { "docid": "76d1eb909e191c23e9023c0a7535499b", "score": "0.6085182", "text": "def using_authenticated_proxy?; end", "title": "" }, { "docid": "2918371e32359fb2c67759972046271e", "score": "0.59609914", "text": "def start_session(endpoint); end", "title": "" }, { "docid": "75ceb44e8f01390829831168d086f498", "score": "0.5956689", "text": "def session_options; end", "title": "" }, { "docid": "75ceb44e8f01390829831168d086f498", "score": "0.5956689", "text": "def session_options; end", "title": "" }, { "docid": "2340447bd44116a261df97f2143e7105", "score": "0.59418887", "text": "def session_endpoint_private(options = {})\n transaction = Janus::Transactions::Session.new(true,\n options['session_id'])\n transaction.connect { yield(transaction) }\n end", "title": "" }, { "docid": "17799d94b08af069818214c7ef9aedae", "score": "0.57109374", "text": "def setup_ip\n @request = ActionController::TestRequest.create(self.class.controller_class)\n @request.remote_addr = \"127.0.0.1\"\n session[:user_id] = 1\n end", "title": "" }, { "docid": "1cb89f2f61f3fc3a66dbb274ede3bbed", "score": "0.56895834", "text": "def initialize_session\n puts 'initializing session with client'\n end", "title": "" }, { "docid": "f6077382bc426c13aaccbc66ee70616b", "score": "0.56594914", "text": "def authenticate_client\n client.authenticate if client.session.expired?\n end", "title": "" }, { "docid": "dbf10a9f15058f522d72c4b0cca3da6d", "score": "0.5623799", "text": "def security_server_client\n end", "title": "" }, { "docid": "440f2d3eef84c4a02852e1d2d6d97e9f", "score": "0.55412596", "text": "def session_ip\n session[:ip] = request.remote_ip\n end", "title": "" }, { "docid": "0677b018ed106a2eb18c3a2259a164f5", "score": "0.55112445", "text": "def set_session\n \n end", "title": "" }, { "docid": "b2408a95474fea4a4318221e4f33c268", "score": "0.54873234", "text": "def client_access\n super\n end", "title": "" }, { "docid": "5eaf1b9b96b660866c3660621be64e6e", "score": "0.54408485", "text": "def valid_client?(request)\n (request.env[\"HTTP_X_FORWARDED_FOR\"] == \"127.0.0.1\") ||\n (request.env[\"HTTP_X_CLIENT_IDENTIFIER\"] == \"<< Client Identifier Here >>\") &&\n (request.env[\"HTTP_X_CLIENT_SECRET_KEY\"] == \"<< Secret Token Here >>\")\n end", "title": "" }, { "docid": "78d2373e7fdd74b6145a1979fde455bb", "score": "0.5425885", "text": "def ssl_client_key\n super\n end", "title": "" }, { "docid": "47598d28da94c972bf4d959dce637720", "score": "0.5419705", "text": "def init_session\n before do\n path = defined?(init_session_path) ? init_session_path : '/'\n get(path)\n end\n end", "title": "" }, { "docid": "df3df2dbcaff909f4cdea32a474eadeb", "score": "0.54046476", "text": "def client_login_disabler\n unless Spree::Auth::Disabler::Config[:client_login_enabled]\n # TODO: add variants of workaround (404 and so on)\n if (user = User.find_by_email(params[:user_session]['login'])) && (!user.has_role? :admin)\n flash[:error] = t('spree_auth_disabler.client_login_disabled')\n redirect_to root_url \n end\n end\n end", "title": "" }, { "docid": "d7ab1e2ec52be87dd8180b2c93164b6a", "score": "0.5394634", "text": "def disable_sessions\n self.auto_capture_sessions = false\n @enable_sessions = false\n end", "title": "" }, { "docid": "c303d68b9e54d7d4193b12afe515a699", "score": "0.5372173", "text": "def ip_configuration_require_ssl\n settings.fetch(:ip_configuration, {})[:require_ssl]\n end", "title": "" }, { "docid": "d7abe393bed3c44e5d29c8d944b0f1d9", "score": "0.5365018", "text": "def opentok_session\n opentok.create_session(request.remote_addr).to_s\n end", "title": "" }, { "docid": "c41ef760cf6159bcec16848c4db96415", "score": "0.53522706", "text": "def serverssl\n super\n end", "title": "" }, { "docid": "158cffca6a594672c92986ce84917094", "score": "0.53303784", "text": "def session env\n raise \"Rack env['#{rack_session}'] is nil ... has a Rack::Session middleware be enabled? \" + \n \"use :rack_session for custom key\" if env[rack_session].nil? \n env[rack_session]['rack.oauth'] ||= {}\n env[rack_session]['rack.oauth']['default'] ||= {}\n end", "title": "" }, { "docid": "8cdb678f33e8c42ce10266c9dde1a963", "score": "0.531982", "text": "def set_no_auth\n FHIR.logger.info 'Configuring the client to use no authentication.'\n @use_oauth2_auth = false\n @use_basic_auth = false\n @security_headers = {}\n @client = RestClient\n @client.proxy = proxy unless proxy.nil?\n @client\n end", "title": "" }, { "docid": "c7e50714fdff320243e00e9234bff732", "score": "0.531049", "text": "def default_config\n data = {\n 'acr_values' => 'http://idmanagement.gov/ns/assurance/loa/1',\n 'client_id' => 'urn:gov:gsa:openidconnect:sp:sinatra',\n }\n\n if LoginGov::Hostdata.in_datacenter?\n # EC2 deployment defaults\n\n env = LoginGov::Hostdata.env\n domain = LoginGov::Hostdata.domain\n\n if env == 'prod'\n data['idp_url'] = \"https://secure.#{domain}\"\n else\n data['idp_url'] = \"https://idp.#{env}.#{domain}\"\n end\n data['redirect_uri'] = \"https://sp-oidc-sinatra.#{env}.#{domain}/\"\n data['sp_private_key_path'] = \"aws-secretsmanager:#{env}/sp-oidc-sinatra/oidc.key\"\n data['redact_ssn'] = true\n else\n # local dev defaults\n data['idp_url'] = 'http://localhost:3000'\n data['redirect_uri'] = 'http://localhost:9292/'\n data['sp_private_key_path'] = demo_private_key_path\n data['redact_ssn'] = false\n end\n\n data\n end", "title": "" }, { "docid": "54d29cefa12b84d5cd496214fb7dcf93", "score": "0.5307929", "text": "def no_session # :nologin: :norobots:\n end", "title": "" }, { "docid": "938d2207b4517ab2d45b8dfa7e1104a2", "score": "0.52999926", "text": "def list_my_sessions_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: FrontendApi.list_my_sessions ...'\n end\n if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"per_page\"]\" when calling FrontendApi.list_my_sessions, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"per_page\"]\" when calling FrontendApi.list_my_sessions, must be greater than or equal to 1.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"page\"]\" when calling FrontendApi.list_my_sessions, must be greater than or equal to 1.'\n end\n\n # resource path\n local_var_path = '/sessions'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].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 header_params[:'X-Session-Token'] = opts[:'x_session_token'] if !opts[:'x_session_token'].nil?\n header_params[:'Cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?\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] || 'Array<Session>'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || []\n\n new_options = opts.merge(\n :operation => :\"FrontendApi.list_my_sessions\",\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: FrontendApi#list_my_sessions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "3d7c704a8054f4ba4e402a95d0088502", "score": "0.5292066", "text": "def ssl_required?\n return false if disable_ssl?\n return true if logged_in?\n super\n end", "title": "" }, { "docid": "90426a8cbaa21dc8449c9ae4a5f51041", "score": "0.52853584", "text": "def endpoint_options\n {user: @username,\n pass: @password,\n host: @host,\n port: @port,\n operation_timeout: @timeout_in_seconds,\n no_ssl_peer_verification: true,\n disable_sspi: true}\n end", "title": "" }, { "docid": "19d835c30220870e54d594641917ee39", "score": "0.5280047", "text": "def initialize_auth\n @conf[:use_user_pool_cache] = false\n end", "title": "" }, { "docid": "69496e23989fdeb65ecbd59daff7cb50", "score": "0.52772754", "text": "def get path, args={}, env={}\n env[\"rack.session\"] ||= {}\n super(path, args, env.merge('rack.url_scheme' => 'https'))\n end", "title": "" }, { "docid": "d6d8b6ea30b337e72da8d07449204001", "score": "0.5269131", "text": "def check_session_ip_binding\n return true unless logged_in?\n if !session[:session_ip].nil? && session[:session_ip] != request.headers['REMOTE_ADDR']\n # client IP has changed\n session_log(\"IP changed from #{session[:session_ip]} to #{request.headers['REMOTE_ADDR']}\")\n expire_session\n else\n # Assign client IP\n session[:session_ip] = request.headers['REMOTE_ADDR']\n return true\n end\n end", "title": "" }, { "docid": "7a15e8cf9a6a6dd109d426a3c545ad6b", "score": "0.52657413", "text": "def do_not_set_cookie\n request.session_options[:skip] = true\n end", "title": "" }, { "docid": "7a15e8cf9a6a6dd109d426a3c545ad6b", "score": "0.52657413", "text": "def do_not_set_cookie\n request.session_options[:skip] = true\n end", "title": "" }, { "docid": "7a15e8cf9a6a6dd109d426a3c545ad6b", "score": "0.52657413", "text": "def do_not_set_cookie\n request.session_options[:skip] = true\n end", "title": "" }, { "docid": "878956db6757ac1a5297a4f5cfa170f7", "score": "0.52637273", "text": "def authenticate_client_access!\n return if api_key_from_params.nil?\n\n return require_api_client if access_from_localhost?\n return require_api_client if access_from_preview_hosting? && restricted_api_access_mode?\n return require_api_client if access_from_production_hosting?\n return require_api_client if access_from_public_hosting?\n\n true # Do not halt otherwise\n end", "title": "" }, { "docid": "98324c588a4911690092befa6328c860", "score": "0.52604884", "text": "def sign_in\n request.session = { authorized: true }\n end", "title": "" }, { "docid": "5ec6ba1f74d6b01d0db9d0e37170d87c", "score": "0.52592516", "text": "def skip_authentication?\n true\n end", "title": "" }, { "docid": "09db383df2f4432613e13b7f5328bb3b", "score": "0.52559996", "text": "def setup\n @env = { Rack::Session::Abstract::ENV_SESSION_KEY => '123456', Rack::Session::Abstract::ENV_SESSION_OPTIONS_KEY => Rack::Session::Abstract::ID::DEFAULT_OPTIONS}\n SmartSessionApp.test_proc = nil\n end", "title": "" }, { "docid": "992644a4c6c30d14d8d16edacc9d6bba", "score": "0.5252866", "text": "def skip_session\n request.session_options[:skip] = true\n end", "title": "" }, { "docid": "992644a4c6c30d14d8d16edacc9d6bba", "score": "0.5252866", "text": "def skip_session\n request.session_options[:skip] = true\n end", "title": "" }, { "docid": "487129826d80e80d3e54f19210e585f8", "score": "0.52222747", "text": "def disable_request_forgery_protection; end", "title": "" }, { "docid": "c47628453b94b70e313e0a217a26437d", "score": "0.5214781", "text": "def ssl_client_certificate\n super\n end", "title": "" }, { "docid": "87a353c40908fd1489fab326648852c8", "score": "0.5207501", "text": "def handle_unverified_request\n super\n cookies.delete(:autologin)\n end", "title": "" }, { "docid": "eed6db95919573bc45cf7f72a507ad2e", "score": "0.5207192", "text": "def disable_ssl; end", "title": "" }, { "docid": "6db5ea40585c6e19016f6d1d9b501890", "score": "0.51892793", "text": "def disable_my_other_sessions_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: FrontendApi.disable_my_other_sessions ...'\n end\n # resource path\n local_var_path = '/sessions'\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 header_params[:'X-Session-Token'] = opts[:'x_session_token'] if !opts[:'x_session_token'].nil?\n header_params[:'Cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?\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] || 'DeleteMySessionsCount'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || []\n\n new_options = opts.merge(\n :operation => :\"FrontendApi.disable_my_other_sessions\",\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(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: FrontendApi#disable_my_other_sessions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "9bf5104dc4a098194b0bde65ec827abe", "score": "0.5161953", "text": "def connect_to_server\n puts \"==>connect_to_server\"\n if session[:client_id].length == 0 \n @client = FHIR::Client.new(session[:iss_url])\n @client.use_r4\n return # We do not have authentication\n end\n if session.empty? \n err = \"Session Expired\"\n # binding.pry \n redirect_to root_path, alert: err\n end\n if session[:iss_url].present?\n @client = FHIR::Client.new(session[:iss_url])\n @client.use_r4\n token_expires_in = session[:token_expiration] - Time.now.to_i\n if token_expires_in.to_i < 10 # if we are less than 10s from an expiration, refresh\n get_new_token\n end\n @client.set_bearer_token(session[:access_token])\n end\n rescue StandardError => exception\n reset_session\n err = \"Failed to connect: \" + exception.message\n redirect_to root_path, alert: err\n end", "title": "" }, { "docid": "d1d2cbffb319386fe7dc73110d68da68", "score": "0.51477647", "text": "def dalli_client\n Dalli::Client.new(nil, :compression => true, :namespace => 'rack.session', :expires_in => 3600)\nend", "title": "" }, { "docid": "5e30b41e0920e50ef6166e0ab07dc8c5", "score": "0.51386434", "text": "def encryption_client; end", "title": "" }, { "docid": "7ce1ee12c7a0ce7fd774ad333a323b8b", "score": "0.51339436", "text": "def setup_config_defaults!(cfg)\n cfg.session_type ||= default_session_type\n cfg.session_path ||= default_session_path\n cfg.session_options ||= {}\n cfg.sessions ||= []\n end", "title": "" }, { "docid": "a580389af09bbc41089ea9ce6bfc99ef", "score": "0.51305735", "text": "def session\n Thread.current['clients_manager'].client('Website').session\n end", "title": "" }, { "docid": "1f760c16d5a1d3d005ccd13bdccab83a", "score": "0.51241", "text": "def init_session\n if session\n if session.updated_at < Time.now - ::Gricer.config.max_session_duration\n self.session = Session.create previous_session: session, ip_address: @ip_address, agent: agent, requested_locale: @request_locale\n else\n self.session.touch\n end\n else\n self.is_first_in_session = true\n self.session = Session.create ip_address: @ip_address, agent: agent, requested_locale: @request_locale\n self.session.touch\n end\n \n session\n end", "title": "" }, { "docid": "668eb9016536017e4b632e6306aad232", "score": "0.5123856", "text": "def use_ssl?\n true # user_signed_in? (but would need to ensure Devise runs under ssl)\n end", "title": "" }, { "docid": "d7ce05dbc6ba556302c740bad53259a3", "score": "0.5121951", "text": "def open_session; end", "title": "" }, { "docid": "fe4d64d1580288324dc7dd274435d47f", "score": "0.5114643", "text": "def client_passive_login\n return_uri = session[:_return_uri]\n session[:_return_uri] = nil\n client_app = client_app(params[:client_id])\n login_path = params[:login_path] || '/users/auth/nyulibraries'\n # If user is signed in\n # redirect to client login\n if user_signed_in? && client_app.present?\n escaped_return_uri = CGI::escape(return_uri) if return_uri.present?\n client_authorize_url = URI.join(URI.parse(client_app.redirect_uri), login_path, \"?origin=#{escaped_return_uri}\")\n redirect_to \"#{client_authorize_url}\"\n # If the user is not signed in but there is a return URI\n # send the user back there\n elsif return_uri.present?\n redirect_to return_uri\n else\n head :bad_request\n end\n end", "title": "" }, { "docid": "5e79f6878c0687195c64a224ef3f6b82", "score": "0.5114613", "text": "def security_enabled_request_state\n super\n end", "title": "" }, { "docid": "c230bd1d7a826af6db9a354b3e2a1ff2", "score": "0.51080984", "text": "def session_options=(_arg0); end", "title": "" }, { "docid": "c230bd1d7a826af6db9a354b3e2a1ff2", "score": "0.51080984", "text": "def session_options=(_arg0); end", "title": "" }, { "docid": "8ec8c2868bd00562e9d991012f4bd902", "score": "0.5105787", "text": "def connect_to_server\n if session.empty? \n err = \"Session Expired\"\n binding.pry \n redirect_to root_path, flash: { error: err }\n end\n if session[:iss_url].present?\n @client = FHIR::Client.new(session[:iss_url])\n @client.use_r4\n token_expires_in = session[:token_expiration] - Time.now.to_i\n if token_expires_in.to_i < 10 # if we are less than 10s from an expiration, refresh\n get_new_token\n end\n @client.set_bearer_token(session[:access_token])\n end\n rescue => exception\n err = \"Connection failed: Ensure provided url points to a valid FHIR server\"\n redirect_to root_path, flash: { error: err }\n end", "title": "" }, { "docid": "f04808ec2ab66ebb601af6d8c71e9253", "score": "0.5102842", "text": "def show\n return unless restrict_to_hosts\n\n get_session_data(@session)\n end", "title": "" }, { "docid": "967b2048912f06b0864041f2eefa6741", "score": "0.5101339", "text": "def connect_to_patient_server\n puts \"==>connect_to_patient_server\"\n if session[:client_id].length == 0 \n @patient_client = FHIR::Client.new(session[:iss_url])\n @patient_client.use_r4\n return # We do not have authentication\n end\n if session.empty? \n err = \"Session Expired\"\n # binding.pry \n redirect_to root_path, alert: err\n end\n if session[:iss_url].present?\n @patient_client = FHIR::Client.new(session[:iss_url])\n @patient_client.use_r4\n token_expires_in = session[:token_expiration] - Time.now.to_i\n if token_expires_in.to_i < 10 # if we are less than 10s from an expiration, refresh\n get_new_token\n end\n @patient_client.set_bearer_token(session[:access_token])\n end\n rescue StandardError => exception\n reset_session\n err = \"Failed to connect: \" + exception.message\n redirect_to root_path, alert: err\n end", "title": "" }, { "docid": "e11eb69276820cd88f746953159c0359", "score": "0.50999296", "text": "def client_secret; end", "title": "" }, { "docid": "c69b02a1a00259c6b83eb3714f2a72fc", "score": "0.50970906", "text": "def ssl_required?\n (APP_CONFIG['use_https'] and !session[:user_id].nil?)\n end", "title": "" }, { "docid": "a34329198a9f402782c6ac811b066fc4", "score": "0.50966185", "text": "def default_config\n data = {\n 'acr_values' => ENV['acr_values'] || 'http://idmanagement.gov/ns/assurance/ial/1',\n 'client_id' => ENV['client_id'] || 'urn:gov:gsa:openidconnect:sp:sinatra',\n 'mock_irs_client_id' => ENV['mock_irs_client_id'] ||\n 'urn:gov:gsa:openidconnect:sp:mock_irs',\n 'redirect_uri' => ENV['redirect_uri'] || 'http://localhost:9292/',\n 'sp_private_key_path' => ENV['sp_private_key_path'] || './config/demo_sp.key',\n 'redact_ssn' => true,\n 'cache_oidc_config' => true,\n }\n\n # EC2 deployment defaults\n\n env = ENV['idp_environment'] || 'int'\n domain = ENV['idp_domain'] || 'identitysandbox.gov'\n\n data['idp_url'] = ENV.fetch('idp_url', nil)\n unless data['idp_url']\n if env == 'prod'\n data['idp_url'] = \"https://secure.#{domain}\"\n else\n data['idp_url'] = \"https://idp.#{env}.#{domain}\"\n end\n end\n data['sp_private_key'] = ENV.fetch('sp_private_key', nil)\n\n data\n end", "title": "" }, { "docid": "e1e5a0f41d65b27e2a15ceb15b9fe461", "score": "0.5096411", "text": "def handle_unverified_request\n reset_session\nend", "title": "" }, { "docid": "7992a505477729d669cc843da4ef1dba", "score": "0.5089671", "text": "def skip_session\n request.session_options[:skip] = true if token\n end", "title": "" }, { "docid": "162cf3fb537efbb1596f4352d92d3f55", "score": "0.50889677", "text": "def session\n raise Sinatra::Unit::SessionsDisabledError unless test_sessions_enabled?\n env['rack.session'] ||= {}\n end", "title": "" }, { "docid": "1e1c8557c7e745355537e1df9a2ac9e5", "score": "0.50858295", "text": "def set_client_access(opts)\n opts = check_params(opts,[:client_access_info])\n super(opts)\n end", "title": "" }, { "docid": "b2c8e4bd29a2567a578344647b764031", "score": "0.50832504", "text": "def session_config\n # ES: Crea la sesion, si el usuario está autorizado, si no, lo bloquea:\n # EN: Creates the session if the user is authorized, if not, block it:\n session[:empresa] = params[:idEmpresa].to_i;\n toRender = 'OK'\n\n respond_to do |format|\n format.json {render text: toRender}\n end\n end", "title": "" }, { "docid": "94b72bf6971775ba7102796e4c754af5", "score": "0.50831264", "text": "def authorize_client session_token\n base_url = \"#{APP_CONFIG['okta_base_url']}/oauth2/v1/authorize\"\n redirect_uri = \"#{APP_CONFIG['okta_openid_redirect_uri']}\"\n client_id = \"#{APP_CONFIG['okta_client_id']}\"\n scopes = [\"openid\", \"email\", \"groups\"].join(\"%20\")\n url = \"#{base_url}?sessionToken=#{session_token}&redirect_uri=#{redirect_uri}&response_type=id_token&client_id=#{client_id}&scope=#{scopes}&response_mode=fragment\"\n\n begin\n HttpClient.get(url)\n rescue HTTParty::RedirectionTooDeep => e\n open_id_token = e.response.header['location']\n end\n open_id_token.split('=').last\n end", "title": "" }, { "docid": "6d39f853b59939fb2a044c8e43423071", "score": "0.5081294", "text": "def require_ssl\n @require_ssl = true\n end", "title": "" }, { "docid": "09a16c7b039c64b2591de034ade12724", "score": "0.50803304", "text": "def login\n #If we go to login page we clear all data still in session to force a re-auth\n current_user = nil\n session[:user_id] = nil\n session[\"REMOTE_USER\"] = nil\n env[\"REMOTE_USER\"] = nil\n if params[:redirect_uri].nil? or params[:client_id].nil?\n redirect_to root_path\n else\n @from_application = ClientApplication.find_by_callback_url(params[:redirect_uri])\n if @from_application.nil?\n redirect_to root_path\n end\n end\n\n\n end", "title": "" }, { "docid": "758c1e13d131eb3b09251b93ea9af142", "score": "0.50787425", "text": "def ssl_opts; end", "title": "" }, { "docid": "3b815058a8fef0f0ae9c4307e0646417", "score": "0.5076643", "text": "def initialize\n @sandbox = true\n @enable_ssl = true\n end", "title": "" }, { "docid": "ac6d75a32dc438e62a2a0e26bc717b4b", "score": "0.5074336", "text": "def require_no_authentication\n end", "title": "" }, { "docid": "736c6127fd9172ece4cc8ec1786c7bb4", "score": "0.5071072", "text": "def ssl_required?\n true\n end", "title": "" }, { "docid": "aabd92e81575401010db43ff63396186", "score": "0.5070028", "text": "def secure!\n session_id_column = if self.class.columns_hash['sessid']\n :sessid\n else\n :session_id\n end\n raw_session_id = read_attribute(session_id_column)\n if ActionDispatch::Session::ActiveRecordStore.private_session_id?(raw_session_id)\n # is already private, nothing to do\n else\n session_id_object = Rack::Session::SessionId.new(raw_session_id)\n update_column(session_id_column, session_id_object.private_id)\n end\n end", "title": "" }, { "docid": "fd967d277f41398b80054b41b3b7a8b3", "score": "0.5067672", "text": "def authenticate_client\r\n client_id = request.headers['client-id']\r\n client_secret = request.headers['client-secret']\r\n\r\n unless client_id == Rails.application.secrets.api_key && client_secret == Rails.application.secrets.api_secret\r\n render json: ErrorResponse.new(\r\n code: 401, message: 'Unauthorized Request'\r\n ), adapter: :json, status: :unauthorized\r\n nil\r\n end\r\n\r\n end", "title": "" }, { "docid": "17d47322a764646532dd617624e3843f", "score": "0.5067091", "text": "def get_local_settings(app_settings)\n app_settings[\"session\"][:host_server] = @host_server\n app_settings[\"session\"][:port_server] = @port_server\n #if @login_name == @curr_user_name \n app_settings[\"session\"][:login_name] = @login_name# @curr_user_name\n #end \n app_settings[\"session\"][:password_login] = @password_login_md5 if @password_saved\n app_settings[\"session\"][:connect_type] = @serv_conn_type\n app_settings[\"web_http\"] = @server_type_http \n app_settings[\"session\"][:remote_web_srv_url] = @remote_web_url\n app_settings[\"session\"][:password_saved] = @password_saved \n end", "title": "" }, { "docid": "bce3aaee451e24b31cf5cda3e4173f93", "score": "0.50626254", "text": "def client_secret=(client_secret); end", "title": "" }, { "docid": "bce3aaee451e24b31cf5cda3e4173f93", "score": "0.50626254", "text": "def client_secret=(client_secret); end", "title": "" }, { "docid": "739d522a99ec37235e46aac3985572dd", "score": "0.5048929", "text": "def weak_session_config\n widget_session[:weak_session_config] ||= {}\n end", "title": "" }, { "docid": "aa33bed77aba7801d88c77ffb7052e51", "score": "0.50468814", "text": "def ssl_option\n super\n end", "title": "" }, { "docid": "68a29da026b3fc7a03cefff0e99f4872", "score": "0.5038482", "text": "def ds_connection\n if session[:int_key].nil? || session[:email].nil? || session[:password].nil?\n redirect_to new_login_path\n else\n @connection ||= Docusign::Base.login(\n :integrators_key => session[:int_key],\n :email => session[:email],\n :password => session[:password],\n :endpoint_url => Docusign::Config[:default_endpoint_url],\n :wiredump_dev => STDOUT #This echoes all SOAP calls to standard out. Change this to log somewhere else, or comment out to eliminate logging.\n )\n end\n end", "title": "" }, { "docid": "126fcdeb326ba54581ee7cdd3981c137", "score": "0.5036947", "text": "def start_session(nick)\n usr = User.first(:nickname=>params[:nickname])\n p User.all\n if usr != nil\n sid = gen_sessionid\n\n #associate nick with sid & IP & communication password\n $sessions[nick] = {:ip=>@env['REMOTE_ADDR'], :sid=> sid, :lastrequest=> Time.now.to_i}\n\n #return JSON with sessionid\n return {:sid => sid}\n end\n return 'error'\nend", "title": "" }, { "docid": "9cd243a51ab679d77f2b976f735ec177", "score": "0.5036301", "text": "def api_only\n @config.instance_variable_set(:@api_only, true)\n end", "title": "" }, { "docid": "866c51f6d858fec6004532b66a8a2d55", "score": "0.50293666", "text": "def session; end", "title": "" }, { "docid": "866c51f6d858fec6004532b66a8a2d55", "score": "0.50293666", "text": "def session; end", "title": "" }, { "docid": "866c51f6d858fec6004532b66a8a2d55", "score": "0.50293666", "text": "def session; end", "title": "" }, { "docid": "866c51f6d858fec6004532b66a8a2d55", "score": "0.50293666", "text": "def session; end", "title": "" }, { "docid": "c39b24b1f7ce66520aa4264ba2a3346a", "score": "0.5026612", "text": "def session_options\n ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS\n end", "title": "" }, { "docid": "f2d6eb931b6683328306cf0b15390cf5", "score": "0.5017999", "text": "def encryption_server; end", "title": "" }, { "docid": "384b98886f1533cd5edc437786eefdbb", "score": "0.5016913", "text": "def session\n Rack::Test::Session.new(Rack::MockSession.new(FULL_STACK_SYNERGY_APP))\nend", "title": "" }, { "docid": "ed76217264bb228f254e856d3de176f3", "score": "0.50152487", "text": "def ssl; end", "title": "" }, { "docid": "d4c70740a49ca39cf20664724c19fbbc", "score": "0.50128394", "text": "def authorize_routing(session)\n true\n end", "title": "" }, { "docid": "4303198b027992896ed79646c1bd92d2", "score": "0.5011183", "text": "def insert_xforwarded_for_header_mode\n super\n end", "title": "" }, { "docid": "8dd7a8d090a27ca38d65f2146f94e0d7", "score": "0.5009286", "text": "def configure_ssl(client)\n Preconditions.assert_class('client', client, Net::HTTP)\n client.use_ssl = true\n client.verify_mode = OpenSSL::SSL::VERIFY_PEER\n client.cert_store = OpenSSL::X509::Store.new\n client.cert_store.set_default_paths\n end", "title": "" }, { "docid": "eb6b4d2b66ac5986d74a6116b2d32247", "score": "0.50079596", "text": "def index\n return unless restrict_to_hosts\n\n @sessions = Session.where(event_id: @event.id)\n end", "title": "" }, { "docid": "ec25313266f6822c7bd8ce10e3e2e250", "score": "0.50057554", "text": "def skip_login? \n false \nend", "title": "" }, { "docid": "fc8bdfd06276b1c9cbe798b5e0962730", "score": "0.4996753", "text": "def session\n end", "title": "" }, { "docid": "25f79bf864c71cdb51c1d542d3764a5e", "score": "0.49949962", "text": "def skip_login?\n false\n end", "title": "" }, { "docid": "6105605a7d22bf4bb371d7ddc5968f62", "score": "0.4993772", "text": "def create\n @client = current_client\n @session = @client.session\n debug { \"SessionsController#create - #{@session.inspect}\"}\n raise \"ResourceOwner from token != session.owner\" if doorkeeper_token.resource_owner_id != @session.owner.id\n\n @client.update_attributes!(client_params)\n render json: @client, status: :created, serializer: Sso::ClientSerializer\n end", "title": "" } ]
774e596d8aed81d2450f7bf419065427
GET /advertisements/1 GET /advertisements/1.json
[ { "docid": "88779ab337da6d15db4596235f6c9fb9", "score": "0.57923865", "text": "def show\n @advertisement = Advertisement.where(id: params[:id]).last\n end", "title": "" } ]
[ { "docid": "08b084142167e533c4f61d246c6ec142", "score": "0.76745564", "text": "def show\n respond_to do |format|\n format.html\n format.json { render json: { advertisements: @advertisements } }\n end\n end", "title": "" }, { "docid": "032f3506b1c3562078418df18497fac2", "score": "0.7375984", "text": "def index\n @advertisements = Advertisement.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @advertisements }\n end\n end", "title": "" }, { "docid": "032f3506b1c3562078418df18497fac2", "score": "0.7375984", "text": "def index\n @advertisements = Advertisement.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @advertisements }\n end\n end", "title": "" }, { "docid": "cc3e7692d000998c03578143c3f39bd1", "score": "0.7038442", "text": "def index\n @advertisements = Advertisement.where(merchant_id: params[:merchant_id])\n\n render json: @advertisements\n end", "title": "" }, { "docid": "fe37191b9b74bb004f28060d520e0d77", "score": "0.6936181", "text": "def index\n @advertisements = Advertisement.all\n end", "title": "" }, { "docid": "fe37191b9b74bb004f28060d520e0d77", "score": "0.6936181", "text": "def index\n @advertisements = Advertisement.all\n end", "title": "" }, { "docid": "1fa59a15f537e641ce7ebeda2b6be3c2", "score": "0.67149705", "text": "def index\n @advertises = Advertise.all\n render 'index', formats: 'json', handlers: 'jbuilder'\n end", "title": "" }, { "docid": "3dc39792a56005aec5bb9dc25fa6de1d", "score": "0.66943586", "text": "def index\n @advertisements = Advertisement.page(params[:page])\n end", "title": "" }, { "docid": "1f29b6b16d85863d1b0a4b48ffde87a3", "score": "0.6619049", "text": "def index\n @advertisements = Advertisement.where(user: current_user).order(updated_at: :desc).with_attached_images\n\n respond_to do |format|\n format.html\n format.json { render json: { advertisements: @advertisements } }\n end\n end", "title": "" }, { "docid": "540e9057ed3e41a876630aba2b9ebf00", "score": "0.6599275", "text": "def show\n @advertisement = Advertisement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @advertisement }\n end\n end", "title": "" }, { "docid": "74bfd89ff0938ff83ffc7650f38d9360", "score": "0.6580428", "text": "def index\n if (current_user && !current_user.advertiser?)\n @advertisements = Advertisement.find_recommendations_for(current_user)\n \n @advertisements += Advertisement.for_homepage(current_user).excluding_ids(@advertisements.collect(&:id))\n else\n @advertisements = Advertisement.for_homepage(current_user)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @advertisements }\n end\n end", "title": "" }, { "docid": "5f89edefa487ff329218e1cdc6f2eb18", "score": "0.6576301", "text": "def show\n render json: @advert\n end", "title": "" }, { "docid": "69c4693a6ae2db7a92501752de4a7b92", "score": "0.6522122", "text": "def index\n @advertises = current_user.advertises.page(params[:page])\n respond_to do |format|\n format.html\n format.json\n end\n end", "title": "" }, { "docid": "99c405cddf5ba566e8c3cf9b725ddba6", "score": "0.6473201", "text": "def new\n @advertise = Advertise.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @advertise }\n end\n end", "title": "" }, { "docid": "0d9b103b542d929a31250f45e89420d5", "score": "0.64567727", "text": "def show\n @advertisment = Advertisment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @advertisment }\n end\n end", "title": "" }, { "docid": "c186d6f0fba7bff1a1e26ad19fc6187b", "score": "0.6437753", "text": "def show\n @advert = Advert.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @advert }\n end\n end", "title": "" }, { "docid": "f12e448925034f46769441b44489c421", "score": "0.6414838", "text": "def show\n @advocacy = Advocacy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @advocacy }\n end\n end", "title": "" }, { "docid": "1dac421ba8283a9485c85603292fb26b", "score": "0.63676226", "text": "def index\n @manage_advertisements = ManageAdvertisement.all\n end", "title": "" }, { "docid": "3915f4c2f02f58e075c686b735b57cf4", "score": "0.6351528", "text": "def index\n @advertisements = Advertisement.all\n @advertisements = Advertisement.where(\"user_id = ?\", current_user.id)\n end", "title": "" }, { "docid": "a517656d347d577eae1d6c5ddfd329c9", "score": "0.63308346", "text": "def show\n @advert = Advert.find(params[:id])\n @vcounter = ViewsCounter.counter('Advert', params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @advert }\n end\n end", "title": "" }, { "docid": "c1793c88220e2f7d9fb5700b48c44d0e", "score": "0.62920827", "text": "def index\n @advertisers = Advertiser.all\n end", "title": "" }, { "docid": "cc84644938968f0da885f13f7b792bc1", "score": "0.61968976", "text": "def index\n @advertises = Advertise.all\n end", "title": "" }, { "docid": "cc84644938968f0da885f13f7b792bc1", "score": "0.61968976", "text": "def index\n @advertises = Advertise.all\n end", "title": "" }, { "docid": "87bc32350db8f0c48eb9cff58eda386f", "score": "0.61462563", "text": "def index\n @appeals = @conference.appeals\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @appeals }\n end\n end", "title": "" }, { "docid": "d44ee3c778b7881f5c0ff1fb163e7729", "score": "0.6130288", "text": "def index\n @ads = Ad.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ads }\n end\n end", "title": "" }, { "docid": "ee8fc69247996513104d83a6ff6fc696", "score": "0.6123103", "text": "def show\n render json: @adopter\n end", "title": "" }, { "docid": "777b1bda2c3a4b541a421ef04c1513de", "score": "0.6110639", "text": "def set_advertise\n @advertise = Advertise.find(params[:id])\n end", "title": "" }, { "docid": "777b1bda2c3a4b541a421ef04c1513de", "score": "0.6110639", "text": "def set_advertise\n @advertise = Advertise.find(params[:id])\n end", "title": "" }, { "docid": "777b1bda2c3a4b541a421ef04c1513de", "score": "0.6110639", "text": "def set_advertise\n @advertise = Advertise.find(params[:id])\n end", "title": "" }, { "docid": "d772a8462c0ff19841e6ade34405568b", "score": "0.6103824", "text": "def index\n @ads = Ad.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ads }\n end\n end", "title": "" }, { "docid": "ca1e8886145a572402f8b0c6c2312b1b", "score": "0.6091461", "text": "def index\n \n @advertises = Advertise.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @advertises }\n end\n end", "title": "" }, { "docid": "e2a903e93fbc58ba7f90eaa0e85df97e", "score": "0.60895437", "text": "def show\n @advertise = Advertise.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @advertise }\n end\n end", "title": "" }, { "docid": "a3e4044add704615516df7ed4532dbe8", "score": "0.6086781", "text": "def index\n @leases = Lease.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @leases }\n end\n end", "title": "" }, { "docid": "a19bbe070bc9b711a469210d73a417f4", "score": "0.6080867", "text": "def show\n advertisement = nil\n consumer_page_view = @consumer.crumbs.map{ |crumb| crumb.beacon_id }.uniq.sample\n if consumer_page_view\n @sem3.products_field( \"upc\", Beacon.find(consumer_page_view).first_party_data.sample )\n advertisement = @sem3.get_products\n end\n\n logger.debug \"Advertisement : #{advertisement}\"\n\n respond_to do |format|\n if advertisement\n format.html # show.html.erb\n format.json { render json: advertisement['results'].first }\n else\n format.html # show.html.erb\n format.json { render json: {\"status\" => \"error\"}, status: :not_found }\n end\n end\n end", "title": "" }, { "docid": "7cf0ad24b9396b39592fb82898eef9a7", "score": "0.60643595", "text": "def show\n @announcement = Announcement.find(params[:id])\n render json:@announcement\n end", "title": "" }, { "docid": "a184b363b2be70f4ebd18f5b40f9824e", "score": "0.6041379", "text": "def index\n @advert1s = Advert1.all\n end", "title": "" }, { "docid": "60eee356489223903d3b69a48fb3d56d", "score": "0.6016946", "text": "def show\n @home_indices_ad = Home::Indices::Ad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @home_indices_ad }\n end\n end", "title": "" }, { "docid": "246757e6b2c372d7e0f5959c6739f0c0", "score": "0.6009647", "text": "def show\n @adv = Advantage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @adv }\n end\n end", "title": "" }, { "docid": "4ed9df41738c3a61df73942d6e4fce66", "score": "0.5992193", "text": "def show\n @advertise = Advertise.find(params[:id])\n authorize! :show, @advertise, :message => 'Acceso denegado.'\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @advertise }\n end\n end", "title": "" }, { "docid": "b3309d8e2b22ad678dd266fabaca3169", "score": "0.59904903", "text": "def index\n if current_user.try(:admin?)\n @advertisements = Advertisement.page(params[:page]).per(10).order(\"updated_at DESC\")\n else\n @advertisements = Advertisement.where(state: \"published\").page(params[:page]).per(10).order(\"updated_at DESC\")\n end\n end", "title": "" }, { "docid": "56f4a57796b871da92ee1a3bff954306", "score": "0.5968007", "text": "def index\n @advert = Advert.find(params[:advert_id])\n @bids = @advert.bids\n end", "title": "" }, { "docid": "93eba7356ce3d1295744049dfd8ea19c", "score": "0.59545", "text": "def new\n @advert = Advert.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @advert }\n end\n end", "title": "" }, { "docid": "31ea7c52a5f78ae2e542622800456788", "score": "0.5948001", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @appeal }\n end\n end", "title": "" }, { "docid": "352e0c44c03a6ddda5925562e2e82196", "score": "0.59262055", "text": "def new\n @advertisement = Advertisement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @advertisement }\n end\n end", "title": "" }, { "docid": "352e0c44c03a6ddda5925562e2e82196", "score": "0.59262055", "text": "def new\n @advertisement = Advertisement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @advertisement }\n end\n end", "title": "" }, { "docid": "352e0c44c03a6ddda5925562e2e82196", "score": "0.59262055", "text": "def new\n @advertisement = Advertisement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @advertisement }\n end\n end", "title": "" }, { "docid": "8ba6581a737094941b2afef4efd9df9a", "score": "0.5918176", "text": "def index\n @banners = Banner.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @banners }\n end\n end", "title": "" }, { "docid": "e1ab0105f6df50b25e567bfd61b119db", "score": "0.59108835", "text": "def show\n render json: @banner\n end", "title": "" }, { "docid": "6ebd6c0dc6b90ec73bd05c0c7cb11ba9", "score": "0.58964956", "text": "def index\n \n if params[:comapny_id].present?\n @advertisements = @user.advertisements.paginate(:page => params[:page], :per_page => 10)\n else\n @advertisements = current_user.advertisements.paginate(:page => params[:page], :per_page => 10)\n end\n \n end", "title": "" }, { "docid": "cafcca8605e66324fd28ab69875fd591", "score": "0.5894893", "text": "def create\n @advertise = Advertise.new(advertise_params)\n\n respond_to do |format|\n if @advertise.save\n format.html { redirect_to @advertise, notice: 'Advertise was successfully created.' }\n format.json { render :show, status: :created, location: @advertise }\n else\n format.html { render :new }\n format.json { render json: @advertise.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8c92ff51b02f3f8ab38698829b281554", "score": "0.58876216", "text": "def show\n @lease = Lease.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @lease }\n end\n end", "title": "" }, { "docid": "23e45746464cf7fdfc250973e9a1567a", "score": "0.5851967", "text": "def create\n @advertise = Advertise.new(advertise_params)\n\n respond_to do |format|\n if @advertise.save\n format.html { redirect_to @advertise, notice: \"Advertise was successfully created.\" }\n format.json { render :show, status: :created, location: @advertise }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @advertise.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99aeeb1120cd5e8013833f1527fbcd01", "score": "0.5851852", "text": "def index\n @leads = Lead.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @leads }\n end\n end", "title": "" }, { "docid": "c7bc1420acc3c6c107ea6b5e29d0e0d1", "score": "0.58364177", "text": "def show\n @ad = Ad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ad }\n end\n end", "title": "" }, { "docid": "c7bc1420acc3c6c107ea6b5e29d0e0d1", "score": "0.58364177", "text": "def show\n @ad = Ad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ad }\n end\n end", "title": "" }, { "docid": "c7bc1420acc3c6c107ea6b5e29d0e0d1", "score": "0.58364177", "text": "def show\n @ad = Ad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ad }\n end\n end", "title": "" }, { "docid": "2edf4d72194e92fbfb52842b4a42c71c", "score": "0.5833562", "text": "def index\n @applicants = Applicant.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @applicants }\n end\n end", "title": "" }, { "docid": "607364134ebc9b0488b48c06af290695", "score": "0.582077", "text": "def new\n @advertisment = Advertisment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @advertisment }\n end\n end", "title": "" }, { "docid": "8a30b69e25c63a785a468e441fec1f5f", "score": "0.581809", "text": "def new\n\n \n @advert = Advert.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @advert }\n \n end\n end", "title": "" }, { "docid": "b7547733f418dc2d4037e7cf006121d8", "score": "0.5804259", "text": "def index\n @adopters = Adopter.where(filtering_params)\n\n render json: @adopters\n end", "title": "" }, { "docid": "d0543329c322058c4fb56c4e48abfba6", "score": "0.58028436", "text": "def index\n @adversaires = Adversaire.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @adversaires }\n end\n end", "title": "" }, { "docid": "d94ec2aeebc1d4047fdc7d014fe67bfb", "score": "0.57985306", "text": "def index\n @adverts = Advert.all\n end", "title": "" }, { "docid": "1c446c2c1695608d9810f8ef56371391", "score": "0.579811", "text": "def index\n @meals = Meal.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @meals }\n end\n end", "title": "" }, { "docid": "61ab2023e35eaa3fdd8b2e0ffbaabe23", "score": "0.57926536", "text": "def show\n @purchasing_ad = PurchasingAd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @purchasing_ad }\n end\n end", "title": "" }, { "docid": "7d5f78ee3b6276f95088a1c7b973c6fc", "score": "0.5776049", "text": "def index\n @announcements = Announcement.order(created_at: :desc).all\n render json: @announcements, each_serializer: AnnouncementsSerializer\n end", "title": "" }, { "docid": "810d6b1063d70737bfb1a99ba86ef6b9", "score": "0.5773796", "text": "def show\n render json: @admitting\n end", "title": "" }, { "docid": "7001a596dc6b6524cce804d4c14aff93", "score": "0.576097", "text": "def index\n @announcements = Announcement.all\n\n respond_to do |format|\n format.html { render html: '200' }\n format.json { render 'announcements/index', announcements: @announcements, status: :ok }\n end\n end", "title": "" }, { "docid": "3240009b93133fb27b6ec186865afae5", "score": "0.5756694", "text": "def index\n render json: Apartment.all\n end", "title": "" }, { "docid": "6d20c4ebb1040c142b86c35179cef9aa", "score": "0.57424784", "text": "def index\n @affiliates = Affiliate.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @affiliate }\n end\n end", "title": "" }, { "docid": "b98a05d4c95418fe06741534767b8519", "score": "0.5733394", "text": "def show\n @announce = Announce.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @announce }\n end\n end", "title": "" }, { "docid": "b98a05d4c95418fe06741534767b8519", "score": "0.5733394", "text": "def show\n @announce = Announce.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @announce }\n end\n end", "title": "" }, { "docid": "9675efbde53ed587793f4f2e652d7127", "score": "0.57325697", "text": "def new\n # @advertisement = Advertisement.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @advertisement }\n end\n end", "title": "" }, { "docid": "537726d733d1fac52b210081054346aa", "score": "0.5726953", "text": "def advertise\n begin\n render params[:id]\n rescue ActionView::MissingTemplate\n render :file => \"#{Rails.root}/public/advertise\", :layout => false, :status => :not_found\n end\n end", "title": "" }, { "docid": "c35dc8bacd929743f4e6b3f84703392f", "score": "0.5723703", "text": "def index\n @allocations = Allocation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @allocations }\n end\n end", "title": "" }, { "docid": "2c2e5379bf2603960e07cf07feca8638", "score": "0.57171077", "text": "def show\n @audience = Audience.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @audience }\n end\n end", "title": "" }, { "docid": "162725cb20a0038961bf6a45587decff", "score": "0.57046413", "text": "def index\n @items = Admin::Item.by_agency(@current_agency.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_items }\n end\n end", "title": "" }, { "docid": "2941330c5ac7bed8420899380e22a4b6", "score": "0.57002914", "text": "def index\n @audiences = Audience.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @audiences }\n end\n end", "title": "" }, { "docid": "6a1818cc94d3bac9fc0fd4c3a147a0a6", "score": "0.56974536", "text": "def index\n @apartments = @building.apartments\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @apartments }\n end\n end", "title": "" }, { "docid": "0cb80dd5530532607a66fde2e0eed0ee", "score": "0.56857693", "text": "def index\n id = params[:id].to_i\n\n if id != 0\n \t @agencies = @agencies.paginate(page: params[:page], per_page: 10).order(:name).find_all_by_id(id)\n if @agencies.any?\n @agency_name = @agencies.first.name\n end\n else\n \t @agencies = @agencies.paginate(page: params[:page], per_page: 10).order(:name).find(:all)\n end\n\n\t\t@records_returned = @agencies.count\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @agencies }\n end\n end", "title": "" }, { "docid": "5528ada37d581f324b5ce654b9b8f98d", "score": "0.56827986", "text": "def index\n @recommended_links = RecommendedLink.all\n\n render json: @recommended_links\n end", "title": "" }, { "docid": "a07b6facff95c779cc751df4348e355d", "score": "0.56791013", "text": "def show\n @agencies = Agency.find(params[:id])\n\n if @agencies \n respond_to do |format|\n format.json { render :json => @agencies }\n format.xml { render :xml => @agencies }\n end \n else\n head :not_found\n end\n end", "title": "" }, { "docid": "77976aec4191c8bf6faea66da4f7faf0", "score": "0.56735575", "text": "def index\n @admittings = Admitting.all\n render json: @admittings\n end", "title": "" }, { "docid": "cfb149c7736c36e014a8afabcdc570c6", "score": "0.56643206", "text": "def index\n @leads = Lead.upcoming\n .includes(:updates, :agents, :agent)\n .order(created_at: :desc)\n .page(params[:page])\n .per(50)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @leads }\n end\n end", "title": "" }, { "docid": "6119c72c3fbf6346654b95a5aca30d4c", "score": "0.566397", "text": "def index\n @deseases = Desease.order(:id)\n\n render json: @deseases\n end", "title": "" }, { "docid": "ea1b02774cc2adb14707fceafdbac646", "score": "0.56435144", "text": "def index\n @ads = Ad.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ads }\n format.json { render :json => @ads }\n end\n end", "title": "" }, { "docid": "6cd23b139d03c5b0377d989e1180e3a8", "score": "0.5637273", "text": "def index\n @admin_agencies = Admin::Agency.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_agencies }\n end\n end", "title": "" }, { "docid": "8768229dba38a3bdb83fbceb669b5cf8", "score": "0.56301004", "text": "def index\n if (params[:client_id])\n @engagements = Engagement.find_all_by_client_id(params[:client_id])\n else\n @engagements = Engagement.all\n end\n\n respond_with(@engagements)\n end", "title": "" }, { "docid": "a613f6e6f0318023e97fa4ad7cee0b91", "score": "0.56299084", "text": "def index\n base_url = 'https://www.googleapis.com/books/v1/volumes?q=fiction&maxResults=20'\n and_key = '&key='\n key = ENV['GOOGLE_BOOKS_API_KEY'] \n googleurl = base_url + and_key + key\n\n response = RestClient.get(googleurl)\n @books = JSON.parse(response)\n\n respond_to do |format|\n format.html\n format.json { render json: @books }\n end\n\nend", "title": "" }, { "docid": "8c8c03f2017191d0c8ca92fa1f8f2771", "score": "0.5629342", "text": "def show\n @avert = Avert.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @avert }\n end\n end", "title": "" }, { "docid": "3de204e192ecf4beddf03cc8f56571b7", "score": "0.56264794", "text": "def meals\n get(\"/user/#{@user_id}/meals.json\")\n end", "title": "" }, { "docid": "54bdc4ae89ab9852ebda770e758d2dd9", "score": "0.5625698", "text": "def show\n @advertisement = Advertisement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @advertisement }\n end\n end", "title": "" }, { "docid": "e4baad7e58a16f5e7a651cb311d7df54", "score": "0.56201077", "text": "def index\n @adverts = Advert.paginate(:page => params[:page], :per_page => 10).order('id DESC').accessible_by(current_ability)\n end", "title": "" }, { "docid": "1349237e4f0f31acfde8cfa82e56083a", "score": "0.56144434", "text": "def show\n @admin_agency = Admin::Agency.where(:id => params[:id]).includes(:pages)[0]\n \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_agency }\n end\n end", "title": "" }, { "docid": "d074bf951ef55106c3495d7f2722fd12", "score": "0.5609348", "text": "def show\n @adversaire = Adversaire.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @adversaire }\n end\n end", "title": "" }, { "docid": "218eab31665e186fecd476d1c3434acd", "score": "0.56083107", "text": "def show\n render json: @diet, status: 200, root: true\n end", "title": "" }, { "docid": "28772b6c98fe70f053ec00041789cb31", "score": "0.55854553", "text": "def index\n respond_with(deals)\n end", "title": "" }, { "docid": "c45b6c7b421541464e811df5b4440985", "score": "0.5583009", "text": "def show\n render json: Alien.find(params[\"id\"])\n end", "title": "" }, { "docid": "034a57f81f361a1e5bfcf185c511f015", "score": "0.55818325", "text": "def show\n @drip = Drip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @drip }\n end\n end", "title": "" }, { "docid": "24c5c65cf777d1e3601505acf59864b6", "score": "0.55793273", "text": "def show\n @agencies = Agency.find(params[:id])\n\n if @agencies \n respond_to do |format|\n format.json { render :json => @agencies }\n format.xml { render :xml => @agencies }\n end \n else\n head :not_found\n end\n end", "title": "" }, { "docid": "b0de4eb245a90c31fdf6f5d049690079", "score": "0.5578214", "text": "def index\n @announcements = Announcement.visible.where(locale: I18n.locale || 'en').paginate(:page => params[:page], :per_page => 10)\n \n @announcements.first.increase_views unless @announcements.empty?\n\n @title = \"News\"\n\n logger.debug @announcement.inspect\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @announcements }\n end\n end", "title": "" } ]
d0e9a640eab8e73330110a2a7754b6f0
DELETE /admin/contact_groups/:contact_group_id/contacts/1 DELETE /admin/contact_groups/:contact_group_id/contacts/1.json
[ { "docid": "c140bb4bd134f54aedab6cedc4581acf", "score": "0.7587783", "text": "def destroy\n @contact.destroy\n\n render json: @contact, status: :ok\n end", "title": "" } ]
[ { "docid": "a9f50026f2440bff8c2bebf2d695684c", "score": "0.8331248", "text": "def destroy\n @contacts_group = ContactsGroup.find(params[:id])\n @contacts_group.destroy\n\n respond_to do |format|\n format.html { redirect_to contacts_groups_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f96d74e1121bac4786278364d8b1ec21", "score": "0.82461315", "text": "def destroy\n @contact_group = ContactGroup.find(params[:id])\n @contact_group.destroy\n\n respond_to do |format|\n format.html { redirect_to contact_groups_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a0eed6323dab968d256d6bab2172fce8", "score": "0.8244599", "text": "def destroy\n group_contact = GroupContact.find_by_id(params[:id].to_i)\n\n if group_contact\n if check_permission_user(group_contact.user_id)\n contacts = Contact.where(:group_id => params[:id].to_i)\n\n contacts.each do |c|\n c.update(:group_id => nil)\n end\n\n group_contact.destroy\n respond_to do |format|\n format.html\n format.json { head :no_content }\n end\n end\n else\n respond_to do |format|\n format.html\n format.json { render json: {:error => 'group contact not found'}, :status => :bad_request }\n end\n end\n\n\n end", "title": "" }, { "docid": "4e5f8d06c9bbc8d7cfad1b8a558f5aea", "score": "0.802733", "text": "def destroy\n notices = []\n if contact_group_params[:contacts_fate].to_i == 1\n deleted = contacts_doomed(@contact_group[:_id])\n notices << (t :group_only_contacts_deleted).gsub('%contacts_deleted%', \"<strong>#{deleted.to_s}</strong>\")\n end\n\n empty_group(@contact_group[:_id])\n\n label = @contact_group[:label]\n @contact_group.destroy\n notices << (t :contact_group_deleted).gsub('%group_label%', \"<strong>#{label}</strong>\")\n\n respond_to do |format|\n format.html { redirect_to contact_groups_url, notice: notices.reverse.join('<br/>') }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "109c5a803942e2cf0a8d5a5e3d22b8dd", "score": "0.8022707", "text": "def destroy\n @contact.destroy\n\n respond_to do |format|\n format.html { redirect_to hub_group_contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "81d7a808dd141c11aa757805c84b1e3d", "score": "0.7942301", "text": "def destroy\n @contact_group = ContactGroup.find(params[:id])\n @contact_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(contact_groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6f311928ae8553120a04ad6c06972be8", "score": "0.79185724", "text": "def destroy\n @contact_group = current_user.contact_groups.find(params[:id])\n @contact_group.destroy\n render :nothing => true\n end", "title": "" }, { "docid": "93d42e108e68ec811d85b14c968e62b1", "score": "0.790461", "text": "def destroy\n @admin_contact = Contact.find(params[:id])\n @admin_contact.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "404aa57a61c291936bc980987b9476a3", "score": "0.7879838", "text": "def destroy\n @admin_contact.destroy\n respond_to do |format|\n format.html { redirect_to admin_contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "88e18eeb95c7b9daa1667c1638518971", "score": "0.783197", "text": "def destroy\n @contact_group.destroy\n respond_to do |format|\n format.html do\n redirect_to contact_groups_url,\n notice: 'Contact group was successfully destroyed.'\n end\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6dad58b99fd8c04ef8eff167bdffb05e", "score": "0.7790947", "text": "def destroy\n @contact.destroy\n respond_to do |format|\n format.html { redirect_to admin_contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6dad58b99fd8c04ef8eff167bdffb05e", "score": "0.7790947", "text": "def destroy\n @contact.destroy\n respond_to do |format|\n format.html { redirect_to admin_contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "848147ac8e180cc8f52df1b5a43ed785", "score": "0.7747958", "text": "def remove_contacts\n pars = contact_group_params\n contact_ids = []\n pars[:contact_ids].each do |cid|\n contact_ids << BSON::ObjectId.from_string(cid)\n end\n\n removed = Contact.where(uid: current_user.id).in(:_id => contact_ids).pull(contact_group_ids: @contact_group[:_id])\n\n respond_to do |format|\n format.html { redirect_to @contact_group,\n notice: \"#{removed.documents.first[:nModified]}\n #{(t :contacts_successfully_removed).gsub('%group_label%', @contact_group[:label])}.\" }\n format.json { render :show, status: :ok, location: @contact_group }\n end\n end", "title": "" }, { "docid": "89e5f4fa5a52448899e184666b73ebf1", "score": "0.7670582", "text": "def destroy\n @admin_contact_detail = Admin::ContactDetail.find(params[:id])\n @admin_contact_detail.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_suppliers_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "8f9a10b25199391582d9eb3305022ce0", "score": "0.7662144", "text": "def destroy\n @contactadmin = Contactadmin.find(params[:id])\n @contactadmin.destroy\n\n respond_to do |format|\n format.html { redirect_to contactadmins_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9e6dff4d49897b3f79989c3405f6602f", "score": "0.76426023", "text": "def destroy\n @contact.destroy\n @skills = Skill.all\n @groups = Group.all\n respond_to do |format|\n format.html { redirect_to contacts_url, notice: 'Contact was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5ba849fcd98d513aa3f06b03125c4ba6", "score": "0.7640431", "text": "def contacts_delete(contacts=[],http_request_options={},api_key=nil)\n options = {\n :path => \"#{config.base_path}/contacts/delete\",\n :params => {:contacts => contacts},\n :http_request_options => http_request_options,\n :api_key => api_key\n }\n request = Knowtify::Request.new(options)\n handler.post(request)\n end", "title": "" }, { "docid": "355ca94849bf1e143fe5e6981519d869", "score": "0.7632559", "text": "def destroy\n @contact.destroy\n respond_to do |format|\n format.html { redirect_to admin_contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1548b040c40fc188eb26ca094e3fe41d", "score": "0.76123226", "text": "def destroy\n @admin_contact.destroy\n respond_to do |format|\n format.html { redirect_to admin_contacts_url, notice: 'Admin contact was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bbcdad3b5a7d124e1a5f75023588c45c", "score": "0.7587159", "text": "def delete_contact(contact_id)\n request :delete,\n \"/v3/contacts/#{contact_id}.json\"\n end", "title": "" }, { "docid": "cdca66072e270e22d83598513c6bf67e", "score": "0.7569333", "text": "def bulk_delete\n params = contact_group_params\n contacts_fate = params[:contacts_fate].to_i\n\n notices = []\n deleted = 0\n labels = []\n\n params[:contact_group_ids].each do |group_id|\n bson_id = BSON::ObjectId.from_string(group_id)\n\n deleted += contacts_doomed(bson_id) unless contacts_fate == 0\n\n empty_group(bson_id)\n\n group = ContactGroup.find(bson_id)\n labels << group[:label]\n group.destroy\n end\n\n notices << (t :contact_group_deleted).gsub('%group_label%', \"<strong>#{labels.join(', ')}</strong>\")\n notices << (t :group_only_contacts_deleted).gsub('%contacts_deleted%', \"<strong>#{deleted.to_s}</strong>\") unless contacts_fate == 0\n\n respond_to do |format|\n format.html { redirect_to contact_groups_url, notice: notices.join('<br/>') }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9c5b56b5a14d1b3a6bae42cc8b15f80e", "score": "0.75602365", "text": "def destroy\n @campaign_contact = @campaign.campaign_contacts.find(params[:id])\n @campaign_contact.destroy\n \n respond_to do |format|\n format.html { redirect_to user_campaigns_path(@user, @campaign) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "db31580cc47cc5b92920ab8f13760712", "score": "0.7538936", "text": "def destroy # DELETE /contacts/:id\n @contact = Contact.find(params[:id])\n @contact.destroy\n end", "title": "" }, { "docid": "118b8893f64c32a582c6d3ccf09028b8", "score": "0.7535546", "text": "def destroy\n @edit_contact.destroy\n respond_to do |format|\n format.html { redirect_to edit_contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2473105befe8971be3485d9a2be847ec", "score": "0.7487495", "text": "def destroy\n @contact.destroy\n \n respond_to do |format|\n format.html { redirect_to contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "730bdedbe10f2c3d08a3e72ac455cda6", "score": "0.74788135", "text": "def destroy\n @user_contact.destroy\n render json: {message: 'Contact deleted successfully'}\n end", "title": "" }, { "docid": "492c2d2cd9d4a9eda54dabb9a35e4024", "score": "0.74722666", "text": "def destroy\n @account_contact = @account.account_contacts.find(params[:id])\n @account_contact.destroy\n\n respond_to do |format|\n format.html { redirect_to account_account_contacts_url(@account) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "42eff17cd8bfede77e0410a2bac58cd5", "score": "0.74681455", "text": "def destroy\n @admin_contact_type = Admin::ContactType.find(params[:id])\n @admin_contact_type.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_contact_types_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "a3b4f16893ef06e8dbc93e9d75706e2b", "score": "0.74511576", "text": "def destroy\n @contact = Contact.find(params[:id])\n @contact.destroy\n\n respond_to do |format|\n format.html { redirect_to user_contacts_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "4558291168cd77f46131969205b78409", "score": "0.7439377", "text": "def destroy\n @contact = @business.contacts.find(params[:id])\n @contact.destroy\n\n respond_to do |format|\n format.html { redirect_to business_contacts_url(@business) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "aa85421df334a578a812965a57b7dbea", "score": "0.74348754", "text": "def delete(contact)\n @contacts.delete(contact)\n end", "title": "" }, { "docid": "17bbac4c2997ecb6a6d6dceb6947218c", "score": "0.74268425", "text": "def destroy\n puts \"delete contact\"\n contact = Contact.find(params[:id])\n contact.destroy\n render json: contact\n end", "title": "" }, { "docid": "a2ab84e6d3cada83610cfbd1ddf6ab5f", "score": "0.7423775", "text": "def destroy\n @contact.destroy\n respond_to do |format|\n format.html { redirect_to backend_contacts_url, notice: 'Contacto eliminado.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "03d3dbb939364d03719344b01235015c", "score": "0.7411353", "text": "def destroy\n @r_contact.destroy\n respond_to do |format|\n format.html { redirect_to r_contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c66fcc387027dd3544c9b683e84d00db", "score": "0.74093515", "text": "def destroy\n @client_contact = ClientContact.find(params[:id])\n @client_contact.destroy\n\n respond_to do |format|\n format.html { redirect_to client_contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3ced4dae85e68c31476f44bd8d2c7ad3", "score": "0.74020433", "text": "def destroy\n @contactum.destroy\n respond_to do |format|\n format.html { redirect_to contacta_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "979599433326445639a3491b2f91876f", "score": "0.73987466", "text": "def destroy\n @contact.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "979599433326445639a3491b2f91876f", "score": "0.73987466", "text": "def destroy\n @contact.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "979599433326445639a3491b2f91876f", "score": "0.73987466", "text": "def destroy\n @contact.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "979599433326445639a3491b2f91876f", "score": "0.73987466", "text": "def destroy\n @contact.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "67e29995be11ad328eadaec0804a1535", "score": "0.7391611", "text": "def destroy\n @company_contact = CompanyContact.find(params[:id])\n @company_contact.destroy\n\n respond_to do |format|\n format.html { redirect_to company_contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5d1df2c6500d5cba94bcb14453e1a558", "score": "0.73881686", "text": "def destroy\n Contact.destroy params[:id]\n redirect_to admin_contacts_path\n end", "title": "" }, { "docid": "4d86cc3a446314d446c2af5b0e567c62", "score": "0.7378512", "text": "def destroy\n @contact.destroy\n respond_to do |format|\n format.html { redirect_to contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4d86cc3a446314d446c2af5b0e567c62", "score": "0.7378512", "text": "def destroy\n @contact.destroy\n respond_to do |format|\n format.html { redirect_to contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4d86cc3a446314d446c2af5b0e567c62", "score": "0.7378512", "text": "def destroy\n @contact.destroy\n respond_to do |format|\n format.html { redirect_to contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4d86cc3a446314d446c2af5b0e567c62", "score": "0.7378512", "text": "def destroy\n @contact.destroy\n respond_to do |format|\n format.html { redirect_to contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4d86cc3a446314d446c2af5b0e567c62", "score": "0.7378512", "text": "def destroy\n @contact.destroy\n respond_to do |format|\n format.html { redirect_to contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4d86cc3a446314d446c2af5b0e567c62", "score": "0.7378512", "text": "def destroy\n @contact.destroy\n respond_to do |format|\n format.html { redirect_to contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4d86cc3a446314d446c2af5b0e567c62", "score": "0.7378512", "text": "def destroy\n @contact.destroy\n respond_to do |format|\n format.html { redirect_to contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4d86cc3a446314d446c2af5b0e567c62", "score": "0.7378512", "text": "def destroy\n @contact.destroy\n respond_to do |format|\n format.html { redirect_to contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4d86cc3a446314d446c2af5b0e567c62", "score": "0.7378512", "text": "def destroy\n @contact.destroy\n respond_to do |format|\n format.html { redirect_to contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4d86cc3a446314d446c2af5b0e567c62", "score": "0.7378512", "text": "def destroy\n @contact.destroy\n respond_to do |format|\n format.html { redirect_to contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4d86cc3a446314d446c2af5b0e567c62", "score": "0.7378512", "text": "def destroy\n @contact.destroy\n respond_to do |format|\n format.html { redirect_to contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4d86cc3a446314d446c2af5b0e567c62", "score": "0.7378512", "text": "def destroy\n @contact.destroy\n respond_to do |format|\n format.html { redirect_to contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4d86cc3a446314d446c2af5b0e567c62", "score": "0.7378512", "text": "def destroy\n @contact.destroy\n respond_to do |format|\n format.html { redirect_to contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4d86cc3a446314d446c2af5b0e567c62", "score": "0.7378512", "text": "def destroy\n @contact.destroy\n respond_to do |format|\n format.html { redirect_to contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4d86cc3a446314d446c2af5b0e567c62", "score": "0.7378512", "text": "def destroy\n @contact.destroy\n respond_to do |format|\n format.html { redirect_to contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4d86cc3a446314d446c2af5b0e567c62", "score": "0.7378512", "text": "def destroy\n @contact.destroy\n respond_to do |format|\n format.html { redirect_to contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4d86cc3a446314d446c2af5b0e567c62", "score": "0.7378512", "text": "def destroy\n @contact.destroy\n respond_to do |format|\n format.html { redirect_to contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "845907f4c8d4834f9353d75df894dc95", "score": "0.737246", "text": "def delete(options={})\n post('deleteContact', options)\n end", "title": "" }, { "docid": "bc759a54eb893f47efc2e74139e74b20", "score": "0.73707247", "text": "def destroy\n @s_contact.destroy\n respond_to do |format|\n format.html { redirect_to s_contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7581b18aaa33446ee0a0d5302c4f9333", "score": "0.73578024", "text": "def destroy\n @contact_request = ContactRequest.find(params[:id])\n @contact_request.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "51e2da1165ac97c65cc77bc99dc28183", "score": "0.7353258", "text": "def destroy\n if @contact_group.owner_id == current_user.id\n @contact_group.destroy\n respond_to do |format|\n format.html { redirect_to homes_url, notice: 'Contact group was successfully destroyed.' }\n format.json { head :no_content }\n end\n else\n respond_to do |format|\n format.html { redirect_to homes_url, alert: \"You must be the owner of the group to delete it\" }\n format.js { redirect_to homes_url, alert: \"You must be the owner of the group to delete it\" }\n end\n end\n end", "title": "" }, { "docid": "200400621e50aed8c7672e0e42ffbfa6", "score": "0.7349313", "text": "def destroy\n @contact = Contact.find(params[:id])\n @contact.destroy\n\n respond_to do |format|\n format.html { redirect_to contacts_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "200400621e50aed8c7672e0e42ffbfa6", "score": "0.7349313", "text": "def destroy\n @contact = Contact.find(params[:id])\n @contact.destroy\n\n respond_to do |format|\n format.html { redirect_to contacts_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "200400621e50aed8c7672e0e42ffbfa6", "score": "0.7349313", "text": "def destroy\n @contact = Contact.find(params[:id])\n @contact.destroy\n\n respond_to do |format|\n format.html { redirect_to contacts_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "ee97171c9715ec5df3a82f61cd85a0e5", "score": "0.73476875", "text": "def destroy\n @contact.destroy\n\n respond_to do |format|\n format.json {\n render nothing: true, status: 200\n }\n\n format.html {\n redirect_to contacts_url, notice: t('common.destroyed').capitalize\n }\n end\n\n end", "title": "" }, { "docid": "00ad6e5d6ac84846052ee60bed537bd7", "score": "0.73369104", "text": "def destroy\n @customer_contact = CustomerContact.find(params[:id])\n @customer_contact.destroy\n\n respond_to do |format|\n format.html { redirect_to customer_contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "352a5226be265f2753dc8e24b09f371e", "score": "0.7332412", "text": "def destroy\n @contact = Contact.find(params[:id])\n @contact.destroy\n\n respond_to do |format|\n format.html { redirect_to contacts_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1ee28e84143d976abd5c6acb8a487e1a", "score": "0.7329404", "text": "def destroy\n @contact.destroy\n respond_to do |format|\n format.html { redirect_to contacts_url, notice: t('controllers.contacts.companies.destroy.success') }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5844b2d7dc8b7cfaba0795cf505ee2b2", "score": "0.7324852", "text": "def destroy\n @organization_contact = @organization.contacts.find(params[:id])\n @organization_contact.destroy\n\n respond_to do |format|\n format.html { redirect_to(redirect_to_path || organization_contacts_url(@organization)) }\n end\n end", "title": "" }, { "docid": "de5edb5e5d52d3f789cdd95e5db121bb", "score": "0.73234624", "text": "def destroy\n @contact = Contact.find(params[:id])\n @contact.destroy\n\n respond_to do |format|\n format.html { redirect_to contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "de5edb5e5d52d3f789cdd95e5db121bb", "score": "0.73234624", "text": "def destroy\n @contact = Contact.find(params[:id])\n @contact.destroy\n\n respond_to do |format|\n format.html { redirect_to contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "de5edb5e5d52d3f789cdd95e5db121bb", "score": "0.73234624", "text": "def destroy\n @contact = Contact.find(params[:id])\n @contact.destroy\n\n respond_to do |format|\n format.html { redirect_to contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "de5edb5e5d52d3f789cdd95e5db121bb", "score": "0.73234624", "text": "def destroy\n @contact = Contact.find(params[:id])\n @contact.destroy\n\n respond_to do |format|\n format.html { redirect_to contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "de5edb5e5d52d3f789cdd95e5db121bb", "score": "0.73234624", "text": "def destroy\n @contact = Contact.find(params[:id])\n @contact.destroy\n\n respond_to do |format|\n format.html { redirect_to contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "de5edb5e5d52d3f789cdd95e5db121bb", "score": "0.73234624", "text": "def destroy\n @contact = Contact.find(params[:id])\n @contact.destroy\n\n respond_to do |format|\n format.html { redirect_to contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "de5edb5e5d52d3f789cdd95e5db121bb", "score": "0.73234624", "text": "def destroy\n @contact = Contact.find(params[:id])\n @contact.destroy\n\n respond_to do |format|\n format.html { redirect_to contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "571ab37f87e8069c550d3a1e1383c665", "score": "0.7318057", "text": "def destroy\n @contact = set_contact\n \n @contact.destroy\n respond_to do |format|\n format.html { redirect_to contacts_url, notice: 'Contact was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "80bf0dab6e6311f983dd328a762fd07a", "score": "0.73167926", "text": "def destroy\n @contact = Contact.find(params[:id])\n @contact.destroy\n\n respond_to do |format|\n format.html { redirect_to(contacts_url) }\n format.xml { head :ok }\n format.json { render :json => { :success => true, :message => \"Deleted Contact #{@contact.id}\", :data => []}}\n end\n end", "title": "" }, { "docid": "c54cb0b74caba42b4db2ffbcec0087cf", "score": "0.7314668", "text": "def destroy\n puts \" --------- #{params}\"\n @contact.destroy\n respond_to do |format|\n format.html { redirect_to contacts_url, notice: 'Contact was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2967d6192ca599bd688ed887b2298849", "score": "0.7310757", "text": "def destroy\n if @contact.contactable.contacts.size > 1\n @contact.destroy\n else\n flash[:notice] = 'You are not allowed to delete the only remaining contact';\n end\n respond_to do |format|\n format.html { redirect_to session.delete(:return_to) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "66f9485d859e2116ba8513117d2bda4a", "score": "0.73102885", "text": "def destroy\n @contact = Contact.find(params[:id])\n @contact.destroy\n\n respond_to do |format|\n format.json { head :ok }\n format.html { redirect_to(contacts_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "ac16de173282a611f70bfe76a6492ac3", "score": "0.73101133", "text": "def destroy\n @primary_contact.destroy\n respond_to do |format|\n format.html { redirect_to admin_primary_contacts_path, notice: 'Primary contact was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d46f5b89f1af2ea6c62d86c0fd461e83", "score": "0.73072195", "text": "def delete_contact(id)\n delete \"contacts/#{id}\"\n end", "title": "" }, { "docid": "6ea29fd8ecf18e014320a5bcc581c9a8", "score": "0.7299786", "text": "def destroy\n @contact.destroy\n respond_to do |format|\n format.html { redirect_to contacts_url, notice: 'Contact was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6ea29fd8ecf18e014320a5bcc581c9a8", "score": "0.7299786", "text": "def destroy\n @contact.destroy\n respond_to do |format|\n format.html { redirect_to contacts_url, notice: 'Contact was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0613a389d66f0a7a680c9de7d5be46f1", "score": "0.7298269", "text": "def destroy\n @organization_contact = @organization.contacts.find(params[:id])\n @organization_contact.destroy\n\n respond_to do |format|\n format.html { redirect_to(community_partner_service_learning_organization_contacts_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "caa1d6dbfc397bbf6afbccb75c9fad0c", "score": "0.7288496", "text": "def destroy\n @globalcontact.destroy\n respond_to do |format|\n format.html { redirect_to globalcontacts_url, notice: 'Globalcontact was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "26638a0f071d24e0387b78e66927a7ec", "score": "0.7285086", "text": "def destroy\n @called_from = params[:called_from] || \"contact\"\n @contact_team_group.destroy\n respond_to do |format|\n format.html { redirect_to(admin_contact_team_groups_url) }\n format.xml { head :ok }\n format.js \n end\n add_log(user: current_user, action: \"Removed #{@contact_team_group.team_group.name} from #{@contact_team_group.contact.name}\")\n end", "title": "" }, { "docid": "c220abaff5cd7f0681c6b27890108f06", "score": "0.7271821", "text": "def destroy\n @contact = @company.contacts.find(params[:id])\n @contact.destroy\n\n respond_to do |format|\n format.html { redirect_to(company_contacts_path) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "126ae804bd53d8fdd62697fec51c7e7f", "score": "0.72584575", "text": "def destroy\n #@contact = Contact.find(params[:id])\n @contact = @p.contacts.find(params[:id])\n @contact.destroy\n\n respond_to do |format|\n format.html { redirect_to(contacts_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "c9cc735c80df5877ce51b306c22ea8f4", "score": "0.72557527", "text": "def destroy\n @contact.destroy\n respond_to do |format|\n format.html { redirect_to after_destroy_url, notice: 'Se eliminó con exito.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d7bc906913fa1ef162d71c5dfdd289f1", "score": "0.7253173", "text": "def delete\n delete.new_contact\n end", "title": "" }, { "docid": "d97fe98e65edf92c7fbeffa6f2afd721", "score": "0.7252791", "text": "def destroy\n @user_contact = UserContact.find(params[:id])\n @user_contact.destroy\n\n respond_to do |format|\n format.html { redirect_to user_contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ae11e2733e237bf5abd355a710994112", "score": "0.72525394", "text": "def destroy\n @fields_group = FieldsGroup.find(params[:id])\n @fields_group.destroy\n\n respond_to do |format|\n format.html { redirect_to fields_groups_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "dbac53b77b101506fd4a66c9d24ba8c6", "score": "0.72501826", "text": "def destroy\n @contact.destroy\n respond_to do |format|\n format.html { redirect_to contacts_url, notice: '联系人信息已成功删除.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4f7b39748b6ce1a25e9bf58eec22c78e", "score": "0.7247059", "text": "def destroy\n @augmentaion_contact.destroy\n respond_to do |format|\n format.html { redirect_to augmentaion_contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2177a7bc17c44bd5ea3e16ddf3dffdff", "score": "0.7232893", "text": "def destroy\n @list_contact = ListContact.find(params[:id])\n @list_contact.destroy\n\n respond_to do |format|\n format.html { redirect_to list_contacts_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "6a445002e57be60a646264c1f2a22960", "score": "0.7231504", "text": "def destroy\n @b_supplier_contact = BSupplierContact.find(params[:id])\n @b_supplier_contact.destroy\n\n respond_to do |format|\n format.html { redirect_to b_supplier_contacts_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
26341c28bf0457b6c3f88ea5e216aeb9
returns date of period start
[ { "docid": "e283905715b41c649dc406d6c464b5bf", "score": "0.8039575", "text": "def get_period_start(i)\n self.start + get_period_offset(i)\n end", "title": "" } ]
[ { "docid": "a1cc48a947ccd742aff79730ba9856a9", "score": "0.8516619", "text": "def min_date(period)\n period.start_date\n end", "title": "" }, { "docid": "033e89b99e2b32c2cc6e35eddca18f1e", "score": "0.7729136", "text": "def start_date\n start.to_date\n end", "title": "" }, { "docid": "eccd81d4d5fc1ca86a882258e53b1cc3", "score": "0.76319116", "text": "def start_date\n Date.new(start_year.to_i, start_month.to_i, start_day.to_i)\n rescue ArgumentError\n 1.day.ago\n end", "title": "" }, { "docid": "0f86a0fa1d910c33349f0d3210c1e8bb", "score": "0.75527", "text": "def start_date\n return nil unless iteration.present?\n Time.at(iteration.deadline.to_i + start_offset.to_i).to_datetime\n end", "title": "" }, { "docid": "5186f19b0a571bb1b45b441cef1bdc89", "score": "0.75503784", "text": "def begin_of_period(date_value, period)\n dt = case period\n when :day\n date_value\n else\n case period\n when :month, :long_month\n count_month = 1\n when :quarter_year\n count_month = 3\n when :half_year\n count_month = 6\n when :year\n count_month = 12\n end\n \n dt = date_value.to_date >> - ((CustomFields::DateTimeField.month_year(date_value) -\n CustomFields::DateTimeField.month_year(Date.null_date)) % count_month)\n dt.beginning_of_month\n end\n \n dt.beginning_of_day\n end", "title": "" }, { "docid": "e9112f7cc4cf9f1de2aa0e997c965a71", "score": "0.7493297", "text": "def start_date\n puts \"@@@@@@ #{date.year} #{date.month}\"\n \t@start_date ||= Date.new(date.year, date.month-2, 1)\n end", "title": "" }, { "docid": "400b1a6081dd78d74b4499f7f9d61a83", "score": "0.7490479", "text": "def period_start_for(period_end)\n raise NotImplementedError\n end", "title": "" }, { "docid": "7fc73737a625fd30ac80a2881310cdec", "score": "0.7376181", "text": "def start_of_day\n 1.day.ago.beginning_of_day\n end", "title": "" }, { "docid": "c86dd6fcf150a576eba4c4a2c71fbc07", "score": "0.7340203", "text": "def start_date\n date\n end", "title": "" }, { "docid": "2e374338734375d0dfe2e698c20ee20d", "score": "0.7291322", "text": "def day_before_start_date\n start_date - 1\n end", "title": "" }, { "docid": "cf04871d85514765719d1f026c9e6ff8", "score": "0.7240888", "text": "def periods_from_start(date)\n (date - cf.min_date) / cf.period\n end", "title": "" }, { "docid": "0240d250d25e31ed362f492c8c618f6a", "score": "0.72342086", "text": "def start_date\n return @start_date\n end", "title": "" }, { "docid": "0240d250d25e31ed362f492c8c618f6a", "score": "0.72342086", "text": "def start_date\n return @start_date\n end", "title": "" }, { "docid": "cc18b5cdcbea645316f51b07bf84f84c", "score": "0.7227096", "text": "def start_date\n subscription? ? Time.zone.at(@item.period.start).strftime('%b %d, %Y') : nil\n end", "title": "" }, { "docid": "27e4fdaa289c33578d69e5b3a311a7a6", "score": "0.7118659", "text": "def start_date\n (created_at - ((created_at.wday == 0 ? 7 : created_at.wday) - 1).days).to_date\n end", "title": "" }, { "docid": "34a0686cc3951ad27c861bae94481482", "score": "0.71132106", "text": "def date_range_start\n read_attribute(:date_range_start) || \"2007-01-01\".to_time\n end", "title": "" }, { "docid": "9042f3f42f1ef5c8ac009e8c7ebdecb7", "score": "0.7047396", "text": "def get_start_date\n starts_at = @today.to_datetime\n if @not_available_days.include?(@today.wday) && @next_available_day\n advance_days = @next_available_day - @today.wday\n if advance_days < 0\n advance_days = 7 + advance_days\n end\n starts_at += advance_days\n end\n\n return starts_at\n end", "title": "" }, { "docid": "9b613f6d8fbf72e5de21bf483bb7a22c", "score": "0.7038774", "text": "def dtstart(event)\n if event.recurring?\n Mhc::OccurrenceEnumerator.new(event, empty_dates, empty_dates, event.recurrence_condition, event.duration).first.dtstart\n else\n Mhc::OccurrenceEnumerator.new(event, event.dates, empty_dates, empty_condition, empty_duration).first.dtstart\n end\n end", "title": "" }, { "docid": "6dcce7f6af95bb7d5bd43b597353c0dd", "score": "0.70215607", "text": "def at_start_of_day\n LocalDateTime.of(year, month, day, 0, 0, 0, 0)\n end", "title": "" }, { "docid": "7e975e685b17bd7cc77aadb410a25f93", "score": "0.70200646", "text": "def get_start_date(day)\n day = day.to_i\n if Date.today.day < day\n return Date.today + (day - Date.today.day).days\n else \n return Date.today.end_of_month + day.days\n end\n end", "title": "" }, { "docid": "1b5b55d8c6a8363a1e5c7a5f21f4f6be", "score": "0.7019322", "text": "def start_date\n filter!\n @reporter.start_date\n end", "title": "" }, { "docid": "8602bb4b6198a127b1c0b844d26725b0", "score": "0.70128155", "text": "def review_history_period_start_date_time\n return @review_history_period_start_date_time\n end", "title": "" }, { "docid": "1749729b149aaca9c7794589fd1a93e0", "score": "0.6971681", "text": "def beginning_of_day; end", "title": "" }, { "docid": "1749729b149aaca9c7794589fd1a93e0", "score": "0.6971681", "text": "def beginning_of_day; end", "title": "" }, { "docid": "1749729b149aaca9c7794589fd1a93e0", "score": "0.6971681", "text": "def beginning_of_day; end", "title": "" }, { "docid": "1749729b149aaca9c7794589fd1a93e0", "score": "0.6971681", "text": "def beginning_of_day; end", "title": "" }, { "docid": "1749729b149aaca9c7794589fd1a93e0", "score": "0.6971681", "text": "def beginning_of_day; end", "title": "" }, { "docid": "1749729b149aaca9c7794589fd1a93e0", "score": "0.6971681", "text": "def beginning_of_day; end", "title": "" }, { "docid": "1749729b149aaca9c7794589fd1a93e0", "score": "0.6971681", "text": "def beginning_of_day; end", "title": "" }, { "docid": "0382fe4ccdae17922986645657e5c656", "score": "0.6961831", "text": "def period_start_for(time_zone, period_end)\n new(time_zone).period_start_for(period_end)\n end", "title": "" }, { "docid": "d80b0af1f23362f2ee848928b1336cfe", "score": "0.69543666", "text": "def start_of_time\n Date.jd(0).strftime(\"%Y, %m, %d\")\n end", "title": "" }, { "docid": "85dc05c1f3d7169d10f40501a4d45a08", "score": "0.6946997", "text": "def start_date\n options[:start_date].presence&.beginning_of_day || Time.current.beginning_of_week(:sunday)\n end", "title": "" }, { "docid": "40982f5b3c2aaca592da6ccf353aee69", "score": "0.69301885", "text": "def start_of_this_month\n start_of_month( today )\n end", "title": "" }, { "docid": "1e09183d3f52cc3d9c5f6904916ae118", "score": "0.6907893", "text": "def start_date\n Date.commercial year, number\n end", "title": "" }, { "docid": "7f576f7d3dd8d3c61cec849706704a9d", "score": "0.6905539", "text": "def start_date\n date = dates_of_attendance['StartDate'] || {}\n date.values[0]\n end", "title": "" }, { "docid": "a1bf5e28978d13417f9936ebb6bf29a0", "score": "0.6899551", "text": "def start_date\n start_date_time.to_date.strftime('%m/%d/%Y') if start_date_time.present?\n end", "title": "" }, { "docid": "7c4ec6688407c07c152f4a4f2b177743", "score": "0.68857896", "text": "def start_date\n @start_date ||= [\n issues.minimum('start_date'),\n shared_versions.minimum('effective_date'),\n Issue.fixed_version(shared_versions).minimum('start_date')\n ].compact.min\n end", "title": "" }, { "docid": "adc0764d7f52767016aa1dd4726e8f6e", "score": "0.6876856", "text": "def start_date_offset\n offset_years = ApplicationController.helpers.config_for_version(version).start_date_offset\n (Time.at(measure_period_start).in_time_zone + offset_years.year).to_i - measure_period_start\n end", "title": "" }, { "docid": "cad80a45600db7467cb7eecb1ae04ccf", "score": "0.6868252", "text": "def getStartDate\r\n\t\t\t\t\treturn @startDate\r\n\t\t\t\tend", "title": "" }, { "docid": "ff157b6b390c547c21e5eb9d84e96d57", "score": "0.68658596", "text": "def start_of_month\n return self.start_of_day.delta(days:1 - day)\n end", "title": "" }, { "docid": "ff157b6b390c547c21e5eb9d84e96d57", "score": "0.68658596", "text": "def start_of_month\n return self.start_of_day.delta(days:1 - day)\n end", "title": "" }, { "docid": "c8255874257490cdd2e3bba3de979444", "score": "0.68543315", "text": "def start_of_day\n date_components = NSDateComponents.new\n date_components.hour = 0\n date_components.minute = 0\n date_components.second = 0\n date_components.day = self.day\n date_components.month = self.month\n date_components.year = self.year\n\n calendar = NSCalendar.alloc.initWithCalendarIdentifier(NSGregorianCalendar)\n calendar.timeZone = NSTimeZone.timeZoneForSecondsFromGMT(self.utc_offset)\n date = calendar.dateFromComponents(date_components)\n\n return date\n end", "title": "" }, { "docid": "e40e396e934f8a0b3b4d98536d25d0d2", "score": "0.6849342", "text": "def starts_on\n date.wday\n end", "title": "" }, { "docid": "9bc24fa472794414d61b4f487aecb869", "score": "0.68378323", "text": "def first_day\n @range.min\n end", "title": "" }, { "docid": "14ac268eea1802e91302e86f6226ee64", "score": "0.68368477", "text": "def start_date\n Time.now\n end", "title": "" }, { "docid": "6392d8d0e3c91836c816b218ac49b804", "score": "0.6833555", "text": "def start_date\n (Time.parse(@start_date) if @start_date) || Date.today\n end", "title": "" }, { "docid": "6392d8d0e3c91836c816b218ac49b804", "score": "0.6833555", "text": "def start_date\n (Time.parse(@start_date) if @start_date) || Date.today\n end", "title": "" }, { "docid": "b0d9e11812bdeb05715984f22f51f8ed", "score": "0.6825617", "text": "def start_date ## generate \"generic / syntetic start date\" - keep helper - why? why not?\n if year?\n Date.new( start_year, 1, 1 )\n else\n Date.new( start_year 1, 7 )\n end\n end", "title": "" }, { "docid": "911253aa40c62342bd8396c2bba29665", "score": "0.6821382", "text": "def beginning_of_month; end", "title": "" }, { "docid": "911253aa40c62342bd8396c2bba29665", "score": "0.6821382", "text": "def beginning_of_month; end", "title": "" }, { "docid": "9882b31bf3abed96293765d8aea94eca", "score": "0.6815473", "text": "def start_date\n begin\n p = (Project.find_by_sql [\"SELECT DISTINCT (p.date_start) FROM projects p, jobs j WHERE p.id=j.project_id AND j.employee_id=#{session[:user_id]}\"])\n if p.blank? \n return nil\n else\n return (p.min { |a,b| a[:date_start] <=> b[:date_start] })[\"date_start\"]\n end\n rescue Exception => e\n logger.error { \"Error [hours_helper.rb/start_date] #{e.message}\" }\n end\n end", "title": "" }, { "docid": "5dc92dd8c7374fd386ccc52ee89803bc", "score": "0.6807901", "text": "def dtstart\n self.started_at.strftime(HCALENDAR_DATE_FORMAT) unless self.started_at.nil?\n end", "title": "" }, { "docid": "6822e92a39f97adc05ccb05e15b19ffa", "score": "0.67933553", "text": "def start_date\n get_persisted_option_value(:start_date)\n end", "title": "" }, { "docid": "bc79927a97498464153fbb597513e72a", "score": "0.67895514", "text": "def claim_statement_period_start(*options)\n claim_start_date = @classified_eob.get_start_date(@claim)\n to_print_claim_dates(claim_start_date)\n end", "title": "" }, { "docid": "cd3264806f5fe151fe4e7752adc76e0a", "score": "0.6789468", "text": "def start_date\n return request.start_date if request.start_date.present?\n event_requests.first&.start_date\n end", "title": "" }, { "docid": "5a3ce4a5cd6308e2c43a241ca99ad304", "score": "0.67794883", "text": "def get_start_week_date\n Date.commercial(get_current_year, get_week, 1)\n end", "title": "" }, { "docid": "ad27afcc8e69e5a628ec6f9bd7a66e2b", "score": "0.6776783", "text": "def custom_range_start\n Time.zone.parse(custom_range[\"date_from\"]).beginning_of_day\n end", "title": "" }, { "docid": "0da22dc75b07e752e018c7e3ca61a0ed", "score": "0.67744017", "text": "def start_of_day\n \n end", "title": "" }, { "docid": "7144e9a605e68f34c525aa16f1e373d4", "score": "0.67673093", "text": "def start_at_date\n\t start_at.strftime(\"%Y-%m-%d\") if start_at.present?\n\tend", "title": "" }, { "docid": "e290da5fd71353f7636c20d7771a1f97", "score": "0.67661434", "text": "def effective_start_date_of_original_decision\n [original_denial_date, converted_begin_date, begin_date].compact.min\n end", "title": "" }, { "docid": "a142b5dd6d988d9dc601b231cc2eb715", "score": "0.67504245", "text": "def start_date\n @start_date ||= respond_to?(:incumbencyStartDate) ? DateTime.parse(incumbencyStartDate) : nil\n end", "title": "" }, { "docid": "20b3724f692165aab095b0604b842df2", "score": "0.674524", "text": "def calendar_start_date\n right_now = Time.now\n one_year_ago = Time.new(right_now.year - 1, right_now.month, right_now.day, 12, 0, 0, right_now.utc_offset)\n # One week less. It uses one year and 1 week:\n day_in_seconds = 24*60*60\n one_year_ago = one_year_ago - day_in_seconds * 7\n unless one_year_ago.sunday?\n # Weekdays numbering in Ruby: Sunday #=> 0, Saturday #=> 6. So I need to get to the 7th day (zero again)\n weekday_delta = 7 - one_year_ago.wday\n one_year_ago = one_year_ago + day_in_seconds * weekday_delta\n end\n one_year_ago\n end", "title": "" }, { "docid": "69ca9167c25418292a6e6415329fe2fe", "score": "0.6744826", "text": "def start_date\n Date.parse(@start_date) if @start_date\n end", "title": "" }, { "docid": "69ca9167c25418292a6e6415329fe2fe", "score": "0.6744826", "text": "def start_date\n Date.parse(@start_date) if @start_date\n end", "title": "" }, { "docid": "0f2f0ce7029b759556780a8d2624d5a7", "score": "0.67425966", "text": "def start_date\n @start_date ||= respond_to?(:parliamentaryIncumbencyStartDate) ? DateTime.parse(parliamentaryIncumbencyStartDate) : nil\n end", "title": "" }, { "docid": "0f16d8bb959da2fd0bd07f24b230767e", "score": "0.67416024", "text": "def at_beginning_of_month; end", "title": "" }, { "docid": "0f16d8bb959da2fd0bd07f24b230767e", "score": "0.67416024", "text": "def at_beginning_of_month; end", "title": "" }, { "docid": "f9fcb80e449087032ea23066b9dbb0d4", "score": "0.6739267", "text": "def start_date_select\n select_date TermsCalculator.this_year_start,\n :order => [:day, :month, :year],\n :use_month_numbers => true\n end", "title": "" }, { "docid": "0fe13a0427eb6c80d8f3a55bc4692a93", "score": "0.67288065", "text": "def start_time\n date_object.to_datetime\n end", "title": "" }, { "docid": "607fde115e30e2e025ac976ca5016320", "score": "0.67221093", "text": "def get_start_date \r\n Array((Date.today - 6.months)..(Date.today)).sample \r\n end", "title": "" }, { "docid": "469429a637f85af9a8c133daae22f6dd", "score": "0.67110324", "text": "def period_before date\n raise \"#{date} is before FY #{to_s} which starts on #{first_day}\" if date < first_day\n raise \"#{date} is after FY #{to_s} which ends on #{last_day}\" if date > last_day\n\n first_day...date\n end", "title": "" }, { "docid": "2d444bcc083ded436f0a90675ade66a7", "score": "0.6709775", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.6708995", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.6708995", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.6708995", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.6708995", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.6708995", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.6708995", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.6708995", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.6708995", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.6708995", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.6708995", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.6708995", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.6708995", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.6708995", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.6708995", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.6708995", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.6708995", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.6708995", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "628acabb6b3d3fae205f582d7f6a4d6e", "score": "0.67082846", "text": "def start_date\n Date.today + 1.week\n end", "title": "" }, { "docid": "13ea99d375bf39f3069c6202bebec77e", "score": "0.6708204", "text": "def start_date\n started_on.strftime \"%B %Y\"\n end", "title": "" }, { "docid": "a4c62e76f03d928dffbfd280ba39d9ac", "score": "0.66991454", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "473910457135a23df5dc1a938546bb07", "score": "0.66977566", "text": "def start_date\n \"#{self.startyear}-01-01\"\n end", "title": "" }, { "docid": "473910457135a23df5dc1a938546bb07", "score": "0.66977566", "text": "def start_date\n \"#{self.startyear}-01-01\"\n end", "title": "" }, { "docid": "3322adbe98aaba5cb78a8bf6552d3d95", "score": "0.6677752", "text": "def start\n starts_at_utc.strftime('%m/%d/%Y')\n end", "title": "" }, { "docid": "dba6627a88be7cfafe1ed53d477df290", "score": "0.66751224", "text": "def beginning_of_day\r\n to_time\r\n end", "title": "" }, { "docid": "8fa63783cc60cd84545106a0f789b2da", "score": "0.66714793", "text": "def start_of_month( date )\n date - date.day + 1\n end", "title": "" }, { "docid": "1026ca2863e7777c992e23d4c0f5fdb4", "score": "0.66697156", "text": "def start_date\n Date.new(startyear).to_s\n end", "title": "" }, { "docid": "064a2b6caebbec46196368c823973fdf", "score": "0.66509354", "text": "def service_from_date(*options)\n\t\t\tservice_period_start\n\t\tend", "title": "" }, { "docid": "1396d59eaa1825f8389c9e2554992059", "score": "0.6648576", "text": "def start_date\n now = DateTime.now\n case @unit_list.currentRow\n when 0 # day\n start = now - @number_list.currentRow\n year, month, day = start.year, start.month, start.day\n when 1 # week\n mday = now - (now.wday==0 ? 6 : now.wday - 1)\n start = mday - @number_list.currentRow * 7\n year, month, day = start.year, start.month, start.day\n when 2 # month \n year, month, day = now.year, now.month, 1\n @number_list.currentRow.times do\n month -= 1\n if month == 0\n year -= 1\n month = 12\n end\n end\n when 3 # quarter (3 months)\n year, month, day = now.year, now.month, 1\n @number_list.currentRow.times do\n month -= 3\n if month < 1\n year -= 1\n month += 12\n end\n end\n month = ((month-1) / 3) * 3 + 1\n when 4 # half (6 months)\n year, month, day = now.year, now.month, 1\n @number_list.currentRow.times do\n month -= 6\n if month < 1\n year -= 1\n month += 12\n end\n end\n month = ((month-1) / 6) * 6 + 1 \n when 5 # year\n year, month, day = now.year - @number_list.currentRow, 1, 1\n end\n Qt::Date.new(year, month, day) \n end", "title": "" } ]
fd3bd94deabe0fb10b21c183c343ded8
This is a dangerous method because it will delete directories that are not empty. So this is called in delete_dir method with the root directory appended to the dir_name so you cannot delete directories outside of this project.
[ { "docid": "6a3f7492fc7626bd3b3f834fc58d477b", "score": "0.7772447", "text": "def delete_dir_base(dir_name)\n FileUtils.remove_dir(dir_name)\n end", "title": "" } ]
[ { "docid": "e68b2af095ffca076abc331a09eaf479", "score": "0.77864397", "text": "def delete_dir!(path)\n # do nothing, because there's no such things as 'empty directory'\n end", "title": "" }, { "docid": "66d9af491ec8df5da78350a1cc860450", "score": "0.75141543", "text": "def clean_dir\n\n path = self.get_dir\n _clean_dir(path)\n end", "title": "" }, { "docid": "b462e10679dd10fe65f0fbc703f41e1c", "score": "0.74968475", "text": "def delete_dir dir_name\n puts \"Deleting #{dir_name}...\"\n files = Dir.entries(HTML_DIR)\n files.delete(\".\")\n files.delete(\"..\")\n files.each {|file| File.delete(File.join(HTML_DIR, file))}\n Dir.delete(HTML_DIR)\nend", "title": "" }, { "docid": "7d825943c08d6cc1bc0d83fe6bee55bf", "score": "0.7287883", "text": "def empty_non_root_directory path\n check_path_for_danger_to_remove path\n\n logger.debug \"Removing content of '#{File.join path, '*'}'\"\n FileUtils.rm_rf Dir.glob(File.join(path, '*'))\n FileUtils.rm_rf Dir.glob(File.join(path, '.*')).select {|f| f !~ /\\/..?$/}\n end", "title": "" }, { "docid": "bf9ee9775838fbb20ab9486f58f11bc4", "score": "0.72833884", "text": "def clean_dir\n File.join clean_dir_parent, name\n end", "title": "" }, { "docid": "b6d5727ff824c3a7a1383261950e4e0f", "score": "0.71487534", "text": "def cleanup_dirs\n @cleanup_dirs ||= ['.']\n end", "title": "" }, { "docid": "348e6a6840868dd36ed0c6d0c25484ac", "score": "0.71246356", "text": "def delete_empty_directories(dir)\n return if File.realpath(dir) == File.realpath(@root_path)\n if Dir.entries(dir).reject{ |f| EXCLUDED_DIRS.include?(f) }.empty?\n Dir.delete(dir) rescue nil\n delete_empty_directories(File.dirname(dir))\n end\n end", "title": "" }, { "docid": "c860b9f0f1bb8873e9c8eee539feec34", "score": "0.71066034", "text": "def destroy_dir(dir_name)\n Dir.exist?(dir_name) ? (FileUtils.rm_rf dir_name) : nil\n return true\n end", "title": "" }, { "docid": "df2abe524e86eed84c285a273904a705", "score": "0.708433", "text": "def clean_dir(dir)\n Dir.glob(File.join(dir, '*')).each {|d| clean_dir(d); Dir.rmdir(d) rescue nil}\nend", "title": "" }, { "docid": "51acba7c85793d1db46bbd0c87acebf5", "score": "0.7027569", "text": "def flush_dir(dirName)\r\n\tif File.directory?(dirName)\r\n\t\tFileUtils.remove_dir(dirName, true)\r\n\tend\r\nend", "title": "" }, { "docid": "51acba7c85793d1db46bbd0c87acebf5", "score": "0.7027569", "text": "def flush_dir(dirName)\r\n\tif File.directory?(dirName)\r\n\t\tFileUtils.remove_dir(dirName, true)\r\n\tend\r\nend", "title": "" }, { "docid": "287bbd84fafb3fad2553e71a246c7cc2", "score": "0.70141405", "text": "def remove_empty_directory(path = nil)\r\n dir = path || File.dirname(full_path)\r\n dir.gsub!(/(\\/+\\.\\.?\\/*)*$/, '')\r\n system_files = %w(Thumbs.db .DS_Store)\r\n if File.directory?(dir) and !File.symlink?(dir) and (Dir.entries(dir) - %w(. ..) - system_files).empty?\r\n system_files.each { |sys| File.delete(\"#{dir}/#{sys}\") if File.exists?(\"#{dir}/#{sys}\") }\r\n Dir.rmdir(dir)\r\n remove_empty_directory(dir.gsub(/\\/+[^\\/]*\\/*$/, ''))\r\n end\r\n end", "title": "" }, { "docid": "914bad81a16cfb7f28036ab221eb4fd9", "score": "0.70112175", "text": "def delete\n File.delete fullpath\n dirname = File.dirname(fullpath)\n while dirname != root\n Dir.rmdir(dirname)\n dirname = File.dirname(dirname)\n end\n rescue Errno::ENOTEMPTY\n end", "title": "" }, { "docid": "db94b3427fa35371c21ff2f34b338e06", "score": "0.69051975", "text": "def rm_dir(dir)\n @dirs.delete(dir.path)\n end", "title": "" }, { "docid": "b044bf3a5023c039b238e44f59b51418", "score": "0.6893165", "text": "def clean(name)\n return false if exists?(name)\n path = File.join(directory, dir_name(name))\n FileUtils.rm_rf(path)\n end", "title": "" }, { "docid": "e0593a8cc1d375cbeba20da3ddc030eb", "score": "0.6875655", "text": "def rm_dir(dir)\n @dirs.delete(dir.path)\n end", "title": "" }, { "docid": "ad8262dddd0a9cf697adb7a8eaed4037", "score": "0.68754584", "text": "def cleandir(dir)\n if FileTest.directory?(dir)\n files = []\n Find.find(dir) { |f|\n files.push(f)\n }\n files.shift\t\t# get rid of 'dir'\n files.reverse_each { |f|\n if FileTest.directory?(f)\n Dir.delete(f)\n else\n File.delete(f)\n end\n }\n end\n end", "title": "" }, { "docid": "a50aa96dc238366ef16d27ebb3b49430", "score": "0.6799031", "text": "def delete_root\n Dir.chdir(root) do\n Dir.entries('.').each do |entry|\n next if entry == '.' || entry == '..'\n next if entry == FILES_DIR && task.options.copy_files_with_symlink\n\n begin\n FileUtils.remove_entry_secure(entry)\n rescue\n if task.options.copy_files_with_symlink\n print_title('Cannot automatically empty ' + root + '. Please manually empty this directory (except for ' + root + '/' + FILES_DIR + ') and then hit any key to continue...')\n else\n print_title('Cannot automatically empty ' + root + '. Please manually empty this directory and then hit any key to continue...')\n end\n STDIN.getch\n break\n end\n end\n end\n\n logger.info(\"#{root} content was deleted\")\n end", "title": "" }, { "docid": "480012f6f6771c62e2a513094dcc7f2e", "score": "0.6789513", "text": "def cleanup\n\n # ----------------------------------------------\n account_name = 'your account name' # <-- change this!\n project_name = 'your project name' # <-- change this!\n # ----------------------------------------------\n\n project_dir = \"/home/#{account_name}/www\"\n Dir.chdir(project_dir)\n\n Dir.entries(project_name).select do |entry1|\n\n dir1 = File.join(project_name,entry1) #dir2 = \"#{project_name}/#{entry1}\"\n if is_directory?(dir1)\n Dir.entries(dir1).select do |entry2|\n \n dir2 = File.join(dir1,entry2) #dir2 = \"#{project_name}/#{entry1}/#{entry2}\"\n if is_directory?(dir2)\n Dir.entries(dir2).select do |entry3|\n \n dir3 = File.join(dir2,entry3) #dir3 = \"#{project_name}/#{entry1}/#{entry2}/#{entry3}\"\n if is_directory?(dir3)\n Dir.entries(dir3).select do |entry4|\n delete_file(File.join(dir3,entry4))\n end\n end\n\n delete_file(dir3)\n delete_dir(dir3)\n end\n end\n\n delete_file(dir2)\n delete_dir(dir2)\n end\n end\n\n delete_file(dir1)\n delete_dir(dir1)\n end\n\n delete_dir(project_name)\nend", "title": "" }, { "docid": "f55e598934ee004b9a5915cd87de7100", "score": "0.67657727", "text": "def clean_directory\n Dir.foreach(@server_dir) do |file|\n fn = File.join(@server_dir, file)\n File.delete(fn) if fn[-1] != '.'\n end\n end", "title": "" }, { "docid": "9b75ac0bbf9b1bddcd29f84b59588a65", "score": "0.67133594", "text": "def destroy()\n\n path = self.get_dir\n FileUtils.remove_entry_secure(path, true)\n _clean_dir(File.dirname(path))\n\n super()\n end", "title": "" }, { "docid": "73e4891cef144ca8dae8e68d4d8e9cc3", "score": "0.66980475", "text": "def delete\n if (exists?)\n list.each do |children|\n children.delete\n end\n factory.system.delete_dir(@path)\n end\n end", "title": "" }, { "docid": "48d601136a676e4c8e0114cc9f7c2531", "score": "0.66937214", "text": "def destroy\n delete_files_and_empty_parent_directories\n end", "title": "" }, { "docid": "c21294ae248208c710c9335461dcc4de", "score": "0.66728604", "text": "def remove_dirs()\n puts \"Removing test directories...\"\n \n if File::exist?(\"tmp\") && File::directory?(\"tmp\")\n FileUtils.rm_rf(\"tmp\") \n end\n exit 0\nend", "title": "" }, { "docid": "d18e58bdca4521e7e9d53298f9f8542e", "score": "0.6666668", "text": "def clean_tmp_upload_dir\n FileUtils.rm_r(tmp_upload_dir) if self.tmp_upload_dir && File.directory?(self.tmp_upload_dir)\n end", "title": "" }, { "docid": "0a61048ef2202d309a0ecce7030a29ca", "score": "0.66503406", "text": "def remove_empty_directories\n base_paths.each do |path|\n command = <<-CMD\n for directory in $(find #{path} -type d); do\n if [ ! -d $directory ]; then\n echo \"Can't find directory $directory, it was probably already deleted, skipping . . .\"\n continue\n fi\n files=$(find $directory -type f)\n if [ -z \"$files\" ]; then\n echo \"No files in directory $directory, deleting . . .\"\n sudo rm -rf $directory\n fi\n done\n CMD\n Pkg::Util::Net.remote_execute(Pkg::Config.staging_server, command)\n end\n end", "title": "" }, { "docid": "d317a172274aa729cc00f8c0aef5dd90", "score": "0.66278666", "text": "def clean!\n FileUtils.rm_rf(dir)\n end", "title": "" }, { "docid": "c1b8ba794b983c83526363bd8b641b65", "score": "0.6621573", "text": "def deleteOld(dir)\n\tif File.exists?(dir)\n\t\tMcmlln::Tools.deleteDir(dir)\n\tend\nend", "title": "" }, { "docid": "2c3d18914ce03893b1d96ffdc46d31cd", "score": "0.6619396", "text": "def delete_dir(path)\n Dir.foreach(@old_base + path) do |fname|\n path_fname = path + fname\n next if fname == '.' || fname == '..' || filter_fname(path_fname)\n type = File.ftype(@old_base + path_fname).to_sym\n delete_dir(path_fname + '/') if type == :directory\n @entries << [path_fname, type, :deleted]\n end\n end", "title": "" }, { "docid": "333e519b201c10b7520c37d2c67b7d05", "score": "0.6609752", "text": "def destroy_wormhole(rootpath)\n if rootpath == \"#{$paths.reports_path}Sapphire_Update/New_Students\"\n Process.abort\n end\n Dir.chdir(rootpath)\n all_folders = Dir.entries(rootpath)\n if all_folders == [\".\",\"..\"]\n Dir.chdir(\"..\")\n Dir.rmdir(rootpath)\n @i += 1\n else\n all_folders.each{|entry|\n next if entry == \".\" || entry == \"..\"\n path = File.expand_path(entry)\n destroy_wormhole(path)\n Dir.chdir(\"..\")\n Dir.rmdir(rootpath)\n @i += 1\n }\n end\n end", "title": "" }, { "docid": "912f48d8b885479f67d17e1b72b51471", "score": "0.6599523", "text": "def delete_dir_contents(target_dir)\n Find.find(target_dir) do |x|\n if File.file?(x)\n FileUtils.rm(x)\n elsif File.directory?(x) && x != target_dir\n FileUtils.remove_dir(x)\n end\n end\n end", "title": "" }, { "docid": "43458c4eea919a76bba3d349bafbac4e", "score": "0.65969634", "text": "def clean_dir(dir)\n Dir.chdir(dir)\n Dir.glob('*').each {|f| FileUtils.rm f }\n end", "title": "" }, { "docid": "d5558f562e76974cd4c9ad048d4915ca", "score": "0.65758216", "text": "def _clean_dir(path)\n\n if File.expand_path(path) == File.expand_path(THETIS_MAIL_LOCATION_DIR)\n return\n end\n\n files_dirs = Dir.glob(File.join(path, '**/*'))\n if files_dirs.nil? or files_dirs.empty?\n FileUtils.remove_entry_secure(path, true)\n _clean_dir(File.dirname(path))\n end\n end", "title": "" }, { "docid": "723ada652d01e26fc431d80ed0515a56", "score": "0.6569814", "text": "def deleteDirectory(dirPath, dryRun)\n #N Without this, the deletion command won't be run at all\n sshAndScp.deleteDirectory(dirPath, dryRun)\n end", "title": "" }, { "docid": "71ab384b713a7103dd4ebfd99c8255c8", "score": "0.65545684", "text": "def clean(path)\n path.dirname.ascend do |pathname|\n if Dir.empty?(pathname) && pathname != directory\n pathname.rmdir\n else\n break\n end\n end\n end", "title": "" }, { "docid": "525aaef18c13382a77a5d790a25419ea", "score": "0.6542384", "text": "def cleanup\n if dir and File.exists?(dir)\n FileUtils.rm_rf(dir)\n end\n\n nil\n end", "title": "" }, { "docid": "bae750808b3ad94ae02e5fafcaef0cea", "score": "0.65315944", "text": "def recursively_delete_dir(dir)\n FileUtils.rm_rf(dir) # or use FileUtils.rm_r(dir, :force => true)\n # system(\"rm -rf #{dir}\")\n end", "title": "" }, { "docid": "fb1b62b82e33a03a874f972c1e61c5ab", "score": "0.6525981", "text": "def rmdir() Dir.rmdir( expand_tilde ) end", "title": "" }, { "docid": "d304b7d1429db8a969c89084f961b6ce", "score": "0.65066123", "text": "def clean_out_log_directory(dir)\n Pathstring(dir).children.each do |item|\n if item.directory?\n # First clean out inside the directory\n clean_out_log_directory(item)\n\n # Then, if it is empty, delete it\n if item.empty?\n # OSX::NSLog \"Removing directory: #{file.basename}\"\n item.unlink\n end\n else # Not a directory, so a normal file\n unless Pathstring(item).basename.scan(/rolling/)[0] # Note: This depends on the convention to include 'rolling' in the name of persistent files. TODO: Remove older rolling logs.\n # If it is not a persistent log\n # remove it\n # OSX::NSLog \"Removing log: #{item.basename}\"\n item.unlink\n end\n end\n end\nend", "title": "" }, { "docid": "c3d1fdc76c7e449cb177f3d7aa1379da", "score": "0.64995444", "text": "def delete_empty_upstream_dirs\n path = ::File.expand_path(store_dir, root)\n Dir.delete(path) # fails if path not empty dir\n\n path = ::File.expand_path(base_store_dir, root)\n Dir.delete(path) # fails if path not empty dir\n rescue SystemCallError\n true # nothing, the dir is not empty\n end", "title": "" }, { "docid": "b3fb63d8200e91ce90e9fa5500dbccba", "score": "0.649448", "text": "def clean_test_dir!\n FileUtils.remove_entry_secure test_dir\n end", "title": "" }, { "docid": "e4e9a28eed94ab4a14c3a544afbfe80d", "score": "0.6494439", "text": "def destroy_upload_dir\n dir = File.expand_path \"../\", file.path\n FileUtils.rm_rf dir\n end", "title": "" }, { "docid": "233f3b5564452a1a7b5502905ba64ed3", "score": "0.64931583", "text": "def prune_empty_directories(path)\n all_files = all_files(path)\n\n directories = all_files.select { |x| File.directory?(x) }\n directories.sort! { |a, b| b.size <=> a.size }\n\n directories.each do |directory|\n entries = all_files(directory)\n FileUtils.rmdir(directory) if entries.empty?\n end\n end", "title": "" }, { "docid": "6d72c5657c3735f4d168ff8bdb9ea91f", "score": "0.64910746", "text": "def remove_file_and_clean_directories( path )\n # first, delete the file\n delete_file( path )\n # recursively remove any parent directories, but only if they are empty, stop if they are not\n remove_empty_folders_recursively( path )\n end", "title": "" }, { "docid": "1a510a822a85ac75ea6926ff5bbb3354", "score": "0.6486222", "text": "def rmdir() Dir.rmdir(path) end", "title": "" }, { "docid": "4a6a536fb6f4e99b9699b20227a73cfb", "score": "0.6470449", "text": "def clean\n FileUtils.rm_rf(\"#{ROOT_DATA_FOLDER}/.\", secure: true)\n unless File.directory?(ROOT_DATA_FOLDER)\n FileUtils.mkdir_p(ROOT_DATA_FOLDER)\n end\n end", "title": "" }, { "docid": "28f0f6a2433fc141bddd7c8049b50728", "score": "0.64562684", "text": "def delete\n FileUtils.remove_entry_secure(@directory)\n ObjectSpace.undefine_finalizer(self)\n rescue Errno::ENOENT\n end", "title": "" }, { "docid": "5c8c9175ac90979e623c1e432c081dc7", "score": "0.6456013", "text": "def remove_dir path\r\n files = []\r\n dirs = []\r\n\r\n @ftp.list path do |line|\r\n name = line.split(' ', 9)[8] #should be file or dir name\r\n is_dir = line.chars.to_a[0] == 'd' #first character is 'd' for dirs\r\n if is_dir\r\n dirs << name\r\n else\r\n files << name\r\n end\r\n end\r\n\r\n files.each do |file|\r\n remove_file(File.join(path, file))\r\n end\r\n\r\n dirs.each do |dir|\r\n unless dir == '.' || dir == '..'\r\n remove_dir(File.join(path, dir))\r\n end\r\n end\r\n\r\n begin\r\n @ftp.rmdir path\r\n rescue Net::FTPPermError\r\n end\r\n end", "title": "" }, { "docid": "bab2702f3de836f1d9f3db8133d770de", "score": "0.64480424", "text": "def delete_dir\n FileUtils.rm_rf(@server_dir)\n @queue = []\n end", "title": "" }, { "docid": "4cbc56e3bf6a67a74d9444a20482d166", "score": "0.6440325", "text": "def clean\n needs_cleaning = File.exist?(project_dir)\n if needs_cleaning\n log.info(log_key) { \"Cleaning project directory `#{project_dir}'\" }\n FileUtils.rm_rf(project_dir)\n end\n create_required_directories\n deploy\n needs_cleaning\n end", "title": "" }, { "docid": "63488fc6a8db90082aa9183e1288b2bf", "score": "0.64378357", "text": "def clean_up\n Dir.foreach(Dir.pwd) do |f|\n if !f.start_with?('tmp_') then next\n elsif File.directory?(f) then FileUtils.rm_rf(f)\n else FileUtils.rm(f)\n end\n end\nend", "title": "" }, { "docid": "d8d441f0b223aae0e394260411568b9a", "score": "0.6410568", "text": "def delete_empty(directory) \n log_file(\"[START] running empty folder deletion...\")\n\n dir(directory + '**/*').each do |path|\n if (File.directory?(path) && tree_empty?(path)) then\n log_file(\"This folder is empty and will be deleted: \" + path)\n trash(path)\n end\n end\n log_file(\"[COMPLETE] ...empty folder deletion done.\")\n\nend", "title": "" }, { "docid": "77ac4550fe20912e8f4c7aff47622c23", "score": "0.64017713", "text": "def remove_directory(dir)\n if(File.exists?(dir))\n clear_directory(dir)\n FileUtils.rm_r dir, :force => true\n end\n end", "title": "" }, { "docid": "f1120d4e78a36a5b6cdaab3cf221541d", "score": "0.63942003", "text": "def clear_directory(dir)\n puts dir\n if(File.exists?(dir))\n Dir.foreach(dir){|entry|\n puts entry\n if(File.file?(entry))\n File.delete(entry)\n end\n }\n end\n end", "title": "" }, { "docid": "7b611dc4400bd04e35c798884614a73f", "score": "0.6364898", "text": "def clean(id)\n path(id).dirname.ascend do |pathname|\n if pathname.children.empty? && pathname != directory\n pathname.rmdir\n else\n break\n end\n end\n end", "title": "" }, { "docid": "5376d1b096d312f3e582a211cd6b204f", "score": "0.63556576", "text": "def clean_app()\n wd = FileUtils.pwd()\n FileUtils.rm_f( [\n '/app/assets/*',\n '/app/components/*',\n '/app/controllers/*',\n '/app/helpers/*',\n '/app/models/*',\n '/app/views/*'\n ].collect!{|e| Dir.glob(wd + e)}.flatten.compact )\n end", "title": "" }, { "docid": "97339e792af9a1472cfd27e60c10876f", "score": "0.6350374", "text": "def destroy(_)\n paths = [\n instance.provisioner[:root_path], instance.verifier[:root_path]\n ]\n paths.each do |p|\n FileUtils.rm_rf(p)\n logger.info(\"[Localhost] Deleted temp dir '#{p}'.\")\n end\n self.class.unlock!\n end", "title": "" }, { "docid": "95879532937e08f79d660a1bc0278d55", "score": "0.6346518", "text": "def rm_r(dir)\n Dir.entries(dir).each do |entrada|\n if (File.directory?(\"#{dir}/#{entrada}\") and (entrada != \".\" and entrada != \"..\") )\n rm_r(\"#{dir}/#{entrada}\")\n Dir.delete(\"#{dir}/#{entrada}\")\n else\n File.delete(\"#{dir}/#{entrada}\") if (entrada != \".\" and entrada != \"..\")\n end\n end\nend", "title": "" }, { "docid": "134d7754546dd0a6becdfd3a2e3e48d2", "score": "0.633628", "text": "def remove_dir(path)\n FileUtils.remove_dir(path) if File.directory?(path)\n end", "title": "" }, { "docid": "2227eabfb0783b2ccea8abf5114fb6ad", "score": "0.63357115", "text": "def deleteDirectory(dirPath, dryRun)\n #N Without this, the required ssh command to recursive remove a directory won't be (optionally) executed. Without the '-r', the attempt to delete the directory won't be successful.\n ssh(\"rm -r #{dirPath}\", dryRun)\n end", "title": "" }, { "docid": "67af3b3019821785bcc4498040dee819", "score": "0.63340765", "text": "def delete_temp_dir\n\t\tself.rm_str(\" -rf \", @@dir_temp)\n\tend", "title": "" }, { "docid": "effb90d93ebdf6da301c61d1ef837f9d", "score": "0.6318392", "text": "def destroy\n @dirs_created.each { |d| FileUtils.rm_rf(d) }\n self.class.repositories.delete(@name)\n end", "title": "" }, { "docid": "a1b18b321705e43c75c432b017c06a56", "score": "0.63074356", "text": "def destroy\n error = nil\n\n if @file.directory_id.nil?\n render_error \"Cannot remove root directory. Delete the project, instead.\"\n else\n begin\n ActiveRecord::Base.transaction do\n delete_file(@file, true);\n render json: \"\", serializer: SuccessSerializer\n end\n rescue\n render_error \"Files could not be deleted.\"\n end\n end\n end", "title": "" }, { "docid": "14c0e20fba00065240a572a6cf2c7e90", "score": "0.6273947", "text": "def purge\n\n FileUtils.remove_dir(@basepath)\n end", "title": "" }, { "docid": "919d16dcf28e52da327e06020ebd451b", "score": "0.62701994", "text": "def remove_directory(path)\n FileUtils.rm_rf(path)\n end", "title": "" }, { "docid": "919d16dcf28e52da327e06020ebd451b", "score": "0.62701994", "text": "def remove_directory(path)\n FileUtils.rm_rf(path)\n end", "title": "" }, { "docid": "4e7e54ddc28aa934ababac65d3ac2f04", "score": "0.6267625", "text": "def delete_files_from dir\n Dir[dir+\"/*\"].each do |file|\n File::delete(file)\n end \n rescue => e\n Logger.<<(__FILE__,\"WARNING\",\"Files from #{dir} could not be deleted.\\n#{e.message}\")\n end", "title": "" }, { "docid": "0a2b1cd027237a76ac8696a97eeb7b0e", "score": "0.625968", "text": "def clean\n FileUtils.remove_dir(@log_dir, true)\n end", "title": "" }, { "docid": "53403a6cb6e92e66595e461671a3e2a3", "score": "0.625753", "text": "def destroy\n FileUtils.rm_rf @root\n end", "title": "" }, { "docid": "db90b2b2cad3d49c44f22535dc5f1f20", "score": "0.625119", "text": "def delete_files_and_empty_parent_directories\n style_names = reflection.styles.map{|style| style.name} << :original\n # If the attachment was set to nil, we need the original value\n # to work out what to delete.\n if column_name = reflection.column_name_for_stored_attribute(:file_name)\n interpolation_params = {:basename => record.send(\"#{column_name}_was\")}\n else\n interpolation_params = {}\n end\n style_names.each do |style_name|\n path = interpolate_path(style_name, interpolation_params) or\n next\n FileUtils.rm_f(path)\n begin\n loop do\n path = File.dirname(path)\n FileUtils.rmdir(path)\n end\n rescue Errno::EEXIST, Errno::ENOTEMPTY, Errno::ENOENT, Errno::EINVAL, Errno::ENOTDIR\n # Can't delete any further.\n end\n end\n end", "title": "" }, { "docid": "2bc133d3fbe6f2fd8fe3af94de5f69f0", "score": "0.6242339", "text": "def rmdir(dir)\n FileUtils.rm_rf dir\n puts \" ✔ rm -rf #{dir}\".colorize(:magenta).bold\n end", "title": "" }, { "docid": "0ef57440c889a0976137e130ebf32e4a", "score": "0.6233513", "text": "def delete_directory_contents(options)\n Process::Delete::DirectoryContents.delete(options[:directory_path])\n end", "title": "" }, { "docid": "4840554d60b43c187b1fbd41773520d6", "score": "0.6212094", "text": "def delete_all_projects\n FileUtils.rm_rf(Dir.glob(\"#{DIR_PROJECTS}/*\"))\nend", "title": "" }, { "docid": "00f5858bca4fd455792ad4a98d0a126a", "score": "0.6210024", "text": "def clearDistributionDirectory(projectDir)\n distDir = projectDir.to_s + '/dist'\n FileUtils.rm_rf(distDir)\n FileUtils.mkdir_p(distDir)\nend", "title": "" }, { "docid": "3e18fc6161584ecdcb9d7975f9e6d0ec", "score": "0.6200661", "text": "def clean(dir)\n\tFind.find(dir){|f|\n\t\tnext unless FileTest.file?(f)\n\t\tif File.basename(f) != \".gitkeep\"\n\t\t\tFile.delete(f)\n\t\tend\n\t}\nend", "title": "" }, { "docid": "f8beb9fce7155c760878f22fc1f40300", "score": "0.6192443", "text": "def clean_build_directory\n FileUtils.rm_rf Dir.glob(File.join(@project.build_path, '*'))\n end", "title": "" }, { "docid": "fe77a63430c636588aaba13e8ea19981", "score": "0.61768293", "text": "def delete_content_dir(path)\n FileUtils.rm_rf(Dir.glob(\"#{path}/*\"))\n end", "title": "" }, { "docid": "7c6c04a03f8f1650cad071e972197053", "score": "0.6165746", "text": "def rm_and_mkdir(dir)\n raise \"don't do this\" if dir == \"\"\n run \"rm -rf #{dir} && mkdir -p #{dir}\"\n end", "title": "" }, { "docid": "5508a43c410fd52568ef379f712e572e", "score": "0.61408514", "text": "def keep_dirs; end", "title": "" }, { "docid": "6a20f589934105d8fbfca9b1633f10d6", "score": "0.613879", "text": "def rmdir_if_empty_ie path\n rmdir path if File.exist?(path) && dir_empty?(path)\n end", "title": "" }, { "docid": "c99baeae004dadacc8cc7bc961ee44e0", "score": "0.61298454", "text": "def delete_tmp_dir(new_file)\n # versions hash is inicialized after storing all versions. We want to delete folder after all versions are restored\n # make sure we don't delete other things accidentally by checking the name pattern\n if versions.length > 0 && @cache_id_was.present? && @cache_id_was =~ /\\A[\\d]{8}\\-[\\d]{4}\\-[\\d]+\\-[\\d]{4}\\z/\n FileUtils.rm_rf(File.join(Rails.root.to_s,Refinery::PhotoGallery.photo_gallery_dir_relative_to_root, cache_dir, @cache_id_was))\n end\n end", "title": "" }, { "docid": "293ec650608a5554d9cb2395c7f93236", "score": "0.6123344", "text": "def destroy\n FileUtils.rm_rf(@root)\n true\n end", "title": "" }, { "docid": "c7d775e58f0b79033aa9a4488ec21274", "score": "0.6115193", "text": "def safe_dir\n options[:root_dir] / name.to_s\n end", "title": "" }, { "docid": "80d4dce9f1132ba2e0b93a6d209978a2", "score": "0.61114913", "text": "def delete_dir dir, pattern\n puts dir\n puts pattern\n Find.find(dir) do |path|\n if FileTest.directory? path\n # ?. means the ascii char of '.' same as '.'.chr, \".\"[0].chr\n # this is to avoid the directory start with \".\"\n if File.basename(path)[0] == ?.\n Find.prune\n else\n if File.basename(path) =~ pattern\n puts \"remove #{path}.\"\n rm_rf path\n else\n next\n end\n end\n end\n end\nend", "title": "" }, { "docid": "797e9d847997ed3deae7c935eb0e92c3", "score": "0.61019766", "text": "def delete_downloads\n FileUtils.remove_entry_secure(dir) if Dir.exist?(dir)\n end", "title": "" }, { "docid": "e99fe913a3ed924b03430d36b5155d5d", "score": "0.6092908", "text": "def purge(full_path)\n\t\traise \"No.\" if full_path == '/'\n\t\tDir.chdir(full_path) do\n\t\t\tall = Dir.glob(\"*\", File::FNM_DOTMATCH).reject { |f| f == '.' or f == '..' }\n\t\t\tFileUtils.rm_rf all\n\t\tend\n\t\ttrue\n\tend", "title": "" }, { "docid": "e99fe913a3ed924b03430d36b5155d5d", "score": "0.6092908", "text": "def purge(full_path)\n\t\traise \"No.\" if full_path == '/'\n\t\tDir.chdir(full_path) do\n\t\t\tall = Dir.glob(\"*\", File::FNM_DOTMATCH).reject { |f| f == '.' or f == '..' }\n\t\t\tFileUtils.rm_rf all\n\t\tend\n\t\ttrue\n\tend", "title": "" }, { "docid": "0407a15bcdd3490ebed567d3dc648fc3", "score": "0.6079612", "text": "def cleanup(dir)\n Dir.glob(dir+\"/*\").each do |file|\n File.unlink(file)\n end\n Dir.unlink(dir)\nend", "title": "" }, { "docid": "799fd997245cad6517353c672a9ebe4c", "score": "0.607814", "text": "def rmdir\n util.rmdir(path)\n end", "title": "" }, { "docid": "1cac33416f924d4003e2b250d0c9870d", "score": "0.607727", "text": "def delete_file name\n filename = \"#{RAILS_ROOT}/#{@@dir}/#{name}\" \n File.delete filename if File.exists? filename\n end", "title": "" }, { "docid": "c54fdb01d0f27af4d7652aca0f0a6e0b", "score": "0.6077228", "text": "def fix_dir(dir)\n (dir.nil? || dir.empty?) && '/' || dir\n end", "title": "" }, { "docid": "63693a0447263fef1f8f5c8abd7dde21", "score": "0.60645247", "text": "def clean_dir_root\n File.join(root_dir, \"test\", \"tmp\", \"cleanreps\")\n end", "title": "" }, { "docid": "83ab31fc2b98d472ebddde56c7712d41", "score": "0.6055805", "text": "def delete_completely(root, resource)\n path = File.join(root, resource.path(identifying_sym))\n FileUtils.rm_rf(path)\n\n # removes the empty directories upward\n (resource.identifiers(identifying_sym).size - 1).times do |t|\n path = File.split(path).first\n begin\n FileUtils.rmdir(path)\n rescue Errno::ENOTEMPTY\n break\n end\n end\n end", "title": "" }, { "docid": "9beb88248e69dc678c9fb9bf2124f078", "score": "0.60414064", "text": "def reset_dir(pathname)\n\tputs \" Deleting and recreating #{pathname} folder\"\n\tFileUtils.rm_rf(pathname) unless not Dir.exist?(pathname)\n\tDir.mkdir(pathname)\nend", "title": "" }, { "docid": "de1273c127cc4fe373cea8b7ae9ab7a0", "score": "0.60363495", "text": "def delete(rmdir: false)\n # FIXME: rethink this interface... should qdel be idempotent?\n # After first call, no errors thrown after?\n\n if pbsid\n\n @torque.qdel(pbsid, host: @host)\n # FIXME: removing a directory is always a dangerous action.\n # I wonder if we can add more tests to make sure we don't delete\n # something if the script name is munged\n\n # recursively delete the directory after killing the job\n Pathname.new(path).rmtree if path && rmdir && File.exist?(path)\n end\n end", "title": "" }, { "docid": "73821d7587e775e0480c30b09746976b", "score": "0.6033378", "text": "def deleteT(dir1, dir2)\n\t\tFileUtils.rm_rf Dir.glob(\"#{dir1}*\")\n\t\tFileUtils.rm_rf Dir.glob(\"#{dir2}*\")\n\tend", "title": "" }, { "docid": "5e86b3183a1bfed07598e32aa77e8e9b", "score": "0.6027066", "text": "def fileCleanPath(pathName) \n pathName.mkpath()\n begin\n pathName.rmtree()\n rescue\n puts \"Cannot delete: \" + pathName.to_s\n end\n pathName.mkpath()\nend", "title": "" }, { "docid": "5213add8e05a9897c85f4af6f0ed6201", "score": "0.6022324", "text": "def delete_directory_or_file(dir_or_file)\n if File.exist?(dir_or_file)\n FileUtils.rm_rf(dir_or_file)\n end\n end", "title": "" }, { "docid": "342015a67d21d8bd61082635f37690d4", "score": "0.6017583", "text": "def remove_structure\n rm_rf target_dir\n end", "title": "" }, { "docid": "bf69d3080977fef7b3d4f2778afac3ad", "score": "0.6013741", "text": "def clean_up\n FileUtils.rm_rf \"#{@path}\" unless create_in_current_directory?\n FileUtils.rm_rf \"#{@cache}\"\n end", "title": "" } ]
26db4e42e9043d38fb7887551516362d
Minifies the whole application
[ { "docid": "152496f1d0e7305ec3bc5e7ca62fec9c", "score": "0.66296744", "text": "def minify()\r\n # Parse the index.html\r\n doc = Hpricot(open(\"index.html\"))\r\n\r\n puts \"Minifying framework files\"\r\n # Select the framework files into an array\r\n fwk_files = doc.search('head script[@src]').map { |x| x['src'] }\r\n #remove the scripts\r\n (doc/\"head/script\").remove\r\n # Minify them\r\n minify_js(fwk_files, \"fwk_min.js\")\r\n\r\n puts \"Minifying application & modules files\"\r\n # Select the applications & modules files into an array\r\n app_files = doc.search('body script[@src]').map { |x| x['src']}\r\n #remove the scripts\r\n (doc/\"body/script\").remove\r\n # Minify them\r\n minify_js(app_files, \"apps_min.js\")\r\n\r\n #write the new scripts into the document\r\n (doc/\"head\").append(\"<script type='text/javascript' src='fwk_min.js'></script>\");\r\n (doc/\"body\").append(\"<script type='text/javascript' src='apps_min.js'></script>\");\r\n\r\n backup_files\r\n\r\n puts \"Minifying CSS files\"\r\n \r\n [\"css/CSS2.css\", \"css/CSS2_IE6.css\", \"css/CSS2_IE7.css\"].each do |filename|\r\n minify_css(filename + \".bak\", filename)\r\n end\r\n\r\n puts \"Writing minified index.html\"\r\n #write the new document\r\n html = File.new(\"index.html\", \"w\")\r\n html.write(doc.to_s.tr(\"\\t\\n\",\"\"))\r\n html.close\r\nend", "title": "" } ]
[ { "docid": "bc38f53332d6d78f25deb8cc834f4eab", "score": "0.6870435", "text": "def minify_build_js()\n puts 'Minifying JS...'\n %x[closure --js #{BUILD_JS} --js_output_file #{BUILD_JS}.tmp]\n %x[mv #{BUILD_JS}.tmp #{BUILD_JS}]\nend", "title": "" }, { "docid": "62d56ad06cb1dc602d58db529526585b", "score": "0.68663436", "text": "def min\n puts 'minifying js'\n min_file = \"#{ LIBPATH }lib#{ File::SEPARATOR }xui-min.js\"\n doc_file = \"#{ LIBPATH }lib#{ File::SEPARATOR }xui.js\"\n sh \"java -jar #{LIBPATH}/util/yuicompressor-2.3.6.jar --charset UTF-8 -o #{min_file} #{doc_file}\"\nend", "title": "" }, { "docid": "08aa8f366ef6ca8d7647d9e5e4a1a6e0", "score": "0.68110347", "text": "def min\n puts 'minifying js'\n min_file = \"#{ LIBPATH }lib#{ File::SEPARATOR }phonegap-min.js\"\n doc_file = \"#{ LIBPATH }lib#{ File::SEPARATOR }phonegap.js\"\n sh \"java -jar #{LIBPATH}#{ File::SEPARATOR }util#{ File::SEPARATOR }yuicompressor-2.4.2.jar --charset UTF-8 -o #{min_file} #{doc_file}\"\nend", "title": "" }, { "docid": "d1b0cf4445d5ddf59e6bb4679c11bbdb", "score": "0.6738631", "text": "def minify_build_html()\n puts 'Minifying HTML...'\n %x[htmlcompressor --type html --charset utf-8 --recursive --compress-js \\\n --compress-css --js-compressor closure -o #{BUILD_DIR} #{BUILD_DIR}]\nend", "title": "" }, { "docid": "97a2de505795ad19c1a184ef3c58f4b8", "score": "0.6584952", "text": "def should_minify\r\n false\r\n end", "title": "" }, { "docid": "6c9a3612c7407c985b7b6ca3c0e3eb66", "score": "0.6554933", "text": "def minify(content)\n Rainpress.compress(content)\n end", "title": "" }, { "docid": "e0d9b2eb64f482661518873ef434a2f6", "score": "0.64282054", "text": "def compress_app\n def write_entries(entries, path, io)\n excludes = ['run.command']\n entries.each do |e|\n zip_file_path = path.empty? ? e : File.join(path, e)\n diskFilePath = File.join '..', zip_file_path\n if File.directory? diskFilePath \n subdir = Dir.entries(diskFilePath).reject! {|dir| dir == '.' or dir == '..'}\n write_entries subdir, zip_file_path, io\n elsif not excludes.include? File.basename(diskFilePath)\n io.get_output_stream(zip_file_path){ |f| f.print(File.open(diskFilePath, 'rb').read) }\n end\n end\n end\n\n output = @build_dir + '/app.nw'\n entries = Dir.entries('..').reject! do |dir|\n dir.start_with? '.' or dir == 'build' \n end\n\n print 'Zipping the app...'\n\n io = Zip::File.open output, Zip::File::CREATE\n write_entries entries, '', io\n io.close\n puts ' Done!'\nend", "title": "" }, { "docid": "0f0d3bd6359496763a504b850a13a913", "score": "0.6301382", "text": "def minify(file)\n Uglifier.compile(file)\n end", "title": "" }, { "docid": "f4236f81c4324dce6ecfd8a980538e91", "score": "0.6214974", "text": "def build\n FileUtils.mkdir_p(File.dirname(file))\n File.open(file, 'w') { |f| f.write minify(concatenated) }\n file\n end", "title": "" }, { "docid": "05f1ab77421dc78843f01051a0029e65", "score": "0.617406", "text": "def minify(working_dir)\n files = Dir.glob(\"#{working_dir}/**/*.{css, js}\")\n \n files.each do |file|\n type = File.extname(file) == \".css\" ? \"css\" : \"js\"\n newfile = file.gsub(\".#{type}\", \".new.#{type}\")\n puts \"minifying #{file}\"\n `#{COMPRESSOR_CMD} --type #{type} #{file} > #{newfile}`\n\n if File.size(newfile) > 0\n FileUtils.cp newfile, file\n FileUtils.rm newfile\n else\n @errors << \"Unable to process #{file}.\"\n end\n \n end\nend", "title": "" }, { "docid": "e5c0c07c513bc9ccbef3ec7e42fa3170", "score": "0.6154089", "text": "def precompile_app_assets\n puts \"Precompiling assets...\"\n\n root = File.expand_path(\"../../../../lib/assets/javascripts/websocket_rails\", __FILE__)\n destination_dir = File.expand_path(\"../../../../spec/javascripts/generated/assets\", __FILE__)\n\n glob = File.expand_path(\"**/*.js.coffee\", root)\n\n Dir.glob(glob).each do |srcfile|\n srcfile = Pathname.new(srcfile)\n destfile = srcfile.sub(root, destination_dir).sub(\".coffee\", \"\")\n FileUtils.mkdir_p(destfile.dirname)\n File.open(destfile, \"w\") {|f| f.write(CoffeeScript.compile(File.new(srcfile)))}\n end\n end", "title": "" }, { "docid": "93ecc82a99f276c4288ee619f7e97422", "score": "0.61385006", "text": "def minify_js(files, dest_file)\r\n\r\n puts \"Minifying files into #{dest_file}\"\r\n\r\n secretary = Sprockets::Secretary.new(\r\n :source_files => files\r\n )\r\n\r\n # Generate a Sprockets::Concatenation object from the source files\r\n concatenation = secretary.concatenation\r\n # Write the concatenation to disk\r\n concatenation.save_to(dest_file)\r\n\r\n # Minify files using YUI compressor\r\n minification = `java -jar yuicompressor-2.4.2.jar --nomunge --charset utf-8 #{dest_file}`\r\n min_js = File.new(dest_file, \"w\")\r\n min_js.write(minification)\r\n min_js.close\r\nend", "title": "" }, { "docid": "acc474d7073f9e7ef7a92d3a9e8f33f9", "score": "0.6126141", "text": "def minify(file_list)\n file_list.each do |cf_file|\n one_minification(cf_file) if cf_file.minify?\n end\n end", "title": "" }, { "docid": "6c8be81956139ac0db484cbf478f8301", "score": "0.6121395", "text": "def build_javascript(dst_path)\n entry.source_entry.build!\n\n # Minify module JavaScript immediately so it can be string-wrapped\n if entry.target[:target_type] == :module\n SC::Helpers::Minifier.minify dst_path\n elsif entry.target[:target_type] == :app\n SC::Helpers::Minifier << dst_path\n end\n end", "title": "" }, { "docid": "e8279e2d42579923136a31a18d0d11d2", "score": "0.6112988", "text": "def minify(input_file, output_file)\n #require 'uglifier'\n require 'tempfile'\n\n puts \"Minifying #{input_file} to #{output_file}.\"\n Tempfile.open('jquery-raty') do |temp|\n sh 'closure', input_file.to_s, temp.path\n temp.rewind\n File.open(output_file, 'wb') do |out|\n out.puts \"/* Minified by Google Closure */\"\n out.write(temp.read)\n end\n end\nend", "title": "" }, { "docid": "a36d5357e8aa42edb97dcacc3a1286a7", "score": "0.6096519", "text": "def barryvanolen(src, target)\n put \"Minifying #{src} with Barry van Olen's CSSMIN...\"\n `java -jar vendor/yuicompressor/yuicompressor-2.4.2.jar #{src} -o #{target}`\n puts \"done.\"\nend", "title": "" }, { "docid": "70d8fd60060a3be715b44f7af96b499c", "score": "0.6002742", "text": "def minify(glob, &block)\n\tDir.glob(glob) do |file|\n\t\tnext unless file.match /\\.dev\\./\n\t\tputs \"> preparing #{file}\"\n\n\t\t# minify\n\t\tminified = block.call file\n\n\t\t# write to production file\n\t\tfile_parts = file.split(\".\")\n\t\tnew_file = \"#{file_parts[0]}.#{file_parts[2]}\"\n\t\tFile.open(new_file, 'w') { |f| f.write minified }\n\tend\t\nend", "title": "" }, { "docid": "cc23eaaf1d1fd013091e8d090446950f", "score": "0.5968843", "text": "def do_clean_compile\n end", "title": "" }, { "docid": "2adc76d4c1956c78bac55d7bd97f8643", "score": "0.59641343", "text": "def build_javascript(dst_path)\n a = Regexp.new('^'+MANIFEST.build_root)\n if dst_path =~ a\n # $to_minify << dst_path\n FileUtils.mkdir_p(File.dirname(dst_path))\n FileUtils.copy(entry.source_path, dst_path)\n else\n FileUtils.mkdir_p(File.dirname(dst_path)) # make sure loc exists...\n filecompress = \"java -Xmx128m -jar \\\"\" + SC.yui_jar + \"\\\" --js \\\"\" + entry.source_path + \"\\\" --js_output_file \\\"\" + dst_path + \"\\\" 2>&1\"\n SC.logger.info 'Compiling with YUI: '+ filecompress + \"...\"\n\n output = `#{filecompress}` # It'd be nice to just read STDERR, but\n # I can't find a reasonable, commonly-\n # installed, works-on-all-OSes solution.\n if $?.exitstatus != 0\n _report_error(output, entry.filename, entry.source_path)\n SC.logger.fatal(\"!!!!YUI compiler failed, please check that your js code is valid\")\n SC.logger.fatal(\"!!!!Failed compiling ... \"+ dst_path)\n end\n end\n end", "title": "" }, { "docid": "f416512a7e2682c4825d2ab5f01a6797", "score": "0.5956104", "text": "def js_compressor; end", "title": "" }, { "docid": "f416512a7e2682c4825d2ab5f01a6797", "score": "0.5956104", "text": "def js_compressor; end", "title": "" }, { "docid": "aee8a8199b6049b306b1949489674267", "score": "0.5879396", "text": "def minify_html\n compressor = HtmlCompressor::Compressor.new\n\n Dir.chdir(@pod_root) do\n Dir.glob('**/*.html') do |filename|\n html = File.read(filename)\n compressed_html = compressor.compress(html)\n File.open(filename, 'w') { |f| f.write(compressed_html) }\n end\n end\n end", "title": "" }, { "docid": "757e288a047201c91bca92aed72eb775", "score": "0.5873229", "text": "def minify_js(*files_in_and_out)\n files_in_and_out.each do |file_in_and_out|\n if file_in_and_out.is_a? String\n file_in = \"#{ROOT_PATH}#{file_in_and_out}\"\n file_out = \"#{ROOT_PATH}#{file_in_and_out}.tmp\"\n else\n file_in = \"#{ROOT_PATH}#{file_in_and_out[0]}\"\n file_out = \"#{ROOT_PATH}#{file_in_and_out[1]}\"\n end\n\n system \"java -jar #{ROOT_PATH}framework/scripts/libs/yuicompressor-2.4.6.jar --type js #{file_in} -o #{file_out}\"\n\n if file_in_and_out.is_a? String\n FileUtils.rm file_in\n FileUtils.mv file_out, file_in\n end \n end\nend", "title": "" }, { "docid": "7b033700add12963a306a0f0c3432ad6", "score": "0.5834497", "text": "def recompile_coffeescript\n return unless Rails.env.development?\n \n Dir.glob File.join(Rails.root, \"app\", \"javascript\", \"**\", \"*.coffee\") do |file|\n base = File.dirname(file)\n package = File.basename base\n out_package = File.join(Rails.root, \"public\", \"javascripts\", \"#{package}.js\")\n if !File.exists?(out_package) or File.mtime(out_package) < File.mtime(file)\n manifest = open(File.join(base, \"MANIFEST\")).read.split(\"\\n\").compact\n source = manifest.map do |line_item|\n line_item.strip!\n if line_item.blank?\n nil\n else\n open(File.join(base, \"#{line_item}.coffee\")).read\n end\n end.compact.join(\"\\n\")\n output = CoffeeScript.compile source\n File.open(out_package, \"w\") {|f| f.write output }\n break \n end\n end\n end", "title": "" }, { "docid": "b142b31adbf37f03c40df18a2156d275", "score": "0.58333826", "text": "def copy_app_boilerplate\n # it should remove empty directories during 'destroy' command\n %w(controllers lib models views).each do |dir_name|\n empty_directory File.join(javascript_path, dir_name)\n end\n\n # copy all /javascripts directory\n directory 'javascripts', javascript_path\n\n # create empty 'assets/templates' directory\n empty_directory template_path\n end", "title": "" }, { "docid": "36ef02549d884127191b1624b7932a50", "score": "0.5823362", "text": "def make_smaller\n puts \"Shrinking #{`pwd`}\"\n sh \"#{STRIP} *.so\"\n sh \"#{STRIP} *.so.*\"\n Dir.glob(\"lib/ruby/**/*.so\").each {|lib| sh \"#{STRIP} #{lib}\"}\n end", "title": "" }, { "docid": "ea610d07298b6d2a44b515b6e07111eb", "score": "0.58223253", "text": "def compress!(bundle_name = false)\n bundle!(bundle_name, true)\n end", "title": "" }, { "docid": "83cbe30adeecd09c2c9cb1eb9c93d2e1", "score": "0.5801924", "text": "def copy_and_compress_binary\n \n # (RIP Mar 09, 2011) - Define some variables.\n binary_filename = \"#{@application_name}.#{BINARY_EXTENSION}\"\n zip_filename = \"#{@application_name.gsub(' ','_')}.zip\"\n \n # (RIP Mar 09, 2011) - Compress the binary into a zip file.\n # (RIP Apr 07, 2011) - The .app bundle includes a symlink to _CodeSignature/CodeResources. You must include -y in the zip options\n # to store symlinks in the archive. If this isn't done, the binary is invalid and Apple will not accept. More info can be found\n # here (see the answer from shirikodama) - http://stackoverflow.com/questions/47941/invalid-iphone-application-binary\n system(\"cd '#{BUILD_FOLDER_PATH}'; /usr/bin/zip -yr '#{zip_filename}' '#{binary_filename}'\")\n system(\"cp '#{BUILD_FOLDER_PATH}/#{zip_filename}' '#{@bundle_executables_folder_path}/#{zip_filename}'\")\n \nend", "title": "" }, { "docid": "0998aa54e7c11235ee15d6b37144dcd4", "score": "0.5787701", "text": "def compressed\n require 'jsmin'\n @compressed ||= JSMin.minify(combined).strip\n end", "title": "" }, { "docid": "0998aa54e7c11235ee15d6b37144dcd4", "score": "0.5787701", "text": "def compressed\n require 'jsmin'\n @compressed ||= JSMin.minify(combined).strip\n end", "title": "" }, { "docid": "f2c9c29b4039ddc2a150dece74acac8b", "score": "0.57826126", "text": "def build_javascript(dst_path)\n yui_root = File.expand_path(File.join(LIBPATH, '..', 'vendor', 'yui-compressor'))\n jar_path = File.join(yui_root, 'yuicompressor-2.4.2.jar')\n FileUtils.mkdir_p(File.dirname(dst_path)) # make sure loc exists...\n filecompress = \"java -jar \" + jar_path + \" --charset utf-8 --line-break 80 \" + entry.source_path + \" -o \" + dst_path\n SC.logger.info 'Compressing with YUI .... '+ dst_path\n SC.logger.debug `#{filecompress}`\n \n if $?.exitstatus != 0\n SC.logger.fatal(\"!!!!YUI compressor failed, please check that your js code is valid and doesn't contain reserved statements like debugger;\")\n SC.logger.fatal(\"!!!!Failed compressing ... \"+ dst_path)\n end\n \n end", "title": "" }, { "docid": "7ea0bc634981ab40349631eab993c4c8", "score": "0.57651967", "text": "def minify(filename, minified_filename = nil)\r\n if minified_filename.nil?\r\n minified_filename = filename.gsub(/\\.js$/, '-min.js')\r\n end\r\n \r\n if File.exists?(minified_filename)\r\n FileUtils.rm(minified_filename)\r\n # puts \"Deleted old #{minified_filename}\"\r\n end\r\n\r\n system(\"java -jar vendor/yui-compressor/build/yuicompressor-2.4.jar #{filename} -o #{minified_filename}\")\r\n\r\n # puts \"Created minified file #{minified_filename}\"\r\n # puts\r\n end", "title": "" }, { "docid": "55257bc6cc76f843c29078d6e7fd6fbc", "score": "0.5764822", "text": "def package_app\n puts 'Packaging application...'\n package = \".dister/#{@options.app_name}_application.tar.gz\"\n system \"rm #{package}\" if File.exists?(package)\n system \"tar -czf .dister/#{@options.app_name}_application.tar.gz ../#{@options.app_name}/ --exclude=.dister &> /dev/null\"\n puts \"Done!\"\n end", "title": "" }, { "docid": "c443d44a917559776f47c0fa099e20e2", "score": "0.57561094", "text": "def compress\n files=@input_files=collect_filepaths\n \n # This will consist of only an entry (the concatenated file body)\n # when compressing javascript or css files \n\n files=[concatenate_files] if @concatenate_input\n cmd= (@commands.empty?)? nil : @commands[ @default_command ]\n\n files.each do |path|\n output_path=process(path,cmd)\n size_check(path,output_path) unless %w(.css .js).include?( File.extname(output_path)) \n end\n \n # summarise compression stats\n print_summary unless ['.css','.js' ].include?(@input_file_extensions)\n end", "title": "" }, { "docid": "138972d75c5aaae03c25694c3df1c7d4", "score": "0.5750026", "text": "def minify_build_css()\n puts 'Minifying CSS...'\n %x[yui --type css --charset utf-8 -o #{BUILD_CSS} #{BUILD_CSS}]\nend", "title": "" }, { "docid": "e3be0e721700ae12a2c7acef0afa3219", "score": "0.57080096", "text": "def compile_main\n `coffee --no-wrap -o output -c application.coffee`\n content = File.read \"output/application.js\"\n File.open(\"output/application.js\", \"w\") {|f| f.write \"templates = #{@templates};\\n#{content}\"}\n `cat output/application.js | pbcopy`\n end", "title": "" }, { "docid": "1d5424bd69568c1c21d099b6b3618434", "score": "0.5705051", "text": "def copy_and_compress_dSYM\n \n # (RIP Mar 09, 2011) - Define some variables.\n dsym_filename = \"#{@application_name}.#{DSYM_EXTENSION}\"\n \n # compress the dsym file\n system(\"cd '#{BUILD_FOLDER_PATH}'; tar -cvzpf '#{dsym_filename}.tgz' '#{dsym_filename}'\")\n system(\"cp '#{BUILD_FOLDER_PATH}/#{dsym_filename}.tgz' '#{@bundle_executables_folder_path}/#{dsym_filename}.tgz'\")\n \nend", "title": "" }, { "docid": "1456c26eb3e33dc3984a51423ab783eb", "score": "0.5679552", "text": "def compress_application\n system(\"tar -zcf #{APPLICATION_FILE} #{APPLICATION_PATH}\")\n end", "title": "" }, { "docid": "ddd9820526bb6083f38f0b6a9789efda", "score": "0.56652504", "text": "def crunch\n\n\tend", "title": "" }, { "docid": "09c4e3e147aca1af8d14352acf21e406", "score": "0.5619694", "text": "def run_all\n UI.info \"Rebuilding all assets\"\n ::Forge::Guard.builder.clean_images\n ::Forge::Guard.builder.build_assets\n end", "title": "" }, { "docid": "6a2d1702e5e5466a0176c9974e80ad89", "score": "0.5605954", "text": "def compress_js(source)\n tmp_path = \"#{RAILS_ROOT}/tmp/#{@target}_packaged_uncompressed.js\"\n File.open(tmp_path, \"w\") {|f| f.write(source) }\n result = `java -jar \"#{YUI_COMPRESSOR_PATH}/build/yuicompressor-2.4.2.jar\" --type js \"#{tmp_path}\"`\n File.delete(tmp_path) if File.exists?(tmp_path)\n result\n end", "title": "" }, { "docid": "c1460dee612d68375f78dd9344409ebe", "score": "0.56056046", "text": "def finalize_application\n \n # integrate the angular libs into the application.js in the right order\n filename = \"#{destination}/app/assets/javascripts/application.js\"\n \n content = File.read(filename)\n \n if namespace\n libs = \"//= require #{namespace}/app/app\n//= require #{namespace}/app/services\n//= require_tree ./#{namespace}/modules\"\n else\n libs = \"//= require app/app\n//= require app/services\n//= require_tree ./modules\"\n end\n \n unless content.include? libs\n content.sub!(/include builder modules\\s*$/) {|matched| matched + \"\\n#{libs}\\n\"}\n end\n\n write_asset(\"application.js\",content) \n end", "title": "" }, { "docid": "d9f0b41848daaf4754d149317abd9dca", "score": "0.5594", "text": "def compile_all\n preprocess_scripts\n preprocess_styles\n preprocess_slim\n copy_other_files\n self\n end", "title": "" }, { "docid": "07e05c5cab5ef98fdc21343dceadf22d", "score": "0.5563573", "text": "def compress_javascript(file_name)\n say \" -Compressing #{file_name} with yuicompressor\", :yellow\n\n compressor = 'yuicompressor'\n if `which yuicompressor`.empty?\n compressor = 'yui-compressor'\n if `which yui-compressor`.empty?\n say \"ERROR: you don't have a yuicompressor installed\", :red\n say \" Are you sure yuicompressor is installed on your system? Mac users, run this in console:\", :red\n say \" $ brew install yuicompressor\", :red\n say \" Ubuntu users: $sudo apt-get -y install yui-compressor\", :red\n end\n end\n cmd = \"#{compressor} #{file_name} -o #{file_name}\"\n system(cmd)\n unless $?.exitstatus == 0\n say \" ERROR: #{cmd}\", :red\n end\n end", "title": "" }, { "docid": "0b4a4e07f601358b6a324bde60e6a21e", "score": "0.55595887", "text": "def do_compression\n puts \"Doing Compression\"\n Dir[File.join(@tmp_dir,\"chrome/content/*.js\")].each do |filename|\n #`java -jar #{YUI_COMPRESSOR} #{filename} > #{File.join(@sandbox_dir,'chrome/content',File.basename(filename))}`\n `cp #{filename} #{File.join(@sandbox_dir,'chrome/content',File.basename(filename))}`\n end\n puts \"Done Compression\"\n end", "title": "" }, { "docid": "874a9e9ce4a42640dd36f6980984da8c", "score": "0.55449295", "text": "def compile\n install_jdk\n copy_killjava_script\n write_heap_size_ratio_file\n end", "title": "" }, { "docid": "e39d76d298ecc3eda2b99c6189df115a", "score": "0.5517799", "text": "def pack\r\n File.delete @file if File.exists? @file\r\n \r\n files = Dir['**/*'] - Dir[@file] + Dir['.srcignore']\r\n \r\n # Exclude ignored files.\r\n exclusions = load_exclusions.map { |e| Dir[e] }.flatten\r\n files = files - exclusions\r\n \r\n Zip::File.open @file, Zip::File::CREATE do |zip|\r\n files.each { |file| zip.add file, file }\r\n \r\n zip.get_output_stream(@warning_file) { |f|\r\n f.puts make_warning_file\r\n }\r\n end\r\n end", "title": "" }, { "docid": "3fa1106a8b3aa187535e8e33ce859b9c", "score": "0.5509813", "text": "def amalgamate_code_files\n\n print 'Concatenating ruby files '\n\n entry_point = File.read(ENTRY_POINT)\n # Put a \"require\" statement with our target in it\n modified_entry_point = entry_point.sub(TERRACE_TARGET_REQUIRE, TERRACE_TARGET_REQUIRE.sub('/TARGET/', \"/#{@target}/\"))\n\n # Swap in the \"require\" line with the correct target\n File.open(GENERATED_MAIN, 'w') { |f|\n f.write(modified_entry_point)\n }\n\n FileUtils.rm_f \"#{OUTPUT_DIR}/#{ENTRY_POINT}\"\n FileUtils.mkdir_p \"#{OUTPUT_DIR}\"\n\n `ruby #{MRUBYMIX} #{GENERATED_MAIN} #{OUTPUT_DIR}/#{ENTRY_POINT}`\n FileUtils.mv(GENERATED_MAIN, \"#{OUTPUT_DIR}/#{GENERATED_MAIN}\")\n\n puts ' done.'\n end", "title": "" }, { "docid": "7c2ae2e137573337413087f74ce8c00a", "score": "0.55039024", "text": "def bundle\n @bundled = @assets.join(\"\\n\")\n end", "title": "" }, { "docid": "c3fbb523f8094675acba1affaad87acb", "score": "0.54867184", "text": "def minimize!\n # I'll implement this when I need it\n end", "title": "" }, { "docid": "a3f6085ee97badf73e2c2746d81a966e", "score": "0.5486357", "text": "def compress_js_uglifier(content)\n begin\n require 'uglifier'\n rescue => e\n # :nocov:\n raise CompressorNotFound, \"#{e.class}: #{e.message}\", e.backtrace\n # :nocov:\n end\n\n Uglifier.compile(content)\n end", "title": "" }, { "docid": "e738ca74ddeaf0081da4e9b2f4d84f44", "score": "0.54687953", "text": "def prepare_compiler\n asset_env.css_compressor = Tipsy::Compressors::CssCompressor.new\n asset_env.js_compressor = Tipsy::Compressors::JavascriptCompressor.new\n end", "title": "" }, { "docid": "8ce300e59ef45361bee70d2623456123", "score": "0.544803", "text": "def move_and_generate_files\n if can_mv_application_to_front_site?\n say \"Renaming app/views/taglibs/application.dryml to app/views/taglibs/front_site.dryml\" unless options[:quiet]\n unless options[:pretend]\n FileUtils.mv('app/views/taglibs/application.dryml', \"app/views/taglibs/front_site.dryml\")\n copy_file \"application.dryml\", 'app/views/taglibs/application.dryml'\n end\n end\n\n template \"site.css.erb\", File.join('app/assets/stylesheets', \"#{file_name}.css\")\n copy_file \"gitkeep\", \"app/assets/stylesheets/#{file_name}/.gitkeep\"\n template \"site.js.erb\", File.join('app/assets/javascripts', \"#{file_name}.js\")\n copy_file \"gitkeep\", \"app/assets/javascripts/#{file_name}/.gitkeep\"\n\n template \"controller.rb.erb\", File.join('app/controllers', file_name, \"#{file_name}_site_controller.rb\")\n\n application \"config.assets.precompile += %w(#{file_name}.css #{file_name}.js)\"\n end", "title": "" }, { "docid": "d12206c2c535f75751c23dadfa005302", "score": "0.5442483", "text": "def compress!\n compressor.compress!\n end", "title": "" }, { "docid": "c483ade55acb1ecb1adaafcbd9878a40", "score": "0.5442352", "text": "def zip\n version = self.version\n zip_file = \"#{@current_branch}_#{version}_#{@random_id}.zip\"\n minifier = Minifier.new\n minifier.minify_js(\"#{@local_url}/js\")\n minifier.minify_css(\"#{@local_url}/css\")\n transifex = Transifex.new(\"#{@local_url}/languages/\")\n transifex.translate\n # Create new zip.\n if system \"cd #{Dir.pwd}/tmp/ && zip -r #{@@packages_path}/#{zip_file} #{@random_id}\"\n return zip_file\n end\n end", "title": "" }, { "docid": "872a54237f554c015e12a1f77b4397d3", "score": "0.5435396", "text": "def write_bundle_files\n write_pkg_info_file\n write_info_plist_file\n build_executable unless File.exist?(executable_file)\n write_ruby_main\n end", "title": "" }, { "docid": "5614b0200ecd798f3783b6d3b1bef690", "score": "0.54232484", "text": "def compress; end", "title": "" }, { "docid": "5614b0200ecd798f3783b6d3b1bef690", "score": "0.54232484", "text": "def compress; end", "title": "" }, { "docid": "73420c0c80171be0cdaa2a755f060cc6", "score": "0.5414578", "text": "def build!\n puts \"Bulding Ember Application #{name} in #{@dir.basename}\"\n Dir.chdir(@dir.to_s) do\n `npm install && bower install && npm run-script build -- -e production`\n end\n end", "title": "" }, { "docid": "baf279cfe0a8f48cf78d8c6208817ebc", "score": "0.5410288", "text": "def compile\n merge\n bust_cache if @type == 'css'\n minify\n end", "title": "" }, { "docid": "e400fd63a1378bbd0960f38403f40cb3", "score": "0.54001683", "text": "def generate_app\n folder = \"#{@build_dir}/#{@app_name}\"\n FileUtils.rm_rf folder\n FileUtils::mkdir_p folder\n\n @platforms.each do |p|\n FileUtils::mkdir_p folder + \"/#{p}\"\n if p.start_with? 'osx'\n FileUtils::copy_entry \"#{@cache_dir}/#{@latest_version}/#{p}/nwjs.app\", \"#{folder}/#{p}/#{@app_name}.app\"\n FileUtils::cp \"#{@build_dir}/app.nw\", \"#{folder}/#{p}/#{@app_name}.app/Contents/Resources/app.nw\"\n elsif p.start_with? 'win'\n FileUtils::copy_entry \"#{@cache_dir}/#{@latest_version}/#{p}\", \"#{folder}/#{p}/#{@app_name}\"\n FileUtils::cp \"#{@build_dir}/app.nw\", \"#{folder}/#{p}/#{@app_name}/package.nw\"\n elsif p.start_with? 'linux'\n FileUtils::copy_entry \"#{@cache_dir}/#{@latest_version}/#{p}\", \"#{folder}/#{p}/#{@app_name}\"\n FileUtils::cp \"#{@build_dir}/app.nw\", \"#{folder}/#{p}/#{@app_name}/package.nw\"\n end\n end\nend", "title": "" }, { "docid": "ddbc981c7021be2a677d22fbcf14c2f2", "score": "0.53947854", "text": "def minimize!\n replace minimize\n end", "title": "" }, { "docid": "705fb585aa2951fcb54a13b0f02a6758", "score": "0.53903884", "text": "def store_release\n # Need both so that sprockets can recompile all assets for device and browser.\n ENV['PRECOMPILE_TARGET'] = 'browser'\n ENV['BROWSER_RELEASE_VERSION'] = 'store_b.0.0'\n respond_to do |format|\n format.mobile {render :template => \"app/app\"}\n end\n end", "title": "" }, { "docid": "55b46c1a1268bf7a485825e6f6b8ac1d", "score": "0.5378336", "text": "def compress()\nend", "title": "" }, { "docid": "a79e15dcea7ac3c4d542318b5dba8ebc", "score": "0.5368329", "text": "def clean_up\n FileUtils.rm(\n Dir.glob('build/{src,lib}.{rb,c,js}') +\n Dir.glob('build/ruby2d-opal.{rb,js}') +\n Dir.glob('build/app.c')\n )\nend", "title": "" }, { "docid": "fef95a568c73c825fc08c826c493e36e", "score": "0.5360951", "text": "def compile_all\n preprocess_scripts\n preprocess_styles\n preprocess_slim\n copy_mp3\n self\n end", "title": "" }, { "docid": "b42f0bb0cc712793a85ab4d59a02eab7", "score": "0.5356695", "text": "def assemble(filename = nil, minify = true)\n fname = filename || \"tmp.min.js\"\n FileUtils.mkdir_p(File.dirname(fname))\n\n # Merge files\n merger = Juicer::Merger::JavaScriptMerger.new(scripts)\n merger.save(fname)\n\n # Minify\n if minify\n begin\n path = File.join(Juicer.home, \"lib/yui_compressor/bin\")\n minifyer = Juicer::Minifyer::YuiCompressor.new(:bin_path => path)\n minifyer.save(fname, fname)\n rescue Exception => e\n puts e.message\n exit\n end\n end\n\n # TMP: Correct YUIC mistake on regexes\n contents = File.read(fname)\n\n File.open(fname, 'w') do |file|\n contents.gsub!(/\\(\\^\\|\\\\s\\)/, \"(^|\\\\\\\\\\\\s)\")\n contents.gsub!(/\\(\\\\s\\|\\$\\)/, \"(\\\\\\\\\\\\s|$)\")\n\n license = <<EOF\n/**\n * TERMS OF USE - Validatious 2.0\n * Open source under the BSD License.\n * Copyright 2008-2009 Christian Johansen.\n * All rights reserved.\n */\nEOF\n\n file.puts license + contents\n end\n\n # Print confirmation\n if $verbose\n size = File::Stat.new(fname).size / 1024.0\n puts \"Produced #{fname}, #{sprintf '%.2f' % size} kB\"\n end\n\n # Delete file if temporary\n File.delete(fname) if filename.nil?\n contents\n end", "title": "" }, { "docid": "0f828e39ac6c0cb39ceb456b5ed44912", "score": "0.5356249", "text": "def warmup; end", "title": "" }, { "docid": "865e9f3035e62dc7dcdf281cc2794200", "score": "0.5354323", "text": "def uglify(source, mangle: false)\n sh \"#{'ruby ' if Gem.win_platform?}bin/yarn -s run terser -c #{'-m' if mangle}\", data: source\n end", "title": "" }, { "docid": "9d92d2025ed5b9129e041c1867cbe97e", "score": "0.5344565", "text": "def compress_js_minjs(content)\n require 'minjs'\n Minjs::Compressor::Compressor.new(:debug => false).compress(content).to_js\n end", "title": "" }, { "docid": "c83ba68ec9a809b4a38709765f084bc9", "score": "0.53379357", "text": "def app_js\n dist(%r{^#{name}.*js$})\n end", "title": "" }, { "docid": "4d2a538661fff382793e5f6743933791", "score": "0.53223205", "text": "def minify(source)\n source.gsub(/([;{}])\\s*\\n+\\s*/, '\\1')\nend", "title": "" }, { "docid": "7b3e34691bfb9f2bd4419612d47af939", "score": "0.5320568", "text": "def generate_files\n system(\"gem list '^rails$' --installed --version '#{version_constraint}' || \" \\\n \"gem install rails --clear-sources --source http://rubygems.org --version '#{version_constraint}'\")\n\n @version = RailsVersion.new(`ruby -e 'puts Gem::Specification.find_by_name(\"rails\", \"#{version_constraint}\").version'`.chomp)\n\n skips = %w(--skip-bundle --skip-javascript --skip-sprockets --skip-spring --skip-listen --skip-system-test)\n\n system(\"rails _#{version}_ new #{application.root} #{skips.join(' ')}\")\n raise \"application generation failed\" unless application.exists?\n\n FileUtils.mkdir_p(application.gem_home)\n FileUtils.mkdir_p(application.user_home)\n FileUtils.rm_rf(application.path(\"test/performance\"))\n\n append_to_file(application.gemfile, \"gem 'spring', '#{Spring::VERSION}'\")\n\n append_to_file(application.path(\"config/boot.rb\"), \"raise 'BOOM' if ENV['CRASH_ON_BOOT']\")\n\n rewrite_file(application.gemfile) do |c|\n c.sub!(\"https://rubygems.org\", \"http://rubygems.org\")\n c.gsub!(/(gem '(byebug|web-console|sdoc|jbuilder)')/, \"# \\\\1\")\n\n c\n end\n\n rewrite_file(application.path(\"config/environments/test.rb\")) do |c|\n c.sub!(/config\\.cache_classes\\s*=\\s*true/, \"config.cache_classes = false\")\n c\n end\n\n if application.path(\"bin\").exist?\n FileUtils.cp_r(application.path(\"bin\"), application.path(\"bin_original\"))\n end\n end", "title": "" }, { "docid": "e98f11649091fc395c11da4cb30e0c44", "score": "0.53162426", "text": "def light_minify(lua_code)\n lua_code_lines = lua_code.lines.reject do |l|\n l.strip.start_with?('--') || l.strip.empty?\n end\n lua_code_lines.join\n end", "title": "" }, { "docid": "37d8e69fdc7750f2fe88f44df91c93f7", "score": "0.5312694", "text": "def compress!\n command = TOOL_NAMES.inject('imageoptim') do |command, (name, param)|\n if options[:tools][name]\n command = \"#{command} --#{param}\"\n end\n command\n end\n result = system \"#{command} --quit #{directory_parameter}\"\n raise \"File compression error.\" unless result\n end", "title": "" }, { "docid": "18ff962cc14182a29ecd1425c0cb6f12", "score": "0.53077954", "text": "def compress\n yui_compressor.compress(self)\n end", "title": "" }, { "docid": "5a429c2009f9e75d621e46ae92afe0a2", "score": "0.5307071", "text": "def generate\n banner\n \n # Load our plugins and filters\n load_plugins\n load_filters\n \n # Prepare public folder\n prepare(true)\n \n load_content\n \n process_attachments\n \n compile_assets\n \n render\n \n cleanup\n \n compress\n \n # Store cached version of configuration\n cached_config = File.join(storage.path(:cache), \"config.yml\")\n @config.write_cache(cached_config)\n end", "title": "" }, { "docid": "27a7ec43e728e81a33d280ab7bc54152", "score": "0.5297836", "text": "def pack(dir = nil)\n logger.info \"packing the Jimfile for this project\"\n vendor(dir)\n bundle\n compress\n end", "title": "" }, { "docid": "6615a77c37db57066db70b9a469f0580", "score": "0.52965134", "text": "def createZippedDSYM\n root_folder_path = \"Executables/#{@bundle_identifier}\"\n \n # Copy the original\n dsym_name = \"#{@application_name}.#{DSYM_EXTENSION}\"\n FileUtils.cp_r \"#{BUILD_FOLDER_PATH}/#{dsym_name}\", \"Executables/#{@bundle_identifier}/#{dsym_name}\"\n \n # compress the dsym file\n system(\"cd '#{root_folder_path}'; tar -cvzpf '#{dsym_name}.tgz' '#{dsym_name}'\")\n\n #remove the old dsym dir\n FileUtils.rmtree(\"#{root_folder_path}/#{dsym_name}\")\n \nend", "title": "" }, { "docid": "0892a7c128ebfea6643617858b8180a8", "score": "0.5292743", "text": "def minify_sources(shaders, rewriteall)\n names = [*(\"A\"..\"Z\"), *(\"AA\"..\"ZZ\"), *(\"aA\"..\"zZ\"), *(\"Aa\"..\"Zz\"), *(\"Aa\"..\"ZZ\"), *(\"A0\"..\"Z9\")]\n datatypes = [\"float\",\"double\",\"u?int\",\"void\",\"bool\",\"d?mat[2-4](?:x[2-4])?\",\"[ibdu]?vec[2-4]\",\"[iu]?(?:sampler|image)(?:[1-3]D|Cube|Buffer)(?:MSArray|MS|RectShadow|Rect|ArrayShadow|Shadow|Array)?\"]\n language_words = [\"attribute\",\"const\",\"uniform\",\"varying\",\"buffer\",\"shared\",\"coherent\",\"volatile\",\"restrict\",\"readonly\",\"writeonly\",\"atomic_uint\",\"layout\",\"centroid\",\"flat\",\"smooth\",\"noperspective\",\"patch\",\"sample\",\"break\",\"continue\",\"do\",\"for\",\"while\",\"switch\",\"case\",\"default\",\"if\",\"else\",\"subroutine\",\"in\",\"out\",\"inout\",\"float\",\"double\",\"int\",\"void\",\"bool\",\"true\",\"false\",\"invariant\",\"discard\",\"return\",\"mat2\",\"mat3\",\"mat4\",\"dmat2\",\"dmat3\",\"dmat4\",\"mat2x2\",\"mat2x3\",\"mat2x4\",\"dmat2x2\",\"dmat2x3\",\"dmat2x4\",\"mat3x2\",\"mat3x3\",\"mat3x4\",\"dmat3x2\",\"dmat3x3\",\"dmat3x4\",\"mat4x2\",\"mat4x3\",\"mat4x4\",\"dmat4x2\",\"dmat4x3\",\"dmat4x4\",\"vec2\",\"vec3\",\"vec4\",\"ivec2\",\"ivec3\",\"ivec4\",\"bvec2\",\"bvec3\",\"bvec4\",\"dvec2\",\"dvec3\",\"dvec4\",\"uint\",\"uvec2\",\"uvec3\",\"uvec4\",\"lowp\",\"mediump\",\"highp\",\"precision\",\"sampler1D\",\"sampler2D\",\"sampler3D\",\"samplerCube\",\"sampler1DShadow\",\"sampler2DShadow\",\"samplerCubeShadow\",\"sampler1DArray\",\"sampler2DArray\",\"sampler1DArrayShadow\",\"sampler2DArrayShadow\",\"isampler1D\",\"isampler2D\",\"isampler3D\",\"isamplerCube\",\"isampler1DArray\",\"isampler2DArray\",\"usampler1D\",\"usampler2D\",\"usampler3D\",\"u\",\"samplerCube\",\"usampler1DArray\",\"usampler2DArray\",\"sampler2DRect\",\"sampler2DRectShadow\",\"isampler2DRect\",\"usampler2DRect\",\"samplerBuffer\",\"isamplerBuffer\",\"usamplerBuffer\",\"sampler2DMS\",\"isampler2DMS\",\"usampler2DMS\",\"sampler2DMSArray\",\"isampler2DMSArray\",\"usampler2DMSArray\",\"samplerCubeArray\",\"samplerCubeArrayShadow\",\"isamplerCubeArray\",\"usamplerCubeArray\",\"image1D\",\"iimage1D\",\"uimage1D\",\"image2D\",\"iimage2D\",\"uimage2D\",\"image3D\",\"iimage3D\",\"uimage3D\",\"image2DRect\",\"iimage2DRect\",\"uimage2DRect\",\"imageCube\",\"iimageCube\",\"uimageCube\",\"imageBuffer\",\"iimageBuffer\",\"uimageBuffer\",\"image1DArray\",\"iimage1DArray\",\"uimage1DArray\",\"image2DArray\",\"iimage2DArray\",\"uimage2DArray\",\"imageCubeArray\",\"iimageCubeArray\",\"uimageCubeArray\",\"image2DMS\",\"iimage2DMS\",\"uimage2DMS\",\"image2DMSArray\",\"iimage2DMSArray\",\"uimage2DMSArray\",\"struct\",\"gl_VertexID\",\"gl_InstanceID\",\"gl_PerVertex\",\"gl_Position\",\"gl_PointSize\",\"gl_ClipDistance\",\"gl_PatchVerticesIn\",\"gl_PrimitiveID\",\"gl_InvocationID\",\"gl_TessLevelOuter\",\"gl_TessLevelInner\",\"gl_TessCoord\",\"gl_PrimitiveIDIn\",\"gl_Layer\",\"gl_ViewportIndex\",\"gl_FragCoord\",\"gl_FrontFacing\",\"gl_PointCoord\",\"gl_SampleID\",\"gl_SamplePosition\",\"gl_SampleMaskIn\",\"gl_FragDepth\",\"gl_SampleMask\",\"gl_NumWorkGroups\",\"gl_WorkGroupSize\",\"gl_LocalGroupSize\",\"gl_WorkGroupID\",\"gl_LocalInvocationID\",\"gl_GlobalInvocationID\",\"gl_LocalInvocationIndex\",\"gl_MaxComputeWorkGroupCount\",\"gl_MaxComputeWorkGroupSize\",\"gl_MaxComputeUniformComponents\",\"gl_MaxComputeTextureImageUnits\",\"gl_MaxComputeImageUniforms\",\"gl_MaxComputeAtomicCounters\",\"gl_MaxComputeAtomicCounterBuffers\",\"gl_MaxVertexAttribs\",\"gl_MaxVertexUniformComponents\",\"gl_MaxVaryingComponents\",\"gl_MaxVertexOutputComponents\",\"gl_MaxGeometryInputComponents\",\"gl_MaxGeometryOutputComponents\",\"gl_MaxFragmentInputComponents\",\"gl_MaxVertexTextureImageUnits\",\"gl_MaxCombinedTextureImageUnits\",\"gl_MaxTextureImageUnits\",\"gl_MaxImageUnits\",\"gl_MaxCombinedImageUnitsAndFragmentOutputs\",\"gl_MaxImageSamples\",\"gl_MaxVertexImageUniforms\",\"gl_MaxTessControlImageUniforms\",\"gl_MaxTessEvaluationImageUniforms\",\"gl_MaxGeometryImageUniforms\",\"gl_MaxFragmentImageUniforms\",\"gl_MaxCombinedImageUniforms\",\"gl_MaxFragmentUniformComponents\",\"gl_MaxDrawBuffers\",\"gl_MaxClipDistances\",\"gl_MaxGeometryTextureImageUnits\",\"gl_MaxGeometryOutputVertices\",\"gl_MaxGeometryTotalOutputComponents\",\"gl_MaxGeometryUniformComponents\",\"gl_MaxGeometryVaryingComponents\",\"gl_MaxTessControlInputComponents\",\"gl_MaxTessControlOutputComponents\",\"gl_MaxTessControlTextureImageUnits\",\"gl_MaxTessControlUniformComponents\",\"gl_MaxTessControlTotalOutputComponents\",\"gl_MaxTessEvaluationInputComponents\",\"gl_MaxTessEvaluationOutputComponents\",\"gl_MaxTessEvaluationTextureImageUnits\",\"gl_MaxTessEvaluationUniformComponents\",\"gl_MaxTessPatchComponents\",\"gl_MaxPatchVertices\",\"gl_MaxTessGenLevel\",\"gl_MaxViewports\",\"gl_MaxVertexUniformVectors\",\"gl_MaxFragmentUniformVectors\",\"gl_MaxVaryingVectors\",\"gl_MaxVertexAtomicCounters\",\"gl_MaxTessControlAtomicCounters\",\"gl_MaxTessEvaluationAtomicCounters\",\"gl_MaxGeometryAtomicCounters\",\"gl_MaxFragmentAtomicCounters\",\"gl_MaxCombinedAtomicCounters\",\"gl_MaxAtomicCounterBindings\",\"gl_MaxVertexAtomicCounterBuffers\",\"gl_MaxTessControlAtomicCounterBuffers\",\"gl_MaxTessEvaluationAtomicCounterBuffers\",\"gl_MaxGeometryAtomicCounterBuffers\",\"gl_MaxFragmentAtomicCounterBuffers\",\"gl_MaxCombinedAtomicCounterBuffers\",\"gl_MaxAtomicCounterBufferSize\",\"gl_MinProgramTexelOffset\",\"gl_MaxProgramTexelOffset\",\"gl_MaxTransformFeedbackBuffers\",\"gl_MaxTransformFeedbackInterleavedComponents\",\"radians\",\"degrees\",\"sin\",\"cos\",\"tan\",\"asin\",\"acos\",\"atan\",\"sinh\",\"cosh\",\"tanh\",\"asinh\",\"acosh\",\"atanh\",\"pow\",\"exp\",\"log\",\"exp2\",\"log2\",\"sqrt\",\"inversesqrt\",\"abs\",\"sign\",\"floor\",\"trunc\",\"round\",\"roundEven\",\"ceil\",\"fract\",\"mod\",\"modf\",\"min\",\"max\",\"clamp\",\"mix\",\"step\",\"smoothstep\",\"isnan\",\"isinf\",\"floatBitsToInt\",\"floatBitsToUint\",\"intBitsToFloat\",\"uintBitsToFloat\",\"fma\",\"frexp\",\"ldexp\",\"packUnorm2x16\",\"packSnorm2x16\",\"packUnorm4x8\",\"packSnorm4x8\",\"unpackUnorm2x16\",\"unpackSnorm2x16\",\"unpackUnorm4x8\",\"unpackSnorm4x8\",\"packDouble2x32\",\"unpackDouble2x32\",\"packHalf2x16\",\"unpackHalf2x16\",\"length\",\"distance\",\"dot\",\"cross\",\"normalize\",\"faceforward\",\"reflect\",\"refract\",\"matrixCompMult\",\"outerProduct\",\"transpose\",\"determinant\",\"inverse\",\"lessThan\",\"lessThanEqual\",\"greaterThan\",\"greaterThanEqual\",\"equal\",\"notEqual\",\"any\",\"all\",\"not\",\"uaddCarry\",\"usubBorrow\",\"umulExtended\",\"imulExtended\",\"bitfieldExtract\",\"bitfieldReverse\",\"bitfieldInsert\",\"bitCount\",\"findLSB\",\"findMSB\",\"atomicCounterIncrement\",\"atomicCounterDecrement\",\"atomicCounter\",\"atomicOP\",\"imageSize\",\"imageLoad\",\"imageStore\",\"imageAtomicAdd\",\"imageAtomicMin\",\"imageAtomicMax\",\"imageAtomicAnd\",\"mageAtomicOr\",\"imageAtomicXor\",\"imageAtomicExchange\",\"imageAtomicCompSwap\",\"dFdx\",\"dFdy\",\"fwidth\",\"interpolateAtCentroid\",\"interpolateAtSample\",\"interpolateAtOffset\",\"noise1\",\"noise2\",\"noise3\",\"noise4\",\"EmitStreamVertex\",\"EndStreamPrimitive\",\"EmitVertex\",\"EndPrimitive\",\"barrier\",\"memoryBarrier\",\"groupMemoryBarrier\",\"memoryBarrierAtomicCounter\",\"memoryBarrierShared\",\"memoryBarrierBuffer\",\"memoryBarrierImage\",\"textureSize\",\"textureQueryLod\",\"textureQueryLevels\",\"texture\",\"textureProj\",\"textureLod\",\"tureOffset\",\"texelFetch\",\"texelFetchOffset\",\"textureProjOffset\",\"textureLodOffset\",\"textureProjLod\",\"textureProjLodOffset\",\"textureGrad\",\"textureGradOffset\",\"textureProjGrad\",\"textureProjGradOffset\",\"textureGather\",\"textureGatherOffset\",\"textureGatherOffsets\",\"texture2D\",\"texture2DProj\",\"texture2DLod\",\"texture2DProjLod\",\"textureCube\",\"textureCubeLod\"] + gen_sizzle_permutations()\n structs = []\n defines = []\n functions = []\n uniforms = []\n attributes = []\n varyings = []\n constants = [];\n members = [];\n \n shaders.map! { |shader|\n remove_comments(shader)\n remove_whitespace(shader)\n }\n \n # Get struct names\n shaders.each { |shader|\n structs += get_struct_names(shader)\n }\n \n # Create a regex of all the known data types\n datatypes_string = datatypes.concat(structs).join(\"|\")\n \n # Remove dead functions that are not in the call graph of the main() function in any of the inputs\n remove_dead_functions(shaders, datatypes_string)\n \n # Get all function/uniform/attribute/varying names, and define names and their values\n shaders.each { |shader|\n functions += get_function_names(shader, datatypes_string)\n uniforms += get_variable_names(shader, \"uniform\", datatypes_string)\n attributes += get_variable_names(shader, \"attribute\", datatypes_string)\n varyings += get_variable_names(shader, \"varying\", datatypes_string)\n constants += get_variable_names(shader, \"const\", datatypes_string)\n defines += get_defines(shader)\n members += get_member_names(shader, datatypes_string);\n }\n \n function_map = gen_map(functions, names, true)\n struct_map = gen_map(structs, names, true)\n uniform_map = gen_map(uniforms, names, rewriteall)\n attribute_map = gen_map(attributes, names, rewriteall)\n varyings_map = gen_map(varyings, names, true)\n constants_map = gen_map(constants, names, true)\n member_map = gen_map_map(members, [*(\"a\"..\"z\"), *(\"A\"..\"Z\"), *(\"aa\"..\"zz\")], rewriteall)\n \n language_words = language_words.uniq().map { |v|\n [v, names.shift()]\n }\n \n # Preprocess #defines to prepare them for inlining\n preprocess_defines(defines)\n \n shaders.map! { |shader|\n # Inline #defines\n inline_defines(defines, shader)\n \n shader = group_globals(shader, datatypes_string)\n \n # Rewrite function names\n function_map.each { |function|\n shader.gsub!(/\\b#{function[0]}\\b/, function[1])\n }\n \n # Rename function arguments and local variables\n shader = rename_locals(shader, datatypes_string)\n \n # Rewrite user defined type names\n struct_map.each { |struct|\n shader.gsub!(/\\b#{struct[0]}\\b/, struct[1])\n }\n \n # Rewrite uniform names\n rewrite_map(uniform_map, shader)\n \n # Rewrite attribute names\n rewrite_map(attribute_map, shader)\n \n # Rewrite varying names\n rewrite_map(varyings_map, shader)\n \n # Rewrite varying names\n rewrite_map(constants_map, shader)\n \n # Rewrite struct member names\n shader = rename_members(shader, member_map, datatypes_string)\n \n # Rewrite numbers\n rewrite_numbers(shader)\n \n shader = add_defines(shader, language_words)\n \n shader = remove_whitespace(shader).gsub(\"\\n\", \"\\\\n\")\n \n # If the first line of a shader is a pre-processor directive, it will cause an error when concatenating it, so add a new line\n if shader[0] == \"#\"\n shader = \"\\\\n\" + shader\n end\n \n shader\n }\n \n global_map = {}\n \n uniform_map.concat(attribute_map).each { |v|\n global_map[v[0]] = v[1]\n }\n \n return [shaders, global_map, member_map]\nend", "title": "" }, { "docid": "503a6d48ba789e593316ecfc1e7dfd01", "score": "0.528868", "text": "def light_minify(lua_code)\n lua_code_lines = lua_code.lines.reject do |l|\n l = l.strip\n l.start_with?('--') || l.empty?\n end\n lua_code_lines.join\n end", "title": "" }, { "docid": "4c775cc2a367a3ec684b504c25c734b3", "score": "0.52854204", "text": "def compile_assets\n Dir.glob(File.join(Bartender::DEFAULTS[\"output\"], '/**/*')).each {|asset| File.delete(asset) unless File.directory?(asset)}#delete the old files\n Dir.glob(File.join(Bartender::DEFAULTS[\"assets\"], '/**/*')).each do |asset|\n asset.gsub!(/\\..*$/, '') unless asset.scan(\"images\").length > 0 #remove the extensions, let's let sprockets tell us what the final extension should be\n compile_asset(asset)\n end\n end", "title": "" }, { "docid": "ddc4e364b4ec18d4ecb24db0a0d715b5", "score": "0.52738357", "text": "def minify_css(file, dest_file)\r\n puts \"Minifying #{file} into #{dest_file}\"\r\n\r\n minification = `java -jar yuicompressor-2.4.2.jar --type css --charset utf-8 #{file}`\r\n css = File.new(dest_file, \"w\")\r\n css.write(minification)\r\n css.close\r\nend", "title": "" }, { "docid": "4509a8bd50105787b8fe280a52cc3645", "score": "0.52704245", "text": "def force_build_all\n packages = manifest.all_layout_packages\n rebuild_packages(packages, packages)\n end", "title": "" }, { "docid": "f0e652aa1094f2222444f1e784fc1a38", "score": "0.52676576", "text": "def compile\n cleanup\n compass_build\n sprockets_build\n mustache_build\n end", "title": "" }, { "docid": "954223d61d6f268a9b30d3ae7335aacf", "score": "0.52611476", "text": "def update_app\n in_root do\n run(\"echo 'a' | rake rails:update:scripts\")\n run(\"echo 'a' | rake rails:update:javascripts\")\n run(\"echo 'a' | rake rails:update:configs\")\n run(\"echo 'a' | rake rails:update:application_controller\")\n\n if @javascript_library != \"prototype\"\n run \"rm public/javascripts/controls.js\"\n run \"rm public/javascripts/dragdrop.js\"\n run \"rm public/javascripts/effects.js\"\n run \"rm public/javascripts/prototype.js\"\n end\n end\nend", "title": "" }, { "docid": "954223d61d6f268a9b30d3ae7335aacf", "score": "0.52611476", "text": "def update_app\n in_root do\n run(\"echo 'a' | rake rails:update:scripts\")\n run(\"echo 'a' | rake rails:update:javascripts\")\n run(\"echo 'a' | rake rails:update:configs\")\n run(\"echo 'a' | rake rails:update:application_controller\")\n\n if @javascript_library != \"prototype\"\n run \"rm public/javascripts/controls.js\"\n run \"rm public/javascripts/dragdrop.js\"\n run \"rm public/javascripts/effects.js\"\n run \"rm public/javascripts/prototype.js\"\n end\n end\nend", "title": "" }, { "docid": "9ea4f86eed561f3ab7758e75293efb48", "score": "0.52574563", "text": "def optimize_images!\n Image::ImageMinifier.minify_all(self, true)\n end", "title": "" }, { "docid": "da83d95880061ff3ece6e9b989545910", "score": "0.52565503", "text": "def pre_build\n puts \"Prebuild: #{pwd}\"\n mkdir_p \"dist/lib/shoes\"\n Dir.chdir \"dist/lib/shoes\" do\n Dir[\"../../../lib/shoes/*.rb\"].each do |f|\n #puts \"SymLinking #{f}\"\n ln_s f, \".\" unless File.symlink? File.basename(f)\n end\n end\n Dir.chdir \"dist/lib\" do\n ln_s \"../../lib/shoes.rb\" , \"shoes.rb\" unless File.symlink? \"shoes.rb\"\n # link to exerb\n ln_s \"../../lib/exerb\", \"exerb\" unless File.symlink? \"exerb\"\n end\n cp_r \"fonts\", \"dist/fonts\"\n cp_r \"samples\", \"dist/samples\"\n Dir.chdir \"dist\" do\n ln_s \"../static\", \".\" unless File.symlink? 'static'\n end\n #cp_r \"static\", \"dist/static\"\n cp \"README.md\", \"dist/README.txt\"\n cp \"CHANGELOG\", \"dist/CHANGELOG.txt\"\n cp \"COPYING\", \"dist/COPYING.txt\"\n end", "title": "" }, { "docid": "b9977dc4b85a244971a83dcf6ddf94f8", "score": "0.52519155", "text": "def sprockets_build(sprocket_assets = [:javascripts, :stylesheets])\n sprocket_assets.each do |asset_type|\n load_path = File.join(@project_root, asset_type.to_s)\n next unless File.exists?(load_path)\n sprockets_env.append_path load_path\n Dir.new(load_path).each do |filename|\n file = File.join(load_path, filename)\n if File.file?(file)\n asset = sprockets_env[filename]\n attributes = sprockets_env.find_asset(asset.pathname)\n # logical_path is the filename\n build_file = File.join(build_path, asset_type.to_s, attributes.logical_path)\n File.open(build_file, 'w') do |f|\n extension = attributes.logical_path.split(\".\").last\n f.write(minify(asset, extension))\n end\n end\n end\n end\n end", "title": "" }, { "docid": "5376d1b096d312f3e582a211cd6b204f", "score": "0.5248884", "text": "def clean_app()\n wd = FileUtils.pwd()\n FileUtils.rm_f( [\n '/app/assets/*',\n '/app/components/*',\n '/app/controllers/*',\n '/app/helpers/*',\n '/app/models/*',\n '/app/views/*'\n ].collect!{|e| Dir.glob(wd + e)}.flatten.compact )\n end", "title": "" }, { "docid": "18b5db075612ac59b24014194d88e5a6", "score": "0.52415365", "text": "def pack_javascripts(package)\n @compressor.compress_js(package_for(package, :js)[:paths])\n end", "title": "" }, { "docid": "a6b2c68adc15fb41c965f4bd3be2dc71", "score": "0.5236443", "text": "def compress(source = '', length = 5000)\n source = source.respond_to?(:read) ? source.read : source.to_s\n \n js = []\n js << \"var result = '';\"\n js << \"var length = #{length};\"\n js << \"var source = #{MultiJson.dump(source)};\"\n js << \"result = YAHOO.compressor.cssmin(source, length);\" \n js << \"return result;\"\n \n @context.exec js.join(\"\\n\")\n end", "title": "" }, { "docid": "eb55e1297823fd3e7d819649bd970e6c", "score": "0.52311546", "text": "def perform\n log system_messages[:mysqldump]; log system_messages[:compressing]\n run \"#{mysqldump} -u #{user} --password='#{password}' #{options} #{additional_options} #{database} #{tables_to_include} #{tables_to_skip} | gzip -f --best > #{File.join(tmp_path, compressed_file)}\"\n end", "title": "" }, { "docid": "6cb9e1c0d9d4af0739dde6a1c3167492", "score": "0.5225943", "text": "def finalize_application\n \n return if skip_method(__method__)\n\n # integrate the angular libs into the application.js in the right order\n filename = \"application.js\"\n \n puts \"finalize rails application.js\"\n \n template = File.read(template(\"ng/application.js.erb\"))\n \n text = Erubis::Eruby.new(template).evaluate( self )\n \n write_asset(filename,text) \n end", "title": "" }, { "docid": "c240d249424a17ff88837318b38de8dd", "score": "0.5223726", "text": "def generate\n start_time = Time.now.to_f\n\n env.each_logical_path do |logical_path|\n if File.basename(logical_path)[/[^\\.]+/, 0] == 'index'\n logical_path.sub!(/\\/index\\./, '.')\n end\n next unless compile_path?(logical_path)\n\n if digest_path = @digests[logical_path]\n abs_digest_path = \"#{@target}/#{digest_path}\"\n abs_logical_path = \"#{@target}/#{logical_path}\"\n\n # Remove known digests from css & js\n if abs_digest_path.match(/\\.(?:js|css)$/)\n mtime = File.mtime(abs_digest_path)\n\n asset_body = File.read(abs_digest_path)\n\n # Find all hashes in the asset body with a leading '-'\n asset_body.gsub!(DIGEST_REGEX) do |match|\n # Only remove if known digest\n $1.in?(@asset_digests.values) ? '' : match\n end\n\n # Write non-digest file\n File.open abs_logical_path, 'w' do |f|\n f.write asset_body\n end\n # Set modification and access times\n File.utime(File.atime(abs_digest_path), mtime, abs_logical_path)\n\n # Also write gzipped asset\n File.open(\"#{abs_logical_path}.gz\", 'wb') do |f|\n gz = Zlib::GzipWriter.new(f, Zlib::BEST_COMPRESSION)\n gz.mtime = mtime.to_i\n gz.write asset_body\n gz.close\n end\n\n env.logger.debug \"Stripped digests, copied to #{logical_path}, and created gzipped asset\"\n\n else\n # Otherwise, treat file as binary and copy it.\n # Ignore paths that have no digests, such as READMEs\n unless !File.exist?(abs_digest_path) || abs_digest_path == abs_logical_path\n FileUtils.cp_r abs_digest_path, abs_logical_path, :remove_destination => true\n env.logger.debug \"Copied binary asset to #{logical_path}\"\n\n # Copy gzipped asset if exists\n if File.exist? \"#{abs_digest_path}.gz\"\n FileUtils.cp_r \"#{abs_digest_path}.gz\", \"#{abs_logical_path}.gz\", :remove_destination => true\n env.logger.debug \"Copied gzipped asset to #{logical_path}.gz\"\n end\n end\n end\n end\n end\n\n\n elapsed_time = ((Time.now.to_f - start_time) * 1000).to_i\n env.logger.debug \"Generated non-digest assets in #{elapsed_time}ms\"\n end", "title": "" }, { "docid": "95401199c6f52ec97ae6ce5116e7d879", "score": "0.5215629", "text": "def freeze_app; end", "title": "" }, { "docid": "95401199c6f52ec97ae6ce5116e7d879", "score": "0.5215629", "text": "def freeze_app; end", "title": "" }, { "docid": "95401199c6f52ec97ae6ce5116e7d879", "score": "0.5215629", "text": "def freeze_app; end", "title": "" }, { "docid": "def5d7c652b064f26e2f8de591320579", "score": "0.5214412", "text": "def manifest; end", "title": "" } ]
fe1d2e1f14b98b8529f46acdb67edb13
DELETE /deliveries/1 DELETE /deliveries/1.json
[ { "docid": "66ccce34383c7de068420f23dd93a844", "score": "0.0", "text": "def destroy\n @delivery = Delivery.find(params[:id])\n order = Order.find(@delivery.order_id)\n order.order_items.each do |order_item|\n ordered_item = OrderedItem.find_by sale_item_id: order_item.sale_item_id\n a = SaleItem.find(order_item.sale_item_id)\n a.amount += order_item.quantity\n a.save\n User.find(SaleItem.find(order_item.sale_item_id).user_id).ordered_items.find(ordered_item.id).destroy\n ordered_item.destroy\n end\n @delivery.destroy\n respond_to do |format|\n format.html { redirect_to profile_url, notice: 'Order was successfully canceled.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "7385e655a7593360c652be872eb0c48f", "score": "0.74534893", "text": "def destroy\n @deliverable = Deliverable.find(params[:id])\n @deliverable.destroy\n\n respond_to do |format|\n format.html { redirect_to deliverables_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "e34a91116f8a2fd192bf0ea471a4c0f4", "score": "0.73382974", "text": "def destroy\n @delivery = Delivery.find(params[:id])\n @delivery.destroy\n\n respond_to do |format|\n format.html { redirect_to deliveries_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "efb56cd5a366196ee1c85ea83012fd6c", "score": "0.7329342", "text": "def destroy\n @deliverable.destroy\n respond_to do |format|\n format.html { redirect_to deliverables_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ca826477649564d9f80482736f7c0a37", "score": "0.73278344", "text": "def destroy\n @deliverable = Deliverable.find(params[:id])\n @deliverable.destroy\n\n respond_to do |format|\n format.html { render :layout => false }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d705a7db31abe5b471e10937ba940bd9", "score": "0.7321378", "text": "def destroy\n @deliverable = Deliverable.find(params[:id])\n #delete deliverable from database\n @deliverable.destroy\n\n respond_to do |format|\n format.html { redirect_to \"/deliverables/project_id/#{@deliverable.project_id}\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f449a6278ab0a690f5dcc5a4c27cb536", "score": "0.7313596", "text": "def destroy\n\n @delivery.destroy\n respond_to do |format|\n format.html { redirect_to admin_deliveries_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "aa5ea900a95f8749fd38ebf51ce98a4d", "score": "0.71031463", "text": "def destroy\n @delivery.destroy\n respond_to do |format|\n format.html { redirect_to deliveries_url, notice: 'Delivery was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "aa5ea900a95f8749fd38ebf51ce98a4d", "score": "0.71031463", "text": "def destroy\n @delivery.destroy\n respond_to do |format|\n format.html { redirect_to deliveries_url, notice: 'Delivery was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1de759ce874bb9753743113d22c48737", "score": "0.70944995", "text": "def destroy\n @delivery.destroy\n respond_to do |format|\n format.html { redirect_to deliveries_url, notice: \"Delivery was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f5a494fe1ac222920268848812b42b92", "score": "0.70350915", "text": "def destroy\n @content_delivery = ContentDelivery.find(params[:id])\n @content_delivery.destroy\n\n respond_to do |format|\n format.html { redirect_to content_deliveries_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "14647ac1d09863045963c29fb00569d9", "score": "0.69730926", "text": "def destroy\n @adhoc_deliverable = Deliverable.find(params[:id])\n #delete adhoc deliverable from database\n @adhoc_deliverable.destroy\n\n respond_to do |format|\n format.html { redirect_to adhoc_deliverables_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "236fa97e7a91b08aece79a295e0e5e09", "score": "0.68091464", "text": "def destroy\n @food_delivery.destroy\n respond_to do |format|\n format.html { redirect_to food_deliveries_url, notice: 'Food delivery was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d55d893a9a627b3e2725f4103c8efbf4", "score": "0.67724687", "text": "def destroy\n\n\n @delivery = Delivery.find(params[:id])\n \n company_id = @delivery[:company_id]\n\n \n @delivery.destroy \n respond_to do |format|\n format.html { redirect_to(\"/companies/deliveries/\" + company_id.to_s) }\n end\n \n\n end", "title": "" }, { "docid": "ddafdb5357ea8a6ddabdb9955a05d730", "score": "0.6747257", "text": "def destroy\n @delivery = Deliverymine.find(params[:id])\n company_id = @delivery[:company_id]\n @delivery.destroy\n\n respond_to do |format|\n format.html { redirect_to(\"/companies/deliveries/\" + company_id.to_s) }\n end\n end", "title": "" }, { "docid": "276617a52f5a5c697f508565bc2274bc", "score": "0.66916835", "text": "def destroy\n @delivery_address = DeliveryAddress.find(params[:id])\n @delivery_address.destroy\n\n respond_to do |format|\n format.html { redirect_to delivery_addresses_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a9cdf07abd2f7a88bb3bcc4c652167b8", "score": "0.66856426", "text": "def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end", "title": "" }, { "docid": "6d2c6843ef822360206b0cc1aea4c529", "score": "0.6579358", "text": "def destroy\n @deliveryinfo.destroy\n respond_to do |format|\n format.html { redirect_to deliveryinfos_url, notice: 'Deliveryinfo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9858aa9417248d07693c181ce536a06c", "score": "0.6526677", "text": "def destroy\n @typical_deliverable = TypicalDeliverable.find(params[:id])\n @typical_deliverable.destroy\n\n respond_to do |format|\n format.html { redirect_to(:controller => 'catalogs') }\n #format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "05c94afe24c6afb33adf6d700a0e0d13", "score": "0.65078795", "text": "def destroy\n @delivery_option.destroy\n respond_to do |format|\n format.html { redirect_to delivery_options_url, notice: 'Item apagado com sucesso.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c51b88a13332e48f129a8cffa9308776", "score": "0.6497426", "text": "def destroy\n \t@courier = Courier.find(params[:courier_id])\n @delivery = @courier.deliveries.find(params[:delivery_id])\n @dropoff = @delivery.dropoffs.find(params[:id])\n @dropoff.destroy\n\n respond_to do |format|\n format.html { redirect_to(dropoffs_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "4603aabef4eb21d83bb6dd3b23d2c267", "score": "0.64899486", "text": "def destroy\n @delivery_order = DeliveryOrder.find(params[:id])\n @delivery_order.destroy\n\n respond_to do |format|\n format.html { redirect_to delivery_orders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "10534004460575bcc0d44ef84cd279ad", "score": "0.64815664", "text": "def destroy\n @delivery_method = DeliveryMethod.find(params[:id])\n\n respond_to do |format|\n format.html { redirect_to delivery_methods_url, notice: \"Delivery Method #{@delivery_method.name} was removed.\" }\n format.json { head :no_content }\n end\n \n @delivery_method.destroy\n end", "title": "" }, { "docid": "689d5a07a403c4b765ba178e4aff08a3", "score": "0.64709675", "text": "def delete\n client.delete(\"/#{id}\")\n end", "title": "" }, { "docid": "7a5eea7c7a07ce3e7f95fa50802d596e", "score": "0.6468239", "text": "def delete path\n make_request(path, \"delete\", {})\n end", "title": "" }, { "docid": "de86aaec19a3d2268721968ac2c1d39c", "score": "0.6443194", "text": "def destroy_delivery\n Rails.logger.info \"Attempting to destroy deliverable_id = #{id} \" \\\n \"AND deliverable_type = '#{self.class}'\"\n Delivery.where(\"deliverable_id = #{id} AND deliverable_type = \" \\\n \"'#{self.class}'\").each(&:destroy)\n end", "title": "" }, { "docid": "59f95bf6559ea200132a81ba5f0bc55c", "score": "0.6433926", "text": "def destroy\n @item_delivery.record_activity(:delete, current_user, \"Deleted PO Delivery\")\n po = @item_delivery.purchase_order\n @item_delivery_id = @item_delivery.id\n @item_delivery.destroy\n respond_to do |format|\n format.html { redirect_to purchase_order_path(po) }\n format.json { head :no_content }\n format.js\n end\n end", "title": "" }, { "docid": "49d9c736e7ef53a93b48e115c4dd567d", "score": "0.642181", "text": "def destroy\n @ourmail.destroy\n respond_to do |format|\n format.html { redirect_to ourmails_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "522e787502895f0a05c9b2c6ca4e5ced", "score": "0.640864", "text": "def delete\n request(:delete)\n end", "title": "" }, { "docid": "7d0854e09a53c709ccd6eddea3ee902e", "score": "0.6406521", "text": "def destroy\n @customer_mailer.destroy\n respond_to do |format|\n format.html { redirect_to customer_mailers_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d13afa3c75d9626cc5ed2be1a7405e5e", "score": "0.63958687", "text": "def delete(address)\n \tMailgun.submit :delete, list_url(address)\n end", "title": "" }, { "docid": "f12282ab4f6cf924ae23cd752b9a5143", "score": "0.63683784", "text": "def destroy\n @bussiness.destroy\n respond_to do |format|\n format.html { redirect_to bussinesses_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c789ac1ac0d0b49d2a9015a659a63f0a", "score": "0.6359737", "text": "def destroy\n @recipient.destroy\n respond_to do |format|\n format.html { redirect_to recipients_url, notice: '送付先情報を削除しました。' }\n format.json { head :no_content }\n end\nend", "title": "" }, { "docid": "ba67ebd85114998e01be10599c8943ca", "score": "0.63566655", "text": "def delete(path)\n RestClient.delete request_base+path\n end", "title": "" }, { "docid": "f245842fcfaa8d5c260b26307489641d", "score": "0.6354128", "text": "def delete(id)\n Mailgun.submit :delete, webhook_url(id)\n end", "title": "" }, { "docid": "1610d01b4c5552c7da6a9da29715e426", "score": "0.63515466", "text": "def destroy\n @test_dep_collector.destroy\n respond_to do |format|\n format.html {redirect_to test_dep_collectors_url, notice: 'Test dep collector was successfully destroyed.'}\n format.json {head :no_content}\n end\n end", "title": "" }, { "docid": "cca6019dc42b9e8764808f5b8e68909e", "score": "0.6347682", "text": "def destroy\n @recipient = Recipient.find(params[:id])\n @recipient.destroy\n\n respond_to do |format|\n format.html { redirect_to recipients_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "56ea84cc8f69c63be5a0e7bff0a4fe8f", "score": "0.6346297", "text": "def destroy\n @mailer = Mailer.find(params[:id])\n @mailer.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "ee8080891886a4f50035e02f47e137fe", "score": "0.6338352", "text": "def delete(path)\n request(:delete, path)\n end", "title": "" }, { "docid": "a6660f8f62027412929d7b78d182281c", "score": "0.6337427", "text": "def delete endpoint\n do_request :delete, endpoint\n end", "title": "" }, { "docid": "df8995744483461ea533bb49a09603b7", "score": "0.63321817", "text": "def destroy\n @recipient = Recipient.find(params[:id])\n @recipient.destroy\n\n respond_to do |format|\n format.html { redirect_to recipients_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ca47d5e938df99eb744c55c8a8b7a3df", "score": "0.63232124", "text": "def delete(*args)\n request(:delete, *args)\n end", "title": "" }, { "docid": "9b66bf00481475e6b535142758e5841c", "score": "0.6320506", "text": "def destroy\n @deliverable = Deliverable.find(params[:id])\n\n unless @deliverable.editable?(current_user)\n flash[:error] = I18n.t(:not_your_deliverable)\n redirect_to root_path and return\n end\n @deliverable.destroy\n\n respond_to do |format|\n format.html { redirect_to(deliverables_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "44bd1e5fe602f312be7a4c18e7f30859", "score": "0.63171315", "text": "def destroy\n @mail.destroy\n respond_to do |format|\n format.html { redirect_to mails_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7fe2c2c6aac2335e52d616a5f82f62f8", "score": "0.63015723", "text": "def destroy\n @backlog_item.destroy\n respond_to do |format|\n format.html { redirect_to backlog_items_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "59be246afea915b07a1e0476d95c81c8", "score": "0.6300884", "text": "def destroy\n @newsletter.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "39ec6b755af65b0258f73bd9c8d3f608", "score": "0.62881416", "text": "def destroy\n @cost.destroy\n respond_to do |format|\n format.html { redirect_back(fallback_location: @cost.delivery) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "495bd8e59050dbae0c277b69ac93eaca", "score": "0.62874866", "text": "def destroy\n @delivery_note = DeliveryNote.find(params[:id])\n @delivery_note.destroy\n\n respond_to do |format|\n format.html { redirect_to delivery_notes_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "a378d1965c4aa50ef4f190f366bbed6d", "score": "0.6285598", "text": "def destroy\n @announce = Announce.find(params[:id])\n @announce.destroy\n #AnnounceMailer.delete_mail(@announce).deliver\n\n respond_to do |format|\n format.html { redirect_to announces_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0b7cf243f8ffb4570f64785e5c2279ca", "score": "0.62804353", "text": "def delete(url, vars={})\n send_request url, vars, 'DELETE'\n end", "title": "" }, { "docid": "86f0d7494d9910756152e54ab8101bc6", "score": "0.62767357", "text": "def destroy\n @product_delivered = ProductDelivered.find(params[:id])\n puts \"#{@product_delivered.subscription_id}\"\n @subscription = Subscription.find @product_delivered.subscription_id\n @product_delivered.destroy\n\n respond_to do |format|\n format.html { redirect_to campaign_subscription_product_delivereds_path(@subscription.campaign, @subscription)}\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ef2c0c142f43571ee1b97a992b2bb3ae", "score": "0.6273801", "text": "def delete(path)\n request 'DELETE', path\n end", "title": "" }, { "docid": "599c44a4edf08ea2f33d74b38abefe09", "score": "0.62695366", "text": "def destroy\n @bouncer = Bouncer.find(params[:id])\n @bouncer.destroy\n\n respond_to do |format|\n format.html { redirect_to(bouncers_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "648b9d240078e40599ebd8e4cff88ee5", "score": "0.62552637", "text": "def destroy\n @delivery.offer.destroy\n @delivery.offer.offer_boxes.each do |offer_box|\n offer_box.destroy\n end\n @delivery.offer.offer_articles.each do |offer_article|\n offer_article.destroy\n end\n @delivery.offer.return_boxes.each do |return_box|\n return_box.destroy\n end\n @delivery.destroy\n respond_to do |format|\n format.html { redirect_to deliveries_url, notice: 'Delivery was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bd92158cd07c76c14cdae27c89fb0d5a", "score": "0.6251396", "text": "def destroy\n @badge = Badge.find(params[:id])\n @badge.destroy\n\n respond_to do |format|\n format.html { redirect_to badges_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "350956bcbdd4031cdd7c2bc5358449ad", "score": "0.6250758", "text": "def destroy\n @food_delivery_type.destroy\n respond_to do |format|\n format.html { redirect_to food_delivery_types_url, notice: 'Food delivery type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "611b2f53fb4bea1762cddd2c15ba3d8e", "score": "0.6245401", "text": "def destroy\n @dailymail.destroy\n respond_to do |format|\n format.html { redirect_to dailymails_url, notice: 'Dailymail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1971a41060b66e0aa608a5fdfda718e6", "score": "0.62358433", "text": "def destroy\n @delivery_order.destroy\n respond_to do |format|\n format.html { redirect_to delivery_orders_url, notice: 'Delivery order was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "33b888c8f2b033bb54789de80c57d692", "score": "0.6235081", "text": "def delete\n client.delete(url)\n @deleted = true\nend", "title": "" }, { "docid": "19dc38069d551b9ab7fb57b1b3b3877d", "score": "0.62306434", "text": "def destroy\n @dataload_email = DataloadEmail.find(params[:id])\n @dataload_email.destroy\n\n respond_to do |format|\n format.html { redirect_to dataload_emails_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "64f3e1fbae4c5debce64a3170090deff", "score": "0.62279075", "text": "def destroy\n @project_phase_deliverable = ProjectPhaseDeliverable.find(params[:id])\n @project_phase_deliverable.destroy\n\n respond_to do |format|\n format.html { redirect_to(@project_phase_deliverable.project_phase.project) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fa3c20a90ea1419af2232f845e460f8c", "score": "0.622768", "text": "def delete!\n request! :delete\n end", "title": "" }, { "docid": "a1f3c7d499f21a82d9c4a4b92e299a60", "score": "0.6216191", "text": "def delete(*args)\n prepare_request(:delete, args)\n @@client.add(:delete, @path, *args)\n end", "title": "" }, { "docid": "acb8a955f17442ce1943df31af7a73f7", "score": "0.6206488", "text": "def delete(id:)\n id_check(:id, id)\n\n cf_delete(path: \"/organizations/#{org_id}/railguns/#{id}\")\n end", "title": "" }, { "docid": "abea65454e165974779d08fbf65632f3", "score": "0.6202658", "text": "def destroy\n @email.destroy\n respond_to do |format|\n format.html { redirect_to emails_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "abea65454e165974779d08fbf65632f3", "score": "0.6202658", "text": "def destroy\n @email.destroy\n respond_to do |format|\n format.html { redirect_to emails_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3b2459e76bb0c41ce5030b991a1278e0", "score": "0.6196463", "text": "def destroy\n @mail_item = MailItem.find(params[:id])\n @mail_item.destroy\n\n respond_to do |format|\n format.html { redirect_to mail_items_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2ac5bdb43cd5fb9ad1a8a7694a70dd8b", "score": "0.61928356", "text": "def destroy\n # find ALL servings associated with this purchase and delete them\n all_servings = Serving.where(purchase_id: @purchase.id)\n puts \"all servings associated with this purchase: #{all_servings}\"\n all_servings.destroy_all\n puts \"deleted servings\"\n @purchase.destroy\n puts \"deleted purchase\"\n render json: {status: 204, purchase: @purchase}\n end", "title": "" }, { "docid": "6bc45dc4197baeb0f8a4c6876439b359", "score": "0.61857784", "text": "def delete(path, params = {})\n post(path, params.merge(\"_method\" => \"delete\"))\n end", "title": "" }, { "docid": "21ad693dfab2dffe46477da40039e0b0", "score": "0.6184878", "text": "def destroy\n @mailername.destroy\n respond_to do |format|\n format.html { redirect_to mailernames_url, notice: 'Mailername was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "57e22b68751e729cd453a063c6e8ef7c", "score": "0.6182491", "text": "def destroy\n @delivery_time = DeliveryTime.find(params[:id])\n @delivery_time.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_delivery_times_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "32a71988d6564c4c459d4a5185e3b96e", "score": "0.61810744", "text": "def destroy\n @arrival = Arrival.find(params[:id])\n @arrival.destroy\n\n respond_to do |format|\n format.html { redirect_to arrivals_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "32a71988d6564c4c459d4a5185e3b96e", "score": "0.61810744", "text": "def destroy\n @arrival = Arrival.find(params[:id])\n @arrival.destroy\n\n respond_to do |format|\n format.html { redirect_to arrivals_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bbed65774f9489c73d250b9e57131b95", "score": "0.61777437", "text": "def delete(path)\n request(:delete, path)\n end", "title": "" }, { "docid": "91cf605ed72ff99d37c8e60f97425dda", "score": "0.6169737", "text": "def destroy\n @delivery_slip.destroy\n @delivery_slips = DeliverySlip.all\n respond_to do |format|\n format.html { redirect_to delivery_slips_url, notice: 'Delivery slip was successfully destroyed.' }\n format.json { head :no_content }\n format.js\n end\n end", "title": "" }, { "docid": "7bf4db1a88648b1fbf92b73daa9f054b", "score": "0.6166396", "text": "def destroy\n @collector.destroy\n respond_to do |format|\n format.html { redirect_to collectors_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3f806bc744b21d1da78bbe8f721edcda", "score": "0.6165146", "text": "def destroy\n @user_delivery_address.destroy\n respond_to do |format|\n format.html { redirect_to user_delivery_addresses_url, notice: 'User delivery address was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b39a03413d606391c52e7c71e957a049", "score": "0.6160927", "text": "def delete\n render json: Company.delete(params[\"id\"])\n end", "title": "" }, { "docid": "846ebc9811354ce2063d78756174954a", "score": "0.6160573", "text": "def incident_delete(statuspage_id, incident_id)\n data = {}\n data['statuspage_id'] = statuspage_id\n data['incident_id'] = incident_id\n\n request :method => :post,\n :url => @url + 'incident/delete',\n :payload => data\n end", "title": "" }, { "docid": "d1f0a8e8c97a0438790f1ddeeecaca29", "score": "0.61468256", "text": "def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end", "title": "" }, { "docid": "2a31a69138dadab19d26114f8fb86011", "score": "0.6143017", "text": "def destroy\n @delivery_truck.destroy\n respond_to do |format|\n format.html { redirect_to delivery_trucks_url, notice: 'Delivery truck was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c2a0fc36f669d746e4627fefaf3a99e2", "score": "0.6142781", "text": "def destroy\n @badge = Badge.find(params[:id])\n @badge.destroy\n\n respond_to do |format|\n format.html { redirect_to(badges_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "067f342441f903468437048d0c82695f", "score": "0.6138407", "text": "def destroy\n @bounty.destroy\n respond_to do |format|\n format.html { redirect_to bounties_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ff1dfc323659a9545801021023f70e39", "score": "0.613714", "text": "def destroy\n @prayer_request = PrayerRequest.find(params[:id])\n @prayer_request.destroy\n\n respond_to do |format|\n format.html { redirect_to prayer_requests_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "117a8c3dd94e733f06445866096a30a8", "score": "0.6136204", "text": "def destroy\n @recipient.destroy\n respond_to do |format|\n format.html { redirect_to recipients_url, notice: 'Recipient was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "117a8c3dd94e733f06445866096a30a8", "score": "0.6136204", "text": "def destroy\n @recipient.destroy\n respond_to do |format|\n format.html { redirect_to recipients_url, notice: 'Recipient was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ed19f23363675f0413ab513b5bc32746", "score": "0.61337864", "text": "def destroy\n @homework_delivery.destroy\n respond_to do |format|\n format.html { redirect_to homework_deliveries_url, notice: 'Homework delivery was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9af9f1a85116256b643ef1db17d2c54f", "score": "0.61335397", "text": "def destroy\n @recipient.destroy\n respond_to do |format|\n format.html { redirect_to recipients_url, notice: \"Recipient was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "666d78d89278eef13a42019077362b1c", "score": "0.61333126", "text": "def destroy\n @service_email = ServiceEmail.find(params[:id])\n @service_email.destroy\n\n respond_to do |format|\n format.html { redirect_to service_emails_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "94fa03b720a7d4703a4b82267015792d", "score": "0.6133263", "text": "def destroy\n @attendee = Attendee.find(params[:id])\n @attendee.destroy\n\n respond_to do |format|\n format.html { redirect_to attendees_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "9a8c2e0515915aae593d194cf776868f", "score": "0.61301273", "text": "def destroy\n @badge.destroy\n respond_to do |format|\n format.html { redirect_to badges_url, notice: 'Badge was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0e16822c8ee5fe3ffe7b4d1fcc32d973", "score": "0.6130003", "text": "def destroy\n @attendee = Attendee.find(params[:id])\n @attendee.destroy\n\n respond_to do |format|\n format.html { redirect_to attendees_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0e16822c8ee5fe3ffe7b4d1fcc32d973", "score": "0.6130003", "text": "def destroy\n @attendee = Attendee.find(params[:id])\n @attendee.destroy\n\n respond_to do |format|\n format.html { redirect_to attendees_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "59eb9d1fec3a5d513ff6aed6b0ddc0b1", "score": "0.6124274", "text": "def delete(url, headers = {})\n http :delete, \"#{url}.json\", headers\n end", "title": "" }, { "docid": "3cf8c46370e44ad4612da14f6c25fabf", "score": "0.6122867", "text": "def destroy\n @my_prayer_request = PrayerRequest.find(params[:id])\n @my_prayer_request.destroy\n\n respond_to do |format|\n format.html { redirect_to my_prayer_requests_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e7265b22acacda4174a261f7a58fdd73", "score": "0.61157626", "text": "def destroy\n @fee.destroy\n respond_to do |format|\n format.html { redirect_to @fee.booth, flash: { warning: 'Fee was deleted.' } }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ca51223ad693f5e81e329c46e13bc49f", "score": "0.61126906", "text": "def destroy\n @request = PrayerRequest.find(params[:id])\n @prayers = Prayer.where(\"prayer_request_id = ?\", @request.id)\n @prayers.each do |prayer| \n prayer.destroy\n end\n\n respond_to do |format|\n format.html { redirect_to prayers_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a534fa0d734005ce5f8dde50b36decd7", "score": "0.61121446", "text": "def destroy\n @newcomer_sends_task.destroy\n respond_to do |format|\n format.html { redirect_to newcomer_sends_tasks_url, notice: 'Newcomer sends task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b14cfb28afba3735bf66cdf77d7713fc", "score": "0.6109883", "text": "def destroy\n @node = @delivery_date.node\n @environment = @delivery_date.environment\n add_activity_to_subscribers_inbox(@delivery_date.create_activity :destroy, owner: @current_user, parameters: {environment: @environment.name, node: @node.id})\n @delivery_date.destroy\n respond_to do |format|\n format.html { redirect_to @node, notice: 'Delivery date was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b653051c1cdad0b9373a2c52b7faca4e", "score": "0.6107363", "text": "def destroy\n @retailer = Retailer.find(params[:id])\n @retailer.destroy\n\n respond_to do |format|\n format.html { redirect_to retailers_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "6bb5b9e2ce5ab901a05a1d618f90ad4d", "score": "0.61038893", "text": "def delete\n url = prefix + \"delete\"\n return response(url)\n end", "title": "" }, { "docid": "6bb5b9e2ce5ab901a05a1d618f90ad4d", "score": "0.61038893", "text": "def delete\n url = prefix + \"delete\"\n return response(url)\n end", "title": "" } ]
d201608fd00b0625332d6d176536ed51
callseq: join( timeout = nil ) => spawner or nil The calling thread will suspend execution until all child processes have been stopped. Does not return until all spawner threads have exited (the child processes have been stopped) or until _timeout seconds have passed. If the timeout expires +nil+ will be returned; otherwise the spawner is returned.
[ { "docid": "bf45fb21638d8f22bc893ce0ef66c0e4", "score": "0.48349893", "text": "def join( limit = nil )\n loop do\n t = @group.list.first\n break if t.nil?\n return nil unless t.join(limit)\n end\n self\n end", "title": "" } ]
[ { "docid": "3e5dedb28e4127ecd0af232bfc5ecdad", "score": "0.70817626", "text": "def join(timeout)\n @thread.join timeout\n end", "title": "" }, { "docid": "449d2ec18dcd68fa2d0d51efecb4541b", "score": "0.69918334", "text": "def join(timeout: nil)\n if timeout\n if !@server_thread.join(timeout)\n raise Timeout, \"timed out while waiting for the server to stop\"\n end\n else\n @server_thread.join\n end\n end", "title": "" }, { "docid": "1bcc4cf199ddcc5ef090248fd36cb684", "score": "0.6098987", "text": "def join_module_threads(threads, timeout = nil)\n return if not threads\n threads.each{|t|\n # Keep track of time\n start = Time.now\n\n # Allow the thread to close for up to timeout seconds\n t.join(timeout)\n\n # Then subtract how long it took for the next one\n timeout -= (Time.now - start)\n }\n end", "title": "" }, { "docid": "8662d7240e3d254cd2ce3ed36bac4f7c", "score": "0.597391", "text": "def join\n @running_processes.each { |x| x.wait }\n end", "title": "" }, { "docid": "2b1882e19f5901704dc033dd2a119672", "score": "0.5964512", "text": "def join\n return if not running?\n @thread.join\n end", "title": "" }, { "docid": "6343f34aeda1ee2d3497d3154880b147", "score": "0.5937186", "text": "def join\n @server_thread.join if @server_thread\n end", "title": "" }, { "docid": "ca8f4625a10a992e608790b4371baeea", "score": "0.591401", "text": "def join(limit = INFINITE)\n limit = limit * 1000 unless limit == INFINITE\n WaitForSingleObject(@thread, limit)\n ReleaseMutex(@@mutex) \n end", "title": "" }, { "docid": "1896f7bbe3e4442ecb052868ea729e39", "score": "0.59044677", "text": "def join\n @mutex.synchronize do\n logger.debug { \"spawned process #{@pid}\" }\n @exit_cond.wait_until { @status }\n end\n @status.success?\n end", "title": "" }, { "docid": "e21dace452ef043d033e39c4a48e73d0", "score": "0.58981085", "text": "def join\n attached? ? sleep : (running! and ::Process.waitpid2 pid rescue nil)\n end", "title": "" }, { "docid": "d6b51ea391502b9dd38517200aa06b5f", "score": "0.58325016", "text": "def join\n @thread.join\n end", "title": "" }, { "docid": "2ad9e208007926ff9dcafe267af93aa0", "score": "0.58088803", "text": "def join\n thread && thread.join\n end", "title": "" }, { "docid": "5280ab2cb81fabb53e5ad3b509bf689b", "score": "0.5779091", "text": "def join()\n @scheduler.join\n end", "title": "" }, { "docid": "03cc1d29aab494acfb253f162b5f80b3", "score": "0.5773393", "text": "def join\n @server_thread.join if @server_thread\n end", "title": "" }, { "docid": "6fe3cab4099df65f75ec1abf639a0e6f", "score": "0.5772973", "text": "def stop(join_timeout: 10)\n EventMachine.next_tick { @server.stop! }\n if join_timeout != 0\n join(timeout: join_timeout)\n end\n end", "title": "" }, { "docid": "687837140ebc19ac09d96b2731ebd935", "score": "0.57584053", "text": "def join\n complete\n @threads.size.times { @inqueue.push(nil) }\n @threads.each { |thr| thr.join }\n end", "title": "" }, { "docid": "e296737a6c0b90fcf9b475c81c5f2fc4", "score": "0.5757112", "text": "def join\n @threads.each { |t| t.join }\n @threads.clear\n end", "title": "" }, { "docid": "daf4100969151107cccbb264c753515b", "score": "0.5744784", "text": "def join\n #@pool_lock.synchronize { @worker_threads.each { |t| t.join unless @terminate } }\n # TODO protect w/ pool_lock? (causes deadlock)\n @manager_thread.join if @manager_thread\n end", "title": "" }, { "docid": "592889e99520923deecb17843b5aa6d0", "score": "0.5696126", "text": "def join\n require \"thwait\"\n ThreadsWait.new(@event_loop).join\n end", "title": "" }, { "docid": "07a2ff77e89f7553adfe22b33eef00ad", "score": "0.5675941", "text": "def join(timeout = nil)\n return true if complete?(false)\n \n # this is here because of the side effect that calling complete? has: complete? retrieves the newest value of\n # the job's status field from redis.\n is_complete = complete?\n \n # listen for task completion notification if the task is set up to do that\n if notify && pool\n listen_for_completion_notification(timeout)\n elsif !is_complete # we're not setup to listen to a queue for task-completion, so poll for job completion if the job isn't marked complete\n wait_for_completion(timeout)\n end\n \n complete?(false) # return the local (cached) completion status\n end", "title": "" }, { "docid": "4f4f2e286fae9268533885903096758e", "score": "0.5660936", "text": "def join_until_no_more_jobs\n\n @exit_when_no_more_jobs = true\n join\n end", "title": "" }, { "docid": "7086ab7fb5009660122afa2f2f9dbbdc", "score": "0.56444716", "text": "def join\n @thread.join\n end", "title": "" }, { "docid": "66cfd9b51de84d6171a807af03cfedb2", "score": "0.5630797", "text": "def join\n\n @scheduler_thread.join\n end", "title": "" }, { "docid": "0917adac6b35c5f66ae91bd68f51e03c", "score": "0.5602039", "text": "def join(sleep_seconds_before_join: 1)\n # check already existing TCPServers\n return if @tcp_servers.empty?\n # wait some seconds before joininig the upcoming threads\n # and check that all TCPServers gots one thread\n while (@tcp_server_threads.length < @tcp_servers.length) && sleep_seconds_before_join.positive?\n sleep_seconds_before_join -= 1\n sleep 1\n end\n # try to join any thread\n begin\n @tcp_server_threads.each(&:join)\n\n # catch ctrl-c to stop service\n rescue Interrupt\n end\n end", "title": "" }, { "docid": "ddb9af60074e42a8e962f586f975adde", "score": "0.55939984", "text": "def join\n start if [email protected]?\n @listener.join\n end", "title": "" }, { "docid": "a57e58ec2f50a50e9e78b35ff7d14543", "score": "0.5590075", "text": "def join_thread\n @thread&.join\n end", "title": "" }, { "docid": "b4210fac63838e6fc32c3e27a9086499", "score": "0.5569451", "text": "def join(sleep_seconds_before_join = 1)\n # check already started server\n if @tcpServerThread\n begin\n # wait a second\n sleep sleep_seconds_before_join\n # join\n @tcpServerThread.join\n\n # catch ctrl-c to stop service\n rescue Interrupt\n end\n end\n end", "title": "" }, { "docid": "3409bb8aa63b1dc95999221757da5b83", "score": "0.55033046", "text": "def join\n @worker.join(10)\n end", "title": "" }, { "docid": "272f3673bc1a852cf99fb1d4b8ec8ad4", "score": "0.54914623", "text": "def join\n @worker.join(SHUTDOWN_TIMEOUT)\n end", "title": "" }, { "docid": "4b8201f2b0910f7ecb1abf3d51455251", "score": "0.54695326", "text": "def join\n @manager_thread.join if @manager_thread\n self\n end", "title": "" }, { "docid": "61cedcd9b5b977657e4cabec911d0240", "score": "0.5450246", "text": "def join\n @acceptor.join if @acceptor\n end", "title": "" }, { "docid": "aeabad7a205558e6bebca5ed70a146c2", "score": "0.5431511", "text": "def join\n @threads.each { |aThread| aThread.join }\n end", "title": "" }, { "docid": "47fd129cfe25f672f73b726b52aeb72b", "score": "0.54181814", "text": "def join\n @listen_thread.join if @listen_thread\n sleep 0.5\n raise @thread_error if @thread_error\n end", "title": "" }, { "docid": "042be01dc23f5a88d6eadd0fe8a84443", "score": "0.5396872", "text": "def join\n @thread.join\n unset_thread_task\n end", "title": "" }, { "docid": "c91f7711aaa6a8861980b24e8e01f353", "score": "0.53882635", "text": "def join\n @cond.wait if not finished?\n end", "title": "" }, { "docid": "098bc352c528a4411f81bbc94bfe46de", "score": "0.53539187", "text": "def join\n [email protected]\n # Taking a copy here is really important!\n self.decrement @thread_count\n # Stop the threads or else suffer a deadlock.\n threads.each do |t|\n debug \"joining thread #{t}\" if @debug\n t.join\n end\n end", "title": "" }, { "docid": "5314d8b1be166c0e8b14ff3108c3bec5", "score": "0.53229934", "text": "def join\n respawn = true\n last_check = Time.now\n\n proc_name 'master'\n logger.info \"master process ready\" # test_exec.rb relies on this message\n if @ready_pipe\n @ready_pipe.syswrite($$.to_s)\n @ready_pipe = @ready_pipe.close rescue nil\n end\n begin\n reap_all_workers\n case SIG_QUEUE.shift\n when nil\n # avoid murdering workers after our master process (or the\n # machine) comes out of suspend/hibernation\n if (last_check + @timeout) >= (last_check = Time.now)\n sleep_time = murder_lazy_workers\n else\n sleep_time = @timeout/2.0 + 1\n @logger.debug(\"waiting #{sleep_time}s after suspend/hibernation\")\n end\n maintain_worker_count if respawn\n master_sleep(sleep_time)\n when :QUIT # graceful shutdown\n break\n when :TERM, :INT # immediate shutdown\n stop(false)\n break\n when :USR1 # rotate logs\n logger.info \"master reopening logs...\"\n Unicorn::Util.reopen_logs\n logger.info \"master done reopening logs\"\n soft_kill_each_worker(:USR1)\n when :USR2 # exec binary, stay alive in case something went wrong\n reexec\n when :WINCH\n if Unicorn::Configurator::RACKUP[:daemonized]\n respawn = false\n logger.info \"gracefully stopping all workers\"\n soft_kill_each_worker(:QUIT)\n self.worker_processes = 0\n else\n logger.info \"SIGWINCH ignored because we're not daemonized\"\n end\n when :TTIN\n respawn = true\n self.worker_processes += 1\n when :TTOU\n self.worker_processes -= 1 if self.worker_processes > 0\n when :HUP\n respawn = true\n if config.config_file\n load_config!\n else # exec binary and exit if there's no config file\n logger.info \"config_file not present, reexecuting binary\"\n reexec\n end\n end\n rescue => e\n Unicorn.log_error(@logger, \"master loop error\", e)\n end while true\n stop # gracefully shutdown all workers on our way out\n logger.info \"master complete\"\n unlink_pid_safe(pid) if pid\n end", "title": "" }, { "docid": "36c752b1fd16bec0ecab1296c9d38caa", "score": "0.5235008", "text": "def wait(mutex, timeout=nil)\n begin\n # TODO: mutex should not be used\n @waiters_mutex.synchronize do\n @waiters.push(Thread.current)\n end\n mutex.sleep timeout\n end\n self\n end", "title": "" }, { "docid": "850f83217c4332c81a03d2806f5e4513", "score": "0.52226084", "text": "def kill_gracefully(waiter, timeout: 1.0)\n Process.kill(\"TERM\", waiter.pid)\n return waiter unless waiter.join(timeout).nil?\n\n Process.kill(\"KILL\", waiter.pid)\n waiter.join\nend", "title": "" }, { "docid": "741566d6a74e4d7a6116c5e83251b21f", "score": "0.5200963", "text": "def join(server, already); end", "title": "" }, { "docid": "ca530f75fbe00cc547a2bb01c76711a5", "score": "0.51980245", "text": "def join_threads\n Threaded.new map { |x| x.join.value }\n end", "title": "" }, { "docid": "1c9276fd6917f37c19d607b1c0077235", "score": "0.51464665", "text": "def join\n @server.stop! if @server and @server.running?\n super\n end", "title": "" }, { "docid": "c8d3e97f2e3e854aa8f935c9f54dae75", "score": "0.5142686", "text": "def join(outs) ; nil ; end", "title": "" }, { "docid": "128548718a1344764895196034ba08b6", "score": "0.5130344", "text": "def join(*) end", "title": "" }, { "docid": "15b3c4365f58997464739eaebcdad350", "score": "0.511446", "text": "def spawn( options = {} )\n assert_valid_keys( options, :wait )\n wait = options[:wait]\n\n if ! wait then\n Hive::Worker.spawn kind, registry: registry, policy: policy, name: name\n return\n end\n\n before = registry.checked_workers( policy ).live\n\n Hive::Worker.spawn kind, registry: registry, policy: policy, name: name\n\n Hive::Idler.wait_until( 10 ) do\n after = registry.checked_workers( policy ).live\n diff = ( after - before ).select { |k| k.host == Hive::Key.local_host }\n diff.size > 0\n end\n end", "title": "" }, { "docid": "ce164155c1c8dbfacd5a064bf0d573be", "score": "0.5114313", "text": "def wait(timeout = nil)\n @monitor.instance_eval {mon_check_owner()}\n timer = create_timer(timeout)\n \n Thread.critical = true\n count = @monitor.instance_eval {mon_exit_for_cond()}\n @waiters.push(Thread.current)\n\n begin\n\tThread.stop\n return true\n rescue Timeout\n return false\n ensure\n\tThread.critical = true\n\tbegin\n\t if timer && timer.alive?\n\t Thread.kill(timer)\n\t end\n\t if @waiters.include?(Thread.current) # interrupted?\n\t @waiters.delete(Thread.current)\n\t end\n\t @monitor.instance_eval {mon_enter_for_cond(count)}\n\tensure\n\t Thread.critical = false\n\tend\n end\n end", "title": "" }, { "docid": "2370f38f2ffc3f94ba0a330d5e1a809a", "score": "0.50788015", "text": "def wait_for_termination(timeout)\n @executor.awaitTermination(1000 * timeout, java.util.concurrent.TimeUnit::MILLISECONDS)\n end", "title": "" }, { "docid": "9a07fea827f0e1076e1f8f005001c3b9", "score": "0.50738484", "text": "def join(&block)\n self.class.join(@processes.values, &block)\n end", "title": "" }, { "docid": "49ea0d72a3fc7e1037a41190264a7e9d", "score": "0.506333", "text": "def join\n @rufus_scheduler.join\n end", "title": "" }, { "docid": "4ad921ae9f84ec613d4670730e68be86", "score": "0.50629944", "text": "def join\n end", "title": "" }, { "docid": "7401e9dda0ef6281d40bafcb5deb4244", "score": "0.5059643", "text": "def join; end", "title": "" }, { "docid": "6a55a0109b22845243391e3277b2e8bb", "score": "0.5053815", "text": "def wait(timeout=60)\n countdown = timeout.to_f\n\n while countdown > 0\n if @zmq_thread and @zmq_thread.alive?\n sleep 0.1\n countdown = countdown - 0.1\n else\n break\n end\n end\n\n super()\n end", "title": "" }, { "docid": "f1111aa56bed53b0e010dece9ca4c9fe", "score": "0.5033877", "text": "def wait_to_spawn_thread\n # Never spawn more than the specified maximum number of threads.\n until Thread.list.select {|thread| thread.status == \"run\"}.count <\n (1 + @options[:max_threads]) do\n # Wait 5 milliseconds before trying again.\n sleep 0.005\n end\n end", "title": "" }, { "docid": "401ced2825098614bba3a04874731cfa", "score": "0.49985433", "text": "def join(limit=nil)\n # try directly get result\n if !alive? || limit.nil? || limit <= 0\n # call value to raise error\n value\n return self\n end\n\n # return to current beam if beam done within time limit\n origin_parent = parent\n self.parent = Beam.current\n # set a transfer back timer\n timer = LightIO::Watchers::Timer.new(limit)\n timer.set_callback do\n if alive?\n caller_beam = parent\n # resume to origin parent\n self.parent = origin_parent\n caller_beam.transfer\n end\n end\n ioloop.add_timer(timer)\n ioloop.transfer\n\n if alive?\n nil\n else\n check_and_raise_error\n self\n end\n end", "title": "" }, { "docid": "5452d0023d9f2c244ef997e5f9327d30", "score": "0.4972789", "text": "def join\n debug \"Joining listen-thread.\\n\" if @debug\n @thr_listen.join if @thr_listen\n raise @listen_err if @listen_err\n\n debug \"Joining error-thread.\\n\" if @debug\n @thr_err.join if @thr_join\n raise @listen_err_err if @listen_err_err\n end", "title": "" }, { "docid": "ef07d279b2f2d6f9ce73bee5ce7fc2a8", "score": "0.49597698", "text": "def join()\r\n @watchThread.join() if @watchThread\r\n end", "title": "" }, { "docid": "c9910b26866bdca0e30349f6069d31cb", "score": "0.4955632", "text": "def wait_start(timeout: 10)\n @wait_start.wait(timeout)\n if !@wait_start.complete?\n raise Timeout, \"timed out while waiting for the server to start\"\n end\n end", "title": "" }, { "docid": "3a4975d8719fe78f9a4c616be1372bb4", "score": "0.49497712", "text": "def join\n @listeners.values.each {|s| s.acceptor.join }\n end", "title": "" }, { "docid": "ed832eef4d98b6a37ea3d7b7cdfcca23", "score": "0.49453163", "text": "def wait(timeout = nil)\n @threads.wait_for_termination(timeout)\n Disquo.logger.info \"Worker shutdown complete\"\n end", "title": "" }, { "docid": "e2a4eb3d0923a098f27dbc6def43a7bc", "score": "0.49348378", "text": "def close(timeout = false)\n # Return immediately if the server isn't listening\n return unless @ml.locked?\n \n # Ask the loop to close\n @close_in.putc 'x' # Tell select to close\n\n \n # Wait for loop to end\n elapsed_time = 0\n while @ml.locked? do\n sleep(0.05)\n elapsed_time += 0.05\n\n # If a timeout is given, try killing threads at this point\n if timeout && elapsed_time > timeout\n @clients.each {|id, thread| thread.kill() }\n end\n end\n end", "title": "" }, { "docid": "b0a86dc2d7c32ab1605fd7613756c5bd", "score": "0.4929283", "text": "def soft_timeout(timeout, &block)\n t = Thread.new(&block)\n t.join(timeout) or raise Timeout::Error\n t.value\n end", "title": "" }, { "docid": "db929d2fd9d4ac719d08705cc1303ed6", "score": "0.49284407", "text": "def stop(timeout=nil)\n timeout ||= @timeout +1\n @shutting_down = true\n @thread.join timeout\n @running = false\n end", "title": "" }, { "docid": "e45913cfe56a8adecd99b53fb93760cc", "score": "0.49203333", "text": "def stop( timeout = 5 )\n return self unless running?\n @stop = true\n\n @cleanup.call\n ObjectSpace.undefine_finalizer(self)\n\n # the cleanup call sends SIGTERM to all the child processes\n # however, some might still be hanging around, so we are going to wait\n # for a timeout interval and then send a SIGKILL to any remaining child\n # processes\n nap_time = 0.05 * timeout # sleep for 5% of the timeout interval\n timeout = Time.now + timeout\n\n until @cids.empty?\n sleep nap_time\n unless Time.now < timeout\n @cids.kill 'KILL', :all\n @cids.clear\n @group.list.each {|t| t.kill}\n break\n end\n end\n\n self\n end", "title": "" }, { "docid": "cd8d4c8b8202d13c31444bf28c8d8339", "score": "0.4914464", "text": "def shutdown(timeout = 300)\n @running = false\n @thread.join(timeout) if @thread and @thread.alive?\n end", "title": "" }, { "docid": "e7e0dc1905d63d937f2898311659c988", "score": "0.49117833", "text": "def sleep(timeout)\n @sleeper.sleep(timeout)\n loop do\n next_waitable = @condition_variable.next_waitable_to_wake\n break if next_waitable == self\n next_waitable.wait_until_resumed\n end\n end", "title": "" }, { "docid": "8982ad4e2e379050a511ac5e6320102d", "score": "0.49114424", "text": "def spawn\n raise \"not yet implemented\"\n end", "title": "" }, { "docid": "cbefaacfb723f3e142421aac9e14cf05", "score": "0.4908086", "text": "def wait\n @timer_thread.join\n end", "title": "" }, { "docid": "4b1c41175a7854fee059cdb40511cbb5", "score": "0.48976716", "text": "def join_threads\n @worker_threads.each do |name, t|\n puts \"Joining thread: #{name}\"\n t.join\n end\n @worker_threads = {}\n end", "title": "" }, { "docid": "a659ab06b6ec6fdebc786b04530f3bdf", "score": "0.48864758", "text": "def join\n @poller.join if @poller\n end", "title": "" }, { "docid": "dc1f109f1dc2f63d635a35007d967ea8", "score": "0.48863274", "text": "def wait_for_termination(timeout = nil)\n stopped_event.wait(timeout)\n end", "title": "" }, { "docid": "dc1f109f1dc2f63d635a35007d967ea8", "score": "0.48863274", "text": "def wait_for_termination(timeout = nil)\n stopped_event.wait(timeout)\n end", "title": "" }, { "docid": "10fd9f26efb8dc159f300dd0070c3dce", "score": "0.4871558", "text": "def wait\n @t.each{|t| t.join}\n end", "title": "" }, { "docid": "5c160b283013dfdc7af8ec637c3c04fe", "score": "0.4844194", "text": "def enter(timeout = nil, wait = 0.01)\n time_at_timeout = Time.now + timeout if timeout\n while !timeout || Time.now < time_at_timeout\n return true if try_enter\n sleep(wait)\n end\n false\n end", "title": "" }, { "docid": "34d940e9b1dcdb4243cece566de7e1fe", "score": "0.4804708", "text": "def spawn_detached(args); end", "title": "" }, { "docid": "822bc7c9bbc294df2c4bbfdf04459d3f", "score": "0.47703072", "text": "def wait\n @thread.join\n end", "title": "" }, { "docid": "8e63a588fcbfda3a991abf8f6a536864", "score": "0.4766738", "text": "def join()\n @watchThread.join() if @watchThread\n end", "title": "" }, { "docid": "7e8532fb2232e5760f40b5c2bae96156", "score": "0.47650176", "text": "def wait(timeout = nil)\n result = true\n c = nil\n @mutex.synchronize do\n @count -= 1\n if @count < 0\n @sleeping.push Thread.current\n @mutex.sleep(timeout)\n end\n end\n if timeout\n # If we had a timeout we may have woken due to it expiring rather than\n # due to signal being called. In that case we need to remove ourself from the sleepers.\n @mutex.synchronize do\n i = @sleeping.index(Thread.current)\n if i\n @count += 1\n @sleeping.delete_at(i)\n result = false\n end\n end\n end\n result\n end", "title": "" }, { "docid": "20aa50314f1a012ded94bb7cc152af0d", "score": "0.47573853", "text": "def join()\n raise \"Missing implementation 'join'\"\n end", "title": "" }, { "docid": "8d87c543466fd0f5651e99ebbea3b4c7", "score": "0.4747344", "text": "def wait(mutex=nil,timeout = nil)\n\n if timeout.nil? && (mutex.nil? || Numeric === mutex)\n timeout = mutex\n mutex = nil\n end\n\n # Get the fiber that called us.\n strand = Thread.current\n # Add the fiber to the list of waiters.\n @waiters << strand\n begin\n sleeper = mutex ? mutex : Thread\n sleeper.sleep(timeout)\n ensure\n # Remove from list of waiters.\n @waiters.delete(strand)\n end\n self\n end", "title": "" }, { "docid": "2741a00c17e3f6d3dfdf112e501b2fc5", "score": "0.47426516", "text": "def wait(mutex=nil,timeout = nil)\n\n if timeout.nil? && (mutex.nil? || Numeric === mutex)\n timeout = mutex\n mutex = nil\n end\n\n # Get the fiber (Empathy::EM::Thread) that called us.\n thread = Thread.current\n # Add the fiber to the list of waiters.\n @waiters << thread\n begin\n sleeper = mutex ? mutex : Kernel\n if timeout then sleeper.sleep(timeout) else sleeper.sleep() end\n ensure\n # Remove from list of waiters. Note this doesn't run if the thread is killed\n @waiters.delete(thread)\n end\n self\n end", "title": "" }, { "docid": "68d52ad483b2370324c6c44a6f044642", "score": "0.47201157", "text": "def wait(timeout = nil)\n synchronize do\n touch\n # TODO interruptions ?\n super timeout if incomplete?\n self\n end\n end", "title": "" }, { "docid": "7eca0bc13bd4b5b2843c624a18ca0a86", "score": "0.47147042", "text": "def _spawn\n t = Thread.new do\n catch(:die) do\n loop do\n begin\n io = IO.popen(\"#{@ruby} #{@tmp.path}\", 'r')\n cid = Integer(line = io.gets)\n\n @cids.sync {@cids << cid} if cid > 0\n Process.wait cid\n rescue SystemCallError # if the child has already died\n rescue Exception => err\n child_err = Marshal.load(line) rescue nil\n err = child_err unless child_err.nil?\n\n STDERR.puts err.inspect\n STDERR.puts err.backtrace.join(\"\\n\")\n throw :die\n ensure\n line = io.read\n child_err = Marshal.load(line) rescue nil\n\n io.close rescue nil\n @cids.sync {\n @cids.delete cid\n throw :die unless @cids.length < @spawn or child_err\n }\n raise child_err unless child_err.nil?\n end\n\n throw :die if @stop\n sleep @pause\n\n end # loop\n end # catch(:die)\n end # Thread.new\n\n @group.add t\n t\n end", "title": "" }, { "docid": "af94f659be9537ae819ccfcce2092d40", "score": "0.47067463", "text": "def sleep(timeout = nil)\n unlock\n begin\n timeout ? Kernel.sleep(timeout) : Kernel.sleep\n ensure\n lock\n end\n end", "title": "" }, { "docid": "63e73b10843318fe409b241ebb6fe071", "score": "0.47045973", "text": "def join\n @executions.each do |execution|\n execution.join\n end\n end", "title": "" }, { "docid": "7bee2dbc80e2ddd789ef223eb1c4805f", "score": "0.46815205", "text": "def stop! timeout = nil\n stop\n wait! timeout\n end", "title": "" }, { "docid": "feb01712257a7f411db02432489ab3f6", "score": "0.4679214", "text": "def initialize_timeout(thread)\n #Thread to stop the execution after timeout time\n Thread.start(thread) do |thr|\n sleep(VM_TIMEOUT + 3) #add a little because normaly vm triggers timeout\n if thr.alive?\n puts 'kill'\n thr.kill\n exit_simulation!('Ausführungszeit wurde überschritten.')\n @packet.send_packet\n end\n end\nend", "title": "" }, { "docid": "99571f2f684cdf6facaa82a2e77c213d", "score": "0.46782812", "text": "def join(*futures)\n countdown = Concurrent::AtomicFixnum.new futures.size\n promise = OuterPromise.new(futures)\n futures.each { |future| future.add_callback :join, countdown, promise, *futures }\n promise.future\n end", "title": "" }, { "docid": "91d846b4b0924a9dfcbd62b29c4640eb", "score": "0.46780547", "text": "def lay_to_rest(pid, timeout=10)\n #refuse to kill ourselves, or to pass a bad arg to Process.kill\n return 0 unless pid.is_a?(Integer) && pid > 0\n\n Process.kill('TERM', pid)\n time_waited = 0\n loop do\n if time_waited >= timeout\n Process.kill('KILL', pid)\n # can't waitpid here, because the ssh-agent isn't our\n # child. Still, after SIGKILL it will die and init will\n # reap it, so continue\n return\n end\n # still can't waitpid here, so we see if it's still alive\n return unless still_alive?(pid)\n sleep 1\n time_waited += 1\n end\n end", "title": "" }, { "docid": "6c7d612691f105f289aae4fa146fbfbc", "score": "0.4670649", "text": "def wait_until_terminated(sec=10)\n unless terminated?\n wait_until_after(:terminate, sec)\n @chain_threads.list.each {|thread| thread.join}\n end\n end", "title": "" }, { "docid": "670fab9c84d0b569a187abfd4a2aab35", "score": "0.46669996", "text": "def drain_queue\n @queue_threads.each do |item|\n item.join unless item.nil? || !item.alive?\n end\n nil\n end", "title": "" }, { "docid": "79e523dd3535aff68cfc7f8377affea3", "score": "0.4666405", "text": "def timeout\n exception = nil\n self.thread = Thread.new do\n begin\n yield\n rescue Exception => e\n # save exception so it can be rethrown outside of the thread\n exception = e\n end\n end\n while self.thread.join(self.timeout_period) == nil do\n if self.last_ping < Time.now - self.timeout_period\n self.terminated = true\n break\n end\n end\n raise exception if exception\n end", "title": "" }, { "docid": "3c88b5a33fc9c0b01bc2d44929141996", "score": "0.46355134", "text": "def join\n raise \"No http-server or http-server not running.\" if !@httpserv or [email protected]_accept\n \n begin\n @httpserv.thread_accept.join\n @httpserv.thread_restart.join if @httpserv and @httpserv.thread_restart\n rescue Interrupt => e\n self.stop\n end\n \n if @should_restart\n loop do\n if @should_restart_done\n STDOUT.print \"Ending join because the restart is done.\\n\"\n break\n end\n \n sleep 1\n end\n end\n end", "title": "" }, { "docid": "01912d609a5798c08b9584940b5f9e48", "score": "0.4635429", "text": "def timeout(args = {}, &block)\n return Knjappserver::Threadding_timeout.new({\n :kas => self,\n :block => block,\n :args => []\n }.merge(args)).start\n end", "title": "" }, { "docid": "edeca62be7b7959d48078c139ac53023", "score": "0.46254438", "text": "def rejoin(target = nil, join_options = nil)\n target ||= join_target\n join_options ||= @join_options\n logger.info \"Rejoining to #{target}\"\n ignoring_ended_calls do\n unless target == @call\n @join_target = target\n @call.join target, join_options\n end\n end\n @calls.each do |call|\n ignoring_ended_calls { call.join target, join_options }\n end\n end", "title": "" }, { "docid": "33c52353e67da1c1f08b4aa46e50f9a3", "score": "0.46221316", "text": "def wait_for(seq,timeout=1)\n begin\n ::Timeout.timeout(timeout) do\n wait(seq)\n end\n rescue ::Timeout::Error\n end\n end", "title": "" }, { "docid": "6dba684cccafb1f24d867de647f243d1", "score": "0.46093705", "text": "def wait_any(timeout = -1)\n DRMAA.wait(ANY_JOB, timeout)\n end", "title": "" }, { "docid": "9d7f237c80aa19cfbefddc239bf0e7d3", "score": "0.46003902", "text": "def join\n wait_for_completion\n update_nodes\n end", "title": "" }, { "docid": "ca3f792b347351ba7615dbd69bbf4f78", "score": "0.4599916", "text": "def shutdown(timeout: nil)\n lock do\n @keep_running = false\n @condition.signal\n end\n\n @thread.join\n force_flush\n @exporter.shutdown\n end", "title": "" }, { "docid": "5216f138488967cf7a5e7fdc4a92931d", "score": "0.45856166", "text": "def worker_timeout(timeout); end", "title": "" }, { "docid": "51b905de470d739722256b5f3415b11b", "score": "0.45679054", "text": "def wait(timeout=nil)\n return false if closed?\n return self if IO.select([self], nil, nil, timeout)\n end", "title": "" }, { "docid": "4fac70d0fde57f6a673d75ad90093744", "score": "0.4560912", "text": "def wait_any(timeout = -1)\n DRMAA.wait(ANY_JOB, timeout)\n end", "title": "" } ]
05f690b888a41c1dcb5ab04c0848fb8e
Merges two build.cfg files
[ { "docid": "f5b5d6e751f01aa6ab509bc604732e7b", "score": "0.69768655", "text": "def merge_configurations cfg,cfg2\n cfg['prefix']||=cfg2['prefix']\n raise \"Attempting to merge configurations with differing prefixes: '#{cfg['prefix']}' vs. '#{cfg2['prefix']}' \" if cfg['prefix']!=cfg2['prefix']\n cfg['include']||=[]\n cfg['depend']||=[]\n cfg['interface']||=[]\n cfg['include']+=cfg2['include'] if cfg2['include']\n cfg['depend']+=cfg2['depend'] if cfg2['depend']\n cfg['interface']+=cfg2['interface'] if cfg2['interface']\n return cfg\nend", "title": "" } ]
[ { "docid": "9c1c8318e63e833622f758d75f398507", "score": "0.6401581", "text": "def merge(cfg_file)\n cfg = read_configuration(cfg_file)\n list_keys, = *keys\n cfg.each_key do |k|\n if @config.keys.include?(k) && list_keys.include?(k)\n @config[k] += cfg[k]\n else\n # last one wins\n @config[k] = cfg[k]\n end\n end\n @configuration_files << cfg_file\n end", "title": "" }, { "docid": "cfb9373a62a7dce65974573858bb3ae2", "score": "0.63358754", "text": "def merge(opts); end", "title": "" }, { "docid": "3955f69d1c29e468f306b2cc2422d51f", "score": "0.6236957", "text": "def merge_builds merged_build\n FileUtils.mkdir_p @temp_root\n debug_msg \"Merging #{merged_build}\"\n require \"sdoc/merge\"\n \n tmp = temp_dir\n target = File.join @public_dir, merged_build.to_s\n \n title = merged_build.builds.map do |build| \n automation_by_name(build.name).name + \" v#{build.version}\"\n end.join(', ')\n names = merged_build.builds.map do |build| \n automation_by_name(build.name).short_name\n end.join(',')\n urls = merged_build.builds.map do |build|\n '../' + build.to_s\n end.join(' ')\n \n options = []\n options << \"-o\" << tmp\n options << '--title' << title\n options << '--names' << names\n options << '--urls' << urls\n merged_build.builds.each do |build|\n options << File.join(@public_dir, build.to_s)\n end\n SDoc::Merge.new.merge(options)\n \n FileUtils.rm_rf target if File.exists? target\n FileUtils.cp_r File.join(tmp, '.'), target, :preserve => true \n \n zip_tmp = merge_zip merged_build\n FileUtils.cp File.join(zip_tmp, 'rdoc.zip'), target, :preserve => true\n clean_up\n end", "title": "" }, { "docid": "d44b19d9deb4b2a478cf91cad02efa98", "score": "0.61342496", "text": "def merge_with_default(config, config_file, unset_nil:); end", "title": "" }, { "docid": "fc38821e2a4e8b82675af6f71394134e", "score": "0.6094355", "text": "def merge_config_file(site)\n required = [TITLE_KEY, DESC_KEY, GITHUB_KEY, SEARCH_KEY, URL_KEY]\n optional = [ORG_KEY]\n\n original_url = site.config[URL_KEY]\n\n customizations = YAML.load_file(GUIDE_CONFIG)\n if customizations\n required.each do |k|\n site.config[k] = customizations[k]\n end\n\n optional.each do |k|\n if customizations.key?(k)\n site.config[k] = customizations[k]\n end\n end\n\n # Per https://jekyllrb.com/docs/variables/, Jekyll will set\n # the url at runtime in dev environments -- preserve, if set\n if original_url\n site.config[URL_KEY] = original_url\n end\n end\n puts \" Merged \" + GUIDE_CONFIG\n end", "title": "" }, { "docid": "ddd9e534767ee93ac355c01c72b7eb1f", "score": "0.5981226", "text": "def merge_configs\n # Apply config file settings on top of mixlib-cli defaults\n combined_config = default_config.merge(config_file_settings)\n # Apply user-supplied options on top of the above combination\n combined_config = combined_config.merge(config)\n # replace the config hash from mixlib-cli with our own.\n # Need to use the mutate-in-place #replace method instead of assigning to\n # the instance variable because other code may have a reference to the\n # original config hash object.\n config.replace(combined_config)\n end", "title": "" }, { "docid": "476335cb3a93b807c919b49ef52de5d0", "score": "0.5948224", "text": "def merge_configs\n # Update our original_config - if someone has created a knife command\n # instance directly, they are likely ot have set cmd.config values directly\n # as well, at which point our saved original config is no longer up to date.\n @original_config = config.dup\n # other code may have a handle to the config object, so use Hash#replace to deliberately\n # update-in-place.\n config.replace(config_file_defaults.merge(default_config).merge(config_file_settings).merge(config))\n end", "title": "" }, { "docid": "f7bf46dd7b30ae93d9223a4b03b0f6ef", "score": "0.5910221", "text": "def merge(other)\n @scheme = other.scheme unless other.scheme.nil?\n @workspace = other.workspace unless other.workspace.nil?\n @target = other.target unless other.target.nil?\n @suffix = other.suffix unless other.suffix.nil?\n @reporter = other.reporter unless other.reporter.nil?\n @xctool_path = other.xctool_path unless other.xctool_path.nil?\n @project = other.project unless other.project.nil?\n \n return self\n end", "title": "" }, { "docid": "6f9ad431938d774e0f288ce28f785364", "score": "0.58033544", "text": "def wonkofile_merge(old, new)\n res = old.merge new\n # changing versions is not allowed by adding another version index (we might end up with a version in the index that\n # we don't have an actual version file for)\n res['versions'] = old['versions']\n res\nend", "title": "" }, { "docid": "733663143c92502652c8df15288fc9a3", "score": "0.5784758", "text": "def merge_config!(config = {})\n self.config.url = config[:url] if config.key?(:url)\n self.config.opts = config[:opts] if config.key?(:opts)\n self.config.db = config[:db] if config.key?(:db)\n end", "title": "" }, { "docid": "7ae5ebcb2f497293e3c246660cfbff9f", "score": "0.57714516", "text": "def merge!(other)\n other.config.each do |key, value|\n case key\n when 'clusters', 'contexts', 'users'\n value.each do |other_value|\n own_value = config[key].find { |c| c['name'] == other_value['name'] }\n config[key].delete(own_value) if own_value\n config[key] << other_value\n end\n when 'current-context', 'preferences'\n config[key] = value\n else\n config[key] ||= value\n end\n end\n\n self\n end", "title": "" }, { "docid": "ceb29f28d478b1100a6ec005494c750b", "score": "0.5696295", "text": "def common_build\n copy_gems\n end", "title": "" }, { "docid": "ceb29f28d478b1100a6ec005494c750b", "score": "0.5696295", "text": "def common_build\n copy_gems\n end", "title": "" }, { "docid": "ff2a1daf4b585f102133f7a0f93a7545", "score": "0.5670128", "text": "def import(another)\n merge! configs.import(another)\n end", "title": "" }, { "docid": "ef0490e56e653f5b3dca81f19e4a0fef", "score": "0.566068", "text": "def common_build\n copy_gems # in make/gems.rb\n end", "title": "" }, { "docid": "af6bb9209b51bc87438a2b167ce428bd", "score": "0.5659021", "text": "def merge *sources\n unless directory == '*' || sources.all? { |source| source_hash.key?(source.filename) }\n # Reload the config to determine if a new source should be included\n @config = Solargraph::Workspace::Config.new(directory)\n end\n\n includes_any = false\n sources.each do |source|\n if directory == \"*\" || config.calculated.include?(source.filename)\n source_hash[source.filename] = source\n includes_any = true\n end\n end\n\n includes_any\n end", "title": "" }, { "docid": "6a43b965af83dc587c68f76b7f54c134", "score": "0.5650179", "text": "def merge_zip merged_build\n debug_msg \"Merging zip for #{merged_build}\"\n \n tmp = temp_dir\n \n title = merged_build.builds.map do |build| \n automation_by_name(build.name).name + \" v#{build.version}\"\n end.join(', ')\n names = merged_build.builds.map do |build| \n automation_by_name(build.name).short_name\n end.join(',')\n options = []\n options << \"-o\" << tmp\n options << '--title' << title\n options << '--names' << names\n merged_build.builds.each do |build|\n options << File.join(@public_dir, build.to_s)\n end\n SDoc::Merge.new.merge(options)\n \n prepare tmp\n \n tmp\n end", "title": "" }, { "docid": "f672fb5715c712fa3e9ba822639607b6", "score": "0.56469226", "text": "def merge_with_default(config, config_file, unset_nil: T.unsafe(nil)); end", "title": "" }, { "docid": "d2a7de17c0d0cb272d22a2596582c9db", "score": "0.5628971", "text": "def merge(source); end", "title": "" }, { "docid": "a6fc339191b81bc50c57e4ecb9dca574", "score": "0.5626416", "text": "def merge_with other\n m_next = @metadata.merge_with other.metadata\n files_res = {}\n\n # my files\n @files.each { |f| files_res[f.src] = f }\n\n # overrides\n other.files.each { |f| files_res[f.src] = f }\n\n # result\n f_next = files_res.collect { |k, v| v }\n\n Package.new m_next, f_next\n end", "title": "" }, { "docid": "9cab0cd4d372d25df55b3c72446781fd", "score": "0.5614215", "text": "def _compile(config)\n default_configuration.deep_merge(config).deep_merge(overlay_configuration)\n end", "title": "" }, { "docid": "b7052c428546b2818b2a29151948e740", "score": "0.55520934", "text": "def merge(xml1, file2)\n xml2 = File.read(file2)\n return xml2 unless xml1\n\n merge_xml(xml1, xml2)\n end", "title": "" }, { "docid": "7a971f96efbc1be7fd05cce05227993c", "score": "0.5532495", "text": "def merge!; end", "title": "" }, { "docid": "8df16c67473e4584f1272f9ea7029e4d", "score": "0.54995114", "text": "def merge(*sources); end", "title": "" }, { "docid": "c709a538f87e59369ae23ec94aab1954", "score": "0.5489841", "text": "def merge!( other )\n my_keys = @ini.keys\n other_keys =\n case other\n when IniFile; other.instance_variable_get(:@ini).keys\n when Hash; other.keys\n else raise \"cannot merge contents from '#{other.class.name}'\" end\n\n (my_keys & other_keys).each do |key|\n @ini[key].merge!(other[key])\n end\n\n (other_keys - my_keys).each do |key|\n @ini[key] = other[key]\n end\n\n self\n end", "title": "" }, { "docid": "86489075c9954affce8e8de75f49868e", "score": "0.5467784", "text": "def config_merge(config)\n @config.merge!(config)\n end", "title": "" }, { "docid": "944b0256566c98b86e3036ac4b9f1fef", "score": "0.54633445", "text": "def merge(other = {})\n branch default_options.merge(other)\n end", "title": "" }, { "docid": "b19400ea6e41850c6efdf8959ee60816", "score": "0.54554635", "text": "def merge!(other)\n return self if other.nil?\n\n my_keys = @ini.keys\n other_keys = case other\n when IniFile\n other.instance_variable_get(:@ini).keys\n when Hash\n other.keys\n else\n raise Error, \"cannot merge contents from '#{other.class.name}'\"\n end\n\n (my_keys & other_keys).each do |key|\n case other[key]\n when Hash\n @ini[key].merge!(other[key])\n when nil\n nil\n else\n raise Error, \"cannot merge section #{key.inspect} - unsupported type: #{other[key].class.name}\"\n end\n end\n\n (other_keys - my_keys).each do |key|\n @ini[key] = case other[key]\n when Hash\n other[key].dup\n when nil\n {}\n else\n raise Error, \"cannot merge section #{key.inspect} - unsupported type: #{other[key].class.name}\"\n end\n end\n\n self\n end", "title": "" }, { "docid": "9588c1032a6aeafd14a432dcd6c9835a", "score": "0.54481447", "text": "def merge; end", "title": "" }, { "docid": "91b94f4c5ddb45aee9caa928050d03eb", "score": "0.5443928", "text": "def read_component_configuration component,platform,configuration\n hp_dir=File.join(configuration['base_dir'],'src','hand',platform,component)\n hc_dir=File.join(configuration['base_dir'],'src','hand','common',component)\n gp_dir=File.join(configuration['base_dir'],'src','gen',platform,component)\n gc_dir=File.join(configuration['base_dir'],'src','gen','common',component)\n cfg={}\n [hp_dir,hc_dir,gp_dir,gc_dir].each do |cfg_dir|\n file_to_merge=File.join(cfg_dir,'build.cfg')\n if File.exists?(file_to_merge)\n cfg_to_merge=read_configuration(file_to_merge)\n cfg=merge_configurations(cfg,cfg_to_merge) \n end\n end\n return cfg\nend", "title": "" }, { "docid": "9bb36e71f16c81d6325885819a2b3ce8", "score": "0.54293394", "text": "def merge!(config)\n self.compiled = false\n self.resource_class ||= config.resource_class\n transforms_from.merge! config.transforms_from\n transforms_to.merge! config.transforms_to\n custom_serializers.merge! config.custom_serializers\n namespaces.merge! config.namespaces\n facets.merge! config.facets #TODO --jdc change to a deep_merge!\n extensions.merge! config.extensions\n\n self\n end", "title": "" }, { "docid": "2d4cb3fccd3861321c12c6a061f16603", "score": "0.5392509", "text": "def merge_conf_file!(result, conf_file_path)\n # parse conf file\n conf = Fwissr.parse_conf_file(conf_file_path)\n if conf\n conf_file_name = ::File.basename(conf_file_path, ::File.extname(conf_file_path))\n\n result_part = result\n\n unless TOP_LEVEL_CONF_FILES.include?(conf_file_name) || @options['top_level']\n # merge conf at the correct place in registry\n #\n # eg: my_app.json => /my_app\n # my_app.database.yml => /my_app/database\n # my_app.database.slave.yml => /my_app/database/slave\n key_ary = conf_file_name.split('.')\n key_ary.each do |key_part|\n result_part = (result_part[key_part] ||= { })\n end\n end\n\n Fwissr.merge_conf!(result_part, conf)\n else\n raise \"Failed to parse conf file: #{conf_file_path}\"\n end\n end", "title": "" }, { "docid": "98452e4ff63035ef63236efa47196bb9", "score": "0.53885496", "text": "def build_supplement(config_base, config_more)\n # merge in our post-build additions to base configuration hash\n config_base.deep_merge!( config_more )\n\n # flatten our addition hash\n config_more_flattened = @configurator_builder.flattenify( config_more )\n\n # merge our flattened hash with built hash from previous build\n @project_config_hash.deep_merge!( config_more_flattened )\n store_config()\n\n # create more constants and accessors\n @configurator_setup.build_constants_and_accessors(config_more_flattened, binding())\n\n # recreate constants & update accessors with new merged, base values\n config_more.keys.each do |key|\n hash = { key => config_base[key] }\n @configurator_setup.build_constants_and_accessors(hash, binding())\n end\n end", "title": "" }, { "docid": "7d5673641a51f429ea60022268a2955d", "score": "0.53868973", "text": "def merge(*files)\n @paths[''].merge *files\n end", "title": "" }, { "docid": "31905e7a537fa156d564aa40511b9c5a", "score": "0.53824544", "text": "def merge(with); end", "title": "" }, { "docid": "bad56e346bf5a829258456e043dfdf1a", "score": "0.53596264", "text": "def copy_configuration_files\n replace_file 'config/routes.rb'\n replace_file 'config/environments/development.rb'\n replace_file 'config/environments/test.rb'\n copy_file 'templates/.env', '.env'\n copy_file 'templates/.tool-versions', '.tool-versions'\n replace_file 'config/initializers/dotenv.rb'\n replace_file 'config/initializers/colorize.rb'\n git add: '.'\n git commit: %Q{ -m \"Update application configuration\" }\nend", "title": "" }, { "docid": "511c18e3f1527a68aeca22d4b58e5875", "score": "0.5358044", "text": "def merge(paths)\n prepare(paths)\n end", "title": "" }, { "docid": "063dd5c44e93f3e4584ffe9acb4c1610", "score": "0.5334432", "text": "def edit_build(carbon_home,location,usr,pwd,url,dialects,driver) \n\n\tFile.open(File.join(Dir.pwd,'build.xml')) do |config_file|\n\t\t# Open the document and edit the port (carbon.xml)\n\t\tconfig = Document.new(config_file)\n\t\n\t\tconfig.root.elements[14].attributes['value']=carbon_home\n\n\t\tif(dialects == 'mysql')\n\t\t\tconfig.root.elements[21].attributes['value']=location\n\t\t\tconfig.root.elements[22].attributes['value']=usr\n\t\t\tconfig.root.elements[23].attributes['value']=pwd\n\t\t\tconfig.root.elements[24].attributes['value']=url\n\t\t\tconfig.root.elements[25].attributes['value']=dialects\n\t\t\tconfig.root.elements[26].attributes['value']=driver\n\t\tend\n\n\t\tif(dialects == 'oracle')\n\t\t\tconfig.root.elements[15].attributes['value']=location\n\t\t\tconfig.root.elements[16].attributes['value']=usr\n\t\t\tconfig.root.elements[17].attributes['value']=pwd\n\t\t\tconfig.root.elements[18].attributes['value']=url\n\t\t\tconfig.root.elements[19].attributes['value']=dialects\n\t\t\tconfig.root.elements[20].attributes['value']=driver\n\t\tend\n\n\t\n\t\n\t\t# Write the result to a new file.\n\t\tformatter = REXML::Formatters::Default.new\n\t\tFile.open(File.join('result_build.xml'), 'w') do |result|\n\t\tformatter.write(config, result)\n\t\tend\n\t\n\tend \n\n\tFile.delete(File.join('build.xml'))\n\tFile.rename( File.join('result_build.xml'),File.join('build.xml') )\n\n\t#call buld.xml to setup the connection with database\n\tif(dialects == 'mysql')\n\t\tif RUBY_PLATFORM.downcase.include?(\"mswin\")\n\t\t\t`ant startServerWindows -Dscript=normal -Ddatabase.name=mysql`\n\t\telsif RUBY_PLATFORM.downcase.include?(\"linux\")\n\t\t\t`ant startServerUnix -Dscript=normal -Ddatabase.name=mysql`\n\t\tend\n\tend\n\n\tif(dialects == 'oracle')\n\t\tif RUBY_PLATFORM.downcase.include?(\"mswin\")\n\t\t\t`ant startServerWindows -Dscript=normal -Ddatabase.name=oracle`\n\t\telsif RUBY_PLATFORM.downcase.include?(\"linux\")\n\t\t\t`ant startServerUnix -Dscript=normal -Ddatabase.name=oracle`\n\t\tend\n\tend\n\nend", "title": "" }, { "docid": "1158c136a49ae6ae5bbb98fa288a77c0", "score": "0.5322656", "text": "def extend!(other)\n # Any image_registries entry in |self| should take precedence\n # over any identical key in |other|. The behavior of merge is that\n # the 'other' hash wins.\n @image_registries = other.image_registries.merge(@image_registries)\n\n # Same behavior as above for #default_flags.\n @default_flags = other.default_flags.merge(@default_flags)\n\n # artifacts should be merged by 'name'. In other words, if |self| and |other|\n # specify the same 'name' of a registry, self's config for that registry\n # should win wholesale (no merging of flags.)\n @artifacts = (@artifacts + other.artifacts).uniq { |h| h.fetch('name') }\n\n # Same behavior as for flags and registries, but the flags within the flavor\n # are in a Hash, so we need a deep merge.\n @flavors = other.flavors.deep_merge(@flavors)\n\n # A break from the preceding merging logic - Dependent hooks have to come\n # first and a given named hook can only be run once. But seriously, you\n # probably don't want to make a library that specifies hooks.\n @hooks = (other.hooks + @hooks).uniq\n\n @expiration = (@expiration + other.expiration).uniq { |h| h.fetch('repository') }\n end", "title": "" }, { "docid": "c59b08432427d5c1ad2f2de33dfb7539", "score": "0.53011334", "text": "def merge_gemfiles(*path, ruby_version: nil, unlock: [])\n gems_remotes = Set.new\n dependencies = Hash.new do |h, k|\n h[k] = Hash.new do |i, j|\n i[j] = Hash.new do |a, b|\n a[b] = Array.new\n end\n end\n end\n path.each do |gemfile|\n bundler_def =\n begin Bundler::Dsl.evaluate(gemfile, nil, [])\n rescue Exception => e\n cleaned_message = e\n .message\n .gsub(/There was an error parsing([^:]+)/,\n \"Error in gem definitions\")\n .gsub(/# from.*/, \"\")\n raise ConfigError, cleaned_message\n end\n gems_remotes |= bundler_def.send(:sources).rubygems_remotes.to_set\n bundler_def.dependencies.each do |d|\n d.groups.each do |group_name|\n if d.platforms.empty?\n dependencies[group_name][\"\"][d.name] = d\n else\n d.platforms.each do |platform_name|\n dependencies[group_name][platform_name][d.name] = d\n end\n end\n end\n end\n end\n\n contents = []\n gems_remotes.each do |g|\n g = g.to_s\n g = g[0..-2] if g.end_with?(\"/\")\n contents << \"source '#{g}'\"\n end\n if ruby_version\n contents << \"ruby \\\"#{ruby_version}\\\" if respond_to?(:ruby)\"\n end\n valid_keys = %w[group groups git path glob name branch ref tag\n require submodules platform platforms type\n source install_if]\n dependencies.each do |group_name, by_platform|\n contents << \"group :#{group_name} do\"\n by_platform.each do |platform_name, deps|\n deps = deps.values.sort_by(&:name)\n unless platform_name.empty?\n contents << \" platform :#{platform_name} do\"\n platform_indent = \" \"\n end\n deps.each do |d|\n if d.source\n options = d.source.options.dup\n options.delete_if { |k, _| !valid_keys.include?(k) }\n options = options.map { |k, v| \"#{k}: \\\"#{v}\\\"\" }\n end\n contents << [\" #{platform_indent}gem \\\"#{d.name}\\\",\n \\\"#{d.requirement}\\\"\", *options].join(\", \")\n end\n contents << \" end\" unless platform_name.empty?\n end\n contents << \"end\"\n end\n contents.join(\"\\n\")\n end", "title": "" }, { "docid": "382fe825ebdf5f26c4297ff36c8ab855", "score": "0.5265851", "text": "def merge!(another)\n configs = self.configs\n another.each_pair do |key, value|\n if config = configs[key]\n config.set(receiver, value)\n else\n store[key] = value\n end\n end\n self\n end", "title": "" }, { "docid": "b6dce7e7d3fd67f60ef9918bcbdada35", "score": "0.5256022", "text": "def merge(other); end", "title": "" }, { "docid": "0513c72d52a4695e30ce20ccbdaa63d8", "score": "0.5249642", "text": "def merge\n @mergeit.merge_data(@input_files)\n end", "title": "" }, { "docid": "998b2d0b4e63569b2595a53c152573fa", "score": "0.52476954", "text": "def merge_values!(values)\n # STUB: should make recorsive calls if need\n global_config[target] ||= {}\n global_config[target].merge!(values)\n end", "title": "" }, { "docid": "6eb5001b0b58e1c8ea5145afe6622e1d", "score": "0.52406746", "text": "def merge!(with); end", "title": "" }, { "docid": "86ce430ace4f5f8df379598618b6ec40", "score": "0.5240291", "text": "def merge_gemfiles(*path, unlock: [])\n gems_remotes = Set.new\n dependencies = Hash.new do |h, k|\n h[k] = Hash.new do |h, k|\n h[k] = Hash.new do |a, b|\n a[b] = Array.new\n end\n end\n end\n path.each do |gemfile|\n bundler_def = Bundler::Dsl.evaluate(gemfile, nil, [])\n gems_remotes |= bundler_def.send(:sources).rubygems_remotes.to_set\n bundler_def.dependencies.each do |d|\n d.groups.each do |group_name|\n if !d.platforms.empty?\n d.platforms.each do |platform_name|\n dependencies[group_name][platform_name][d.name] = d\n end\n else\n dependencies[group_name][''][d.name] = d\n end\n end\n end\n end\n\n contents = []\n gems_remotes.each do |g|\n g = g.to_s\n if g.end_with?('/')\n g = g[0..-2]\n end\n contents << \"source '#{g.to_s}'\"\n end\n dependencies.each do |group_name, by_platform|\n contents << \"group :#{group_name} do\"\n by_platform.each do |platform_name, deps|\n deps = deps.values.sort_by(&:name)\n if !platform_name.empty?\n contents << \" platform :#{platform_name} do\"\n platform_indent = \" \"\n end\n deps.each do |d|\n if d.source\n options = d.source.options.map { |k, v| \"#{k}: \\\"#{v}\\\"\" }\n end\n contents << [\" #{platform_indent}gem \\\"#{d.name}\\\", \\\"#{d.requirement}\\\"\", *options].join(\", \")\n end\n if !platform_name.empty?\n contents << \" end\"\n end\n end\n contents << \"end\"\n end\n contents.join(\"\\n\")\n end", "title": "" }, { "docid": "4290376bf9aed89bcee3470b1e2c86f9", "score": "0.52246255", "text": "def configure_build_configuration_settings(project, name, platforms)\n configure_project_build_configuration_settings(project, name)\n configure_primary_build_configuration_settings(project, name, platforms)\n configure_tests_build_configuration_settings(project, name, platforms)\nend", "title": "" }, { "docid": "167858e3388a585ba90decd56af6a830", "score": "0.52183914", "text": "def populate_defaults(config)\n new_config = DEFAULT_CEEDLING_CONFIG.deep_clone\n new_config.deep_merge!(config)\n config.replace(new_config)\n\n @configurator_builder.populate_defaults( config, DEFAULT_TOOLS_TEST )\n @configurator_builder.populate_defaults( config, DEFAULT_TOOLS_TEST_PREPROCESSORS ) if (config[:project][:use_test_preprocessor])\n @configurator_builder.populate_defaults( config, DEFAULT_TOOLS_TEST_DEPENDENCIES ) if (config[:project][:use_deep_dependencies])\n\n @configurator_builder.populate_defaults( config, DEFAULT_TOOLS_RELEASE ) if (config[:project][:release_build])\n @configurator_builder.populate_defaults( config, DEFAULT_TOOLS_RELEASE_ASSEMBLER ) if (config[:project][:release_build] and config[:release_build][:use_assembly])\n @configurator_builder.populate_defaults( config, DEFAULT_TOOLS_RELEASE_DEPENDENCIES ) if (config[:project][:release_build] and config[:project][:use_deep_dependencies])\n end", "title": "" }, { "docid": "43313530e6e4e58f13818f1512412fdf", "score": "0.5213068", "text": "def copy_configs\n template \"config/compass.rb\"\n template \"config/html5_rails.yml\"\n end", "title": "" }, { "docid": "5730bd6e9d64d492fb2c86e832cea2c3", "score": "0.5210979", "text": "def merge_i18n(barclamp, options={})\n options = {:debug => false}.merge! options\n debug = options[:debug] or ENV['DEBUG'] === \"true\"\n locales = barclamp['locale_additions']\n locales.each do |key, value|\n #translation file (can be multiple)\n f = File.join CROWBAR_PATH, 'config', 'locales', \"#{key}.yml\"\n if File.exist? f\n puts \"merging translation for #{f}\" if debug\n master = YAML.load_file f\n master = merge_tree(key, value, master)\n File.open( f, 'w' ) do |out|\n YAML.dump( master, out )\n end\n else\n puts \"WARNING: Did not attempt tranlation merge for #{f} because file was not found.\"\n end\n end\nend", "title": "" }, { "docid": "a4030fce0c5be6ac5a0123ea0cc97c31", "score": "0.5203278", "text": "def merge_with_default(config, config_file, unset_nil:)\n default_configuration = ConfigLoader.default_configuration\n\n disabled_by_default = config.for_all_cops['DisabledByDefault']\n enabled_by_default = config.for_all_cops['EnabledByDefault']\n\n if disabled_by_default || enabled_by_default\n default_configuration = transform(default_configuration) do |params|\n params.merge('Enabled' => !disabled_by_default)\n end\n end\n\n config = handle_disabled_by_default(config, default_configuration) if disabled_by_default\n\n opts = { inherit_mode: config['inherit_mode'] || {},\n unset_nil: unset_nil }\n Config.new(merge(default_configuration, config, **opts), config_file)\n end", "title": "" }, { "docid": "7aa4e18e028beda416672d0ee5337f8b", "score": "0.52015793", "text": "def merge_conflict?; end", "title": "" }, { "docid": "675ffa9e38b8e77a587bf3de67fe225a", "score": "0.5184978", "text": "def merge!(new_args); end", "title": "" }, { "docid": "a30b1136b6bf90b343f09ed111530668", "score": "0.5180788", "text": "def merge_with_default(config, config_file, unset_nil: true)\n resolver.merge_with_default(config, config_file, unset_nil: unset_nil)\n end", "title": "" }, { "docid": "f047923e0292349a8891d46a3fb4b8c4", "score": "0.5180193", "text": "def merge other_entry\n options = {\n :extracted_comment => merge_string(@extracted_comment,\n other_entry.extracted_comment),\n :translator_comment => merge_string(@translator_comment,\n other_entry.translator_comment),\n :references => merge_array(@references,\n other_entry.references),\n :flags => merge_array(@flags,\n other_entry.flags),\n }\n self.class.new(@msgid, options)\n end", "title": "" }, { "docid": "2c7af9f9dd50b898f6b16e6d0a4089f2", "score": "0.51702756", "text": "def merge_cli_settings!(settings, cli_settings)\n # Override any settings we passed in on the command line\n settings[:source] ||= {}\n settings[:source][:db] = cli_settings[:source_db] if cli_settings[:source_db]\n settings[:source][:db_host] = cli_settings[:source_db_host] if cli_settings[:source_db_host]\n settings[:source][:db_port] = cli_settings[:source_db_port].to_i if cli_settings[:source_db_port]\n settings[:source][:db_passwd] = cli_settings[:source_db_passwd] if cli_settings[:source_db_passwd]\n settings[:source][:db_username] = cli_settings[:source_db_username] if cli_settings[:source_db_username]\n settings[:source][:domain] = cli_settings[:source_domain] if cli_settings[:source_domain]\n settings[:source][:tracker_ip] = cli_settings[:source_tracker_ip] if cli_settings[:source_tracker_ip]\n settings[:source][:tracker_port] = cli_settings[:source_tracker_port] if cli_settings[:source_tracker_port]\n\n settings[:dest] ||= {}\n settings[:dest][:db] = cli_settings[:dest_db] if cli_settings[:dest_db]\n settings[:dest][:db_host] = cli_settings[:dest_db_host] if cli_settings[:dest_db_host]\n settings[:dest][:db_port] = cli_settings[:dest_db_port].to_i if cli_settings[:dest_db_port]\n settings[:dest][:db_passwd] = cli_settings[:dest_db_passwd] if cli_settings[:dest_db_passwd]\n settings[:dest][:db_username] = cli_settings[:dest_db_username] if cli_settings[:dest_db_username]\n settings[:dest][:domain] = cli_settings[:dest_domain] if cli_settings[:dest_domain]\n settings[:dest][:tracker_ip] = cli_settings[:dest_tracker_ip] if cli_settings[:dest_tracker_ip]\n settings[:dest][:tracker_port] = cli_settings[:dest_tracker_port] if cli_settings[:dest_tracker_port]\n end", "title": "" }, { "docid": "6e83e159c884b43612b13459c0753acd", "score": "0.5170261", "text": "def merge!(other)\n other.read_present.each do |k, v|\n write(k, v)\n end\n\n self\n end", "title": "" }, { "docid": "ba8c56db35f8d9b89c138cdffe0fbb35", "score": "0.51369244", "text": "def merge_sass_options(options, other_options)\n\t\t\t\tif (load_paths = options[:load_paths]) && (other_paths = other_options[:load_paths])\n\t\t\t\t\tother_options[:load_paths] = other_paths + load_paths\n\t\t\t\tend\n\t\t\t\toptions.merge other_options\n\t\t\tend", "title": "" }, { "docid": "087e1ccc127733779d1c33a5c22f77a2", "score": "0.5135801", "text": "def common_build\n puts \"common_build dir=#{pwd} #{SHOES_TGT_ARCH}\"\n #mkdir_p \"#{TGT_DIR}/ruby\"\n #cp_r \"#{EXT_RUBY}/lib/ruby/#{RUBY_V}\", \"#{TGT_DIR}/ruby/lib\"\n %w[req/ftsearch/lib/* req/rake/lib/*].each do |rdir|\n FileList[rdir].each { |rlib| cp_r rlib, \"#{TGT_DIR}/lib/ruby/#{TGT_RUBY_V}\" }\n end\n %w[req/ftsearch/ext/ftsearchrt req/chipmunk/ext/chipmunk].\n #%w[req/binject/ext/binject_c req/ftsearch/ext/ftsearchrt req/bloopsaphone/ext/bloops req/chipmunk/ext/chipmunk].\n each { |xdir| copy_ext xdir, \"#{TGT_DIR}/lib/ruby/#{TGT_RUBY_V}/#{SHOES_TGT_ARCH}\" }\n\n gdir = \"#{TGT_DIR}/lib/ruby/gems/#{RUBY_V}\"\n {'hpricot' => 'lib', 'sqlite3' => 'lib'}.each do |gemn, xdir|\n #{'hpricot' => 'lib', 'json' => 'lib/json/ext', 'sqlite3' => 'lib'}.each do |gemn, xdir|\n spec = eval(File.read(\"req/#{gemn}/gemspec\"))\n mkdir_p \"#{gdir}/specifications\"\n mkdir_p \"#{gdir}/gems/#{spec.full_name}/lib\"\n FileList[\"req/#{gemn}/lib/*\"].each { |rlib| cp_r rlib, \"#{gdir}/gems/#{spec.full_name}/lib\" }\n mkdir_p \"#{gdir}/gems/#{spec.full_name}/#{xdir}\"\n FileList[\"req/#{gemn}/ext/*\"].each { |elib| copy_ext elib, \"#{gdir}/gems/#{spec.full_name}/#{xdir}\" }\n cp \"req/#{gemn}/gemspec\", \"#{gdir}/specifications/#{spec.full_name}.gemspec\"\n end\n end", "title": "" }, { "docid": "f740693f2ad6e83870e7462b6b90ebd7", "score": "0.51186603", "text": "def config_build config_file, config_vars={}, parse=false\n @logger.debug \"Using config file #{config_file}.\"\n validate_file_input(config_file, \"config\")\n if config_vars.length > 0 or parse or contains_liquid(config_file)\n @logger.debug \"Config_vars: #{config_vars.length}\"\n # If config variables are passed on the CLI, we want to parse the config file\n # and use the parsed version for the rest fo this routine\n config_out = \"#{@build_dir}/pre/#{File.basename(config_file)}\"\n vars = DataObj.new()\n vars.add_data!(\"vars\", config_vars)\n liquify(vars, config_file, config_out)\n config_file = config_out\n @logger.debug \"Config parsed! Using #{config_out} for build.\"\n validate_file_input(config_file, \"config\")\n end\n begin\n config = YAML.load_file(config_file)\n rescue Exception => ex\n unless File.exists?(config_file)\n @logger.error \"Config file #{config_file} not found.\"\n else\n @logger.error \"Problem loading config file #{config_file}. #{ex} Exiting.\"\n end\n raise \"ConfigFileError\"\n end\n cfg = BuildConfig.new(config) # convert the config file to a new object called 'cfg'\n if @safemode\n commands = \"\"\n cfg.steps.each do |step|\n if step['action'] == \"execute\"\n commands = commands + \"> \" + step['command'] + \"\\n\"\n end\n end\n unless commands.to_s.strip.empty?\n puts \"\\nWARNING: This routine will execute the following shell commands:\\n\\n#{commands}\"\n ui = HighLine.new\n answer = ui.ask(\"\\nDo you approve? (YES/no): \")\n raise \"CommandExecutionsNotAuthorized\" unless answer.strip == \"YES\"\n end\n end\n iterate_build(cfg)\nend", "title": "" }, { "docid": "ec9e09bf813682c51f58489b59ae55b9", "score": "0.5111575", "text": "def merge_info(parent, child, opt1, opt2)\n result = Dependency.merge_dependency_options(opt1, opt2)\n update_triggers_for(parent, child, result)\n result\n rescue Exception => e\n raise e, e.message + \" while updating the dependency information for #{parent} -> #{child}\", e.backtrace\n end", "title": "" }, { "docid": "3b2700c4306a48160a2b1071a228b55a", "score": "0.5107174", "text": "def merge_i18n(barclamp)\n locales = barclamp['locale_additions']\n locales.each do |key, value|\n #translation file (can be multiple)\n f = File.join CROWBAR_PATH, 'config', 'locales', \"#{key}.yml\"\n if File.exist? f\n puts \"merging translation for #{f}\" if DEBUG\n master = YAML.load_file f\n master = merge_tree(key, value, master)\n File.open( f, 'w' ) do |out|\n YAML.dump( master, out )\n end\n else\n puts \"WARNING: Did not attempt tranlation merge for #{f} because file was not found.\"\n end\n end\n end", "title": "" }, { "docid": "b8ceec952c322ad2d8e77af98a6499a0", "score": "0.508143", "text": "def gdal_merge(input_files, output_file, merge_strategy = :lossless)\n return nil if input_files.length == 0\n return CDBTool.link_output(input_files[0], output_file) if input_files.length == 1\n\n command = case merge_strategy\n when :lossless\n \"gdal_merge.py -o #{output_file} -co BIGTIFF=YES -co COMPRESS=LZW -co NUM_THREADS=ALL_CPUS -co TILED=YES -n 0 -a_nodata 0 #{input_files.join(\" \")}\"\n when :lossy\n \"gdal_merge.py -o #{output_file} -co BIGTIFF=YES -co COMPRESS=JPEG -co TILED=YES #{input_files.join(\" \")}\"\n end\n\n merge = Mixlib::ShellOut.new(command, live_stdout: $stdout, live_stderr: $stderr)\n\n if File.exists?(output_file)\n puts \"Output exists, skipping merge command.\"\n else\n puts command\n merge.run_command\n $mosaic.log(\"#{output_file},#{File.size(output_file)},#{merge.execution_time}s\")\n end\nend", "title": "" }, { "docid": "c59e2f67706f13c3860326f7a0791217", "score": "0.50809693", "text": "def merge(updates = {})\n dup.update(updates)\n end", "title": "" }, { "docid": "59975f4abeadb4c25643dbe7bda49649", "score": "0.50736314", "text": "def merge(other)\n result = super\n\n result.sources = other.sources + self.sources\n result\n end", "title": "" }, { "docid": "50cb3267f683ac12858952a8c6134349", "score": "0.5058396", "text": "def merge_conf_directives(config_file, cfg)\n Chef::Log.info \"YAML config file: #{config_file}, conf directive entries: #{cfg}\"\n # Always backup\n bak_file = config_file.sub('.yaml', '_template.yaml')\n File.rename(config_file, bak_file)\n yaml = YAML::load_file(bak_file)\n puts cfg\n\n cfg.each_key { |key|\n if key == \"data_file_directories\"\n val = parse_json(cfg[key]).split(\",\")\n elsif key == \"seed_provider\"\n val = cfg[key]\n else\n val = parse_json(cfg[key])\n end\n yaml[key] = val\n }\n Chef::Log.info \"Merged cassandra YAML config: #{yaml.to_yaml}\"\n\n File.open(config_file, 'w') { |f|\n f.write <<-EOF\n# Cassandra storage config YAML\n#\n# NOTE:\n# See http://wiki.apache.org/cassandra/StorageConfiguration\n# or #{bak_file} file for full\n# explanations of configuration directives\n# /NOTE\n#\n# Auto generated by Cassandra cookbook\n EOF\n f.write yaml.to_yaml\n Chef::Log.info \"Saved YAML config to #{config_file}\"\n }\n end", "title": "" }, { "docid": "95f718c6f0885a0f2ea4f00ba7a47a37", "score": "0.5053993", "text": "def merge!(other); end", "title": "" }, { "docid": "50ad7fa776218f9ac9279150b955ac33", "score": "0.50417346", "text": "def update_config(current, new)\n current.merge! new\n end", "title": "" }, { "docid": "9d8e8476e6bd55dff5d690298bfa23de", "score": "0.50289595", "text": "def configure_primary_build_configuration_settings(project, name, platforms)\n\n platforms.each do |platform|\n\n # FIXME: abstract away\n target = project.targets.find { |y| y.name == \"#{name} #{platform}\" }\n\n settings = {\n 'INFOPLIST_FILE' => \"#{name}/Info.plist\",\n 'ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES' => 'NO',\n 'PRODUCT_NAME' => \"#{name}\",\n 'CODE_SIGN_IDENTITY[sdk=iphoneos*]' => \"-\",\n 'PRODUCT_BUNDLE_IDENTIFIER' => \"com.dn-m.#{name}\"\n }\n\n settings.each do |key, val|\n target.build_configuration_list.set_setting(key, val)\n end\n end\nend", "title": "" }, { "docid": "c20095955785ece9efe952740fd00acb", "score": "0.5012368", "text": "def update_buildfile\n buildfile = change_version { |version| # THIS_VERSION minus SNAPSHOT\n resolve_next_version(this_version) # THIS_VERSION\n }\n File.open(Rake.application.rakefile.to_s, 'w') { |file| file.write buildfile }\n end", "title": "" }, { "docid": "0757a244bc045d7f03c15f4ff71ac013", "score": "0.5010585", "text": "def copy_config_files\n copy_file 'config/arkivo.yml', 'config/arkivo.yml'\n copy_file 'config/zotero.yml', 'config/zotero.yml'\n end", "title": "" }, { "docid": "a9e52cc97afd868366d38ba7f1e4530e", "score": "0.5008871", "text": "def merge(doc)\n src = open_pdoc(doc)\n merge_pdoc(src)\n end", "title": "" }, { "docid": "004d68225c0564fc4df9014a484065c5", "score": "0.5003236", "text": "def _combine\n @@round = @@round + 1\n files = @files.values\n @file_list = []\n\n files.each {|f| _include_file(f) }\n \n content = \"$theme: '\" + @options[:theme] + \"';\"\n\n content += @file_list.map {|file|\n \"@_chance_file \" + @files.key(file[:path]) + \";\\n\" + file[:content]\n }.join(\"\\n\")\n\n content\n end", "title": "" }, { "docid": "d0716274dc9dae6c53064bc6b267707f", "score": "0.50031275", "text": "def merge_log4j_directives(log4j_file, cfg)\n Chef::Log.info \"Log4j file: #{log4j_file}, log4j directive entries: #{cfg}\"\n # Always backup\n bak_file = log4j_file.sub('.properties', '_template.properties')\n File.rename(log4j_file, bak_file)\n log_props = load_properties(bak_file)\n cfg.each_key { |key|\n val = parse_json(cfg[key])\n log_props[key] = val\n }\n Chef::Log.info \"Merged cassandra log4j : #{log_props.to_yaml}\"\n File.open(log4j_file, 'w') { |f|\n log_props.each {|key,value| f.puts \"#{key}=#{value}\\n\" }\n Chef::Log.info \"Saved Log4j config to #{log4j_file}\"\n }\n end", "title": "" }, { "docid": "d5c55b6c8c012813a833dcfd72da10c8", "score": "0.5002176", "text": "def dsl_merge_file(read_file)\n raise WawError, \"Missing .wawaccess file #{readfile}\" unless File.file?(read_file)\n dsl_merge(File.read(read_file), read_file)\n self\n end", "title": "" }, { "docid": "991453515c2fd62912108a361b4f1af5", "score": "0.49974847", "text": "def merged_config_for_generator\n return {}\n end", "title": "" }, { "docid": "d480eb41c4621cadcd25b0393cd76592", "score": "0.4994268", "text": "def update_buildfile\n buildfile = change_version { |version| # THIS_VERSION minus SNAPSHOT\n resolve_next_version(this_version) # THIS_VERSION\n }\n File.open(version_file, 'w') { |file| file.write buildfile }\n end", "title": "" }, { "docid": "63b347389f5b20e1127b6e18162dc998", "score": "0.49806005", "text": "def swap_builds_and_sources\n unless defined?(@swap_builds)\n self.swap_builds_and_sources = DEFAULT_SWAP_BUILDS\n end\n\n @swap_builds\n end", "title": "" }, { "docid": "10e86e0d786a3e7ef46436a1e88cfbea", "score": "0.49771875", "text": "def merge(file, *times)\n\tparts = []\n\tsplit! file, *times do |out|\n\t\tparts << out \n\tend\n\tparts = parts.join ' + '\n\tout = merge_name(file, *times)\n\tsystem \"mkvmerge -o #{out} #{parts}\"\nend", "title": "" }, { "docid": "880666b4f25339ffa300ce87b6186d7a", "score": "0.4967871", "text": "def add_build_configuration(name, type, skip_existing_names = true)\n unless build_configuration_list[name]\n build_configuration = project.new(XCBuildConfiguration)\n build_configuration.name = name\n build_configuration.build_settings = ProjectHelper.common_build_settings(type, platform_name, deployment_target, product_type)\n build_configuration_list.build_configurations << build_configuration\n build_configuration\n end\n end", "title": "" }, { "docid": "18c85a423909c455ee52ea5356cc47c6", "score": "0.49669695", "text": "def merge_changelog(current_env,back_env)\n changelog_control = ProtesteGenerateApplication::ChangelogControl.new(current_env)\n changelog_control.merge(back_env)\nend", "title": "" }, { "docid": "6a5ded8202a98772b4790966a8db20d4", "score": "0.49663812", "text": "def copy_project_dependencies_for_awestruct_image\n\n puts \"- Copying project dependencies into '_docker/awestruct' for build...\"\n\n parent_gemfile = File.open '../Gemfile'\n parent_gemlock = File.open '../Gemfile.lock'\n\n target_gemfile = FileHelpers.open_or_new('awestruct/Gemfile')\n target_gemlock = FileHelpers.open_or_new('awestruct/Gemfile.lock')\n #Only copy if the file has changed. Otherwise docker won't cache optimally\n FileHelpers.copy_if_changed(parent_gemfile, target_gemfile)\n FileHelpers.copy_if_changed(parent_gemlock, target_gemlock)\n\n puts \"- Successfully copied project dependencies into '_docker/awestruct' for build.\"\n\nend", "title": "" }, { "docid": "525a4c636121904f7ba6162e7e02ca28", "score": "0.49579984", "text": "def update_config\n if File.exist?(config_file) then\n puts \"updating #{config_file}\"\n config = YAML.load_file(config_file)\n else\n puts \"generating #{config_file}\"\n config = {}\n end\n\n files = Dir.glob(File.join(libdir, '**', \"rbconfig.rb\")).sort\n\n files.each do |rbconfig|\n version = rbconfig.match(/.*-(\\d.\\d.\\d)/)[1]\n config[\"rbconfig-#{version}\"] = rbconfig\n puts \"Found Ruby version #{version} (#{rbconfig})\"\n end\n\n mkdir_p(File.dirname(config_file))\n\n File.open(config_file, 'w') do |f|\n f.puts(config.to_yaml)\n end\n end", "title": "" }, { "docid": "7064b76217cfab73ca594271d8ab62bc", "score": "0.49566382", "text": "def merge_use_idml_or_folio(options)\n input_folio_base_dir = config.compute_base_dir(\n options['base-dir'] || options['base-dir-1'] || :folio_import_dir\n )\n input_idml_base_dir = config.compute_base_dir(\n options['base-dir-2'] || :idml_import_dir\n )\n input_file_selector = config.compute_file_selector(\n options['file-selector'] || :all_files\n )\n input_file_extension = config.compute_file_extension(\n options['file-extension'] || :at_extension\n )\n output_base_dir = config.base_dir(:staging_dir)\n $stderr.puts ''\n $stderr.puts '-' * 80\n $stderr.puts 'Using either idml_at or folio_at for content_at'\n start_time = Time.now\n total_count = 0\n success_count = 0\n idml_used_count = 0\n folio_used_count = 0\n\n # TODO: refactor this method to use Cli::Utils so that the changed-only flag works\n\n # First get union of all Folio and Idml files\n folio_files = Dir.glob([input_folio_base_dir, input_file_selector, input_file_extension].join)\n idml_files = Dir.glob([input_idml_base_dir, input_file_selector, input_file_extension].join)\n all_output_files = (folio_files + idml_files).map { |e|\n # process folio files\n e = e.gsub(input_folio_base_dir, output_base_dir)\n .gsub(/\\.folio\\.at\\z/, '.at')\n # process idml files\n e = e.gsub(input_idml_base_dir, output_base_dir)\n .gsub(/\\.idml\\.at\\z/, '.at')\n }.uniq.sort\n all_output_files.each do |output_file_name|\n if output_file_name !~ /\\.at\\z/\n $stderr.puts \" - Skip #{ output_file_name }\"\n next\n end\n\n total_count += 1\n\n # prepare paths\n at_folio_file_name = output_file_name.gsub(output_base_dir, input_folio_base_dir).gsub(/\\.at\\z/, '.folio.at')\n at_idml_file_name = output_file_name.gsub(output_base_dir, input_idml_base_dir).gsub(/\\.at\\z/, '.idml.at')\n\n if File.exist?(at_idml_file_name)\n # Idml is present, use it\n FileUtils.mkdir_p(File.dirname(output_file_name))\n idml_at = File.read(at_idml_file_name)\n # write to file\n File.write(output_file_name, idml_at)\n success_count += 1\n idml_used_count += 1\n $stderr.puts \" Use #{ at_idml_file_name }\"\n elsif File.exist?(at_folio_file_name)\n # IDML file is not present, bt folio is, use it\n FileUtils.mkdir_p(File.dirname(output_file_name))\n folio_at = File.read(at_folio_file_name)\n # write to file\n File.write(output_file_name, folio_at)\n success_count += 1\n folio_used_count += 1\n $stderr.puts \" Use #{ at_folio_file_name }\"\n else\n raise \"Could find neither Folio nor IDML file! (#{ output_file_name })\"\n end\n end\n\n $stderr.puts \"Finished merging #{ success_count } of #{ total_count } files in #{ Time.now - start_time } seconds.\"\n $stderr.puts \" - IDML files used: #{ idml_used_count }\"\n $stderr.puts \" - Folio files used: #{ folio_used_count }\"\n $stderr.puts '-' * 80\n end", "title": "" }, { "docid": "4197c2e35135aa00f7cc3238b23cb5bd", "score": "0.49555978", "text": "def update_sources\n source_files_path = Dir['config/locales/**/*.en-EU.yml']\n source_files_path.each do |path|\n puts \"update #{path}\"\n @crowdin.update_file([{ dest: \"/#{File.basename(path).gsub('en-EU', 'en')}\",\n source: path }])\n end\n\n source_files_path = Dir['config/locales/main/en-EU.yml']\n source_files_path.each do |path|\n puts \"update #{path}\"\n @crowdin.update_file([{ dest: '/main.en.yml',\n source: path }])\n end\n end", "title": "" }, { "docid": "6c2c97b20f9894b0a2f74ffedf89fd66", "score": "0.49541384", "text": "def perform_additional_merge_operations!(other)\n end", "title": "" }, { "docid": "315cab85b8ca1538145e28a432c24c90", "score": "0.4948044", "text": "def apply_configuration_data!(vars)\n if merge_vars = vars[\"merge\"]\n append(merge_vars)\n end\n if append_vars = vars[\"append\"]\n merge_flags(append_vars)\n end\n if parse_vars = vars[\"parse\"]\n parse_vars.each do |parse_string|\n parse_flags!(parse_string)\n end\n end\n end", "title": "" }, { "docid": "f4660f659b99396b22cb4a906d9c7c47", "score": "0.4945405", "text": "def merge_config_layers(*config_data)\n config_data.inject({}) do |acc, config|\n acc.merge(config) do |key, val1, val2|\n case key\n # Shallow merge config for each plugin\n when 'plugins'\n val1.merge(val2) { |_, v1, v2| v1.merge(v2) }\n # Transports are deep merged\n when *TRANSPORT_CONFIG.keys\n Bolt::Util.deep_merge(val1, val2)\n # Hash values are shallow merged\n when 'apply-settings', 'log', 'plugin-hooks', 'puppetdb', 'puppetdb-instances'\n val1.merge(val2)\n # Disabled warnings are concatenated\n when 'disable-warnings'\n val1.concat(val2)\n when 'analytics'\n val1 && val2\n # All other values are overwritten\n else\n val2\n end\n end\n end\n end", "title": "" }, { "docid": "e0cb84670205e6e981db86db956cde10", "score": "0.4940841", "text": "def merge_from(other)\n @title = other.title unless other.title.to_s.empty?\n @descriptions[:default] = other.descriptions[:default] unless other.descriptions[:default].to_s.empty?\n @impact = other.impact unless other.impact.nil?\n other.tags.each do |ot|\n tag = @tags.detect { |t| t.key == ot.key }\n tag ? tag.value = ot.value : @tags.push(ot)\n end\n self\n end", "title": "" }, { "docid": "d185a355c8b5f329306ebdcf50b88812", "score": "0.49388736", "text": "def merge(other)\n @actions += other.actions\n @errors += other.errors\n @warnings += other.warnings\n @notices += other.notices\n end", "title": "" }, { "docid": "eca4c7d49fbf85d1dc0c688f86901896", "score": "0.49374995", "text": "def merge(*files)\n files.each do |f|\n f = check_for_file(f)\n @merged << f\n end\n end", "title": "" }, { "docid": "e11b8efe92e29448f43de61ef0f5d9c1", "score": "0.49330455", "text": "def merge_to_project(options = {})\n $merge = true \n @opt = {\n :proj_id => nil, \n :person_id => nil,\n :postfix_otu_names => false,\n :postfix_chr_names => false\n }.merge!(options.symbolize_keys)\n\n return false if !@opt[:proj_id] || !@opt[:person_id]\n return false if !@proj = Proj.find(@opt[:proj_id])\n return false if !@person = Person.find(@opt[:person_id])\n\n $proj_id = @proj.id \n $person_id = @person.id\n\n begin\n Proj.transaction do \n # try and do a little matching/transfer in a few cases (could also extend to Keywords)\n self.content_types.each do |o|\n if ct = ContentType.find(:first, :conditions => {:proj_id => @proj.id, :name => o.name})\n # update the templates \n self.content_templates_content_types.each do |ctct|\n if ctct.content_type.name == ct.name\n ctct.content_type = ct\n ctct.save\n end\n end\n \n # update the content\n self.contents.each do |c|\n if c.content_type.name == ct.name\n c.content_type = ct\n c.save\n end\n end \n\n # update the mapped_chr_groups\n self.chr_groups.each do |cg|\n if !cg.content_type.blank? && cg.content_type.name == ct.name\n cg.content_type = ct\n cg.save\n end\n end \n # we have to only delete the merged object below\n end\n end\n\n self.genes.each do |g|\n if g = Gene.find(:first, :conditions => {:proj_id => @proj.id, :name => g.name})\n self.primers.each do |p|\n p.gene = g\n p.save\n end\n self.seqs.each do |s|\n s.gene = g\n s.save\n end\n end\n end\n\n # loop the remaining types\n [:has_many, :has_one, :has_and_belongs_to_many].each do |rel|\n Proj.reflect_on_all_associations(rel).collect{|o| o.name}.each do |r| # r is the class name \n next if r == :text_content_types\n case r\n when :content_types \n self.send(r).each do |o|\n if @ct = ContentType.find(:first, :conditions => {:proj_id => @proj.id, :name => o.name})\n o.destroy \n else\n o.proj_id = @opt[:proj_id]\n o.save\n end \n end \n \n when :genes\n self.send(r).each do |o|\n if @g = Gene.find(:first, :conditions => {:proj_id => @proj.id, :name => o.name})\n o.destroy \n else\n o.proj_id = @opt[:proj_id]\n o.save\n end \n end \n \n when :people\n # do nothing, these remain in the project to be deleted later, otherwise they get touched an pwds get borked\n\n else \n t = self.send(r).each do |o|\n @o = o\n @r = r\n o.name = \"#{o.name} [from: #{o.proj_id}]\" if (@opt[:postfix_otu_names] && o.class == Otu) || (@opt[:postfix_chr_names] && o.class == Chr)\n o.proj_id = @opt[:proj_id]\n o.save\n end\n end\n end\n end # end rel types\n end # end transaction\n\n rescue Exception => e\n $merge = false\n raise \"#{e} o:(#{@o.to_yaml}) o_class: #{@o.class.to_s} r:(#{@r}) p:(#{@proj.id})\"\n end\n $merge = false\n true\n end", "title": "" }, { "docid": "24c18d462fe44132051d3b7751795af1", "score": "0.49313706", "text": "def merge(headers_or_env); end", "title": "" }, { "docid": "56eaadda32dd0e5f6f1f26265024ef56", "score": "0.49130124", "text": "def merge(*args)\n options = Hash === args.last ? args.pop : {}\n files = to_artifacts(args)\n rake_check_options options, :path\n raise ArgumentError, \"Expected at least one file to merge\" if files.empty?\n path = options[:path] || @path\n expanders = files.collect do |file|\n @sources << proc { file.to_s }\n expander = ZipExpander.new(file)\n @actions << proc do |file_map, transform_map|\n file.invoke() if file.is_a?(Rake::Task)\n expander.expand(file_map, transform_map, path)\n end\n expander\n end\n Merge.new(expanders)\n end", "title": "" }, { "docid": "adc05e6f5ba6fc2738edf8f5f61f2d57", "score": "0.49072114", "text": "def build_combined\n\tself.update_aliases\n\t\n\tcompiler = Closure::Compiler.new\n\t\n\toutput = compiler.compile_files(\n\t\t[\"jquery.syntax.js\", \"jquery.syntax.cache.js\"]\n\t)\n\t\n\tFile.open(MINIFIED_FILE, \"w\") do |file|\n\t\tfile.write(LICENSE)\n\t\tfile.write(output)\n\tend\nend", "title": "" }, { "docid": "8c2404aea3577f402d799c3f8508d17a", "score": "0.49004537", "text": "def merge_env opts\n @envars = @@default_envars\n if opts.key?(:with)\n @envars.concat(opts[:with]).uniq!\n opts.delete(:with)\n end\n if opts.key?(:without)\n @envars -= opts[:without]\n opts.delete(:without)\n end\n end", "title": "" }, { "docid": "5a1ed72f5386e6409c52960719a97ca5", "score": "0.48982596", "text": "def merge!( other )\n\t\t\tcase other\n\t\t\twhen Hash\n\t\t\t\t@hash = self.to_h.merge( other,\n\t\t\t\t\t&HashMergeFunction )\n\n\t\t\twhen ConfigStruct\n\t\t\t\t@hash = self.to_h.merge( other.to_h,\n\t\t\t\t\t&HashMergeFunction )\n\n\t\t\twhen Arrow::Config\n\t\t\t\t@hash = self.to_h.merge( other.struct.to_h,\n\t\t\t\t\t&HashMergeFunction )\n\n\t\t\telse\n\t\t\t\traise TypeError,\n\t\t\t\t\t\"Don't know how to merge with a %p\" % other.class\n\t\t\tend\n\n\t\t\t# :TODO: Actually check to see if anything has changed?\n\t\t\t@dirty = true\n\n\t\t\treturn self\n\t\tend", "title": "" }, { "docid": "9db445d8a7c373c85d72d769433fc1e8", "score": "0.4892264", "text": "def merge(stmt2)\n # print each statement to a file\n [ [ @rows, \"/tmp/merge.1\" ],\n [ stmt2.rows, \"/tmp/merge.2\" ] ].each do | cur_rows, cur_file |\n f = File.open(cur_file, \"w\")\n cur_rows.each do |row| \n if !row[0].nil?\n f.puts(row[0].text) \n end\n end\n f.close\n end\n \n # run an sdiff on it\n @diffs = []\n IO.popen(\"sdiff -w1 /tmp/merge.1 /tmp/merge.2\") do |f|\n f.each { |line| @diffs.push(line.chomp) }\n end\n system(\"rm /tmp/merge.1 /tmp/merge.2\")\n \n # paralellize the arrays, by inserting blank rows\n @diffs.each_with_index do |cur_diff,idx|\n if cur_diff == \"<\"\n new_row = [@rows[idx][0]]\n while new_row.length < stmt2.rows[idx].length\n new_row.push(Cell.new)\n end\n stmt2.rows.insert(idx,new_row)\n elsif cur_diff == \">\"\n new_row = [stmt2.rows[idx][0]]\n while new_row.length < @rows[idx].length\n new_row.push(Cell.new)\n end\n @rows.insert(idx,new_row)\n else\n end\n end\n \n # merge them together\n @rows.size.times do |i|\n @rows[i].concat(stmt2.rows[i])\n end\n end", "title": "" }, { "docid": "03f2d7a508f7a03314938b3f8011274d", "score": "0.48788303", "text": "def config_files(override); end", "title": "" }, { "docid": "db043bff24ee4f72cbcc407b2c5e8663", "score": "0.48775408", "text": "def combine_files(file1, file2)\n new_coverage = combine_coverages(file1.coverage, file2.coverage)\n # NOTE: It is possible that both don't exist but eventually either one does or it's just one of the names that was\n # used in the code\n new_filename = strict_file_exists?(file1.filename) ? file1.filename : file2.filename\n SimpleCov::SourceFile.new(new_filename, new_coverage)\n end", "title": "" } ]
00b628bf3453b6aad7362f4fc47d3af8
Returns the value of attribute combining_class. source://mail//lib/mail/multibyte/unicode.rb12
[ { "docid": "f5e09e5e6737a4d8652669383902867b", "score": "0.64018345", "text": "def combining_class; end", "title": "" } ]
[ { "docid": "e0c3143e12de50494b57886186de7f49", "score": "0.6109653", "text": "def class_value\n @pairs.fetch(\"class\", \"\")\n end", "title": "" }, { "docid": "47f6428d53b6d3aebc115e372d1d1422", "score": "0.5938113", "text": "def get_comp_type\n \tcomp_type_value = ''\n \tcomp_type = self.attribute_values.joins(:label_attribute).where(\"label_attributes.short_label like '%Comp Type%'\").first\n \tif comp_type.present?\n \t\tcomp_type_value = comp_type.value\n \tend\t\n \treturn comp_type_value\n end", "title": "" }, { "docid": "47f6428d53b6d3aebc115e372d1d1422", "score": "0.5938113", "text": "def get_comp_type\n \tcomp_type_value = ''\n \tcomp_type = self.attribute_values.joins(:label_attribute).where(\"label_attributes.short_label like '%Comp Type%'\").first\n \tif comp_type.present?\n \t\tcomp_type_value = comp_type.value\n \tend\t\n \treturn comp_type_value\n end", "title": "" }, { "docid": "8eac6378b07f192e40f15a5b1ed11b1c", "score": "0.5790322", "text": "def get_comp_type\n comp_type_value = ''\n comp_type = self.attribute_values.joins(:label_attribute).where(\"label_attributes.short_label like '%Comp Type%'\").first\n if comp_type.present?\n comp_type_value = comp_type.value\n end \n return comp_type_value\n end", "title": "" }, { "docid": "3c1e8a52f2e416429ccdc81617a25b49", "score": "0.5691711", "text": "def class_type(element_key)\n class_key = class_key(element_key)\n return 'MI' if class_key.upcase.end_with?('_MI')\n\n return 'FD' if class_key.upcase.end_with?('_FD', '_WF')\n\n 'DO'\n end", "title": "" }, { "docid": "d4b937bd639aa414d4c0b6e9558b56bc", "score": "0.56325644", "text": "def getclass _alias\r\n\t\t\t\tCharClasses.get _alias\r\n\t\t\tend", "title": "" }, { "docid": "0b72240d343fa4792410498125376b34", "score": "0.55980223", "text": "def get_class instance\n\t\tinstance.toString.split(\",\")[instance.numAttributes() - 1]\n\tend", "title": "" }, { "docid": "b081919508bf58acf6d9e5897c084bd3", "score": "0.55248475", "text": "def class_code\n return @class_code\n end", "title": "" }, { "docid": "6e89176bb753b969765df655772d318a", "score": "0.54918844", "text": "def combining_class=(_arg0); end", "title": "" }, { "docid": "00d830a36505074013c2527ecb308282", "score": "0.5462415", "text": "def get_class_name(type, class_name=nil)\n class_name = 'mailer-form' if class_name.nil? and %(form).include? type\n class_name = 'mailer-field' if class_name.nil? and %(text password file select textarea).include? type\n class_name = 'mailer-button' if class_name.nil? and %(submit reset).include? type\n class_name = 'mailer-option' if class_name.nil? and %(checkbox radio).include? type\n class_name\n end", "title": "" }, { "docid": "8d87a718a3785457eef1f844da794882", "score": "0.5424586", "text": "def class_name\n self[:type] || self.class.to_s\n end", "title": "" }, { "docid": "307766d7a8f94d1443fb258465606b5e", "score": "0.5397254", "text": "def ruby_class\n attributes[\"ruby_class\"]\n end", "title": "" }, { "docid": "737756798b834707fbf26ff152dc0ebb", "score": "0.53694826", "text": "def class_plus\n case @object\n when Array\n object_classes = element_classes(@object.map {|e| e.class }.uniq)\n if object_classes\n \"Array<#{object_classes}>\"\n else\n \"Array\"\n end\n else\n @object.class.name\n end\n end", "title": "" }, { "docid": "0bfe95e470f9052d3ea5e66bd3605064", "score": "0.5356946", "text": "def derive_class_name\n return (options[:class_name] ? options[:class_name].to_s : expanded_name).classify\n end", "title": "" }, { "docid": "841502d4f483417526efa2e8b1981a14", "score": "0.5306031", "text": "def class_name\n return @class_name unless @class_name.nil?\n @class_name = _root.type_ids[class_idx].type_name\n @class_name\n end", "title": "" }, { "docid": "841502d4f483417526efa2e8b1981a14", "score": "0.5306031", "text": "def class_name\n return @class_name unless @class_name.nil?\n @class_name = _root.type_ids[class_idx].type_name\n @class_name\n end", "title": "" }, { "docid": "fb36a544ec7e2d927d5196ce9b468620", "score": "0.52949196", "text": "def assemble_class_names\n CHARACTER_CLASSES.keys\n end", "title": "" }, { "docid": "07a6c445acdf8ebd839e5c38a4ce072f", "score": "0.529174", "text": "def class_name\n attribute 'class'\n end", "title": "" }, { "docid": "b90324813d0c76a4156be73353697782", "score": "0.5281173", "text": "def human_rrclass\n if self[:name].dns.is_a? MDNS\n self.class::CLASSES.key(self.rrclass & 0x7fff) || '0x%04x' % (self.rrclass & 0x7fff)\n else\n self.class::CLASSES.key(self.rrclass) || '0x%04x' % self.rrclass\n end\n end", "title": "" }, { "docid": "22f12159a0eb41089ed09a70cc3878f1", "score": "0.5279619", "text": "def class_name\n @class_name ||= type.underscore.classify\n end", "title": "" }, { "docid": "e5581be7402269942d8b3806572bc455", "score": "0.5275869", "text": "def to_class(name)\n if name == :types || name == :etype\n result = \"type\"\n elsif name == :nicknames\n result = \"nickname\"\n else\n result = name.to_s.gsub('_','-')\n end\n result\n end", "title": "" }, { "docid": "c76db2643ddbaf05a85fbd3a91f388a1", "score": "0.52623534", "text": "def cim_class_name\n if defined?(@cim_class_name)\n return @cim_class_name\n end\n to_s\n end", "title": "" }, { "docid": "23a5b658da797c32858ce9042a6f345c", "score": "0.52541566", "text": "def seqclass\n if @seqclass then\n @seqclass\n else\n klass = nil\n each_seq do |s|\n if s then\n klass = s.class\n break if klass\n end\n end\n (klass or String)\n end\n end", "title": "" }, { "docid": "e6ec47a86433bcf9b8ea1d3a3c155c7b", "score": "0.52380615", "text": "def building_class\n self.dig_for_string(\"buildingClass\")\n end", "title": "" }, { "docid": "30ec52a89bf133466eb0fdb540c3d082", "score": "0.52306974", "text": "def class_name\n %x{\n var first = self[0];\n return (first && first.className) || \"\";\n }\n end", "title": "" }, { "docid": "cb68ce95c107583cf2774e740180d7f0", "score": "0.52105176", "text": "def result_class\n Geocoder::Result.const_get(self.class.to_s.split(\":\").last)\n end", "title": "" }, { "docid": "4a19f4c54784ab93d4d71818156a37b5", "score": "0.5199415", "text": "def list_class\n\t\tif self.resource_type_id\n\t\t\tif self.property_id\n\t\t\t\treturn 'rp'\n\t\t\telse\n\t\t\t\treturn 'r'\n\t\t\tend\n\t\telse\n\t\t\treturn 's'\n\t\tend\n\tend", "title": "" }, { "docid": "aba3a24400b750494d6220344c5d3e31", "score": "0.5186743", "text": "def generate_char_class(val)\n if(md = val.match(/^\\[\\:(\\^)?(\\w+)\\:\\]$/))\n reverse = (md[1] && md[1]==\"^\")?true:false\n class_name = md[2]\n else\n raise \"internal error, invalid POSIX class name(#{val})\"\n end\n \n obj = nil\n if @options[:reg_options].is_unicode?\n obj = CharClass.new(class_name)\n else\n case class_name\n when 'alnum'\n obj = CharClass.new(\n [ TRange.new('a', 'z'), TRange.new('A', 'Z'),\n TRange.new('0', '9') ]\n )\n when 'alpha'\n obj = CharClass.new(\n [ TRange.new('a', 'z'), TRange.new('A', 'Z') ]\n )\n when 'cntrl'\n obj = CharClass.new(\n [ TRange.new(\"\\x00\", \"\\x1f\"), TRange.new(\"\\x7f\") ]\n )\n when 'lower'\n obj = CharClass.new(\n [ TRange.new('a', 'z') ]\n )\n when 'print'\n obj = CharClass.new(\n [ TRange.new(\"\\x20\", \"\\x7e\") ]\n )\n when 'space'\n obj = CharClass.new(\n [ TRange.new(' '), TRange.new(\"\\n\"), TRange.new(\"\\r\"), \n TRange.new(\"\\t\"), TRange.new(\"\\f\"), TRange.new(\"\\v\") ]\n )\n when 'digit'\n obj = CharClass.new(\n [ TRange.new('0', '9') ]\n )\n when 'upper'\n obj = CharClass.new(\n [ TRange.new('A', 'Z') ]\n )\n when 'blank'\n obj = CharClass.new(\n [ TRange.new(' '), TRange.new(\"\\t\") ]\n )\n when 'graph'\n obj = CharClass.new(\n [ TRange.new(\"\\x21\", \"\\x7e\") ]\n )\n when 'punct'\n obj = CharClass.new(\n [ TRange.new(\"\\x21\", \"\\x23\"), TRange.new(\"\\x25\", \"\\x2a\"), \n TRange.new(\"\\x2c\", \"\\x2f\"), TRange.new(\"\\x3a\", \"\\x3b\"),\n TRange.new(\"\\x3f\", \"\\x40\"), TRange.new(\"\\x5b\", \"\\x5d\"),\n TRange.new(\"\\x5f\"), TRange.new(\"\\x7b\"), TRange.new(\"\\x7d\") ]\n )\n when 'xdigit'\n obj = CharClass.new(\n [ TRange.new('a', 'f'), TRange.new('A', 'F'),\n TRange.new('0', '9') ]\n )\n when 'word'\n obj = CharClass.new(\n [ TRange.new('a', 'z'), TRange.new('A', 'Z'),\n TRange.new('0', '9'), TRange.new('_') ]\n )\n else\n raise \"Error: Invalid character class #{val}\"\n end\n end\n \n if reverse\n obj.set_reverse(@options)\n end\n \n obj\n end", "title": "" }, { "docid": "6c726020fd1bcc0b0ebdf97ca1d7f098", "score": "0.51787144", "text": "def get_class\n Built::Class.get(@class_uid)\n end", "title": "" }, { "docid": "c374cc35d12f310757ef2f4d316b4682", "score": "0.5159304", "text": "def type_class_name(type_name)\n return type_name if type_name[0].upcase == type_name[0]\n \"#{type_name[0].upcase}#{type_name[1..-1]}\"\n end", "title": "" }, { "docid": "510242dac5bdf8eb8e46996174ef5dc4", "score": "0.5144497", "text": "def get_as_class_name class_name #:nodoc:\n @ruby_mappings[class_name.to_s]\n end", "title": "" }, { "docid": "96834cfe17ef696feeb6d4bfdce6755b", "score": "0.51216847", "text": "def klass\n class_name = @attributes[:class_name]\n class_name ? class_name.constantize : name.to_s.classify.constantize\n end", "title": "" }, { "docid": "37d80d308519a06fe958b345999c12dd", "score": "0.51087534", "text": "def field_class\n\t\t\t\tObject.const_get(@field_class_name)\n\t\t\tend", "title": "" }, { "docid": "6c6963de6177764505d9042c29f68a37", "score": "0.51077604", "text": "def seqclass\n @seqclass or String\n end", "title": "" }, { "docid": "04fa9ca4334eaa5f7271c556367429ae", "score": "0.51060003", "text": "def klass\n class_name = @attributes[:class_name]\n association_name = @attributes[:association_name]\n class_name ? class_name.constantize : association_name.to_s.classify.constantize\n end", "title": "" }, { "docid": "240e828905b246cf885498a8c791d0e9", "score": "0.5104065", "text": "def companion\n StringVal\n end", "title": "" }, { "docid": "bd0257162c4db143fb72191fb4f3cf15", "score": "0.5100708", "text": "def comp_type\n self[:comp_type]\n end", "title": "" }, { "docid": "6ba1225466cd9b29614ac2bbb72afd7d", "score": "0.5100623", "text": "def class_name\n return $data_classes[@class_id].name\n end", "title": "" }, { "docid": "28031a7dc548b5e7bb4c17dc4a470a46", "score": "0.509559", "text": "def class_name\n @class_name ||= (self[:class_name] || classify).sub(/^::/,\"\")\n end", "title": "" }, { "docid": "d910fd06c70acc92130a8955ba48cd67", "score": "0.509367", "text": "def java_class_name\n names = self.split(/[<>]/).map {|type| type.split('.').last }\n names.shift + (names.any? ? \"<#{names.join(', ')}>\" : '')\n end", "title": "" }, { "docid": "905a9399483a4a968411d091a78281f2", "score": "0.50893617", "text": "def name_and_class\n [name, self['class']].compact.join('.')\n end", "title": "" }, { "docid": "c158257eb2a9cab0e9f77e93d3ae5286", "score": "0.5087295", "text": "def get_as_class_name class_name #:nodoc:\n @ruby_mappings[class_name.to_s]\n end", "title": "" }, { "docid": "1ee7826a26302c646c4a0f4d173ed84a", "score": "0.5081973", "text": "def klass\n @_klass ||= self.value.constantize\n end", "title": "" }, { "docid": "1fcd44706332fd37d2e6b8defa7b2619", "score": "0.50722885", "text": "def get_as_class_name obj\n # Get class name\n if obj.is_a?(String)\n ruby_class_name = obj\n elsif obj.is_a?(Values::TypedHash)\n ruby_class_name = obj.type\n else\n ruby_class_name = obj.class.name\n end\n\n # Get mapped AS class name\n mappings.get_as_class_name ruby_class_name\n end", "title": "" }, { "docid": "bd58e88517a8bc4cf0001e30b3f964a3", "score": "0.5070549", "text": "def class_name\r\n r = \"\"\r\n up = true\r\n each_byte do |c|\r\n if c == 95\r\n if up\r\n r << \"::\"\r\n else\r\n up = true\r\n end\r\n else\r\n m = up ? :upcase : :to_s\r\n r << (c.chr.send(m))\r\n up = false\r\n end\r\n end\r\n r\r\n end", "title": "" }, { "docid": "40b96ec189b040246e8af8fa848be088", "score": "0.5065642", "text": "def getClassificationType\r\n\t\t\t\t\treturn @classificationType\r\n\t\t\t\tend", "title": "" }, { "docid": "abf54260f4fd3f7a93dd3371d7704a55", "score": "0.50519294", "text": "def class_name(data)\n data.class.name\n end", "title": "" }, { "docid": "337edfd05b36cf61ecff8f5eb67a6540", "score": "0.50461525", "text": "def klass(type)\n # wonderful world of Ruby - get a class from its name\n Module.const_get(\"CX::CSV::Attribute::#{type.to_s.camel_case}\")\n end", "title": "" }, { "docid": "1c3b8de4c3759ec06e51bc3e58acf125", "score": "0.5045041", "text": "def class_name(klass)\n c = klass.class.to_s\n # If it didn't return a constant, or it returned some generic \"Class\" crap...\n c = klass.class.name if !defined?(c) || c == 'Class'\n # Last resort! Try #inspect w regex\n c = /^([\\w:]+)\\s?\\(/.match(klass.inspect)[1] if !defined?(c) || c == 'Class'\n c\n end", "title": "" }, { "docid": "44977e73de9dcf2f19a1886850328a0b", "score": "0.50406486", "text": "def get_type\r\n @classification\r\n end", "title": "" }, { "docid": "7f8d7b01ae8d55f4d4c8f5e95dc96bc0", "score": "0.5038789", "text": "def string_class_name?(class_pair)\n class_pair.children[1].str_type?\n end", "title": "" }, { "docid": "aa9d100faa3deaae257b00589865235b", "score": "0.5025969", "text": "def class_name\n r = \"\"\n up = true\n each_byte do |c|\n if c == 95\n if up\n r << \"::\"\n else\n up = true\n end\n else\n m = up ? :upcase : :to_s\n r << (c.chr.send(m))\n up = false\n end\n end\n r\n end", "title": "" }, { "docid": "441415a58917c7607bdaaad1ac457160", "score": "0.5022468", "text": "def class_name\n @class_name ||= -(options[:class_name] || derive_class_name).to_s\n end", "title": "" }, { "docid": "8f25b0c0cc3c3c6b7cefdd584c5b71ca", "score": "0.502094", "text": "def get_as_class_name obj\n # Get class name\n if obj.is_a?(String)\n ruby_class_name = obj\n elsif obj.is_a?(Values::TypedHash)\n ruby_class_name = obj.type\n elsif obj.is_a?(Hash)\n return nil\n else\n ruby_class_name = obj.class.name\n end\n\n # Get mapped AS class name\n @mappings.get_as_class_name ruby_class_name\n end", "title": "" }, { "docid": "b6646af13b429fe934c82aa14840c981", "score": "0.501778", "text": "def in_char_class?(codepoint, classes); end", "title": "" }, { "docid": "71a9cc1344d4608d078b1e3f109d0899", "score": "0.50096726", "text": "def human_rrclass\n if self[:name].dns.is_a? MDNS\n str = self.class::CLASSES.key(self.rrclass & 0x7fff) || '0x%04x' % (self.rrclass & 0x7fff)\n str += ' CACHE-FLUSH' if (self.rrclass & 0x8000).positive?\n str\n else\n self.class::CLASSES.key(self.rrclass) || '0x%04x' % self.rrclass\n end\n end", "title": "" }, { "docid": "fc0bb4f65e40124cbe9899e2dd2a5b86", "score": "0.50086486", "text": "def get_PU_attr\n @@class_info[ @class1 ]\n end", "title": "" }, { "docid": "9a40482af6e2d600cf01f721fe15d716", "score": "0.500702", "text": "def _class_name\n case _form\n when :element_type\n _type_target._class_name\n when :element_ref\n _ref_target._class_name\n when :element_anonymous_complexType\n choice.complexType._class_name\n when :element_empty\n 'element_empty' # TODO\n\n when :attribute_type\n _type_target._class_name\n when :attribute_ref\n _ref_target._class_name\n\n when :attributeGroup_ref\n _ref_target._class_name\n when :attribute_ref\n raise 'internal error'\n\n else\n @_class_name\n end\n end", "title": "" }, { "docid": "e71165f96abd82f52336155f47695fd4", "score": "0.5004972", "text": "def type_class_name(type)\n type.classify\n end", "title": "" }, { "docid": "f6fc28502b3efc9c61f1e3f09c174334", "score": "0.5004401", "text": "def to_class_name\n self.split('_').collect { |component| component.capitalize}.join\n end", "title": "" }, { "docid": "0d11a174c816715f1208f7b508b838f3", "score": "0.49979445", "text": "def class\n\t\tbegin\n\t\t\tdefined?(::Rails) && @attributes[:_type] ? @attributes[:_type].camelize.constantize : super\n\t\trescue NameError\n\t\t\tsuper\n\t\tend\n\tend", "title": "" }, { "docid": "7bf42f4144f9484e8ebfdb04ebcf8a7a", "score": "0.498945", "text": "def convert_klass klass\n return klass.split(' ').join('_') if klass.split(' ').length > 1\n return klass\n end", "title": "" }, { "docid": "101c31dd60fdeb940624bdbbdc35e297", "score": "0.49840784", "text": "def class_name\n name.classify\n end", "title": "" }, { "docid": "5ffb25bb6de398db660b368b95ed323b", "score": "0.4981789", "text": "def class_name\n @class_name ||= derive_class_name\n end", "title": "" }, { "docid": "e7b71880440dd8364a5f37f61ab89f4a", "score": "0.49775562", "text": "def get_ruby_class_name class_name #:nodoc:\n @as_mappings[class_name.to_s]\n end", "title": "" }, { "docid": "584a8f364dabfbd28f808ad7752c9e98", "score": "0.49770594", "text": "def type_str\n self.class.const_get(:TYPE_STR)\n end", "title": "" }, { "docid": "305fa0cc55ba2ae8b1e7f599c64da914", "score": "0.49766538", "text": "def find_complex_class_name(classes_defined = [])\n complex_class = struct? ? basic_type.tr('.', '/').camelize : nil\n check_duplicate_complex_class(classes_defined, complex_class) unless complex_class.nil? || classes_defined.blank?\n complex_class\n end", "title": "" }, { "docid": "c88d8a163ce3e0a78830731125cd43c6", "score": "0.49750945", "text": "def get_category_type\r\n @category_type.code\r\n end", "title": "" }, { "docid": "49b046d1099007569b58f533276ff867", "score": "0.49716434", "text": "def get_class()\n l = get_type()\n #puts \"Type #{l.class} in #{self.class} , #{self}\"\n l.object_class()\n end", "title": "" }, { "docid": "49b046d1099007569b58f533276ff867", "score": "0.49716434", "text": "def get_class()\n l = get_type()\n #puts \"Type #{l.class} in #{self.class} , #{self}\"\n l.object_class()\n end", "title": "" }, { "docid": "49b046d1099007569b58f533276ff867", "score": "0.49716434", "text": "def get_class()\n l = get_type()\n #puts \"Type #{l.class} in #{self.class} , #{self}\"\n l.object_class()\n end", "title": "" }, { "docid": "07c31904f0af19ea315a8687f5d0e09d", "score": "0.49683255", "text": "def getClassTypeName(cls)\n nsPrefix = \"\"\n if cls.namespace.hasItems?()\n nsPrefix = cls.namespace.get(\"::\") + \"::\"\n end\n\n baseTypeName = CodeNameStyling.getStyled(cls.name, @langProfile.classNameStyle)\n baseTypeName = nsPrefix + baseTypeName\n\n return baseTypeName\n end", "title": "" }, { "docid": "255165da08853b6692d5b1eb8a39b1a3", "score": "0.49663958", "text": "def css_class value\n value.to_s.strip.downcase.gsub(' ','') # TODO update to strip out all non alphanumeric characters\n end", "title": "" }, { "docid": "b9d0728105b887a250edd3d0fdf35e54", "score": "0.49610335", "text": "def extract_code_language(attr)\n if attr['class'] && attr['class'] =~ /\\blanguage-\\S+/\n attr['class'].scan(/\\blanguage-(\\S+)/).first.first\n end\n end", "title": "" }, { "docid": "61ac17199d0d64d7b8870faf57726e08", "score": "0.4957342", "text": "def typecast_to_class(value)\n value.to_s.constantize\n rescue NameError\n value\n end", "title": "" }, { "docid": "644a98573db39c90e3b4412b1c693564", "score": "0.49552074", "text": "def to_classname\r\n self\r\n end", "title": "" }, { "docid": "a9038e903c499063b0ec71873355986d", "score": "0.49533367", "text": "def class_name\n r = \"\"\n up = true\n each_byte do |c|\n if c == 95\n if up\n r << \"::\"\n else\n up = true\n end\n else\n m = up ? :upcase : :to_s\n r << (c.chr.send(m))\n up = false\n end\n end\n r\n end", "title": "" }, { "docid": "5c4bc91e3defa1a3efd4451036842324", "score": "0.4944077", "text": "def type_literal_generic_trueclass(column)\n :'char(1)'\n end", "title": "" }, { "docid": "ec5b5bdc1790b5ba51c11000bef0495d", "score": "0.49433", "text": "def to_class_name\n self.class.respond_to?(:base_class) ? self.class.base_class.name : self.class.name\n end", "title": "" }, { "docid": "8187cce7009eeaeef515b871ed103519", "score": "0.4939878", "text": "def class_to_type\n self.class.name.underscore\n end", "title": "" }, { "docid": "b4471647ae17593edc55a8257bfc90c1", "score": "0.49396113", "text": "def get_ruby_class_name class_name #:nodoc:\n @as_mappings[class_name.to_s]\n end", "title": "" }, { "docid": "878c35a77207dfb0169115ab7c9dc0e6", "score": "0.49395254", "text": "def get_completion_color_class_name\n self.completion.try(:name).to_s.parameterize('_')\n end", "title": "" }, { "docid": "e85eceda5eed70796353d97024af3bc1", "score": "0.4938414", "text": "def type\n self.class.name.split(/::/).last.gsub(/([[:lower:]])([[:upper:]])/) { \"#{$1}_#{$2}\" }.downcase.intern\n end", "title": "" }, { "docid": "b2e29398b4149f0bf8674456c9f34348", "score": "0.49363384", "text": "def class_for(option_type, type: nil)\n option_type = \"#{option_type}__#{option_type}\" if type == :hash_item\n \"#{name}::#{option_type.to_s.ns_camelize}\".constantize\n end", "title": "" }, { "docid": "883af21d7c606f2cdd3f6c66e545e20e", "score": "0.4927354", "text": "def armor_class\r\n value = stat(:armor_class)\r\n if @base_armor_class\r\n value += @base_armor_class\r\n end\r\n return value\r\n end", "title": "" }, { "docid": "44843e204785593696e62fc059da3d80", "score": "0.4925638", "text": "def deco_class\n Setting[:callstyle] == \"short\" || _class.to_s.empty? ? \"\" : \"#{_class}.\"\n end", "title": "" }, { "docid": "f26ef39c9544c374f1199b16d144f03e", "score": "0.49240232", "text": "def className\n getAttribute('class').to_s\n end", "title": "" }, { "docid": "ec57e5d97edeed38d22829d2b5c65c0d", "score": "0.4921211", "text": "def type\n 'Class'\n end", "title": "" }, { "docid": "99200e0b32cdaded7e814fecff0d2c71", "score": "0.49209043", "text": "def to_s\n classname\n end", "title": "" }, { "docid": "773bbad36b390ade889fcf278c603402", "score": "0.49197608", "text": "def get_property_class(property, classname = nil)\n type = find_basic_type(property.type)\n\n # If type is Self (as per Spec) treat is as HostType\n # classname is always in camelcase\n type = classname if type == \"self\"\n type = \"List<#{type}>\" if property.array\n type\n end", "title": "" }, { "docid": "f8f10132a1f2a522f4c4fa7d841358eb", "score": "0.4919246", "text": "def gmail_label_types\n\t self.class.gmail_label_types\n end", "title": "" }, { "docid": "b173ffc2cd8aa177e23d9a13ef4edfb4", "score": "0.4914356", "text": "def lookup_class\n if self.kind\n Toolkit.classify(self.kind)\n else\n self.class.item_class\n end\n end", "title": "" }, { "docid": "a2007835b6a055a78fd604b9e13695f1", "score": "0.4911116", "text": "def census_subdivision_type\n self.class.census_subdivision_types.fetch(self).sub(/\\ATV\\z/, \"T\").sub(/\\AC\\z/, \"CY\")\n end", "title": "" }, { "docid": "3098b062ff58ec29cd63d9188e3ca1ee", "score": "0.4902609", "text": "def clazz_name\n my_class.to_s\n end", "title": "" }, { "docid": "0b992397d2a1fc3f1b3caf68d6c601d5", "score": "0.4901302", "text": "def class_attributes\n attributes[:class]\n end", "title": "" }, { "docid": "f5f724d73ca6b29f404e3e28fd08774f", "score": "0.49012274", "text": "def short_class\n return @classification.to_s.gsub(/.*::(\\w+)$/,\"\\\\1\")\n end", "title": "" }, { "docid": "793f91f5ed66fecce41d7ed9725b15b1", "score": "0.48990077", "text": "def class_name\n I18n.t(self.class.to_s)\n end", "title": "" }, { "docid": "8206b40c022d54ca6e05909edd5225c9", "score": "0.48904163", "text": "def get_type\n class_name = self.class.name.split('::').last\n class_name.downcase.to_sym\n end", "title": "" }, { "docid": "13538576941a3fdea38181b1f2b79f03", "score": "0.4889967", "text": "def type\n klass&.type_tree&.tree&.type || Mikunyan::Constants::CLASS_ID2NAME[class_id || klass&.class_id]\n end", "title": "" }, { "docid": "d5e72a494dbd05294a47037be5eaa74d", "score": "0.4889479", "text": "def type\n self.class.to_s\n end", "title": "" } ]
652c8a0fa975e0cec23001cff93d203e
GET /parliaments/1 GET /parliaments/1.json
[ { "docid": "02e8431d1c922333f2576d5c6c05046c", "score": "0.66671115", "text": "def show\n @parliament = Parliament.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @parliament }\n end\n end", "title": "" } ]
[ { "docid": "52cbe1e521186ee23e7ed12f6e6f58e8", "score": "0.67865366", "text": "def index\n @parishes = Parish.all\n\n render json: @parishes\n end", "title": "" }, { "docid": "825d97350a54503e7a635363e3e19325", "score": "0.6721505", "text": "def index\n @parliaments = Parliament.sorted_start_year\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @parliaments }\n end\n end", "title": "" }, { "docid": "795367c6b04cee160241f8153ab0e188", "score": "0.6451893", "text": "def show\n @partecipante = Partecipante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @partecipante }\n end\n end", "title": "" }, { "docid": "f8f1f8ed79f53c3d08d7d74811b7d5a4", "score": "0.63368964", "text": "def index\n @parks = Park.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @parks }\n end\n end", "title": "" }, { "docid": "68f60b39a3310dff714a00ae9fc11c53", "score": "0.6299791", "text": "def retrieve(id)\n @client.make_request(:get, \"parcels/#{id}\", MODEL_CLASS)\n end", "title": "" }, { "docid": "3a83877514afc953e8dd621dccc34753", "score": "0.62041646", "text": "def show\n @parasitic_interaction = ParasiticInteraction.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @parasitic_interaction }\n end\n end", "title": "" }, { "docid": "fcf4e3da2eb497ffd41c75175fa37543", "score": "0.6197007", "text": "def show\n render json: @parish\n end", "title": "" }, { "docid": "eb2293a0aaa54940f579f221f2975124", "score": "0.60558456", "text": "def index\n @member_of_parliaments = MemberOfParliament.all\n end", "title": "" }, { "docid": "05696dd3ee46165447825ca4f6085d93", "score": "0.6031438", "text": "def index\n pets = pets_from_query\n\n respond_to do |format|\n format.html do\n @pets = pets.paginate(page: params[:page], per_page: 10)\n end\n format.json do\n @pets = pets\n end\n end\n end", "title": "" }, { "docid": "d794e32df52ebfb6d54f7e914ff11bad", "score": "0.5985832", "text": "def show\n @papel = Papel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @papel }\n end\n end", "title": "" }, { "docid": "1871acb6a369ff638af86cdf5408d440", "score": "0.5965002", "text": "def index\n @proteins = Protein.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @proteins }\n end\n end", "title": "" }, { "docid": "b0ba38dea3ddf0173c8dcb24267bca8f", "score": "0.59092414", "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": "306cc652cf35b09bb0b7b04cd48b9442", "score": "0.5908716", "text": "def index\n if params[:meeting_id] && params[:team_id]\n @passages = Passage.includes(:team, :meeting).where(\n 'meetings.id' => params[:meeting_id],\n 'teams.id' => params[:team_id]\n ).to_a\n else\n @passages = []\n end\n render status: 200, json: @passages\n end", "title": "" }, { "docid": "67c8af31c2bec9c457b0db2255953ee4", "score": "0.5873222", "text": "def index\n @papels = Papel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @papels }\n end\n end", "title": "" }, { "docid": "2e4173afa245d04fe3b08e6a4875aa7c", "score": "0.5839246", "text": "def show\n @parlamentarian = Parlamentarian.find_by_id(params[:rdf_uri])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @parlamentarian }\n end\n end", "title": "" }, { "docid": "8c05aecae663c67d091ace0b159fc609", "score": "0.581071", "text": "def show\n @prime = Prime.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @prime }\n end\n end", "title": "" }, { "docid": "2a6088f18c4f7a56029c5a77daedc567", "score": "0.58068967", "text": "def show\n @pto = Pto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pto }\n end\n end", "title": "" }, { "docid": "a82393e491db26146c1b3e9e7e77bab5", "score": "0.58035403", "text": "def index\n @participates = Participate.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @participates }\n end\n end", "title": "" }, { "docid": "80eb38bce5a2c830088ea42e9db904fe", "score": "0.57828647", "text": "def show\n @portion = Portion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @portion }\n end\n end", "title": "" }, { "docid": "983e7ad56fb65711405c23e7baec2a35", "score": "0.5782503", "text": "def show\n @pinit = Pinit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pinit }\n end\n end", "title": "" }, { "docid": "cce405005cdc03c4c27a00712005f747", "score": "0.5777908", "text": "def show\n @pony = Pony.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pony }\n end\n end", "title": "" }, { "docid": "1cdcaec8a6d7ec978ab95daeec1f0c7a", "score": "0.57742995", "text": "def index\n @paragrafs = Paragraf.all\n end", "title": "" }, { "docid": "2b3c22c5d576b4e879895ddd193eca48", "score": "0.5771944", "text": "def show\n @peptide = Peptide.find(params[:id])\n logger.info(\"PEPTIDE: (#{params[:id]}) #{@peptide.pep_seq}\")\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @peptide }\n end\n end", "title": "" }, { "docid": "8da74be57d927729999f8a6b42fdc104", "score": "0.5745381", "text": "def show\n @pokeparty = Pokeparty.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pokeparty }\n end\n end", "title": "" }, { "docid": "76bd9a3030fbe32fedfb45b54bdc7f35", "score": "0.5742647", "text": "def index\n @poms = Pom.all\n\n respond_to do |format|\n # just poms\n format.json { render json: @poms, :except => [:created_at, :updated_at]}\n end\n end", "title": "" }, { "docid": "de956c7156ce6a7ad46fb0033eaac853", "score": "0.57270175", "text": "def index\n @pacientes = Pacientes.all\n render json: @pacientes\n end", "title": "" }, { "docid": "7dad6f5e2862593587d2c6dec9b1c054", "score": "0.5725947", "text": "def index\n @pets = Pet.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pets }\n end\n end", "title": "" }, { "docid": "d9035deba12296101031a33a421a9dbe", "score": "0.5721193", "text": "def index\n page = params[:page]\n page = 1 if page.nil? || page == 0\n offset = (Integer(page) - 1) * RESULTS_PER_PAGE\n offset = offset + 1 if Integer(page) > 1\n @parlamentarians = Parlamentarian.find_all(true, RESULTS_PER_PAGE, offset)\n @paginated_parlamentarians = @parlamentarians.paginate(:page => page, :per_page => RESULTS_PER_PAGE, :total_entries => Parlamentarian.count)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @parlamentarians }\n end\n end", "title": "" }, { "docid": "77989b6095eb558f7af86e9afdb5f2db", "score": "0.56960005", "text": "def index\n @loves = Love.all\n render json: @loves\n end", "title": "" }, { "docid": "a56e370f49542acee32ae1077f5656bf", "score": "0.5694173", "text": "def index\n @parties = Party.order(:name).all\n\n respond_to do |format|\n format.html\n format.json { render json: @parties }\n format.xml { render xml: @parties }\n end\n end", "title": "" }, { "docid": "51b78fbe76579145bc96610db2e4ea39", "score": "0.5681792", "text": "def show\n @pet = Pet.find_by(id: params[:id])\n if @pet\n render json: @pet\n else\n render json: {}, status: 404\n end\n end", "title": "" }, { "docid": "e5b6eb13313b061c44038c671caba012", "score": "0.5673841", "text": "def index\n @parjos = Parjo.all\n end", "title": "" }, { "docid": "5394a546c344f99c606442d570fea49e", "score": "0.567345", "text": "def show\n @protein = Protein.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @protein }\n end\n end", "title": "" }, { "docid": "bc214e2a6226f30ab90a07cb6bf6c1b0", "score": "0.5673175", "text": "def index\n @universes = Universe.all.page(params[:page]).per(25)\n respond_to do |format|\n format.html\n format.json { render json: @universes }\n end\n end", "title": "" }, { "docid": "8d00db839cc9de13fceb8c61006d5bde", "score": "0.566419", "text": "def show\n @plate = Plate.find(params[:id])\n\n render json: @plate\n end", "title": "" }, { "docid": "756a88cf12815011079641e25781187d", "score": "0.5655454", "text": "def index\n @primes = Prime.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @primes }\n end\n end", "title": "" }, { "docid": "9ffbbbf6c58001f509a932d594c2e067", "score": "0.56543386", "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": "cf778a566e51d6c713b89a94e8616943", "score": "0.5647084", "text": "def show\n @lent = Lent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lent }\n end\n end", "title": "" }, { "docid": "9b3203b2249dc8799b379370e03856cb", "score": "0.5636874", "text": "def new\n @partecipante = Partecipante.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @partecipante }\n end\n end", "title": "" }, { "docid": "d4ed3388b7e87ca6d4a8e2316b99f4d4", "score": "0.562533", "text": "def index\n @proposals = Proposal.all\n\n render json: @proposals\n end", "title": "" }, { "docid": "7723238d5d2dd78ee6ef5093f9195736", "score": "0.5621065", "text": "def index\n @pizzas = Pizza.all\n render json: @pizzas\n end", "title": "" }, { "docid": "70d0af0333897dedf5c177c7e03b188c", "score": "0.5615542", "text": "def index\n @pots = Pot.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pots }\n end\n end", "title": "" }, { "docid": "54ad52543543a36c7f9b89787622fb73", "score": "0.5615329", "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": "5ac2b0f4ddd374b99fe48b6cd39af208", "score": "0.5614766", "text": "def show\n render json: @pet\n end", "title": "" }, { "docid": "fcd21ca992c882ceeeb1a1e04035f1d5", "score": "0.5613195", "text": "def new\n @parasitic_interaction = ParasiticInteraction.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @parasitic_interaction }\n end\n end", "title": "" }, { "docid": "1d7eddcaac99841aba52dfadd5c054fe", "score": "0.5609849", "text": "def show\n @love = Love.find(params[:id])\n render json: @love\n end", "title": "" }, { "docid": "a19fb2a167098b23100450d11f3da6d3", "score": "0.5609393", "text": "def show\n @premio = Premio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @premio }\n end\n end", "title": "" }, { "docid": "5c842ebf1a10b07b930ed607bef4cd65", "score": "0.56039333", "text": "def client_choose(offset = 10, limit = 20)\n response = Net::HTTP.get(\n URI(\"https://pokeapi.co/api/v2/pokemon/?offset=#{offset}&limit=#{limit}\")\n )\n \n JSON.parse(response)\nend", "title": "" }, { "docid": "18c7be2974052e9d0fa115effe73e2ee", "score": "0.559344", "text": "def show\n @pet = Pet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pet }\n end\n end", "title": "" }, { "docid": "18c7be2974052e9d0fa115effe73e2ee", "score": "0.559344", "text": "def show\n @pet = Pet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pet }\n end\n end", "title": "" }, { "docid": "3240009b93133fb27b6ec186865afae5", "score": "0.55908364", "text": "def index\n render json: Apartment.all\n end", "title": "" }, { "docid": "889005251b84d80ce2e77bd2ccb5164d", "score": "0.5584266", "text": "def show\n @passage = Passage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @passage }\n end\n end", "title": "" }, { "docid": "e64c66fb5ee44ee406ce7fa30dc7fe57", "score": "0.5575656", "text": "def show\n @pruning = Pruning.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pruning }\n end\n end", "title": "" }, { "docid": "b891d44310e9c4e876380bb4c48b112e", "score": "0.55744857", "text": "def index\n @players_prizes = PlayersPrize.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @players_prizes }\n end\n end", "title": "" }, { "docid": "5b0a4ff39f43f9195c4e97be9ef68bbd", "score": "0.55650866", "text": "def show\n @politicalcommittee = Politicalcommittee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @politicalcommittee }\n end\n end", "title": "" }, { "docid": "cf8c47eb0b9c55059b657c407aeee7dd", "score": "0.5562873", "text": "def index\n @parcels = Parcel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @parcels }\n end\n end", "title": "" }, { "docid": "68f5719f072d593b4add50424dfb132c", "score": "0.55604935", "text": "def show\n\t\t\t\tparking = Parking.where(plate: params[:id])\n\t\t\t\trender json: {status: 'SUCCESS', message:'Loaded parking', data:parking},status: :ok\n\t\t\tend", "title": "" }, { "docid": "3cb4b28aa7cc5b7591ef018088f1e9b1", "score": "0.5559917", "text": "def show\n @primer = Primer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @primer }\n end\n end", "title": "" }, { "docid": "f22f2cef0f821024cad767857d6f04b7", "score": "0.55546963", "text": "def index\n @phrasebooks = Phrasebook.all\n\n render json: @phrasebooks\n end", "title": "" }, { "docid": "249c37fe85111ef2830221e30ce49595", "score": "0.5553287", "text": "def show\n\t\tparadox = Paradox.find(params[:id])\n\t\trender json: paradox\n\tend", "title": "" }, { "docid": "deb913113ab4c0895735e53dc3d11e80", "score": "0.55503833", "text": "def index\n @plants = Plant.all\n\n respond_to do |format|\n format.html\n format.json { render :json => @plants }\n end\n end", "title": "" }, { "docid": "2b9e5e669b489a1c3f94f2f8956a234b", "score": "0.55492765", "text": "def index\n @ped_programs = PedProgram.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ped_programs }\n end\n end", "title": "" }, { "docid": "32f7211d782de45a2518463ccd7ba745", "score": "0.5548904", "text": "def index\n @pricings = Pricing.all\n\n render json: @pricings\n end", "title": "" }, { "docid": "d3716fbc9081ddb4fe1d7982ad0cabf6", "score": "0.554416", "text": "def show\n @propose = Propose.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @propose }\n end\n end", "title": "" }, { "docid": "c9340617b7386f58552bcd0265c76893", "score": "0.5539651", "text": "def show\n @park = Park.find(params[:id])\n @fields = Field.where(\"park_id\" => params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @park }\n end\n end", "title": "" }, { "docid": "72089c60b0e42e089c5892498bf6c6f4", "score": "0.5539476", "text": "def show\n @pot = Pot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pot }\n end\n end", "title": "" }, { "docid": "b79e0ce6ecc2a523588672b990047789", "score": "0.5536621", "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": "17cb2cb1db0dea5c12a38f14e3e78750", "score": "0.55360657", "text": "def show\n @petition = Petition.friendly.find(params[:id])\n\n render json: @petition\n end", "title": "" }, { "docid": "0d108154661deecd71581a4dc7e406f3", "score": "0.5535925", "text": "def index\n authorize! :index, Por, :message => 'Acceso denegado.'\n @pors = @campus.pors.paginate(:per_page => 3, :page => params[:page])\n\t\t@points = @pors\n\t\t@point_name = \"por\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render \"points/index.json.erb\" } # index.json.erb\n end\n end", "title": "" }, { "docid": "7b9211770be31fa5c9eb28c87044f699", "score": "0.5535491", "text": "def index\n @client = Client.find params[:client_id]\n @pets = @client.pets\n end", "title": "" }, { "docid": "54199ad22205b37c6d05b3651d7a523d", "score": "0.55343604", "text": "def get_part_by_car_category\n @cars = PartsController::PartService.get_part_by_car_category(params[:paran_car], params[:paran_category]);\n respond_to do |format|\n format.json { render json: @cars }\n end \n end", "title": "" }, { "docid": "3409f3d5d11d439e440339e23cb79c48", "score": "0.5524282", "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": "830dac79576385ab50438e89a0bf02ef", "score": "0.55166095", "text": "def show\n @parking_spot = ParkingSpot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @parking_spot }\n end\n end", "title": "" }, { "docid": "efa3e3c64a97ee9d5c9cc0c86a26c2dc", "score": "0.5513988", "text": "def index\n @proposals = listing.proposals\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @proposals }\n end\n end", "title": "" }, { "docid": "56e1141ee4d11ac0a006c011c1527b7c", "score": "0.5510005", "text": "def show\n @partei = Partei.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @partei }\n end\n end", "title": "" }, { "docid": "52cd128adeb2d69a1ef38a39d45729ea", "score": "0.5502775", "text": "def show\n @part_three_predict = PartThreePredict.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @part_three_predict }\n end\n end", "title": "" }, { "docid": "6a552e8f83dabe7eb696546e80f55f59", "score": "0.5486694", "text": "def index\n @parks = Park.all\n end", "title": "" }, { "docid": "6a552e8f83dabe7eb696546e80f55f59", "score": "0.5486694", "text": "def index\n @parks = Park.all\n end", "title": "" }, { "docid": "6a552e8f83dabe7eb696546e80f55f59", "score": "0.5486445", "text": "def index\n @parks = Park.all\n end", "title": "" }, { "docid": "b6179f2fa838ba68d5cf0b9fe251fc2b", "score": "0.5486191", "text": "def show\n @competent = Competent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @competent }\n end\n end", "title": "" }, { "docid": "2f98c1fc09bbf3df2ba04252beaa132c", "score": "0.54819834", "text": "def show\r\n @theoretical_part = TheoreticalPart.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @theoretical_part }\r\n end\r\n end", "title": "" }, { "docid": "77039c70476608650d5f0329d9e4aa33", "score": "0.5480702", "text": "def index\n @verbindung = Verbindung.find(params[:verbindung_id])\n @entities = PruegelEntity.where(:verbindung_id => @verbindung.id).where(:type => get_type).paginate(:page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @entities }\n end\n end", "title": "" }, { "docid": "62c58977af6f00ba36c977d9ae5a36c0", "score": "0.54786366", "text": "def show\n @petition = Petition.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @petition }\n end\n end", "title": "" }, { "docid": "65d6d165066819c7d2f28c74dfcc51e8", "score": "0.5477641", "text": "def index\n @rents = Rent.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rents }\n end\n end", "title": "" }, { "docid": "689075b83d54232708b2322ca8030876", "score": "0.54687697", "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": "52aa6e9430985c1e85858051dbd247e7", "score": "0.5466859", "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.5466859", "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": "1741eecf51246f8aea9adc8677a88ed2", "score": "0.54649246", "text": "def show\n @precious_metal = PreciousMetal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @precious_metal }\n end\n end", "title": "" }, { "docid": "4079933a25e56707335170481f08eed4", "score": "0.5462511", "text": "def index\n @competencies = Competency.all\n respond_to do |format|\n format.json { render json: @competencies }\n end\n end", "title": "" }, { "docid": "5f33d70c677be716df1d64df8d013f49", "score": "0.5458879", "text": "def index\n @spots = Spot.visible.order('id desc').page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @spots }\n end\n end", "title": "" }, { "docid": "ad33b1d5a795f61dfd82b6b33c0b46bb", "score": "0.545341", "text": "def index\n @nepals = Nepal.all\n\n render json: @nepals\n end", "title": "" }, { "docid": "127000a1b9e288fa97494b6ec0af178c", "score": "0.5451609", "text": "def show\n @ped_program = PedProgram.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ped_program }\n end\n end", "title": "" }, { "docid": "e0c93087d191e755aca0538cd226926d", "score": "0.54515386", "text": "def index\n @proovedors = Proovedor.all\n end", "title": "" }, { "docid": "0271e953529b654f2d23d12a59c89023", "score": "0.5450859", "text": "def show\n @rent = Rent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rent }\n end\n end", "title": "" }, { "docid": "437c32361777ba643d2acb89a6a236d3", "score": "0.54497635", "text": "def index\n @opportunities = Opportunity.all\n\n render json: @opportunities\n end", "title": "" }, { "docid": "5db7d1aba3de133ae569863246070624", "score": "0.5444596", "text": "def index\n @players = Player.all\n render json: @players\n end", "title": "" }, { "docid": "c70a81625450f7776be21795b283bdb8", "score": "0.5440028", "text": "def index\n @parkers = Parker.all\n\t\trespond_with @parkers\n end", "title": "" }, { "docid": "8aa14ca4438ac374b107dff84a8789fe", "score": "0.5438312", "text": "def show\n @trumpet = Trumpet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trumpet }\n end\n end", "title": "" }, { "docid": "a1e8760096bfd4cdb563d6bd2fdd1aeb", "score": "0.54378784", "text": "def get_part_by_car\n @cars = PartsController::PartService.get_part_by_car(params[:param]);\n respond_to do |format|\n format.json { render json: @cars }\n end \n end", "title": "" }, { "docid": "195158c19e2be2ef28e861392532bf26", "score": "0.5437181", "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": "" } ]
867f00e85c1e259d5be44ed1f5e6fad4
generates html for a field label
[ { "docid": "fef06fa2ea1470599ebeaa65d9ce0fb5", "score": "0.78989875", "text": "def elmo_field_label(field_name, options)\n label_str = options[:label] || @object.class.human_attribute_name(field_name)\n label_html = (options[:required] ? \"#{@template.reqd_sym} \" : \"\") + label_str + \":\"\n label(field_name, label_html.html_safe, :class => \"main\")\n end", "title": "" } ]
[ { "docid": "5d0a4e7adf632266a1f1059f4fb872ba", "score": "0.82565945", "text": "def label_and_field(field_html, errors_html, attr, label_text, label_options)\n output = ''.html_safe\n output << label(attr, label_text, label_options)\n output << field_html\n output << errors_html if errors_html\n output\n end", "title": "" }, { "docid": "76428ff332bbfb35ba2fb4330db18b64", "score": "0.81395024", "text": "def label_for_field(field, options = {})\r\n #return ''.html_safe if options.delete(:no_label)\r\n # text = options[:label].is_a?(Symbol) ? l(options[:label]) : options[:label]\r\n # text ||= l((\"field_\" + field.to_s.gsub(/\\_id$/, \"\")).to_sym)\r\n return \"\" if options[:label] == false\r\n text = field.to_s.humanize\r\n text += @template.content_tag(\"span\", \" *\", :class => \"required\") if options.delete(:required)\r\n @template.content_tag(\"label\", text,\r\n :class => \"label #{ (@object && @object.errors[field] ? 'error' : nil) }\",\r\n :for => (@object_name.to_s + \"_\" + field.to_s))\r\n end", "title": "" }, { "docid": "25e35ae8fa2cab209286396c8f5f5e38", "score": "0.8138636", "text": "def label_for_field(field, options = {})\n text = \"\"\n text += @template.content_tag(\"div\", \"\", :class => \"requiredBlock\") if options.delete(:required)\n @template.content_tag(\"div\", text + field,{:class => \"requiredInput\"}, false)\n\n\n# text = options[:label].is_a?(Symbol) ? ::I18n.t(options[:label]) : options[:label]\n# text ||= ::I18n.t((\"label_#{@object_name.to_s}_\" + field.to_s.gsub(/\\_id$/, \"\")).to_sym)\n# text += @template.content_tag(\"span\", \" *\", :class => \"required\") if options.delete(:required)\n# @template.content_tag(\"label\", text,\n# {:class => (@object && @object.errors[field] ? \"error\" : nil),\n# :for => (@object_name.to_s + \"_\" + field.to_s)},false)\n end", "title": "" }, { "docid": "51f09db934d680af4729f6ebcafe5456", "score": "0.8079543", "text": "def dc_label_for(input_html, label)\n c =<<eot\n<tr>\n <td class=\"dc-edit-label\">#{label}</td>\n <td class=\"dc-edit-field\">#{input_html}</td>\n</tr>\neot\n c.html_safe\nend", "title": "" }, { "docid": "619623e18e57bf4d9c39583403df5f81", "score": "0.80011153", "text": "def field(label, &block)\n if label == ' '\n label = \"&nbsp;\".html_safe\n else\n label = label.to_s.humanize\n end\n @template.content_tag(\"div\",\n @template.content_tag(\"label\",\n label,\n :for => \"#{@object_name}_#{label}\", :class => 'field-label') +\n @template.capture(&block),\n class: 'field')\n end", "title": "" }, { "docid": "91c9ddd0e7b04afeb6e6660a85457154", "score": "0.79961616", "text": "def label_html\n \"<label for='#{id}'>#{title}:</label>\"\n end", "title": "" }, { "docid": "5de52a75f7fcdf89909132ff2679c024", "score": "0.7922826", "text": "def labeled_field(label, value, field_class = 'labeled_field')\n (\"<div class='\" + field_class + \"'><span class='label'>#{label}</span><span class='value'>#{value}</span></div>\").html_safe\n end", "title": "" }, { "docid": "5de52a75f7fcdf89909132ff2679c024", "score": "0.7922826", "text": "def labeled_field(label, value, field_class = 'labeled_field')\n (\"<div class='\" + field_class + \"'><span class='label'>#{label}</span><span class='value'>#{value}</span></div>\").html_safe\n end", "title": "" }, { "docid": "d6cc8dda16d84e30d1bf75aba2b29739", "score": "0.78880244", "text": "def label_for_field(field, options = {})\n return '' if options.delete(:no_label)\n text = options[:label].is_a?(Symbol) ? I18n.t(options[:label]) : options[:label]\n text ||= I18n.t((\"field_\" + field.to_s.gsub(/\\_id$/, \"\")).to_sym)\n text += @template.content_tag(\"span\", \" *\", :class => \"required\") if options.delete(:required)\n @template.content_tag(\"label\", text,\n :class => (@object && @object.errors[field] ? \"error\" : nil),\n :for => (@object_name.to_s + \"_\" + field.to_s))\n end", "title": "" }, { "docid": "f86dcc58c96c127c5a940cf3e20695fd", "score": "0.7841964", "text": "def field_label\n @field_label = \"Title: #{@title}\" + \"\\n\" + \"Description: #{@description}\"\n end", "title": "" }, { "docid": "6bfce56f56dacc7bb7482188f4f25d1d", "score": "0.78285384", "text": "def label_html\n @label ||= [name.capitalize, code_html].compact.join(' ')\n end", "title": "" }, { "docid": "c93783953214755fa767c15a47db7fa5", "score": "0.78137267", "text": "def label_html\n return label_html_without_customizations if builder.options[:label_customizations] == false\n \n if render_label?\n audience = template.try(:current_user).try(:person_type)\n help_text = HelpText.for(object_name.to_s.classify, method, audience)\n custom_label_text = Formtastic::Util.html_safe(help_text.try(:title)) || label_text\n # Add customer-specific instructions text\n custom_label_text << template.content_tag(\n :div,\n template.content_tag(\n :span, Formtastic::Util.html_safe(help_text.try(:instructions))\n ),\n :class => \"button icon info icon-only help-text\"\n ) unless help_text.try(:instructions).blank?\n \n builder.label(input_name, custom_label_text, label_html_options)\n else\n \"\".html_safe\n end\n end", "title": "" }, { "docid": "6cb5af0bac9f6d100e63f2f51aa3663f", "score": "0.77526355", "text": "def emit_label\n return \"\" if @options[:no_label]\n title = @anno[:title] || @options[:label] || @attribute.to_s.humanize\n %{<label for=\"#{control_id}\">#{title}</label>}\n end", "title": "" }, { "docid": "b179e2f5b497cc52b36b5022fe44131b", "score": "0.77392334", "text": "def label_wrapper(field, options)\n the_label = (options.delete(:required) ? \"<em>*</em>\" : \"\") + options.delete(:label)\n the_class = options.delete(:class).to_s + ' ' + (@wrapper ? '' : 'nestedLabel')\n the_class = nil if the_class == ' '\n options.merge!(:for => \"#{@object_name}_#{field}\", :class => the_class)\n \"\\t\" + @template.content_tag(:label, the_label, options) + \"\\n\"\n end", "title": "" }, { "docid": "fc43b6b516216aa64f1c36b21613adb3", "score": "0.77282774", "text": "def field_tag(label, &block)\n content_tag(\"div\",\n content_tag(\"label\",\n label.to_s.humanize,\n :for => \"#{@object_name}_#{label}\", :class => 'field-label') +\n capture(&block),\n class: 'field')\n end", "title": "" }, { "docid": "83eddcb5a8bcdfd8a12b45de95846bba", "score": "0.7660482", "text": "def label_element(field, options = {}, html_options = {})\n return '' if options.has_key?(:label) && options[:label].nil?\n text = options.delete(:label) || (@object.nil? ? field.to_s.humanize : @object.class.human_attribute_name(field.to_s))\n suffix = options.delete(:suffix) || label_suffix\n value = text + suffix\n if (required = mandatory?(field, options.delete(:required)))\n required = required_signifier if required == true\n value += \" <em class='required'>#{required}</em>\"\n end\n\n html_options.stringify_keys!\n html_options['for'] ||= \"#{@object_name}_#{field}\"\n\n if errors_for? field\n error_msg = @object.errors[field].to_a.to_sentence\n option_capitalize = options.delete(:capitalize) || capitalize_errors\n error_msg = error_msg.capitalize unless option_capitalize == 'false' or option_capitalize == false\n value += %Q( <span class=\"feedback\">#{error_msg}.</span>)\n end\n\n @template.content_tag :label, value, html_options\n end", "title": "" }, { "docid": "3066111725a9a2cf35dba3d065f11a05", "score": "0.75936604", "text": "def label(name, *args)\n content_tag :div, class: 'dx-form-label' do\n super\n end\n end", "title": "" }, { "docid": "892aa904a1749ba455cb9ec4b096e439", "score": "0.75816303", "text": "def captcha_label_for(field_name, label)\n \"<label_for=\\\"\" + @captcha.encrypted_attributes[field_name] + \"\\\">\" + label + \"</label>\"\n end", "title": "" }, { "docid": "97547be41c4ccef6a8ff2ef588c7efee", "score": "0.75705236", "text": "def label_tag(field, attrs = {}, &block) \n attrs.reverse_merge!(label: field.to_s.titleize, for: field)\n \n label_text = attrs.delete(:label)\n # handle FALSE & nil values\n label_text = '' if label_text == false\n label_text = field.to_s.titleize if label_text.nil?\n \n unless label_text.to_s.empty?\n label_text << opts_tag_helpers[:tags_label_append_str]\n if attrs.delete(:required) \n label_text = \"#{label_text} #{opts_tag_helpers[:tags_label_required_str]}\"\n end\n end\n \n if block_given? # label with inner content\n label_content = label_text + capture_html(&block)\n concat_content(tag(:label, label_content, attrs))\n else # regular label\n tag(:label, label_text, attrs)\n end\n end", "title": "" }, { "docid": "eadba0c8134761e5ab282f430ab2a5ce", "score": "0.75549245", "text": "def tag_for_label_with_instructions( label_text, field_id, instructions )\n _html = \"\"\n _html << %{<label for=\"#{field_id}\">#{label_text}}\n _html << %{<span class=\"instructions\">#{instructions}</span>}\n _html << %{</label><br />}\n _html\n end", "title": "" }, { "docid": "39b372f40b470616641ff76176956206", "score": "0.75422674", "text": "def label_for_field(record, controller = self.controller)\n renderer = controller.record_select_config.label\n description = case renderer\n when Symbol, String\n # find the <label> element and grab its innerHTML\n render_record_from_config(record, File.join(controller.controller_path, renderer.to_s))\n\n when Proc\n # just return the string\n render_record_from_config(record, renderer)\n end\n description.match(/<label[^>]*>(.*)<\\/label>/){ |match| match[1] } || description if description\n end", "title": "" }, { "docid": "9f37623c1e0e679e965909efdd6155c3", "score": "0.7533999", "text": "def label_for(label, options = {})\n\t\t\twrapper = options.delete(:wrapper) || :div\n\t\t\ton = options.delete(:on) # is the label on the left or the right?\n\t\t\tid = options.delete(:id)\n\t\t\tlabel_for = options.delete(:for)\n\t\t\tlabel_markup = content_tag(:label, {:for => label_for}){ label }\n options.absorb({ :what => :field })\n options[:class] = extract_style(nil, nil, Enstyle::Config.style_wrapper_with, options)\n\t\t\tmarkup = []\n\t\t\tmarkup << label_markup\n\t\t\tmarkup << yield(label_for)\n\t\t\tcontent = (on == :right ? markup.reverse : markup).join('')\n filter_options options\n\t\t\tif wrapper\n\t\t\t\toptions[:id] = id if id\n\t\t\t\tcontent_tag(wrapper, options){ content }\n\t\t\telse\n\t\t\t\tcontent\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "d137067d98fba272765c17dc6258e643", "score": "0.7507421", "text": "def render_generated_field_label document, field_config\n field = field_config.field\n label = field_config.label\n if label.is_a? Symbol\n label = send label, document, field_config\n end\n t(:'blacklight.search.show.label', label: label)\n end", "title": "" }, { "docid": "8224d7b97b3117272d2b31cd0a176df0", "score": "0.74774104", "text": "def tag_for_label_with_inline_help( label_text, field_id, help_text )\n _html = \"\"\n _html << %{<label for=\"#{field_id}\">#{label_text}}\n _html << %{<img src=\"/images/icons/help_icon.png\" onclick=\"$('#{field_id}_help').toggle();\" class='inline_icon' />}\n _html << %{</label><br />}\n _html << %{<div class=\"inline_help\" id=\"#{field_id}_help\" style=\"display: none;\">}\n _html << %{<p>#{help_text}</p>}\n _html << %{</div>}\n _html\n end", "title": "" }, { "docid": "4b89d4cd2917e3e1a2ad2c9ce9e285db", "score": "0.7457274", "text": "def sp_label(label, show, wrapper_tag)\n ret_text = ''\n if show\n ret_text = label\n if !wrapper_tag.blank?\n ret_text = \"<#{wrapper_tag}> #{ret_text} </#{wrapper_tag.split(' ').first}>\" \n else\n ret_text = \"#{ret_text}\"\n end \n end\n ret_text.html_safe\n end", "title": "" }, { "docid": "208958ca116f7db59dd6903c08e7ec0d", "score": "0.74498254", "text": "def label\n content_tag('label', number + @question.title + required, :class => @question.type, :for => @question.label_id )\n end", "title": "" }, { "docid": "cdfd50555fc1333a6734d452ba300a6e", "score": "0.7442331", "text": "def field_label\n\t\treturn \"\" unless @label_options.present?\n\t\t@form_builder.label(@attribute, @label_options)\n\tend", "title": "" }, { "docid": "157170f10c01d72d19cc791f31362acf", "score": "0.74281716", "text": "def label(field, options={})\n options.reverse_merge!(:caption => \"#{field.to_s.titleize}: \")\n @template.label_tag(field_id(field), options)\n end", "title": "" }, { "docid": "75c3fd5ca6069f17d5f87b1ee28dc59e", "score": "0.74126834", "text": "def labeled(attr, field_html = nil, &block)\n template.labeled(label(attr), field_html, &block)\n end", "title": "" }, { "docid": "5bec852b0bb6731f6b8312274bc11b9e", "score": "0.74093825", "text": "def inline_label\n \" #{label_text}\".html_safe\n end", "title": "" }, { "docid": "9bfaf16bb2399c524af17cadc4e33fcc", "score": "0.74071866", "text": "def custom_field_label_tag(name, custom_value, options={})\n required = options[:required] || custom_value.custom_field.is_required?\n\n content_tag \"label\", h(custom_value.custom_field.name) +\n (required ? \" <span class=\\\"required\\\">*</span>\".html_safe : \"\"),\n :for => \"#{name}_custom_field_values_#{custom_value.custom_field.id}\"\n end", "title": "" }, { "docid": "53766d9f5e561a6c54b4bdd1b2506dd7", "score": "0.7396246", "text": "def fedora_field_label(ds,fields,label)\n label\nend", "title": "" }, { "docid": "53766d9f5e561a6c54b4bdd1b2506dd7", "score": "0.7396246", "text": "def fedora_field_label(ds,fields,label)\n label\nend", "title": "" }, { "docid": "cd69f058ca12da4c2623ebd8e773dc38", "score": "0.73883486", "text": "def render_field(label, value)\n render_field_content(label, (h value))\n end", "title": "" }, { "docid": "5a146b197a1018101d11463214a2f713", "score": "0.73871624", "text": "def wor_custom_field_label_tag(name, custom_value, options={})\n content_tag \"label\", h(custom_value.custom_field.name),\n :for => \"#{name}_custom_field_values_#{custom_value.custom_field.id}\"\n end", "title": "" }, { "docid": "a616b8a1c31d4b91b589007013f0baa0", "score": "0.73765296", "text": "def form_field_with_label(form, field, options={})\n render :partial => 'forms/field',\n :locals => { :element => form.text_field(field, options),\n :label => form.label(field, options[:label])\n }\n end", "title": "" }, { "docid": "9411405f28ccd693219bff8646434b43", "score": "0.7318724", "text": "def form_field_control_label_and_input(object, field, input, options = {})\n label_name = options[:label_name].nil? ? field.to_s.camelize : options[:label_name]\n content_tag(:div,:class => 'control-group') do\n label(object, field, label_name,:class => 'control-label') +\n content_tag(:div, input, :class => 'controls')\n end \n end", "title": "" }, { "docid": "0debe58653141a154e196b2c33166d3b", "score": "0.727996", "text": "def label(field, options={})\n options.reverse_merge!(:caption => \"#{field_human_name(field)}: \")\n @template.label_tag(field_id(field), options)\n end", "title": "" }, { "docid": "1dabf837e96c23b65621265f4b44e7cc", "score": "0.7255796", "text": "def labeled_field(label, value)\n (\"<dt>#{label}</dt> <dd>#{value}</dd>\").html_safe\n end", "title": "" }, { "docid": "0b363ea1b6cadb45354c5e95a5ce53c4", "score": "0.72407204", "text": "def raw_label_text\n template.content_tag('span', id: curate_nd_dom_id('label')) do\n super\n end\n end", "title": "" }, { "docid": "387d39098275c12fe2fd9c34f0d4d34b", "score": "0.720228", "text": "def label_with_designerization(field, text = nil, form_options = {})\n text = text || \"#{field.to_s.humanize}:\"\n \n # figures out if the field is required and adds a class, and the required flag\n if (@object && @object.class.requires?(field)) || form_options[:required] == true\n text = @@form_options.required_flag + text\n add_class!(form_options, @@form_options.required_class)\n end\n form_options.delete(:required)\n form_options.delete(:label)\n \n self.respond_to?(:label_without_designerization) ?\n label_without_designerization(field, text, form_options) :\n @template.content_tag(:label, text, form_options.merge!('for' => \"#{@object_name}_#{field}\"))\n end", "title": "" }, { "docid": "32f2006a70d92f233c84bd5179560669", "score": "0.7190527", "text": "def label_tag(contents=nil, attrs=nil)\n contents ||= conditional_escape(@label)\n widget = @field.widget\n id_ = widget.attrs[:id] || self.auto_id\n\n if id_\n attrs = attrs ? flatatt(attrs) : ''\n contents = \"<label for=\\\"#{Widgets::Widget.id_for_label(id_)}\\\"#{attrs}>#{contents}</label>\"\n end\n\n mark_safe(contents)\n end", "title": "" }, { "docid": "32f2006a70d92f233c84bd5179560669", "score": "0.7190527", "text": "def label_tag(contents=nil, attrs=nil)\n contents ||= conditional_escape(@label)\n widget = @field.widget\n id_ = widget.attrs[:id] || self.auto_id\n\n if id_\n attrs = attrs ? flatatt(attrs) : ''\n contents = \"<label for=\\\"#{Widgets::Widget.id_for_label(id_)}\\\"#{attrs}>#{contents}</label>\"\n end\n\n mark_safe(contents)\n end", "title": "" }, { "docid": "f8404a935e8c99e6f4bbee56b3cb4710", "score": "0.71859527", "text": "def labeled_input_field(attr, html_options = {})\n control_class.new(self, attr, html_options).render_labeled\n end", "title": "" }, { "docid": "bd3eb9e8ebc9e37e0dd1285cb4fd48b5", "score": "0.718006", "text": "def label_text\n config[:label] || field_name.titleize\n end", "title": "" }, { "docid": "73f76dd039ebbe6a80d7ee83df659ad5", "score": "0.7176671", "text": "def label_tag(fieldname_or_title, options = {})\n fieldname_or_title.blank? ? \"\" : content_tag(:label, build_title(fieldname_or_title), options)\n end", "title": "" }, { "docid": "911da19b7a7c7467b707845db40f7caa", "score": "0.7163573", "text": "def labelled_field_tag (options = {}, &proc)\n options = options.stringify_keys\n\n content = options.delete('content')\n\t\t\t\traise ArgumentError, \"You mast pass either content or a block\" if content.nil? and !block_given?\n\t\t\t\t\n\t\t\t\toptions['class'] = options['class'] ? \"#{options['class']} field\" : 'field'\n\n\t\t\t\tlabel = label_tag(options.delete('label'))\n\t\t\t\tparams = options.delete('params') || []\n\t\t\t\tbefore_input, after_input = options.delete(\"wrap\") || [\"\", \"\"]\n\t\t\t\t\n\t\t\t\tfield_start = tag('div', options, true) + label + \"\\n\" + before_input\n\t\t\t\tfield_end = after_input + '</div>'\n\t\t\t\t\n\t\t\t\tif block_given?\n\t\t\t\t\tconcat(field_start, proc.binding)\n\t\t\t\t\tyield(*params)\n\t\t\t\t\tconcat(field_end, proc.binding)\n\t\t\t\telse\n\t\t\t\t\tfield_start + content + field_end\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "08c5bb18485ec062edfee265faa667ee", "score": "0.71455884", "text": "def label\n if @label\n %Q<\"#{@label}\">\n else\n \"<#{html_table_label}>\"\n end\n end", "title": "" }, { "docid": "233520ba6d76a9ee2af75bc87a8af1e4", "score": "0.71361935", "text": "def show_field(label, obj)\n #mdl-cell--5-col mdl-cell--4-col-tablet m-8\n content_tag :div, class: \"mdl-cell--5-col no-p-l no-p-t no-p-r no-p-b\" do\n content_tag :div, class: \"\" do\n content_tag :p, class: \"no-m-b\" do\n str = content_tag :strong, label\n str += content_tag :span, obj rescue nil\n str\n end\n end\n end\n end", "title": "" }, { "docid": "2dce9adea7a2d5429bac8b7df5bfde9a", "score": "0.7121636", "text": "def build_hacky_label(label,is_bold)\n\tif is_bold\n\t\treturn \"<html><body><div style=\\\"width:150px;text-align:left\\\"><b>#{label}</b></div></body></html>\"\n\telse\n\t\treturn \"<html><body><div style=\\\"width:150px;text-align:left\\\">#{label}</div></body></html>\"\n\tend\nend", "title": "" }, { "docid": "0850901b845698f8ffca61baa6c1f46e", "score": "0.711847", "text": "def create_label(field, text = nil, options_label)\n if options_label and options_label[:none]\n label = ''\n else\n label = label field, text, options_label\n end\n end", "title": "" }, { "docid": "09afea9b772552166d638967930441a3", "score": "0.710749", "text": "def custom_label(attribute, text, options, field_before_label = false, show_required = true)\n return block_given? ? yield.html_safe : \"\".html_safe if text == false\n\n text = default_label_text(object, attribute) if text.nil? || text == true\n text += required_for_attribute(attribute) if show_required\n\n text = if field_before_label && block_given?\n safe_join([yield, text.html_safe])\n elsif block_given?\n safe_join([text.html_safe, yield])\n end\n\n label(attribute, text, options || {})\n end", "title": "" }, { "docid": "545dbfa67e5de2beaff9e1d34a0647a2", "score": "0.70945436", "text": "def label(field, text = nil, options = {}, &block)\n text ||= i18n_text(:attributes, field)\n @template.label(@object_name, field, text, objectify_options(options), &block)\n end", "title": "" }, { "docid": "4e92acd8f08b20597421348f70204d2b", "score": "0.7089865", "text": "def value_label(name, value, text)\n pretty_tag_value = value.to_s.gsub(/\\s/, \"_\").gsub(/(?!-)\\W/, \"\").downcase\n pretty_name = name.to_s.gsub(/\\[/, \"_\").gsub(/\\]/, \"\")\n \"<label for=\\\"#{pretty_name}_#{pretty_tag_value}\\\">#{h(text)}</label>\"\n end", "title": "" }, { "docid": "c9412e707a7f5243ae34c89c147b8db4", "score": "0.70510805", "text": "def generate_form_field(method, super_code, options)\n return super_code if options[:no_label]\n return \"\\ \n <div class='form_line'> \\\n #{generate_label(method, options)} \\\n <div class='form_field'> \\\n #{super_code} \\ \n #{generate_error(method, options)} \\\n </div> \\\n </div>\"\n end", "title": "" }, { "docid": "80a60592de8d1dc3fd364171065c06ea", "score": "0.7041759", "text": "def label_and_field(container_class, method, options = {}, &block)\n label = safe_join [' ' , options.delete(:label)]\n label_options = options.delete(:label_options) || {}\n\n label_and_field = @template.capture(&block)\n if index = label_and_field =~ %r{</div>$}\n label_and_field.insert index, label\n else\n label_and_field.concat label\n end\n content_tag :div, class: container_class do\n content_tag :label, label_and_field, label_options\n end\n end", "title": "" }, { "docid": "3693cdc2ee0b72e10b848058b055b221", "score": "0.7022109", "text": "def label(field, options={})\n options.reverse_merge!(:caption => field.to_s.titleize)\n @view_context.label_tag(field_id(field), options)\n end", "title": "" }, { "docid": "b06d4f3151691837e232c874492947fe", "score": "0.69971067", "text": "def t_label_for_field(field_name, default = '')\n c = (@form['i18n_prefix'] || \"helpers.label.#{@form['table']}\") + \".#{field_name}\"\n c = field_name if field_name.match(/helpers\\./)\n\n label = t(c, default)\n label = field_name.capitalize.gsub('_', ' ') if c.match( /translation missing/i )\n label\nend", "title": "" }, { "docid": "a00fd600a9f3888df7f8ea00f3a2dd91", "score": "0.6994999", "text": "def label_for(id, value, name)\n if error = @form_errors.delete(name.to_s)\n @g.label(\"#{value} \", :for => id){ @g.span(:class => :error){ error } }\n else\n @g.label(value, :for => id)\n end\n end", "title": "" }, { "docid": "68da504128b6b501bfbb7003c8ba2e6c", "score": "0.69937456", "text": "def labeled\n errors = errors? ? ' has-error' : ''\n\n tag.div(class: \"form-group#{errors}\") do\n builder.label(attr, caption, class: 'col-md-2 control-label') +\n tag.div(content, class: \"col-md-#{span}\")\n end\n end", "title": "" }, { "docid": "1b74927c25bc1e03926403a20ecaea36", "score": "0.6988655", "text": "def static_text_with_label(**args)\n opts = separate_field_options_from_args(args)\n opts[:class] = \"form-control-static\"\n text = opts[:text] || opts[:value] || \"\"\n opts.delete(:value)\n\n wrap_class = form_group_wrap_class(args)\n\n content_tag(:div, class: wrap_class) do\n concat(args[:form].label(args[:field], args[:label], class: \"mr-3\"))\n concat(content_tag(:p, text, opts))\n end\n end", "title": "" }, { "docid": "a2fd8d21531bbc5108a168bda9dd26a9", "score": "0.6971206", "text": "def handle_label(f)\n opts[:label] = humanize(field) unless opts.has_key?(:label)\n opts[:label] = [opts[:label], form._tag(:abbr, {:title=>'required'}, '*')] if opts[:label] && opts[:required] && obj.forme_use_required_abbr?\n end", "title": "" }, { "docid": "a2ca4731596412733797cacb3ec5f060", "score": "0.69704926", "text": "def label_for name, record = nil, attr = name, options = {}\n errors = record && !record.body.blank? && !record.valid? && record.errors.on(attr)\n label name.to_s.humanize, { :for => name }, options.merge(errors ? { :class => :error } : {})\n end", "title": "" }, { "docid": "a2ca4731596412733797cacb3ec5f060", "score": "0.69704926", "text": "def label_for name, record = nil, attr = name, options = {}\n errors = record && !record.body.blank? && !record.valid? && record.errors.on(attr)\n label name.to_s.humanize, { :for => name }, options.merge(errors ? { :class => :error } : {})\n end", "title": "" }, { "docid": "532a7e84df884bd998363ae51853293f", "score": "0.6960558", "text": "def legend_html\n template.content_tag(:label, control_label_html_options) do\n render_label? ? label_text : \"\".html_safe\n end\n end", "title": "" }, { "docid": "a746c40318c913271df9b56900cb8bf1", "score": "0.69535965", "text": "def custom_label\n \"#{self.name}\"\n end", "title": "" }, { "docid": "a746c40318c913271df9b56900cb8bf1", "score": "0.69535965", "text": "def custom_label\n \"#{self.name}\"\n end", "title": "" }, { "docid": "751ca86dc1e3eb9da5dadbf4506c3ab6", "score": "0.6931429", "text": "def input_field(f,obj,field,&block) \n rc = \"<div class='input_field'>\".html_safe\n if f\n rc << f.label(field.to_sym)\n else\n rc << label_tag(field.to_sym)\n end\n rc << yield\n rc << LayoutHelper::NBSP + display_errors_for( obj, field.to_sym )\n rc << \"</div>\".html_safe\n rc\n end", "title": "" }, { "docid": "53752b22c88664dbfa6b3974563f9f8a", "score": "0.69253135", "text": "def render_document_show_field_label(args)\n field = args[:field]\n label = blacklight_config.show_fields[field].label\n\n if role_field?(label)\n html_escape t('vocabulary.marc_relator.codes.' + label[5, 3])\n else\n html_escape t('dri.views.fields.' + label)\n end\n end", "title": "" }, { "docid": "72575b2cec0de3cb925d4b3cfc34c8d5", "score": "0.6917826", "text": "def render_document_show_field_label(args)\n field = args[:field]\n label = blacklight_config.show_fields[field].label\n\n if label[0, 5] == 'role_'\n html_escape t('vocabulary.marc_relator.codes.' + label[5, 3])\n else\n html_escape t('dri.views.fields.' + label)\n end\n end", "title": "" }, { "docid": "fd02b2290b5c41337ae621e418849b4c", "score": "0.6912427", "text": "def custom_field_tag_with_label(name, custom_value, options={})\n custom_field_label_tag(name, custom_value, options) + custom_field_tag(name, custom_value)\n end", "title": "" }, { "docid": "fc92e17f80347f2282f2c0642ca45ea0", "score": "0.6899244", "text": "def tb_label(name, options = {})\n options ||= {}\n\n options[:class] = \"label #{options[:class]}\"\n\n content_tag(:span, name, options)\n end", "title": "" }, { "docid": "15a1d533f6cb0f7a99c8c4eca6c96af7", "score": "0.6887068", "text": "def label_for(method, label)\n return '' if label.nil?\n label += (self.options[:label_append] || '') unless label =~ /\\?$/\n @template.content_tag('label', label, {:for => \"#{@object_name}_#{method}\"})\n end", "title": "" }, { "docid": "cd8802792ca3ca914b601d9441581a3c", "score": "0.6886651", "text": "def custom_label\n \"#{self.title}\"\n end", "title": "" }, { "docid": "271861663dd071718ade9dd386783d44", "score": "0.68844545", "text": "def field_label(field_name)\n form.fields[field_name].label\n end", "title": "" }, { "docid": "74c8995756764128f3c4c83e02ca0e94", "score": "0.6883913", "text": "def field(field_name, label = nil, options = {})\n unless label.nil? || (label.class.name == 'String')\n options = label\n label = nil\n end\n unless label\n label = @context_obj.class.human_attribute_name(field_name)\n end\n # :haml, ruby: source code display pretty printing\n # icon: show icons in a reasonable size for the operator\n # yesno: output \"Yes\" or \"No\" instead of \"true\" or \"false\"\n if options[:as] == :haml\n #val = \"<pre>#{@context_obj.send(field_name)}</pre>\"\n val = \"<pre class=\\\"highlight\\\">#{format_code(@context_obj.send(field_name), :haml)}</pre>\"\n elsif options[:as] == :ruby\n val = \"<pre class=\\\"highlight\\\">#{format_code(@context_obj.send(field_name), :ruby)}</pre>\"\n elsif options[:as] == :icon\n val = \"<i class='#{h(@context_obj.send(field_name))} fa-2x'></i>\"\n elsif options[:as] == :yesno\n val = @context_obj.send(field_name) ? I18n.t('cmn.yes') : I18n.t('cmn.no')\n else\n val = h(@context_obj.send(field_name))\n end\n\n \"<dt>#{h(label)}&nbsp;</dt><dd>#{val}</dd>\".html_safe\n end", "title": "" }, { "docid": "8c7db52c63bdc3425fac435f24782d25", "score": "0.6879031", "text": "def display_label(context = nil, lens = nil)\n type = context.to_s.presence\n lens = Blacklight::Lens.key_for(lens)\n name = key.to_s.sub(FIELD_PREFIX_RE, '').sub(FIELD_SUFFIX_RE, '')\n keys = []\n keys << :\"blacklight.#{lens}.#{type}_field.#{name}\" if lens && type\n keys << :\"blacklight.#{lens}.field.#{name}\" if lens\n keys << :\"blacklight.#{type}_field.#{name}\" if type\n keys << :\"blacklight.field.#{name}\"\n keys << label\n keys << name.to_s.titleize\n keys.delete_if(&:blank?)\n field_label(*keys)\n end", "title": "" }, { "docid": "f3d4d608aae2ecce87013bbc4002840a", "score": "0.6862135", "text": "def hidden_field_with_label(**args)\n opts = separate_field_options_from_args(args)\n text = opts[:text] || opts[:value] || \"\"\n\n wrap_class = form_group_wrap_class(args)\n\n content_tag(:div, class: wrap_class) do\n concat(args[:form].label(args[:field], args[:label], class: \"mr-3\"))\n concat(content_tag(:p, text, class: \"form-control-static\"))\n concat(args[:form].hidden_field(args[:field], opts))\n end\n end", "title": "" }, { "docid": "f97c605198859c8cbac339e43ad8d0bb", "score": "0.68569016", "text": "def label= txt\n \n end", "title": "" }, { "docid": "f97c605198859c8cbac339e43ad8d0bb", "score": "0.68569016", "text": "def label= txt\n \n end", "title": "" }, { "docid": "bdc5d3c1d3b9d2103f1f07f131bc24f0", "score": "0.6856292", "text": "def dc_field_label_help(options)\n label, help = dc_label_help(options)\n # create field object from type and call its render method\n if options['type'].present?\n klass_string = options['type'].camelize\n field_html = if DrgcmsFormFields.const_defined?(klass_string) # when field type defined\n klass = DrgcmsFormFields.const_get(klass_string)\n field = klass.new(self, @record, options).render\n @js << field.js\n @css << field.css\n field.html\n else\n \"Error: Field type #{options['type']} not defined!\"\n end\n else\n \"Error: Field type missing!\"\n end\n [field_html, label, help]\nend", "title": "" }, { "docid": "83fd888b1c38e77758285e23167a0c14", "score": "0.6852655", "text": "def inline_label(wrapper_options)\n inline_option = options[:inline_label]\n\n if inline_option\n label = inline_option == true ? label_text : html_escape(inline_option)\n \" #{label}\".html_safe\n end\n end", "title": "" }, { "docid": "e7b75f691ddbde6a460628214ff5e4ef", "score": "0.6848222", "text": "def element(label = '&nbsp;', value = '', type = 'text_field', &block)\n value += @template.capture(&block) if block_given?\n %{\n <div class='control-group'>\n <label class='control-label'>#{label}</label>\n <div class='controls'>\n #{value}\n </div>\n </div>\n }.html_safe\n end", "title": "" }, { "docid": "c1d669de8d38e1472adf5e110555e84d", "score": "0.6847363", "text": "def wizard_label(field, text = nil, options = {}) \n # set value\n text = self.wizard_model[field] if text.nil?\n \n # return a label field\n return label(self.wizard_model, field, text, options)\n end", "title": "" }, { "docid": "507786c1d3c0497a1c7f08df86310a81", "score": "0.6836474", "text": "def format_as_label(elem, style = 'info')\n html = \"<span class='label label-#{style}'>\"\n html << elem.to_s\n html << \"</span>\"\n html.html_safe\n end", "title": "" }, { "docid": "507786c1d3c0497a1c7f08df86310a81", "score": "0.6836474", "text": "def format_as_label(elem, style = 'info')\n html = \"<span class='label label-#{style}'>\"\n html << elem.to_s\n html << \"</span>\"\n html.html_safe\n end", "title": "" }, { "docid": "a60a6bdd7d61c53abfc551c44cb12d64", "score": "0.68272895", "text": "def label= txt; end", "title": "" }, { "docid": "a60a6bdd7d61c53abfc551c44cb12d64", "score": "0.68272895", "text": "def label= txt; end", "title": "" }, { "docid": "794cde048465cd3a83eacab3528de103", "score": "0.681967", "text": "def custom_label\n \"#{self.name}\"\n end", "title": "" }, { "docid": "9627b976e548da5134a10f26249547d6", "score": "0.6819502", "text": "def wor_custom_field_tag_with_label(name, custom_value, options={})\n wor_custom_field_label_tag(name, custom_value, options) + wor_custom_field_tag(name, custom_value)\n end", "title": "" }, { "docid": "9db429844fa8bae2c8c77dd2816264b8", "score": "0.6814906", "text": "def render_tag_with_label(label, unlabeled_tag, template = self)\n label_html = extract_label_html! label\n label_text = extract_label_text! label\n label_template = template.content_tag(:label, label_text, label_html)\n label_and_tag = \"\"\n\n if label[:after]\n label_and_tag = unlabeled_tag + label_template\n elsif label[:linebreak] == false\n label_and_tag = label_template + unlabeled_tag\n else\n label_and_tag = label_template + \"<br />\" + unlabeled_tag\n end\n\n if label[:paragraph] == false || label[:after]\n return label_and_tag\n else\n return template.content_tag(:p, label_and_tag)\n end\n end", "title": "" }, { "docid": "a86138a7df719bb91a4b869a23548369", "score": "0.6805486", "text": "def render_document_show_field_label *args\n options = args.extract_options!\n document = args.first\n\n field = options[:field]\n\n html_escape document_show_fields(document)[field].label\n end", "title": "" }, { "docid": "ad00fc5af8809c49c0daa70f629aa7a2", "score": "0.68046796", "text": "def label_for name, record = nil, attr = name, options = {}\n errors = record && !record.body.blank? && !record.valid? && record.errors[attr]\n label name.to_s, { :for => name }, options.merge(errors ? { :class => :error } : {})\n end", "title": "" }, { "docid": "79ff1b357a99a17ef379e1c0d88322b9", "score": "0.6800655", "text": "def definition_as_html() \n \"<b>#{label}</b>&nbsp;#{domain ? domain.definition_as_html : nil}\"\n end", "title": "" }, { "docid": "b1bb409dec2333f25b1f071f60402a20", "score": "0.6788819", "text": "def custom_label_method\n \"#{self.nombre} #{self.apellido}\"\n end", "title": "" }, { "docid": "23842585f51c08762b6d5d60fafd30d1", "score": "0.6784442", "text": "def label_for_custom_field(entry, field)\n if field.localized?\n translated_css = entry.translated_field?(field) ? '' : 'untranslated'\n\n icon = content_tag(:i, '', class: \"fa fa-globe #{translated_css}\")\n\n \"#{icon}&nbsp;#{field.label}\".html_safe\n else\n field.label\n end\n end", "title": "" }, { "docid": "ad1623982c5223077ff6d747e1810169", "score": "0.6780982", "text": "def build_label_tag(field, opts, key = :label, defaults = { :class => \"control-label\" }, &block)\n label_opts = extract_sub_options(opts, key, defaults)\n\n # False indicates complete fall-back to FormBuilder's implementation\n return false if label_opts === false\n\n if label_opts\n if block_given?\n label(field, *label_opts) { yield(label_opts) }\n else\n label(field, *label_opts)\n end\n else\n \"\"\n end.html_safe\n end", "title": "" }, { "docid": "778efe73b006c7c4fd8d94ef7c1516db", "score": "0.6773766", "text": "def as_field(label, inside)\n label = label ? t(label) : ''\n locals = { :label => label, :inside => inside }\n render :partial => 'shared/as_field', :locals => locals\n end", "title": "" }, { "docid": "273ba56599dd84870d87f3a6f0f270c3", "score": "0.6769881", "text": "def text_field_for(form, field,\n size = HTML_TEXT_FIELD_SIZE,\n maxlength = DB_STRING_MAX_LENGTH)\n \n # label = \n content_tag(:label, \"#{field.humanize}:\", :for => field) + \"\" + (form.text_field field, :size => size, :maxlength => maxlength)\n\n # form_field = \n\n\n\n # content_tag(:div, \"#{label}\" + \"<br/>\" + \"#{form_field}\", :class => \"form_row\")\n end", "title": "" }, { "docid": "3b13ef276f321562e36031b9322dc32f", "score": "0.67657524", "text": "def content_label(content)\n content_tag :label, for: content.form_field_id do\n [render_content_name(content), render_hint_for(content)].compact.join(\"&nbsp;\").html_safe\n end\n end", "title": "" } ]
124896c3c8ef6e853d70f5f5922cdcdc
Very simple, given a number, find its opposite. Examples: 1: 1 14: 14 34: 34
[ { "docid": "cdabfd0921478277993a8cd9741c46e0", "score": "0.7117432", "text": "def opposite(num)\n if num < 0\n return num * -1\n \n else\n return num * -1\n end\nend", "title": "" } ]
[ { "docid": "209b1349fb319312759a49506781df4c", "score": "0.78078616", "text": "def opposite(number)\n 0 - number\nend", "title": "" }, { "docid": "209b1349fb319312759a49506781df4c", "score": "0.78078616", "text": "def opposite(number)\n 0 - number\nend", "title": "" }, { "docid": "e488f7af51041337d223d8d6b904e5a5", "score": "0.75202864", "text": "def opposite(number)\n return number * (-1)\nend", "title": "" }, { "docid": "c67caaa73432017bcf4e0d6a5b292836", "score": "0.7504885", "text": "def opposite(num)\n - num\nend", "title": "" }, { "docid": "d2a644a07f319fc8150bc81e0d0585bc", "score": "0.7323653", "text": "def opposite2(n)\n -n\nend", "title": "" }, { "docid": "25f175448c2a0faa306f660d6feb0ac6", "score": "0.72973144", "text": "def opposite(num)\n return -1*num\nend", "title": "" }, { "docid": "268bbd1f89c8d3dbec8c4aa1ad500cea", "score": "0.70281225", "text": "def opposite(num)\n num = -num\nend", "title": "" }, { "docid": "82dea4236b065e248590ecadf9249247", "score": "0.67303824", "text": "def opposite(i)\n i.to_s.include?('-') ? \"#{i}\".delete('-').to_f : \"-#{i}\".to_f\nend", "title": "" }, { "docid": "85107d6c5247713e9b972fd1c1392f53", "score": "0.6614544", "text": "def reversed_number(num)\n num.to_s.reverse.to_i unless num < 0\nend", "title": "" }, { "docid": "5147c8432e434bbc2957a2fdf625da00", "score": "0.6554725", "text": "def negatize(num)\n\nend", "title": "" }, { "docid": "31c09cdab68627a4d7103950da4d129c", "score": "0.6475276", "text": "def opposite(n)\n case n\n when 'EQ' \n return 'NE'\n when 'NE'\n return 'EQ'\n when 'CS'\n return 'CC'\n when 'CC'\n return 'CS'\n when 'MI'\n return 'PL'\n when 'PL'\n return 'MI'\n when 'HI'\n return 'LS'\n when 'LS'\n return 'HI'\n when 'GE'\n return 'LT'\n when 'LT'\n return 'GE'\n when 'GT'\n return 'LE'\n when 'LE'\n return 'GT'\n when 'AL'\n return 'AL'\n end \nend", "title": "" }, { "docid": "6779cd69dc3482b1047a70bf1fbd024e", "score": "0.639726", "text": "def reverse\n num.abs.to_s.reverse.to_i * (num <=> 0)\n end", "title": "" }, { "docid": "9f8b077c5d5024791603cbad6a7b83bf", "score": "0.6384821", "text": "def reversed_number(number)\n\tnumber.to_s.reverse.to_i\nend", "title": "" }, { "docid": "5fa93386795048033f024ee6bce74075", "score": "0.6339532", "text": "def reversed_number(number)\n number.to_s.reverse.to_i\nend", "title": "" }, { "docid": "5fa93386795048033f024ee6bce74075", "score": "0.6339532", "text": "def reversed_number(number)\n number.to_s.reverse.to_i\nend", "title": "" }, { "docid": "5fa93386795048033f024ee6bce74075", "score": "0.6339532", "text": "def reversed_number(number)\n number.to_s.reverse.to_i\nend", "title": "" }, { "docid": "5fa93386795048033f024ee6bce74075", "score": "0.6339532", "text": "def reversed_number(number)\n number.to_s.reverse.to_i\nend", "title": "" }, { "docid": "5fa93386795048033f024ee6bce74075", "score": "0.6339532", "text": "def reversed_number(number)\n number.to_s.reverse.to_i\nend", "title": "" }, { "docid": "394680d4fff6d8f3b61569040d11b858", "score": "0.6234118", "text": "def reversed_number(number)\n p number.to_s.reverse.to_i\nend", "title": "" }, { "docid": "6e6fcadc6a49e737e0a9ae750f08790b", "score": "0.6205342", "text": "def opposite (x)\n #your code here\n x *= -1\n puts x.to_s\nend", "title": "" }, { "docid": "b102a5b3f4b9b29d8ce304153ec7c484", "score": "0.61800134", "text": "def reversed_number(num)\n num.to_s.reverse.to_i\nend", "title": "" }, { "docid": "b102a5b3f4b9b29d8ce304153ec7c484", "score": "0.61800134", "text": "def reversed_number(num)\n num.to_s.reverse.to_i\nend", "title": "" }, { "docid": "b102a5b3f4b9b29d8ce304153ec7c484", "score": "0.61800134", "text": "def reversed_number(num)\n num.to_s.reverse.to_i\nend", "title": "" }, { "docid": "b102a5b3f4b9b29d8ce304153ec7c484", "score": "0.61800134", "text": "def reversed_number(num)\n num.to_s.reverse.to_i\nend", "title": "" }, { "docid": "b102a5b3f4b9b29d8ce304153ec7c484", "score": "0.61800134", "text": "def reversed_number(num)\n num.to_s.reverse.to_i\nend", "title": "" }, { "docid": "b102a5b3f4b9b29d8ce304153ec7c484", "score": "0.61800134", "text": "def reversed_number(num)\n num.to_s.reverse.to_i\nend", "title": "" }, { "docid": "b102a5b3f4b9b29d8ce304153ec7c484", "score": "0.61800134", "text": "def reversed_number(num)\n num.to_s.reverse.to_i\nend", "title": "" }, { "docid": "b102a5b3f4b9b29d8ce304153ec7c484", "score": "0.61800134", "text": "def reversed_number(num)\n num.to_s.reverse.to_i\nend", "title": "" }, { "docid": "b102a5b3f4b9b29d8ce304153ec7c484", "score": "0.61800134", "text": "def reversed_number(num)\n num.to_s.reverse.to_i\nend", "title": "" }, { "docid": "b102a5b3f4b9b29d8ce304153ec7c484", "score": "0.61800134", "text": "def reversed_number(num)\n num.to_s.reverse.to_i\nend", "title": "" }, { "docid": "c8a6fb723aea7d470c869aedcd73add4", "score": "0.6174291", "text": "def my_reverse(x)\n neg = false\n neg = true if x < 0\n\n x = x.abs.to_s.split(\"\")\n\n result = \"\"\n x.each do |num|\n result = num.to_s + result\n end\n result = result.to_i\n return 0 if result > (2 ** 32) / 2\n if neg\n return result * -1\n else\n return result\n end\n\nend", "title": "" }, { "docid": "acdce650758e965f8e749ee8c76219aa", "score": "0.6162856", "text": "def reverse(number)\n \nend", "title": "" }, { "docid": "43551f8b18c58750adc2ad430508eb58", "score": "0.6162603", "text": "def reversed_number(number)\n string = number.to_s\n reversed_string = string.reverse\n reversed_string.to_i\nend", "title": "" }, { "docid": "43551f8b18c58750adc2ad430508eb58", "score": "0.6162603", "text": "def reversed_number(number)\n string = number.to_s\n reversed_string = string.reverse\n reversed_string.to_i\nend", "title": "" }, { "docid": "43551f8b18c58750adc2ad430508eb58", "score": "0.6162603", "text": "def reversed_number(number)\n string = number.to_s\n reversed_string = string.reverse\n reversed_string.to_i\nend", "title": "" }, { "docid": "43551f8b18c58750adc2ad430508eb58", "score": "0.6162603", "text": "def reversed_number(number)\n string = number.to_s\n reversed_string = string.reverse\n reversed_string.to_i\nend", "title": "" }, { "docid": "95e16f4e329cb65f25a68f881d3ff11e", "score": "0.61616606", "text": "def make_numbers_negative(number)\n -(number.abs)\nend", "title": "" }, { "docid": "9abfad5bb7254aa88943f0e215dd213d", "score": "0.6159298", "text": "def reversible(n)\n return false if n.to_s.split('').last.to_i == 0\n sum = n + n.to_s.reverse.to_i\n sum.to_s.split('').each do |digit|\n return false if digit.to_i % 2 == 0\n end\n return true\nend", "title": "" }, { "docid": "b63dd0794aa45dbb05be712473c78c68", "score": "0.61491287", "text": "def reverse(number)\n\nend", "title": "" }, { "docid": "06e0a06f1d0c459463bb9b8b125b3d81", "score": "0.6142987", "text": "def opposite; end", "title": "" }, { "docid": "ab75a2ed879e46cd561599a7b4fb8790", "score": "0.6139767", "text": "def palindrome(number)\n number.to_s == number.to_s.reverse\nend", "title": "" }, { "docid": "7dd46f8e3378d9aacf40c143d35e994a", "score": "0.6128845", "text": "def closest_palindrome(num)\n num2 = 0\n num3=num\n x=1\n if !(num.to_s==(num.to_s).reverse)\n while(!(num3.to_s==(num3.to_s).reverse))\n num3 = num-x\n ((num3.to_s==(num3.to_s).reverse))?(num2 = num3):(num3 = num+x)\n (!(num3.to_s==(num3.to_s).reverse))?(num2 = num3):()\n x+=1\n end\n return num3\n else\n num2 = num\n end\n return num2\nend", "title": "" }, { "docid": "d46d308520c94f2cc64458d173be9d19", "score": "0.6125251", "text": "def check_if_palindrome_num(n)\n\t(n.to_s == n.to_s.reverse )? true : false\nend", "title": "" }, { "docid": "2431b97b5a96f46c2be2dd0f66da103a", "score": "0.6122928", "text": "def toggle number\r\n number=(number.class!=String) ? number.to_s : number\r\n number.reverse.to_i\r\nend", "title": "" }, { "docid": "2877055db30da4454634f1f34c1bdadd", "score": "0.6113368", "text": "def make_numbers_negative(number)\n\tnumber = -number.abs\nend", "title": "" }, { "docid": "41dd2dac58df57900045e89e57f1d4c4", "score": "0.6110462", "text": "def palindrome? (number)\n string = number.to_s\n string == string.reverse\nend", "title": "" }, { "docid": "d1c8c113691991ba06969b74b9b2c172", "score": "0.6098836", "text": "def palindrome?(number)\n number == number.to_s.reverse.to_i\nend", "title": "" }, { "docid": "42f44936980869b48d183b4acae25ac7", "score": "0.6098828", "text": "def odd(number1)\n number1.abs.remainder(2) == 1\nend", "title": "" }, { "docid": "a709cc1836031b01ebb7d733c7b798c4", "score": "0.6094058", "text": "def reverse_number(number)\n number.to_s.reverse.to_i\nend", "title": "" }, { "docid": "a709cc1836031b01ebb7d733c7b798c4", "score": "0.6094058", "text": "def reverse_number(number)\n number.to_s.reverse.to_i\nend", "title": "" }, { "docid": "3eb9afd10c87fb40588dc41951110191", "score": "0.60804874", "text": "def subtractNumber2(number)\n p number -2\n end", "title": "" }, { "docid": "e22d2b142ec6aa41b20fd2f40306ef63", "score": "0.60791695", "text": "def opposite_sign? num1, num2\n (num1 ^ num2) < 0\nend", "title": "" }, { "docid": "994127d553e1321376c0b86023af1f35", "score": "0.60752165", "text": "def is_palindrome? (number)\n num_to_string = number.to_s\n num_to_string == num_to_string.reverse\nend", "title": "" }, { "docid": "068de52b623ef16c915aac13e738f9a5", "score": "0.60689324", "text": "def reverse_number(n)\n abs = n.abs.to_s.reverse\n if n < 0\n ('-' + abs).to_i\n else\n abs.to_i\n end\nend", "title": "" }, { "docid": "c483d6a8c0c6008485eb715f751019e7", "score": "0.60688454", "text": "def subtract(number1, number2)\n difference = number1 - number2\n return difference \n end", "title": "" }, { "docid": "bf132e93315bae59caea955cb9859f17", "score": "0.60686046", "text": "def reverse(num)\n return 0 if num == 0 \n inner = lambda do |n, res|\n return res if n == 0\n res = res * 10 + n % 10 \n inner.call(n / 10, res)\n end\n result = inner.call(num.abs, 0) * (num < 0 ? -1 : 1)\n return 0 if result >= 2147483647 || result <= -2147483647\n result\nend", "title": "" }, { "docid": "b249912cfaba770516bee9089fa39cf6", "score": "0.6060497", "text": "def subtract(number1, number2)\n number1 - number2\n end", "title": "" }, { "docid": "4a97b869dd2cc5b3fcc7256bb86ff9b0", "score": "0.60548097", "text": "def reversed_number(integer)\r\n integer.to_s.reverse.to_i\r\nend", "title": "" }, { "docid": "9a345efcb50a970d0f96503d5ea78680", "score": "0.6051311", "text": "def getOdd(n)\n (2*n)-1\n end", "title": "" }, { "docid": "75fb2bcd337da0371bfb72b9daf0318e", "score": "0.6044318", "text": "def palindrome_number?(num)\n num.to_s == num.to_s.reverse\nend", "title": "" }, { "docid": "f60fddf9e33eb72022e1decaaff25e28", "score": "0.60426813", "text": "def make_numbers_negative(number)\nend", "title": "" }, { "docid": "22446d86ffdfd541d26b90196d1c8036", "score": "0.6035615", "text": "def reverse\n result = 0\n n = self\n loop do\n result = result * 10 + n % 10\n break if (n /= 10).zero?\n end\n result\n end", "title": "" }, { "docid": "94567dbe6a800ca03d2b1e80cabdcfc1", "score": "0.602636", "text": "def palindromic_number(num)\n number = num.to_s\n number == number.reverse\nend", "title": "" }, { "docid": "5fd71682f35b4dc18cf3796eda68e224", "score": "0.6022605", "text": "def make_numbers_negative(number)\n number = -(number.abs)\nend", "title": "" }, { "docid": "1958202f421e7fcddf5cf699a5777ce5", "score": "0.6019681", "text": "def no_strings_reverse(number)\n reversed_array = []\n digits = (0..9).to_a\n place_value = 1\n reversed_number = 0\n\n until number == 0\n digits.each do |digit|\n if (number - digit * place_value) % (place_value * 10) == 0\n reversed_array << digit\n number -= (digit * place_value)\n place_value *= 10\n end\n end\n end\n\n reversed_array.length.times do |index|\n reversed_number += reversed_array[index] * 10 ** (reversed_array.length - index - 1)\n end\n return reversed_number\nend", "title": "" }, { "docid": "9d4806ed30178eccc94bcb874e7698bf", "score": "0.6016545", "text": "def palindromic_number?(number)\n number_as_string = number.to_s.to_i.to_s\n number_as_string == number_as_string.reverse\nend", "title": "" }, { "docid": "4c6c8843e130d70325f397653283109c", "score": "0.6010465", "text": "def reverseInt(n) \n reversed = n.to_s.reverse.to_i\n return n.negative? ? reversed * -1 : reversed \nend", "title": "" }, { "docid": "095d5349c54936f18c1fe204291a12e0", "score": "0.6001794", "text": "def reversed_number(integer)\n integer.to_s.reverse.to_i\nend", "title": "" }, { "docid": "095d5349c54936f18c1fe204291a12e0", "score": "0.6001794", "text": "def reversed_number(integer)\n integer.to_s.reverse.to_i\nend", "title": "" }, { "docid": "ece0a052c27bb259001b06508cefd5f3", "score": "0.5993947", "text": "def reversed_number(num)\n number_string = num.to_s\n number_string.reverse.to_i\nend", "title": "" }, { "docid": "6292b60e202217b4696d59e39294049a", "score": "0.5985932", "text": "def palindromic_number(number)\n number == \"#{number}\".reverse.to_i \nend", "title": "" }, { "docid": "8e42b169d180f8e3e0ac9fb3c079a1ba", "score": "0.59770703", "text": "def palindromic_number?(number)\n number_as_string = number.to_s\n number_as_string == number_as_string.reverse\nend", "title": "" }, { "docid": "8933e6e32d7716e8fb7d3d530fe4ca36", "score": "0.5975901", "text": "def reversed_number(numbers)\n numbers.to_s.reverse.to_i\nend", "title": "" }, { "docid": "1e95077c43eee146cb068673c8feb786", "score": "0.5965367", "text": "def numero(number)\n puts number.abs % 2 == 1\nend", "title": "" }, { "docid": "bf59a3538357e27c87659912d60f2b56", "score": "0.5962016", "text": "def is_palindrome num \n\tnum.to_s == num.to_s.reverse\nend", "title": "" }, { "docid": "5e56fef34e46a1098b980bc01e2c4262", "score": "0.59595263", "text": "def reverse_number(n)\n if n > 0\n n.digits.join.to_i\n\n else\n (n*-1).digits.join.to_i*-1\n end\nend", "title": "" }, { "docid": "6d7782b49dd5dc5540dfc8f0159ffee0", "score": "0.595868", "text": "def mirror?(number)\n f = prime_number(number)\n l = prime_number(get_mirror(number)).to_s\n\n if f == l.reverse.to_i\n return true\n end\nend", "title": "" }, { "docid": "4ebc18edc19cc5db213f966f4189b32b", "score": "0.59471947", "text": "def makeNegative(num)\n if num <= 0\n return num\n else\n num = num - num * 2\n return num\n end\nend", "title": "" }, { "docid": "baf09d017b1a1ad0d7e1640d9ac08f21", "score": "0.5943121", "text": "def subtract(first_number, second_number)\n return first_number - second_number\nend", "title": "" }, { "docid": "36aa98bbc16d12fe38c91c49df20d594", "score": "0.59417474", "text": "def reverse_a_number(number)\n # write code here \nend", "title": "" }, { "docid": "1a11be1db1f3dfb32ae7e7d19e3be095", "score": "0.59378046", "text": "def is_palindrome? int\n int == int.to_s.reverse.to_i\nend", "title": "" }, { "docid": "45f7c2b8abf80ca5e3df52c5184ea76a", "score": "0.59376204", "text": "def previous_number(number)\n return number -= 1\nend", "title": "" }, { "docid": "45f7c2b8abf80ca5e3df52c5184ea76a", "score": "0.59376204", "text": "def previous_number(number)\n return number -= 1\nend", "title": "" }, { "docid": "c61cf2b9091ed480d59d576b6ec9af59", "score": "0.5919653", "text": "def makeNegative(num)\n if num > 0\n return num - 2*num\n\n elsif num <= 0\n return num\n end\nend", "title": "" }, { "docid": "466ba6b7ab6d666e78bd1cc07a5dd646", "score": "0.5918729", "text": "def negative(number)\n if number.positive?\n -number\n elsif number.negative?\n number\n else\n number\n end\nend", "title": "" }, { "docid": "0d32de923424879f3718d7fff219c78b", "score": "0.5917065", "text": "def palondromic?(number)\n number.to_s == number.to_s.reverse\nend", "title": "" }, { "docid": "b723952789fbeb493bd759b82e053618", "score": "0.5914781", "text": "def reverse(x)\n number = x.to_s.gsub(/[^\\d]/, '')\n sign = x.to_s.gsub(/[^\\+|\\-]/, '')\n reversed_number = (sign + number.to_s.split(\"\").reverse.join(\"\")).to_i\n if reversed_number > 2**31 - 1 || reversed_number < -2**31\n 0\n else\n reversed_number\n end\nend", "title": "" }, { "docid": "c781d1aba554b2c60ffe02a49172917c", "score": "0.59109", "text": "def reversed_number(number)\n number.to_s.chars.reverse.join.to_i\nend", "title": "" }, { "docid": "5239f55ad17265f2ff008be577bfafec", "score": "0.5910018", "text": "def number_reverse(number)\n number.to_s.reverse.to_f\nend", "title": "" }, { "docid": "fe07d9be1ef205671b8631e6b4f9c587", "score": "0.5904267", "text": "def make_numbers_negative(number)\n\treturn number < 0 ? number : number*(-1)\nend", "title": "" }, { "docid": "0338a74e3a3a1a5c7630df694bb32bf9", "score": "0.59038883", "text": "def palindrome? num\n s1 = num.to_s\n s2 = num.to_s.reverse\n s1 == s2\nend", "title": "" }, { "docid": "4f1cc76381be8264d1bd4cf2ceb22d4e", "score": "0.5900111", "text": "def reversed_number(inp_num)\n inp_num.to_s.reverse.to_i\nend", "title": "" }, { "docid": "fe1db21b2e789be8a4d43af6846e3174", "score": "0.58926684", "text": "def ne_numb(numb)\n return numb + 1\nend", "title": "" }, { "docid": "3aa3f3668dce9c0c829209f7da8dda99", "score": "0.5889446", "text": "def is_palindrome(number)\n num = number\n x = 0\n\n until num == 0\n x += 1\n num = num / 10\n end\n y = 10 ** (x - 1)\n\n until number < 10\n if number % 10 == number / y\n number = number / 10\n number = number % (y / 10)\n y = y / 100\n else\n return false\n end\n end\n return true\nend", "title": "" }, { "docid": "f382818f816c99d63b3db6f9075d47eb", "score": "0.58869296", "text": "def make_numbers_negative(number)\n\tnumber <= 0 ?\tnumber : -number\nend", "title": "" }, { "docid": "740f1b9531ff526df79b9fc317bf5000", "score": "0.5882989", "text": "def palindromic_number?(num)\n number_string = num.to_s\n number_string == number_string.reverse\nend", "title": "" }, { "docid": "d9f601391a77348c62ad883d695d5072", "score": "0.5882444", "text": "def palindromic_number?(number)\n number_string = number.to_s\n number_string == number_string.reverse\nend", "title": "" }, { "docid": "988f6b8d4666c57b36aaf49e554a8c35", "score": "0.5882339", "text": "def palindromic_number?(num)\n puts num\n num.to_s == num.to_s.reverse\nend", "title": "" }, { "docid": "a6f50b5173c8f4135035cecf9bf27d9c", "score": "0.58797014", "text": "def negative(number)\n if number.positive?\n return -(number)\n elsif number.negative?\n return number\n elsif number.zero?\n return 0\n end\nend", "title": "" }, { "docid": "186fb3f6ad86963a7f5bda6385f41029", "score": "0.5874827", "text": "def subtract num1, num2\n result = 0\n if num1 >= num2\n until result + num2 == num1\n result += 1\n end\n result\n else\n until result + num1 == num2\n result += 1\n end\n return -result\n end\n\nend", "title": "" } ]
1d6673549b1dc699d019adca0d316eda
PATCH/PUT /originating_histories/1 PATCH/PUT /originating_histories/1.json
[ { "docid": "86a443439ec464b1a70965e35d0bb98b", "score": "0.6852895", "text": "def update\n respond_to do |format|\n if @originating_history.update(originating_history_params)\n format.html { redirect_to @originating_history, notice: 'Originating history was successfully updated.' }\n format.json { render :show, status: :ok, location: @originating_history }\n else\n format.html { render :edit }\n format.json { render json: @originating_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "5adc071ac70442e8ab9181648c94eed9", "score": "0.65348697", "text": "def update\n @historical = Historical.find(params[:id])\n\n respond_to do |format|\n if @historical.update_attributes(params[:historical])\n format.html { redirect_to @historical, notice: 'Historical was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @historical.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3eac0522661dcb81bb8a2bde6bfb6819", "score": "0.65277565", "text": "def update\n @historial = Historial.find(params[:id])\n\n respond_to do |format|\n if @historial.update_attributes(params[:historial])\n format.html { redirect_to @historial.cartucho, notice: 'Historial was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @historial.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "22c9e5075101e405b7ea6c23ce47dbb8", "score": "0.6388157", "text": "def update\n @historial_odt = HistorialOdt.find(params[:id])\n\n respond_to do |format|\n if @historial_odt.update_attributes(params[:historial_odt])\n format.html { redirect_to @historial_odt, notice: 'Historial odt was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @historial_odt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "776345dedbd0fd975ab8c8107f277608", "score": "0.6359449", "text": "def update\n respond_to do |format|\n if @historic.update(historic_params)\n format.html { redirect_to @historic, notice: 'Historic was successfully updated.' }\n format.json { render :show, status: :ok, location: @historic }\n else\n format.html { render :edit }\n format.json { render json: @historic.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fb3d010f43b6413b7a59f1f40572b984", "score": "0.63326466", "text": "def update\n respond_to do |format|\n if @historial.update(historial_params)\n format.html { redirect_to @historial, notice: 'Historial was successfully updated.' }\n format.json { render :show, status: :ok, location: @historial }\n else\n format.html { render :edit }\n format.json { render json: @historial.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fb3d010f43b6413b7a59f1f40572b984", "score": "0.63326466", "text": "def update\n respond_to do |format|\n if @historial.update(historial_params)\n format.html { redirect_to @historial, notice: 'Historial was successfully updated.' }\n format.json { render :show, status: :ok, location: @historial }\n else\n format.html { render :edit }\n format.json { render json: @historial.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dce36c38947e2d0f67fe8239c081c4c8", "score": "0.62267977", "text": "def update\n respond_to do |format|\n if @histroal.update(histroal_params)\n format.html { redirect_to @histroal, notice: 'Historial was successfully updated.' }\n format.json { render :show, status: :ok, location: @histroal }\n else\n format.html { render :edit }\n format.json { render json: @histroal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99faed42820fb0d02f75b6aa31c78bd9", "score": "0.62256837", "text": "def update\n respond_to do |format|\n if @historical_source.update(historical_source_params)\n format.html { redirect_to @historical_source, notice: 'Historical source was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @historical_source.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8b7721282559510601f0cd5ae30361ca", "score": "0.6216486", "text": "def update\n historial_params = params[:historial]\n with_bill = historial_params.delete(:with_bill)\n @historial = Historial.find(params[:id])\n\n respond_to do |format|\n if @historial.update_attributes(historial_params)\n if with_bill.present?\n format.html { redirect_to new_bill_path(\n client_id: @historial.cliente_id,\n historial_id: @historial.id\n ), notice: 'Presupuesto actualizado =)'}\n else\n format.html { redirect_to @historial, notice: 'Presupuesto actualizado =)' }\n end\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @historial.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "40e06405230b093b709537d9d4b324ff", "score": "0.6178178", "text": "def update\n #@fundamentals_history = FundamentalsHistory.find(params[:id])\n @fundamentals_history = @company.fundamentals_histories.find(params[:id])\n\n respond_to do |format|\n if @fundamentals_history.update_attributes(params[:fundamentals_history])\n format.html { redirect_to @fundamentals_history, notice: 'Fundamentals history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fundamentals_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4e6f6964edff9b5fe9358188404558c9", "score": "0.60433066", "text": "def update\n respond_to do |format|\n old = @hr_person\n if @hr_person.update(hr_person_params)\n if params[:change_seat]\n @hr_person.hr_person_histories.create(old.attributes.except('id', 'created_by', 'updated_by', 'created_at', 'updated_at'))\n end\n format.html { render :js => view_context.close_window_show_tips('parent.MAIN_LAYER_WINDOW', '资料创建成功!') }\n format.json { render :show, status: :ok, location: @hr_person }\n else\n format.html { render :edit }\n format.json { render json: @hr_person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "abd32747a16178cb1aff2821a0d4d174", "score": "0.5890898", "text": "def update\n respond_to do |format|\n if @pediatric_history.update(pediatric_history_params)\n format.html { redirect_to @pediatric_history, notice: 'Historial pediatrico actualizado con exito.' }\n format.json { render :show, status: :ok, location: @pediatric_history }\n else\n format.html { render :edit }\n format.json { render json: @pediatric_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0da2edb07512dd9741944e8fcd3030f0", "score": "0.58867127", "text": "def update\n @operation_history = OperationHistory.find(params[:id])\n\n respond_to do |format|\n if @operation_history.update_attributes(params[:operation_history])\n format.html { redirect_to @operation_history, notice: 'Operation history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @operation_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6706e0b15a48c6b71b9f0d94b3f0ff7b", "score": "0.5873885", "text": "def update\n respond_to do |format|\n if @harvest_history.update(harvest_history_params)\n format.html { redirect_to @harvest_history, notice: 'Harvest history was successfully updated.' }\n format.json { render :show, status: :ok, location: @harvest_history }\n else\n format.html { render :edit }\n format.json { render json: @harvest_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c70438e192c11b858d93abb1714ce090", "score": "0.58695096", "text": "def update\n @reading_history = current_user.reading_histories.find(params[:id])\n\n respond_to do |format|\n if @reading_history.update_attributes(params[:reading_history])\n data_new = params[:reading_history]\n format.html { redirect_to data_new[\"html_path\"], notice: data_new.to_s }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @reading_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5b28fc219daa5074cc32cf60d91c6e6d", "score": "0.58679986", "text": "def update\n respond_to do |format|\n if @past_history.update(past_history_params)\n format.html { redirect_to @past_history, notice: 'Past history was successfully updated.' }\n format.json { render :show, status: :ok, location: @past_history }\n else\n format.html { render :edit }\n format.json { render json: @past_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4a336bc7f0cb447dc25b89ac1665d729", "score": "0.5850293", "text": "def set_historic\n @historic = Historic.find(params[:id])\n end", "title": "" }, { "docid": "d1d95c39aa3ccd880f1b22b019831b9c", "score": "0.5843151", "text": "def set_originating_history\n @originating_history = OriginatingHistory.find(params[:id])\n end", "title": "" }, { "docid": "b97c772ba34cad2623fb99bfb1a7eeab", "score": "0.5829467", "text": "def update\n respond_to do |format|\n if @history.update(history_params)\n format.html { redirect_to @history, notice: 'History was successfully updated.' }\n # format.json { render :show, status: :ok, location: @history }\n upper = @history.fandom_id ? @history.fandom : @history.history\n format.json { return render json: { data: @history, upper: upper, status: :ok } }\n else\n format.html { render :edit }\n # format.json { render json: @history.errors, status: :unprocessable_entity }\n format.json { return render json: { data: @history, status: :unprocessable_entity, message: \"The History's Date (#{@history.event_date.strftime('%F')}) is already exist!\" } }\n end\n end\n end", "title": "" }, { "docid": "9be68eac1011ff43a3bc3e3279629338", "score": "0.5788191", "text": "def update\n respond_to do |format|\n if @history.update(history_params)\n format.html { redirect_to @history, notice: 'History was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "71b2af2c41cbe720a873b7d54ea6cea9", "score": "0.57845676", "text": "def update\n respond_to do |format|\n if @thermostat_history.update(thermostat_history_params)\n format.html { redirect_to @thermostat_history, notice: 'Thermostat history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @thermostat_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "61cab8bba953926acf4ed8eef620ec11", "score": "0.5769372", "text": "def update\n @asset_allocation_history = AssetAllocationHistory.find(params[:id])\n\n respond_to do |format|\n if @asset_allocation_history.update_attributes(params[:asset_allocation_history])\n format.html { redirect_to @asset_allocation_history, notice: 'Asset allocation history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @asset_allocation_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "df7d7fd4b4e86b4ad399d8dd54e974a0", "score": "0.5766616", "text": "def update\n @buying_history = BuyingHistory.find(params[:id])\n\n respond_to do |format|\n if @buying_history.update_attributes(params[:buying_history])\n format.html { redirect_to @buying_history, :notice => 'Buying history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @buying_history.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5bd538284055d341a49e471525f615d7", "score": "0.57549214", "text": "def update\n @holding = Holding.find(params[:id])\n\n respond_to do |format|\n if @holding.update_attributes(params[:holding].merge(@yahoo_data))\n format.html { redirect_to @holding, notice: 'Holding was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @holding.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "55dc679e8ae9ab08f7fe5756be21b439", "score": "0.574949", "text": "def update\n render json: Company.update(params[\"id\"], params[\"company\"])\n end", "title": "" }, { "docid": "42d71c8a2c02f9ee28db29c06535ebe5", "score": "0.57441676", "text": "def update\n respond_to do |format|\n if @history.update(history_params)\n format.html { redirect_to @history, notice: 'History was successfully updated.' }\n format.json {\n render 'show', format: 'json', handlers: 'jbuilder', status: :ok\n }\n else\n format.html { render :edit }\n format.json { render json: @history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "313e114c6fed99679003943187f2efe6", "score": "0.57333356", "text": "def update\n @h_old = @housing_detail.dup\n @h_old.save\n\n @housing_detail.status = 'Waiting for Approval'\n @housing_detail.version_id = HousingDetail.where(category_id: @h_old.category_id).maximum(:version_id) + 1\n @housing_detail.updatedby = current_user.email\n\n respond_to do |format|\n if @housing_detail.update(housing_detail_params)\n format.html { redirect_to @housing_detail, notice: 'Housing detail was successfully updated.' }\n format.json { render :show, status: :ok, location: @housing_detail }\n else\n format.html { render :edit }\n format.json { render json: @housing_detail.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5fa94562a35d0ed0e7feba101b4890af", "score": "0.57267827", "text": "def update\n @illness_history = current_user.illness_histories.find(params[:id])\n\n respond_to do |format|\n if @illness_history.update_attributes(params[:illness_history])\n flash[:notice] = 'IllnessHistory was successfully updated.'\n format.html { redirect_to(medical_histories_path) }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end", "title": "" }, { "docid": "968e4814f76ec70ce514a4f56439b0ad", "score": "0.57246006", "text": "def update\n @settlement_history = Settlement::History.find(params[:id])\n\n respond_to do |format|\n if @settlement_history.update_attributes(params[:settlement_history])\n format.html { redirect_to @settlement_history, notice: 'History was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @settlement_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6747cc7eca5a62fcd9d11c529e310169", "score": "0.5722082", "text": "def update\n respond_to do |format|\n if @observation.update(observation_params)\n format.html { redirect_to @observation, notice: 'Observation was successfully updated.' }\n format.json { render :show, status: :ok, location: @observation }\n else\n @services_of_dependence = current_user.dependence.service_of_dependences\n agents_of_service = AgentOfService.where(service_of_dependence: @services_of_dependence)\n @agents = Agent.where(id: agents_of_service.pluck(:agent_id))\n format.html { render :edit }\n format.json { render json: @observation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b0d216f72caf2a54c37b8737abbe02d5", "score": "0.5701883", "text": "def update\n respond_to do |format|\n if @housing.update(housing_params)\n format.html { redirect_to @housing, notice: 'Housing was successfully updated.' }\n format.json { render :show, status: :ok, location: @housing }\n else\n format.html { render :edit }\n format.json { render json: @housing.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ec7b668557001e517e9f06e3e76a300d", "score": "0.5700973", "text": "def update\n respond_to do |format|\n if @clinic_history.update(clinic_history_params)\n format.html { redirect_to patient_clinic_histories_path(@patient, @clinic_history), notice: 'clinic_history actualizada satisfactoriamente.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @clinic_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a8ca8c0f4d94905563ada5b45cb10982", "score": "0.5689717", "text": "def update\n @vehicle_historic = VehicleHistoric.find(params[:id])\n @vehicle_historic.status = \"aberto\"\n\n respond_to do |format|\n if @vehicle_historic.update_attributes(params[:vehicle_historic])\n format.html { redirect_to(@vehicle_historic, :notice => 'Vehicle historic was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @vehicle_historic.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b70821ecea31a8548a3161aa8c60abe0", "score": "0.56569946", "text": "def update\n respond_to do |format|\n if @bug.update(bug_params)\n BugHistoric.create(bug_id: @bug.id, ref: BugHistoric.MODIFIED, user_id: current_user.id)\n format.html { redirect_to @bug, notice: 'Bug was successfully updated.' }\n format.json { render :show, status: :ok, location: @bug }\n else\n format.html { render :edit }\n format.json { render json: @bug.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8e4d32b3d212085436e233969140de88", "score": "0.56550634", "text": "def update\n @points_history = PointsHistory.find(params[:id])\n\n respond_to do |format|\n if @points_history.update_attributes(params[:points_history])\n format.html { redirect_to @points_history, notice: 'Points history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @points_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3941147b047c08dda461168af0595058", "score": "0.56497264", "text": "def update\n respond_to do |format|\n if @housing.update(housing_params)\n format.html {\n redirect_to housings_url, notice: 'Housing was successfully updated.' }\n format.json {\n render json: {}, status: :ok }\n else\n format.html { render :edit }\n format.json { render json: @housing.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "16801860adb7001a9116bf2e76435579", "score": "0.56309086", "text": "def update\n respond_to do |format|\n if @issue_history.update(issue_history_params)\n format.html { redirect_to @issue_history, notice: 'Issue history was successfully updated.' }\n format.json { render :show, status: :ok, location: @issue_history }\n else\n format.html { render :edit }\n format.json { render json: @issue_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "16801860adb7001a9116bf2e76435579", "score": "0.56309086", "text": "def update\n respond_to do |format|\n if @issue_history.update(issue_history_params)\n format.html { redirect_to @issue_history, notice: 'Issue history was successfully updated.' }\n format.json { render :show, status: :ok, location: @issue_history }\n else\n format.html { render :edit }\n format.json { render json: @issue_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eee5d7002daf559a9ed7ac6bedbc8853", "score": "0.5613144", "text": "def update\n respond_to do |format|\n if @history_thermostat.update(history_thermostat_params)\n format.html { redirect_to @history_thermostat, notice: 'History thermostat was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @history_thermostat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "040cc9e76e23752cc448ca23e4ec3292", "score": "0.560972", "text": "def update\n @observation = Observation.find(params[:id])\n\n respond_to do |format|\n if @observation.update_attributes(observation_params)\n format.html { redirect_to coral_path(@observation.coral), flash: {success: 'Observation was successfully updated.' } }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @observation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dd8cb8eca8c85deff519009d6b1b5263", "score": "0.56094176", "text": "def update\n respond_to do |format|\n if @order_history_joint.update(order_history_joint_params)\n format.html { redirect_to @order_history_joint, notice: 'Order history joint was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @order_history_joint.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1e6719b1f34b406fea466b00bed09a31", "score": "0.55910987", "text": "def update\n respond_to do |format|\n if @purchased_history.update(purchased_history_params)\n format.html { redirect_to @purchased_history, notice: 'Purchased history was successfully updated.' }\n format.json { render :show, status: :ok, location: @purchased_history }\n else\n format.html { render :edit }\n format.json { render json: @purchased_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6ba90924bf1572334565d4f5c9ce2c28", "score": "0.5585801", "text": "def update\n\t\tauthorize! :update, HistorialEstadoPresupuesto\n respond_to do |format|\n if @historial_estado_presupuesto.update(historial_estado_presupuesto_params)\n format.html { redirect_to @historial_estado_presupuesto, notice: 'Historial estado presupuesto fue actualizado satisfactoriamente.' }\n format.json { render :show, status: :ok, location: @historial_estado_presupuesto }\n else\n format.html { render :edit }\n format.json { render json: @historial_estado_presupuesto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ecfc3584cab3c68beb7d29d3943ba7d3", "score": "0.55821776", "text": "def update\n @cocktail_history = CocktailHistory.find(params[:id])\n\n respond_to do |format|\n if @cocktail_history.update_attributes(params[:cocktail_history])\n format.html { redirect_to @cocktail_history, notice: 'Cocktail history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cocktail_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9c622aeeb146160ffd6a6f87e88a05ac", "score": "0.55813897", "text": "def update\n respond_to do |format|\n if @item_history.update(item_history_params)\n format.html { redirect_to @item_history, notice: 'Item history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @item_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "158807a4c77911b28e65fbbaef8fe3ac", "score": "0.5580391", "text": "def update\n respond_to do |format|\n if @water_history.update(water_history_params)\n format.html { redirect_to @water_history, notice: 'Water history was successfully updated.' }\n format.json { render :show, status: :ok, location: @water_history }\n else\n format.html { render :edit }\n format.json { render json: @water_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c1463271408e00a1478f9628d70f8512", "score": "0.5575202", "text": "def update\n\n if key_indicate_map_indicator_file_params[:year]\n year = @key_indicate_map_indicator_file.year.to_s\n KeyIndicateMap::IndicatorKey.each{|key|\n if key['history'] && key['history'][year]\n attrs = key['history'].reject{|key, value| key == year }\n attrs[key_indicate_map_indicator_file_params[:year]] = key['history'][year]\n key.update_attributes({:history => attrs})\n end\n }\n end\n\n respond_to do |format|\n if @key_indicate_map_indicator_file.update(key_indicate_map_indicator_file_params)\n format.js {}\n format.json { head :no_content, status: :updated }\n else\n format.html { render :edit }\n format.json { render json: @key_indicate_map_indicator_file.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e991143a2fac36d7f18457c977219488", "score": "0.5570548", "text": "def update\n @housing_feature = HousingFeature.find(params[:id])\n\n respond_to do |format|\n if @housing_feature.update_attributes(params[:housing_feature])\n format.html { redirect_to @housing_feature, notice: 'Housing feature was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @housing_feature.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d6a256108adc6876ddcf3af7fdaeb1ae", "score": "0.55654156", "text": "def update\n respond_to do |format|\n if @single_housing.update(single_housing_params)\n format.html { redirect_to @single_housing, notice: 'Single housing was successfully updated.' }\n format.json { render :show, status: :ok, location: @single_housing }\n else\n format.html { render :edit }\n format.json { render json: @single_housing.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0b4a28f3e8e93bbcc83c7b1fbbb14dbb", "score": "0.55535716", "text": "def update\n @chamado = Chamado.find(params[:id])\n\n respond_to do |format|\n if @chamado.update_attributes(params[:chamado])\n #Cria historico\n Audit.create(:idchamado => @chamado.id, :tipousuario => 1, :mudancas => @chamado.tracked_changes)\n \n format.html { redirect_to @chamado, notice: 'Chamado was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @chamado.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a7b695605e13f9688bac9961aee673bf", "score": "0.55526996", "text": "def update\n respond_to do |format|\n if @haircut.update(haircut_params)\n format.html { redirect_to @haircut, notice: 'Haircut was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @haircut.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "23d8f9eb077f9acde2c62ef4a4b76f5f", "score": "0.55456495", "text": "def update\n @observation = Observation.find(params[:id])\n\n respond_to do |format|\n if @observation.update_attributes(params[:observation])\n format.html { redirect_to @observation, notice: 'Observation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @observation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bb6f30f0552c0fa4b887e77defa92f95", "score": "0.5542743", "text": "def update\n update_resource_response(@headline, headline_params)\n end", "title": "" }, { "docid": "4a64c0b08c1d07f49cd1e032cf58c4ca", "score": "0.55407923", "text": "def update\n @roof = Roof.find(params[:roof_id])\n @status = @roof.statuses.find(params[:id])\n\n respond_to do |format|\n if @status.update_attributes(params[:roof_status])\n format.html { redirect_to @roof, notice: 'Status was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b54b14d16e13d5822d5654805a9ccb40", "score": "0.55376726", "text": "def update\n @bowl = Bowl.find(params[:id])\n \n # set bowl modify time\n @bowl.modified = Time.now\n \n respond_to do |format|\n if @bowl.update_attributes(params[:bowl])\n \n Rails.logger.info \"Updating Bowl Contents\"\n \n # remove all contents for this bowl and add new\n @bowl.contents.delete_all(\"bowl_id=\" + @bowl.id)\n \n params.keys.each do |param|\n if param.start_with?(\"input_\") and (params[param] != \"\") \n @bowl.contents.create(:bowl_id => @bowl.id, :dryfruit_id => param[6, 2], :quantity => params[param]) \n end\n end\n\n format.html { redirect_to bowls_path, :notice => 'Bowl was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @bowl.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5b6d1d52f418929fdab2976558a78250", "score": "0.55254245", "text": "def update\n @territory = current_company.territories.find(params[:id])\n\n # hack to determine new and deleted regions\n adjust_region_ids\n adjust_zipcode_ids\n\n if @territory.update_attributes(params[:territory])\n respond_with(@territory)\n else\n respond_with(@territory, :status => :unprocessable_entity)\n end\n end", "title": "" }, { "docid": "a7269b3e5186ffcc45082dbb7afd92f9", "score": "0.55213773", "text": "def update\n @heat_source = HeatSource.find(params[:id])\n\n respond_to do |format|\n if @heat_source.update_attributes(params[:heat_source])\n format.html { redirect_to @heat_source, notice: 'Heat source was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @heat_source.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d92bc6d4f5711710660e751429233213", "score": "0.55044526", "text": "def update\n respond_to do |format|\n if @male_shot_put_head.update(male_shot_put_head_params)\n format.html { redirect_to @male_shot_put_head, notice: 'Male shot put head was successfully updated.' }\n format.json { render :show, status: :ok, location: @male_shot_put_head }\n else\n format.html { render :edit }\n format.json { render json: @male_shot_put_head.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8a8872856a604cbe6801b4a735eaecdb", "score": "0.549602", "text": "def update\n respond_to do |format|\n if @votaciones_hist.update(votaciones_hist_params)\n format.html { redirect_to @votaciones_hist, notice: 'Votaciones hist was successfully updated.' }\n format.json { render :show, status: :ok, location: @votaciones_hist }\n else\n format.html { render :edit }\n format.json { render json: @votaciones_hist.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3017e0a1f860398fb2828823b3e102d5", "score": "0.54929554", "text": "def update\n respond_to do |format|\n if @housing_rent.update(housing_rent_params)\n format.html { redirect_to @housing_rent, notice: 'Housing rent was successfully updated.' }\n format.json { render :show, status: :ok, location: @housing_rent }\n else\n format.html { render :edit }\n format.json { render json: @housing_rent.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "46307ba5cd3f296135cadd467854b84d", "score": "0.54868275", "text": "def update\n respond_to do |format|\n if @invoice_history.update(invoice_history_params)\n format.html { redirect_to @invoice_history, notice: \"Invoice history was successfully updated.\" }\n format.json { render :show, status: :ok, location: @invoice_history }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @invoice_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b76ed9292b5e39fcf1fb816a35fdff02", "score": "0.5483156", "text": "def update\n respond_to do |format|\n if @borrow_history.update(borrow_history_params)\n format.html { redirect_to @borrow_history, notice: 'Borrow history was successfully updated.' }\n format.json { render :show, status: :ok, location: @borrow_history }\n else\n format.html { render :edit }\n format.json { render json: @borrow_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bad621cfea696eddc8871cf58b32fc46", "score": "0.5482596", "text": "def update\n @shot = Shot.find(params[:id])\n\n if @shot.update(shot_params)\n head :no_content\n else\n render json: @shot.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "6c6c737848d2ef01ce02d4d24d54435f", "score": "0.54816157", "text": "def update\n respond_to do |format|\n if @foodhistory.update(foodhistory_params)\n format.html { redirect_to @foodhistory, notice: 'Foodhistory was successfully updated.' }\n format.json { render :show, status: :ok, location: @foodhistory }\n else\n format.html { render :edit }\n format.json { render json: @foodhistory.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b9ea180739d631ca6b370eefc58c030e", "score": "0.5474255", "text": "def update\n respond_to do |format|\n if @laptop_history.update(laptop_history_params)\n format.html { redirect_to @laptop_history, notice: 'Laptop history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @laptop_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a646cfc3c6e897f23aa2d42c7906de56", "score": "0.54596525", "text": "def update\n respond_to do |format|\n if @tracing.update(tracing_params)\n format.html { redirect_to @tracing }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tracing.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1c8484a8480f3ea22af3d572d7532e9e", "score": "0.54569614", "text": "def update\n id = params[:id]\n @physical_rack = PhysicalRack.any_of({_id: id}, {name: id.gsub('-', '.')}).first\n @physical_rack.attributes = params[:physical_rack]\n @physical_rack.audits << Audit.new(source: 'controller', action: 'update', admin_user: current_user)\n respond_to do |format|\n if @physical_rack.save\n format.html { redirect_to @physical_rack, notice: 'Physical rack was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @physical_rack.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "294a0f53cf538779c65594c309a2cbfb", "score": "0.54527783", "text": "def update\n @experience_history = ExperienceHistory.find(params[:id])\n\n respond_to do |format|\n if @experience_history.update_attributes(params[:experience_history])\n format.html { redirect_to @experience_history, notice: 'Experience history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @experience_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "991dd151e09ec0897554814871bf0350", "score": "0.5451124", "text": "def update\n respond_to do |format|\n if @historic_refinancing.update(historic_refinancing_params)\n format.html { redirect_to @historic_refinancing, notice: 'Historic refinancing was successfully updated.' }\n format.json { render :show, status: :ok, location: @historic_refinancing }\n else\n format.html { render :edit }\n format.json { render json: @historic_refinancing.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "96b603c67648f9bfee0ba1eebfdadaf8", "score": "0.5435981", "text": "def update\n @flat_happening = FlatHappening.find(params[:id])\n\n if @flat_happening.update_attributes(params[:flat_happening])\n head :no_content\n else\n render json: @flat_happening.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "13b898b5ce790a356f742676855b3e05", "score": "0.54319453", "text": "def update\n respond_to do |format|\n if @unique_whiteline.update(unique_whiteline_params)\n format.html { redirect_to @unique_whiteline, notice: 'Unique whiteline was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @unique_whiteline.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a58668820553a17d31e2cc77feeda8ea", "score": "0.5430564", "text": "def update\n @hit = Hit.find(params[:id])\n\n respond_to do |format|\n if @hit.update_attributes(params[:hit])\n format.html { redirect_to @hit, notice: 'Hit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @hit.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab7ea598cdf0afbb5a638720d9aa7802", "score": "0.54273784", "text": "def update\n respond_to do |format|\n if @unified_history.update(unified_history_params)\n format.html do\n flash[:success] = 'Unified history was successfully updated.'\n redirect_to @unified_history\n end\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @unified_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9da108f07573f1842e2332411e87d085", "score": "0.54240763", "text": "def update!(**args)\n @expiration = args[:expiration] unless args[:expiration].nil?\n @history_id = args[:history_id] unless args[:history_id].nil?\n end", "title": "" }, { "docid": "1303422cb9eb2128bbf095cea5dea1f2", "score": "0.5422546", "text": "def update\n @history = History.find(params[:id])\n respond_to do |format|\n\n @history.update(status: 0)\n format.html { redirect_to @history, notice: 'Released successfully!!' }\n\n end\n end", "title": "" }, { "docid": "8ed675c592baaab422b4f6bf912a22d0", "score": "0.54118985", "text": "def update\n respond_to do |format|\n if @lifeline.update(lifeline_params)\n format.html { redirect_to @lifeline, notice: 'Lifeline was successfully updated.' }\n format.json { render :show, status: :ok, location: @lifeline }\n else\n format.html { render :edit }\n format.json { render json: @lifeline.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab5e53eb965cfcd19da58dbf0a2e4021", "score": "0.54081905", "text": "def test_cast_vote_rolf_change\n obs = observations(:coprinus_comatus_obs)\n nam1 = namings(:coprinus_comatus_naming)\n\n login(\"rolf\")\n put(:update, params: { vote: { value: \"2\" }, naming_id: nam1.id })\n assert_equal(10, rolf.reload.contribution)\n\n # Make sure observation was updated right.\n assert_equal(names(:coprinus_comatus).id, obs.reload.name_id)\n\n # Check vote.\n assert_equal(3, nam1.reload.vote_sum)\n assert_equal(2, nam1.votes.length)\n end", "title": "" }, { "docid": "515834e6b9f1a282112dc24ec025705f", "score": "0.54021853", "text": "def update\n @accessory = Accessory.find(params[:id])\n\n if @accessory.update_attributes(params[:accessory])\n head :no_content\n else\n render json: @accessory.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "64f42e3efdc5095f8930fd0873d4a26c", "score": "0.53972596", "text": "def update\n @serving = Serving.find(params[:id])\n\n respond_to do |format|\n if @serving.update_attributes(params[:serving])\n format.html { redirect_to @serving, notice: 'Serving was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @serving.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d7cd83b8448ecbcfc5eb5625c0dabbbd", "score": "0.53890544", "text": "def update\n @patient_history = PatientHistory.find(params[:id])\n\n respond_to do |format|\n if @patient_history.update_attributes(params[:patient_history])\n format.html { redirect_to @patient_history, notice: 'Patient history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @patient_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e02baa003135ed6499c51fdc038722ee", "score": "0.5382879", "text": "def update\n @service_history = ServiceHistory.find(params[:id])\n\n if @service_history.update(service_history_params)\n head :no_content\n else\n render json: @service_history.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "8b7242db696342740424246c9f71fb0e", "score": "0.53805923", "text": "def update(resource,identifier,json)\n raise 'Not Yet Implemented'\n end", "title": "" }, { "docid": "763eeb3f3b148a3ef1da949ee14adc78", "score": "0.5379979", "text": "def update\n respond_to do |format|\n if @medical_history.update(medical_history_params)\n format.html { redirect_to @medical_history, notice: 'Medical history was successfully updated.' }\n format.json { render :show, status: :ok, location: @medical_history }\n else\n format.html { render :edit }\n format.json { render json: @medical_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "763eeb3f3b148a3ef1da949ee14adc78", "score": "0.5379979", "text": "def update\n respond_to do |format|\n if @medical_history.update(medical_history_params)\n format.html { redirect_to @medical_history, notice: 'Medical history was successfully updated.' }\n format.json { render :show, status: :ok, location: @medical_history }\n else\n format.html { render :edit }\n format.json { render json: @medical_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f81ec75e50514c8d3f03ea46bff624fd", "score": "0.537768", "text": "def update\n @lot = Lot.find(params[:id])\n\n respond_to do |format|\n if @lot.update_attributes(params[:lot])\n format.html { redirect_to myadmin_lots_path, :notice => 'Lot was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @lot.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "40998820c683e746f657e901afb5a59c", "score": "0.53764", "text": "def update\n respond_to do |format|\n if @book_history.update(book_history_params)\n format.html { redirect_to @book_history, notice: 'Book history was successfully updated.' }\n format.json { render :show, status: :ok, location: @book_history }\n else\n format.html { render :edit }\n format.json { render json: @book_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4bcf4ad882f5b09a13d8750b20c51b44", "score": "0.5374236", "text": "def update\n respond_to do |format|\n if @area_history.update(area_history_params)\n respond_if_is_true_web(@area_history, 'Area history was successfully updated.', :show, :ok, @area_history)\n else\n respond_if_is_false_web(:edit, :unprocessable_entity, @area_history.errors, :unprocessable_entity)\n \n end\n end\n end", "title": "" }, { "docid": "24cc5cc7943ee197e9f5242a2c4564cc", "score": "0.53740853", "text": "def update\n @harvesting = Harvesting.find(params[:id])\n\n respond_to do |format|\n if @harvesting.update_attributes(params[:harvesting])\n format.html { redirect_to @harvesting, notice: 'Harvesting was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @harvesting.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5b96ea13066cce539de3a3b5737184a1", "score": "0.53703696", "text": "def update\n @clothing_log = current_account.clothing_logs.find(params[:id])\n authorize! :update, @clothing_log\n params[:clothing_log].delete(:user_id)\n @clothing_log.update_attributes(clothing_log_params[:clothing_log])\n respond_with @clothing_log\n end", "title": "" }, { "docid": "5056cabddc4e739929e52ff4f185fe39", "score": "0.5368152", "text": "def historic_params\n params.require(:historic).permit(:description, :text, :disapeared_id, :date, :status_id)\n end", "title": "" }, { "docid": "86a952bf7d19d69fe058fcd08d4c8ee2", "score": "0.5367542", "text": "def update\n respond_to do |format|\n if @article_history.update(article_history_params)\n format.html { redirect_to @article_history, notice: 'Article history was successfully updated.' }\n format.json { render :show, status: :ok, location: @article_history }\n else\n format.html { render :edit }\n format.json { render json: @article_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "752b83a086c8815b0b4c35ede85d1789", "score": "0.53641444", "text": "def update\n respond_to do |format|\n if @hood.update(hood_params)\n format.html { redirect_to @hood, notice: 'Hood was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @hood.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c3efd50cc2bd38cf652445aad928a6da", "score": "0.53609955", "text": "def set_historic\n @historic = historic.find(params[:id])\n @map= map.find(params[:id])\n end", "title": "" }, { "docid": "99ea42748177526b9bff3403e2a22080", "score": "0.5358575", "text": "def update\n respond_to do |format|\n if @hair.update(hair_params)\n format.html { redirect_to @hair, notice: 'Hair was successfully updated.' }\n format.json { render :show, status: :ok, location: @hair }\n else\n format.html { render :edit }\n format.json { render json: @hair.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1167cd27cd1fb43f4943b64e7be17837", "score": "0.5357766", "text": "def update\n ingredient.update(ingredient_params)\n render json: ingredient\n end", "title": "" }, { "docid": "a2a4578592cb81f64cd81ddcc6357ec5", "score": "0.53576756", "text": "def update\n @shot = Shot.find(params[:id])\n @shot.update_attributes(shot_params)\n respond_with @shot\n end", "title": "" }, { "docid": "f9f92ec8451bf88efca2fa39b3c00f10", "score": "0.53521657", "text": "def update\n @shot = Shot.find(params[:id])\n\n respond_to do |format|\n if @shot.update_attributes(params[:shot])\n format.html { redirect_to @shot, notice: 'Shot was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @shot.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "678fc6a3d129ae6a2eb43bf618edf10a", "score": "0.5350558", "text": "def update\n respond_to do |format|\n if @houmon.update(houmon_params)\n format.html { redirect_to @houmon, notice: 'Houmon was successfully updated.' }\n format.json { render :show, status: :ok, location: @houmon }\n else\n format.html { render :edit }\n format.json { render json: @houmon.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "232d69542fbd53ceb0932a5e34165320", "score": "0.53489906", "text": "def update\n if current_user.is_not_staff?\n flash[:error] = \"You do not have permissions to access that feature.\"\n redirect_to root_path and return\n end\n \n @location_history = LocationHistory.find(params[:id])\n\n respond_to do |format|\n if @location_history.update_attributes(params[:location_history])\n format.html { redirect_to @location_history, notice: 'Location history was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @location_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b9428ca1199b57ed705cda18cfa4fe17", "score": "0.53465647", "text": "def update\n respond_to do |format|\n if @top_standing_entry.update(top_standing_entry_params)\n format.html { redirect_to @top_standing_entry, notice: 'Top standing entry was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @top_standing_entry.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
a58d361afb5ed130943a304a16cb06ea
Evict the cache entry for key
[ { "docid": "880bb562e385bf682c4e76d2ef40c35c", "score": "0.8241675", "text": "def evict(key)\n @data_expires_at.delete(key)\n cache_value = @data.delete(key)\n @current_size_bytes -= size_of(key, cache_value)\n end", "title": "" } ]
[ { "docid": "052aa53d7254791a358b017c36b321cc", "score": "0.7879288", "text": "def remove(key)\n cache.delete(key)\n end", "title": "" }, { "docid": "cc9816a369f3c960ff1e4cbb2ade2fef", "score": "0.7519028", "text": "def delete_from_cache(key)\n cache_class.delete(key)\n end", "title": "" }, { "docid": "a7fa1562413541ce8a8e77b4852633fa", "score": "0.74983937", "text": "def delete(key)\n @cache.delete(key)\n end", "title": "" }, { "docid": "66130fc96a2f4df88e287ccb97854a50", "score": "0.7459875", "text": "def evict!\n MetalArchives.cache.delete(cache_key)\n end", "title": "" }, { "docid": "c1cbebec99df4ba21deff81fe3131652", "score": "0.7436315", "text": "def evict\n RRRSpec.redis.srem(RRRSpec.make_key('rrrspec', 'worker'), key)\n end", "title": "" }, { "docid": "8c67b6877f590151ba2961de05797838", "score": "0.7401028", "text": "def remove(key)\n decode(cache.remove(encode(key)))\n end", "title": "" }, { "docid": "2f430be9be82b565e75150acbef95f66", "score": "0.7379033", "text": "def forget(key)\n lock_memory do\n @memories[key] = nil\n store_memories\n end # \n nil\n end", "title": "" }, { "docid": "b8d3a627c5c116e323ed837f441e2ff8", "score": "0.7302178", "text": "def cache_clear(key)\n delete_cached_object(key)\n end", "title": "" }, { "docid": "469bec26006a0e3fcd062b749d1b51e2", "score": "0.726946", "text": "def remove_entry(key)\n @hash_storage.delete(key)\n end", "title": "" }, { "docid": "ec3e3dce20fc055b43e69d75c35f2ea4", "score": "0.71895653", "text": "def delete key\n File.delete( cache_file(key) ) if File.exists?( cache_file(key) )\n end", "title": "" }, { "docid": "dac732450a090261af2a8ae6ca2d44f1", "score": "0.71765393", "text": "def delete(key)\n\t\t\t\tdo_finalization(key,@cache[key])\n\t\t\t\[email protected] key\n\t\t\t\t@ttl_cache.delete key\n\t\t\tend", "title": "" }, { "docid": "c45547345d5289c2c9d847ed649b2bfa", "score": "0.7168832", "text": "def purge(key)\n @hash.delete(key)\n nil\n end", "title": "" }, { "docid": "9408bd362df3b09651f388d7b91b7222", "score": "0.7142228", "text": "def delete( k )\n cache.delete( k.hash )\n end", "title": "" }, { "docid": "9954ad883198965e35e2005b8600ac36", "score": "0.7103805", "text": "def delete(key)\n @cache.delete(key)\n File.delete(path_to(hash(key))) if disk_cache_enabled?\n end", "title": "" }, { "docid": "e79545b24fe7de9135c9bef346025ca3", "score": "0.7098496", "text": "def purge(key)\n @hash.delete(key)\n nil\n end", "title": "" }, { "docid": "e85650be195409ac56436f5cd2084754", "score": "0.7080463", "text": "def delete(key)\n @monitor.synchronize do\n entry = @stash.delete(key)\n if entry\n @expires_at.delete(entry)\n entry.value\n else\n nil\n end\n end\n end", "title": "" }, { "docid": "dc39574cfa2b0ec5115df4aff33e5ac2", "score": "0.7038601", "text": "def remove(key)\n @semaphore.synchronize do\n return [email protected](key)\n end\n end", "title": "" }, { "docid": "611ef221cffd3306492d8a7bdc9a6bf7", "score": "0.7035322", "text": "def remove(*key)\n @cache.delete(key)\n end", "title": "" }, { "docid": "4753074d58ad29dec6bb3d9a68200953", "score": "0.69932425", "text": "def erase(key)\n if !contains?(key)\n return\n end\n\n erase_internal(key)\n end", "title": "" }, { "docid": "b0a86e3c8b4035b31c296ad6d48ba450", "score": "0.69761634", "text": "def forget(key)\n key = key.to_s\n __remove(key)\n end", "title": "" }, { "docid": "d1cfe267e661bbde376a63a0c5a11e0a", "score": "0.69029427", "text": "def invalidate( key )\n\t\tself.log.debug \"invalidating cache key '%p' for %s\" % [key, self.name]\n\t\tsuper\n\tend", "title": "" }, { "docid": "c3817d5d5e91da07d3ef775a6aaa14d3", "score": "0.68877095", "text": "def invalidate(key)\n invalidate_key(key)\n @write_mutex.synchronize { @data.delete(key) }\n end", "title": "" }, { "docid": "998d5570f910287220c50d69d521bd18", "score": "0.6885357", "text": "def remove(key)\n @mutex.lock\n @proxy.remove(key)\n rescue NativeException => e\n raise EhcacheError, e.cause\n ensure\n @mutex.unlock\n end", "title": "" }, { "docid": "ad7da3031d7bf2ea60495a05ea9d2023", "score": "0.687653", "text": "def evict_ramcache_entry\n super\n end", "title": "" }, { "docid": "296f04ad53c69cc1601388df3d8bbc5d", "score": "0.6851317", "text": "def delete_cached(key)\n key = cache_store_key(key)\n\n @store.transaction do |s|\n s.delete(key)\n end\n end", "title": "" }, { "docid": "4f4c2406d76aa7e942f23db68b64dc55", "score": "0.6838489", "text": "def delete(key)\n begin\n value = self[key]\n\n @memcached.delete key\n\n return value\n rescue Dalli::DalliError => e\n Wrest.logger.error \"Error deleting #{key} from cache: #{e.inspect}\"\n return nil\n end\n end", "title": "" }, { "docid": "c475bc656c0e310a041f678f5914480f", "score": "0.68359035", "text": "def flush(key)\n Rails.cache.delete key\n end", "title": "" }, { "docid": "de6f28d711d92ddebcf733073fe74a7d", "score": "0.6823748", "text": "def invalidate_key(key)\n @meta_mutex.synchronize { @keys.delete(key) }\n end", "title": "" }, { "docid": "141770cde2db6f56a7726fe0844a639f", "score": "0.68132854", "text": "def evict\n node=tail.pnode\n @eviction_bytes+=node.value.memory_size\n @eviction_count+=1\n delete tail.pnode.key\n end", "title": "" }, { "docid": "c0cfcff8d3cb40fa06471b9ace2a8bd1", "score": "0.67907125", "text": "def cache_expire(key:)\n begin\n CACHE.delete(key)\n rescue Redis::CannotConnectError || Redis::ConnectionError || Redis::TimeoutError\n exit\n end\n end", "title": "" }, { "docid": "458214dab59913f1d6b13b855f65edd9", "score": "0.67861897", "text": "def delete(key)\n @provider.delete(key) # Delete key from cache provider\n end", "title": "" }, { "docid": "4649dbc73aebd18ebd4b5702368c9dc0", "score": "0.67378294", "text": "def cache_del\n db.log_info(\"CACHE DEL: #{cache_key}\")\n cache_driver.del(cache_key)\n end", "title": "" }, { "docid": "a5376aede92e2406eaaf4adc06363512", "score": "0.6735352", "text": "def remove_key key\n key_cache.remove(conditional_output_key_column, key)\n end", "title": "" }, { "docid": "88164881611f13e23b8f9c90fbc6a016", "score": "0.6723746", "text": "def evict_expired\n # Since data_expires_at keys are ordered by the age of the cache entry, we can bail out of the\n # loop as soon as we find the first unexpired key.\n @data_expires_at.each do |key, expiration|\n (expiration < Time.now.to_f) ? evict(key) : return\n end\n end", "title": "" }, { "docid": "212e595467df81a35a11c0f768ec72ee", "score": "0.66953266", "text": "def unblock_key(key)\n return false unless @keys.key? key\n @mutex.synchronize do\n @keys[key][:timestamp] = nil\n @free_keys[key] = true\n end\n end", "title": "" }, { "docid": "665fd594067295075c9affc18f02e7df", "score": "0.6694387", "text": "def remove_value(key)\n @entries.delete(key)\n end", "title": "" }, { "docid": "32410fdfb0bd613185e5adcc2c61daf8", "score": "0.6688957", "text": "def prune! # self\n now = Time.now.getutc\n\n @cache.each_pair do |key, entry|\n if entry_expired?(entry, now: now)\n LOG.debug do\n \"Pruning entry for key #{key} from cache (expired as of #{entry_expiration_time(entry, now: now)}) and marking cache as dirty\"\n end\n\n # Only mark the cache as dirty if something is actually pruned from it.\n @is_dirty = true\n @cache.delete(key)\n end\n end\n\n self\n end", "title": "" }, { "docid": "f5af2278637dbd2e5148ea59e75ac0d0", "score": "0.66838807", "text": "def remove_value(key)\n @entries.delete(key)\n end", "title": "" }, { "docid": "59ec0734902814d58deeeed980870f56", "score": "0.6682578", "text": "def remove(key)\n @hash.delete(key)\n end", "title": "" }, { "docid": "59ec0734902814d58deeeed980870f56", "score": "0.6682578", "text": "def remove(key)\n @hash.delete(key)\n end", "title": "" }, { "docid": "18522cc19d9879e8f9f2a8de8d105e37", "score": "0.6662396", "text": "def delete(keyname)\n keyname = keyname.to_s\n @@cache.delete(namespace_keyname(keyname), nil)\n end", "title": "" }, { "docid": "2e6ab9b94dcf0af408cff118e0298026", "score": "0.66550475", "text": "def purge(key); end", "title": "" }, { "docid": "6caad844e3e47779c57b227f387c3a41", "score": "0.66397977", "text": "def remove(key)\n @h.delete(key)\n nil\n end", "title": "" }, { "docid": "76c1829e90627673076dec31621476c4", "score": "0.6633708", "text": "def invalidate(candidate_key)\n pkey = primary_key(candidate_key)\n cache_key = encode_key(context_free_key(pkey))\n store.delete(cache_key)\n end", "title": "" }, { "docid": "f5367dba617a0ffed22cb045f76e0521", "score": "0.6619555", "text": "def erase(key)\n end", "title": "" }, { "docid": "e6dbf3bde5bb74feddf8703633a7093c", "score": "0.6595843", "text": "def remove(bucket, key)\n File.unlink cache_path(bucket, key)\n rescue Errno::ENOENT\n end", "title": "" }, { "docid": "f82e3925ad45438c342c4c9e2c44386a", "score": "0.6592018", "text": "def remove(key); end", "title": "" }, { "docid": "f82e3925ad45438c342c4c9e2c44386a", "score": "0.6592018", "text": "def remove(key); end", "title": "" }, { "docid": "4c4d28a9f439c52c0aee79f53e942974", "score": "0.65623355", "text": "def delete(key)\n if exists? (key)\n remove_entry(key)\n CacheResult.new(true,\"#{MY_MESSAGES[:success]} Key #{key} deleted\", nil)\n else\n CacheResult.new(false,\"#{MESSAGES[:not_found]} Key #{key} not found\", nil)\n end\n end", "title": "" }, { "docid": "6b05d965a20430e86c2597c859e95650", "score": "0.65613383", "text": "def clear_key(key)\n @redis.del(key)\n end", "title": "" }, { "docid": "c95a6e9aab311ba962810f5e07d0380e", "score": "0.65525734", "text": "def evict(uri)\n file_cache(uri).destroy\n end", "title": "" }, { "docid": "64bbd2034a6a4190a45b469ea8368975", "score": "0.65477914", "text": "def evict(uri)\n CachedFile.new(@mutable_cache_root, uri, true).destroy\n end", "title": "" }, { "docid": "4784560d4c5d46fa6e5a1420da0ce2d5", "score": "0.65477264", "text": "def del(key)\n @hash.delete(key)\n end", "title": "" }, { "docid": "7dd6903ffcc1fdfbcd4aecb311f06936", "score": "0.6542634", "text": "def remove(key)\n if @container[key]\n @container[key] = nil\n end\n end", "title": "" }, { "docid": "8183f7643798dfd505ba354925a47d58", "score": "0.65350324", "text": "def cache_delete\n model.send(:cache_delete, cache_key)\n end", "title": "" }, { "docid": "ceaae4c4c9fa3802433f143d5b4353b1", "score": "0.6534086", "text": "def delete(keyname)\n keyname = keyname.to_s\n Rails.cache.delete(namespace_keyname(keyname))\n end", "title": "" }, { "docid": "3ddad6e69af71aab793b1c10a48af6c5", "score": "0.65335363", "text": "def remove(key)\n if @sync\n @mutex.synchronize do\n @hash.delete(key) { yield if block_given? }\n end\n else\n @hash.delete(key) { yield if block_given? }\n end\n end", "title": "" }, { "docid": "8b3cd9969896044be3a7b139af85479f", "score": "0.65277565", "text": "def purge_key(key)\n synchronize do\n puts \"PURGE KEY: #{key}\"\n @storage.delete(key)\n end\n end", "title": "" }, { "docid": "dc50b3565f53af8db743288d2fd33936", "score": "0.6525048", "text": "def delete_cache\n Rails.cache.delete(Service.get_key_cache_key)\n end", "title": "" }, { "docid": "523d727ce11241eff4ace40effe4f855", "score": "0.6515213", "text": "def delete key\n self.hash.delete key\n end", "title": "" }, { "docid": "dfc46688c7e92385ff6b122d02165367", "score": "0.64878166", "text": "def delete_entry(key, options) # :nodoc:\n cache.remove( key ) && true\n end", "title": "" }, { "docid": "73de11af993f263ec34e684fdc43626c", "score": "0.6471561", "text": "def delete(key, expires = 0)\n raise MemCacheError, \"Update of readonly cache\" if @readonly\n @client.delete(make_cache_key(key))\n end", "title": "" }, { "docid": "2c5de3f651e373808629f278a0f5a9f6", "score": "0.64641535", "text": "def delete(_key) end", "title": "" }, { "docid": "a77b49b0cf56368d5625cafb0ee3052e", "score": "0.64587957", "text": "def del(key)\n redis.del(key)\n end", "title": "" }, { "docid": "03a22c95ac078c69ee195be404fba180", "score": "0.64515716", "text": "def clear_cache\n Heimdallr.cache.delete(cache_key)\n end", "title": "" }, { "docid": "7ae1923b9c8acba2b58199dcf750b515", "score": "0.64507926", "text": "def delete(key)\n @cache.del @prefix + key\n end", "title": "" }, { "docid": "bebf37fb369283f80cae09697792366e", "score": "0.6433519", "text": "def cache_invalidate\n LinkedData::HTTPCache.redis.hdel cache_prefix_and_segment, cache_key\n cache_segment_invalidate\n self.class.cache_collection_invalidate\n end", "title": "" }, { "docid": "95999a1ce934afdfec194088cfe94bd5", "score": "0.6430054", "text": "def delete(key)\n entry = @data.delete(key)\n if entry\n @expires_at.delete(entry)\n entry.value\n else\n nil\n end\n end", "title": "" }, { "docid": "01f72964d825fadd0a844a86cd828cef", "score": "0.6422466", "text": "def remove_key\n File.unlink key_path\n end", "title": "" }, { "docid": "dba742c401a4942a25d5585c137e7743", "score": "0.64087844", "text": "def remove(key)\n @count -= 1\n bucket = @set[key.hash % @size]\n bucket.delete(key)\n end", "title": "" }, { "docid": "4c9dc0be66f295c203941ab09adf0700", "score": "0.6404484", "text": "def delete(cache_key)\n path = diskpath(cache_key)\n FileUtils.rm(path) if File.exist?(path)\n end", "title": "" }, { "docid": "a582b5de317c6af17a4def5d96d29f1b", "score": "0.6396374", "text": "def decr(key); end", "title": "" }, { "docid": "a582b5de317c6af17a4def5d96d29f1b", "score": "0.6396374", "text": "def decr(key); end", "title": "" }, { "docid": "272ed0bdc4c38bd470cb02e3afb908d2", "score": "0.63838875", "text": "def delete(key)\n @redis.hdel(@path, key)\n return nil\n end", "title": "" }, { "docid": "9afbefd8a400e0742b200eef31bf7397", "score": "0.6381955", "text": "def get(key)\n @hash.delete(key)\n end", "title": "" }, { "docid": "239d813f57ed05343fcd3933849f7a62", "score": "0.63738036", "text": "def destroy\n keys = rcache.keys(\"%s/*\" % key_prefix)\n unless keys.nil? || keys.empty?\n rcache.del(*keys)\n end\n end", "title": "" }, { "docid": "a8235aaa875203f66b399aaa889fa1a6", "score": "0.63686574", "text": "def clear\n @redis.del(@key)\n end", "title": "" }, { "docid": "a6768ecb486edb1ed435ae0b0ebc1beb", "score": "0.63651216", "text": "def delete(key)\n entries.delete(key)\n end", "title": "" }, { "docid": "b58f2d48b6c1cc0927fcfe0ddc56e3c0", "score": "0.6359345", "text": "def remove(key)\n @java_critbit.remove(key)\n end", "title": "" }, { "docid": "40e50a44f2489351892564c432b0aaff", "score": "0.63580406", "text": "def unset(key)\n data.delete(key)\n end", "title": "" }, { "docid": "663e16367dc822bc0de2a8973f2be7a3", "score": "0.6353936", "text": "def remove(key)\n# @store[index(key)].select { |entry| entry.key == key }\n entry = get(key)\n @store.delete(entry) unless entry == -1\n end", "title": "" }, { "docid": "7a11bbb6abcb984a39fd1ad71c0370c9", "score": "0.63536704", "text": "def delete!(key)\n value = delete(key)\n flush\n value\n end", "title": "" }, { "docid": "db07720407de22719ebb91db70a2a7b9", "score": "0.63454753", "text": "def delete(key)\n @hash.delete(key)\n end", "title": "" }, { "docid": "db07720407de22719ebb91db70a2a7b9", "score": "0.63454753", "text": "def delete(key)\n @hash.delete(key)\n end", "title": "" }, { "docid": "173e720a05c4e1c880a975234074aae4", "score": "0.6342217", "text": "def delete(key)\n redis.del _key(key)\n end", "title": "" }, { "docid": "173e720a05c4e1c880a975234074aae4", "score": "0.6342217", "text": "def delete(key)\n redis.del _key(key)\n end", "title": "" }, { "docid": "be6a52e0f818c1d3be6416acb7f36388", "score": "0.63411546", "text": "def remove_from_cache(el)\n @cache.delete(el) if @cache.include?(el)\n end", "title": "" }, { "docid": "1cc9c9d73ef3dd19b078879aa825daf6", "score": "0.63352853", "text": "def delete(key)\n @redis.del(key)\n end", "title": "" }, { "docid": "a6c8a03d33fe121d9593890f636d03ef", "score": "0.6312628", "text": "def remove(key)\r\n if @hash.include?(key)\r\n @hash.delete(key)\r\n end\r\n end", "title": "" }, { "docid": "86c1205571e8432371fb0186d255617e", "score": "0.6306525", "text": "def delete!(key)\n value = delete(key)\n flush\n value\n end", "title": "" }, { "docid": "7e7b6d4bd33d97bb3fda2614d42b8e25", "score": "0.63062173", "text": "def invalidate_cache(host)\r\n @cache.delete(host)\r\n end", "title": "" }, { "docid": "be071f63abc1e1ec5e10a1a1f2cd589e", "score": "0.6302115", "text": "def remove_key(key)\n @access_keys.delete(key)\n end", "title": "" }, { "docid": "1a02a4318504c717bd216be9169ee918", "score": "0.630062", "text": "def remove_from_cache(qkey)\n if qkey.nil?\n return\n end\n \n #Remove from cache \n @@q_keys.delete(qkey)\n \n #remove json file too\n json_fname = \"#{Rails.root}/public/tmpjson/#{qkey}.json\"\n begin\n File.delete(json_fname)\n rescue\n end\n end", "title": "" }, { "docid": "e4b202488689d01a6bfe94271b998cdb", "score": "0.6298657", "text": "def remove_from_cache(id)\n\t\tind = -1\n\t\t([email protected]). each{ |i| ind = i if @cache[i].id == id }\n\t\t@cache[ind] = nil\n\tend", "title": "" }, { "docid": "01a892abe9f42d872ad99446e462123f", "score": "0.6298059", "text": "def delete(key)\n\t\t\tlock_cache do\n\t\t\t\tif !@bypass_transactions and transaction_cache_include?(key)\n\t\t\t\t\ttcg = transaction_cache_get(key)\n\t\t\t\t\tunless tcg.is_a?(DeletedValue)\n\t\t\t\t\t\t@transaction_cache.last[key] = DeletedValue.new(tcg)\n\t\t\t\t\tend\n\t\t\t\telsif FileTest.exist?(datafile_for_key(key))\n\t\t\t\t\tif @transaction_lock[0] and @transaction_cache.length > 0\n\t\t\t\t\t\t@transaction_cache.last[key] = DeletedValue.new(self[key])\n\t\t\t\t\telse\n\t\t\t\t\t\tFile::unlink(datafile_for_key(key))\n\t\t\t\n\t\t\t\t\t\t#new_count = getdata(@cache_count,false) - 1\n\t\t\t\t\t\t#putdata(new_count,@cache_count)\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "d134bf2c08e8ff744ca6b191e5e93934", "score": "0.62919855", "text": "def delete(key)\n n = @lookup.delete(key)\n v = n ? node_purge(n) : nil\n v\n end", "title": "" }, { "docid": "81fdd186cd9d333c979b6db32ba7a4cd", "score": "0.6291022", "text": "def evict_all_ramcache_entries\n super\n end", "title": "" }, { "docid": "48c1fd458fea4656b145c0854b13a983", "score": "0.6286145", "text": "def delete(key, expiry = 0)\r\n raise MemCacheError, \"Update of readonly cache\" if @readonly\r\n with_server(key) do |server, cache_key|\r\n with_socket_management(server) do |socket|\r\n socket.write \"delete #{cache_key} #{expiry}\\r\\n\"\r\n result = socket.gets\r\n raise_on_error_response! result\r\n result\r\n end\r\n end\r\n end", "title": "" }, { "docid": "193e52d497a33e1bae0a7476ea32746c", "score": "0.628502", "text": "def clear\n @redis.del(@key)\n end", "title": "" }, { "docid": "6748c8be6e269f1e36399c02908aabfc", "score": "0.6280242", "text": "def discard(key = nil)\n set_dirty(key)\n end", "title": "" } ]
066675d4dedb4f6f6bebce652b9d552f
Execute the Choreo using the specified InputSet as parameters, wait for the Choreo to complete and return a ResultSet containing the execution results.
[ { "docid": "55d874dcd885a2dd3df61c83675d1233", "score": "0.0", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = LoginResultSet.new(resp)\n return results\n end", "title": "" } ]
[ { "docid": "ea872306361fc864408e8279b0199bbe", "score": "0.75943273", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "bf6609d69b18cbe3a5f620c672c2cbbf", "score": "0.7562547", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "bf6609d69b18cbe3a5f620c672c2cbbf", "score": "0.75611603", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = QueryResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "0aafc24aa7bfd676f6f07627c9f76bc6", "score": "0.7473949", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = SetDescriptionResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "a1344c3896c39c00dc3d90b8d8a5a83b", "score": "0.72562593", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ParseResponseResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "63ba8945aeb5bf9ebd7b95276105a753", "score": "0.72404796", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = FindResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "c098b36637f21771b9a908399c4b5304", "score": "0.7238139", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ResidenceResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "9de8750a58a9526fbdee57ac41e90203", "score": "0.7191751", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ParseResponseResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "fb95fc8487bca52a46c68ffd52d8e48d", "score": "0.7141682", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetEtymologyResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "4183b17f9f6707b4e269ea07803007a1", "score": "0.7139071", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ContractsResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "8a356cb581c7765ae3e66fb2f3368ea8", "score": "0.7119928", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveEntryResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "8a356cb581c7765ae3e66fb2f3368ea8", "score": "0.7119928", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveEntryResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "8a356cb581c7765ae3e66fb2f3368ea8", "score": "0.7119928", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveEntryResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "8a356cb581c7765ae3e66fb2f3368ea8", "score": "0.7119928", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveEntryResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "8a356cb581c7765ae3e66fb2f3368ea8", "score": "0.7119928", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveEntryResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "639639f17f588593bbcf03fdc35fecf6", "score": "0.7115346", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetDatabaseResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "f0db36b53d36a7f729d6ef503cd1e26d", "score": "0.71064734", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GenomesResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "97d69a1243e550711ff62f86bdadd438", "score": "0.7098656", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = FinancialAidResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "7c8530d9126329b99fce59f75361a16a", "score": "0.70975655", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ExecutePaymentResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "19f97824a1cc014b08673ca9a909e4de", "score": "0.70712465", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = SetLocationResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "0f9bf967849751416c965e8a1dbf0e99", "score": "0.7069423", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveRecordsResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "7414e27ed90b51c60c7884fd3b9b6764", "score": "0.70635855", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetRecordsResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "df86f0f487e0ac505181e3852add84c2", "score": "0.7055068", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ShowResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "f59d05bfeab248eb2779e89f130f5ede", "score": "0.7050506", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ListSetsResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "97b063b4c20e342a90ad50ef32db85a2", "score": "0.70483005", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = MathAndScienceResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "5c4622d196e17563085f3203a4b8d585", "score": "0.7047437", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = MentionsResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "9f9d9ae5fd274ed7076d8884f27992cc", "score": "0.70424503", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = BulkUpdateResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "4fe16cb06a9eb592e64974fe3311c547", "score": "0.7039569", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UserResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "f4cff698b052b3fe5c2343fc71c2c32b", "score": "0.7033651", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveActivityResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "f4cff698b052b3fe5c2343fc71c2c32b", "score": "0.7033651", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveActivityResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "f4cff698b052b3fe5c2343fc71c2c32b", "score": "0.7033651", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveActivityResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "712f4b46e3bd997ee63c7b449378fa5d", "score": "0.69997764", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = AutomobileResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "8991e752c84e8b3242230ec421fa51cf", "score": "0.6995685", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GBDResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "968a214e05f10a677a0749155e2fba76", "score": "0.69810355", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = NextUploadServerResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "20cc4185727d6b92df1aee31a806aeda", "score": "0.6977781", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateActivityResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "20cc4185727d6b92df1aee31a806aeda", "score": "0.6977781", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateActivityResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "20cc4185727d6b92df1aee31a806aeda", "score": "0.6977781", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateActivityResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "34f73ee5415fb9d9865d16f1ee5ec5eb", "score": "0.6973938", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RecoveryResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "dcb51f3d97a944de7c707b0eff551f64", "score": "0.6973146", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = AncestryResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "22a9c78a9437dad2c736a497549da74c", "score": "0.69638824", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateEntryResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "22a9c78a9437dad2c736a497549da74c", "score": "0.69638824", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateEntryResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "22a9c78a9437dad2c736a497549da74c", "score": "0.69638824", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateEntryResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "22a9c78a9437dad2c736a497549da74c", "score": "0.69638824", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateEntryResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "22a9c78a9437dad2c736a497549da74c", "score": "0.69638824", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateEntryResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "fe6ec24248bf5c004d7aaec8d6c5d7a5", "score": "0.6962345", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = UpdateCollectionResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "0c2ae0cf1e20a7563315e21eb72cec1b", "score": "0.6961258", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetCollectionResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "71275022b85ea99d40b9d16e7ef573df", "score": "0.69603235", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = DietResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "5d828e36cab8bd524adaa6ebd3f1d76b", "score": "0.6956967", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetRecordsByIdResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "1106164b71a7305bf185887dbdbf0bc1", "score": "0.6930092", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ClosestResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "5fb8aa8b7300e210da1f460dfd42a797", "score": "0.692526", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = AvailableResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "1b93e592b88a10fb06bed840f955e7e7", "score": "0.69240576", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetMyRecordsResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "6fe38d7372e8d21c1a0657409ab776ab", "score": "0.69117355", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = MassPaymentsResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "93850d3500ac8f4c7c96beb97d38c069", "score": "0.69095016", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveActivitiesResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "93850d3500ac8f4c7c96beb97d38c069", "score": "0.69095016", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveActivitiesResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "b476bea8ec71ad2e5a20c3f0189ebeaf", "score": "0.6905331", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = AssistanceResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "a5bd86ed41ea9d0bdbcaa84544ed2965", "score": "0.6901844", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = MusicAndTheArtsResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "c00916d1a131098ad83ef5bd4c52e90d", "score": "0.6901066", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = DownloadSpreadsheetResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "edf5ce31a77bb52e82407c2f84914176", "score": "0.6900007", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveUserResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "c5ffc65619103cf5ea1b33342e8aa903", "score": "0.6895354", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetByCoordinatesResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "cff83deaf0132c3ca2c47aec72135798", "score": "0.6894406", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ElectricityUseResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "68c8984299624dc154e0bf17a6bc3b0b", "score": "0.68852526", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = FlightResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "9336f920fdd19087043f65741e1c4210", "score": "0.6883391", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = CloseThreadResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "ebed0170586c3023aa87019193fec032", "score": "0.68820107", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = SharePrivateResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "1379ce5cb764a610202315b080d3a70e", "score": "0.6880793", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RecordActivityResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "1379ce5cb764a610202315b080d3a70e", "score": "0.6880793", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RecordActivityResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "1379ce5cb764a610202315b080d3a70e", "score": "0.6880793", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RecordActivityResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "94d45876c55c3a3c48f7938d15154ed4", "score": "0.6880044", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveEntriesResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "94d45876c55c3a3c48f7938d15154ed4", "score": "0.6880044", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveEntriesResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "94d45876c55c3a3c48f7938d15154ed4", "score": "0.6880044", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveEntriesResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "94d45876c55c3a3c48f7938d15154ed4", "score": "0.6880044", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveEntriesResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "94d45876c55c3a3c48f7938d15154ed4", "score": "0.6880044", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveEntriesResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "b599e29e834fdb3872543a8fb2d9fd41", "score": "0.6874741", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RailTripResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "761dc9bed4a3fcb5d633cd2412d9327b", "score": "0.6873288", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = MassPaymentsResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "52ca5fa1c0411c41e5d3f0eda87d5a08", "score": "0.686894", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GenotypeResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "6de60246333f87f8886a533a322fb58a", "score": "0.68651956", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = HistoryAndCivicsResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "7326b0589949970f64369c6ceca85ab3", "score": "0.68606234", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = FindByCoordinatesResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "7326b0589949970f64369c6ceca85ab3", "score": "0.68606234", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = FindByCoordinatesResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "370f0a079a5c53196d7c7f497ec2b4db", "score": "0.6858249", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetExamplesResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "33b11d6238d9cb8de05e46ad973b05d4", "score": "0.68500304", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetCommitteeResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "0bc1247264c645a35bd0bf9b781a9467", "score": "0.68419594", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveActivitesResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "402e95aa6e5ad17e4dad97533f8eaa1c", "score": "0.68312865", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = FindByURLResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "8a8bee40f047c795960f40f0e423be25", "score": "0.6822841", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetUserResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "9f801f3f9009a0929fedeeca96d80b11", "score": "0.6819698", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ProcessDirectPaymentResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "cd290484bda172f6278420373eba80d2", "score": "0.6814314", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = InsertResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "10f24a07a5ab663e0e45e3ad85daf51d", "score": "0.68077344", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = LookupMajorsResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "ae4e299f93919051b7421562be54e239", "score": "0.68033606", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetDataStreamResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "42c5dd9d8c34f481fe8aa66e8fcb79c0", "score": "0.67987967", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetContextResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "99dcf48841b1a3efa4119e8a9842c197", "score": "0.6787911", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = NamesResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "126cf4245dc8c9cd65871154b0d273b0", "score": "0.67768645", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = AdSearchResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "d903e170560cc186d5228489834aa0be", "score": "0.6765367", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = CreateDatabaseResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "44e21435da3e95fd543d177ddcebd052", "score": "0.67636764", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = MatchIDsResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "44e21435da3e95fd543d177ddcebd052", "score": "0.67636764", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = MatchIDsResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "fa74bc7c14a3ab4cfb5223bc9223f9d0", "score": "0.67594254", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = SearchResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "fa74bc7c14a3ab4cfb5223bc9223f9d0", "score": "0.6758443", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = SearchResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "3a7e84c1f233a47764515d8a300293d3", "score": "0.6752681", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = LookupResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "ea3394565e37eae1b751830ddfd2b79a", "score": "0.67408115", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = PetResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "c08b0e2325ecef72d2d60d6aab2d09da", "score": "0.6739167", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = QueryArticlesResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "3257b037b385f4f87a72bc39fceb30dc", "score": "0.6736194", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = RetrieveFriendsResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "28976b81fe81569d8bb666a36053d1bc", "score": "0.673062", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetSearchRecordsResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "66bd0cf8ef965f052f9e0e41f86cdf07", "score": "0.6729301", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetDocumentResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "114712a30c9c80181d95c7618454d28c", "score": "0.6725592", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = GetPriceResultSet.new(resp)\n return results\n end", "title": "" } ]
9d84fbfa44d367ab93975b0c6275014f
Return the position of this cursor.
[ { "docid": "e3a66b03e2ed0d8769376ed83c21cad0", "score": "0.66143084", "text": "def position\n @position = Vedeu::Geometry::Position[y, x]\n end", "title": "" } ]
[ { "docid": "ce15cefcdfc10bda2a6bc3cad27d4a19", "score": "0.84886086", "text": "def position\n @cursor[0]\n end", "title": "" }, { "docid": "3447747acb280f092f43bdbd91c90c84", "score": "0.8333751", "text": "def get_cursor_pos\n @cursor_pos.dup\n end", "title": "" }, { "docid": "7d118a110817adae4bc45344b9ae5f58", "score": "0.7931806", "text": "def position\n return @position\n end", "title": "" }, { "docid": "7d118a110817adae4bc45344b9ae5f58", "score": "0.7931806", "text": "def position\n return @position\n end", "title": "" }, { "docid": "7d118a110817adae4bc45344b9ae5f58", "score": "0.7931806", "text": "def position\n return @position\n end", "title": "" }, { "docid": "b9ba73b49a5c16f3a1138c6c2ce9fd6b", "score": "0.7917952", "text": "def get_cursor_position()\n\t\t[model.cursor_row, model.cursor_col]\n\tend", "title": "" }, { "docid": "b54df291c61432b9f725297875f0193f", "score": "0.79148227", "text": "def position\n return (@position != nil) ? @position : 0\n end", "title": "" }, { "docid": "b54df291c61432b9f725297875f0193f", "score": "0.79148227", "text": "def position\n return (@position != nil) ? @position : 0\n end", "title": "" }, { "docid": "4f3e0be64c0d8c0e951414de1c22287c", "score": "0.7800902", "text": "def get_pos()\n return @position\n end", "title": "" }, { "docid": "69ad197162100b379b830ce2e71038b7", "score": "0.77455825", "text": "def pos\n @position\n end", "title": "" }, { "docid": "6ddb6014609fd7882216cbdc026601f4", "score": "0.7716297", "text": "def pos\n @position_holder.pos\n end", "title": "" }, { "docid": "cf062fa6c67519db0b42ff6fc27013d3", "score": "0.7616472", "text": "def position()\n @position\n end", "title": "" }, { "docid": "7dd120af1b164a85db507c30e6ab60fd", "score": "0.7564919", "text": "def position\n @position\n end", "title": "" }, { "docid": "7dd120af1b164a85db507c30e6ab60fd", "score": "0.7564919", "text": "def position\n @position\n end", "title": "" }, { "docid": "83992f96f957cec1410139ba5427de57", "score": "0.75320035", "text": "def current_position\n send(position_column).to_i\n end", "title": "" }, { "docid": "83992f96f957cec1410139ba5427de57", "score": "0.75320035", "text": "def current_position\n send(position_column).to_i\n end", "title": "" }, { "docid": "66b786011588b0e1b436b1ae19058430", "score": "0.747849", "text": "def pos\n return @pos\n end", "title": "" }, { "docid": "9c002c0fcb8c3dbf70203c6aca8207cd", "score": "0.74382716", "text": "def position\n @position \n end", "title": "" }, { "docid": "e0386089d8c7a581a329d98c0b5057bd", "score": "0.73750544", "text": "def get_cursor_pos\n [@cursor_pos.x, @cursor_pos.y]\n end", "title": "" }, { "docid": "d46a0d607383f49c36d1536dc76b0a0c", "score": "0.73298496", "text": "def cursor_index\n @cursor_index\n end", "title": "" }, { "docid": "c6b8d142fb9ff3153c18342c3fc0e540", "score": "0.7310363", "text": "def position\n [row, column]\n end", "title": "" }, { "docid": "3956781e157cc0e324372ceab385fc43", "score": "0.7293793", "text": "def position\n [@line, @column]\n end", "title": "" }, { "docid": "de29902dbf5d2703b434c44375ebc261", "score": "0.7275819", "text": "def position\n @curr.dup\n end", "title": "" }, { "docid": "bfd40cd44919d0d0ab6550be05a5660e", "score": "0.7252123", "text": "def cursor\n @cursor ||= document.lines.first(line - 1).join('').bytes.to_a.length + column\n end", "title": "" }, { "docid": "bed6b4c99cc6374702b187b5f2a55d30", "score": "0.7246677", "text": "def cursor_position()\n vars = all_variables()\n x = vars[\"cursor_x\"].to_i\n y = vars[\"cursor_y\"].to_i\n shown = vars[\"cursor_flag\"] != \"0\"\n [x, y, shown]\n end", "title": "" }, { "docid": "7c54b9a8cfa230712e3ee32bac0f0ee9", "score": "0.7225002", "text": "def position\n @position\n end", "title": "" }, { "docid": "92d955e0637303e320798a850d3cf098", "score": "0.7130605", "text": "def pos\n @pos\n end", "title": "" }, { "docid": "92d955e0637303e320798a850d3cf098", "score": "0.7130605", "text": "def pos\n @pos\n end", "title": "" }, { "docid": "03206be2cf10927a999c9035ab56fc30", "score": "0.7129317", "text": "def position\n\t\t[@line, @column]\n\tend", "title": "" }, { "docid": "976eec01841cb84d456273207fca004f", "score": "0.7095197", "text": "def position\n unless(defined?(@position)) then\n @position = 0\n end\n @position\n end", "title": "" }, { "docid": "16249b626fd5c57b68c3c91585a277b7", "score": "0.7052656", "text": "def position\n pos = read_attribute(position_column) and Position.new(pos)\n end", "title": "" }, { "docid": "021c74719c573f246c473e4e1e066709", "score": "0.70490867", "text": "def position\n obj[3]\n end", "title": "" }, { "docid": "b9eee829ab792c5a194cb07815ef2dee", "score": "0.704326", "text": "def position\n position? ? @position : nil\n end", "title": "" }, { "docid": "89baa34baa888d03a62445551a2e7499", "score": "0.7018061", "text": "def cursor # :nodoc:\n @cursor ||= 0\n end", "title": "" }, { "docid": "24505ab71942b4978f6e0920f146d018", "score": "0.7001759", "text": "def get_cursor_position(locator)\n return get_number(\"getCursorPosition\", [locator,])\n end", "title": "" }, { "docid": "772eb382e2f507c2e8b6886a8c5274db", "score": "0.6948824", "text": "def pos\n @__source_position__ || SourcePosition.unknown\n end", "title": "" }, { "docid": "8edb9ee3121453ab7ded1df3df7238df", "score": "0.6948296", "text": "def pos\n @pointer || 0\n end", "title": "" }, { "docid": "a145ca373d18ae0cd2d39b8312d0477b", "score": "0.69423884", "text": "def position\n return @interface.PositionGet.first\n end", "title": "" }, { "docid": "d5b8c027c93fd501c8c5eb3d07e3245a", "score": "0.69365406", "text": "def caret_position\n @text_input.caret_pos\n end", "title": "" }, { "docid": "f9aea5e98675ed11cf2d8ff0c4a1d59a", "score": "0.6920042", "text": "def position\n return 0\n end", "title": "" }, { "docid": "59e38a14056cd029db5abdc6fb795fad", "score": "0.69006646", "text": "def position\n @_position ||= ActiveRecord::Position.find(self.value)\n end", "title": "" }, { "docid": "4f75c10d54f3fa066af1eec4e94669d9", "score": "0.68838257", "text": "def start_position\n @startPosition\n end", "title": "" }, { "docid": "5f67c532cab9d555137b252fab581d54", "score": "0.6869693", "text": "def position\n fetch('the_thick_of_it.positions')\n end", "title": "" }, { "docid": "8d9e8c7185db4a69fc5509511183c283", "score": "0.686305", "text": "def pos # :nodoc:\n @pos || super\n end", "title": "" }, { "docid": "c766cfd7f22cf8b7020297a495a3b310", "score": "0.6854998", "text": "def pos\n return 0\n end", "title": "" }, { "docid": "c6c7a427231c514d49237a745fff1125", "score": "0.6845305", "text": "def position\n self[:position] || 1\n end", "title": "" }, { "docid": "f6de87ba49888b235dfc85179de24810", "score": "0.6830496", "text": "def pos\n @pos ||= node.get('pos')\n end", "title": "" }, { "docid": "eb2a1a931ce01254214cc9173aa00af0", "score": "0.68303734", "text": "def position\n Position.new(@filename,@lineno,@col)\n end", "title": "" }, { "docid": "5bef5a973e17a724d37bfcb52bc5d74c", "score": "0.67948776", "text": "def cursor_column\n line, col = @window.cursor\n col\n end", "title": "" }, { "docid": "dbb10ab61c1a20c5d93bdc285f50410d", "score": "0.67854524", "text": "def position\n @_position ||= Position.new(y, x).to_s\n end", "title": "" }, { "docid": "0afd9697ca99aa72220eb0a9a33086be", "score": "0.67754114", "text": "def cursor_pos\n @functions[:cursor_pos_x] ||= AU3_Function.new(\"MouseGetPosX\", 'V', 'L')\n @functions[:cursor_pos_y] ||= AU3_Function.new(\"MouseGetPosY\", 'V', 'L')\n [@functions[:cursor_pos_x].call, @functions[:cursor_pos_y].call]\n end", "title": "" }, { "docid": "28e74a16af8a9b824115442f012385e8", "score": "0.6756538", "text": "def offset\n return @offset unless @tok\n @tok.source_range.start_pos.offset\n end", "title": "" }, { "docid": "5afeee82215316a1369a308fbc956b59", "score": "0.6751581", "text": "def cursor\n @data['cursor']\n end", "title": "" }, { "docid": "fab5b768254ffddc5a9cc897446f0c10", "score": "0.6750793", "text": "def pos; @positionHolder.pos; end", "title": "" }, { "docid": "fab5b768254ffddc5a9cc897446f0c10", "score": "0.6750793", "text": "def pos; @positionHolder.pos; end", "title": "" }, { "docid": "05dd590939924eae25f84511a319514f", "score": "0.6745312", "text": "def position\n raise NotImplementedError\n end", "title": "" }, { "docid": "ff4c9a4db73a25162e8d4d5c0e8c02e5", "score": "0.6742816", "text": "def pos\n locatable.locator.pos_on_line(offset)\n end", "title": "" }, { "docid": "2dd2053a20425ccbd4e11fe8be68a115", "score": "0.67377037", "text": "def position\n __ub2(OCI_ATTR_POSITION)\n end", "title": "" }, { "docid": "da0ee99fa842ee29e1d73cfb6cda560b", "score": "0.67336786", "text": "def pos\r\n @raw_io.pos\r\n end", "title": "" }, { "docid": "666dff2ac3ba28ec46dc1128a15b1626", "score": "0.67315793", "text": "def position\n @element[\"position\"].to_i\n end", "title": "" }, { "docid": "1c54f2d7a9fcd1f3f64fb5ed2c71a5d2", "score": "0.67273206", "text": "def pos\n Position.new(@str.string, @str.pos)\n end", "title": "" }, { "docid": "059eaa9927a1aee7ff1483f899cf5a93", "score": "0.6718337", "text": "def retrieve_position\n scope = select(table[klass.position_column]).limit(1)\n result = connection.select_all(scope.arel, \"SQL\", scope.bind_values).first\n Position.new(type_cast_attribute(result.keys.first, result)) if result\n end", "title": "" }, { "docid": "373fba5f416004f054c4b9d019ef0ad2", "score": "0.6717538", "text": "def cursor\n buffer.length\n end", "title": "" }, { "docid": "1248923f4fac7c5bf4544cbf3c7ff468", "score": "0.6706616", "text": "def cursor\n # not relevant for this editor\n [0, 0]\n end", "title": "" }, { "docid": "a1815df5f11dc2d73929fcfb2dc4874b", "score": "0.670251", "text": "def current_position\n head.position\n end", "title": "" }, { "docid": "a69b0fba461a04454d09a0e8fbccf2bc", "score": "0.66890544", "text": "def rposition\n @count + 1 - @position\n end", "title": "" }, { "docid": "efc7b1e147bac90f1088a1ff33eb87fc", "score": "0.6678158", "text": "def char_pos\n @line_counts[lineno - 1][column]\n end", "title": "" }, { "docid": "beca539a735ee7456611fabccf840555", "score": "0.66731936", "text": "def cursor_x\n # x is \"0\" if cursor position at 0\n return -self.src_rect.x if !self.cursor_can_move_left?\n # find cursor position from text left from it\n display_text = get_display_text.scan(/./m)[0, @cursor_position].join\n return self.bitmap.text_size(display_text).width - self.src_rect.x\n end", "title": "" }, { "docid": "fbd55efcbaaa9d385a5847fe44dcb40d", "score": "0.66664344", "text": "def cursor_x\r\n contents_width - cursor_width - 4\r\n end", "title": "" }, { "docid": "6d6333e06328fe1d4c495117e68cf6a3", "score": "0.6649802", "text": "def cursor\n get_cursor\n end", "title": "" }, { "docid": "8f7a4be74fe538fcde38ef18568817a6", "score": "0.663719", "text": "def cursor\n [0, 0]\n end", "title": "" }, { "docid": "241826d66af11dd23071226c41d1e68c", "score": "0.6632425", "text": "def realPos\n @stream.pos\n end", "title": "" }, { "docid": "7f344d61b1dad48e5d6b920cdd4606ca", "score": "0.66153187", "text": "def pos\n if elements.size > 0\n elements.first.pos\n end\n end", "title": "" }, { "docid": "f0671c923b81422c154cd5b3421d556b", "score": "0.6588178", "text": "def realPos\n\t\[email protected]\n\tend", "title": "" }, { "docid": "e23ecba425b6c3adf8b3c288a3133218", "score": "0.6569828", "text": "def fetch position\n raise NotImplementedError\n end", "title": "" }, { "docid": "ca854e12177aaac0c0442457ad47e18b", "score": "0.65434796", "text": "def current_position; end", "title": "" }, { "docid": "aa248fa121f79fcfbb782e53ae05c734", "score": "0.65373695", "text": "def position\n \"Line: #{self[:yaml_line]} Column: #{self[:yaml_column]}\"\n end", "title": "" }, { "docid": "feaa752c4ca7d67ca91f45a1476101ae", "score": "0.6533575", "text": "def position\n attributes.fetch(:position)\n end", "title": "" }, { "docid": "feaa752c4ca7d67ca91f45a1476101ae", "score": "0.6533575", "text": "def position\n attributes.fetch(:position)\n end", "title": "" }, { "docid": "feaa752c4ca7d67ca91f45a1476101ae", "score": "0.6533575", "text": "def position\n attributes.fetch(:position)\n end", "title": "" }, { "docid": "feaa752c4ca7d67ca91f45a1476101ae", "score": "0.6533575", "text": "def position\n attributes.fetch(:position)\n end", "title": "" }, { "docid": "f000dd66a7e9fab30bd348b21c09ae8a", "score": "0.65297395", "text": "def x\n @position.x\n end", "title": "" }, { "docid": "cf4c49ba87bd15a17eae55c80d1895be", "score": "0.6528658", "text": "def offset\n if positioning_supported?\n @raw_io.pos - @initial_pos\n else\n # stream does not support positioning\n 0\n end\n end", "title": "" }, { "docid": "fc5002343132b19bdb191066e5707112", "score": "0.6524476", "text": "def current_position\n @current_position ||= calculate_position\n end", "title": "" }, { "docid": "b73318f03d10fc4d765832e0f734b722", "score": "0.6514522", "text": "def current_position\n gen_prompt.no_colors.length + @buffer.idx\n end", "title": "" }, { "docid": "9285b9748d27095ecc9ada9e01fb92b9", "score": "0.65099835", "text": "def get_pos(index)\n\t\t\t\n\t\t\tln = @buffer.line.number\n\n\t\t\treturn nil unless page.range.include? ln\n\n\t\t\t[line_space(index), ln - page.start]\n\t\tend", "title": "" }, { "docid": "10caf98dee73cf6ca4cf55eb04f8280f", "score": "0.65023476", "text": "def position\n # The rest of the current line\n rest = @scanner.check_until(/\\n|\\Z/).to_s.chomp\n\n # What we have parsed so far\n parsed = @scanner.string[[email protected]]\n\n lines = parsed.split(\"\\n\")\n\n [ lines.size, lines.last.size - 1, lines.last + rest ]\n end", "title": "" }, { "docid": "10caf98dee73cf6ca4cf55eb04f8280f", "score": "0.65023476", "text": "def position\n # The rest of the current line\n rest = @scanner.check_until(/\\n|\\Z/).to_s.chomp\n\n # What we have parsed so far\n parsed = @scanner.string[[email protected]]\n\n lines = parsed.split(\"\\n\")\n\n [ lines.size, lines.last.size - 1, lines.last + rest ]\n end", "title": "" }, { "docid": "29603de0e9c8fcbf4b1abb71c5e2dc9d", "score": "0.650218", "text": "def position\n\t\t\[email protected]\n\t\tend", "title": "" }, { "docid": "01f4e6eaf35b59b1ce5f8662cd19337e", "score": "0.65011555", "text": "def file_position\n @line_count\n end", "title": "" }, { "docid": "69419d459368958be279a96403c4e169", "score": "0.6497885", "text": "def offset\n return @offset\n end", "title": "" }, { "docid": "69419d459368958be279a96403c4e169", "score": "0.6497885", "text": "def offset\n return @offset\n end", "title": "" }, { "docid": "fac1dc4523256c2d1a9ad0606c3aa2e1", "score": "0.6493847", "text": "def x\n position.x if position?\n end", "title": "" }, { "docid": "05ad90bc4d3e6650c8369d79d8dc132f", "score": "0.64912766", "text": "def char_pos\n line_counts[lineno - 1][column]\n end", "title": "" }, { "docid": "8317db993eb424cd2ca4b0234016e01f", "score": "0.64733803", "text": "def position\n acquired_at.to_s\n end", "title": "" }, { "docid": "8317db993eb424cd2ca4b0234016e01f", "score": "0.64733803", "text": "def position\n acquired_at.to_s\n end", "title": "" }, { "docid": "9e7108195b3355fbcab7fc46a4f63a3b", "score": "0.6460748", "text": "def column_number( position = nil )\n position = @last_position if position.nil?\n eol_index = eol_index(position)\n \n if eol_index == 0 then\n return position - @commit_first_line_start_position + 1\n else\n return position - @eol_positions[eol_index - 1] \n end\n end", "title": "" }, { "docid": "760af56b87d8d8178e19bda772c0a268", "score": "0.6458844", "text": "def position\n end", "title": "" }, { "docid": "760af56b87d8d8178e19bda772c0a268", "score": "0.6458844", "text": "def position\n end", "title": "" } ]
b77144b49642150aeed116c24ed6778c
Check if the boggle board has all the possible alphabets
[ { "docid": "d04b483dac79c95a83ed28968c309e14", "score": "0.7008293", "text": "def include_every_alphabet?(word)\n for i in 0..word.length-1\n return false if (check_hash(word[i])==[])\n end\n return true\n end", "title": "" } ]
[ { "docid": "576c34e8e74953cb00510f2716d9b0f4", "score": "0.69435513", "text": "def uses_available_letters?(input, letters_in_hand)\n word_array = []\n input.each_char { |letter| word_array << letter }\n return word_array & letters_in_hand == word_array\nend", "title": "" }, { "docid": "83204cf02ca0a701704dc508ec70f2bf", "score": "0.692974", "text": "def any_winning_combination(board)\n WIN_COMBINATIONS.detect do |combination|\n any_char_combo?(combination, board)\n end\nend", "title": "" }, { "docid": "0d5cfc0c0f7c9bafd72ed484a2332d10", "score": "0.6928741", "text": "def any_char_combo?(combination, board)\n CHARACTER_SET.any? do |character|\n winning_combo?(combination, board, character)\n end\nend", "title": "" }, { "docid": "0a5bdc5b3ba66f800a81522e87b13ea3", "score": "0.6810788", "text": "def uses_available_letters?(input, letters_in_hand)\n input = input.upcase.chars\n boolean_value = true\n input.each do |letter|\n if input.count(letter) > letters_in_hand.count(letter) \n boolean_value = false\n end \n end\n boolean_value\nend", "title": "" }, { "docid": "f2ee4aa792100f8da55bddd21456f5f6", "score": "0.6808934", "text": "def uses_available_letters?(input, letters_in_hand)\n input = input.upcase.split(\"\")\n value = []\n if input.length > letters_in_hand.length\n return false\n else\n input.each do |letter|\n input.count(letter) > letters_in_hand.count(letter) ? value << false : value << true\n end\n end\n value.all? true ? true : false\nend", "title": "" }, { "docid": "2d9987c79fc9a148cc0c31c28ada8f8c", "score": "0.6769586", "text": "def full?(board)\n board.all? {|letter| letter == \"X\" || letter == \"O\"}\nend", "title": "" }, { "docid": "958446957ae77dfa79d4c6ff1da4d121", "score": "0.6747558", "text": "def letter_in_grid\n @answer.chars.sort.all? { |letter| @random.include?(letter) }\n end", "title": "" }, { "docid": "507cd25631875e9558bfbc6fb486d999", "score": "0.6746353", "text": "def won?(board)\n WIN_COMBINATIONS.each do |combo|\n check1 = board[combo[0]]\n check2 = board[combo[1]]\n check3 = board[combo[2]]\n final_check = [check1,check2,check3]\n if final_check.all?{|char| char == check1} && check1 != \" \"\n return combo\n end\n end\n return false\nend", "title": "" }, { "docid": "762f51657b57ff0f4a897832ad061c73", "score": "0.67365307", "text": "def full?(board)\n board.all? do |char|\n char == \"X\" || char == \"O\"\n end\nend", "title": "" }, { "docid": "fb2cdb25daef73954610dca5a0326a66", "score": "0.67321616", "text": "def grid_contains_word (attempt, grid)\n attempt_array = attempt.upcase.chars.to_a\n all_letters_present = true\n same_number_letters = true\n attempt_array.each do |char|\n if !grid.include?(char)\n all_letters_present = false\n end\n if grid.count(char) < attempt_array.count(char)\n same_number_letters = false\n end\n end\n return all_letters_present && same_number_letters\n end", "title": "" }, { "docid": "c97560c3310df8bc26b911d0d2511a01", "score": "0.6721329", "text": "def letter_in_grid\n @answer.chars.sort.all? { |letter| @grid.include?(letter) }\n end", "title": "" }, { "docid": "cbaa4a857ea7766c4f5915d8fa2411b1", "score": "0.6695204", "text": "def won?\n\t\t# Create a new array to check against.\n\t\t# This new array has to match the letters array to validate\n\t\tcorrect_array = @board.correct.map {\n\t\t\t|l| l.size == 2 ? l = l[0,1] : l = l\n\t\t}\n\t\[email protected] - correct_array == []\n\t\t\n\tend", "title": "" }, { "docid": "320baf03aec879e831edae66e4a08d91", "score": "0.66511256", "text": "def check_horizontal_comb(symbol)\n if @board[0][0] == symbol && @board[1][0] == symbol && @board[2][0] == symbol || @board[0][1] == symbol && @board[1][1] == symbol && @board[2][1] == symbol || @board[0][2] == symbol && @board[1][2] == symbol && @board[2][2] == symbol\n true\n else\n false\n end\n end", "title": "" }, { "docid": "034f960254ce293849bb3b5d8d4d9e77", "score": "0.6641916", "text": "def winning_combo?(combination, board, character = \"X\")\n combination.all? do |index|\n board[index] == character\n end\nend", "title": "" }, { "docid": "7a63efd4a89223ca7215c439fcd9d0b7", "score": "0.6611473", "text": "def valid_entry(attempt, grid)\n letters_of_attempt = attempt.upcase.split(\"\")\n letters_of_attempt.all? do |letter|\n letters_of_attempt.count(letter) <= grid.count(letter)\n end\n end", "title": "" }, { "docid": "6f973956f3283aee69958b7866566964", "score": "0.6595322", "text": "def check_all\n if is_scrambled?\n # Match scrambled_checksum with user grid\n puts \"scrambled_checksum:#{@scrambled_checksum} chksum:#{chksum @state}\"\n @scrambled_checksum == chksum(@state)\n else\n (0...@height).map do |r|\n (0...@width).map do |c|\n is_letter?(r,c) ? check_letter(r,c) : nil\n end\n end.flatten.compact.all? { |e| !!e } # if we have all 'true' squares then solution is correct\n end\n end", "title": "" }, { "docid": "72ad64401b5c1af6bee91cb43e8bb205", "score": "0.6591528", "text": "def any_char_combo?(combination)\n CHARACTER_SET.any? do |character|\n self.winning_combo?(combination, character)\n end\n end", "title": "" }, { "docid": "8fa3366cbede12725e941c8c6e4f961c", "score": "0.6576632", "text": "def check\n num_letter\n @bingo_board.each do |num|\n index = num.index(@number)\n num[index] = 'X' unless index.nil?\n # if num.include?(@num_letter)\n # num.map!{|x| x == @num_letter ? 'X' : x}\n # else\n # num\n # end\n end\n p @letter\n p @number\n pp @bingo_board\n end", "title": "" }, { "docid": "da31461c8a6e680eb609626b96f3a18d", "score": "0.6560149", "text": "def guessed_all_correct?\n if letter_counter == word.length\n return true\n end\n false\n end", "title": "" }, { "docid": "ced27796b2d3d029873cd04214b9b90a", "score": "0.65506303", "text": "def uses_available_letters?(input, letters_in_hand)\n used_letters = []\n input.each_char do |letter|\n if letters_in_hand.include?(letter) == true\n letters_in_hand.delete_elements_in_([letter])\n used_letters << letter\n else\n letters_in_hand = (letters_in_hand << used_letters).flatten! # Resets letter bank if previous user input included invalid letters\n return false\n end\n end\n letters_in_hand = (letters_in_hand << used_letters).flatten!\n return true\nend", "title": "" }, { "docid": "6b80d8c1b4bf2a451529037f80d5ed35", "score": "0.6542055", "text": "def uses_available_letters? (input, letters_in_hand)\n # Make a copy of the letters_in_hand in order to maintain the original array of values\n letters_in_hand_copy = []\n letters_in_hand_copy += letters_in_hand\n input.split('').each do |tile|\n if letters_in_hand_copy.include?(tile)\n index_of_tile = letters_in_hand_copy.index(tile)\n letters_in_hand_copy.delete_at(index_of_tile)\n else\n return false\n end\n end \n return true\nend", "title": "" }, { "docid": "546dafc8f133daaac03eca7d5a6ed4fc", "score": "0.651373", "text": "def uses_available_letters?(input, letters_in_hand)\n\n # takes word and puts it into an array\n adagram = input.split(//)\n\n # checks each letter against drawn letters\n # to see if they are included\n adagram.each do |letter|\n return false unless letters_in_hand.include?(letter)\n\n # check for repeated letters more than in drawn letters\n if letters_in_hand.include?(letter)\n letters_in_hand.delete(letter)\n end\n end\n\n return true\nend", "title": "" }, { "docid": "1b1c5b4b0cb5028d8fac429fb6881414", "score": "0.64962274", "text": "def uses_available_letters? (input, letters_in_hand)\n input = input.upcase.chars\n # make copy of drawn letters\n dl_copy = letters_in_hand.dup\n\n # if letter of input = letter in drawn letters, remove letter in drawn letters\n # continue to compare rest of letters to drawn letters\n # times_true array used to determine if word is valid\n times_true = []\n input.each do |letter|\n if dl_copy.include?(letter) == true\n dl_copy.delete_at(dl_copy.index(letter))\n times_true << \"true\"\n else\n times_true << \"false\"\n end\n end\n\n if times_true.count(\"true\") == input.length\n is_valid = true\n else\n is_valid = false\n end\n return is_valid\nend", "title": "" }, { "docid": "1d75f8e06acf75d9ee57ff8663fffac8", "score": "0.6494159", "text": "def uses_available_letters?(test_word, drawn_letters)\n \n # Create duplicate of drawn_letters to ensure data in this array does not change\n drawn_letters_2 = drawn_letters.dup\n # Take users's word and identify each character in that word\n input_letters = test_word.split('')\n input_letters = input_letters.map {|letter| letter.upcase}\n input_letters.each do |letter|\n # Verify user's word character against collection of drawn letters\n index = drawn_letters_2.index(letter)\n # If user's word character exist in the collection of drawn letters,\n # delete character from collection of drawn letters to account for repeats of same letter\n if index != nil\n drawn_letters_2.delete_at(index)\n else\n return false\n end\n end\n return true\nend", "title": "" }, { "docid": "896c9f6360cc33b2da2d7ed2c517c2ee", "score": "0.6493722", "text": "def winning_combo?(combination, character = \"X\")\n combination.all? do |index|\n self.board[index] == character\n end\n end", "title": "" }, { "docid": "9ffd865bb71cd192eb34b065a4ef9f1e", "score": "0.64927685", "text": "def full?(board)\n board.all? do |character|\n character == \"X\" || character == \"O\"\n end\nend", "title": "" }, { "docid": "67f5f7e553726b16c3d9f485fc9514df", "score": "0.6490083", "text": "def full?(board)\n all_full = board.all? do |character|\n character == \"X\" || character == \"O\"\n end\nend", "title": "" }, { "docid": "4e1255547e0d35df996ee43786e347a0", "score": "0.6485383", "text": "def uses_available_letters?(input, letters_in_hand)\n\n # splits the input into an array of characters\n split_input = input.chars\n\n # pushes true/false values into an array based on if user input is valid\n true_false = []\n split_input.each do |letter|\n # if all letters are available\n if letters_in_hand.include?(letter) && letters_in_hand.count(letter) >= input.count(letter)\n true_false << \"true\"\n else\n true_false << \"false\"\n end\n end\n\n # if all values in the true_false array are true, returns true, else returns false\n if true_false.all? do |statements|\n statements == \"true\"\n end\n return true\n else\n return false\n end\nend", "title": "" }, { "docid": "b1b52e6a48ab0e16700d75d1523b87d7", "score": "0.64832985", "text": "def is_possible?(letter, index)\n possibilities = DICTIONARY[size]\n each_with_index do |ltr, i|\n next if ltr.letter == '_'\n possibilities = possibilities.select {|p| p[i].chr == ltr.letter }\n end\n possibilities = possibilities.select {|p| p[index].chr == letter}\n possibilities -= @banned\n @cached_possibilities = possibilities\n !possibilities.empty?\n end", "title": "" }, { "docid": "b9c2cbe8545859222cfd54a0dc631496", "score": "0.6472678", "text": "def panagram?(string)\n # enter your code here\n p alphabet = (\"a\"..\"z\").to_a\n alphabet.all? { |letter| string.downcase.include? letter } \nend", "title": "" }, { "docid": "feea40fcd9cdbc50bb7ea10166625e14", "score": "0.6472282", "text": "def uses_available_letters?(input, letters_in_hand)\n letters_copy = letters_in_hand.clone # letters_in_hand will be kept the same even if any of the letters evals to false\n input.each_char { |o|\n index = letters_copy.find_index(o.upcase)\n if index.nil?\n return false\n else\n letters_copy.delete_at(index)\n end\n }\n return true\nend", "title": "" }, { "docid": "5c0a1f3c69fc3241ca926a190f8dd57d", "score": "0.64624035", "text": "def victory(word,letters)\n if word.split(\"\").all? { |i| letters.include?(i) }\n true\n else\n false\n end\n end", "title": "" }, { "docid": "12131494a34d7daa8861eda5923e3950", "score": "0.6452616", "text": "def find_combos \n combos = []\n # find letter combos greater than two letters\n @original_password.scan(/[A-Za-z]{2,}/) do |combo|\n combos << combo\n end\n combos\n end", "title": "" }, { "docid": "e71e64621402587daba7100643ba826a", "score": "0.6451729", "text": "def any_winning_combination\n WIN_COMBINATIONS.detect do |combination|\n self.any_char_combo?(combination)\n end\n end", "title": "" }, { "docid": "8c308b39341946fb33a0bf152ddc5131", "score": "0.6440027", "text": "def filled?\n all?{|letter| letter.letter != '_' }\n end", "title": "" }, { "docid": "95753353458d5e23c66cbb0e4d5168b9", "score": "0.64370847", "text": "def check_char(x, y, len, hei, board, control, char)\n return false unless safe(x, y, len, hei, control)\n\n # puts \" - searching: #{char} in [#{x}, #{y}] --> #{board[y][x]}\"\n\n if board[y][x] == char\n # puts \" - found letter #{char}\"\n control[y][x] = false\n true\n end\nend", "title": "" }, { "docid": "5ec5d193bd8ee6bba9b99028c00e298d", "score": "0.64161325", "text": "def uses_available_letters?(play, deck)\n hand = word_to_letter_with_count_hash(play)\n pool = letter_with_count_hash(deck)\n hand.each do | letter , count |\n if pool[letter] < count\n return false\n end\n end\n return true\nend", "title": "" }, { "docid": "94f6194326e9fe0d27dc1666700b432f", "score": "0.64030516", "text": "def is_valid_guess(letters)\n #\n end", "title": "" }, { "docid": "298212cf70a900ebdf5a6e59f46d5fa3", "score": "0.63943064", "text": "def uses_available_letters?(input, letters_in_hand)\n input_array = input.upcase.chars\n letters_copy = letters_in_hand.dup\n if input_array.length <= letters_in_hand.length\n input_array.each do |letter|\n if letters_copy.include?(letter)\n letters_copy.delete_at(letters_copy.index(letter))\n else\n return false\n end\n end\n return true\n else\n return false\n end\nend", "title": "" }, { "docid": "0cabf63bc013f4beb63cdf16e1ea9eb3", "score": "0.6391246", "text": "def same_letters?\n @letters_array.uniq.length == 1\n end", "title": "" }, { "docid": "7593a7e7af7541b7f5b9d781879f5f7b", "score": "0.6386845", "text": "def uses_available_letters?(input, letters_in_hand)\n\tlih_clone = letters_in_hand.dup\n\tword = input.upcase.split('')\n \n\tletters_match = word.map do |letter|\n\t\tbreak if lih_clone.index(letter) == nil\n\t\tlih_clone.slice!(lih_clone.index(letter))\n\t\tletter\n\tend\n\n\tif word == letters_match\n\t\tword.each do |letter|\n\t\t\tlih_clone << letter\n\t\tend\t\t\n\t\treturn true\n\telse\n\t\treturn false\n\tend\nend", "title": "" }, { "docid": "af2e7e09179990331e859546a2a88349", "score": "0.6377359", "text": "def uses_available_letters?(input, letters_in_hand)\n available_letters = letters_in_hand.sort.join.upcase\n \n user_input = input.split(\"\").sort.join.upcase\n\n return available_letters.include? user_input \nend", "title": "" }, { "docid": "9cd8929051f8408ff3fbe7b88106a270", "score": "0.6376784", "text": "def full?(board)\n return board.all?{ |space| space == 'X' || space == 'O'}\n end", "title": "" }, { "docid": "aef722890d0ddb8eee7edbe2bcda11aa", "score": "0.6370093", "text": "def uses_available_letters?(input, letters_in_hand)\n # Create a copy of the hand to use within this method so the original hand\n # remains unaltered.\n new_letters_in_hand = letters_in_hand.map do |letter|\n letter\n end\n\n # To account for duplicate letters, delete letters from the hand as they are\n # matched with letters from user input.\n word = input.upcase.split(\"\")\n word.each do |letter|\n if new_letters_in_hand.include?(letter)\n new_letters_in_hand.delete_at(new_letters_in_hand.index letter)\n else\n return false # returns false if any letter user entered isn't in hand\n end\n end\n return true # returns true only after all letters confirmed in hand\nend", "title": "" }, { "docid": "7366a958a386301a337e300c02813649", "score": "0.63632566", "text": "def check_pass pass\n return false if (pass.length < 3 || pass.length > 12)\n\n pass.length.times do |i|\n if pass[i].chr == '~'\n return false\n end\n end\n\n return true\nend", "title": "" }, { "docid": "714d61d0988fc439e5420a4a91467d8b", "score": "0.63619393", "text": "def check(characters)\n letter_number = characters.clone.chars\n letter = letter_number.shift\n\n column = nil\n %w( B I N G O).each_with_index do |character, index|\n column = index if letter == character\n end\n\n @bingo_board.each_with_index do |row, index|\n if row[column] == letter_number.join(\"\").to_i\n return [index, column]\n end\n end\n\n nil\n end", "title": "" }, { "docid": "ab37ed6816535fba98267c48332c2127", "score": "0.63595974", "text": "def check\n b = @board.dup\n win = [123, 456, 789, 147, 258, 369, 159, 357]\n win.each do |key|\n arr_key = key.to_s.split(\"\").collect { |k| k.to_i }\n if arr_key.all? { |position| b[position] == 'X' }\n return 'X'\n elsif arr_key.all? { |position| b[position] == 'O' }\n return 'O'\n else\n\n end\n end\n end", "title": "" }, { "docid": "459d6bf6780b45b0eac5ed9b0fc101fc", "score": "0.63506466", "text": "def full?(board)\n board.each do |taken| \n if taken == \" \"\n return false\n end\n end\nend", "title": "" }, { "docid": "827b43a416e2de89a187f0280ba1fe98", "score": "0.63457614", "text": "def has_all_unique_chars?(str)\n if str.length > NO_CHARS_ALLOWED \n false # pigeon hole principle\n else \n b = 0b0\n str.each_char do |char|\n k = char.ord\n bit = get_kth_bit(b, k)\n if bit == 1 \n return false\n else \n b = set_kth_bit(b, char.ord)\n end\n end\n true\n end\nend", "title": "" }, { "docid": "e41225633c39ad46287c61c8d5cedaf0", "score": "0.6340948", "text": "def full?\n @board.each do |taken| \n if taken == \" \"\n return false\n end\n end\nend", "title": "" }, { "docid": "2ba5f39a50e4f73e24b304a965864290", "score": "0.6332104", "text": "def uses_available_letters?(input, letters_in_hand)\n letters_in_hand_copy = letters_in_hand.dup\n input.split('').each do |letter|\n if letters_in_hand_copy.include? (letter)\n letters_in_hand_copy.slice!(letters_in_hand_copy.index(letter))\n else \n return false\n end\n end \n return true \nend", "title": "" }, { "docid": "57e348244e9214f571c7d5dd427e6ebe", "score": "0.6331105", "text": "def consecutive_letters?\n @letters_array.each_cons(2).all? { |x, y| x == y - 1 }\n end", "title": "" }, { "docid": "d14ecf9aa5f624755dbaaba0dffd9a8b", "score": "0.6328935", "text": "def full?(board)\n board.all?{|a| (a==\"X\" || a== \"O\")}\nend", "title": "" }, { "docid": "b2df475d4b7e626b4715097aa9221677", "score": "0.63283026", "text": "def check_winning_combos\n\t\t@winning_combos.each do |x|\n\t\t\t\tif x.all? { |a| @board[a] == @current_player.letter }\n\t\t\t\t\t@winner = @current_player.name\n\t\t\t\t\tdisplay_board\n\t\t\t\t\tputs \"#{@winner} has won!\"\n\t\t\t\t\tputs \"Would you like to play again? (y/n):\"\n\t\t\t\t\tstart_over\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "6f6b064934e17090cf0c14733eb95e45", "score": "0.6318568", "text": "def check_permutation (a, b)\n a_char_count = count_chars(a)\n b_char_count = count_chars(b)\n return false if a_char_count.to_a.size != b_char_count.to_a.size\n a_char_count.each do |key, value|\n return false if b_char_count[k] != value\n end\nend", "title": "" }, { "docid": "30b934aac2fa7cef2ef288d6c2fb6f19", "score": "0.6309992", "text": "def uses_available_letters? input, letters_in_hand\n letters_to_check = letters_in_hand.dup\n input.split(//).each do |letter|\n if (letters_to_check.include? letter.upcase) == false\n return false\n end\n letters_to_check.delete_at(letters_to_check.index(letter.upcase))\n end\n return true\nend", "title": "" }, { "docid": "93ba563406ad45f7d1f65b286c245d3d", "score": "0.6308135", "text": "def is_anagram?(text)\n @initial_letters == letters_of(text)\n end", "title": "" }, { "docid": "003031ab18fcc063d3fdd7f8d0e76da5", "score": "0.63005227", "text": "def check_vertical_comb(symbol)\n if @board[0][0] == symbol && @board[0][1] == symbol && @board[0][2] == symbol || @board[1][0] == symbol && @board[1][1] == symbol && @board[1][2] == symbol || @board[2][0] == symbol && @board[2][1] == symbol && @board[2][2] == symbol\n true\n else\n false\n end\n end", "title": "" }, { "docid": "9e2f2de4e41a2c956e72020e596b0948", "score": "0.62996906", "text": "def won?(board)\n win_combo = nil\n\n count_letter = lambda do |arr, letter| \n true if arr.count(letter) === 3\n end\n\n if board.count { |x| x == \" \"} == 9\n false\n\n else\n\n WIN_COMBINATIONS.each do |combo|\n positions = [ board[combo[0]], board[combo[1]], board[combo[2]] ]\n if count_letter[positions, \"O\"] \n win_combo = combo\n elsif count_letter[positions, \"X\"] \n win_combo = combo\n # elsif full?(board)\n # false\n else\n false\n end\n end\n\n end\n return win_combo\nend", "title": "" }, { "docid": "0d98692b6b49112b6093f1770d337e8b", "score": "0.62970734", "text": "def won?(board)\n # iterate over the possible winning combinations and see if each index of the winning combo is the same valid character\n WIN_COMBINATIONS.each do |win_combination|\n if position_taken?(board, win_combination[0]) && board[win_combination[0]] == board[win_combination[1]] && board[win_combination[1]] == board[win_combination[2]]\n return win_combination\n end\n end\n return false\nend", "title": "" }, { "docid": "6576004f7b8e9cc356a01c74d1cb21e1", "score": "0.6291757", "text": "def uses_available_letters?(input, letters_in_hand)\n input = input.upcase.split(\"\")\n\n letters_in_hand.each do |letter|\n if input.index(letter)\n input.slice!(input.index(letter))\n end\n end\n\n return input.empty?\nend", "title": "" }, { "docid": "80c0c6e6d58f25dcf3a94c145bdeea2e", "score": "0.62886214", "text": "def check_win()\n count =0\n @map.each do |item|\n\n item.length.times do |index|\n if item[index]==\"#\"\n count+=1\n end\n end\n\n end\n\n if count==0\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "15a9eb387f1de6fd3534aad478ece58d", "score": "0.6278775", "text": "def uses_available_letters?(input,letters_in_hand)\n #splitting the letters from user input [\"ADA\"] = [\"A\", \"D\", \"A\"]\n #confirming that letters in hand are matching the letters drawn by user\n input.split(\"\").each do |letter|\n if letters_in_hand.include?(letter)\n letters_in_hand.each_with_index do |hand_letter,index|\n if hand_letter == letter\n letters_in_hand.delete_at(index)\n break\n end\n end\n elsif !letters_in_hand.include?(letter)\n return false\n end\n end\n return true\nend", "title": "" }, { "docid": "b0bf66efb1fafd93243b8c815d6e60f9", "score": "0.62783605", "text": "def full?(board)\n board.all?{|i| i == \"X\" || i == \"O\"}\nend", "title": "" }, { "docid": "b0bf66efb1fafd93243b8c815d6e60f9", "score": "0.62783605", "text": "def full?(board)\n board.all?{|i| i == \"X\" || i == \"O\"}\nend", "title": "" }, { "docid": "80064cdd507c644fc70925fb06bb136b", "score": "0.6276522", "text": "def full?(board)\n if board.all? { |i| (i == \"X\" || i == \"O\") }\n return true\n end\nend", "title": "" }, { "docid": "9490ae58659366a047ba55eb1a824462", "score": "0.6272536", "text": "def uses_available_letters?(input, letters_in_hand)\n # Capitalizing input\n input.upcase!\n # Empty array to hold results\n letter_results = []\n # Validating quantitiy\n input.chars.each do |letter|\n if input.count(letter) > letters_in_hand.count(letter)\n letter_results << false\n else\n letter_results << true\n end\n end\n # Returns true if input quantity is valid\n return letter_results.all?(true)\nend", "title": "" }, { "docid": "a904f343f007342c141a64dc227f865d", "score": "0.62646663", "text": "def scramble(letters, word)\n contains_word = true\n word.chars.each do |letter|\n if letters.count(letter) < word.count(letter) || !letters.include?(letter)\n contains_word = false \n break if contains_word == false\n end\n end\n contains_word\nend", "title": "" }, { "docid": "1f59ce3c62580a4006f5122306f5ea54", "score": "0.6261415", "text": "def full?(board)\n return board.all?{|space| space == 'X' || space == 'O'}\nend", "title": "" }, { "docid": "aa2dd47544a95a64d60de157bd5d7a36", "score": "0.62541014", "text": "def full?(board)\n board.all? { |x| x == \"X\" || x == \"O\" } \nend", "title": "" }, { "docid": "52610ae5d6b5f96d26423089a8459ed7", "score": "0.62511456", "text": "def full?(board)\n if board == [\"X\", \" \", \"X\", \" \", \"X\", \" \", \"O\", \"O\", \" \"]\n return false\n\n elsif board == [\"X\", \"O\", \"X\", \"O\", \"X\", \"X\", \"O\", \"X\", \"O\"]\n return true\n\n end\n end", "title": "" }, { "docid": "fd46610ae13e435482bca28aed481017", "score": "0.62496084", "text": "def full?\n answer = true\n @board.each do |token|\n if token != \"X\" && token != \"O\"\n answer = false\n end\n end\n\tanswer\n # other solution - board.all?{|token| token == \"X\" || token == \"O\"}\nend", "title": "" }, { "docid": "92f14dc7b790a6f564c7ce9844c3fb7e", "score": "0.6238848", "text": "def full?\n\n @board.all? {|index| index == \"X\" || index == \"O\"}\n end", "title": "" }, { "docid": "27463e25383b14fe97f651a53c9037cb", "score": "0.62277234", "text": "def squares_valid?\n (0...3).each do |sq_i|\n (0...3).each do |sq_j|\n square = []\n (0...3).each do |i|\n (0...3).each do |j|\n square << @board[sq_i * 3 + i][sq_j * 3 + j]\n end\n end\n assigned_values = square.reject { |c| c == '_' }\n unless assigned_values == assigned_values.uniq\n return false\n end\n end\n end\n true\n end", "title": "" }, { "docid": "7a1d0bb2f5a8cfd1de17d6c0a9ff09df", "score": "0.6225052", "text": "def full?()\n board.all? { |value| value == 'X' || value == 'O'}\nend", "title": "" }, { "docid": "7d6f956edc29c2ed529179fd355fb629", "score": "0.6223923", "text": "def full?(board)\n#Return true if all positions on board are filled by X and/or O\n board.all?{|token| token == \"X\" || token == \"O\"}\nend", "title": "" }, { "docid": "cb226c48312d41ce69b5453ff11ac397", "score": "0.62230724", "text": "def is_anagram?(text)\n\t\t @initial_letters == letters_of(text)\n\t end", "title": "" }, { "docid": "d899588968384d996cb989bef4527610", "score": "0.6218649", "text": "def pangram?(wds)\n wds.join.split(//).uniq.size == 26\nend", "title": "" }, { "docid": "b06d9b469d9333db36bff64eb8c6c142", "score": "0.6218611", "text": "def letter_in_puzzle\n @display = []\n @excludeddisplay << @letterinput\n @puzzlecheck = @currentpuzzle.downcase\n multiplier = @puzzlecheck.count(@letterinput)\n #puts @puzzlecheck\n @remainingletters.reject! { |x| x == @letterinput}\n if @puzzlecheck.include?(@letterinput)\n @score += (@turnvalue*multiplier)\n else\n @score -= @turnvalue\n end\n display_board\n play\n end", "title": "" }, { "docid": "ee31dbed4a3f1640cb4ff4b98a63ccf8", "score": "0.6195096", "text": "def uses_available_letters?(input, letters_in_hand)\n\n new_letters_in_hand = letters_in_hand.dup\n\n input.upcase.chars.each do |character|\n if new_letters_in_hand.include?(character)\n position = new_letters_in_hand.index(character)\n new_letters_in_hand.delete_at(position)\n else\n return false\n end\n end\n return true\nend", "title": "" }, { "docid": "72aa84b52b41d96605bc03b93fc23f10", "score": "0.6193465", "text": "def check_board(word)\r\n new_board = []\r\n @board.map{|row| new_board << row.dup}\r\n diagonal = convert_diagonals(new_board)\r\n \r\n if check_rows(@board, word) || check_rows(@board.transpose, word) || check_rows(diagonal, word) || check_rows(diagonal.transpose, word) \r\n true\r\n else\r\n false\r\n end\r\n end", "title": "" }, { "docid": "d5b631b16ea97425be38f31d865c4b1d", "score": "0.6191701", "text": "def uses_available_letters?(user_input, letters_in_hand)\n untouched_hand = letters_in_hand.dup\n word_split = user_input.upcase.split(\"\")\n result = 0\n word_split.each do |letter|\n if untouched_hand.include?(letter)\n untouched_hand.slice!(untouched_hand.index(letter))\n result = true\n else\n result = false\n break\n end\n end\n return result\nend", "title": "" }, { "docid": "f6989cd3cc1fa5bcb0b8099cfad8cd9b", "score": "0.61888736", "text": "def won?(board)\n WIN_COMBINATIONS.each do |combo|\n if board[combo[0]] != \" \" && board[combo[0]] == board[combo[1]] && board[combo[1]] == board[combo[2]]\n return combo\n end\n end\n false\nend", "title": "" }, { "docid": "86b593cbde6409112175756b5467b857", "score": "0.6188667", "text": "def full?\n @board.all? do |taken|\n taken != \" \"\n end\n end", "title": "" }, { "docid": "c49111818e28f893e9a3a91d99f554dc", "score": "0.61886466", "text": "def uses_available_letters?(input, letters_in_hand)\nflag = 0\n# use dup to make a temporary copy of original hand\ncopy_letters_hand = letters_in_hand.dup\n# split user word into array of single letters\n# when word is valid remove letters used from copy hand\ninput.upcase.split('').each do |letter|\n if !(copy_letters_hand.include?(letter))\n flag += 1\n else\n copy_letters_hand.delete_at(copy_letters_hand.index letter)\n end\n end\n # return true if letters are all valid in hand, else -> false\n return flag > 0 ? false : true\nend", "title": "" }, { "docid": "d1d85a1ecee175b896f68385c6527fec", "score": "0.6181122", "text": "def won?\n # @word_array[1].all?([letter, 1])\n end", "title": "" }, { "docid": "136836861912e7708e7685b614538bae", "score": "0.6178326", "text": "def check\n @bingo_board.each do |row|\n if row[@letters[@call_letter]] == @call_number\n row[@letters[@call_letter]] = 'X'\n end\n end\n end", "title": "" }, { "docid": "cec4d10d2e2d0c819154ee38521f28a2", "score": "0.6175671", "text": "def uses_available_letters?(input, letters_in_hand)\n input = input.split(\"\")\n in_hand_dup = letters_in_hand.dup\n\n input.each do |x|\n unless in_hand_dup.include? x \n return false\n end\n in_hand_dup.delete(x)\n end\n return true\nend", "title": "" }, { "docid": "970662ff164a96f0e5f1cada7476b736", "score": "0.617534", "text": "def full?(board)\n board.all? {|i| i == \"X\" || i == \"O\"}\nend", "title": "" }, { "docid": "970662ff164a96f0e5f1cada7476b736", "score": "0.617534", "text": "def full?(board)\n board.all? {|i| i == \"X\" || i == \"O\"}\nend", "title": "" }, { "docid": "1d9652cffdf2e62f7fec222afc918ca1", "score": "0.6173417", "text": "def included?(word, letters)\n # all? return true only if all letters in array are true\n word.chars.all? { |char| word.count(char) <= letters.count(char) }\n # binding.pry\n end", "title": "" }, { "docid": "03e70f833b86594da55f16f78db9cc00", "score": "0.6173118", "text": "def letterboard\n letterboard = \"\"\n @correctword.each_char do |letter|\n if @letterbank.include?(letter)\n letterboard += letter\n else\n letterboard += \"_ \"\n end\n \n \n end\n letterboard\n \n end", "title": "" }, { "docid": "0e27778a08abf1bc07878ff337691f8c", "score": "0.61713445", "text": "def full?(board)\n board.all?{|token| token == \"X\" || token == \"O\"}\nend", "title": "" }, { "docid": "0e27778a08abf1bc07878ff337691f8c", "score": "0.61713445", "text": "def full?(board)\n board.all?{|token| token == \"X\" || token == \"O\"}\nend", "title": "" }, { "docid": "3c56ff7f1fc49948cfe87263131b8e09", "score": "0.6169356", "text": "def full?\n @board.all? do |index|\n index == \"X\" || index == \"O\"\n end\n end", "title": "" }, { "docid": "874a6d00741c378b24c6cfc6e430fdcc", "score": "0.6168132", "text": "def repeating_letters?(str)\n # your code goes here\n char_arr = str.downcase.chars\n uniq_arr = char_arr.uniq\n return char_arr.length != uniq_arr.length\nend", "title": "" }, { "docid": "5f86fa4183cf4c0a2375eab3ac611376", "score": "0.6168106", "text": "def compare(attempt, grid)\n result = attempt.map do |letter|\n grid.include?(letter.upcase)\n end\n result.all? { |x| x == true }\n end", "title": "" }, { "docid": "f29e224f2c8d6ad5b3a91aee5420d463", "score": "0.6167752", "text": "def included?(guess, grid)\n guess.upcase.chars.all? { |letter| guess.upcase.count(letter) <= grid.to_s.count(letter) }\n end", "title": "" }, { "docid": "fbab416860d95879c1fbdeb21f963f6f", "score": "0.6163266", "text": "def check_diagonal_comb(symbol)\n if @board[0][0] == symbol && @board[1][1] == symbol && @board[2][2] == symbol || @board[2][0] == symbol && @board[1][1] == symbol && @board[0][2] == symbol\n true\n else\n false\n end\n end", "title": "" }, { "docid": "7efbce30659a00d7fbc694cc4e9a12d0", "score": "0.6161552", "text": "def any_letters?(guess)\n\t\t @secret_word.include?(guess) ? true : false\n\t end", "title": "" } ]
7b2ea56142b52fb7d3be735699b666ca
Returns 1 if player 1 wins, 0 if tie and 1 if player 2 wins
[ { "docid": "b3fa3edc6398a52416cb19f1eca81eeb", "score": "0.7612444", "text": "def result(player1, player2)\n if player1 == player2\n 0\n elsif win?(player1, player2)\n 1\n else\n -1\n end\nend", "title": "" } ]
[ { "docid": "6de2126cb3c8ef073fe2547c35a34a25", "score": "0.80338305", "text": "def player_1_wins?\n @current_Score[\"Player 1\"] >= @games_needed_to_win\n end", "title": "" }, { "docid": "c37d9aeadec98c6cea4aed0dfd80dd53", "score": "0.7910568", "text": "def tie?\n player1.games_won == 6 && player2.games_won == 6\n end", "title": "" }, { "docid": "6e09736ae4354f29569cd03733d926ad", "score": "0.7900259", "text": "def player_2_wins?\n @current_Score[\"Player 2\"] >= @games_needed_to_win\n end", "title": "" }, { "docid": "4bea11f679e87407f0595f54432e38e5", "score": "0.78247327", "text": "def who_won?(player, computer)\n if win?(player, computer)\n 1\n elsif win?(computer, player)\n -1\n else\n 0\n end\nend", "title": "" }, { "docid": "11087499a6cef869ed74b0af8b067591", "score": "0.78130573", "text": "def winner\n if user_overtook? && dealer_overtook?\n tie\n elsif user_overtook?\n dealer_wins\n elsif dealer_overtook?\n user_wins\n elsif user_have_more_points?\n user_wins\n elsif dealer_have_more_points?\n dealer_wins\n else\n tie\n end\n status\n end", "title": "" }, { "docid": "abba28a20e0f41953ff4f3a6b4187a54", "score": "0.7796771", "text": "def tie_match\n @p1_wins == @p2_wins\n end", "title": "" }, { "docid": "dba30c42cac8a81cb26836914534b133", "score": "0.7737615", "text": "def who_win(player_1_weapon,player_2_weapon)\n if ((player_1_weapon == 1 && player_2_weapon == 3) ||\n (player_1_weapon == 2 && player_2_weapon == 1) ||\n (player_1_weapon == 3 && player_2_weapon == 2))\n return 1\n elsif((player_2_weapon == 1 && player_1_weapon == 3) ||\n (player_2_weapon == 2 && player_1_weapon == 1) ||\n (player_2_weapon == 3 && player_1_weapon == 2))\n return 2\n else\n return 0\n end\nend", "title": "" }, { "docid": "0906b0ba8ed1c5a15bd6664c32676a72", "score": "0.7687577", "text": "def who_won_all_rounds?\n if @player1_score > @player2_score\n return @player1_score\n\n elsif @player2_score > @player1_score\n return @player2_score\n end\n end", "title": "" }, { "docid": "01c75836495f6bda5d22cb243e604617", "score": "0.7650255", "text": "def win?\n\n if @player1.player_hand.hand_rank > @player2.player_hand.hand_rank\n p \"Player 1 Wins!\"\n elsif @player1.player_hand.hand_rank == @player2.player_hand.hand_rank\n p \"A Draw!\"\n else\n p \"Player 2 Wins!\"\n end\n end", "title": "" }, { "docid": "d1bc0d908fc7505f24057b3cffe77dd5", "score": "0.7646804", "text": "def check_who_wins\n if (choices[player_one.weapon][0] == player_two.weapon) || choices[player_one.weapon][1] == player_two.weapon\n @winner = player_one.name\n player_one.score_update\n else\n @winner = player_one.name\n player_two.score_update\n end\n end", "title": "" }, { "docid": "f31c7d1b6a7ab2ae24f9b25715f90389", "score": "0.7616211", "text": "def winner_count\n if @result == 1\n @player_one_wins += 1\n elsif @result == 2\n @player_two_wins += 1\n else @result == nil\n @games_played -= 1\n end\n end", "title": "" }, { "docid": "602a99595656ffe4055c96e098b2f709", "score": "0.76034755", "text": "def check_winner\n if @win != nil\n if @player1 == @win\n return \"Player one\"\n else return \"Player two\"\n end\n end\n end", "title": "" }, { "docid": "816f3fe4a2717bce0a9f58f94e09ec8c", "score": "0.75830764", "text": "def get_winner (p1, p2)\n who_wins = @rules.determine_winner(p1.move, p2.move)\n if who_wins == 1\n p1.increase_score\n puts \"#{p1.name} wins!\"\n elsif who_wins == 3\n p2.increase_score\n puts \"#{p2.name} wins!\"\n elsif who_wins == 2\n puts \"It's a tie!\"\n end\n \n end", "title": "" }, { "docid": "f56d1abc7a7465399ccd6086212b620c", "score": "0.7581579", "text": "def report_win\n if @player1.points > @player2.points\n if win_set?(player1)\n \"Player 1 wins the set!\"\n elsif tie?\n announce_tiebreaker\n else\n record_game_win!(player1)\n \"Player 1 wins!\"\n end\n else \n if win_set?(player2)\n \"Player 2 wins the set!\"\n elsif tie?\n announce_tiebreaker\n else\n record_game_win!(player2)\n \"Player 2 wins!\"\n end\n end\n end", "title": "" }, { "docid": "f3fa52a5f76eeef08f7dbc86b0eaad25", "score": "0.7526869", "text": "def match_winner\n if @p1_wins > @num_of_games_chosen / 2 \n puts \"\\nPlayer 1 wins!\"\n elsif @p2_wins > @num_of_games_chosen / 2 \n puts \"\\nPlayer 2 wins!\"\n end \n end", "title": "" }, { "docid": "5d3851831a91344e004e7c55352eeb10", "score": "0.7460249", "text": "def we_got_a_winner\r\n @remaining_players == 1\r\n end", "title": "" }, { "docid": "4adeaf25de9185af18e016f6ed3936c2", "score": "0.74565244", "text": "def whoWins(currentRound)\n move1 = currentRound.move1\n move1 = currentRound.move1\n if((move1 == 'r' && move2 == 's') || (move1 == 'p' && move2 == 'r') ||(move1 == 's' && move2 == 'p'))\n return 'player1'\n elsif((move1 == 'r' && move2 == 'r') || (move1 == 'p' && move2 == 'p') ||(move1 == 's' && move2 == 's'))\n return 'tie'\n else return 'player2'\n end\n end", "title": "" }, { "docid": "56f45fa2276cb42c26b6b12ffa21f254", "score": "0.745505", "text": "def rps(player1, player2)\n @tie = false\n if player1 == player2\n tie_round\n elsif player1 == :Rock\n p1_wins if player2 == :Scissors\n p2_wins if player2 == :Paper\n elsif player1 == :Paper\n p1_wins if player2 == :Rock\n p2_wins if player2 == :Scissors\n elsif player1 == :Scissors\n p1_wins if player2 == :Paper\n p2_wins if player2 == :Rock\n end\n end", "title": "" }, { "docid": "0c3249fe5868b01385146808a4f27086", "score": "0.743555", "text": "def winning_player\n if human_won?\n human\n elsif computer_won?\n computer\n end\n end", "title": "" }, { "docid": "821365e1437b49b36f5fe480579bd750", "score": "0.74303454", "text": "def winner\n if (@player1.score > @player2.score)\n puts \"Player 1 wins with a score of #{@player1.score}/3\"\n else\n puts \"Player 2 wins with a score of #{@player2.score}/3\"\n end\n puts \"----- GAME OVER -----\"\n end", "title": "" }, { "docid": "5df8946c0516164af73cfaf846c4de5c", "score": "0.74285877", "text": "def winning?(player)\n player == self.winner\n end", "title": "" }, { "docid": "4d1740da08bcc018bd839764f25996db", "score": "0.73842895", "text": "def game_play(player1, player2)\n if player1.points == 4 && player2.points == 5\n player2.state = \"advantage\"\n\n elsif player1.points >= 3 && player2.points >= 3 && player1.points == player2.points\n player1.state = \"deuce\"\n player2.state = \"deuce\"\n\n elsif player1.points >= 4 && player2.points <= player1.points - 2\n player1.wins += 1\n else\n end\n end", "title": "" }, { "docid": "84da49da0f8fc2772f2856c557934020", "score": "0.737297", "text": "def player_standings(first, second, winning_hash, player_wins)\n if win?(first, second, winning_hash)\n player_wins += 1\n else\n player_wins\n end\nend", "title": "" }, { "docid": "89d2c1d4399e9b6cfa4d2e4a5a2adbc2", "score": "0.73680466", "text": "def winner?(other_player)\n other_player == winner\n end", "title": "" }, { "docid": "727a6b0882e70dc006ca3744455901fc", "score": "0.73575795", "text": "def check_sets(player1, player2)\n if player1.wins >= 6 && player2.wins <= player1.wins - 2\n player1.set_wins +=1 \n else\n end\n end", "title": "" }, { "docid": "97a21845872894b431a5c92af238d5a0", "score": "0.735382", "text": "def winner_players\n if player_1.deck.rank_of_card_at(0) > player_2.deck.rank_of_card_at(0)\n :basic_player_1\n elsif player_1.deck.rank_of_card_at(0) < player_2.deck.rank_of_card_at(0)\n :basic_player_2\n elsif player_1.deck.rank_of_card_at(2) > player_2.deck.rank_of_card_at(2)\n :war_player_1\n elsif player_1.deck.rank_of_card_at(2) < player_2.deck.rank_of_card_at(2)\n :war_player_2\n else\n :mutual_no_winner\n end\n end", "title": "" }, { "docid": "b896260a16249427569eb4806d347fdd", "score": "0.7347958", "text": "def set_winner(p1_weapon, p2_weapon)\n \n if p1_weapon == p2_weapon\n return 0\n end\n\n if p1_weapon == 'paper'\n if p2_weapon == 'rock'\n return 1\n end\n if p2_weapon == 'scissors'\n return 2\n end\n\n elsif p1_weapon == 'scissors'\n if p2_weapon == 'rock'\n return 2\n end\n if p2_weapon == 'paper'\n return 1\n end\n\n elsif p1_weapon == 'rock'\n if p2_weapon == 'paper'\n return 2\n end\n if p2_weapon == 'scissors'\n return 1\n end\n end\n end", "title": "" }, { "docid": "4d61dbae215246afc9edabe7bbb50168", "score": "0.73460686", "text": "def game_over?\n win? || tie?\n end", "title": "" }, { "docid": "65366147800acb25c29518416e49099f", "score": "0.73270845", "text": "def checkWinner\n if @player1.lives == 0\n puts \"----- GAME OVER -----\"\n puts \"#{@player2.name} wins with a score of #{@player2.lives}/3 \"\n puts \"Thank you, play again\"\n elsif @player2.lives == 0\n puts \"----- GAME OVER -----\"\n puts \"#{@player1.name} wins with a score of #{@player1.lives}/3 \"\n puts \"Thank you, play again\"\n else\n nextTurn\n end\n end", "title": "" }, { "docid": "af532484dc2e96de7e7a56cce5b35014", "score": "0.73236", "text": "def winner_present\n player1_winner || player2_winner\n end", "title": "" }, { "docid": "ab5dccac72b915ae01331687556f46ce", "score": "0.73213845", "text": "def who_won\n puts @player == 2 ? 'X wins' : \"O wins\"\n end", "title": "" }, { "docid": "200face82b77b5d4c2c61d6429a3c71d", "score": "0.7320667", "text": "def determine_winner(player1, player2)\n winner_of_game\n #puts player1.moves.join(\" \")\n if @p1_games_won == 3\n puts \"Nice match! #{player1.name} wins!\"\n\n else @p2_games_won == 3\n puts \"#{player2.name} takes it this time!\"\n end\n end", "title": "" }, { "docid": "0a8af26a34d4a88b0679428284a7b196", "score": "0.73128116", "text": "def winning_match\n @p1_wins != @p2_wins\n end", "title": "" }, { "docid": "1b73b3961e2afaeeb42d4c4153d2a98e", "score": "0.73062587", "text": "def p1win(p1weapon, p2weapon)\n\treturn ((p1weapon == 'rock' and p2weapon == 'scissors') or (p1weapon == 'paper' and p2weapon == 'rock') or (p1weapon == 'scissors' and p2weapon == 'paper'))\nend", "title": "" }, { "docid": "16a08c32a1ae63ceb40714ac23a57cf7", "score": "0.7301946", "text": "def winner\n if no_pieces_for_player?(1)\n 2\n elsif no_pieces_for_player?(2)\n 1\n else\n nil\n end\n end", "title": "" }, { "docid": "a7a5ae301a99706aee9dc715f635ecf7", "score": "0.72915846", "text": "def winner(player1, player2)\n if (player1.score == 0) && (player2.score == 0)\n puts \"Both players have 0 points. No one wins.\"\n elsif (player1.score == 0)\n puts \"#{player2.name} wins with #{player2.score} points!\"\n else\n puts \"#{player1.name} wins with #{player1.score} points!\"\n end\n end", "title": "" }, { "docid": "bcb3b3a4786bd5d7b081c4f5d417638d", "score": "0.7285851", "text": "def win? \n game_status(\"wins\")\n end", "title": "" }, { "docid": "b1b22e98c3d38c13a6f643bf221a73b0", "score": "0.72805333", "text": "def winner\n\t\tbest_for_1 = best_hand(@hand1)\n\t\tbest_for_2 = best_hand(@hand2)\n\t\tcase best_for_1[:rank] <=> best_for_2[:rank]\n\t\t\twhen -1 then 2\n\t\t\twhen 1 then 1\n\t\t\twhen 0 then check_kicker(best_for_1, best_for_2)\n\t\tend\n\tend", "title": "" }, { "docid": "dd230af73fea1f2c1d1691d81f99a6d7", "score": "0.72778356", "text": "def checkForWinner()\n if @numPlayers == 1\n puts \"#{@players[0].name} is the winner!!\"\n return true\n elsif @numPlayers == 0\n puts \"It seems we have a tie!\"\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "49fd1bd6acdd8911e98a9d2f0e4fc57a", "score": "0.7276126", "text": "def player_turn?\n if @cell.where(value: 1).count > @cell.where(value: 2).count\n @current_player = 2\n else\n @current_player = 1\n end\n end", "title": "" }, { "docid": "d604d643fe8ae113b9b452545dfabc67", "score": "0.72704506", "text": "def win_set?(player)\n player.games_won >= 6 && player.opponent.games_won < 6\n end", "title": "" }, { "docid": "45b5472a54e776c473b7bbb3c49a930b", "score": "0.72682786", "text": "def wins_count opponent_id\n\t\tmatches = self.matches opponent_id\n\t\twins = 0\n\t\tmatches.each do |match|\n\t\t\t# first team\n\t\t\tif self.id == match.team1_id\n\t\t\t\tif match.result == 1\n\t\t\t\t\twins += 1\n\t\t\t\tend\n\t\t\t# if the team is the team2, then result has to be -1 for the team to win\n\t\t\telsif self.id == match.team2_id\n\t\t\t\tif match.result == -1\n\t\t\t\t\twins += 1\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\twins\n\tend", "title": "" }, { "docid": "913507b02e418940c6f1cf71ba598f41", "score": "0.72663337", "text": "def player_wins?(p1_hand, cpu_hand)\n if !bust?(p1_hand) && amount(p1_hand) == 6\n @details = 'You win!'\n self.class.player_score += 1\n true\n elsif bust?(cpu_hand)\n @details = 'Dealer busted! You win!!'\n self.class.player_score += 1\n true\n elsif amount(p1_hand) == 2 && value(p1_hand) == 21\n @details = 'You win! You got BlackJack!'\n self.class.player_score += 1\n true\n elsif value(p1_hand) > value(cpu_hand) && value(p1_hand) <= 21\n @details = 'You win! You had a higher value than the Dealer.'\n self.class.player_score += 1\n true\n else\n false\n end\n end", "title": "" }, { "docid": "6bbe844bb5b9f15223d2e28a668b82a1", "score": "0.7260934", "text": "def player_won?\n\t\tplayer_largest?\n\tend", "title": "" }, { "docid": "09fd56ad6142a9a25b03ede3e7a80bc3", "score": "0.72450817", "text": "def return_winner\n winner = ''\n if player_1.current_move.downcase == 'rock' && player_2.current_move.downcase == 'scissors' ||\n player_1.current_move.downcase == 'scissors' && player_2.current_move.downcase == 'paper' ||\n player_1.current_move.downcase == 'paper' && player_2.current_move.downcase == 'rock'\n winner = 1\n\n elsif player_2.current_move.downcase == 'rock' && player_1.current_move.downcase == 'scissors' ||\n player_2.current_move.downcase == 'scissors' && player_1.current_move.downcase == 'paper' ||\n player_2.current_move.downcase == 'paper' && player_1.current_move.downcase == 'rock'\n winner = 2\n else\n winner = 3\n end\n end", "title": "" }, { "docid": "7da36acfdacc7ff4ca3008d7b5c6770f", "score": "0.72445774", "text": "def player_has_won(player)\n player.score += 1\n\n puts player.name + ' has won!'\n puts \"Current score: \"\n puts \"#{@player1.name} - #{@player1.score} : #{@player2.name} - #{@player2.score}\"\n end", "title": "" }, { "docid": "07d0614789737b060e50d07465c0a635", "score": "0.7234336", "text": "def determine_winner(array)\n p1 = array.count(@player1.symbol)\n p2 = array.count(@player2.symbol)\n if p1 > p2\n puts \"Congrats! #{@player1.name} wins!\"\n score\n elsif p1 < p2\n puts \"Congrats! #{@player2.name} wins!\"\n score\n else\n puts \"You both win, it's a tie!\"\n score\n end\n end", "title": "" }, { "docid": "3d4075cf9fce45da010cf044bd8e33e6", "score": "0.7222325", "text": "def winner\n if @player1.dead || @player2.dead\n return @player1.dead ? ObjectType::PLAYER2 : ObjectType::PLAYER1\n end\n -1\n end", "title": "" }, { "docid": "dd2b66c6247985c0ae3e787f3ce9f0d1", "score": "0.7213605", "text": "def round_win(p1_answer, p2_answer)\n\t\tif p1_answer == p2_answer\n\t\t\tputs \"It's a tie! Try again!\"\n\t\t\treturn \"tie\"\n\t\telsif p1_answer == \"rock\" and p2_answer == \"paper\"\n\t\t\tputs \"Player 2 wins this round!\"\n\n\t\telsif p1_answer == \"scissors\" and p2_answer == \"rock\"\n\t\t\tputs \"Player 2 wins this round!\"\n\n\t\telsif p1_answer == \"paper\" and p2_answer == \"scissors\"\n\t\telse \n\t\t\tputs \"Player 1 wins this round!\"\n\t\t\treturn \"p1\"\n\t\tend\n\n\tend", "title": "" }, { "docid": "5432606e831067e9602c0984e938b10b", "score": "0.7204128", "text": "def winner?\n if @player && winner\n return @player\n end\n\n if @move_count == 9\n return :draw\n end\n false\n end", "title": "" }, { "docid": "5e7c29c1eeb1206488c05cda47bf6f27", "score": "0.71975416", "text": "def set_winner(p1_weapon, p2_weapon)\n \n if p1_weapon == p2_weapon\n return 0\n end\n\n if p1_weapon == 'paper'\n if p2_weapon == 'rock'\n return 1\n end\n if p2_weapon == 'scissors'\n return 2\n end\n\n elsif p1_weapon == 'scissors'\n if p2_weapon == 'rock'\n return 2\n end\n if p2_weapon == 'paper'\n return 1\n end\n\n elsif p1_weapon == 'rock'\n if p2_weapon == 'paper'\n return 2\n end\n if p2_weapon == 'scissors'\n return 1\n end\n end\nend", "title": "" }, { "docid": "cabc95bffab7f661f722d103a1036109", "score": "0.71907556", "text": "def individual_game_winner\n if @result == 1\n return \"\\nPlayer one wins!\"\n elsif @result == 2\n return \"\\nPlayer two wins!\"\n else @result == nil\n return \"\\nIt's a tie!\"\n end\n end", "title": "" }, { "docid": "81457aa7e45490ebe8a2d3152220422e", "score": "0.7190428", "text": "def already_won_game(player)\n points[player] > 3 && diff_of_two\n end", "title": "" }, { "docid": "93da909c0d9e3b5c5a983e6e68062729", "score": "0.71812445", "text": "def win?\n if @player1.life == 3\n sleep(1)\n puts ' - GAME OVER - '\n sleep(1)\n puts \"#{@player1.name} wins!\"\n sleep(1)\n puts \"THANK YOU, PLAY AGAIN!\"\n\n elsif @player2.life == 3\n puts ' - GAME OVER - '\n sleep(1)\n puts \"#{@player1.name} wins!\"\n sleep(1)\n puts \"THANK YOU, PLAY AGAIN!\"\n else\n turn\n end\nend", "title": "" }, { "docid": "c942f433e7bb0ff53de98ce956bbd291", "score": "0.71780515", "text": "def win?\n\t\tif(@grid[:a1] == \"X\" && @grid[:a2] == \"X\" && @grid[:a3] == \"X\")\n\t\t\tputs @players[0].win\n\t\t\treturn true\n\t\telsif(@grid[:b1] == \"X\" && @grid[:b2] == \"X\" && @grid[:b3] == \"X\")\n\t\t\tputs @players[0].win\n\t\t\treturn true\n\t\telsif(@grid[:c1] == \"X\" && @grid[:c2] == \"X\" && @grid[:c3] == \"X\")\n\t\t\tputs @players[0].win\n\t\t\treturn true\n\t\telsif(@grid[:a1] == \"X\" && @grid[:b1] == \"X\" && @grid[:c1] == \"X\")\n\t\t\tputs @players[0].win\n\t\t\treturn true\n\t\telsif(@grid[:a2] == \"X\" && @grid[:b2] == \"X\" && @grid[:c2] == \"X\")\n\t\t\tputs @players[0].win\n\t\t\treturn true\n\t\telsif(@grid[:a3] == \"X\" && @grid[:b3] == \"X\" && @grid[:c3] == \"X\")\n\t\t\tputs @players[0].win\n\t\t\treturn true\n\t\telsif(@grid[:a1] == \"X\" && @grid[:b2] == \"X\" && @grid[:c3] == \"X\")\n\t\t\tputs @players[0].win\n\t\t\treturn true\n\t\telsif(@grid[:a3] == \"X\" && @grid[:b2] == \"X\" && @grid[:c1] == \"X\")\n\t\t\tputs @players[0].win\n\t\t\treturn true\n\n\t\telsif(@grid[:a1] == \"O\" && @grid[:a2] == \"O\" && @grid[:a3] == \"O\")\n\t\t\tputs @playercount.to_i == 2 ? @players[1].win : \"\\n\\nAI wins!\\n\"\n\t\t\treturn true\n\t\telsif(@grid[:b1] == \"O\" && @grid[:b2] == \"O\" && @grid[:b3] == \"O\")\n\t\t\tputs @playercount.to_i == 2 ? @players[1].win : \"\\n\\nAI wins!\\n\"\n\t\t\treturn true\n\t\telsif(@grid[:c1] == \"O\" && @grid[:c2] == \"O\" && @grid[:c3] == \"O\")\n\t\t\tputs @playercount.to_i == 2 ? @players[1].win : \"\\n\\nAI wins!\\n\"\n\t\t\treturn true\n\t\telsif(@grid[:a1] == \"O\" && @grid[:b1] == \"O\" && @grid[:c1] == \"O\")\n\t\t\tputs @playercount.to_i == 2 ? @players[1].win : \"\\n\\nAI wins!\\n\"\n\t\t\treturn true\n\t\telsif(@grid[:a2] == \"O\" && @grid[:b2] == \"O\" && @grid[:c2] == \"O\")\n\t\t\tputs @playercount.to_i == 2 ? @players[1].win : \"\\n\\nAI wins!\\n\"\n\t\t\treturn true\n\t\telsif(@grid[:a3] == \"O\" && @grid[:b3] == \"O\" && @grid[:c3] == \"O\")\n\t\t\tputs @playercount.to_i == 2 ? @players[1].win : \"\\n\\nAI wins!\\n\"\n\t\t\treturn true\n\t\telsif(@grid[:a1] == \"O\" && @grid[:b2] == \"O\" && @grid[:c3] == \"O\")\n\t\t\tputs @playercount.to_i == 2 ? @players[1].win : \"\\n\\nAI wins!\\n\"\n\t\t\treturn true\n\t\telsif(@grid[:a3] == \"O\" && @grid[:b2] == \"O\" && @grid[:c1] == \"O\")\n\t\t\tputs @playercount.to_i == 2 ? @players[1].win : \"\\n\\nAI wins!\\n\"\n\t\t\treturn true\n\t\telsif([email protected]?(\"null\"))\n\t\t\tputs \"\\n\\nIt's a draw!\\n\"\n\t\t\treturn true\n\t\tend\n\tend", "title": "" }, { "docid": "17f526b3b5386ae76323d41bce4c7625", "score": "0.7167239", "text": "def win?\n @board.win_conditions.each do |win_condition|\n if (win_condition & @player_1.inputs ) == win_condition\n @player_1.state = true\n return true\n end\n if (win_condition & @player_2.inputs ) == win_condition\n @player_2.state = true\n return true\n end\n end\n return false\n end", "title": "" }, { "docid": "5f0a34c5e26867eff107e1bba578db22", "score": "0.71568984", "text": "def score\n\t\tif @player1 > @player2\n\t\t\t\"You win #{@player1} to #{@player2}!\"\n\t\telsif @player1 < @player2\n\t\t\t\"You lost #{@player1} to #{@player2}!\"\n\t\telse\n\t\t\t\"You tied at #{@player1}!\"\n\t\tend\n\tend", "title": "" }, { "docid": "a16cff20def8c4bc31ec9dd2dafa8f3e", "score": "0.71530193", "text": "def who_won\n winner = nil\n if is_round_over?\n twentyone_user = twentyone_users\n if twentyone_user\n winner = twentyone_user\n elsif nonbusted_users\n highest = 0\n users.each do |user|\n hand_value = value(user.hand(self))\n return 'tie' if hand_value == highest && hand_value < 22\n\n if hand_value > highest && hand_value < 22\n highest = hand_value\n winner = user\n end\n end\n end\n end\n winner\n end", "title": "" }, { "docid": "641fa1148188426a6398e73bedfd0f69", "score": "0.7145259", "text": "def winner\n if type_of_turn == :basic\n\n if player1.deck.rank_of_cards_at(0) > player2.deck.rank_of_cards_at(0)\n @winner_of_turn = player1\n else\n @winner_of_turn = player2\n end\n\n elsif type_of_turn == :war\n\n if player1.deck.rank_of_cards_at(2) > player2.deck.rank_of_cards_at(2)\n @winner_of_turn = player1\n else\n @winner_of_turn = player2\n end\n\n else\n @winner_of_turn = \"No Winner\"\n end\n end", "title": "" }, { "docid": "59c035776d5d36e0808e1e33e5f269cf", "score": "0.71443313", "text": "def find_winner(score1, score2)\n return 0 if score1 == score2\n\n score1 > score2 ? 1 : 2\n end", "title": "" }, { "docid": "db2f1ae8ed00e2b4277e361d4561c0c4", "score": "0.7141272", "text": "def winner\n return players_still_in_round[0] if players_still_in_round.count == 1\n end", "title": "" }, { "docid": "f910aeb737449ce7a21d38caf3b1ce01", "score": "0.71412545", "text": "def winning_player\n return :player_1 if who_won == 'x'\n :player_2\n end", "title": "" }, { "docid": "c028d517f627a423c9dc9bea7c14465a", "score": "0.7138222", "text": "def compare(outcome)\n if outcome == :win\n puts \"You win!\"\n WINS[:user] += 1\nelsif outcome == :lose\n puts \"You lose!\"\n WINS[:computer] += 1\nelse\n puts \"Tie game!\"\n WINS[:draw] += 1\nend\nend", "title": "" }, { "docid": "c73260e48995bf2b23e5d0ee6b3a14ef", "score": "0.7136858", "text": "def current_player #it is player 2 turn, else, player 1\n board.turn_count.odd? ? player_2 : player_1\n end", "title": "" }, { "docid": "deded060a60c6788cd5dabdc9c3570dd", "score": "0.7121245", "text": "def check_winners\n winner_x = @winners.count('X')\n winner_o = @winners.count('O')\n puts \"X has won #{winner_x} times\"\n puts \"O has won #{winner_o} times\"\n end", "title": "" }, { "docid": "a0fe0e50aa3c6558155f783c25722bc3", "score": "0.71148425", "text": "def winner\n return nil unless self.score.present?\n\n split = self.score.split \":\"\n\n if split[0].to_i > split[1].to_i\n self.player1\n else\n self.player2\n end\n end", "title": "" }, { "docid": "5c7c96d5b66a466c8d4efe35ef1a17c5", "score": "0.71075004", "text": "def winner\n if winner_players == :basic_player_1\n player_1\n elsif winner_players == :basic_player_2\n player_2\n elsif winner_players == :war_player_1\n player_1\n elsif winner_players == :war_player_2\n player_2\n elsif winner_players == :mutual_no_winner\n 'Mutually Assured Destruction! 6 cards removed from the deck. (;_;)'\n else\n 'OOPS - TESTING'\n end\n end", "title": "" }, { "docid": "5340997940d6b9b1ec10612c0c830538", "score": "0.7104642", "text": "def winner\n if user1.total_points > user2.total_points\n user1\n elsif user1.total_points < user2.total_points\n user2\n end\n end", "title": "" }, { "docid": "14a7f60eec2036c6a57125af1d7d6a04", "score": "0.70928025", "text": "def wins(player, board, player_1_game_symbol, player_2_game_symbol)\n if player && @new_gameboard.game_is_over(board, player_1_game_symbol, player_2_game_symbol)\n return true\n end\n end", "title": "" }, { "docid": "d2fe45dc6c15a93208e631cc787915c1", "score": "0.70885813", "text": "def someone_won?\n !!detect_winner\n end", "title": "" }, { "docid": "d2fe45dc6c15a93208e631cc787915c1", "score": "0.70885813", "text": "def someone_won?\n !!detect_winner\n end", "title": "" }, { "docid": "c2716e3f2c22202ec5b1a55e030d4be3", "score": "0.70752513", "text": "def match_won(tmp)\n\t\tif(@player1.circle_or_cross == tmp)\n\t\t\[email protected] +=1\n\t\t\tputs \"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\t\\t\\t\\tPlayer #{@player1.name} won!\".green\n\t\telse\n\t\t\[email protected] +=1\n\t\t\tputs \"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\t\\t\\t\\tPlayer #{@player2.name} won!\".green\n\t\tend\n\t\tsleep(3)\n\tend", "title": "" }, { "docid": "15ee7e0b8590cdd17add5272a8e77f93", "score": "0.7073403", "text": "def player_won? \n @player_won = [-1, 2].include?(@difference)\n end", "title": "" }, { "docid": "1ee6960d6e45f7ebd52bf304a3032287", "score": "0.7072254", "text": "def player_win?(current_player)\n if @sticks_remaining == 1\n puts \"#{current_player} wins.\"\n if current_player == \"Player 1\"\n computer_lose = true\n else\n computer_lose = false\n end\n end\nend", "title": "" }, { "docid": "863addd9100a8366f4ea4e4214e20d60", "score": "0.7069024", "text": "def check_status\n\n if @player1.player_status == 2 && @player2.player_status == 2\n p \"A Draw!\"\n return true\n elsif @player1.player_status == 2\n p \"Player 2 Wins!\"\n return true\n elsif @player2.player_status == 2\n p \"Player 1 Wins!\"\n return true\n end\n\n return false\n\n end", "title": "" }, { "docid": "bb582b24c06caf02f706bb9393749467", "score": "0.7064652", "text": "def won?\n experience(leader) + opponents.count * 100 < experience\n end", "title": "" }, { "docid": "7b2570970dce9ad4fddf9446ab406b2a", "score": "0.7063877", "text": "def winner\n self.won?\n @winner\n end", "title": "" }, { "docid": "0a5fad82a327c5453727c824a8334e77", "score": "0.7063217", "text": "def add_win_to_score(winner)\n if winner == 1\n @player_1_score += 1\n elsif winner == 2\n @player_2_score += 1\n end\n end", "title": "" }, { "docid": "a3d85380c23cf3fd8e07701b4373d655", "score": "0.7054864", "text": "def rps(p1, p2)\r\n p1_won = 'Player 1 won!'\r\n \r\n if p1 == p2\r\n return 'Draw!'\r\n elsif p1 == 'scissors' && p2 == 'paper'\r\n return p1_won\r\n elsif p1 == 'paper' && p2 == 'rock'\r\n return p1_won\r\n elsif p1 == 'rock' && p2 == 'scissors'\r\n return p1_won\r\n else\r\n return 'Player 2 won!'\r\n end\r\nend", "title": "" }, { "docid": "d033c2daf7f65adb65bf516f65dc368f", "score": "0.70536107", "text": "def winner?\n wins = [ # Here is all the possibilites to win\n [0, 1, 2], [3, 4, 5], [6, 7, 8], # <-- Horizontal wins\n [0, 3, 6], [1, 4, 7], [2, 5, 8], # <-- Vertical wins\n [0, 4, 8], [2, 4, 6], # <-- Diagonal wins\n ]\n if wins.any? { |win| win.all? {|a_case| @cases[a_case].value == 'o'}}\n @state = \"win\"\n\n return 1\n end\n if wins.any? { |win| win.all? {|a_case| @cases[a_case].value == 'x'}}\n @state = \"win\"\n return 2\n end\n end", "title": "" }, { "docid": "a6c65df0ea9bb4f1bb34cfee5cf5a426", "score": "0.7051181", "text": "def win?(first, second)\n WINNERS[first].include?(second)\nend", "title": "" }, { "docid": "c2f0cb8c4f8ca32551bfb2261ae48768", "score": "0.7047978", "text": "def score_counter(player, computer, score1, score2)\n if win?(player, computer)\n score1 << 1\n elsif win?(computer, player)\n score2 << 1\n end\nend", "title": "" }, { "docid": "3cbaa15a6a2697abc1b9a16b20a89fe7", "score": "0.7047486", "text": "def matches_played; wins + losses + draws end", "title": "" }, { "docid": "fa20567c6172f250a3483928bd70b175", "score": "0.7045717", "text": "def is_winner\n\t\twinner = false\n\t\tif @hits == 17\n\t\t\twinner == true\n\t\tend\n\t\treturn winner\n\tend", "title": "" }, { "docid": "cdd48092f88f47216286befd664a8dd9", "score": "0.7037237", "text": "def getWinner()\n if self.player1.lives > self.player2.lives\n puts \"#{self.player1.name} wins with a score of #{self.player1.lives}/3\"\n else\n puts \"#{self.player2.name} wins with a score of #{self.player2.lives}/3\"\n end\n end", "title": "" }, { "docid": "cdd48092f88f47216286befd664a8dd9", "score": "0.7037237", "text": "def getWinner()\n if self.player1.lives > self.player2.lives\n puts \"#{self.player1.name} wins with a score of #{self.player1.lives}/3\"\n else\n puts \"#{self.player2.name} wins with a score of #{self.player2.lives}/3\"\n end\n end", "title": "" }, { "docid": "60bdc68ae9987eae272fcc35b27e6edf", "score": "0.70352507", "text": "def tie? \n game_status(\"tie\")\n end", "title": "" }, { "docid": "4fdc753929029636deddc0c462d9aa55", "score": "0.70343316", "text": "def win player\n if winner = players[player]\n # returns nil if a player object named player isn't in this pair\n winner.score += 1\n self.winner = winner.name\n update_tiebreak\n end\n end", "title": "" }, { "docid": "06db86fe7d31f71217da37aaa34b1466", "score": "0.70293957", "text": "def add_win_to_score(winner)\n if winner == 1\n @player_1_score += 1\n elsif winner == 2\n @player_2_score += 1\n end\nend", "title": "" }, { "docid": "ca81f5676ca517e8f77b0927ca74557a", "score": "0.70290136", "text": "def win\n\t\tgame = Game.find(params[:id])\n\t\t@players = game.players.find(:all, :order => 'score desc')\n\t\t@winners = []\n\t\[email protected] do |player|\n\t\t\tif player.score == @players.first.score\n\t\t\t\twinner = player.user\n\t\t\t\twinner.win_count +=1\n\t\t\t\twinner.save!\n\t\t\t\t@winners << player\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "a1fba2d47661dbb44bbe7b9e13c113b1", "score": "0.70260274", "text": "def p2win(p1weapon, p2weapon)\n\treturn ((p2weapon == 'rock' and p1weapon == 'scissors') or (p2weapon == 'paper' and p1weapon == 'rock') or (p2weapon == 'scissors' and p1weapon == 'paper'))\nend", "title": "" }, { "docid": "3489d9575b54b40cc7073a06693667b4", "score": "0.7025984", "text": "def match_is_over\n sets[PLAYER_1] == 2 || sets[PLAYER_2] == 2\n end", "title": "" }, { "docid": "b97095e0bab0e19c78fe3cffa2f8a11e", "score": "0.7023619", "text": "def wins(opponent)\n opponent.hp <= 0 ? true : false\n end", "title": "" }, { "docid": "e7f096b353f77aa2401ff43ce1a2083f", "score": "0.700996", "text": "def player_won\n pwon = false\n (1..9).each do |a|\n (1..9).each do |b|\n if check_row(a, b, 2, 2, 2)\n pwon = true\n end\n end\n end\n pwon\n end", "title": "" }, { "docid": "7c60d8759b26b8e45121ad728549c1f7", "score": "0.7008093", "text": "def player_won\n pwon = false\n (1..9).each do |a|\n (1..9).each do |b|\n if @board.check_row(a, b, 2, 2, 2)\n pwon = true\n end\n end\n end\n pwon\n end", "title": "" }, { "docid": "1d36f4b377c7155e4716b7b79b1b8070", "score": "0.70062", "text": "def winner\n won?\n @winner\n end", "title": "" }, { "docid": "ae000732b1b0e21df94dbf0dc2972164", "score": "0.70037216", "text": "def winner\n return nil unless player_1_throw and player_2_throw\n return player_1 if player_1_throw.beats(player_2_throw)\n return player_2 if player_2_throw.beats(player_1_throw)\n nil\n end", "title": "" }, { "docid": "56291cb2217be2bf417b2bb9563b8f70", "score": "0.7002258", "text": "def outcome\n if player_wins?(p1_hand, cpu_hand) == true\n puts @details\n ask_for_rematch\n elsif cpu_wins?(p1_hand, cpu_hand) == true\n puts @details\n ask_for_rematch\n elsif tie\n tie_breaker\n ask_for_rematch\n else\n puts @details\n self.class.player_score += 1\n ask_for_rematch\n end\n end", "title": "" }, { "docid": "e70e68bbebe5f7d988cf1ea74ba39a0f", "score": "0.6993293", "text": "def winner(first, second)\n WHO_WINS[first].include?(second)\nend", "title": "" }, { "docid": "27d6ca0be82653ae4e28b632e9521cdb", "score": "0.6991414", "text": "def wins\n games.count(:conditions => { :win => true })\n end", "title": "" } ]
71f5f217872aa3038ff3f4dccc041abd
Based on assert_difference just checks using not_equal instead of a numeric difference so you can compare nonnumeric things
[ { "docid": "8f15a7ea58d814cb785b191d1ddea803", "score": "0.0", "text": "def assert_change(expressions, message = nil, &block)\n expressions = Array(expressions)\n\n exps = expressions.map { |e|\n e.respond_to?(:call) ? e : lambda { eval(e, block.binding) }\n }\n before = exps.map { |e| e.call }\n\n yield\n\n expressions.zip(exps).each_with_index do |(code, e), i|\n error = \"#{code.inspect} didn't change\"\n error = \"#{message}.\\n#{error}\" if message\n assert_not_equal(before[i], e.call, error)\n end\n end", "title": "" } ]
[ { "docid": "c514eb0345eb253a32f533249e483563", "score": "0.688172", "text": "def assert_no_difference(expression, &block)\n assert_difference expression, 0, &block\n end", "title": "" }, { "docid": "6e6905d2b85927ebcf7632f621e77e33", "score": "0.6865912", "text": "def assert_no_difference(expressions, message = nil, &block)\n assert_difference expressions, 0, message, &block\n end", "title": "" }, { "docid": "4eaa1702ca4c49082e1d38861f5de3d9", "score": "0.67520744", "text": "def assertNotEqualTest expected, value\n assertNotEqual expected, value\n end", "title": "" }, { "docid": "98654c369612f2c12fcee5ae226da581", "score": "0.66811776", "text": "def DISABLED_test_several_numbers\n assert_tokenises_as '1 -2 3. -4.0',\n IntegerToken.new(1),\n IntegerToken.new(-2),\n DecimalToken.new(3),\n DecimalToken.new(-4)\n end", "title": "" }, { "docid": "c1a67a93fb7951e96f8164440c49c796", "score": "0.66714406", "text": "def DISABLED_test_three_minus\n assert_does_not_parse [DecimalToken.new(3), SubtractOpToken.instance]\n end", "title": "" }, { "docid": "cc4dbc849dbaadc73c5b94098fc1996c", "score": "0.6663959", "text": "def test_numeric_and_string_comparison\n value1_ = ::Versionomy.create([1, 9, 2, 'a2'], :semver)\n value2_ = ::Versionomy.create([1, 9, 2], :semver)\n assert(value2_ > value1_)\n end", "title": "" }, { "docid": "62a3ef686049f24aa18b8427e200d1c9", "score": "0.6635502", "text": "def test_not_equal_to\n @t1 = DatelessTime.new \"15:45:10\"\n @t2 = DatelessTime.new \"10:30:00\"\n @t3 = DatelessTime.new \"15:45:10\"\n\n assert @t1 != @t2\n refute @t1 != @t3\n refute @t3 != @t1\n end", "title": "" }, { "docid": "62a3ef686049f24aa18b8427e200d1c9", "score": "0.6635502", "text": "def test_not_equal_to\n @t1 = DatelessTime.new \"15:45:10\"\n @t2 = DatelessTime.new \"10:30:00\"\n @t3 = DatelessTime.new \"15:45:10\"\n\n assert @t1 != @t2\n refute @t1 != @t3\n refute @t3 != @t1\n end", "title": "" }, { "docid": "ff48deeeb11c6c4d8f4877f6e541a21c", "score": "0.6591347", "text": "def test_neg_check_success\n assert_nil neg_check(['0', '0', '0']) # pass\n assert_nil neg_check(['0', '2', '3'])# pass\n end", "title": "" }, { "docid": "46653aca04fb2408b6dc5c8d046e7a82", "score": "0.6589555", "text": "def assert_no_difference(expressions, message = nil, &block)\n assert_difference expressions, 0, message, &block\n end", "title": "" }, { "docid": "3fcc6424ee7925b82f644831c9dd565b", "score": "0.6584226", "text": "def test_neg_check_fail\n assert_equal neg_check(['0', '-1', '0']), false # return false\n assert_equal neg_check(['0', '0', '-1']), false # return false\n assert_equal neg_check(['0', '-9', '-9']), false # return false\n end", "title": "" }, { "docid": "24748fd3c615670fe1f5f08260aa6e35", "score": "0.65761775", "text": "def DISABLED_test_decimals\n assert_tokenises_as '0.0', DecimalToken.new(0)\n assert_tokenises_as '1.', DecimalToken.new(1)\n assert_tokenises_as ' 3.14159', DecimalToken.new(3.14159)\n assert_tokenises_as '-2.0 ', DecimalToken.new(-2)\n end", "title": "" }, { "docid": "01ea8ec5691ae4b87763bf040a45a8fb", "score": "0.6552011", "text": "def assert_no_difference(expressions, message = nil, &block)\n message ||= \"Expected #{expressions} not to change but it did\"\n assert_difference(expressions, 0, message, &block)\n end", "title": "" }, { "docid": "c86083509a53235770ac796ff6aa9f65", "score": "0.6546646", "text": "def assert_difference(expression, difference = 1, message = nil, &block)\n expressions = Array(expression)\n\n exps = expressions.map { |e|\n e.respond_to?(:call) ? e : lambda { eval(e, block.binding) }\n }\n before = exps.map { |e| e.call }\n\n yield\n\n expressions.zip(exps).each_with_index do |(code, e), i|\n if message\n error = message\n else\n error = \"#{code.inspect} didn't change by #{difference}\"\n end\n assert_equal(before[i] + difference, e.call, error)\n end\n end", "title": "" }, { "docid": "f875faeb73323eeadae24e41a9f20f35", "score": "0.6537291", "text": "def test_numeric_comparison\n value1_ = ::Versionomy.create([1, 9, 2], :semver)\n value2_ = ::Versionomy.create([1, 9], :semver)\n assert(value2_ < value1_)\n value1_ = ::Versionomy.create([1, 9, 0], :semver)\n value2_ = ::Versionomy.create([1, 9], :semver)\n assert(value2_ == value1_)\n end", "title": "" }, { "docid": "94c9086a38f65173095d816e13b88237", "score": "0.652871", "text": "def assert_flequal(exp, actual, msg='')\r\n if exp == 0.0\r\n error = 1e-7\r\n else\r\n error = exp.abs/1e7\r\n end\r\n \r\n assert((exp - actual).abs < error, \r\n \"#{msg} Expected #{'%f' % exp} got #{'%f' % actual}\")\r\n end", "title": "" }, { "docid": "91fc120832c9ab8f5666d25fb9ac1785", "score": "0.64825124", "text": "def assert_difference(expressions, difference = 1, message = nil, &block)\n expression_evaluations = [expressions].flatten.collect{|expression| lambda { eval(expression, block.binding) } } \n \n original_values = expression_evaluations.inject([]) { |memo, expression| memo << expression.call }\n yield\n expression_evaluations.each_with_index do |expression, i|\n assert_equal original_values[i] + difference, expression.call, message\n end\n end", "title": "" }, { "docid": "86fac57c545ec6f488b7416df8d9f3f6", "score": "0.6478146", "text": "def test_numeric_comparison\n value1_ = ::Versionomy.create([1, 9, 2], :rubygems)\n value2_ = ::Versionomy.create([1, 9], :rubygems)\n assert(value2_ < value1_)\n value1_ = ::Versionomy.create([1, 9, 0], :rubygems)\n value2_ = ::Versionomy.create([1, 9], :rubygems)\n assert(value2_ == value1_)\n end", "title": "" }, { "docid": "084d2cb2a86732ceae2a298b429047db", "score": "0.6472043", "text": "def assertSimilar( expected, actual, errmsg=nil )\n\t\tif expected != ODE::Infinity && expected != -ODE::Infinity && expected.kind_of?( Float )\n\t\t\tassert_in_delta expected, actual, Tolerance, errmsg\n\t\telsif expected.is_a?( Class )\n\t\t\tassert_instance_of expected, actual\n\t\telse\n\t\t\tassert_equal expected, actual, errmsg\n\t\tend\n\tend", "title": "" }, { "docid": "701408ca1904b5be22a6abf80adb3a1c", "score": "0.64642614", "text": "def assert_no_difference(object, method, &block)\n assert_difference object, method, 0, &block\n end", "title": "" }, { "docid": "fcc54379b6cf2ec3397e4f275d6f2b45", "score": "0.6445512", "text": "def test_numeric_and_string_comparison\n value1_ = ::Versionomy.create([1, 9, 2, 'a', 2], :rubygems)\n value2_ = ::Versionomy.create([1, 9, 2, 1], :rubygems)\n assert(value2_ > value1_)\n end", "title": "" }, { "docid": "ff209bcc2244fb7a3fdbf8b63b885a71", "score": "0.64171517", "text": "def assert_not_same(expected, actual, message=\"\")\n msg = message(msg) { build_message(message, <<EOT, expected, expected.__id__, actual, actual.__id__) }\n<?>\nwith id <?> expected to not be equal\\\\? to\n<?>\nwith id <?>.\nEOT\n assert(!actual.equal?(expected), msg)\n end", "title": "" }, { "docid": "197f1304f2ecf0fcbadfe3a974384db6", "score": "0.64029425", "text": "def test_regexp_number_negative\n @numbers.each do |value, expected|\n # add auto negative values\n value = value.is_a?(String) ? '-' + value : value * -1\n expected = expected == '0' ? expected : '-' + expected\n\n assert_equal expected, @TS_Regexp.format(value)\n end\n end", "title": "" }, { "docid": "cb879a1d30c9cdb55723ca0f0374ee71", "score": "0.64014244", "text": "def DISABLED_test_decimal_minus_sequence\n assert_tokenises_as '2.-2.0', DecimalToken.new(2), SubtractOpToken.instance, DecimalToken.new(2)\n assert_tokenises_as '2.0--2.', DecimalToken.new(2), SubtractOpToken.instance, DecimalToken.new(-2)\n end", "title": "" }, { "docid": "abd1d2849fdcee8321d118e63b674179", "score": "0.6386221", "text": "def assertNotEqualFailTest expected, value\n rescue_assertion ASSERT_NOT_EQUAL_ERROR do\n assertNotEqual expected, value\n end\n end", "title": "" }, { "docid": "e31d927938e257c31865635b02add784", "score": "0.6376035", "text": "def test_rec_number_negative\n @numbers.each do |value, expected|\n # add auto negative values\n value = value.is_a?(String) ? '-' + value : value * -1\n expected = expected == '0' ? expected : '-' + expected\n\n assert_equal expected, @TS_Rec.format(value)\n end\n end", "title": "" }, { "docid": "f58b9b5561c70fcc51785d07d0c131d5", "score": "0.63503057", "text": "def test_less_than_3_equal_chars\n\t\tassert_equal(false,compare('1234','1325'))\n\tend", "title": "" }, { "docid": "8607c8badfddcec649bd389aca2500a6", "score": "0.63178957", "text": "def test_subtracts_numbers\n result = @calculator.subtracts(10, 4)\n expected = 6\n assert_equal expected, result\n end", "title": "" }, { "docid": "91148eb86dcd305e3738ee46b5803f2e", "score": "0.6282368", "text": "def assert_not_equals(actual, expected, msg = nil, options = nil)\n if actual == expected\n msg = msg ? msg + ' - ' : ''\n message = \"#{msg}Not expected: #{actual.inspect}\"\n Test.expect(false, message)\n end\n end", "title": "" }, { "docid": "9a01869b6c955ad74366ecdef9952e67", "score": "0.62539226", "text": "def assert_not_same(exp, act, msg=nil)\n test = ! exp.equal?(act)\n msg = \"Expected #{act.inspect} to not be the same as #{exp.inspect}\" unless msg\n __assert__(test, msg)\n end", "title": "" }, { "docid": "4fbaf17cd41b777a460d6196328be6f4", "score": "0.62493104", "text": "def assertNotEqualWithMessageTest expected, value, message\n assertNotEqual expected, value, message\n end", "title": "" }, { "docid": "8d1a3be2d6b5c376853e7630224d4411", "score": "0.6217424", "text": "def test_negative_float\n\n @values_positive_float.each { |x|\n assert_in_delta(Math::log(x), ln(x))\n }\n\n end", "title": "" }, { "docid": "56b4895057d9101ce299d8df71c80110", "score": "0.62111545", "text": "def verifyEqual(exp_val,act_val)\n assert_equal(exp_val, act_val,\"Wrong value Expected #{exp_val} Actual #{act_val}\")\n end", "title": "" }, { "docid": "30967200cf9d52cc4205417fb1741ac6", "score": "0.6187535", "text": "def must_almost_equals(expected, actual)\n case expected\n when nil\n true\n when Array\n unless actual.instance_of?(Array)\n raise ComparisonError, \"Inconsistent type: expected type of #{expected}: Array, actual type of #{actual}: #{actual.class}\"\n end\n unless expected.size == actual.size\n raise ComparisonError, \"Different size of arrays: expected size of #{expected}: #{expected.size}, actual size of #{actual}: #{actual.size}\"\n end\n\n expected.to_enum.with_index.each do |e, i|\n begin\n must_almost_equals(e, actual[i])\n rescue ComparisonError => e\n raise ComparisonError, \"Different value of #{i}-th element of array\"\n end\n end\n when Hash\n # Note: It is OK when `actual` has additional entries.\n unless actual.instance_of?(Hash)\n raise ComparisonError, \"Incensistent type: expected type of #{expected}: Hash, actual type of #{actual}: #{actual.class}\"\n end\n\n expected.each do |k, v|\n begin\n unless actual.include?(k)\n raise ComparisonError, \"Missing key `#{k}` in actual: #{actual}\"\n end\n must_almost_equals(v, actual[k])\n rescue ComparisonError => e\n if not e.cause.nil? and e.cause.message.match(/^Missing key `#{k}`/)\n raise e\n end\n raise ComparisonError, \"Different value for `#{k}`\"\n end\n end\n else\n unless expected == actual\n raise ComparisonError, \"Comparison failed: #{expected} == #{actual}\"\n end\n end\nend", "title": "" }, { "docid": "4f0352c74e5fa911fcb3b7b9a9315829", "score": "0.6181052", "text": "def test_not_same_value_as\n #G\n white_pair = PAIR_OF_4\n black_value = VALUE_2\n\n #W\n result = white_pair.same_value? black_value\n\n #T\n assert_false result\n end", "title": "" }, { "docid": "5cc93ecd3e485f1066aadd5ea76f26fe", "score": "0.6175293", "text": "def assert(actual, expected)\n\traise \"actual: #{actual}, expected: #{expected}\" unless expected == actual\nend", "title": "" }, { "docid": "d12aca186236abe478b9744541e8255d", "score": "0.6170517", "text": "def assert(expected, output)\n left = expected.to_s.gsub(/\\s+/, ' ').gsub(/>\\s+</, '><').strip\n right = output.to_s.gsub(/\\s+/, ' ').gsub(/>\\s+</, '><').strip\n nodiff = left.scan(/./).sort == right.scan(/./).sort\n unless ( nodiff )\n puts \"\\nERROR in comparaison\\n\"\n puts \"EXPECTED : #{left}\"\n puts \"RETURNED : #{right}\"\n end\n nodiff.should == true\n end", "title": "" }, { "docid": "88db0ad6ec58ab6a633cb9402ef3b66d", "score": "0.6170177", "text": "def test_array_number_negative\n @numbers.each do |value, expected|\n # add auto negative values\n value = value.is_a?(String) ? '-' + value : value * -1\n expected = expected == '0' ? expected : '-' + expected\n\n assert_equal expected, @TS_Array.format(value)\n end\n end", "title": "" }, { "docid": "5e99b817dff215492a714dc17072836e", "score": "0.6168791", "text": "def test_numeric\n assert_instance_of(Numeric, value)\nend", "title": "" }, { "docid": "7eed9264566adbcbf0167af3fc506296", "score": "0.6150633", "text": "def assert_dom_not_equal(expected, actual, message = nil, strict: false, html_version: nil)\n expected_dom, actual_dom = fragment(expected, html_version: html_version), fragment(actual, html_version: html_version)\n message ||= \"Expected: #{expected}\\nActual: #{actual}\"\n assert_not compare_doms(expected_dom, actual_dom, strict), message\n end", "title": "" }, { "docid": "b0154e9d9d2a647ebcf7192d3e181869", "score": "0.6134239", "text": "def values_sndiff_equal?(bav, pav)\n bav == pav || string_numeric_diff_ignored? && bav.is_a?(String) && pav.is_a?(Numeric) && to_number_or_nil(bav) == pav\n end", "title": "" }, { "docid": "7898d76b9f835b50a4cd1583a19c8511", "score": "0.61196184", "text": "def assertSimilar( expected, actual, errmsg=nil )\n\t\tif expected != ODE::Infinity && expected.kind_of?( Float )\n\t\t\tassert_in_delta expected, actual, Tolerance, errmsg\n\t\telsif expected.is_a?( Array )\n\t\t\tassert_kind_of Array, actual\n\t\t\tassert_equal expected.length, actual.length\n\n\t\t\t# Recurse for each value\n\t\t\texpected.each_index {|i| assertSimilar(expected[i], actual[i], errmsg)}\n\t\telsif expected.is_a?( ODE::Vector )\n\t\t\tassert actual.similarTo?( expected ),\n\t\t\t\t\"#{actual.inspect} was not similar to #{expected.inspect}\"\n\t\telse\n\t\t\tassert_equal expected, actual, errmsg\n\t\tend\n\tend", "title": "" }, { "docid": "ead5339d727b8c2b6883ed8085c151a5", "score": "0.61073095", "text": "def assert_difference(objects, method = nil, difference = 1)\n objects = [objects].flatten\n initial_values = objects.inject([]) { |sum,obj| sum << obj.send(method) }\n yield\n if difference.nil?\n objects.each_with_index { |obj,i|\n assert_not_equal initial_values[i], obj.send(method), \"#{obj}##{method}\"\n }\n else\n objects.each_with_index { |obj,i|\n assert_equal initial_values[i] + difference, obj.send(method), \"#{obj}##{method}\"\n }\n end\n end", "title": "" }, { "docid": "4b63a849e2d602560ca15a381a87b3a6", "score": "0.6100087", "text": "def test_lessercomparison\n b_plus = Grade.new(\"B+\")\n a = Grade.new(\"A\")\n assert (b_plus < a) # should return true\n end", "title": "" }, { "docid": "869a3331b70e0c824fde5515b8128e10", "score": "0.6091938", "text": "def assert_equal(expected, actual)\n raise \"Expected #{expected} to match #{actual}\" unless expected == actual\nend", "title": "" }, { "docid": "f10c183a25a1ca75cf683343ec93fed1", "score": "0.6089887", "text": "def test_is_nummeric\n assert(StringChecker.is_numeric?(\"+20\"))\n assert(StringChecker.is_numeric?(\"-020\"))\n assert(StringChecker.is_numeric?(\"123\"))\n assert(StringChecker.is_numeric?(\"0123\"))\n assert(!StringChecker.is_numeric?(\"1.2\"))\n assert(!StringChecker.is_numeric?(\"asdf\"))\n assert(!StringChecker.is_numeric?(\" \"))\n end", "title": "" }, { "docid": "daf11a88d0bbd17a257f75caad215631", "score": "0.60870427", "text": "def assert_not_equal(exp, act, msg=nil)\n msg = message(msg) { \"<#{mu_pp(exp)}> expected to be != to\\n<#{mu_pp(act)}>\" }\n assert(exp != act, msg)\n end", "title": "" }, { "docid": "3aaa6230217de6fe0d16ecc95bc62bbb", "score": "0.6086371", "text": "def test_should_not_currency_of_same_amount_and_code\n currency1 = Currency.new(\"USD\", 1.0)\n currency2 = Currency.new(\"USD\", 5.0)\n refute_equal currency2, currency1\n end", "title": "" }, { "docid": "f5b5a7516aae222fb2923a6ddfeff000", "score": "0.6084103", "text": "def assert_equalish(x, y, delta=0.1)\n assert_in_delta(x, y, delta)\n end", "title": "" }, { "docid": "49009566220a5eb5af71a6104b83e226", "score": "0.60700685", "text": "def test_extended\r\n\t\tassert('two'.length == 3)\t\t\t\t\t\t# Boolean expression\r\n\t\tassert_not_equal(\"Expected\", \"Actual\")\t\t\t# != \r\n\t\tassert_raise(ZeroDivisionError) { 2/0} \t\t\t# Exception type\r\n\t\tassert_nothing_raised(ZeroDivisionError) { 2/1 }# Positive if the none of the exceptions raised\r\n\t\tassert_instance_of(String, 23) \t\t\t\t# Checks the object against its type\r\n\tend", "title": "" }, { "docid": "718ea9d4ce785b03a4a97e3e8bd99a4a", "score": "0.60672575", "text": "def assert_same_elements(expected, actual, message = '')\n if expected.nil? && actual.nil?\n return\n end\n if !expected.nil? && actual.nil?\n flunk \"#{message}\\n Expected #{expected} but was nil\"\n elseif expected.nil? && !actual.nil?\n flunk \"#{message}\\n Expected nil but was #{actual}\"\n end\n _expected = expected\n if !_expected.is_a?(Set)\n _expected = Set.new(_expected)\n end\n _actual = actual\n if !_actual.is_a?(Set)\n _actual = Set.new(_actual)\n end\n difference = _expected.difference(_actual)\n if !difference.empty?\n if expected.empty?\n expected_message = \"[]\"\n else\n expected_message = expected.to_a.join(', ')\n end\n if actual.empty?\n actual_message = \"[]\"\n else\n actual_message = actual.to_a.join(', ')\n end\n flunk \"#{message}\\n Expected \\n#{expected_message} but was \\n#{actual_message}.\\ Difference: #{difference.to_a.join(', ')}\"\n end\n end", "title": "" }, { "docid": "c92d70ef0165510aa47b200bd4a67420", "score": "0.60619104", "text": "def test_subtracts_numbers\n\t\tassert_equal 6, subtract(10, 4)\n\tend", "title": "" }, { "docid": "5bd2b923efe1eae19b3c00214fc69396", "score": "0.6042135", "text": "def DISABLED_test_decimal_exponent_sequence\n assert_tokenises_as '2.^2.0', DecimalToken.new(2), ExponentOpToken.instance, DecimalToken.new(2)\n assert_tokenises_as '2.0^-2.', DecimalToken.new(2), ExponentOpToken.instance, DecimalToken.new(-2)\n end", "title": "" }, { "docid": "7d8c6af7c19377f396ea9e41969ab60c", "score": "0.6041849", "text": "def assert_dom_not_equal(expected, actual, message=\"\")\n clean_backtrace do\n expected_dom = HTML::Document.new(expected).root\n actual_dom = HTML::Document.new(actual).root\n full_message = build_message(message, \"<?> expected to be != to\\n<?>.\", expected_dom.to_s, actual_dom.to_s)\n assert_block(full_message) { expected_dom != actual_dom }\n end\n end", "title": "" }, { "docid": "e535a5f923d3d7ac36264224b4163385", "score": "0.6038082", "text": "def assert_numeric(att, error = [att, :not_numeric])\n if assert_present(att, error)\n assert_format(att, /\\A\\-?\\d+\\z/, error)\n end\n end", "title": "" }, { "docid": "5e9fe02a3592ab83d39f0aca067e2382", "score": "0.6037851", "text": "def test_num_check_pass\n assert_nil num_check(['1', '1', '1']) # pass\n assert_nil num_check(['k', 'k', 'k']) # pass\n end", "title": "" }, { "docid": "a4ee08797a986fd7a4152d55b39dbf26", "score": "0.6033496", "text": "def test_more_than_one_variable\n assert_equal(20,minus(80,40,20))\t\n end", "title": "" }, { "docid": "225efd0e9b1ad21398d12886cbdd6d69", "score": "0.60229385", "text": "def diff_to_compare; end", "title": "" }, { "docid": "370167f26a1f3f4a33a1d04a94954fe3", "score": "0.6020783", "text": "def assert_not_equal(exp, act, msg=nil)\n EqualityFailure.refute(act, exp, :message=>msg, :backtrace=>caller)\n end", "title": "" }, { "docid": "86fa1c70855aaaf45eb50da2c2d7c548", "score": "0.6013312", "text": "def refute_cmp(expect, actual)\n actual = rspec_expect actual\n expect = cmp expect\n\n assert_raises RSpec::Expectations::ExpectationNotMetError do\n actual.to expect\n end\n end", "title": "" }, { "docid": "c9f1f5aa473b2d6e094e05c780d0fd86", "score": "0.5998613", "text": "def test_num_check_fail\n assert_equal num_check([]), false # pass\n assert_equal num_check(['1']), false # pass\n assert_equal num_check(['1', '1']), false # pass\n assert_equal num_check(['k', 'k', 'k', 'k']), false # pass\n end", "title": "" }, { "docid": "be82c81060f782fea34f841d1537c25f", "score": "0.59958124", "text": "def test_negative_integer\n\n @values_negative_integer.each { |x|\n assert_raises RangeError do\n ln(x)\n end\n }\n\n end", "title": "" }, { "docid": "27267777d0af2b793fe92a1120feee35", "score": "0.59796315", "text": "def test_num_transactions_correct_not_0_true\n assert @bv.num_transactions_correct?(1, [0,2,3])\n end", "title": "" }, { "docid": "8dc6905152c05c3310f6422a368c2988", "score": "0.59728795", "text": "def test_numeric\n assert_equal(true, RpnCalc.new.numeric?('0'))\n assert_equal(true, RpnCalc.new.numeric?('0.0'))\n assert_equal(true, RpnCalc.new.numeric?('-0'))\n assert_equal(true, RpnCalc.new.numeric?('-0.0'))\n assert_equal(false, RpnCalc.new.numeric?('A'))\n assert_equal(false, RpnCalc.new.numeric?('-E'))\n assert_equal(false, RpnCalc.new.numeric?(nil))\n end", "title": "" }, { "docid": "24d4a26b1d7c78437a0e16b6234e87d2", "score": "0.59706724", "text": "def assert_equal( expected, obtained, msg = nil )\n unless expected == obtained\n fail \"*** assert_equal( #{expected.inspect}, #{obtained.inspect}, #{msg} )\"\n end\nend", "title": "" }, { "docid": "9ae63c75fac21ac2cb8ad0caf8091e94", "score": "0.5969557", "text": "def assertNotEqualWithMessageFailTest expected, value, message\n rescue_assertion ASSERT_NOT_EQUAL_ERROR, message do\n assertNotEqual expected, value, message\n end\n end", "title": "" }, { "docid": "88deba9c3d307cb53f1b28a8aac1499b", "score": "0.5961975", "text": "def DISABLED_test_decimal_plus_sequence\n assert_tokenises_as '2.+2.0', DecimalToken.new(2), AddOpToken.instance, DecimalToken.new(2)\n assert_tokenises_as '2.0+-2.', DecimalToken.new(2), AddOpToken.instance, DecimalToken.new(-2)\n end", "title": "" }, { "docid": "ee78276bc2756cb00c1e669282603862", "score": "0.5954614", "text": "def assert_difference(object, method = :count, difference = 1)\n initial_value = object.send(method)\n yield\n assert_equal initial_value + difference, object.send(method), \"#{object}##{method}\"\n end", "title": "" }, { "docid": "ef06d57efa4b733d71a27520f46d1e65", "score": "0.59543806", "text": "def test_num10\n result = numbers?(\"ryaNStantz**\")\n refute(result, \"'ryaNStantz**' should not be valid because it does not contain a number\")\n end", "title": "" }, { "docid": "bad4fde8be3faca739bb41d4db1c10b1", "score": "0.5949746", "text": "def assert_not_equal(exp, act, msg=nil)\n test = (exp != act)\n msg = \"Expected #{act.inspect} to not be equal to #{exp.inspect}\" unless msg\n __assert__(test, msg)\n end", "title": "" }, { "docid": "550a347eecadfa99b71fdd1d7b282f4e", "score": "0.59427", "text": "def DISABLED_test_single_decimal\n assert_parses_to [DecimalToken.new(-1)],\n ExpressionNode.new(\n TermNode.new(\n FactorNode.new(\n BaseNode.new(\n DecimalToken.new(-1))),\n TermPrimeNode.new),\n ExpressionPrimeNode.new)\n end", "title": "" }, { "docid": "ed190e6649bf29cc1e33e79e1920cf48", "score": "0.5934374", "text": "def test_kind_of_value\n assert_kind_of(Numeric, value)\nend", "title": "" }, { "docid": "6787f96e00a91c66d4ab2cc87b58b9ea", "score": "0.5931304", "text": "def test_positive_float_out_of_range\n\n @values_positive_float_out_of_range.each { |x|\n assert_raises RangeError do\n ln(x)\n end\n }\n\n end", "title": "" }, { "docid": "82b3f62ca0823922912570adecedd43b", "score": "0.59214926", "text": "def DISABLED_test_subtraction_with_addition\n assert_parses_to [DecimalToken.new(0), SubtractOpToken.instance, IntegerToken.new(2), AddOpToken.instance, DecimalToken.new(3)],\n ExpressionNode.new(\n TermNode.new(\n FactorNode.new(\n BaseNode.new(\n DecimalToken.new(0))),\n TermPrimeNode.new),\n ExpressionPrimeNode.new(\n SubtractOpToken.instance,\n TermNode.new(\n FactorNode.new(\n BaseNode.new(\n IntegerToken.new(2))),\n TermPrimeNode.new),\n ExpressionPrimeNode.new(\n AddOpToken.instance,\n TermNode.new(\n FactorNode.new(\n BaseNode.new(\n DecimalToken.new(3))),\n TermPrimeNode.new),\n ExpressionPrimeNode.new)))\n end", "title": "" }, { "docid": "3b9dde08e02992cdc507c7b170c0f4ab", "score": "0.59119934", "text": "def test_greatercomparison\n a_plus = Grade.new(\"A+\")\n a = Grade.new(\"A\")\n assert (a_plus > a) # should return true\n end", "title": "" }, { "docid": "7a1f1ad036d3242db4689dc05829ae4b", "score": "0.5910838", "text": "def test_compare_arrays_disagreement\n @expected_enum = ('a'..'e').to_a\n @actual_enum = ('a'..'d').to_a + ['z']\n\n assert_enumerable_mismatch(\n message: [\n missing_value_message('[4]', 'e'),\n spurious_value_message('[4]', 'z')\n ].join(\"\\n\")\n )\n end", "title": "" }, { "docid": "68bad516fda959eacd72c9ae833e35a3", "score": "0.59068257", "text": "def assert_equal(actual, expected)\n\tif actual == expected\n\t\tputs \"pass\"\n\telse\n\t\tputs \"fail\"\nend\n \nassert_equal(1,1) #=> pass\nassert_equal(2,1) #=> fail\n \n# Use assert to test the following:\n \n# define a method to sum the values of an array. Make this method defend against nils and\n# other errors\n \ndef sum(numbers)\n\tresult = 0\n\tnumbers.collect do |i|\n\tresult += i if i.is_a? Integer\n\tend\n\tresult\nend\n \nassert_equal sum([]), 0\nassert_equal sum([1,2]), 3\nassert_equal sum([1,nil,2]), 3\nassert_equal sum([1, \"2\", 2]), 3\n \n# define a method that returns comfortable for temps between 60-80, cold for below and hot\n# for above.\n \ndef temperature_bot(temp)\n\tif temp >=60 && temp <=80\n\t\tputs \"comfortable\"\n\telsif temp < 60\n\t\tputs \"cold\"\n\telse\n\t\tputs \"hot\"\n\tend\nend\n \nassert_equal temperature_bot(65), \"comfortable\"\nassert_equal temperature_bot(70), \"comfortable\"\nassert_equal temperature_bot(85), \"hot\"\nassert_equal temperature_bot(30), \"cold\"\n \n# define an object, Person, that has a birthdate and a name. Define a method for a person\n# that returns their age.\n\nclass Person\n\tattr_accessor :birthday, :name\n\n\tdef age\n\t\tbirth_year = @birthday.split(\"/\").last.to_i\n\t\tTime.now.year - birth_year\n\tend\nend\n\n\nbegin\n person = Person.new\n person.name = \"Alan Turing\"\n person.birthday = \"06/23/1912\"\n \n assert_equal person.name, \"Alan Turing\"\n assert_equal person.birthday, \"06/23/1912\"\n assert_equal person.age, 101\n \nrescue => e\n puts \"Fail: #{e}\"\nend", "title": "" }, { "docid": "a28d3f5a1797ed99d6f1d3f3f096f6eb", "score": "0.5904785", "text": "def xml_should_eql(actual, expected)\n same = xml_cmp(actual, expected)\n actual.should.== expected unless same \nend", "title": "" }, { "docid": "04697c026aa28cd8d378d2215c3fbc3c", "score": "0.58963084", "text": "def assert_cmp(expect, actual)\n # expect(Account.new.balance).to eq(Money.new(0))\n # => expect(actual).to cmp expect\n\n actual = rspec_expect actual\n expect = cmp expect\n\n assert_operator actual, :to, expect\n end", "title": "" }, { "docid": "4b677d33e2fa765e56a0d9045d191a2e", "score": "0.58898026", "text": "def test_greaterequalcomparison\n a_plus = Grade.new(\"A+\")\n a = Grade.new(\"A\")\n assert (a_plus >= a) # should return true\n end", "title": "" }, { "docid": "cb1b9811eae48dcca8c68294ee7832ec", "score": "0.5878399", "text": "def assertLessThanFailTest lesser, value\n rescue_assertion ASSERT_LESSTHAN_ERROR do\n assertLessThan lesser, value\n end\n end", "title": "" }, { "docid": "1e1e172161b3036303018c74aa1cbaca", "score": "0.58758074", "text": "def test_pair_is_not_equal_w_string\n pair = PairType.new(key: 'xxx', value: 9)\n assert_false pair == 'string'\n end", "title": "" }, { "docid": "0cbaaa53d81d11ff83d633cdd941cb4a", "score": "0.58754545", "text": "def test_a_character_class_can_be_negated\n assert_equal 'the number is ', \"the number is 42\"[/[^0-9]+/]\n end", "title": "" }, { "docid": "b82d6ccd76ad97f91c084a6c0796e609", "score": "0.5865452", "text": "def test_check_digits_lower_bound\r\n assert_nil @g.check_digits('0123456789/')\r\n end", "title": "" }, { "docid": "a431046b3a6fd851eb6439cdd69a634a", "score": "0.58641845", "text": "def assert(expected, output)\n left = expected.to_s.gsub(/\\s+/, ' ').gsub(/>\\s+</, '><').strip\n right = output.to_s.gsub(/\\s+/, ' ').gsub(/>\\s+</, '><').strip\n left.scan(/./).sort.should == right.scan(/./).sort\n#\n# unless left == right\n# puts \"\", \"Expected:\"\n# puts left\n# puts tidy(left)\n# puts \"\", \"Got:\"\n# puts right\n# puts tidy(right)\n# puts\n# end\n# left.should == right\n end", "title": "" }, { "docid": "3ac8b18f89b5b4894feb37189e958a47", "score": "0.5837105", "text": "def test_equality(expected, actual)\n \tif expected == actual\n \t\tputs \"pass :):):)\"\n \telse\n \t\tputs \"fail :(:(:(\"\n\tend\nend", "title": "" }, { "docid": "0679ff8ecc76aab9e647ba1534fb2bc7", "score": "0.58167344", "text": "def subtract(*number)\n test_array = []\n number.each do |n|\n if (n.class != Fixnum) && (n.class != Float)\n test_array.push(false)\n end\n end\n if test_array.length > 0\n return false\n else\n number.inject do |minuend, subtrahend|\n (minuend - subtrahend).round(2)\n end\n end\nend", "title": "" }, { "docid": "1257dcd6c631e8901d29d0d61c3285c3", "score": "0.5815603", "text": "def test_positive_integer\n\n @values_positive_integer.each { |x|\n assert_in_delta(Math::log(x), ln(x))\n }\n\n end", "title": "" }, { "docid": "92ca19e9bd6ce5f266c1c1b506119f86", "score": "0.58097404", "text": "def test_loop_number_negative\n @numbers.each do |value, expected|\n # add auto negative values\n value = value.is_a?(String) ? '-' + value : value * -1\n expected = expected == '0' ? expected : '-' + expected\n\n assert_equal expected, @TS_Loop.format(value)\n end\n end", "title": "" }, { "docid": "f9c4307e30e1ca7f5231d3bd0836754f", "score": "0.58068204", "text": "def test_comparison_advanced\n assert_equal(0, @nested1 <=> @nested2)\n assert_equal(1, @nested3 <=> @nested1)\n assert_equal(-1, @nested1 <=> @nested3)\n\n assert_equal(0, [1] <=> [1.000])\n assert_equal(-1, [1] <=> [1.001])\n assert_equal(1, [1] <=> [0.999])\n end", "title": "" }, { "docid": "01a28eb24c66c9a50277a0d3804fff81", "score": "0.58036274", "text": "def check_numericity\n check_patterns(@income.to_s)\n check_patterns(@age.to_s)\n end", "title": "" }, { "docid": "fc9180bff4cd4579ec95b1dec700cf7f", "score": "0.58014566", "text": "def test_convert_currency_one_to_two\n #AGAIN....test passes if it doesn't work\n assert_raises ArgumentError do \n @apples_to_oranges.convert_currency_one_to_two\n end\n\n @converted_value = @apples_to_oranges.convert_currency_one_to_two(@amount)\n @expected_value = @amount*@apples_to_oranges.conversion_rate\n\n # This test will pass if it is right!\n assert_equal @expected_value, @converted_value\n end", "title": "" }, { "docid": "ee58253c0b8907f9a22e0f5da05cd72d", "score": "0.5790804", "text": "def test_less_than_equal\n 3.should <= 5\n end", "title": "" }, { "docid": "7ab5684bd5650a09821b9bd6a861e8dc", "score": "0.57905674", "text": "def test_check_invalid_prospectors\n assert_equal check_valid([2, 0, 1]), [1, nil, nil, nil]\n end", "title": "" }, { "docid": "d6fdaaee8d92c1dda3637ec2dd98922c", "score": "0.57878697", "text": "def xml_should_be_same(expected, actual)\n expected = Hpricot(expected)\n actual = Hpricot(actual)\n \n blame = \"\\n\\n#################### expected\\n#{expected.to_html}\\n\\n\" \"#################### actual:\\n#{actual.to_html}\\n\\n\" \n (xml_cmp(expected, actual)).should.blaming(blame).equal true\nend", "title": "" }, { "docid": "282276700291f5465ec4450a9b0eff96", "score": "0.5781543", "text": "def test_non_numeric_times\n v = Verify.new\n return_code = v.verify_fourth_pipeset('123.2s1', '123.12')\n assert_equal 1, return_code\n end", "title": "" }, { "docid": "5c882c397a1f813d1603e03c506701d7", "score": "0.577813", "text": "def test_check_digits_true\r\n assert_equal true, @g.check_digits('0123456789')\r\n end", "title": "" }, { "docid": "41adccb772b3ba884d999cd0b2b61d06", "score": "0.57739025", "text": "def not_equal(input_a, input_b, name: nil)\n input_a, input_b = check_data_types(input_a, input_b)\n _op(:not_equal, input_a, input_b, name: name)\n end", "title": "" }, { "docid": "f95ebb5881f1050c2ea07b27e26eb530", "score": "0.57736415", "text": "def DISABLED_test_decimal_divide_sequence\n assert_tokenises_as '2./2.0', DecimalToken.new(2), DivideOpToken.instance, DecimalToken.new(2)\n assert_tokenises_as '2.0/-2.', DecimalToken.new(2), DivideOpToken.instance, DecimalToken.new(-2)\n end", "title": "" }, { "docid": "e42ea5b001a499639a30b9ec64e9a7e5", "score": "0.5771667", "text": "def assert_decreases(objects, methods_and_args = :count, difference = 1, &block)\n assert_difference(objects, methods_and_args, -difference, &block)\n end", "title": "" }, { "docid": "a0a22b33d89dbf6d6a66d3ed93d1be66", "score": "0.57657653", "text": "def test_rec_number_positive\n @numbers.each do |value, expected|\n assert_equal expected, @TS_Rec.format(value)\n end\n end", "title": "" } ]
e49ba28f6731dbe583c16d38e2079417
Generate seed data with the POCDriver.
[ { "docid": "0c1e5e239a24cbce658158ae4cc1e78a", "score": "0.542991", "text": "def seed(connections, rebuilt, options)\n return if !options[:force] && !rebuilt && File.exists?(\".seeded-#{connections}\")\n\n exec!(\"mongo --host #{options[:host]} --port #{options[:port]} --eval #{DROP_DB}\", 'unable to clear old data from database')\n exec!(\"rm -f .seeded-*\", 'unable to clean up metadata files')\n poc!(\"-i 100 -u 0 -k 0 -b 10 -t #{connections} -d 60 -j 5 \"\\\n \"--threadIdStart=0 -c mongodb://#{options[:host]}:#{options[:port]}/?maxPoolSize=10000 2>&1 \"\\\n \"| tee seed-#{connections}.log\",\n 'unable to generate seed data')\n\n exec!(\"touch .seeded-#{connections}\", 'unable to create metadata')\nend", "title": "" } ]
[ { "docid": "3d8f562c5e7c4ada7ab4a866439dc6a0", "score": "0.6897159", "text": "def seed_data()\n self.seed_client_stylist\n self.seed_offering_assignment\n self.seed_date_maker\n end", "title": "" }, { "docid": "ed07a8a9880b819819271a009061e305", "score": "0.6455074", "text": "def db_seed\n file = File.dirname(__FILE__) + \"/../data/data.csv\"\n\n (1..11).each do |i|\n CSV.open(file, \"ab\") do |csv|\n csv << [i, Faker::Company.name, Faker::Commerce.product_name, Faker::Commerce.price]\n end\n end\nend", "title": "" }, { "docid": "80c6ec8c7904b53f51bb82db58821670", "score": "0.6454586", "text": "def db_seed\n @data_path = File.dirname(__FILE__) + \"/../data/data.csv\"\n CSV.open(@data_path, \"ab\") do |csv|\n 10.times do |i|\n csv << [i, Faker::Commerce.department, Faker::Commerce.product_name, Faker::Commerce.price]\n end\n end\nend", "title": "" }, { "docid": "0873733430cc54bffe5c851995212e4c", "score": "0.6435804", "text": "def seed_data\n # Don't log the output of seeding the db\n silence_warnings { load_or_raise(Apartment.seed_data_file) } if Apartment.seed_data_file\n end", "title": "" }, { "docid": "83bce2ed1154e28c6a8965a0808d3d4b", "score": "0.6381483", "text": "def db_seed\n\tprices = [\"2.13\", \"14.52\", \"2.16\", \"99.99\", \"19.99\"] \n\n\t10.times do\n # you will write the \"create\" method as part of your project\n \t\tProduct.create( brand: Faker::Company.name, \n name: Faker::Commerce.product_name, \n price: prices.sample )\n\tend\nend", "title": "" }, { "docid": "f1cf83e8ddc7bdd9d6deac3c6121a1cc", "score": "0.63756204", "text": "def db_seed\n @data_path = File.dirname(__FILE__) + \"/../data/data.csv\"\n CSV.open(@data_path, \"a+\") do |csv|\n x = 0\n 10.times do\n csv << [x, Faker::Company.name, Faker::Commerce.product_name, Faker::Commerce.price]\n x += 1\n end\n end\nend", "title": "" }, { "docid": "44c163b2dec159462ee6fc7103643724", "score": "0.63137186", "text": "def db_seed\n 100.times do\n\tProduct.create( brand: Faker::Company.name, \n name: Faker::Commerce.product_name, \n price: Faker::Commerce.price)\n\tend\nend", "title": "" }, { "docid": "55df58f320b714815e135bb78a0c2ca9", "score": "0.6295032", "text": "def db_seed\n product_names =[]\n prices=[]\n brands=[]\n10.times do\n product_names << Faker::Commerce.product_name\n prices << Faker::Commerce.price\n brands << Faker::Company.name\n end\n 50.times do\n # you will write the \"create\" method as part of your project\n Product.create( brand: brands.sample,\n name: product_names.sample,\n price: prices.sample )\n end\n end", "title": "" }, { "docid": "f3ff10acecad9e6fc8aecc694811d6b0", "score": "0.6258427", "text": "def db_seed\n brands = []\n product_names = []\n prices = []\n\n 5.times do\n brands << Faker::Commerce.department\n product_names << Faker::Commerce.product_name\n prices << Faker::Commerce.price\n end\n\n 10.times do\n Product.create(\n brand: brands.sample,\n name: product_names.sample,\n price: prices.sample\n )\n end\nend", "title": "" }, { "docid": "8665f309076cf18e568f8352d04ac227", "score": "0.62580985", "text": "def db_seed\n # Your code goes here!\n\n @csv_path = File.dirname(__FILE__) + \"/../data/data.csv\"\n CSV.open(@csv_path, 'ab') do |csv|\n\n 10.times do |id|\n # you will write the \"create\" method as part of your project\n csv<<[id, Faker::Commerce.department(2, true),\n Faker::Commerce.product_name,\n Faker::Commerce.price ]\n end\n end\nend", "title": "" }, { "docid": "1c56c0361703e1309c5291e9e5908a0c", "score": "0.6257229", "text": "def db_seed\n data_path = File.dirname(__FILE__) + \"/../data/data.csv\"\n\n products = []\n 10.times do |id|\n brand = Faker::Company.name\n product = Faker::Commerce.product_name\n price = Faker::Commerce.price\n products.push(Product.create(brand: brand, name: product, price: price))\n #CSV.open(data_path, \"ab\") do |csv|\n # csv << [id+1, brand.to_s, product.to_s, price.to_s]\n #end\n end\nend", "title": "" }, { "docid": "eb59dd7a963cb25b2213160280e31189", "score": "0.62135804", "text": "def db_seed\n product_names = []\n brands = []\n 10.times do\n product_names << Faker::Commerce.product_name\n brands << Faker::Commerce.department\n end\n\n\n\n prices = [\"2.01\", \"14.51\", \"2.11\", \"99.99\", \"19.99\"] \n\n 10.times do\n # you will write the \"create\" method as part of your project\n Product.create( brand: brands.sample, \n name: product_names.sample, \n price: prices.sample )\n end\nend", "title": "" }, { "docid": "87ccf5499a8b0867930a5f7f2958bb63", "score": "0.6194482", "text": "def setup_seed_data\n clear_old_files\n move_test_script_files\n\n # setup other elements required for autotesting\n create_marking_scheme\n create_criteria\n create_submission\n process_schema_data\n end", "title": "" }, { "docid": "eea4070bd9e3a0471a7c2cd5ebfbb151", "score": "0.61190313", "text": "def seed_base_data\n data = CSV.read('./db/data_for_challenge.csv', { headers: true })\n hashed_data = data.map { |d| d.to_hash }\n\n hashed_data.each do |d|\n region = Region.find_or_create_by(zipcode: d['zipcode'])\n d.delete('zipcode')\n\n property = Property.create(\n accomodates: d['accomodates'],\n bedrooms: d['bedrooms'] || 0,\n region: region,\n )\n\n puts \"**** Creating Property #{property.id} ***\"\n\n d.delete('accomodates')\n d.delete('bedrooms')\n d.delete('property_id') # assuming data is already in an auto increment format\n\n d.each do |date, status|\n # if status is of a price format, then make status available, and provide the\n # correct price\n date = Date.strptime(date, '%m/%d/%y') unless date.nil?\n price = nil\n\n if status.to_i.to_s == status\n price = status.to_i\n status = 'booked'\n end\n\n PropertyAvailability.create(\n date: date,\n price: price,\n status: status,\n property: property,\n )\n\n puts \"**** Creating PropertyAvailability for #{property.id} ***\"\n end\n end\nend", "title": "" }, { "docid": "43d85267d6358dfbe04a98e75812f218", "score": "0.61161906", "text": "def db_seed\n# Create 10 new Product objects, and save them to the \n# database\n\t10.times do\n\t Product.create( brand: Faker::Company.name, \n\t name: Faker::Commerce.product_name, \n\t price: Faker::Commerce.price)\n\tend\t\nend", "title": "" }, { "docid": "55cd4433cc4f2c71ff3dc4f16cfe059b", "score": "0.6105946", "text": "def db_seed\n\t20.times do\n\t\tProduct.create(brand: \"#{Faker::Company.name} #{Faker::Company.suffix}\", name: Faker::Commerce.product_name, price: rand(5.1...99.9))\n\tend\nend", "title": "" }, { "docid": "815e5cef5b477f9d4cbb01f1c5b6b5e1", "score": "0.605942", "text": "def seed; end", "title": "" }, { "docid": "815e5cef5b477f9d4cbb01f1c5b6b5e1", "score": "0.605942", "text": "def seed; end", "title": "" }, { "docid": "815e5cef5b477f9d4cbb01f1c5b6b5e1", "score": "0.605942", "text": "def seed; end", "title": "" }, { "docid": "b4ef602f8f064546f4faaa4669576f65", "score": "0.5967591", "text": "def seed_data\n silence_stream(STDOUT){ load_or_abort(\"#{Rails.root}/db/seeds.rb\") } # Don't log the output of seeding the db\n end", "title": "" }, { "docid": "e48d746fdc787e8bfae2128d2e4d37cd", "score": "0.58916587", "text": "def seed\n\t\t\t@seed ||= load_yaml('config/seed.yml', :dir => 'db')\n\t\tend", "title": "" }, { "docid": "0365d79acd4a087fbc6582c54607f2a1", "score": "0.5851977", "text": "def seed\n records = @model_class.transaction do\n @data.map { |record_data| seed_record(record_data.symbolize_keys) }\n end\n update_id_sequence\n records\n end", "title": "" }, { "docid": "d4a3bf9758d59ef62fa80d3342f54e6f", "score": "0.5834798", "text": "def load_seed; end", "title": "" }, { "docid": "87d7d8be6e4bb0129231a19ed22c785e", "score": "0.58274114", "text": "def db_seed # tests run noticeably slower since adding this\n 10.times do # repetitions increased to 15, as having only 5 causes destroyed object return test to fail\n Product.create( brand: Faker::Company.name,\n name: Faker::Commerce.product_name,\n price: Faker::Commerce.price )\n\tend\nend", "title": "" }, { "docid": "2ed5cd2a8ceed7a280bfd17719e69c74", "score": "0.5811809", "text": "def _generate_1_0_data\n pe_conf = {}\n ns = \"puppet_enterprise\"\n\n master = the_host_with_role('master')\n puppetdb = the_host_with_role('database')\n console = the_host_with_role('dashboard')\n\n pe_conf[\"#{ns}::puppet_master_host\"] = master.hostname\n\n # Monolithic installs now only require the puppet_master_host, so only\n # pass in the console and puppetdb host if it is a split install\n if [master, puppetdb, console].uniq.length != 1\n pe_conf[\"#{ns}::console_host\"] = console.hostname\n pe_conf[\"#{ns}::puppetdb_host\"] = puppetdb.hostname\n end\n\n if the_host_with_role('pe_postgres', raise_error=false)\n pe_conf[\"#{ns}::database_host\"] = the_host_with_role('pe_postgres', raise_error=false).hostname\n if options[:pe_postgresql_options]\n if options[:pe_postgresql_options][:security] == 'cert'\n postgres_cert_answers(pe_conf, '1.0')\n elsif options[:pe_postgresql_options][:security] == 'password'\n postgres_password_answers(pe_conf, '1.0')\n end\n else\n postgres_cert_answers(pe_conf, '1.0')\n end\n end\n\n pe_conf\n end", "title": "" }, { "docid": "f3f6a3ddeef1120120b8eff4d63190e6", "score": "0.5810843", "text": "def db_seed\n brands = []\n 10.times do |id|\n brand = Faker::Company.name\n name = Faker::Commerce.product_name\n price = Faker::Commerce.price.to_f\n Product.create(brand: brand, name: name, price: price)\n end\nend", "title": "" }, { "docid": "0a04dab35a8765d0e342c652eacd9374", "score": "0.57966155", "text": "def insert_random_data\n 10.times do\n insert_cmd = <<-SQ\n INSERT INTO traveler(name, age, email, job, birthplace, passport_active) VALUES (?, ?, ?, ?, ?, ?);\n SQ\n $db.execute(insert_cmd, [Faker::Name.name, Faker::Number.between(30, 70), Faker::Internet.email, Faker::Commerce.department, Faker::Address.country, Faker::Boolean.boolean.to_s])\n end\n end", "title": "" }, { "docid": "e9d187d8beb02a3aedf4db4a206237bb", "score": "0.57732064", "text": "def seed_sletba_open\n load \"#{Rails.root}/db/seeds/test/sletba_open.seeds.rb\"\n end", "title": "" }, { "docid": "4e8177a1adbf6f8b367db828145b902f", "score": "0.5737745", "text": "def db_seed\n\n\tProduct.clean\n\n 30.times do\n names = Faker::Commerce.product_name\n brands = Faker::Company.name\n prices = Faker::Commerce.price\n Product.create(\tname: names, \n \t\t\t\tbrand: brands, \n \t\t\t\tprice: prices)\n end\n\nend", "title": "" }, { "docid": "cce235878e5a3ac564d8f00c6b6ec177", "score": "0.5722235", "text": "def populate_data\n \n person_util = PersonPopulateUtil.new\n @users.each do |u|\n \n puts \"createing caretaker #{u}\"\n caretaker = person_util.create_caretaker(u)\n @patients.times do |p|\n \n patient = person_util.create_patient(caretaker[:person])\n parent = person_util.create_parent(patient)\n people = {:caretaker => caretaker, :patient => patient, :parent => parent}\n puts \"patient created - #{patient.firstname}\"\n \n if @surveys.length > 0\n survey_util = SurveyPopulateUtil.new(@surveys)\n @surveys.length.times do |t|\n survey_util.create_requests({:people => people, :number => @number_of_surveys, :survey_id => t+1})\n end\n end\n\n if @entry_sets > 0\n entry_set_util = EntrySetPopulateUtil.new\n @entry_sets.times do |e|\n if e == 2\n entry_set_util.create_entry_set_request(people,e,false)\n else\n entry_set_util.create_entry_set_request(people,e)\n end\n end\n end\n \n end\n end \n end", "title": "" }, { "docid": "8725ce29974d7f980b2025f4e271d6b6", "score": "0.57185405", "text": "def seed\n\t\t\t@seed ||= load_hash 'seed/seed_da.yml'\n\t\tend", "title": "" }, { "docid": "6d6ce17e4de0fae2503eac724243a192", "score": "0.5710679", "text": "def load_seed_data\n db[:categories].insert(name: 'english').tap do |id|\n db[:tasks].insert category_id: id,\n name: 'one',\n priority: 1,\n due_date: Date.new(2015)\n db[:tasks].insert category_id: id,\n name: 'two',\n priority: 2,\n due_date: Date.new(2015, 2)\n end\n db[:categories].insert(name: 'spanish').tap do |id|\n db[:tasks].insert category_id: id,\n name: 'uno',\n priority: 1,\n due_date: Date.new(2015)\n db[:tasks].insert category_id: id,\n name: 'dos',\n priority: 2,\n due_date: Date.new(2015, 2)\n end\n end", "title": "" }, { "docid": "fbf81066e87f242a3a8f7e87b8a43ffa", "score": "0.570467", "text": "def populate ; end", "title": "" }, { "docid": "7df8f16ac912ca22d3ffdebc4abaa059", "score": "0.5702871", "text": "def load_seed_data\n bullet\n print \" Loading seed data\".green\n load \"db/seeds/deployment/001_app_setting_types.rb\"\n load \"db/seeds/deployment/002_app_setting_options.rb\"\n load \"db/seeds/deployment/003_app_setting_dependencies.rb\"\n load \"db/seeds/deployment/010_app_label_pages.rb\"\n load \"db/seeds/deployment/011_app_label_dictionaries.rb\"\n load \"db/seeds/deployment/015_user_roles.rb\"\n load \"db/seeds/deployment/030_event_registration_statuses.rb\"\n step_complete\nend", "title": "" }, { "docid": "9855a03432075616c27a0899611a18c0", "score": "0.56877494", "text": "def seed_individual_pda()\n\n begin\n\n # individual seed data sets\n ind_pda_1 = {\"county\" => \"Allegheny\",\n \"municipality_name\" => \"Mt Oliver Boro\",\n \"pda_date\" => \"03/18/2017\",\n \"incident_type\" => \"subsidence\", # flood, tornado, subsidence, fire\n \"page\" => \"1\",\n \"total_pages\" => \"1\",\n \"pda_team_hlo\" => \"\", # need clarification on valid value here\n \"af_own_single\" => \"1\",\n \"af_own_multi\" => \"0\",\n \"af_own_mob\" => \"0\",\n \"af_own_p_fl_ins\" => \"0\",\n \"af_own_p_ho_ins\" => \"0\",\n \"af_own_p_lo_inc\" => \"0\",\n \"af_own_num_inac\" => \"1\",\n \"af_rent_single\" => \"0\",\n \"af_rent_multi\" => \"0\",\n \"af_rent_mob\" => \"0\",\n \"af_rent_p_fl_ins\" => \"0\",\n \"af_rent_p_ho_ins\" => \"0\",\n \"af_rent_p_lo_inc\" => \"0\",\n \"af_rent_num_inac\" => \"0\",\n \"af_sec_single\" => \"0\",\n \"af_sec_multi\" => \"0\",\n \"af_sec_mob\" => \"0\",\n \"mn_own_single\" => \"0\",\n \"mn_own_multi\" => \"0\",\n \"mn_own_mob\" => \"0\",\n \"mn_own_p_fl_ins\" => \"0\",\n \"mn_own_p_ho_ins\" => \"0\",\n \"mn_own_p_lo_inc\" => \"0\",\n \"mn_own_num_inac\" => \"0\",\n \"mn_rent_single\" => \"0\",\n \"mn_rent_multi\" => \"0\",\n \"mn_rent_mob\" => \"0\",\n \"mn_rent_p_fl_ins\" => \"0\",\n \"mn_rent_p_ho_ins\" => \"0\",\n \"mn_rent_p_lo_inc\" => \"0\",\n \"mn_rent_num_inac\" => \"0\",\n \"mn_sec_single\" => \"0\",\n \"mn_sec_multi\" => \"0\",\n \"mn_sec_mob\" => \"0\",\n \"mj_own_single\" => \"0\",\n \"mj_own_multi\" => \"0\",\n \"mj_own_mob\" => \"0\",\n \"mj_own_p_fl_ins\" => \"0\",\n \"mj_own_p_ho_ins\" => \"0\",\n \"mj_own_p_lo_inc\" => \"0\",\n \"mj_own_num_inac\" => \"0\",\n \"mj_rent_single\" => \"0\",\n \"mj_rent_multi\" => \"0\",\n \"mj_rent_mob\" => \"0\",\n \"mj_rent_p_fl_ins\" => \"0\",\n \"mj_rent_p_ho_ins\" => \"0\",\n \"mj_rent_p_lo_inc\" => \"0\",\n \"mj_rent_num_inac\" => \"0\",\n \"mj_sec_single\" => \"0\",\n \"mj_sec_multi\" => \"0\",\n \"mj_sec_mob\" => \"0\",\n \"d_own_single\" => \"0\",\n \"d_own_multi\" => \"0\",\n \"d_own_mob\" => \"0\",\n \"d_own_p_fl_ins\" => \"0\",\n \"d_own_p_ho_ins\" => \"0\",\n \"d_own_p_lo_inc\" => \"0\",\n \"d_own_num_inac\" => \"0\",\n \"d_rent_single\" => \"0\",\n \"d_rent_multi\" => \"0\",\n \"d_rent_mob\" => \"0\",\n \"d_rent_p_fl_ins\" => \"0\",\n \"d_rent_p_ho_ins\" => \"0\",\n \"d_rent_p_lo_inc\" => \"0\",\n \"d_rent_num_inac\" => \"0\",\n \"d_sec_single\" => \"0\",\n \"d_sec_multi\" => \"0\",\n \"d_sec_mob\" => \"0\",\n \"roads_bridges_damaged\" => \"1\",\n \"households_impacted\" => \"1\",\n \"households_no_utilities\" => \"0\",\n \"comments\" => \"10' wide sinkhole at Lacrosse St near 2117 Lacrosse St\"}\n\n ind_pda_2 = {\"county\" => \"Allegheny\",\n \"municipality_name\" => \"Mt Oliver Boro\",\n \"pda_date\" => \"03/18/2017\",\n \"incident_type\" => \"flood\", # flood, tornado, subsidence, fire\n \"page\" => \"1\",\n \"total_pages\" => \"1\",\n \"pda_team_hlo\" => \"\", # need clarification on valid value here\n \"af_own_single\" => \"9\",\n \"af_own_multi\" => \"3\",\n \"af_own_mob\" => \"0\",\n \"af_own_p_fl_ins\" => \"25\",\n \"af_own_p_ho_ins\" => \"75\",\n \"af_own_p_lo_inc\" => \"25\",\n \"af_own_num_inac\" => \"2\",\n \"af_rent_single\" => \"0\",\n \"af_rent_multi\" => \"4\",\n \"af_rent_mob\" => \"0\",\n \"af_rent_p_fl_ins\" => \"0\",\n \"af_rent_p_ho_ins\" => \"50\",\n \"af_rent_p_lo_inc\" => \"75\",\n \"af_rent_num_inac\" => \"1\",\n \"af_sec_single\" => \"0\",\n \"af_sec_multi\" => \"0\",\n \"af_sec_mob\" => \"0\",\n \"mn_own_single\" => \"3\",\n \"mn_own_multi\" => \"0\",\n \"mn_own_mob\" => \"0\",\n \"mn_own_p_fl_ins\" => \"100\",\n \"mn_own_p_ho_ins\" => \"100\",\n \"mn_own_p_lo_inc\" => \"0\",\n \"mn_own_num_inac\" => \"3\",\n \"mn_rent_single\" => \"0\",\n \"mn_rent_multi\" => \"1\",\n \"mn_rent_mob\" => \"0\",\n \"mn_rent_p_fl_ins\" => \"0\",\n \"mn_rent_p_ho_ins\" => \"100\",\n \"mn_rent_p_lo_inc\" => \"100\",\n \"mn_rent_num_inac\" => \"1\",\n \"mn_sec_single\" => \"0\",\n \"mn_sec_multi\" => \"0\",\n \"mn_sec_mob\" => \"0\",\n \"mj_own_single\" => \"2\",\n \"mj_own_multi\" => \"0\",\n \"mj_own_mob\" => \"0\",\n \"mj_own_p_fl_ins\" => \"50\",\n \"mj_own_p_ho_ins\" => \"100\",\n \"mj_own_p_lo_inc\" => \"0\",\n \"mj_own_num_inac\" => \"2\",\n \"mj_rent_single\" => \"0\",\n \"mj_rent_multi\" => \"0\",\n \"mj_rent_mob\" => \"0\",\n \"mj_rent_p_fl_ins\" => \"0\",\n \"mj_rent_p_ho_ins\" => \"0\",\n \"mj_rent_p_lo_inc\" => \"0\",\n \"mj_rent_num_inac\" => \"0\",\n \"mj_sec_single\" => \"0\",\n \"mj_sec_multi\" => \"0\",\n \"mj_sec_mob\" => \"0\",\n \"d_own_single\" => \"0\",\n \"d_own_multi\" => \"0\",\n \"d_own_mob\" => \"0\",\n \"d_own_p_fl_ins\" => \"0\",\n \"d_own_p_ho_ins\" => \"0\",\n \"d_own_p_lo_inc\" => \"0\",\n \"d_own_num_inac\" => \"0\",\n \"d_rent_single\" => \"0\",\n \"d_rent_multi\" => \"0\",\n \"d_rent_mob\" => \"0\",\n \"d_rent_p_fl_ins\" => \"0\",\n \"d_rent_p_ho_ins\" => \"0\",\n \"d_rent_p_lo_inc\" => \"0\",\n \"d_rent_num_inac\" => \"0\",\n \"d_sec_single\" => \"0\",\n \"d_sec_multi\" => \"0\",\n \"d_sec_mob\" => \"0\",\n \"roads_bridges_damaged\" => \"1\",\n \"households_impacted\" => \"40\",\n \"households_no_utilities\" => \"10\",\n \"est_date_utility_restore\" => \"03/25/2017\",\n \"comments\" => \"Preliminary data - will need to assess further to determine entire scope.\"}\n\n # aggregate user data into multi-dimensional array for iteration\n ind_pda_forms = []\n ind_pda_forms.push(ind_pda_1, ind_pda_2)\n\n # connect to the database\n db_params = { # AWS db\n host: ENV['host'],\n port:ENV['port'],\n dbname:ENV['dbname'],\n user:ENV['dbuser'],\n password:ENV['dbpassword']\n }\n # db_params = { # local db\n # dbname:ENV['dbname'],\n # user:ENV['dbuser'],\n # password:ENV['dbpassword']\n # }\n conn = PG::Connection.new(db_params)\n\n # determine current max index (id) in details table\n max_id = conn.exec(\"select max(id) from common\")[0]\n\n # set index variable based on current max index value\n max_id[\"max\"] == nil ? v_id = 1 : v_id = max_id[\"max\"].to_i + 1\n\n # iterate through multi-dimensional users array for data\n ind_pda_forms.each do |form|\n\n # initialize variables for SQL insert statements (common table)\n v_county = form[\"county\"]\n v_municipality_name = form[\"municipality_name\"]\n\n # prepare SQL statement to insert common individual form fields into common table\n conn.prepare('q_statement',\n \"insert into common\n (id, county, municipality_name)\n values($1, $2, $3)\") # bind parameters\n\n # execute prepared SQL statement\n conn.exec_prepared('q_statement', [v_id, v_county, v_municipality_name])\n\n # deallocate prepared statement variable (avoid error \"prepared statement already exists\")\n conn.exec(\"deallocate q_statement\")\n\n # initialize variables for SQL insert statements (ind_pda table)\n v_pda_date = form[\"pda_date\"]\n v_incident_type = form[\"incident_type\"]\n v_page = form[\"page\"]\n v_total_pages = form[\"total_pages\"]\n v_pda_team_fema = form[\"pda_team_fema\"]\n v_pda_team_state = form[\"pda_team_state\"]\n v_pda_team_sba = form[\"pda_team_sba\"]\n v_pda_team_hlo = form[\"pda_team_hlo\"]\n v_af_own_single = form[\"af_own_single\"]\n v_af_own_multi = form[\"af_own_multi\"]\n v_af_own_mob = form[\"af_own_mob\"]\n v_af_own_p_fl_ins = form[\"af_own_p_fl_ins\"]\n v_af_own_p_ho_ins = form[\"af_own_p_ho_ins\"]\n v_af_own_p_lo_inc = form[\"af_own_p_lo_inc\"]\n v_af_own_num_inac = form[\"af_own_num_inac\"]\n v_af_rent_single = form[\"af_rent_single\"]\n v_af_rent_multi = form[\"af_rent_multi\"]\n v_af_rent_mob = form[\"af_rent_mob\"]\n v_af_rent_p_fl_ins = form[\"af_rent_p_fl_ins\"]\n v_af_rent_p_ho_ins = form[\"af_rent_p_ho_ins\"]\n v_af_rent_p_lo_inc = form[\"af_rent_p_lo_inc\"]\n v_af_rent_num_inac = form[\"af_rent_num_inac\"]\n v_af_sec_single = form[\"af_sec_single\"]\n v_af_sec_multi = form[\"af_sec_multi\"]\n v_af_sec_mob = form[\"af_sec_mob\"]\n v_mn_own_single = form[\"mn_own_single\"]\n v_mn_own_multi = form[\"mn_own_multi\"]\n v_mn_own_mob = form[\"mn_own_mob\"]\n v_mn_own_p_fl_ins = form[\"mn_own_p_fl_ins\"]\n v_mn_own_p_ho_ins = form[\"mn_own_p_ho_ins\"]\n v_mn_own_p_lo_inc = form[\"mn_own_p_lo_inc\"]\n v_mn_own_num_inac = form[\"mn_own_num_inac\"]\n v_mn_rent_single = form[\"mn_rent_single\"]\n v_mn_rent_multi = form[\"mn_rent_multi\"]\n v_mn_rent_mob = form[\"mn_rent_mob\"]\n v_mn_rent_p_fl_ins = form[\"mn_rent_p_fl_ins\"]\n v_mn_rent_p_ho_ins = form[\"mn_rent_p_ho_ins\"]\n v_mn_rent_p_lo_inc = form[\"mn_rent_p_lo_inc\"]\n v_mn_rent_num_inac = form[\"mn_rent_num_inac\"]\n v_mn_sec_single = form[\"mn_sec_single\"]\n v_mn_sec_multi = form[\"mn_sec_multi\"]\n v_mn_sec_mob = form[\"mn_sec_mob\"]\n v_mj_own_single = form[\"mj_own_single\"]\n v_mj_own_multi = form[\"mj_own_multi\"]\n v_mj_own_mob = form[\"mj_own_mob\"]\n v_mj_own_p_fl_ins = form[\"mj_own_p_fl_ins\"]\n v_mj_own_p_ho_ins = form[\"mj_own_p_ho_ins\"]\n v_mj_own_p_lo_inc = form[\"mj_own_p_lo_inc\"]\n v_mj_own_num_inac = form[\"mj_own_num_inac\"]\n v_mj_rent_single = form[\"mj_rent_single\"]\n v_mj_rent_multi = form[\"mj_rent_multi\"]\n v_mj_rent_mob = form[\"mj_rent_mob\"]\n v_mj_rent_p_fl_ins = form[\"mj_rent_p_fl_ins\"]\n v_mj_rent_p_ho_ins = form[\"mj_rent_p_ho_ins\"]\n v_mj_rent_p_lo_inc = form[\"mj_rent_p_lo_inc\"]\n v_mj_rent_num_inac = form[\"mj_rent_num_inac\"]\n v_mj_sec_single = form[\"mj_sec_single\"]\n v_mj_sec_multi = form[\"mj_sec_multi\"]\n v_mj_sec_mob = form[\"mj_sec_mob\"]\n v_d_own_single = form[\"d_own_single\"]\n v_d_own_multi = form[\"d_own_multi\"]\n v_d_own_mob = form[\"d_own_mob\"]\n v_d_own_p_fl_ins = form[\"d_own_p_fl_ins\"]\n v_d_own_p_ho_ins = form[\"d_own_p_ho_ins\"]\n v_d_own_p_lo_inc = form[\"d_own_p_lo_inc\"]\n v_d_own_num_inac = form[\"d_own_num_inac\"]\n v_d_rent_single = form[\"d_rent_single\"]\n v_d_rent_multi = form[\"d_rent_multi\"]\n v_d_rent_mob = form[\"d_rent_mob\"]\n v_d_rent_p_fl_ins = form[\"d_rent_p_fl_ins\"]\n v_d_rent_p_ho_ins = form[\"d_rent_p_ho_ins\"]\n v_d_rent_p_lo_inc = form[\"d_rent_p_lo_inc\"]\n v_d_rent_num_inac = form[\"d_rent_num_inac\"]\n v_d_sec_single = form[\"d_sec_single\"]\n v_d_sec_multi = form[\"d_sec_multi\"]\n v_d_sec_mob = form[\"d_sec_mob\"]\n v_roads_bridges_damaged = form[\"roads_bridges_damaged\"]\n v_households_impacted = form[\"households_impacted\"]\n v_households_no_utilities = form[\"households_no_utilities\"]\n v_est_date_utility_restore = form[\"est_date_utility_restore\"]\n v_comments = form[\"comments\"]\n\n # prepare SQL statement to insert unique individual form fields into ind_pda table\n conn.prepare('q_statement',\n \"insert into ind_pda (id, common_id, pda_date, incident_type,\n page, total_pages, pda_team_fema, pda_team_state,\n pda_team_sba, pda_team_hlo, af_own_single, af_own_multi,\n af_own_mob, af_own_p_fl_ins, af_own_p_ho_ins, af_own_p_lo_inc,\n af_own_num_inac, af_rent_single, af_rent_multi, af_rent_mob,\n af_rent_p_fl_ins, af_rent_p_ho_ins, af_rent_p_lo_inc, af_rent_num_inac,\n af_sec_single, af_sec_multi, af_sec_mob, mn_own_single,\n mn_own_multi, mn_own_mob, mn_own_p_fl_ins, mn_own_p_ho_ins,\n mn_own_p_lo_inc, mn_own_num_inac, mn_rent_single, mn_rent_multi,\n mn_rent_mob, mn_rent_p_fl_ins, mn_rent_p_ho_ins, mn_rent_p_lo_inc,\n mn_rent_num_inac, mn_sec_single, mn_sec_multi, mn_sec_mob,\n mj_own_single, mj_own_multi, mj_own_mob, mj_own_p_fl_ins,\n mj_own_p_ho_ins, mj_own_p_lo_inc, mj_own_num_inac, mj_rent_single,\n mj_rent_multi, mj_rent_mob, mj_rent_p_fl_ins, mj_rent_p_ho_ins,\n mj_rent_p_lo_inc, mj_rent_num_inac, mj_sec_single, mj_sec_multi,\n mj_sec_mob, d_own_single, d_own_multi, d_own_mob,\n d_own_p_fl_ins, d_own_p_ho_ins, d_own_p_lo_inc, d_own_num_inac,\n d_rent_single, d_rent_multi, d_rent_mob, d_rent_p_fl_ins,\n d_rent_p_ho_ins, d_rent_p_lo_inc, d_rent_num_inac, d_sec_single,\n d_sec_multi, d_sec_mob, roads_bridges_damaged, households_impacted,\n households_no_utilities, est_date_utility_restore, comments)\n values($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14,\n $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27,\n $28, $29, $30, $31, $32, $33, $34, $35, $36, $37, $38, $39, $40,\n $41, $42, $43, $44, $45, $46, $47, $48, $49, $50, $51, $52, $53,\n $54, $55, $56, $57, $58, $59, $60, $61, $62, $63, $64, $65, $66,\n $67, $68, $69, $70, $71, $72, $73, $74, $75, $76, $77, $78, $79,\n $80, $81, $82, $83)\")\n\n # execute prepared SQL statement\n conn.exec_prepared('q_statement', [v_id, v_id, v_pda_date, v_incident_type,\n v_page, v_total_pages, v_pda_team_fema, v_pda_team_state,\n v_pda_team_sba, v_pda_team_hlo, v_af_own_single, v_af_own_multi,\n v_af_own_mob, v_af_own_p_fl_ins, v_af_own_p_ho_ins, v_af_own_p_lo_inc,\n v_af_own_num_inac, v_af_rent_single, v_af_rent_multi, v_af_rent_mob,\n v_af_rent_p_fl_ins, v_af_rent_p_ho_ins, v_af_rent_p_lo_inc, v_af_rent_num_inac,\n v_af_sec_single, v_af_sec_multi, v_af_sec_mob, v_mn_own_single,\n v_mn_own_multi, v_mn_own_mob, v_mn_own_p_fl_ins, v_mn_own_p_ho_ins,\n v_mn_own_p_lo_inc, v_mn_own_num_inac, v_mn_rent_single, v_mn_rent_multi,\n v_mn_rent_mob, v_mn_rent_p_fl_ins, v_mn_rent_p_ho_ins, v_mn_rent_p_lo_inc,\n v_mn_rent_num_inac, v_mn_sec_single, v_mn_sec_multi, v_mn_sec_mob,\n v_mj_own_single, v_mj_own_multi, v_mj_own_mob, v_mj_own_p_fl_ins,\n v_mj_own_p_ho_ins, v_mj_own_p_lo_inc, v_mj_own_num_inac, v_mj_rent_single,\n v_mj_rent_multi, v_mj_rent_mob, v_mj_rent_p_fl_ins, v_mj_rent_p_ho_ins,\n v_mj_rent_p_lo_inc, v_mj_rent_num_inac, v_mj_sec_single, v_mj_sec_multi,\n v_mj_sec_mob, v_d_own_single, v_d_own_multi, v_d_own_mob,\n v_d_own_p_fl_ins, v_d_own_p_ho_ins, v_d_own_p_lo_inc, v_d_own_num_inac,\n v_d_rent_single, v_d_rent_multi, v_d_rent_mob, v_d_rent_p_fl_ins,\n v_d_rent_p_ho_ins, v_d_rent_p_lo_inc, v_d_rent_num_inac, v_d_sec_single,\n v_d_sec_multi, v_d_sec_mob, v_roads_bridges_damaged, v_households_impacted,\n v_households_no_utilities, v_est_date_utility_restore, v_comments])\n\n # deallocate prepared statement variable (avoid error \"prepared statement already exists\")\n conn.exec(\"deallocate q_statement\")\n\n # increment index value for next iteration\n v_id += 1\n\n end\n\n rescue PG::Error => e\n\n puts 'Exception occurred'\n puts e.message\n\n ensure\n\n conn.close if conn\n\n end\n\nend", "title": "" }, { "docid": "41f47590e530ef76124ad376eada75f8", "score": "0.5681296", "text": "def setup_test_data\n @tenant = create_tenant\n @account = create_account(@tenant)\n @account2 = create_account(@tenant)\n @bundle = create_bundle(@account, @tenant)\n @bundle_invoice = @account.invoices(true, build_options(@tenant)).first\n @payment_method = create_payment_method(true, @account, @tenant)\n @invoice_item = create_charge(@account, @tenant)\n @cba = create_cba(@invoice_item.invoice_id, @account, @tenant)\n @paid_invoice_item = create_charge(@account, @tenant)\n @payment = create_payment(@paid_invoice_item, @account, @tenant)\n\n KillBillClient.api_key = @tenant.api_key\n KillBillClient.api_secret = @tenant.api_secret\n KillBillClient.username = USERNAME\n KillBillClient.password = PASSWORD\n end", "title": "" }, { "docid": "6acbabaacdc9ee2bece04d7b9701c2f3", "score": "0.5669194", "text": "def setup\n clear_db\n\n @url = Wgit::Url.new(DatabaseTestData.url)\n @doc = Wgit::Document.new(DatabaseTestData.doc)\n\n @urls = Array.new(3) { Wgit::Url.new(DatabaseTestData.url) }\n @docs = Array.new(3) { Wgit::Document.new(DatabaseTestData.doc) }\n end", "title": "" }, { "docid": "a56fbf50ee75be4c0f8c498e44a8ddfc", "score": "0.5667921", "text": "def seed_from_web\n @file = File.open('db/'+STORED_SEEDS, \"w\") if SAVE_TO_FILE # Destination file for saving\n seed_teams # HoopScrape::NbaTeamList => Teams\n Team.all.each do |team|\n process_schedules(team) # HoopScrape::NbaSchedule => Games\n process_roster(team) # HoopScrape::NbaRoster => Players\n end\n seed_gamestats # HoopScrape::NbaBoxscore => Gamestats\n @file.close if SAVE_TO_FILE\n end", "title": "" }, { "docid": "d5e1f244b43b404f79391940a154fd6d", "score": "0.56668055", "text": "def seed\n @people[1] = Person.new(\"Seshu\", \"Adunuthula\", 1)\n @people[2] = Person.new(\"Vasu\", \"Adunuthula\", 2)\n @people[3] = Person.new(\"Seshu\", \"Mohan\", 3)\n end", "title": "" }, { "docid": "3cbd11b817a84b4aa522c08a295043d0", "score": "0.56444764", "text": "def setup\n dump_database\n collection_fixtures('records', '_id')\n collection_fixtures('health_data_standards_svs_value_sets', '_id')\n collection_fixtures('measures')\n end", "title": "" }, { "docid": "96185cfbbbe6a1289fa3d5896df0ab97", "score": "0.56351113", "text": "def seed!\n create_vbms_ext_claims_with_no_end_product_establishment\n create_in_sync_epes_and_vbms_ext_claims\n create_out_of_sync_epes_and_vbms_ext_claims\n end", "title": "" }, { "docid": "a52042cb08ed3af83d932df5d0503259", "score": "0.56171525", "text": "def seed_dogs(data)\n # data = @dog_data[\"collection1\"]\n i = 0\n 59.times do\n Dog.create(name: data[i][\"dog_name\"][\"text\"], breed: data[i][\"breed\"], image_link: data[i][\"image\"][\"src\"], description: Faker::Lorem.paragraph(2), gender: data[i][\"gender\"], direct_url: data[i][\"dog_name\"][\"href\"])\n i+=1\n end\nend", "title": "" }, { "docid": "295cbbbc865a6279fc2b67186787eeb9", "score": "0.5597125", "text": "def seed_maker()\norigin_address = 'https://restcountries.eu/rest/v2/all'\norigin_response = RestClient::Request.execute(method: :get, url: origin_address)\n# origin_response = RestClient.get('https://restcountries.eu/rest/v2/all')\nreturned_origin = JSON.parse(origin_response)\n# puts returned_origin\n# puts \"helen is a beast\"\n\n\ncounter = 0\n\nwhile counter < returned_origin.length do\n\n\n\n@name = returned_origin[counter][\"name\"]\n@native_name = returned_origin[counter][\"nativeName\"]\n@population = returned_origin[counter][\"population\"]\n@language = returned_origin[counter][\"languages\"][0][\"name\"]\n@currency_name = returned_origin[counter][\"currencies\"][0][\"name\"]\n@currency_symbol = returned_origin[counter][\"currencies\"][0][\"symbol\"]\n@location_lat = returned_origin[counter][\"latlng\"][0]\n@location_lng = returned_origin[counter][\"latlng\"][1]\n@flag = returned_origin[counter][\"flag\"]\n@capital = returned_origin[counter][\"capital\"]\n# @country_abrv = returned_origin[counter][\"code\"]\n\n@country = Country.create({name: @name, native_name: @native_name, population: @population,\n language: @language, currency_name: @currency_name, currency_symbol: @currency_symbol, location_lat: @location_lat,\n location_lng: @location_lng, flag: @flag, capital: @capital})\n\n # @country = Country.create(name: @name)\ncounter += 1\n\nend\n\nend", "title": "" }, { "docid": "7f16ff942681060358bdddc2282ff343", "score": "0.5590591", "text": "def create_test_data\n (1..6).inject(nil) {|prev, i| create(i, prev) }\n (1..6).each {|i| create_other(i) }\n end", "title": "" }, { "docid": "018863976ab2e87485788c99169a9d49", "score": "0.5589883", "text": "def seed_timeseries\n filenames = TimeseriesData.existing_data_filenames\n\n Company.symbols.each do |symbol|\n next if Timeseries.exists?(symbol: symbol)\n\n puts \"Seeding #{symbol}\"\n\n # sort and [-1] ensure we get the most recent file in the case where there are multiple date_symbol.json\n filename = filenames.sort.filter { |f| TimeseriesData.data_filename_for?(filename: f, symbol: symbol) }[-1]\n if filename\n puts \"Using existing data file: #{filename}\"\n TimeseriesData.data_file_to_db(data_filename: filename)\n else\n data = TimeseriesData.fetch_remote_timeseries(symbol: symbol)\n TimeseriesData.data_to_file(data: data)\n TimeseriesData.data_to_db(data: data)\n sleep(15)\n end\n end\nend", "title": "" }, { "docid": "c4cb5235b662d32b7d312ea060ee054f", "score": "0.55847687", "text": "def generateCoups\n\n\trand(2).times do\n\t\tcoups.push(COUPS.sample)\n\tend\n\t# coups\nend", "title": "" }, { "docid": "1e46923169053cc170083fd6ca97ab37", "score": "0.55807847", "text": "def seeds_data\n ExpressTranslate.seeds\n Account.reset\n end", "title": "" }, { "docid": "4f28d5bc9042aff4f55c1383722337b9", "score": "0.5573876", "text": "def seed\n 1.upto 20 do\n property = {}\n property['type'] = PROPERTY_TYPES.sample\n property['price'] = rand(5..1000) * (MAX_PRICE / 10000)\n property['beds'] = rand(0..MAX_BEDS)\n property['bathrooms'] = rand(0..MAX_BATHROOMS)\n property['car_spaces'] = rand(0..MAX_CAR_SPACES)\n property['address'] = \"#{Faker::Address.street_address}, #{Faker::Address.city} #{Faker::AddressUS.state}, #{Faker::AddressUS.zip_code}\"\n property['desc_title'] = short_text\n property['desc_body'] = long_text\n property['images_string'] = three_images(property['type'])\n Property.new(property).save.blowup_keywords\n sleep 1\n end\n redirect_to admin_path, notice: 'Generated 20 random properties'\n end", "title": "" }, { "docid": "672195deec9eea52dfadb8ef87c92c25", "score": "0.55729866", "text": "def populate\n logger.debug { \"Populating the test fixture...\" }\n\n # the test institution\n inst = CaTissue::Institution.new(:name => 'Test Institution')\n\n # the standard test address\n addr = CaTissue::Address.new\n addr.city = 'Test City'\n addr.state = 'Other'\n addr.country = 'Niue'\n addr.zipCode = '55555'\n addr.street = '555 Elm St'\n addr.phoneNumber = '555-555-5555'\n\n # the test department\n dept = CaTissue::Department.new(:name => 'Test Department')\n\n # the test cancer center\n cc = CaTissue::CancerResearchGroup.new(:name => 'Test Cancer Center')\n\n # the test tissue bank coordinator\n coord = CaTissue::User.new\n coord.loginName = coord.emailAddress = '[email protected]'\n coord.lastName = 'Coordinator'\n coord.firstName = 'Test'\n coord.address = addr.copy\n coord.institution = inst\n coord.department = dept\n coord.cancer_research_group = cc\n coord.add_defaults\n\n # the test surgeon\n surgeon = CaTissue::User.new\n surgeon.loginName = surgeon.emailAddress = '[email protected]'\n surgeon.lastName = 'Scientist'\n surgeon.firstName = 'Test'\n surgeon.address = addr.copy\n surgeon.institution = inst\n surgeon.department = dept\n surgeon.cancer_research_group = cc\n\n # the test PI\n pi = CaTissue::User.new\n pi.loginName = pi.emailAddress = '[email protected]'\n pi.lastName = 'Scientist'\n pi.firstName = 'Test'\n pi.address = addr.copy\n pi.institution = inst\n pi.department = dept\n pi.cancer_research_group = cc\n\n # the test hospital\n hospital = CaTissue::Site.new(\n :site_type => CaTissue::Site::SiteType::COLLECTION,\n :name => 'Test Collection Site',\n :address => addr.copy,\n :coordinator => coord\n )\n\n # the test tissue bank\n @tissue_bank = CaTissue::Site.new(\n :site_type => CaTissue::Site::SiteType::REPOSITORY,\n :name => 'Test Tissue Bank',\n :address => addr.copy,\n :coordinator => coord\n )\n \n # the test participant\n pnt = CaTissue::Participant.new(:name => 'Test Participant')\n\n # add the participant mrn\n mrn = 555555\n pnt.add_mrn(hospital, mrn)\n\n # the test collection protocol\n @protocol = CaTissue::CollectionProtocol.new(\n :title => 'Test CP',\n :principal_investigator => pi\n )\n @protocol.coordinators << coord\n\n # the test consent tier\n ctier = CaTissue::ConsentTier.new(:statement => 'Test Consent Statement')\n @protocol.consent_tiers << ctier\n\n # the collection event template\n cpe = CaTissue::CollectionProtocolEvent.new(:protocol => @protocol)\n\n # the participant collection registration\n @registration = @protocol.register(pnt)\n # add a consent tier response\n rsp = CaTissue::ConsentTierResponse.new(:consent_tier => ctier)\n @registration.consent_tier_responses << rsp\n\n # the specimen requirement template\n @specimen_requirement = CaTissue::TissueSpecimenRequirement.new(\n :collection_event => cpe,\n :specimen_type => 'Frozen Tissue',\n :specimen_characteristics => CaTissue::SpecimenCharacteristics.new,\n :pathological_status => 'Malignant')\n\n # the sole tissue specimen\n @specimen = CaTissue::Specimen.create_specimen(:requirement => @specimen_requirement, :initial_quantity => 4.0)\n\n # the SCG\n @specimen_collection_group = @protocol.add_specimens(\n @specimen,\n :participant => pnt,\n :collection_event => cpe,\n :collection_site => hospital,\n :receiver => coord)\n \n # a storage container\n frz_type = CaTissue::StorageType.new(:name => 'Test Freezer', :columns => 10, :rows => 1, :row_label => 'Rack')\n rack_type = CaTissue::StorageType.new(:name => 'Test Rack', :columns => 10, :rows => 10)\n box_type = CaTissue::StorageType.new(:name => 'Test Box', :columns => 10, :rows => 10)\n frz_type << rack_type\n rack_type << box_type\n box_type << 'Tissue'\n # a sample freezer box\n @box = CaTissue::StorageContainer.new(:storage_type => box_type, :site => @tissue_bank)\n\n logger.debug { \"Test fixture populated.\" }\n self\n end", "title": "" }, { "docid": "be755691cb3e42a76deab240491e6760", "score": "0.5569191", "text": "def seed!\n layout_source = \"/HAML\\n.container-fluid\\n .row-fluid\\n .span2\\n .span8\\n %content:test\\n .span2\"\n content_source = \"/HAML\\n.row-fluid\\n .span12\\n %h2.calign\\n TitleText\\n %p\\n ContentText\"\n seeds = {\n SourceType::LAYOUT => layout_source,\n SourceType::CONTENT => content_source\n }\n unless seeds[self.type].blank?\n self.data = seeds[self.type]\n save!\n p \"Seed content loaded\"\n end\n end", "title": "" }, { "docid": "6f1f4c82d9da15fcc9892b1c40f92368", "score": "0.55551606", "text": "def seed_competitions(data)\n competitions = data[:competition_array]\n competitions.each do |comp|\n Competition.create(league_id: comp[:league_id], name: comp[:name])\n end\n puts \"Competitions seeded\"\nend", "title": "" }, { "docid": "b34a2876f1fb5486b6f32b611a5d66f5", "score": "0.55494773", "text": "def seed_dogs(data)\n # data = @dog_data[\"collection1\"]\n\n i = 0\n 59.times do\n Dog.create(name: data[i][\"dog_name\"][\"text\"], breed: data[i][\"breed\"], image_link: data[i][\"image\"][\"src\"], description: Faker::Lorem.sentence, gender: data[i][\"gender\"])\n i+=1\n end\n\n # data[0][\"dog_name\"][\"text\"] #\"Alfred\"\n # data[0][\"breed\"]\n # data.map do | dog |\n # @dog_name_string_array = dog[\"dog_name\"][\"text\"]\n # @dog_breed_array = dog[\"breed\"]\n # @dog_gender_array = dog[\"gender\"]\n # @dog_image_link_array = dog[\"image\"][\"src\"]\n\n # # Dog.create(name: dog_name_string )\n # end\n\n\nend", "title": "" }, { "docid": "5f05296502df8b03d2c891b2fb0d7e7a", "score": "0.55488515", "text": "def init_generated_seeding_info\n @regions = nil\n @kommuns = nil\n @business_categories = nil\n @address_factory = AddressFactory.new(regions, kommuns)\n end", "title": "" }, { "docid": "a3a05646292f6846b8328a42a4cff378", "score": "0.5542478", "text": "def seed\n refresh\n list\n end", "title": "" }, { "docid": "a261440d572c882d27e077792888e31a", "score": "0.5532658", "text": "def create_all_test_data\n create_system_parameters()\n create_members_and_security_servers()\n create_requests()\n create_approved_cas()\n create_tsps()\n create_global_groups()\n create_configuration_sources()\n create_configuration_anchors()\nend", "title": "" }, { "docid": "0498274ceb128da23bc8d40edb40c8cc", "score": "0.5524214", "text": "def seed_with_minimal_dataset\n ivan = Guest.create(name: 'Ivan')\n rebecca = Guest.create(name: 'Rebecca')\n e2 = Event.create(title: 'Title 2', venue: 'V1', date: Faker::Date.forward(30))\n e1 = Event.create(title: 'Title 1', venue: 'V1', date: Faker::Date.forward(30))\n e3 = Event.create(title: 'Title 3', venue: 'V2', date: Faker::Date.forward(30))\n e4 = Event.create(title: 'Title 4', venue: 'V2', date: Faker::Date.forward(30))\n a1 = Attendance.create(event: e1, guest: ivan)\n a2 = Attendance.create(event: e2, guest: ivan)\n a3 = Attendance.create(event: e1, guest: rebecca)\n a4 = Attendance.create(event: e3, guest: rebecca)\nend", "title": "" }, { "docid": "00cbd2340293b82818280a2e1314246b", "score": "0.5520736", "text": "def seed_hospital_data\n hospital_data_string = RestClient.get(\"https://health.data.ny.gov/resource/7xgt-tyms.json\")\n hospital_data_hash = JSON.parse(hospital_data_string)\n hospital_data_hash.each do |key|\n Hospital.create(facility_name: key[\"facility_name\"],\n street: key[\"address1\"], city: key[\"city\"], state: key[\"cooperator_state\"],\n county: key[\"county\"], zip: key[\"fac_zip\"].to_i, phone: key['fac_phone'],\n description:key[\"description\"], latitude: key[\"latitude\"], longitude: key[\"longitude\"] )\n end\nend", "title": "" }, { "docid": "84c80b5e8f7333dfefb4dd6f83fe4831", "score": "0.5513333", "text": "def load_fixtures_to_db\n accounts.each {|a| Account.create(a)}\n users.each {|a| User.create(a)}\n transactions.each {|a| Transaction.create(a)}\n # Following lines added by Saravana\n response_statuses.each {|a| ResponseStatus.create(a)}\t\n sclients.each {|a| Sclient.create(a)}\n end", "title": "" }, { "docid": "ad58d4fc536b6dd7a86e28dc51de605c", "score": "0.5502212", "text": "def _seed\n @_seed ||= _create_seed\n end", "title": "" }, { "docid": "88d226fcc0b88ad38264ec48b6710a47", "score": "0.54979503", "text": "def load_sample_data\n # load initial database fixtures (in db/sample/*.yml) into the current environment's database\n ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)\n Dir.glob(File.join(RAILS_ROOT, \"db\", 'sample', '*.{yml,csv}')).each do |fixture_file|\n Fixtures.create_fixtures(\"#{RAILS_ROOT}/db/sample\", File.basename(fixture_file, '.*'))\n end\n\n # make product images available to the app\n target = \"#{RAILS_ROOT}/public/images/products/\"\n source = \"#{SPREE_ROOT}/lib/tasks/sample/products/\"\n\n Find.find(source) do |f|\n # omit hidden directories (SVN, etc.)\n if File.basename(f) =~ /^[.]/\n Find.prune \n next\n end\n\n src_path = source + f.sub(source, '')\n target_path = target + f.sub(source, '')\n\n if File.directory?(f)\n FileUtils.mkdir_p target_path\n else\n FileUtils.cp src_path, target_path\n end\n end\n\n announce \"Sample products have been loaded into to the store\"\n end", "title": "" }, { "docid": "22a08430f2346325de987fd166e38e23", "score": "0.5494401", "text": "def populate_trucks\n 100.times do |_n|\n name = Faker::Restaurant.name\n category = Faker::Restaurant.type\n city = \"Bordeaux\"\n zip_code = \"33000\"\n street_address = Faker::Address.street_address\n country = \"France\"\n description = Faker::Restaurant.description\n image = \"https://images.pexels.com/photos/1640777/pexels-photo-1640777.jpeg?auto=compress&cs=tinysrgb&h=750&w=1260\"\n saved = 0\n email = Faker::Internet.email\n state = 0\n phone = Faker::PhoneNumber\n\n Truck.create!(name: name,\n category: category,\n city: city,\n zip_code: zip_code,\n street_address: street_address,\n country: country,\n description: description,\n image: image,\n saved: saved,\n email: email,\n state: state,\n phone: phone)\n end\n end", "title": "" }, { "docid": "6a1ac4ed66f6a69cf366adedfd4b92b1", "score": "0.54801947", "text": "def init_seed\n\n # account\n a = Account.new(:id => SYSTEM_ACCOUNT_ID,\n :description => 'account for system operations')\n\n p = Project.new(:id => DEFAULT_PROJECT_ID,\n :description => 'default project for system operations',\n :account => a)\n\n a.save or raise \"cannot save system account\"\n p.save or raise \"cannot save system project\"\n\n act = Account.new(:id => \"ACT\",\n :description => 'sample account')\n\n prjd = Daitss::Project.new :id => 'default', :description => 'default project for sample account', :account => act\n\n prj = Project.new(:id => \"PRJ\",\n :description => 'sample project',\n :account => act)\n\n act.save or raise \"cannot save sample account\"\n prj.save or raise \"cannot save sample project\"\n prjd.save or raise \"cannot save sample default project\"\n\n # some agents\n program = Program.new(:id => SYSTEM_PROGRAM_ID,\n :description => \"daitss software agent\",\n :account => a)\n\n program.save or raise \"cannot save system program\"\n\n program = Program.new(:id => D1_PROGRAM_ID,\n :description => \"daitss 1 software agent\",\n :account => a)\n\n program.save or raise \"cannot save daitss 1 program\"\n\n operator = Operator.new(:id => ROOT_OPERATOR_ID,\n :description => \"default operator account\",\n :account => a)\n\n operator.encrypt_auth ROOT_OPERATOR_ID\n\n operator.save or raise \"cannot save system operator\"\n end", "title": "" }, { "docid": "a978208c412a3fabdcf8b2d69a6f8c04", "score": "0.54760903", "text": "def seed_initial_population\n puts \"Building initial population of size: #{@population_size} ...\"\n @curr_population = []\n @population_size.times.each { @curr_population << @chromosome_klass.random }\n end", "title": "" }, { "docid": "fe22c3c616371c5bd042d12d93292049", "score": "0.5471621", "text": "def init_generated_seeding_info\n @regions = nil\n @kommuns = nil\n @business_categories = nil\n\n @address_factory = AddressFactory.new(regions, kommuns)\n\n end", "title": "" }, { "docid": "e110210abf785c302ac50d78260848ed", "score": "0.54711103", "text": "def seed_db\nplayer_seed(0)\nplayer_seed(100)\nplayer_seed(200)\nplayer_seed(300)\nplayer_seed(400)\nplayer_seed(500)\nend", "title": "" }, { "docid": "c592ba4cf6c85f1ca5fee330dbf3f4f9", "score": "0.5470662", "text": "def set_up_test(op)\n sample = op.input(POOLED_PLATE).part.sample\n plate = op.input(POOLED_PLATE).collection\n samples = Array.new(plate.get_empty.length, sample)\n plate.add_samples(samples)\n end", "title": "" }, { "docid": "762da6033338198e8db7447591f19d82", "score": "0.5460867", "text": "def setup\n #yml fixtures created with db_fixtures_dump gem\n # FIXTURES_PATH=test/fixtures rake db:fixtures:dump\n #load \"#{Rails.root}/db/seeds.rb\"\n end", "title": "" }, { "docid": "da98ea60b0d172d7cb13d89a81d6bbdc", "score": "0.5456503", "text": "def seed_db\n clear_db\n seed_users\n end", "title": "" }, { "docid": "c0a427fa466c7c68ef0b7b54bfba8327", "score": "0.5452285", "text": "def generate\n # Generate File\n generate_SDC\n generate_UCF\n generate_HDL\n connect = Array.new\n connect = generate_FixedPin_CON(connect)\n# generate_PARA\n connect = generate_PUCTL_CON(connect)\n # generate Expect\n generate_Expect(connect)\n\n end", "title": "" }, { "docid": "210c769f474e11ec058c3ecb4d7f1545", "score": "0.5451541", "text": "def generateSurveySeedData()\n\tsurveys = []\n\tcharacterIDList = getCharacterIDList()\n\n\tUser.all.each do |user|\n counter = 0\n\t\twhile not Survey.where(:user_id => user.id).length + counter >= MAX_READ_PER_USER\n\t\t\tsurveys << {user_id: user.id, character_id: characterIDList[rand(characterIDList.length)], race: randomCharacterRace(), gender: randomCharacterGender(), species: randomCharacterSpecies()}\n counter += 1\n\t\tend\n\t\tif surveys.length >= MAX_READ_PER_USER*MAX_USERS\n\t\t\tbreak\n\t\tend\n\tend\n Survey.create(surveys)\nend", "title": "" }, { "docid": "92a915ff9b06c26ae68c72af1df70190", "score": "0.54465276", "text": "def populate_users\n 99.times do |count|\n name = Faker::Name.name\n email = \"#{name.gsub(/[ ']/,'_') + count.to_s}@railstutorial.org\"\n password = \"password\"\n User.create!(:name => name, \n :email => email, \n :password => password,\n :password_confirmation => password)\n end\nend", "title": "" }, { "docid": "cd7ce3577ee127f97225261d1bb9bf49", "score": "0.544043", "text": "def seed\n self.class.seeders[Rails.env].each do |seeder|\n self.class.run(seeder)\n end\n end", "title": "" }, { "docid": "4eb9a3c0fb2e9b0b48749c97d3cb1dd0", "score": "0.54341346", "text": "def prepare_fixtures\n Fixtures.new(@tmp_keeper.fixtures)\n end", "title": "" }, { "docid": "7bc0d5e1d8c4325b78bf14e9d7f73d23", "score": "0.5420029", "text": "def seed_coppers\n 20.times do\n puts \"Seeding Copper\"\n Card.create(\n name: \"Copper\",\n description: \"+1 to Wallet\", \n picture: \"/card-images/copper.jpg\",\n cost: 0,\n card_type: \"Treasure\",\n triggers: nil,\n victory_points: nil,\n value: 1,\n draw: 0\n )\n end\nend", "title": "" }, { "docid": "986920872022e23d5fb07d7511bf7090", "score": "0.54191715", "text": "def generateUserSeedData(names)\n\tusers = []\n\t(User.all.length..names.length).each do |i|\n\t\tbreak if i >= MAX_USERS\n \tusers << {username: names[i], email: generateEmail(names[i]), race: randomUserRace(), gender: randomUserGender(), user_type: getUserType(), picture: getUserPicture(names[i]), password_digest: getUserPasswordDigest(names[i])}\n\tend\n\tUser.create(users)\nend", "title": "" }, { "docid": "323e929720bc269578fcc6029a398356", "score": "0.54103875", "text": "def seed_from_file\n puts \"Seeding DB with #{STORED_SEEDS} - (approx. 10mins)\"\n [Team, Player, Game, Gamestat].each {|t| t.delete_all}\n require_relative \"./#{STORED_SEEDS}\"\n end", "title": "" }, { "docid": "04324e7400d6291c39de0362b0b8b1aa", "score": "0.53989863", "text": "def prepare_data\n @mapper = { :person => DBMapping::StudentMapper.new(@database),\n :task => DBMapping::TaskMapper.new(@database),\n :relation => DBMapping::RelationsMapper.new(@database)}\n @change_queue = { :person => Array.new(),\n :task => Array.new(),\n :relation => Hash.new()}\n initialize_id_generators\n nil\n end", "title": "" }, { "docid": "e9e7bca8dfc9153dc2f0592ba0c2f5e9", "score": "0.53744686", "text": "def populate_dot_chef!\n generate_knife_files!\n generate_user_pem!\n end", "title": "" }, { "docid": "261c93165f0b628d6391339669fec792", "score": "0.53731906", "text": "def setup\n Dir.mkdir data_dir unless File.exist? data_dir\n end", "title": "" }, { "docid": "f2e3ff80bc68f4fc19bdcef0f038e014", "score": "0.5372477", "text": "def prepare\n prepare_schema\n puts \"time required: \" + Benchmark.measure {populate_data}.to_s\nend", "title": "" }, { "docid": "08abbf915e847a2ec86bd605d3ca0905", "score": "0.53713274", "text": "def seed_data\n # TODO: move this to a background job\n # org = Organization.create(name: 'My Organization')\n\n Campaign::SEED.each { |c| org.campaigns.find_or_create_by(c.merge({ user: self })) }\n end", "title": "" }, { "docid": "481a1ce15817c8b79ed6035ae052479a", "score": "0.5369465", "text": "def populate_sqldb\n\n # populate Device Agent\n [{\n :uri => \"1.b19.device-agent.sv.cmu.edu\",\n :network_address => \"192.168.0.0\",\n :print_name => \"Bob's Office\"\n }].each do |attributes|\n DeviceAgent.create(attributes)\n end\n bob_linux_agent = DeviceAgent.find_by_uri(\"1.b19.device-agent.sv.cmu.edu\")\n\n # populate Device Types\n [\n {:device_type_desc => \"Firefly V2\", :device_type_key => \"firefly_v2\", :version => \"\", :manufacturer => \"CMU\",\n :default_config =>\n \"{\\\"property_type_key\\\": [\n \\\"temperature\\\",\n \\\"digital temperature\\\",\n \\\"light\\\",\n \\\"pressure\\\",\n \\\"humidity\\\",\n \\\"motion\\\",\n \\\"audio_p2p\\\",\n \\\"accelerometer_x\\\",\n \\\"accelerometer_y\\\",\n \\\"accelerometer_z\\\"]}\" }\n ].each do |attributes|\n DeviceType.create(attributes)\n end\n firefly_device_type = DeviceType.find_by_device_type_key(\"firefly_v2\")\n\n # populate Devices\n [{\n :uri => \"1.b19.device.sv.cmu.edu\",\n # :device_type_id => firefly_device_type.id,\n :network_address => \"192.168.0.0\",\n :print_name => \"Building 19 - Room 1054\"\n },\n {\n :uri => \"2.b19.device.sv.cmu.edu\",\n # :device_type_id => firefly_device_type.id,\n :network_address => \"192.168.1.1\",\n :print_name => \"Building 19 - Room 1055\"\n }].each do |attributes|\n d = Device.create(attributes)\n firefly_device_type.devices << d\n bob_linux_agent.devices << d\n end\n firefly_device_1 = Device.find_by_uri(\"1.b19.device.sv.cmu.edu\")\n default_config_json = JSON.parse(firefly_device_type.default_config)\n default_config_json[\"property_type_key\"].each do |pt|\n st = SensorType.create(:property_type_key => pt, :property_type_desc => pt)\n # create one sensor of this sensor-type\n s = Sensor.create({ :uri => \"d\" || firefly_device_1.id ||\".sensor.b19.sv.cmu.edu\", :sensor_type_id => st.id, :device_id => firefly_device_1.id })\n firefly_device_1.sensors << s\n end\n end", "title": "" }, { "docid": "3f5c21ff38329069027e8b1c6315fdfa", "score": "0.5363543", "text": "def seed\n session_description.seed\n\n self\n end", "title": "" }, { "docid": "c607cf8cf3098bfbd4fcee7d67270868", "score": "0.533209", "text": "def pre_test_each\n @records = []\n 4.times { |i| @records << create_simple_record({x: i, y: i*2}) }\n end", "title": "" }, { "docid": "4311d56c7cee10c6231c42e2076c7456", "score": "0.5330494", "text": "def initialize(data_size)\n @data_size = data_size\n @test_set = random_data_set(data_size)\n end", "title": "" }, { "docid": "fcaa95560b146f6cc4f20d9f28a325ef", "score": "0.53289795", "text": "def seed_profile\n self.profile = Profile.new( :name => self.name,\n :handle => \"new ffflourisher\",\n :about_me => \"Tell us a little about yourself.\"\n )\n self.profile.locations.create!( :city => \"City\",\n :state => \"State\",\n :country => \"Country\",\n :postal_code => \"00000\"\n )\n self.profile.websites.create!( :name => \"The name of my awesome website or blog.\",\n :url => \"www.example.com\",\n :info => \"Why my website is awesome.\"\n )\n self.save\n end", "title": "" }, { "docid": "195c26b42db5e1d6c7708662ec6ce881", "score": "0.53267646", "text": "def seed_database\n get_full_filenames.each do |file|\n Models::File.create(:name => file, :number_of_lines => count_number_of_lines(file))\n end\n end", "title": "" }, { "docid": "76be0ce3c013fa55b284cfc9b94d5faa", "score": "0.53261524", "text": "def create_test_data\n importer = Importer.new(TestPhotoCollector.new)\n importer.import\nend", "title": "" }, { "docid": "e4500830138ace58adb4549bac892ffc", "score": "0.5326108", "text": "def setup\n init\n connect_to 'development'\n load_fixtures\n end", "title": "" }, { "docid": "b401cc83ad112349da669befb40db98c", "score": "0.5325288", "text": "def generate_random_data\n number_of_items = params['number_of_items']\n seedData = Array.new(number_of_items.to_i) { rand*100 }\n seedModels = Array.new\n initialTime = Time.now\n\n seedData.each_with_index do |d, index|\n seedModels.push({\n value: d,\n created_at: initialTime - 6*60*60*index,\n sensor: @sensor\n })\n end\n\n data = SensorRecord.create(seedModels)\n\n render json: {\n 'success': true\n }\n end", "title": "" }, { "docid": "4f893697b758681d425bd46d91879c18", "score": "0.5322775", "text": "def seed_users\n Industry.all.each do |ind|\n User.create(email: \"example#{ind.id}@gmail.com\",\n full_name: \"Cool#{ind.id} User#{ind.id}\",\n password: 'password',\n encrypted_password: \"password\",\n industry_id: ind.id)\n end\nend", "title": "" }, { "docid": "e0cb514e396ef70c2112bde4304141fb", "score": "0.53213173", "text": "def populate_data\n populate_scan_data\n populate_rep_data\nend", "title": "" }, { "docid": "91275bce629e7be154f7276d178a52f5", "score": "0.5317436", "text": "def build\n # Truncate all tables\n unless skip_database_cleaner\n cleaner = Utils::DatabaseCleaner.new(db, database_cleaner_tables)\n cleaner.clean\n end\n\n fixture_path, fixture_dir = File.split(path_to_fixtures)\n\n Sequel::Fixture.path = fixture_path\n\n Sequel::Fixture.new(fixture_dir.to_sym, db)\n end", "title": "" }, { "docid": "4a63b94198ac7e212346b67812586c25", "score": "0.5298892", "text": "def generate_products\n ProductCategory.all.each do |category|\n\n min_num = 2 * @seeds_multiplier\n max_num = 5 * @seeds_multiplier\n\n rand(min_num..max_num).times do\n product = Product.new\n detail = ProductDetail.new\n\n detail.title = Faker::Commerce.product_name\n detail.description = Faker::Lorem.paragraph(3)\n detail.price = Faker::Commerce.price\n detail.product_category_id = category.id\n detail.save!\n\n product.sku = Faker::Lorem.characters(16)\n product.product_detail_id = detail.id\n product.save!\n end\n\n end\n end", "title": "" }, { "docid": "59999bfedf766f7b285e53d996f31080", "score": "0.52949345", "text": "def create_db_rvdata\n if Dir.exists?(Database::Table.path)\n tables = Database.tables.keys.collect(&:to_s)\n tables.each do |f|\n if File.exists?(Database::Table.path+\"#{f}.csv\")\n klass = Object.const_get(f)\n klass.insert(Database::Table.path+\"/#{f}.csv\")\n end\n end\n end\n save_data(Database.tables,Database::Table.rvpath) \n end", "title": "" }, { "docid": "5abeb1b320edf6835b2f38da5b8e3eb2", "score": "0.529077", "text": "def generate_addresses(user_id)\n (rand(4) + 1).times do\n a = Address.new\n a[:user_id] = user_id\n a[:street_address] = Faker::Address.street_address\n a[:city_id] = City.select(:id).sample.id\n a[:state_id] = State.select(:id).sample.id\n a[:zip_code] = Faker::Address.zip.to_i\n a.save! #just to check if anything fails here\n end\nend", "title": "" }, { "docid": "223debc127b8ae62d522f2158460916b", "score": "0.5289337", "text": "def initialize\n super\n populate\n end", "title": "" }, { "docid": "446bc49b56424f11a7922e4f76d89dca", "score": "0.52858764", "text": "def generateCoups\n\t$coups = []\n\trand(2).times do\n\t\t$coups.push(COUPS.sample)\n\tend\n\tputs $coups\nend", "title": "" }, { "docid": "a949300d6cefdc16a70adaa3b286000e", "score": "0.5280396", "text": "def create_default_dataset\n order = orders.new\n order.shopify_id = '000'\n order.email = '[email protected]'\n order.shopify_created_at = DateTime.now\n order.customer = '{\"id\":2871225188422,\"email\":\"[email protected]\",\"accepts_marketing\":false,\"created_at\":\"2020-04-02T18:01:37-04:00\",\"updated_at\":\"2020-05-13T19:25:28-04:00\",\"first_name\":\"John\",\"last_name\":\"Smith\",\"orders_count\":0,\"state\":\"disabled\",\"total_spent\":\"0.00\",\"last_order_id\":null,\"note\":null,\"verified_email\":true,\"multipass_identifier\":null,\"tax_exempt\":false,\"phone\":null,\"tags\":\"\",\"last_order_name\":null,\"currency\":\"USD\",\"accepts_marketing_updated_at\":\"2020-04-02T18:01:38-04:00\",\"marketing_opt_in_level\":null,\"admin_graphql_api_id\":\"gid://shopify/Customer/2871225188422\",\"default_address\":{\"id\":3077169905734,\"customer_id\":2871225188422,\"first_name\":\"John\",\"last_name\":\"Smith\",\"company\":null,\"address1\":\"123 Main St \",\"address2\":\"\",\"city\":\"Miami\",\"province\":\"Florida\",\"country\":\"United States\",\"zip\":\"33137\",\"phone\":null,\"name\":\"John Smith\",\"province_code\":\"FL\",\"country_code\":\"US\",\"country_name\":\"United States\",\"default\":true}}'\n order.order_number = '1000'\n order.save\n\n 2.times do |t|\n order_item = order.order_items.new(shopify_id: '000', title: \"Test Product ##{t + 1}\")\n order_item.save\n end\n end", "title": "" }, { "docid": "c8544cce37a6d3b2cd003f2e509f6c6f", "score": "0.5278473", "text": "def generatePlayers()\n \tres=[]\n \t(1..20).each do |i|\n \t\tobj={name:Faker::Name.name, email:Faker::Internet.email, logo:Faker::Company.logo, description:Faker::Lorem.sentence}\n \t\tres << obj\n \tend\n \treturn res\n end", "title": "" } ]
efe034b6f781f559f85116844f055780
The range of the word at the current position.
[ { "docid": "37e906bd64dccc3d583eecc648eeab43", "score": "0.8005786", "text": "def range\n @range ||= begin\n s = Position.from_offset(source.code, offset - start_of_word.length)\n e = Position.from_offset(source.code, offset + end_of_word.length)\n Solargraph::Range.new(s, e)\n end\n end", "title": "" } ]
[ { "docid": "faa470f76997351e46d624859aa2646f", "score": "0.7701425", "text": "def word_range\n @word_range ||= word_range_at(offset, false)\n end", "title": "" }, { "docid": "d7e33133323f2e4cfccf1c8968bd212d", "score": "0.74746734", "text": "def range\n return @def.range\n end", "title": "" }, { "docid": "01f4eef321dd71a17c0ab691f7f80bed", "score": "0.7434125", "text": "def start_of_word(word,range)\n\treturn word[0..range-1]\nend", "title": "" }, { "docid": "4f3b4c36fc50d63da184d6dc9271bb55", "score": "0.7294788", "text": "def range\n return @range\n end", "title": "" }, { "docid": "3267e7cf85e1b3ad7e41c891412b83fc", "score": "0.72932214", "text": "def current_word_and_range_and_index\n iterated_chars = 0\n this_is_the_word = false\n words.each.with_index do |word, index|\n word_started_on = iterated_chars\n word.each_char do |char|\n this_is_the_word = true if iterated_chars == line.cursor_index - 1\n iterated_chars = iterated_chars + 1\n end\n word_ended_on = iterated_chars - 1\n return [word, word_started_on..word_ended_on, index] if this_is_the_word\n\n # For the space character\n iterated_chars = iterated_chars + 1\n end\n return [\"\", line.cursor_index..line.cursor_index, words.count]\n end", "title": "" }, { "docid": "f20d8af8d71cdf979b6b00273686cf50", "score": "0.7236385", "text": "def word_bounds\n iter = get_iter_at_offset(cursor_position)\n s_iter, e_iter = iter.clone, iter.clone\n s_iter.backward_word_start unless s_iter.starts_word?\n e_iter.forward_word_end unless e_iter.ends_word?\n\n [s_iter, e_iter]\n end", "title": "" }, { "docid": "3887ba93c6c6a8b373366f86324e3856", "score": "0.6984895", "text": "def whole_word_range\n @whole_word_range ||= word_range_at(offset, true)\n end", "title": "" }, { "docid": "a47b4f0da4f56c1f850058e0591c522a", "score": "0.696501", "text": "def range\n @start..@end\n end", "title": "" }, { "docid": "1a22dc3e700cd0aab64453baa1acb7a3", "score": "0.69216985", "text": "def range\n type.range\n end", "title": "" }, { "docid": "3b1bb77ddf0d5cc38a6105c9732f750a", "score": "0.6886676", "text": "def current_word(left_chunk = LEFT_CHUNK, right_chunk = RIGHT_CHUNK)\n left, right = buffer[0...pos], buffer[pos..-1]\n left_match, right_match = left[left_chunk], right[right_chunk]\n\n if left_match and right_match\n word = left_match + right_match\n range = (pos - left_match.size)...(pos + right_match.size)\n elsif word = left_match\n range = (pos - word.size)...pos\n elsif word = right_match\n range = pos...(pos + word.size)\n end\n\n return word, range if word\n end", "title": "" }, { "docid": "1887063e85c944cf9db0e18c8d78b823", "score": "0.6822069", "text": "def range\n\t\t\t(start .. self.end)\n\t\tend", "title": "" }, { "docid": "c5a7606d646a979a272085d2973ed26c", "score": "0.67805076", "text": "def range_start\n @range_start ||= formated_value.split(delimiter)[0]\n end", "title": "" }, { "docid": "9e2de150714ea566c16618c7ca10ce8c", "score": "0.6774664", "text": "def bounds\n start = comment.source_range.begin_pos + margin.length\n length = [keyword, colon, space].reduce(0) { |len, elem| len + elem.to_s.length }\n [start, start + length]\n end", "title": "" }, { "docid": "a2c0758f05434a027d77e28e055f4491", "score": "0.6743058", "text": "def word_at_cursor\n get_text(*word_bounds).strip\n end", "title": "" }, { "docid": "611e8efda8bf37d51987949fcd58202d", "score": "0.6726965", "text": "def character_range(token)\n token\n end", "title": "" }, { "docid": "016e5cabef2544dcced299c3deb5643d", "score": "0.6708571", "text": "def range\n first_element('range')\n end", "title": "" }, { "docid": "047e9cf3aeedb014609cfe8c260bcec4", "score": "0.6674124", "text": "def origin()\n return range.low\n end", "title": "" }, { "docid": "75652da9efc5d3098483b8f5616b5777", "score": "0.6657766", "text": "def word\n @word ||= start_of_word + end_of_word\n end", "title": "" }, { "docid": "75652da9efc5d3098483b8f5616b5777", "score": "0.6657766", "text": "def word\n @word ||= start_of_word + end_of_word\n end", "title": "" }, { "docid": "1c373247095619acf5434c13ce66ec52", "score": "0.6652934", "text": "def range_start\n @range_start ||= formatted_value.split(delimiter)[0]\n end", "title": "" }, { "docid": "8612ec1e1052b5a18ec81c9dc998e8d0", "score": "0.66061014", "text": "def selection_range\n from = [@text_input.selection_start, caret_position].min\n to = [@text_input.selection_start, caret_position].max\n\n (from...to)\n end", "title": "" }, { "docid": "7c7ee4d9c77b2071245f5a0eb8a9acc5", "score": "0.65957224", "text": "def range\n attributes.fetch(:range)\n end", "title": "" }, { "docid": "7c7ee4d9c77b2071245f5a0eb8a9acc5", "score": "0.65957224", "text": "def range\n attributes.fetch(:range)\n end", "title": "" }, { "docid": "7c7ee4d9c77b2071245f5a0eb8a9acc5", "score": "0.65957224", "text": "def range\n attributes.fetch(:range)\n end", "title": "" }, { "docid": "7c7ee4d9c77b2071245f5a0eb8a9acc5", "score": "0.65957224", "text": "def range\n attributes.fetch(:range)\n end", "title": "" }, { "docid": "7c7ee4d9c77b2071245f5a0eb8a9acc5", "score": "0.65957224", "text": "def range\n attributes.fetch(:range)\n end", "title": "" }, { "docid": "7c7ee4d9c77b2071245f5a0eb8a9acc5", "score": "0.65957224", "text": "def range\n attributes.fetch(:range)\n end", "title": "" }, { "docid": "7c7ee4d9c77b2071245f5a0eb8a9acc5", "score": "0.65957224", "text": "def range\n attributes.fetch(:range)\n end", "title": "" }, { "docid": "7c7ee4d9c77b2071245f5a0eb8a9acc5", "score": "0.65957224", "text": "def range\n attributes.fetch(:range)\n end", "title": "" }, { "docid": "7c7ee4d9c77b2071245f5a0eb8a9acc5", "score": "0.65957224", "text": "def range\n attributes.fetch(:range)\n end", "title": "" }, { "docid": "7c7ee4d9c77b2071245f5a0eb8a9acc5", "score": "0.65957224", "text": "def range\n attributes.fetch(:range)\n end", "title": "" }, { "docid": "7c7ee4d9c77b2071245f5a0eb8a9acc5", "score": "0.65957224", "text": "def range\n attributes.fetch(:range)\n end", "title": "" }, { "docid": "7c7ee4d9c77b2071245f5a0eb8a9acc5", "score": "0.65957224", "text": "def range\n attributes.fetch(:range)\n end", "title": "" }, { "docid": "7c7ee4d9c77b2071245f5a0eb8a9acc5", "score": "0.65957224", "text": "def range\n attributes.fetch(:range)\n end", "title": "" }, { "docid": "7c7ee4d9c77b2071245f5a0eb8a9acc5", "score": "0.65957224", "text": "def range\n attributes.fetch(:range)\n end", "title": "" }, { "docid": "d88ef413c0c9487f1a8225dfd92031db", "score": "0.65850735", "text": "def range\n end", "title": "" }, { "docid": "67ea30949b637552db5c2749f8777cd9", "score": "0.6573111", "text": "def suggestion_range\n \"-#{line_count}+0\"\n end", "title": "" }, { "docid": "f7da97af017d9c9fe5892ce4ca476682", "score": "0.6571104", "text": "def range; end", "title": "" }, { "docid": "f7da97af017d9c9fe5892ce4ca476682", "score": "0.6571104", "text": "def range; end", "title": "" }, { "docid": "f7da97af017d9c9fe5892ce4ca476682", "score": "0.6571104", "text": "def range; end", "title": "" }, { "docid": "f7da97af017d9c9fe5892ce4ca476682", "score": "0.6571104", "text": "def range; end", "title": "" }, { "docid": "f7da97af017d9c9fe5892ce4ca476682", "score": "0.6571104", "text": "def range; end", "title": "" }, { "docid": "f7da97af017d9c9fe5892ce4ca476682", "score": "0.6571104", "text": "def range; end", "title": "" }, { "docid": "f7da97af017d9c9fe5892ce4ca476682", "score": "0.6571104", "text": "def range; end", "title": "" }, { "docid": "f7da97af017d9c9fe5892ce4ca476682", "score": "0.6571104", "text": "def range; end", "title": "" }, { "docid": "f7da97af017d9c9fe5892ce4ca476682", "score": "0.6571104", "text": "def range; end", "title": "" }, { "docid": "f7da97af017d9c9fe5892ce4ca476682", "score": "0.6571104", "text": "def range; end", "title": "" }, { "docid": "f7da97af017d9c9fe5892ce4ca476682", "score": "0.6571104", "text": "def range; end", "title": "" }, { "docid": "f7da97af017d9c9fe5892ce4ca476682", "score": "0.6571104", "text": "def range; end", "title": "" }, { "docid": "f7da97af017d9c9fe5892ce4ca476682", "score": "0.6571104", "text": "def range; end", "title": "" }, { "docid": "f7da97af017d9c9fe5892ce4ca476682", "score": "0.6571104", "text": "def range; end", "title": "" }, { "docid": "f7da97af017d9c9fe5892ce4ca476682", "score": "0.6571104", "text": "def range; end", "title": "" }, { "docid": "f7da97af017d9c9fe5892ce4ca476682", "score": "0.6571104", "text": "def range; end", "title": "" }, { "docid": "f7da97af017d9c9fe5892ce4ca476682", "score": "0.6571104", "text": "def range; end", "title": "" }, { "docid": "f7da97af017d9c9fe5892ce4ca476682", "score": "0.6571104", "text": "def range; end", "title": "" }, { "docid": "f7da97af017d9c9fe5892ce4ca476682", "score": "0.6571104", "text": "def range; end", "title": "" }, { "docid": "f7da97af017d9c9fe5892ce4ca476682", "score": "0.6571104", "text": "def range; end", "title": "" }, { "docid": "f7da97af017d9c9fe5892ce4ca476682", "score": "0.6571104", "text": "def range; end", "title": "" }, { "docid": "f7da97af017d9c9fe5892ce4ca476682", "score": "0.6571104", "text": "def range; end", "title": "" }, { "docid": "f7da97af017d9c9fe5892ce4ca476682", "score": "0.6571104", "text": "def range; end", "title": "" }, { "docid": "f7da97af017d9c9fe5892ce4ca476682", "score": "0.6571104", "text": "def range; end", "title": "" }, { "docid": "f7da97af017d9c9fe5892ce4ca476682", "score": "0.6571104", "text": "def range; end", "title": "" }, { "docid": "f7da97af017d9c9fe5892ce4ca476682", "score": "0.6571104", "text": "def range; end", "title": "" }, { "docid": "c13db2cf8e7fcca5a5580d4e33789324", "score": "0.65435773", "text": "def range\n node&.loc&.expression || \"?\"\n end", "title": "" }, { "docid": "0c0fda70cab354a8b23af27daa7b7ae3", "score": "0.64836943", "text": "def [] range\r\n raise \"source_text not set\" if source_text.nil?\r\n source_text[range]\r\n end", "title": "" }, { "docid": "d767ed11c1ee6d72eeac54b73837a2df", "score": "0.648001", "text": "def prepare_string_range\n puts \"CHECKING LETTERS #{@starting_point} until #{@ending_point}\" \n @range = @str.downcase[@starting_point...@ending_point] \n puts \"IS '#{@range}' a word?\"\n end", "title": "" }, { "docid": "53a26563485a40389007dda4f9e08559", "score": "0.6479153", "text": "def word_range(word, n)\n word[0..n]\nend", "title": "" }, { "docid": "6d05c09fa9ed9a50f26bcd28ac4f0859", "score": "0.6473824", "text": "def [](range)\n if range.is_a?(Range)\n py_span = @py_doc[range]\n return Span.new(self, start_index: py_span.start, end_index: py_span.end - 1)\n else\n return Token.new(@py_doc[range])\n end\n end", "title": "" }, { "docid": "9f08e252029afa1d853d9d5ea30d0ac4", "score": "0.64437747", "text": "def text_range(range)\n r_end = range.exclude_end? ? range.end : range.end + 1\n r_size = r_end - range.begin\n if range.begin == start && r_size == size\n # special case, entire text\n 0...text.size\n else\n if range.begin < start || r_end > self.end\n raise \"Range #{range} outside sequence bounds; start #{start}, size #{size}\"\n end\n if ! gapped?\n # no gaps, can map indexes directly\n (range.begin - start)...(r_end - start)\n else\n # gaps present\n g_start = start # genomic position of the start\n t_start = 0 # text position of the start\n m_begin = nil # beginning of match\n match = nil\n text.scan(/(\\w+|-+)/) do |parts|\n part = parts[0]\n if part[0] != '-'\n # sequence text\n g_end = g_start + part.size\n if g_start <= range.begin && range.begin < g_end\n offset_in_part = range.begin - g_start\n m_begin = offset_in_part + t_start\n end\n if g_start <= r_end && r_end <= g_end\n raise \"reached end before start!\" unless m_begin\n offset_in_part = r_end - g_start\n m_end = offset_in_part + t_start\n match = m_begin...m_end\n break\n end\n g_start = g_end\n else\n # gap\n end\n t_start += part.size\n end\n raise \"no match found!\" unless match\n return match\n end\n end\n end", "title": "" }, { "docid": "b872b7408ed3ecfeba490a73457dbf08", "score": "0.642685", "text": "def range\n return daterange.to_range\n end", "title": "" }, { "docid": "0ca7886dbadcfdd227b3941ddddae63c", "score": "0.6422999", "text": "def [](range)\n if range.is_a?(Range)\n py_span = @py_span[range]\n return Span.new(@doc, start_index: py_span.start, end_index: py_span.end - 1)\n else\n return Token.new(@py_span[range])\n end\n end", "title": "" }, { "docid": "8bcbdd132ad9b38377990a16a334458b", "score": "0.6421814", "text": "def range\n return unless bounded?\n\n if exclude_end?\n start_at...end_at\n else\n start_at..end_at\n end\n end", "title": "" }, { "docid": "8b878996087aadf159813265c7142499", "score": "0.6416844", "text": "def parse_range\n val = super || return\n return val.begin if val.begin == val.end\n\n val.reverse! if limit.index(val.begin) > limit.index(val.end)\n val\n end", "title": "" }, { "docid": "92dbfd752777a564310b650ac8319b71", "score": "0.6404535", "text": "def range_end\n @range_end ||= formated_value.split(delimiter)[1]\n end", "title": "" }, { "docid": "6296f0b81bfb9aaebe2da45969c7ff0d", "score": "0.63991266", "text": "def set_word_range_to_down\n\t\tif @player.start.length == 2\n\t\t\t# last specifies the number of the square on which the word ends. Because the word goes down, the number decreases.\n\t\t\t# That's why @set is reversed.\n\t\t\tlast = @player.start[1].to_i - @player.word.length + 1\n\t\t\t@set = ([email protected][1].to_i).map { |n| @player.start[0] + n.to_s }.reverse\n\t\telse\n\t\t\tlast = @player.start[1..2].to_i - @player.word.length + 1\n\t\t\t@set = ([email protected][1..2].to_i).map { |n| @player.start[0] + n.to_s }.reverse\n\t\tend\n\tend", "title": "" }, { "docid": "d3f25287a87b1fb8b9af64bfc2a81cae", "score": "0.63909304", "text": "def range\n return nil unless @count > 0\n @hi-@lo\n end", "title": "" }, { "docid": "a0b4cd0eb9ec509d16cf39e29d8b0dfe", "score": "0.63809097", "text": "def set_word_range_to_right\n\t\tlast = (@player.start[0].ord + @player.word.length - 1).chr \t\t# => last specifies the letter of the square on which the word ends.\n\t\tif @player.start.length == 2\n\t\t\t# Letters increases accordingly, the number part stays the same.\n\t\t\t@set = (@player.start[0]..last).map { |l| l + @player.start[1] }\n\t\telse\n\t\t\t@set = (@player.start[0]..last).map { |l| l + @player.start[1..2] }\n\t\tend\n\tend", "title": "" }, { "docid": "43c7c44513c3efc0453e9837a7dfcae9", "score": "0.6350683", "text": "def to_range\n beginning..ending\n end", "title": "" }, { "docid": "5e54027194b90a68b3d073dcea0a5120", "score": "0.6339732", "text": "def range_bounds(range)\n [range.first, range.last]\n end", "title": "" }, { "docid": "566fa8104ba8de2facd7f2613bd277e3", "score": "0.6337974", "text": "def range\n fetch('mountain.range')\n end", "title": "" }, { "docid": "18edb052b561051e97a70ff38388e401", "score": "0.6321447", "text": "def range_end\n @range_end ||= formatted_value.split(delimiter)[1]\n end", "title": "" }, { "docid": "ef7f9156a66dba0b14fc9366db1c65f1", "score": "0.6316548", "text": "def range_length; end", "title": "" }, { "docid": "262f9221b4ba4b251d5f4b0effa4b3d8", "score": "0.6246705", "text": "def type\n :character_range\n end", "title": "" }, { "docid": "8a32c3394a81dfa83034e6adcce30fbf", "score": "0.62364435", "text": "def range\n @range ||= LineRange.new(self, 0, -1)\n end", "title": "" }, { "docid": "4d7fce44f00e309f564dffe6c78fde86", "score": "0.6188194", "text": "def part_of_word\n\t\t@str[@first_letter..@last_letter]\n\tend", "title": "" }, { "docid": "14c3e7ca1ab085e3d4981358b576973d", "score": "0.61861044", "text": "def take_range(str, start_col, max_width); end", "title": "" }, { "docid": "183f7da7fd86e5e21511f43e20396b8f", "score": "0.6183164", "text": "def word_at pos\n\t\t\treturn @words[pos]\n\t\tend", "title": "" }, { "docid": "3a88f0c1247227cd6dfb25e6895300b0", "score": "0.6164333", "text": "def range?\n return @def.range?\n end", "title": "" }, { "docid": "e8c851b4b33593340fafee901fa68d30", "score": "0.61604226", "text": "def range\n @target ? @target.range : super\n end", "title": "" }, { "docid": "fd5e190a10d1ce08a3002c8f7270b5c2", "score": "0.61530274", "text": "def ability_range\n return $1.to_i if self.note =~ /<grid[\\s_]*range:[\\s]*(\\d+)>/i\n return 1\n end", "title": "" }, { "docid": "0ccfab21a318992433e5476fa666c902", "score": "0.6151958", "text": "def range\r\n diff low, high\r\n end", "title": "" }, { "docid": "5432bcf9c1bbfd223165e4e697cd220e", "score": "0.61506724", "text": "def next_range\n range = valid_range cur_position..(cur_position+max_window_size)\n range if range.max > range.min\n end", "title": "" }, { "docid": "5432bcf9c1bbfd223165e4e697cd220e", "score": "0.61506724", "text": "def next_range\n range = valid_range cur_position..(cur_position+max_window_size)\n range if range.max > range.min\n end", "title": "" }, { "docid": "9bbbea8b76e6531aa560077f79f9adb6", "score": "0.6144107", "text": "def word\n @word ||= word_at(offset)\n end", "title": "" }, { "docid": "ee32172d410c4e6a7fee600a772a0f43", "score": "0.61404884", "text": "def start_of_word(word, x)\r\n word[0..(x-1)]\r\nend", "title": "" }, { "docid": "ed36861c234d38461d9db3d93537deda", "score": "0.61349183", "text": "def range_for(markup, range)\n range = (range.begin-1..range.end-1)\n markup.split(\"\\n\")[range].join(\"\\n\")\n end", "title": "" }, { "docid": "c19b21b5f4c372837b82d0455e2def7a", "score": "0.61349", "text": "def span\n self.end >= self.begin ? self.end - self.begin : 0\n end", "title": "" }, { "docid": "70f8c49c9e1079946136505cd636855f", "score": "0.6113069", "text": "def selection_range; end", "title": "" }, { "docid": "70f8c49c9e1079946136505cd636855f", "score": "0.6113069", "text": "def selection_range; end", "title": "" } ]
e8d94279a3e8a7f9621c4b8a80d00d81
Method that goes to our create car page, fills in the make, model year, description, and then clicks the simulate car button
[ { "docid": "e19c3d022c41093db0efc760a6cfade1", "score": "0.79223603", "text": "def fill_in_make_and_modelyear\n visit \"/car/create\"\n fill_in(\"Make\", with: \"Mini\")\n fill_in(\"Model Year\", with: 2012)\n fill_in(\"Description\", with: \"This is the description for our car! It is a great car.\")\n click_button \"Simulate Car\"\n end", "title": "" } ]
[ { "docid": "0bd907f934b71db24a928eedf0f92114", "score": "0.62388265", "text": "def create\n @car = Car.new(params[:make], params[:model_year])\n #converting the Car.new object into a YAML which stands for Yet Another Markup Language. Storing this car's information in a session. (When not using a database)\n session[:car] = @car.to_yaml\n #once the car object is created, redirect user to status.html.erb (view)\n redirect_to \"/cars/status\"\n end", "title": "" }, { "docid": "fa28269228cf02799f38fa9e66a1421b", "score": "0.6101372", "text": "def create\n Car.create(\n name: params[:car][:name],\n image_url: params[:car][:image_url],\n self_driving: params[:car][:self_driving],\n range: params[:car][:range],\n starting_price: params[:car][:starting_price]\n )\n\n redirect_to cars_path\n end", "title": "" }, { "docid": "0efbec0955ed5a971150667940b9cf31", "score": "0.6000006", "text": "def comp_create_account_button\n click_button 'Create an account'\n end", "title": "" }, { "docid": "7fddf5107102c3d256a50d7224011e39", "score": "0.59968495", "text": "def test_create_mr\n login\n sleep 15\n vendor_Name = create_vendor\n @driver.find_element(:xpath, \"//div[@class='create-shortcut dropdown ng-scope']/a\").click\n @driver.find_element(:link_text, \"New Material Receipt\").click\n sleep 3\n time = get_Present\n mr_Name = \"Material Receipt for \"+vendor_Name+\" \"+time\n @driver.find_element(:xpath, \"//input[@placeholder='Title']\").send_keys mr_Name\n @driver.find_element(:xpath, \"//textarea[@placeholder='About this MR']\").send_keys \"This material Receipt is created through Selenium Automation\"\n \n @driver.find_element(:xpath, \".//*[@id='main-section']/div/div/div[2]/form/div[1]/div/section[3]/div/div[1]/vox-dynamic-select/div/div\").click\n sleep 2\n @driver.find_element(:xpath, \"//input[@placeholder='Select vendor...']\").send_keys vendor_Name\n @driver.find_element(:xpath, \"//a[@class='ui-select-choices-row-inner']/span/div/span\").click\n puts \"vendor selected in MR page\"\n\n @driver.find_element(:xpath, \"//button[@class='submit-button button']\").send_keys :enter \n sleep 3\n\n puts \"Created \"+mr_Name\n\n end", "title": "" }, { "docid": "cf42930ec3d2c255b439250622a9f9c4", "score": "0.5970957", "text": "def submit\n click_button('Go')\n ResultPage.new\n end", "title": "" }, { "docid": "0e62c12cdd80ebe5e52fd6ebc8129b17", "score": "0.5941392", "text": "def create\n @car_spec = CarSpec.new(car_spec_params)\n\n respond_to do |format|\n if @car_spec.save\n format.html { redirect_to @car_spec, notice: 'Car spec was successfully created.' }\n format.json { render :show, status: :created, location: @car_spec }\n else\n format.html { render :new }\n format.json { render json: @car_spec.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1d8336995bf5aee6baa060add822c993", "score": "0.59220093", "text": "def create\n @car_make = CarMake.new(params[:car_make])\n\n respond_to do |format|\n if @car_make.save\n flash[:notice] = 'CarMake was successfully created.'\n format.html { redirect_to(@car_make) }\n format.xml { render :xml => @car_make, :status => :created, :location => @car_make }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @car_make.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2116fd134b25edce4c29ab196f59f47c", "score": "0.59193146", "text": "def create\n @car = Car.new(car_params)\n \n respond_to do |format|\n if @car.save\n format.html { redirect_to @car, notice: 'Car was successfully created.' }\n format.json { render :show, status: :created, location: @car }\n else\n manufacturers\n \n format.html { render :new }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a8c6b1ed1cd266f2209421084de9e05", "score": "0.5919273", "text": "def click_create_new_intake\n wait_for_element_and_click intake_link\n end", "title": "" }, { "docid": "711dc54a0e3e80cbc38575b6c32bf517", "score": "0.59062445", "text": "def continue\n frm.button(:value=>\"Continue\").click\n BuildTemplate.new(@browser)\n end", "title": "" }, { "docid": "711dc54a0e3e80cbc38575b6c32bf517", "score": "0.59062445", "text": "def continue\n frm.button(:value=>\"Continue\").click\n BuildTemplate.new(@browser)\n end", "title": "" }, { "docid": "93083315b5e238189b877367087950d0", "score": "0.58992136", "text": "def go_to_course_creation\n create_new_course.click\n end", "title": "" }, { "docid": "402d8db1b5f82f30fd62cfd0ceb781bb", "score": "0.5889301", "text": "def click_create_study\n create_study_button.click\n end", "title": "" }, { "docid": "18593adf972747944ef9fdbee1816968", "score": "0.58525246", "text": "def test_create_vendor\n login\n sleep 15\n @driver.find_element(:xpath, \"//i[@name ='suitcase']\").click\n @driver.find_element(:xpath, \"//a[@ui-sref='vendors']\").click\n @driver.find_element(:xpath, \"//button[@uib-tooltip='Actions']\").send_keys :enter\n @driver.find_element(:link_text, \"New vendor\").click\n time = get_Present\n vendor_Name = \"Test vendor \"+ time\n @driver.find_element(:xpath, \"//input[@placeholder='Name']\").send_keys vendor_Name\n @driver.find_element(:xpath, \"//input[@placeholder='Legal name']\").send_keys \"Bharath\"\n\n terms = \"//select[@name='termCodeId']\"\n terms_index = \"2\"\n getSelect_by_index(terms,terms_index) \n\n tax = \"//select[@name='salesTaxId']\"\n tax_index = \"2\"\n getSelect_by_index(tax,tax_index)\n\n @driver.find_element(:xpath, \"//input[@placeholder='[email protected]']\").send_keys \"[email protected]\"\n # @driver.find_element(:xpath, \"//input[@placeholder='(55) 5555-5555']\").send_keys \"9848032919\"\n\n @driver.find_element(:xpath, \"//*[@id='main-section']/div/div[2]/div/div/div[2]/div/form/div[2]/div/submit-button/button\").send_keys :enter \n sleep 5\n puts \"created vendor with name: \"+vendor_Name\n \n end", "title": "" }, { "docid": "d8937829522b659d7b52f62c21206456", "score": "0.5848707", "text": "def create\n @car = Car.new(car_params)\n\n if @car.save\n respond_with(@car, location: cars_url, notice: 'Vehicle was successfully created.')\n else\n respond_with(@car)\n end\n end", "title": "" }, { "docid": "003f21202d50dcd36d1945287f1ff36c", "score": "0.58443296", "text": "def click_create_new_object\n wait_for_page_and_click object_link\n end", "title": "" }, { "docid": "003f21202d50dcd36d1945287f1ff36c", "score": "0.58443296", "text": "def click_create_new_object\n wait_for_page_and_click object_link\n end", "title": "" }, { "docid": "f32ea8f85e84eed3aa287448f3b63ee5", "score": "0.58419794", "text": "def create_site\n frm.button(:value=>\"Create Site\").click\n SiteSetup.new(@browser)\n end", "title": "" }, { "docid": "1e47ec52cb957e4048f1deaa8f8e2750", "score": "0.5836782", "text": "def click_create_new_acquisition\n wait_for_page_and_click acquisition_link\n end", "title": "" }, { "docid": "1e47ec52cb957e4048f1deaa8f8e2750", "score": "0.5836782", "text": "def click_create_new_acquisition\n wait_for_page_and_click acquisition_link\n end", "title": "" }, { "docid": "33842071cc7c98de8b548a06ce693d8e", "score": "0.5825812", "text": "def make_the_pizza\r\n click_button_with_id 'make_pizza_id'\r\n end", "title": "" }, { "docid": "9d6bccbdb6107f0d8bb96225996be96c", "score": "0.58092", "text": "def create\n @make = Make.new(params[:make])\n\n respond_to do |format|\n if @make.save\n format.html { redirect_to makes_path, notice: 'Car make was successfully created.' }\n format.json { render json: @make, status: :created, location: @make }\n else\n format.html { render action: \"new\" }\n format.json { render json: @make.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "201d6e05eb78c688bbcf15f75509a270", "score": "0.580191", "text": "def comp_register_button\n click_button 'Register'\n end", "title": "" }, { "docid": "9e9bd99dacbe83c692486daf8a7bdff3", "score": "0.5795659", "text": "def create_project(project_name)\n sleep 0.5\n project_element.when_present.value = project_name\n submit_project_element.when_present.click\n end", "title": "" }, { "docid": "8b810ca13df88891d45a7e963444bca6", "score": "0.5795622", "text": "def create_basic_course\n create_thing\n unless url_error_element.visible?\n self.wait_until(45) { self.text.include? \"Add content\" }\n self.button(:id=>\"group_create_new_area\", :class=>\"s3d-button s3d-header-button s3d-popout-button\").wait_until_present\n Library.new @browser\n end\n end", "title": "" }, { "docid": "ce78d9db6237763419e6b75c39ad2e2e", "score": "0.57586795", "text": "def create\n @carspec = Carspec.new(params[:carspec])\n\n respond_to do |format|\n if @carspec.save\n format.html { redirect_to @carspec, notice: 'Carspec was successfully created.' }\n format.json { render json: @carspec, status: :created, location: @carspec }\n else\n format.html { render action: \"new\" }\n format.json { render json: @carspec.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a88fbc5303a60edb7ae8cebfbeeab650", "score": "0.5747861", "text": "def submit\n within(PAGE_MENU) do\n click_button(\"Create\")\n end\n self\n end", "title": "" }, { "docid": "b5d57bdb51281222e749bbddee58e718", "score": "0.5746925", "text": "def create\n @vehicle_make = VehicleMake.new(vehicle_make_params)\n\n respond_to do |format|\n if @vehicle_make.save\n format.html { redirect_to @vehicle_make, notice: 'Vehicle make was successfully created.' }\n format.json { render action: 'show', status: :created, location: @vehicle_make }\n else\n format.html { render action: 'new' }\n format.json { render json: @vehicle_make.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "85f4041dfcdc30288670f9b3ab22ea18", "score": "0.5746892", "text": "def create\n @sim_carte = SimCarte.new(sim_carte_params)\n\n respond_to do |format|\n if @sim_carte.save\n format.html { redirect_to @sim_carte, notice: 'Sim carte was successfully created.' }\n format.json { render :show, status: :created, location: @sim_carte }\n else\n format.html { render :new }\n format.json { render json: @sim_carte.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9b230a407fb233b3877d244268a8c426", "score": "0.572597", "text": "def create\n @vehicle_make = VehicleMake.new(params[:vehicle_make])\n\n respond_to do |format|\n if @vehicle_make.save\n format.html { redirect_to :action => 'index', notice: 'Vehicle make was successfully created.' }\n format.json { render json: @vehicle_make, status: :created, location: @vehicle_make }\n else\n format.html { render action: \"new\" }\n format.json { render json: @vehicle_make.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a4845d1aaebddc9f54dd759bcaf83a28", "score": "0.57257813", "text": "def click_create_new_valuation_control\n wait_for_element_and_click valuation_control_link\n end", "title": "" }, { "docid": "ccc3d146f523e3cedb6a10870254c054", "score": "0.5714097", "text": "def goto_add_address\r\n add_address_btn.click\r\n end", "title": "" }, { "docid": "cb0d90770b0689a886a6f15d189ec3a3", "score": "0.5705269", "text": "def cadastrar\r\n click_button 'Submit'\r\n end", "title": "" }, { "docid": "84723105ddb015e91a78ef9b25bbcc30", "score": "0.5684571", "text": "def vehicle_prompt\n puts \"Enter new vehicle's information:\"\n vehicle_new = get_vehicle_attributes_and_create\n puts \"A new vehicle has been added to the garage\"\n puts \"New Vehicle ID: #{vehicle_new.id}\"\n seperator_and_text {press_return}\n gets.strip\n main_menu\n end", "title": "" }, { "docid": "5c5b6eab586e8c086e69a8461dc07bdb", "score": "0.56621766", "text": "def create_cafe_rouge\n visit '/restaurants/new'\n fill_in('restaurant[name]', :with => \"Cafe Rouge\")\n fill_in('restaurant[address]', :with => \"Kensington Church Street\")\n fill_in('restaurant[description]', :with => \"French Bistro\")\n click_button('Create Restaurant')\nend", "title": "" }, { "docid": "11e0e30eb6fd5b92f2a64ff24b16630d", "score": "0.56364083", "text": "def done\n frm.button(:name=>\"takeAssessmentForm:_id5\").click\n EditAssessment.new(@browser)\n end", "title": "" }, { "docid": "11e0e30eb6fd5b92f2a64ff24b16630d", "score": "0.56364083", "text": "def done\n frm.button(:name=>\"takeAssessmentForm:_id5\").click\n EditAssessment.new(@browser)\n end", "title": "" }, { "docid": "76e438f8a6bf0c3d2e1347b0b3243056", "score": "0.56096935", "text": "def create\n @car = Car.new(car_params)\n\n respond_to do |format|\n if @car.save\n format.html { redirect_to cars_path}\n format.json { render :show, status: :created, location: @car }\n else\n format.html { render :new }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "80776584fddb4df41c4bc2a713b77cae", "score": "0.56045693", "text": "def create\n @car_model = CarModel.new(car_model_params)\n\n if @car_model.save\n respond_with(@car_model, location: car_models_url, notice: 'Car model was successfully created.')\n else\n respond_with(@car_model)\n end\n end", "title": "" }, { "docid": "37f1f47e1d8835d4732397fed4030e84", "score": "0.56003845", "text": "def project_create\n create.click\n end", "title": "" }, { "docid": "6e0302c14f204eb22935ec9b8c98aefc", "score": "0.5598649", "text": "def add_test_player\n visit \"/add\"\n fill_in \"first_name\", with: \"George\"\n fill_in \"surname\", with: \"Test\"\n fill_in \"gender\", with: \"M\"\n fill_in \"club\", with: \"Mantester Utd\"\n fill_in \"country\", with: \"Northern RSpec\"\n fill_in \"position\", with: \"Midfield\"\n fill_in \"date_of_birth\", with: \"1946-05-22\"\n click_button \"Submit\"\nend", "title": "" }, { "docid": "916c31e91cfb1530d0b86d09e3b442d9", "score": "0.55959415", "text": "def sign_up_capy(name, color)\n visit \"/capys/new\"\n # save_and_open_page\n fill_in \"name\", with: name\n fill_in \"color\", with: color\n click_on \"Create Capy\"\nend", "title": "" }, { "docid": "475d35ea77837de2fd2e3c2900e4e2db", "score": "0.5595752", "text": "def create\n @car = Car.new(params[:car])\n\n\n if @car.save\n redirect_to @car, notice: 'Car was successfully created.'\n\n else\n render action: \"new\"\n\n end\n\n end", "title": "" }, { "docid": "1e3699f619a69fa6c72b99069576e8fb", "score": "0.55940753", "text": "def create()\n\t\tclick Template_Btn\n\t\twait_for(10) { is_displayed? Create_New }\n\t\tclick Create_New, Select_Template\n\t\ttype 'Auto Catagory', Catagory_Field\n\t\ttype 'Temporary Template', Name_Field\n\t\tclick Create_Button\n\t\twait_for(10) { is_displayed? Subject_Field }\n\t\ttype 'This is an automated template', Subject_Field\n\t\tsleep(8)\n\t\tswitch_frame(0)\n\t\ttype_paragraph Iframe_Id, 8\n\t\tswitch_back_to_original_frame\n\t\tclick Save_Updates\n\tend", "title": "" }, { "docid": "b3424e1ad2551c3109dadb3551ec6381", "score": "0.5580408", "text": "def create\n @car = Car.new(car_params)\n\n respond_to do |format|\n if @car.save\n format.html do\n redirect_to cars_path\n flash[:success] = 'Car was successfully created.'\n end\n format.json { render :show, status: :created, location: @car }\n else\n format.html { render :new }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a9ca45538fb8675b8137607b405191eb", "score": "0.5577234", "text": "def createPrize()\n sleep(3)\n clickOnNewPrize()\n enterPrizeDetails()\n selectAward()\n #uploadPrizeImage() currently this functionality is not working\n selectCriteria()\n enterCriteriaDesc()\n selectScope()\n #eligibilityDate() currently this functionality is not working\n clickOnCreatePrize()\n #verifyPrizeCreated(\"Automation Prize Title\")\n end", "title": "" }, { "docid": "2f8e2f7d5c1c61dfb98372b9c92dc534", "score": "0.55750525", "text": "def create_new_customer(firstname, lastname, country, email, loginname)\n customer_nav_lnk.click\n wait_for_ajax\n cus_create_form.firstname_input.set firstname\n cus_create_form.lastname_input.set lastname\n cus_create_form.country_opt.select(country)\n cus_create_form.email_input.set email\n cus_create_form.login_input.set loginname\n cus_create_form.create_account_chk.set true\n cus_create_form.save_btn.click\n wait_for_ajax\n end", "title": "" }, { "docid": "246cb7dbb05c6882fce8d30a9563a0a2", "score": "0.55658835", "text": "def new_page\n frm.link(:text=>\"New Page\").click\n NewPage.new(@browser)\n end", "title": "" }, { "docid": "2126dbc31094551b11c9768e176de484", "score": "0.55547875", "text": "def begin_assessment\n frm.button(:value=>\"Begin Assessment\").click\n end", "title": "" }, { "docid": "2126dbc31094551b11c9768e176de484", "score": "0.55547875", "text": "def begin_assessment\n frm.button(:value=>\"Begin Assessment\").click\n end", "title": "" }, { "docid": "07b01d5d77439bf5c2a8b750ae738678", "score": "0.5540383", "text": "def create\n @carmodel = Carmodel.new(carmodel_params)\n\n respond_to do |format|\n if @carmodel.save\n format.html { redirect_to @carmodel, notice: 'Carmodel was successfully created.' }\n format.json { render :show, status: :created, location: @carmodel }\n else\n format.html { render :new }\n format.json { render json: @carmodel.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bdb97601f58bd797ec1ff776189fc7ed", "score": "0.5535799", "text": "def choice_cars(pick_up, drop_off)\n wait_until_cars_visible\n car_tour_field = 'div[id=cars] span[class=select2-chosen]'\n choice_city = '.select2-result-label'\n find(car_tour_field, text: 'Pick up Location').click\n find(choice_city, text: pick_up.to_s).click\n find(car_tour_field, text: 'Drop off Location').click\n find(choice_city, text: drop_off.to_s).click\n end", "title": "" }, { "docid": "074ce500183440da776c9072745d9cc6", "score": "0.5535032", "text": "def create_company\n self.company_name = 'Auto test company ' + Random.rand(100..999).to_s\n self.tel_code = Random.rand(10000..99999).to_s\n self.tel_number = Random.rand(10000..99999).to_s\n self.country = 'Россия'\n self.province = 'Свердловская'\n self.city = 'Екатеринбург'\n self.company_announce = 'test'\n self.submit\n end", "title": "" }, { "docid": "93f66d0bd961536408e3e47648223fb7", "score": "0.55333847", "text": "def create\n @car = Car.new(car_params)\n\n respond_to do |format|\n if @car.save\n format.html { redirect_to @car, notice: 'Car was successfully created.' }\n format.json { render :show, status: :created, location: @car }\n else\n format.html { render :new }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "93f66d0bd961536408e3e47648223fb7", "score": "0.55333847", "text": "def create\n @car = Car.new(car_params)\n\n respond_to do |format|\n if @car.save\n format.html { redirect_to @car, notice: 'Car was successfully created.' }\n format.json { render :show, status: :created, location: @car }\n else\n format.html { render :new }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "93f66d0bd961536408e3e47648223fb7", "score": "0.55333847", "text": "def create\n @car = Car.new(car_params)\n\n respond_to do |format|\n if @car.save\n format.html { redirect_to @car, notice: 'Car was successfully created.' }\n format.json { render :show, status: :created, location: @car }\n else\n format.html { render :new }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eee768428af0d4dcd759dae6e23d7a09", "score": "0.55287284", "text": "def create\n @car_model = CarModel.new(car_model_params)\n\n respond_to do |format|\n if @car_model.save\n format.html { redirect_to @car_model, notice: 'Car model was successfully created.' }\n format.json { render action: 'show', status: :created, location: @car_model }\n else\n format.html { render action: 'new' }\n format.json { render json: @car_model.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4689c2c901951e7e18ba365816a92dad", "score": "0.552156", "text": "def submit\n frm.button(:value=>\"Submit\").click\n Information.new(@browser)\n end", "title": "" }, { "docid": "4689c2c901951e7e18ba365816a92dad", "score": "0.552156", "text": "def submit\n frm.button(:value=>\"Submit\").click\n Information.new(@browser)\n end", "title": "" }, { "docid": "b020559f5a4f8b4bb40aec7d3da12682", "score": "0.551779", "text": "def create_resources\n @driver.find_element(:link, \"CREATE NEW RESOURCE\").click # button \"create new resource\"\n @driver.find_element(:name, \"name\").click # resource name\n @driver.find_element(:name,\"name\").send_keys \"resource#@min\"\n @driver.find_element(:xpath, \"(//input [@type='checkbox'])[1]\").click # checkbox internal\n @driver.find_element(:xpath, \"(//input [@type='text'])[2]\").click#calendar(from)\n @driver.find_element(:xpath, \"(//button[@type='button'])[2]\").click\n @driver.find_element(:xpath, \"(//button[@type='button'])[4]\").click\n @driver.find_element(:xpath, \"(//button[@type='button'])[8]\").click\n @driver.find_element(:xpath, \"(//input[@type='text'])[3]\").click #calendar(to)\n @driver.find_element(:xpath, \"(//button[@type='button'])[50]\").click\n @driver.find_element(:xpath, \"(//button[@type='button'])[63]\").click\n @driver.find_element(:xpath, \"(//button[@type='button'])[84]\").click\n @driver.find_element(:xpath, \"(//input [@type='checkbox'])[3]\").click #checkbox yes AXA permision\n @driver.find_element(:xpath , \"(//button[3])\").click # button create\nend", "title": "" }, { "docid": "08641518c1f4064941e5090cc1aa47f7", "score": "0.55164397", "text": "def create\n @car = Car.new(car_params)\n\n respond_to do |format|\n if @car.save\n format.html { redirect_to @car, notice: 'Car successfully created.' }\n format.json { render :show, status: :created, location: @car }\n else\n format.html { render :new }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "79bfb9e7b890f9b8cfcae1624d29e474", "score": "0.55163014", "text": "def create_research_project\n create_thing\n unless url_error_element.visible?\n self.button(:id=>\"group_create_new_area\", :class=>\"s3d-button s3d-header-button s3d-popout-button\").wait_until_present\n ResearchIntro.new @browser\n end\n end", "title": "" }, { "docid": "8b94cd99bbf1ceb98d180c0e9907d006", "score": "0.5512651", "text": "def create\n @car = Car.new(permitted_params.car)\n\n respond_to do |format|\n if @car.save\n format.html { redirect_to @car, notice: 'Car was successfully created.' }\n format.json { render action: 'show', status: :created, location: @car }\n else\n format.html { render action: 'new' }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5a3aa2d22b7d04a7a03509209d89b4c7", "score": "0.55075586", "text": "def new_incident\n find('#new-incident').click\n end", "title": "" }, { "docid": "45fb673d20709cbd6cd5d9988e167607", "score": "0.55000323", "text": "def create\n @new_car = NewCar.new(params[:new_car])\n\n respond_to do |format|\n if @new_car.save\n format.html { redirect_to @new_car, notice: 'New car was successfully created.' }\n format.json { render json: @new_car, status: :created, location: @new_car }\n else\n format.html { render action: \"new\" }\n format.json { render json: @new_car.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "81812fca3d5d54d7e9a02031fe72fd69", "score": "0.54968774", "text": "def create\n @car_make_section = CarMakeSection.new(params[:car_make_section])\n\n respond_to do |format|\n if @car_make_section.save\n format.html { redirect_to(@car_make_section, :notice => 'Car make section was successfully created.') }\n format.xml { render :xml => @car_make_section, :status => :created, :location => @car_make_section }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @car_make_section.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f3b05cbd8d4dd7b3bf1089fb11c5f7f7", "score": "0.54945946", "text": "def click_create_new_movement\n wait_for_page_and_click movement_link\n end", "title": "" }, { "docid": "172832c0681441c1452242bb7e55760e", "score": "0.54873985", "text": "def create\n @car = Car.new(car_params)\n\n if @car.save\n redirect_to admin_cars_path, success: 'Car was successfully created.'\n else\n render :new\n end\n end", "title": "" }, { "docid": "d5f10b35c36e81ae15d0a1d5c495f1da", "score": "0.5487268", "text": "def create()\n\t\tclick Create_Task\n\t\twait_for(20) { is_displayed? Subject }\n\t\tclick Subject\n\t\t# binding.pry\n\t\twait_and_type_enter 'Automated Template', Type_Subject\n\t\twait_and_type_enter '[email protected]', Contact_Person\n\t\ttype_paragraph Notes, 2\n\t\tclick Save_Task\n\t\tsleep(2)\n\tend", "title": "" }, { "docid": "4dab9b5c6a74b1757d66b43c8cfb23ed", "score": "0.54759705", "text": "def clickButtonSim\r\n button_sim.click\r\n end", "title": "" }, { "docid": "934bd85520a27e4c1af2c30fba3d1cd5", "score": "0.54720587", "text": "def create_new_study\n create_study.click\n end", "title": "" }, { "docid": "7dbb6e0e1d899b08ba435c60d561f543", "score": "0.5471365", "text": "def create\n @car = Car.new(params[:car])\n\n respond_to do |format|\n if @car.save\n format.html { redirect_to admin_car_url(@car), notice: 'Car was successfully created.' }\n format.json { render json: @car, status: :created, location: @car }\n else\n format.html { render action: \"new\" }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4401243ec3deaa7c353b0fd1e56ddf42", "score": "0.54676986", "text": "def create\n @car_year_model = CarYearModel.new(params[:car_year_model])\n\n respond_to do |format|\n if @car_year_model.save\n format.html { redirect_to(@car_year_model, :notice => 'Car year model was successfully created.') }\n format.xml { render :xml => @car_year_model, :status => :created, :location => @car_year_model }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @car_year_model.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cada80d853e0bc29cd74cc17486ca0a6", "score": "0.54636955", "text": "def create\n @carmodel = Carmodel.new(carmodel_params)\n\n respond_to do |format|\n if @carmodel.save\n format.html { redirect_to @carmodel, notice: \"Car model was successfully created.\" }\n format.json { render :show, status: :created, location: @carmodel }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @carmodel.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ae416696002bd3e6d69c5cb7683d7b9e", "score": "0.54596806", "text": "def create\n if !Robot.all().any?\n @robot = Robot.new({x:0, y:0, orientation:0, on_table:false})\n @robot.save\n respond_to do |format|\n format.js {render \"make\"} # Call the 'make' script updating the creation/deletion button.\n end\n else # If the database already contains a robot, alert the user that no more robot can be created.\n render js: \"alert('The robot is already created!')\"\n end\n end", "title": "" }, { "docid": "fdec8f8b57f56916bee5213f7aa682be", "score": "0.5449336", "text": "def preenche_formulario\n\t@name = Faker::Name.name\n \t@email = Faker::Internet.email\n \t@person = Faker::StarWars.character\n\n \tname_field.set(@name)\n \temail_field.set(@email)\t\n \tyes_rdbutton.click\n \tnameMovie_field.set(@person)\n \tpersonFav_field.set(@person)\n \tfavMovie.click\n no_field.click\n sleep 1\nend", "title": "" }, { "docid": "47a777592573daa2cd09b5952c8a991a", "score": "0.54462886", "text": "def create\n @car_model = CarModel.new(params[:car_model])\n\n respond_to do |format|\n if @car_model.save\n flash[:notice] = 'CarModel was successfully created.'\n format.html { redirect_to(@car_model) }\n format.xml { render :xml => @car_model, :status => :created, :location => @car_model }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @car_model.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "91c5b291140b0de953447533d183fd05", "score": "0.54370004", "text": "def create\n\t # Builds new car instance using parameters user has filled in the form\n\t @car = current_user.cars.build(car_params)\n\t # Setting the car's type\n\t @car.type_id = params[:type_id]\n\t # Attempts to save car instance\n\t if @car.save\n\t \t# Once saved, page is redirected to home page\n\t \tredirect_to root_path\n\t else\n\t \t# If car instance has not been saved, form is rendered again\n\t \trender 'new'\n\t end\n\tend", "title": "" }, { "docid": "72816d6fd8d05217d5ad32755beff823", "score": "0.5434759", "text": "def continue\n frm.button(:value=>\"Continue\").click\n CourseSiteInfo.new(@browser)\n end", "title": "" }, { "docid": "896b47cc7fb9b1730a8545cd4794322a", "score": "0.54262793", "text": "def new\n @car_model = CarModel.new\n @car_makes = CarMake.find(:all)\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @car_model }\n end\n end", "title": "" }, { "docid": "830fb758b5b63816cfea525530299d51", "score": "0.5426012", "text": "def create\n @model = Model.new(params.require(:model).permit(:first_year_made, :last_year_made, :make_id, :name))\n ok = validateModel?(@model, true)\n okUrl, errAction = setSaveAction('new', models_url)\n\n respond_to do |format|\n if ok and @model.save\n format.html { redirect_to okUrl,\n notice: 'Model was successfully created.' }\n format.json { render json: @model, status: :created,\n location: @model }\n else\n prepFormVariables\n format.html { render action: errAction }\n format.json { render json: @model.errors,\n status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "352311e65286db758c5c71d0ace9fdf5", "score": "0.5413623", "text": "def create\n builder_or_text = frm.radio(:value=>\"1\", :name=>\"authorIndexForm:_id29\").set?\n\n frm.button(:value=>\"Create\").click\n\n if builder_or_text == true\n EditAssessment.new(@browser)\n else\n # Need to add Markup page class, then add the reference here.\n end\n\n end", "title": "" }, { "docid": "82bd21991f2f1efffbb98e304e11c5fe", "score": "0.54080766", "text": "def car(make, model)\n\tputs \"#{make} #{model}\"\nend", "title": "" }, { "docid": "8c1d57a33c4bff0ad8d30525b8a2422a", "score": "0.5405391", "text": "def finish\n frm.button(:value=>\"Finish\").click\n PortfolioTemplates.new(@browser)\n end", "title": "" }, { "docid": "8c1d57a33c4bff0ad8d30525b8a2422a", "score": "0.5405391", "text": "def finish\n frm.button(:value=>\"Finish\").click\n PortfolioTemplates.new(@browser)\n end", "title": "" }, { "docid": "9b8de5a5cb383389d82820152a2ffbee", "score": "0.5400666", "text": "def continue\n frm.button(:value=>\"Continue\").click\n TakeAssessmentList.new(@browser)\n end", "title": "" }, { "docid": "9b8de5a5cb383389d82820152a2ffbee", "score": "0.5400666", "text": "def continue\n frm.button(:value=>\"Continue\").click\n TakeAssessmentList.new(@browser)\n end", "title": "" }, { "docid": "8290193eb085f18841ddb4de46e9f5bf", "score": "0.53976053", "text": "def create\n builder_or_text = frm.radio(:value=>\"1\", :name=>\"authorIndexForm:_id29\").set?\n \n frm.button(:value=>\"Create\").click\n \n if builder_or_text == true\n EditAssessment.new(@browser)\n else\n # Need to add Markup page class, then add the reference here.\n end\n \n end", "title": "" }, { "docid": "376805c531cd0ea764ba07f8d9041004", "score": "0.539652", "text": "def test_user_can_submit_a_new_task_form_that_create_new_task\n visit '/tasks/new'\n assert_equal '/tasks/new', current_path\n within('#newTaskForm') do\n fill_in('task[title]', with: 'Feature Testing')\n fill_in('task[description]', with: 'I M using Capybara')\n click_button('create task') # id set as a value on the button\n end\n\n assert_equal '/tasks', current_path\n end", "title": "" }, { "docid": "35ec104db61e4e249c7ed3fd71b3e27f", "score": "0.5393803", "text": "def sub_b\n \[email protected](:text, \"Create Account\").click\n end", "title": "" }, { "docid": "523ef764c316999e1d7e575b4d61e9af", "score": "0.5393605", "text": "def create\n cleanUpForm\n @vehicle = Vehicle.new(params.require(:vehicle).permit(:bg_compliant, :carfax_copy_at_qual, :carfax_url,\n :color_id, :comments, :consumer_reports_url,\n :contract_id, :convertible, :country_of_manufacture_id,\n :current_kbb, :customer_id, :date_of_manufacture,\n :door_plate_image_id, :doors, :engine_cyl,\n :engine_displacement_id, :insurance_company_id,\n :insurance_image_id, :insurance_policy_number,\n :kbb_on_qual, :license_plate, :license_plate_state_id,\n :make_id, :mileage, :model, :mpg30after_initial,\n :msrp, :photos_image_id, :qualification_id,\n :service_schedule_id, :submodel_id, :vin,\n :vin_decoded, :wheel_drive_id))\n #p = params[:vehicle]\n # logger.info(\"==== create veh custid #{ @vehicle.customer_id }\")\n ok = validateForm?(@vehicle)\n okUrl, errAction = setSaveAction('new', vehicles_url)\n errAction = 'gfnew2' if errAction == 'gfnew' # 2 step form\n\n respond_to do |format|\n if ok and @vehicle.save\n format.html { redirect_to okUrl,\n notice: 'Vehicle was successfully created.' }\n format.json { render json: @vehicle, status: :created,\n location: @vehicle }\n else\n if errAction == 'gfnew2'\n prepFormVariables(@vehicle.make_id)\n @vehicle_customer_id = @vehicle.customer_id\n @vehicle_make_id = @vehicle.make_id\n @vehicle_contract_id = @vehicle.contract_id\n else\n prepFormVariables\n end\n format.html { render action: errAction }\n format.json { render json: @vehicle.errors,\n status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "546ea92c64d21c6414ada96be6554cf4", "score": "0.53919786", "text": "def test_order_creation_from_company\n\n check_product\n\n get_Company\n \n getElement_xpath(\"company_actions\").click\n\n getElement_text(\"Order\").click\n\n getElement_placeholder(\"Title\").send_keys \"Automation Order \"+get_Present\n \n getElement_placeholder_text(\"About this order\").send_keys \"Created by using Automation\"\n \n getElement_xpath(\"save\").click\n\n wait_for_ajax(@driver)\n\n puts \"Transaction name \"+getElement_xpath(\"trans_name\").text\n\n add_line_item\n end", "title": "" }, { "docid": "34a8a08e2b8d52da89d1de5ca805b1e5", "score": "0.5385594", "text": "def create\n @car_serial = CarSerial.new(params[:car_serial])\n\n respond_to do |format|\n if @car_serial.save\n format.html { redirect_to @car_serial, notice: 'Car serial was successfully created.' }\n format.json { render json: @car_serial, status: :created, location: @car_serial }\n else\n format.html { render action: \"new\" }\n format.json { render json: @car_serial.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7e26e4e8ea9c703c5a05e1334d8a8b3e", "score": "0.53682345", "text": "def new\n @vehicle = Vehicle.new\n @vehicle.build_model\n @vehicle.build_make\n @makes = Make.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vehicle }\n end\n end", "title": "" }, { "docid": "1bb50c5dcbeb640d727458d8af9f368e", "score": "0.5365983", "text": "def create\n @car_name = CarName.new(params[:car_name])\n\n respond_to do |format|\n if @car_name.save\n format.html { redirect_to @car_name, notice: 'Car name was successfully created.' }\n format.json { render json: @car_name, status: :created, location: @car_name }\n else\n format.html { render action: \"new\" }\n format.json { render json: @car_name.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9cac481c11343d03bf4d2f06a838e0b1", "score": "0.5364783", "text": "def create\n @car = Car.new(params[:car])\n redirect_to(cars_url, :notice => 'Creating cars is disabled on heroku.')\n end", "title": "" }, { "docid": "980848b14782a93c85fa6a276de95e08", "score": "0.5362721", "text": "def create\n @car = current_user.cars.new(car_params)\n \n respond_to do |format|\n if @car.save\n format.html { redirect_to car_build_index_path @car }\n\n #format.html { redirect_to @car, notice: 'Car was successfully created.' }\n #format.json { render action: 'show', status: :created, location: @car }\n else\n format.html { render action: 'new' }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "da8449665db59ff73c4f86721cf2bb5c", "score": "0.53625166", "text": "def save\n obj_retry(\"button\") do; det.button(:name, 'Submit'); end\n end", "title": "" }, { "docid": "fd30d61219dfb2ac17fdc0936faebb6b", "score": "0.5361715", "text": "def sign_up\n self.sign_up_link\n self.button(:id=>\"save_account\").wait_until_present\n sleep 3\n CreateNewAccount.new @browser\n end", "title": "" }, { "docid": "aa0eed274535f5eeb13661d5c0793ccc", "score": "0.53586483", "text": "def load_page(base_url)\n get \"#{base_url}/create\"\n wait_for_title 'Create New'\n end", "title": "" } ]
693e8dd05bed06df9b3e60a433097834
Returns the link containing the commenter's name at a given index in the list of comments
[ { "docid": "42c34173baffed8e5a1e4b733ecf5e98", "score": "0.85405654", "text": "def commenter_link(index)\n comment_elements[index].link_element\n end", "title": "" } ]
[ { "docid": "e5d5a3bd3445307ff015bd007e552927", "score": "0.8215443", "text": "def commenter_name(index)\n commenter_link(index).text\n end", "title": "" }, { "docid": "4712fc4e4127857fb240a573a9f59d1a", "score": "0.7977978", "text": "def commenter_name(index_position)\n comment_elements[index_position].link_element.text\n end", "title": "" }, { "docid": "8f324cbd02183452c72c956008bc615e", "score": "0.6722206", "text": "def get_link_id(comment)\n\treturn comment['name']\nend", "title": "" }, { "docid": "602c115ce5829cd35668cc93ceba2046", "score": "0.66945696", "text": "def comment_body_link(index, link_text)\n link_element(xpath: \"//div[@data-ng-repeat='comment in asset.comments'][#{index + 1}]//p/a[contains(.,'#{link_text}')]\")\n end", "title": "" }, { "docid": "7b802910de7c074e84e9dc8699b0de16", "score": "0.65419847", "text": "def comments_link\n if allow_comments\n nav_item do\n h.link_to \"<i class='icon-comments'></i>Comments (#{comments.count})\".html_safe, \"#{full_url}#comments\"\n end\n end\n end", "title": "" }, { "docid": "aca606735bec5f188daf54aa8bfca616", "score": "0.6505089", "text": "def comment_author(comment)\n if comment.url and comment.url != ''\n return \"<a href=\\\"#{comment.url}\\\" title=\\\"View #{comment.name}'s website\\\">#{comment.name}</a>\"\n else\n return comment.name\n end\n end", "title": "" }, { "docid": "d247855deecdca1b66a22db0560b06ba", "score": "0.64220804", "text": "def get_comments_link\r\n\t\tcomments_link = post.at_css('.comments')[\"href\"]\r\n\tend", "title": "" }, { "docid": "3930aade6ac30a75ef0094ab8df12332", "score": "0.6283685", "text": "def comment_body_link(driver, index_position, link_text)\n driver.find_element(:xpath => \"//div[@data-ng-repeat='comment in asset.comments'][#{(index_position + 1).to_s}]//p/a[text()='#{link_text}']\" )\n end", "title": "" }, { "docid": "492cf4f6bf15a1d94d0f2dd96b1ed352", "score": "0.6198459", "text": "def details_link(index=0)\n details_links[index]\n end", "title": "" }, { "docid": "492cf4f6bf15a1d94d0f2dd96b1ed352", "score": "0.6198459", "text": "def details_link(index=0)\n details_links[index]\n end", "title": "" }, { "docid": "492cf4f6bf15a1d94d0f2dd96b1ed352", "score": "0.6198459", "text": "def details_link(index=0)\n details_links[index]\n end", "title": "" }, { "docid": "2d268be13cfb428167f00098095397ed", "score": "0.61394846", "text": "def get_pseud_or_mailaddress(comment)\n if comment.pseud_id\n link_to comment.pseud.byline, [comment.pseud.user, comment.pseud]\n else\n comment.name\n end\n end", "title": "" }, { "docid": "36cd7e45832664f7b4f33c406cc86817", "score": "0.6121532", "text": "def discourse_link comments_id\n link = \"\n<div class=\\\"post-links\\\">\n <p>For help and discussion</p>\n <a target=\\\"_blank\\\" href=\\\"#{$config['forum_url']+$config['forum_thread_prefix']+comments_id}\\\">\n Comments on this chapter\n </a>\n</div>\n\"\nend", "title": "" }, { "docid": "9cdaff6110f320de87ba164ea1db6773", "score": "0.61170995", "text": "def comment_reaction_link(comment, name)\n link_to comment_reaction_text(comment, name),\n reactions_path(reaction: { reactable_id: comment.id,\n reactable_type: \"Comment\",\n name: name }),\n method: :post\n end", "title": "" }, { "docid": "80a570fe95eaa3f8eb1db83ee87a1c14", "score": "0.6080437", "text": "def get_comment_url(tds)\n return COMMENT_URL_PREFIX + CGI::escape(\"Development Application Enquiry: \" + tds[0].at('a').text)\nend", "title": "" }, { "docid": "80a570fe95eaa3f8eb1db83ee87a1c14", "score": "0.6080437", "text": "def get_comment_url(tds)\n return COMMENT_URL_PREFIX + CGI::escape(\"Development Application Enquiry: \" + tds[0].at('a').text)\nend", "title": "" }, { "docid": "80a570fe95eaa3f8eb1db83ee87a1c14", "score": "0.6080437", "text": "def get_comment_url(tds)\n return COMMENT_URL_PREFIX + CGI::escape(\"Development Application Enquiry: \" + tds[0].at('a').text)\nend", "title": "" }, { "docid": "80a570fe95eaa3f8eb1db83ee87a1c14", "score": "0.6080437", "text": "def get_comment_url(tds)\n return COMMENT_URL_PREFIX + CGI::escape(\"Development Application Enquiry: \" + tds[0].at('a').text)\nend", "title": "" }, { "docid": "dcbc329b17fb52fcc6b2091d20310103", "score": "0.592222", "text": "def getCommentByName(name)\n\t \tquery = SearchQuery.new\n\t \tquery.name = name\n\t\titem = search(query)[0]\n\t\tif ! item.nil?\n\t\t\titem.getMySelf(@COMMENT)\n\t\tend \n\t end", "title": "" }, { "docid": "76e9ddd6e6775df83f00edf2d9454ffb", "score": "0.58810025", "text": "def comment_url_helper(comment)\n post = comment.post\n topic = post.topic\n [topic, post, comment]\n end", "title": "" }, { "docid": "76e9ddd6e6775df83f00edf2d9454ffb", "score": "0.58810025", "text": "def comment_url_helper(comment)\n post = comment.post\n topic = post.topic\n [topic, post, comment]\n end", "title": "" }, { "docid": "806bea6a2e90237590cc36db8efce9e0", "score": "0.5839629", "text": "def link_to_ancre_comments\n return \"\" unless has_comments_valided?\n \"Commentaires (#{comments(valided: true).count})\".in_a(href: \"#lire_comments\")\n end", "title": "" }, { "docid": "074df1825adc01076cd46087900bb607", "score": "0.58299494", "text": "def disqus_link(item)\n path = route_path(item)\n path.gsub!(/index\\.html$/, '#disqus_thread')\n link = \"<a href=\\\"#{path}\\\">View comments</a>\"\n return link\nend", "title": "" }, { "docid": "4665d028b8a03ade62d16ecc51aef358", "score": "0.58132964", "text": "def get_comment_id\n @doc.css('.comhead > .age > a:first-child').map{|ele| ele['href']}.map {|x| x[/\\d+/]}\n end", "title": "" }, { "docid": "8cce5a0255e5aa708941442623fa759d", "score": "0.5790123", "text": "def commenter\n \tobject.user.name\n end", "title": "" }, { "docid": "8c0acfdbe70a1e5ee2eb8158e5050e59", "score": "0.5753127", "text": "def commenters\n @commenters ||= comments.index_by { |comment| comment.user.login }.keys\n end", "title": "" }, { "docid": "a3b23e618e14734a0b1258c1b3532c55", "score": "0.57490396", "text": "def permalink_comment_path(comment)\n permalink_path(comment.post, \"#comment-#{comment.id}\")\n end", "title": "" }, { "docid": "8c551338d8ada2662161bb290ee29f53", "score": "0.57485443", "text": "def get(comment_nr)\r\n self.collect.each do |comment|\r\n return comment if (comment.nr == comment_nr.to_i)\r\n end\r\n end", "title": "" }, { "docid": "2e6306770688d7d40827a12119d7772d", "score": "0.5739289", "text": "def commenter\n self.user.name\n end", "title": "" }, { "docid": "5144aa20902e18de231f86c42c9cc187", "score": "0.5734905", "text": "def commentable_name\n self.title\n end", "title": "" }, { "docid": "41fa0ed617df395cd4d04774920acf94", "score": "0.57061976", "text": "def comments_url\n if wall?\n (person_url @person)+'#tWall' # go directly to comments tab\n elsif blog?\n blog_post_url(@blog, @post)\n elsif event?\n @event\n end\n end", "title": "" }, { "docid": "8d016ca044eb5b1c61250581d0e28302", "score": "0.5678631", "text": "def tiny_comment_count_link(item)\n return '' if item.is_a?(Blog)\n item = item.profile if item.is_a?(User)\n count = if item.nil? then 0\n elsif item.respond_to?(:comment_count) then item.comment_count.to_i\n elsif item.respond_to?(:leaves) then item.leaves.count\n else 0\n end\n return '' if count.zero?\n title = if count == 1 then \"(1 comment)\".t\n else \"(%d comments)\" / [count]\n end\n \n general_link = if item.is_a?(Comment)\n link_to(title, :controller => 'user', :action => 'thread', :id => user.id, :thread_id => item.id, :anchor => \"reply-to=#{item.id}\")\n elsif item.is_a?(User)\n link_to(title, :controller => '/user', :action => 'index', :id => item, :anchor => 'user-wall') \n elsif item.is_a?(Profile)\n link_to(title, :controller => '/user', :action => 'index', :id => item.user, :anchor => 'user-wall')\n else \n link_to(title, content_url(item) + '#comment_form')\n end\n return general_link\n end", "title": "" }, { "docid": "d12c52169bbff9787829df6f5ab4134d", "score": "0.56749666", "text": "def commentable_name\n begin\n self.title\n rescue\n \"\"\n end\n end", "title": "" }, { "docid": "f5ab3bd3c524d2a72df58f1cc1ca05b0", "score": "0.5670231", "text": "def comment_index_canonical(comment)\n # Comments are sorted by created_at, see above\n comment_index = comments.index(comment)\n if comment_index\n # Normal case\n comment_index + 1\n else\n # Prevent unusual exception, see comments above\n comments.length + 1\n end\n end", "title": "" }, { "docid": "dbf6e22009afea4d0c1e0e062792736c", "score": "0.5626304", "text": "def comments_link(article)\n link_to pluralize(article.comments.size == 0 ? \"No\" : article.comments.size.to_s, \"Comment\"), article_comments_path(article)\n end", "title": "" }, { "docid": "f7d8e7f0ecfadf2186cf1fbead55c924", "score": "0.55781984", "text": "def index_comment\n query = find_or_create_query(:Comment, by: params[:by])\n show_selected_comments(query, id: params[:id].to_s, always_index: true)\n end", "title": "" }, { "docid": "341e137e493814acb2138dc56a5a7470", "score": "0.554811", "text": "def listing_media_comments_link(listing)\n if can? :edit, listing\n listing_comments_path(listing)\n else\n listing_path(listing, anchor: 'comments-anchor')\n end\n end", "title": "" }, { "docid": "49de03700d87d65bc8141a7b11bdbdd9", "score": "0.5540944", "text": "def path_name(comment)\n if comment.commented_on_type == \"Topic\"\n return topic_path(@comment.commented_on_id)\n elsif comment.commented_on_type == \"CampaignTab\"\n return campaign_tab_path(@comment.commented_on_id)\n end\n end", "title": "" }, { "docid": "86c4e8f7510e6621100f6387f6495b67", "score": "0.5538053", "text": "def poly_link\n \"<a href='/#{commentable_type.pluralize.downcase}/#{commentable_id}'>#{commentable_name}</a>\\n\"\n end", "title": "" }, { "docid": "bc3bbecf99d87269a76fee26d2cccf84", "score": "0.552612", "text": "def gh_commit_comment_link(repo, comment_id, commit_id)\n path = \"#{repo}/commit/#{commit_id}#commitcomment-#{comment_id}\"\n label = commit_id[0..9]\n\n gh_link path, :label => label\nend", "title": "" }, { "docid": "2fdb73c7ca73cc35168196118fc32ed1", "score": "0.5524514", "text": "def index\r\n @comments = @commentable.comments\r\n end", "title": "" }, { "docid": "409f8db33caa467be8b91cb52ae65feb", "score": "0.55146784", "text": "def date_time_comment_linked(comment, post)\n return \"<a href=\\\"#{Post.permalink(post)}\\#c#{comment.id.to_s}\\\" title=\\\"Permalink for this comment\\\">#{comment.created_at.strftime(Preference.get_setting('date_format'))} at #{comment.created_at.strftime(Preference.get_setting('time_format'))}</a>\"\n end", "title": "" }, { "docid": "8c6286a552066a48ffab126f42026c86", "score": "0.55069566", "text": "def reply_button_element(index)\n button_element(xpath: \"//div[@data-ng-repeat='comment in asset.comments'][#{index + 1}]//button[@title='Reply to this comment']\")\n rescue Selenium::WebDriver::Error::NoSuchElementError\n nil\n end", "title": "" }, { "docid": "756ae73443d7f53d4d608c651d80e479", "score": "0.5504521", "text": "def author(index)\n @authors[index]\n end", "title": "" }, { "docid": "6cf9ef39da32d83638850a1cfefc4207", "score": "0.5503542", "text": "def url\n root.url + '/#comment_' + id.to_s\n end", "title": "" }, { "docid": "ddc398606f3822f267a1b3cafb1c0dde", "score": "0.549508", "text": "def index\n @comments = @commentable.comments\n end", "title": "" }, { "docid": "ddc398606f3822f267a1b3cafb1c0dde", "score": "0.549508", "text": "def index\n @comments = @commentable.comments\n end", "title": "" }, { "docid": "ddc398606f3822f267a1b3cafb1c0dde", "score": "0.549508", "text": "def index\n @comments = @commentable.comments\n end", "title": "" }, { "docid": "79f081b7ec5be6674dd367fbf723d658", "score": "0.5483842", "text": "def deleteComment(index) \n if index < @Comments.size \n @Comments.delete_at(index) \n end\n end", "title": "" }, { "docid": "8f842068446bfff1c239f47d68adb606", "score": "0.5476511", "text": "def add_comment_link(post)\n if post.comment_status == 1\n return '&nbsp;<a href=\"#post\" title=\"Post yours &rarr;\">Post yours &rarr;</a>'\n else\n return ''\n end\n end", "title": "" }, { "docid": "8b48b9d1cec68380d839423a51f22f19", "score": "0.5427557", "text": "def edit_comment_link(comment)\n \"(\" +\n link_to_remote(\"Edit\", \n {:url => {:controller => :comments, :action => :edit, :id => comment, :comment_id => params[:comment_id]}, :method => :get}, \n {:href => fallback_url_for_comment(comment, \n {:add_comment => nil, :add_comment_reply_id => nil, :delete_comment_id => nil, :edit_comment_id => comment.id})} ) +\n \")\"\n end", "title": "" }, { "docid": "fcaec68c96e830dee4e49d3b9a4578d8", "score": "0.54186803", "text": "def delete_comment(index)\n comments.delete_at(index)\n end", "title": "" }, { "docid": "34e288abac101b90aa0a5a53c67bc361", "score": "0.54172957", "text": "def comments_url\n if image?\n prank_album_image_path(@prank, @album)\n elsif prank?\n @prank\n end\n end", "title": "" }, { "docid": "1dfedde247033622a8332e0aeb434220", "score": "0.5417042", "text": "def reddit_comment_path(permalink, key)\n return 'http://www.reddit.com' + permalink + 'c5' + key\n end", "title": "" }, { "docid": "8667953b58c0c843659414ab3306a9e4", "score": "0.54119927", "text": "def index\n @list = List.find(params[:list_id])\n @listing = @list.listings.find(params[:listing_id])\n if params[:limit].present?\n idx = 0\n @listing.comments.select! do |c|\n idx = idx + 1\n idx <= params[:limit].to_i\n end\n end\n gon.current_user_id = current_user.id if current_user\n gon.rabl(:template => 'app/views/users/comments/index.json.rabl', :as => \"list\")\n end", "title": "" }, { "docid": "aff15a6be999b9ad52a2758776350482", "score": "0.540261", "text": "def comment_path(drop, asset, comment = nil)\n comment_id = (comment) ? comment.id.to_s : ''\n return asset_path(drop,asset) + \"/comments/\" + comment_id\n end", "title": "" }, { "docid": "e69374f6e98d5d839178bbbb67c86ffa", "score": "0.53983235", "text": "def inbox_reply_link(comment)\n if comment.depth > ArchiveConfig.COMMENT_THREAD_MAX_DEPTH\n fallback_url = url_for(comment_path(comment, :add_comment_reply_id => comment.id, :anchor => 'comment_' + comment.id.to_s))\n else\n fallback_url = fallback_url_for_comment(comment, {:add_comment_reply_id => comment.id})\n end \n link_to \"Reply\", {:url => reply_user_inbox_path(current_user, :comment_id => comment), :method => :get}, :remote => true, :href => fallback_url\n end", "title": "" }, { "docid": "7028da5ca06d796c8952521ed9f49fae", "score": "0.53848815", "text": "def get_commenter_pseud_or_name(comment)\n if comment.pseud_id\n if comment.pseud.nil?\n 'Account Deleted'\n else\n comment.pseud.byline\n end\n else\n comment.name\n end\n end", "title": "" }, { "docid": "2d48dd1b2853addf0b37d88d740ee60b", "score": "0.5370524", "text": "def display_comments_of_post(post_index)\n post = @current_page.posts[post_index]\n if post.nil?\n IoManager.invalid_number_error(post_index, @current_page.posts.length)\n else\n update_current_comments(post.comments_link)\n IoManager.print_comment_array(@current_comments\n .format_all[0...MAX_COLLECTION])\n end\n end", "title": "" }, { "docid": "e49991a4d6413ac99a9629316e0d6ad2", "score": "0.5353896", "text": "def chat_msg_link(index, link_text)\n link_element(xpath: \"//div[@data-ng-repeat='chatMessage in chatMessages'][#{index}]//p/a[contains(.,'#{link_text}')]\")\n end", "title": "" }, { "docid": "8106a140b59f035b2f7a2e5d9b929d2d", "score": "0.5353787", "text": "def link(title)\n link = nil\n Agenda.index.each do |item|\n link = item.href if item.title == title\n end\n return link\n end", "title": "" }, { "docid": "5647093424c5b39324829e7caea9fb73", "score": "0.53507143", "text": "def comment\n @comments.join\n end", "title": "" }, { "docid": "aca28097a2b1218bc2c6f62059af9b6f", "score": "0.5348382", "text": "def add_comment_reply_link(comment)\n commentable_id = eval(\":#{comment.ultimate_parent.class.to_s.downcase}_id\")\n \"(\" + \n link_to_remote( \n \"Reply\", \n {:url => {:controller => :comments, :action => :add_comment_reply, :id => comment.id, :comment_id => params[:comment_id], commentable_id => (comment.ultimate_parent.id)}, :method => :get}, \n {:href => fallback_url_for_comment(comment, \n {:add_comment => nil, :edit_comment_id => nil, :delete_comment_id => nil, :add_comment_reply_id => comment.id})} ) +\n \")\"\n end", "title": "" }, { "docid": "4c95b0c0f84cf9dd027087437bd00b99", "score": "0.5347303", "text": "def commentable_name\n self.work.title\n end", "title": "" }, { "docid": "4c95b0c0f84cf9dd027087437bd00b99", "score": "0.5347303", "text": "def commentable_name\n self.work.title\n end", "title": "" }, { "docid": "b725b842e093c5df1d3a4e1f8eb5a304", "score": "0.53246284", "text": "def name_link(name, str = nil)\n if name.is_a?(Integer)\n str ||= \"#{:NAME.t} ##{name}\"\n link_to(str, name_path(name), { id: \"show_name_link_#{name}\" })\n else\n str ||= name.display_name_brief_authors.t\n link_to(str, name_path(name.id),\n { id: \"show_name_link_#{name.id}\" })\n end\n end", "title": "" }, { "docid": "b0f6d37b9d01f44335d46524486daba8", "score": "0.5312012", "text": "def get_commentor\n @doc.search(':not(.sitebit).comhead > a:first-child').map{|ele| ele.inner_text}\n end", "title": "" }, { "docid": "33e6965dff813eb0213a261a62b0490d", "score": "0.5308715", "text": "def name_link\n link_to contact_me.name, contact_me\n end", "title": "" }, { "docid": "f1f4325d0095070230113d4c6576a4c6", "score": "0.53069586", "text": "def author_link(listing)\n link_to(listing.author.name(@current_community), listing.author, {:title => listing.author.name(@current_community)})\n end", "title": "" }, { "docid": "b948559b6c26ca788e48294fb24b074e", "score": "0.53034604", "text": "def index\n\n @commentable = find_resource\n @comments = @commentable.comments\n\n end", "title": "" }, { "docid": "0b0a143df0627b05afcab933f43b8c6a", "score": "0.5286728", "text": "def comments \n @comments_array = (@doc.css('td.default').map do |comment_data|\n Comment.create(comment_data)\n end)\n puts @comments_array.class\n #puts all_the_text = ((@doc.css('td.default span.c00').text.split('-----')).each {|comment| comment.strip})[0]\n #puts the_username = @doc.css('td.default a')\n #Comment.create(comment)\n end", "title": "" }, { "docid": "1c94d823c8ef266fe0b08aa84ef9f0d5", "score": "0.5284091", "text": "def index\n @comments = Comment.where(\"report < 10\")\n #@user_name = @comment.user.name\n redirect_to posts_path\n end", "title": "" }, { "docid": "d20ceec23acfb5495d808b8e65a05674", "score": "0.52797025", "text": "def index\n puts \"\\n******** index_comment ********\"\n @comments = Comment.all\n end", "title": "" }, { "docid": "fa149fdd7743707c510dccd9707dd97b", "score": "0.52739066", "text": "def link\n #todo: allow the user to select which name to use\n n = names.reverse[0].name\n if Name.isMultiplePeople(n)\n link_id = id\n else \n link_id = n\n end\n '/people/' + link_id.to_s\n end", "title": "" }, { "docid": "abe03520e966097aa80a0f5f744da202", "score": "0.52562237", "text": "def index_comment # :nologin: :norobots:\n query = find_or_create_query(:Comment, :by => params[:by])\n show_selected_comments(query, :id => params[:id].to_s, :always_index => true)\n end", "title": "" }, { "docid": "21aa40efdab0a9fd77ce7f508f37e9bc", "score": "0.5254514", "text": "def get(comment_nr)\r\n fail \"must be a positive number\" unless comment_nr.to_s.is_positive_integer?\r\n\r\n self.collect.each do |comment|\r\n return comment if (comment.nr == comment_nr.to_i)\r\n end\r\n\r\n nil\r\n end", "title": "" }, { "docid": "ed65f12a4628b0514c5bd71af6f5a219", "score": "0.5249685", "text": "def index\n\t\t@comments = Comment.order(name: :asc)\n\tend", "title": "" }, { "docid": "bcf15ecfa360284e12e80a9686dd816d", "score": "0.52428144", "text": "def generateCommentOne(link, i)\n gfy_link = 'http://gfycat.com/fetch/'+link\n output = <<END\n[gfycat](#{gfy_link})\\s\\s\n\nEND\n output\nend", "title": "" }, { "docid": "41b93217223a73ed2069989909f15125", "score": "0.5240929", "text": "def link_to_ancre_write_comments\n return \"\" unless cu.trustable?\n \"Laisser un commentaire\".in_a(href: \"#comment_article\")\n end", "title": "" }, { "docid": "1f5a7b0560904f67429a500ff35238e1", "score": "0.5240103", "text": "def comment_url(comment_id=nil)\n comment_id = context.comment_id if comment_id.nil?\n \"https://github.com/#{context.repo}/issues/#{context.issue_id}#issuecomment-#{comment_id}\"\n end", "title": "" }, { "docid": "66c8cea8dbecb0217b25c60ff615ec2f", "score": "0.5224074", "text": "def author\n comments.first.author\n end", "title": "" }, { "docid": "06484af5a1599a3f7dbbfcdbea963411", "score": "0.5221173", "text": "def user_link(x, who=:creator)\n case x\n when CortexReaver::User\n name = x.name || x.login\n \"<a href=\\\"#{attr_h x.url}\\\">#{h name}</a>\"\n when CortexReaver::Comment\n if x.send(who)\n # Use attached creator/whoever\n user_link x.send(who)\n else\n # Use anonymous info\n name = x.name || x.email || 'Anonymous'\n if x.email\n s = \"<a href=\\\"mailto:#{attr_h x.email}\\\">#{h name}</a>\"\n if x.http\n s << \" (<a href=\\\"#{attr_h x.http}\\\" rel=\\\"nofollow\\\">#{h x.http}</a>)\"\n end\n s\n elsif x.http\n \"<a href=\\\"#{attr_h x.http}\\\" rel=\\\"nofollow\\\">#{h name}</a>\"\n else\n h name\n end\n end\n else\n if x.respond_to? who\n user_link x.send(who)\n elsif x.nil?\n # Hmm.\n ''\n else\n raise ArgumentError.new(\"don't know how to make a user link to #{x.inspect}\")\n end\n end\n end", "title": "" }, { "docid": "08ae6dfc25dd1c237cf8adbf14e0629e", "score": "0.52093893", "text": "def get_comments(limit=100,sort='new')\n\t\treturn ContentGenerator.new('http://www.reddit.com/user/'[email protected]_s+'/comments.json?sort='+sort,limit)\n\tend", "title": "" }, { "docid": "731c6b1358f9a6bb62f49e01dfb4cb47", "score": "0.5190193", "text": "def url(row)\n date_path = row[:comment_date_gmt].strftime(\"%Y/%m/%d\")\n \"#{TARGET_URL}#{row[:post_name]}.html\"\nend", "title": "" }, { "docid": "69b07ecce014e69bf720c79e0cdf24de", "score": "0.5180599", "text": "def link(name)\n @doc['links'][name]\n end", "title": "" }, { "docid": "212bd6083ed0a18a008aede8c9fff6fa", "score": "0.5170566", "text": "def m(name, display_name = nil)\n display_name ||= \"buster-#{name}\"\n url = doc_url(\"buster-#{decamelize(name)}\")\n\n if name =~ /.+#/\n pieces = name.split(\"#\")\n url = doc_url(\"buster-#{decamelize(pieces[0])}\") + \"##{pieces[1]}\"\n end\n\n \"<a href=\\\"#{url}\\\">#{display_name}</a>\".html_safe\n end", "title": "" }, { "docid": "833286c934e91363af8017a329bb1f3e", "score": "0.5170281", "text": "def add_comment_reply_link(comment)\n commentable_id = \"#{comment.ultimate_parent.class.to_s.underscore}_id\".to_sym\n commentable_value = comment.ultimate_parent.id\n link_to( \n \"Reply\", \n url_for(:controller => :comments, \n :action => :add_comment_reply, \n :id => comment.id, \n :comment_id => params[:comment_id], \n commentable_id => commentable_value),\n :remote => true)\n end", "title": "" }, { "docid": "b7e6a42474f528d4f9a2e2041ce9b934", "score": "0.51412076", "text": "def comment_username comment\n\t\tuser = User.find comment.user_id\n\t\tusername = \"\"\n\t\tif user && user.username\n\t\t\tusername = user.username\n\t\tend\t\n\t\treturn username\n\tend", "title": "" }, { "docid": "558728a38662130ce00f89deb083908f", "score": "0.51409906", "text": "def add_comment_link(commentable)\n commentable_id = \"#{commentable.class.to_s.underscore}_id\".to_sym\n commentable_value = commentable.id\n link_to(\n \"Comment\",\n url_for(:controller => :comments, :action => :add_comment, commentable_id => commentable_value),\n :remote => true) \n end", "title": "" }, { "docid": "661f5bdb0abd5e4c216efcf7c97fa544", "score": "0.5140861", "text": "def comment\n x = @name\n x += \" (#{@original_name})\" unless @original_name.nil?\n x\n end", "title": "" }, { "docid": "661f5bdb0abd5e4c216efcf7c97fa544", "score": "0.5140861", "text": "def comment\n x = @name\n x += \" (#{@original_name})\" unless @original_name.nil?\n x\n end", "title": "" }, { "docid": "f93d80e1fe018392cc26290a60b07eeb", "score": "0.5139036", "text": "def comments(doc)\n @comments_list = doc.search('.comment > font:first-child').map { |font| font.inner_text}\n p comments_list\n end", "title": "" }, { "docid": "fb87cdd739946f4a15252345d45891f8", "score": "0.51310015", "text": "def article_comments_path( article, comment_id = nil )\n Rails.application.routes.url_helpers._article_comments_path( :slug => article.full_url )+( comment_id.nil? ? '' : \"#comment-#{comment_id}\" )\n end", "title": "" }, { "docid": "6b590d163716ab0be2ff8c4771adb2fb", "score": "0.5124392", "text": "def comment_email(comment, commenter)\n @comment = comment\n @resource = comment.commentable\n @commenter = commenter\n mail(to: @comment.user.email, subject: \"#{commenter.name} commented on '#{view_context.strip_tags(@comment.commentable.name)}'\")\n end", "title": "" }, { "docid": "c2ebc1c6c8f74b5d24a75ac150927463", "score": "0.512261", "text": "def get_first_level_comments\r\n\t\tcomments_page = Nokogiri::HTML(open(comments_link))\r\n\t\tchild = comments_page.css('.child .entry')\r\n\t\tcomments = comments_page.css('.entry').select{|link| \r\n\t\t\t!(child.include?(link))\r\n\t\t}\r\n\t\tcomments[1..-1] # index 0 would be the initial post so we return all but the index 0\r\n\tend", "title": "" }, { "docid": "4bbc8f8cd10631c4f34a611ce5a5880e", "score": "0.5121487", "text": "def commentable_url(comment, options = {})\n if comment.commentable.is_a? Structure\n structure_url(comment.commentable, { subdomain: 'www', anchor: \"recommandation-#{comment.id}\" }.merge(options))\n elsif comment.commentable\n structure_course_url comment.commentable.structure, comment.commentable, { subdomain: 'www' }.merge(options)\n end\n end", "title": "" }, { "docid": "cbd43d46e3f961b8ea746da875e6173f", "score": "0.51192796", "text": "def name_link(name, str = nil)\n if name.is_a?(Integer)\n str ||= :NAME.t + \" #\" + name.to_s\n link_to(str, Name.show_link_args(name))\n else\n str ||= name.display_name.t\n link_to(str, name.show_link_args)\n end\n end", "title": "" }, { "docid": "8f1256b0166f7b3b699cdee7f35bb69b", "score": "0.5108542", "text": "def note_link(note)\n link_element(id: \"advising-note-search-result-header-link-#{note.id}\")\n end", "title": "" }, { "docid": "bcc2c0d693f11b486f8d981c9dac1118", "score": "0.5100141", "text": "def edit_button_element(index)\n button_element(xpath: \"//div[@data-ng-repeat='comment in asset.comments'][#{index + 1}]//button[@title='Edit this comment']\")\n rescue Selenium::WebDriver::Error::NoSuchElementError\n nil\n end", "title": "" }, { "docid": "d7f5983336d8baff7e82afda847d809c", "score": "0.50968975", "text": "def add_comment_link(commentable)\n commentable_id = eval(\":#{commentable.class.to_s.downcase}_id\")\n link_to_remote(\n \"Add Comment\",\n {:url => { :controller => :comments, :action => :add_comment, commentable_id => (commentable.id)}, :method => :get}, \n {:href => fallback_url_for_top_level(commentable, {:add_comment => true, :add_comment_reply_id => nil})} )\n end", "title": "" } ]
3fbc03d4c6bc797133a58ac4e7e2ee58
def name rid end
[ { "docid": "2c116b49093e9e5f1a43a4a6b6888349", "score": "0.0", "text": "def short\n rid\n end", "title": "" } ]
[ { "docid": "bbafb6243eac8aa73662abbbdfc3959e", "score": "0.8344623", "text": "def name() end", "title": "" }, { "docid": "c46e9ba44fc89c917b462bf75204fb61", "score": "0.80337435", "text": "def name\n \n end", "title": "" }, { "docid": "8374af945e2e0b9fed2531af7205c26e", "score": "0.80288327", "text": "def name\n end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.8019994", "text": "def name; end", "title": "" } ]
bddd6a10903088efb8af246f075d529d
PATCH/PUT /tuhu/brands/1 PATCH/PUT /tuhu/brands/1.json
[ { "docid": "ea15a2520d28c65493b1245650731696", "score": "0.6487213", "text": "def update\n respond_to do |format|\n if @tuhu_brand.update(tuhu_brand_params)\n format.html { redirect_to @tuhu_brand, notice: 'Brand was successfully updated.' }\n format.json { render :show, status: :ok, location: @tuhu_brand }\n else\n format.html { render :edit }\n format.json { render json: @tuhu_brand.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "116265a7f9e066972d73afa764876e28", "score": "0.7005842", "text": "def update_brands\n brands_raw = search_brands_shopstyle\n brands = format_brands_hash(brands_raw[\"brands\"])\n render json: {status: 0, data: {brands: brands}}\n end", "title": "" }, { "docid": "5e52ee0d859e4fc5688bc9c111ab9ddc", "score": "0.656897", "text": "def update\n if current_user.is_not_staff?\n flash[:error] = \"You do not have permissions to access that feature.\"\n redirect_to root_path and return\n end\n \n @bike_brand = BikeBrand.find(params[:id])\n\n respond_to do |format|\n if @bike_brand.update_attributes(params[:bike_brand])\n format.html { redirect_to @bike_brand, notice: 'Bike brand was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bike_brand.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "773a6658f62250448659cc414efe069a", "score": "0.6520966", "text": "def update\n boat = Boat.find_by(name: params[:name])\n\n if boat.update(boat_params)\n render json: BoatSerializer.new(boat).serialized_json\n else\n render json: errors(boat), status: 422\n end\n\n end", "title": "" }, { "docid": "2f082b5bc56e22dc8d0aa5e26bb9bce8", "score": "0.6467493", "text": "def update\n @buket = Buket.find(params[:id])\n\n respond_to do |format|\n if @buket.update_attributes(params[:buket])\n format.html { redirect_to @buket, notice: 'mother was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @buket.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a01cf3a8708bb8eedf8c88d276db6fe5", "score": "0.64644605", "text": "def update\n @brand = Brand.find(params[:id])\n\n respond_to do |format|\n if @brand.update_attributes(params[:brand])\n format.html { redirect_to brands_path, notice: 'Brand was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @brand.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e0369d90966db1deab59086803dbc477", "score": "0.6459615", "text": "def update\n respond_to do |format|\n if @brand_bike.update(brand_bike_params)\n format.html { redirect_to @brand_bike, notice: 'Brand bike was successfully updated.' }\n format.json { render :show, status: :ok, location: @brand_bike }\n else\n format.html { render :edit }\n format.json { render json: @brand_bike.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dcf65f89f7391d34616e460009d08d23", "score": "0.6448849", "text": "def update\n @brand = Brand.find(params[:id])\n\n respond_to do |format|\n if @brand.update_attributes(params[:brand])\n format.html { redirect_to @brand, :notice => 'Brand was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action=> \"edit\" }\n format.json { render :json => @brand.errors, :status=> :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "20446062dc76920039bffe3f57fea064", "score": "0.6442366", "text": "def update\n respond_to do |format|\n if @vehicle_brand.update(vehicle_brand_params)\n format.html { redirect_to @vehicle_brand, notice: 'Vehicle brand was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @vehicle_brand.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "10249ec4b351dd11ed46f6b7036f4594", "score": "0.6431782", "text": "def update\n render json: @brand.errors unless @brand.update(brand_params)\n end", "title": "" }, { "docid": "37f858e790170812c5a702cc601944a4", "score": "0.6423124", "text": "def update\n respond_to do |format|\n if @boletum.update(boletum_params)\n format.html { redirect_to @boletum, notice: 'Boletum was successfully updated.' }\n format.json { render :show, status: :ok, location: @boletum }\n else\n format.html { render :edit }\n format.json { render json: @boletum.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "213133730a225eee8a9f6a47731e7445", "score": "0.6421983", "text": "def update\n @my_bike = MyBike.find(params[:id])\n \n if @my_bike.update(my_bike_params)\n render json: @my_bike, status: :ok\n else\n render json: @my_bike.errors, status: :unprocessable_entity\n end\nend", "title": "" }, { "docid": "26f21c7d38b2d4d9cffd83f9854372d8", "score": "0.64088", "text": "def update\n beer = Beer.find(params[:id])\n beer.update(beer_params)\n render json: beer\n end", "title": "" }, { "docid": "7417be247dddf3f0dacd24617a8c1ff7", "score": "0.6404607", "text": "def update\n @brt = Brt.find(params[:id])\n\n respond_to do |format|\n if @brt.update_attributes(params[:brt])\n format.html { redirect_to @brt, notice: 'Brt was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @brt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bd79adcd12d261207c95940931bb2956", "score": "0.6401852", "text": "def update\n @brand = Brand.find(params[:id])\n respond_to do |format|\n if @brand.update_attributes(params[:brand])\n format.html { redirect_to @brand, notice: 'Brand was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @brand.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eb6e2ee321b71fa44c4372e6724bd63d", "score": "0.6395046", "text": "def update\n respond_to do |format|\n if @buket.update(buket_params)\n format.html { redirect_to @buket, notice: 'Buket was successfully updated.' }\n format.json { render :show, status: :ok, location: @buket }\n else\n format.html { render :edit }\n format.json { render json: @buket.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "59c39ede92ac75ec3d9d3eaabf64b2b3", "score": "0.63922817", "text": "def update\n respond_to do |format|\n if @super_bowl.update(super_bowl_params)\n format.html { redirect_to @super_bowl, notice: 'Super bowl was successfully updated.' }\n format.json { render :show, status: :ok, location: @super_bowl }\n else\n format.html { render :edit }\n format.json { render json: @super_bowl.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8914b545a10542d575a1795f2a02c385", "score": "0.63862985", "text": "def update\n @custom_bucket_hat.brand_id = params[:brand_id]\n respond_to do |format|\n if @custom_bucket_hat.update(custom_bucket_hat_params)\n format.html { redirect_to @custom_bucket_hat, notice: 'Custom bucket hat was successfully updated.' }\n format.json { render :show, status: :ok, location: @custom_bucket_hat }\n else\n format.html { render :edit }\n format.json { render json: @custom_bucket_hat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3a12d5a7d7b8c897ad851c3d5603ff0a", "score": "0.638476", "text": "def update\n @brand = Brand.find(params[:id])\n\n respond_to do |format|\n if @brand.update_attributes(params[:brand])\n format.html { redirect_to @brand, notice: 'Brand was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @brand.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2d7400fdc2a64a1e9fad443e862d0351", "score": "0.6383425", "text": "def update\n @my_bike = MyBike.find(params[:id])\n \n if @my_bike.update(my_bike_params)\n render json: @my_bike\n #head :no_content\n else\n render json: @my_bike.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "a2c058ab3cf8044f2b9420a63cc1728c", "score": "0.63717496", "text": "def update\n respond_to do |format|\n if @brite_rt_barabasis.update(brite_rt_barabasis_params)\n format.html { redirect_to @brite_rt_barabasis, notice: 'Brite rt barabasi was successfully updated.' }\n format.json { render :show, status: :ok, location: @brite_rt_barabasis }\n else\n format.html { render :edit }\n format.json { render json: @brite_rt_barabasis.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1bd8df422d765966687fba299523ce1e", "score": "0.6363576", "text": "def update\n @bread = Bread.find(params[:id])\n\n respond_to do |format|\n if @bread.update_attributes(params[:bread])\n format.html { redirect_to @bread, notice: 'Bread was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bread.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f94a98d0fdf56adc94eadc60fddc11e9", "score": "0.63560915", "text": "def update\n respond_to do |format|\n if @api_bottle.update(api_bottle_params)\n format.html { redirect_to @api_bottle, notice: 'Bottle was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_bottle }\n else\n format.html { render :edit }\n format.json { render json: @api_bottle.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99c66b481a1b32fed763928066a2d2f5", "score": "0.63558173", "text": "def update\n @super_bowl = SuperBowl.find(params[:id])\n\n respond_to do |format|\n if @super_bowl.update_attributes(params[:super_bowl])\n format.html { redirect_to @super_bowl, notice: 'Super bowl was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @super_bowl.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dbab8bf3451a4031beccb48cfa4dd720", "score": "0.6351635", "text": "def update\n respond_to do |format|\n if @bulb.update(bulb_params)\n format.html { redirect_to @bulb, notice: 'Bulb was successfully updated.' }\n format.json { render :show, status: :ok, location: @bulb }\n else\n format.html { render :edit }\n format.json { render json: @bulb.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e49aa17c147847f929b93aa3a3c73218", "score": "0.6339474", "text": "def update\n respond_to do |format|\n if @loose_berry.update(loose_berry_params)\n format.html { redirect_to tenant_loose_berries_path , notice: 'Loose berry was successfully updated.' }\n format.json { render :show, status: :ok, location: @loose_berry }\n else\n format.html { render :edit }\n format.json { render json: @loose_berry.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f68d7c3d4bee50048901f153c894a344", "score": "0.632319", "text": "def update\r\n @brand = Brand.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @brand.update_attributes(params[:brand])\r\n format.html { redirect_to @brand, notice: 'Brand 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: @brand.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "5bb95712be24ad71f7bdc129d1ddea0f", "score": "0.6319736", "text": "def update\n brands_in_shop = JSON.parse(params[:shop][:brands_in_shop])\n\n respond_to do |format|\n # TODO: need to update brands if changed\n if @shop.update_with_brands(shop_params, brands_in_shop)\n format.html { redirect_to director_shops_path, notice: 'Shop was successfully updated.' }\n format.json { render :show, status: :ok, location: @shop }\n else\n format.html {\n @brands = Brand.to_options.to_json\n render :edit\n }\n format.json { render json: @shop.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "549b8691f0f94e4c4ac27173a1dc9a8d", "score": "0.63153476", "text": "def update\n respond_to do |format|\n if @bando.update(bando_params)\n format.html { redirect_to @bando, notice: \"Bando was successfully updated.\" }\n format.json { render :show, status: :ok, location: @bando }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @bando.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bfffefb2433840a4115fb73071c37b9b", "score": "0.630744", "text": "def update(model_name, model_id, data, options = {})\n url = get_brpm_url(model_name, model_id)\n options[\"data\"] = data\n result = Rest.put(url, options)\n result\n end", "title": "" }, { "docid": "43e8f0bca4534c5f973451762b036fb9", "score": "0.62997615", "text": "def update\n respond_to do |format|\n if @api_v1_budget.update(api_v1_budget_params)\n format.html { redirect_to @api_v1_budget, notice: 'Budget was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_budget }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_budget.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "59e541bfddb963dbabb16caf78e694c2", "score": "0.62921566", "text": "def update\n @bof = Bof.find(params[:id])\n\n respond_to do |format|\n if @bof.update_attributes(params[:bof])\n format.html { redirect_to @bof, notice: 'Bof was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bof.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ed976efac6cbff417cb4c060258cbb4a", "score": "0.6291986", "text": "def update\n respond_to do |format|\n if @brand.update(brand_params)\n format.json { render json: @brand, status: 200 }\n else\n format.json { render json: @brand.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9fe12c4f0184ba4b2e0683b49382bc89", "score": "0.62861246", "text": "def update\n @beet = Beet.find(params[:id])\n\n respond_to do |format|\n if @beet.update_attributes(params[:beet])\n format.html { redirect_to @beet, notice: 'Beet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @beet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0a968ac8d66a6978d82d509a3877a65b", "score": "0.62801164", "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": "1c35f89f4e93251128bbf53c08021b3d", "score": "0.6279669", "text": "def update\n @company_id = company_params[:company_id]\n @reponse = HTTParty.put(\"https://rails-api-ipo.herokuapp.com/api/v1/companies/#{@company_id}.json\",\n :body => {:company_name => company_params[:company_name]}.to_json,\n :headers => { 'Content-Type' => 'application/json' } )\n respond_to do |format|\n format.html { redirect_to '/companies/'+(@reponse['id'].to_s), notice: 'Company was successfully created.' }\n end\n end", "title": "" }, { "docid": "79f6b85f02937add27753bcaff8a9b33", "score": "0.6271351", "text": "def update\n @brand = Brand.find(params[:id])\n\n respond_to do |format|\n if @brand.update_attributes(params[:brand])\n @brand = @brand.decorate\n format.html { redirect_to @brand, notice: 'Brand was successfully updated.' }\n # format.json { head :no_content }\n else\n @brand = @brand.decorate\n format.html { render action: \"edit\" }\n # format.json { render json: @brand.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2f8b8da0ca1947ea88ecb5d7751d597a", "score": "0.6264803", "text": "def update\n @bruger = Bruger.find(params[:id])\n\n respond_to do |format|\n if @bruger.update_attributes(params[:bruger])\n format.html { redirect_to @bruger, notice: 'Bruger was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bruger.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "65c9b3b7c7b72db243ed08a6928195b3", "score": "0.62485915", "text": "def update\n @brand = Brand.find(params[:id])\n\n respond_to do |format|\n if @brand.update_attributes(brand_params)\n format.html { redirect_to [:admin, @brand], notice: 'Brand was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @brand.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "265daec0872230d3974833a28c2555e8", "score": "0.62476546", "text": "def update\n @bait = Bait.find(params[:id])\n\n respond_to do |format|\n if @bait.update_attributes(params[:bait])\n format.html { redirect_to @bait, notice: 'Bait was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bait.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bb7ed616376db4ed2ff763d2659f1e13", "score": "0.62413436", "text": "def update\n respond_to do |format|\n if @boilerplate.update(boilerplate_params)\n format.json { render :show, status: :ok, location: @api_v1_boilerplate }\n else\n format.json { render json: @boilerplate.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "77cec3d2926a2b2a6b16d05f8aa24ec8", "score": "0.6240317", "text": "def update\n @brigade = Brigade.find(params[:id])\n\n respond_to do |format|\n if @brigade.update_attributes(params[:brigade])\n format.html { redirect_to @brigade, notice: 'Brigade was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @brigade.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "86731243c8c752ea87ff25de66eba534", "score": "0.62402415", "text": "def update\n @bundle = Bundle.find(params[:id])\n @bundle.update_attributes(:title => params[:bundlename]) if !params[:bundlename].blank?\n @bundle.update_attributes(:description => params[:bundlescription]) if !params[:bundlescription].blank?\n r_ids_array = []\n params[:resources].split(\",\").slice!(1..-1).each do |resource|\n r_ids_array << resource.slice!(9..-1)\n end\n r_ids_array.each do |resource_id|\n resource = Resource.find(resource_id)\n if [email protected]?(resource)\n @bundle.resources << resource\n end\n end\n\n\n respond_to do |format|\n # if @bundle.resources.update_attributes(params[:])\n format.html { redirect_to bundle_path(@bundle), notice: 'Bundle was successfully updated.' }\n format.json { head :no_content }\n # else\n # format.html { render action: \"edit\" }\n # format.json { render json: @bundle.errors, status: :unprocessable_entity }\n # end\n end\n end", "title": "" }, { "docid": "118e5378610d7100e145d9ae9917b945", "score": "0.62352836", "text": "def update\n respond_to do |format|\n if @bagh.update(bagh_params)\n format.html { redirect_to @bagh, notice: 'Bagh was successfully updated.' }\n format.json { render :show, status: :ok, location: @bagh }\n else\n format.html { render :edit }\n format.json { render json: @bagh.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8f6619b804c548d0480415fe7b25fee4", "score": "0.6233335", "text": "def update\n respond_to do |format|\n if @admin_brand.update(admin_brand_params)\n format.html { redirect_to admin_brands_path, notice: '更新品牌成功' }\n format.json { render :show, status: :ok, location: @admin_brand }\n else\n format.html { render :edit }\n format.json { render json: @admin_brand.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3ab61f8ed8bcdcbf2d2874b5251a41aa", "score": "0.6228514", "text": "def update\n @buttle = Buttle.find(params[:id])\n\n respond_to do |format|\n if @buttle.update_attributes(params[:buttle])\n format.html { redirect_to myadmin_buttles_path, notice: 'Buttle was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @buttle.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8526bda945752e27df3ffdba1b7efea0", "score": "0.62215674", "text": "def update_mobile_carrier(args = {}) \n put(\"/mobile.json/#{args[:carrierId]}\", args)\nend", "title": "" }, { "docid": "236304fcad43192d087ee46b0dda7697", "score": "0.6212901", "text": "def update\n @baby = Baby.find(params[:id])\n\n respond_to do |format|\n if @baby.update_attributes(params[:baby])\n format.html { redirect_to @baby, notice: 'Baby was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @baby.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f6b4853cfc9cdc78cec20bc55cc6a318", "score": "0.62067384", "text": "def update\n @brigade = Brigade.find(params[:id])\n\n respond_to do |format|\n if @brigade.update_attributes(params[:brigade])\n format.html { redirect_to brigades_url, notice: 'Бригада успешно обновлена.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @brigade.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "24b15deff937eeed98617dfe8de9c47d", "score": "0.6189285", "text": "def update\n respond_to do |format|\n if @brite_as_barabasis.update(brite_as_barabasis_params)\n format.html { redirect_to @brite_as_barabasis, notice: 'Brite as barabasi was successfully updated.' }\n format.json { render :show, status: :ok, location: @brite_as_barabasis }\n else\n format.html { render :edit }\n format.json { render json: @brite_as_barabasis.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7f307d2082546c733eba25e1f4cc90a6", "score": "0.61872435", "text": "def update\n @bottle = Bottle.find(params[:id])\n\n respond_to do |format|\n if @bottle.update_attributes(params[:bottle])\n format.html { redirect_to @bottle, notice: 'Bottle was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bottle.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1544d4f3247d2555b820c981fcdbdbc2", "score": "0.6185422", "text": "def update\n respond_to do |format|\n if @bhk.update(bhk_params)\n format.html { redirect_to @bhk, notice: 'Bhk was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bhk.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1054af588f459d34e95f31dea263a5d8", "score": "0.61851215", "text": "def update\n\t #render :text => \"<pre>\" + params[:product][:brands_id].to_s and return\n\n\t if params[:product][:subcategory_id] == '1'\n\t\t product_params = product_params_computer\n\t else\n\t\t product_params = product_params_camera\n\t end\n\n\t respond_to do |format|\n\n if @product.update(product_params)\n\t\t\t\tif params[:product][:brands_id]\n\t @product.update(brand: Brand.find(params[:product][:brands_id]))\n\t end\n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "706fa77f12c2bbc621c332f2fd842c87", "score": "0.6184411", "text": "def update\n respond_to do |format|\n if @baby.update(baby_params)\n format.html { redirect_to @baby, notice: 'Baby was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @baby.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "706fa77f12c2bbc621c332f2fd842c87", "score": "0.6184411", "text": "def update\n respond_to do |format|\n if @baby.update(baby_params)\n format.html { redirect_to @baby, notice: 'Baby was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @baby.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "74b4a22ca6d373f70ad0b66221a8dd5c", "score": "0.617568", "text": "def update\n @custom_trucker_hat.brand_id = params[:brand_id]\n respond_to do |format|\n if @custom_trucker_hat.update(custom_trucker_hat_params)\n format.html { redirect_to @custom_trucker_hat, notice: 'Custom trucker hat was successfully updated.' }\n format.json { render :show, status: :ok, location: @custom_trucker_hat }\n else\n format.html { render :edit }\n format.json { render json: @custom_trucker_hat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "58595b5f03ec3a7de4e2b7cd9c2b2037", "score": "0.6169651", "text": "def update\n respond_to do |format|\n if @banal_brainstorm.update(banal_brainstorm_params)\n format.html { redirect_to @banal_brainstorm, notice: 'Brainstorm was successfully updated.' }\n format.json { render :show, status: :ok, location: @banal_brainstorm }\n else\n format.html { render :edit }\n format.json { render json: @banal_brainstorm.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "455a41c3c6a7298eae0c5ee52d783293", "score": "0.6152466", "text": "def update\n @jimboland = Jimboland.find(params[:id])\n\n respond_to do |format|\n if @jimboland.update_attributes(params[:jimboland])\n format.html { redirect_to @jimboland, notice: 'Jimboland was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @jimboland.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5655b98df6460a73de7b81851d822c78", "score": "0.61509264", "text": "def update\n @bundle = Bundle.find(params[:id])\n\n\n respond_to do |format|\n params[:bundle][:category] = params[:bundle][:category].strip.downcase\n params[:bundle][:style] = params[:bundle][:style].strip.downcase\n params[:bundle][:color] = params[:bundle][:color].strip.downcase\n params[:bundle][:brand] = params[:bundle][:brand].strip.downcase\n params[:bundle][:make] = params[:bundle][:make].strip.downcase\n params[:bundle][:location] = params[:bundle][:location].strip.downcase\n\n if @bundle.update_attributes(params[:bundle])\n format.html { redirect_to @bundle, notice: 'Bundle was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bundle.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6882ef78f8b3fdbb5e4fe5420af1d27c", "score": "0.6146712", "text": "def update\n @baoming = Baoming.find(params[:id])\n\n respond_to do |format|\n if @baoming.update_attributes(params[:baoming])\n format.html { redirect_to @baoming, notice: 'Baoming was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @baoming.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "62c9f72d0771859b2f4f55b87a25c47a", "score": "0.6145324", "text": "def update\n @bingo = Bingo.find(params[:id])\n\n respond_to do |format|\n if @bingo.update_attributes(params[:bingo])\n format.html { redirect_to @bingo, notice: 'Bingo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bingo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ef83cbad1e303adbe720d0546c803dde", "score": "0.614388", "text": "def update\n get_list\n if params[:vehicle][:vehicle_type] == \"Shuttle\"\n params[:vehicle][:payload_weight] = nil\n end\n @vehicle = Vehicle.find(params[:id])\n\n respond_to do |format|\n if @vehicle.update_attributes(params[:vehicle])\n format.html { redirect_to @vehicle, notice: 'Vehicle was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vehicle.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "96a43940175dc99078671f9277dbd809", "score": "0.61429083", "text": "def update\n respond_to do |format|\n if @brand.update(brand_params)\n format.html { redirect_to @brand, notice: 'Brand was successfully updated.' }\n format.json { render :show, status: :ok, location: @brand }\n else\n format.html { render :edit }\n format.json { render json: @brand.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "96a43940175dc99078671f9277dbd809", "score": "0.61429083", "text": "def update\n respond_to do |format|\n if @brand.update(brand_params)\n format.html { redirect_to @brand, notice: 'Brand was successfully updated.' }\n format.json { render :show, status: :ok, location: @brand }\n else\n format.html { render :edit }\n format.json { render json: @brand.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "96a43940175dc99078671f9277dbd809", "score": "0.61429083", "text": "def update\n respond_to do |format|\n if @brand.update(brand_params)\n format.html { redirect_to @brand, notice: 'Brand was successfully updated.' }\n format.json { render :show, status: :ok, location: @brand }\n else\n format.html { render :edit }\n format.json { render json: @brand.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "be6a1ef1b5b1b5a6c78aeb791735d7d0", "score": "0.6139959", "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": "fe2891263f9bd1f21aaa3713ab6c5296", "score": "0.6138247", "text": "def update\n respond_to do |format|\n if @fish_bowl.update(fish_bowl_params)\n format.html { redirect_to @fish_bowl, notice: 'Fish bowl was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @fish_bowl.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8b8b80c03748d645ae352b30063d5f2e", "score": "0.61343133", "text": "def update\n @brand_name = BrandName.find(params[:id])\n\n respond_to do |format|\n if @brand_name.update_attributes(params[:brand_name])\n format.html { redirect_to @brand_name, notice: 'Brand name was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @brand_name.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "692eaabee73a833c5c56aa7fd05696c9", "score": "0.61318797", "text": "def update\n respond_to do |format|\n if @boat_detail.update(boat_detail_params)\n format.html { redirect_to @boat_detail, notice: 'Boat detail was successfully updated.' }\n format.json { render :show, status: :ok, location: @boat_detail }\n else\n format.html { render :edit }\n format.json { render json: @boat_detail.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "75903c3f81f25667a7bdc189785e9c4e", "score": "0.6127943", "text": "def update\n @used_bike_model = UsedBikeModel.find(params[:id])\n\n if @used_bike_model.update(used_bike_model_params)\n head :no_content\n else\n render json: @used_bike_model.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "84fb09fd0ee9909b65aa261af282a517", "score": "0.61274594", "text": "def update\n @buttle = Buttle.find(params[:id])\n\n respond_to do |format|\n if @buttle.update_attributes(params[:buttle])\n format.html { redirect_to buttles_path, notice: 'Buttle was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @buttle.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ae407bbb604e0818e25cc47710c881a8", "score": "0.6123562", "text": "def update\n respond_to do |format|\n if @banda.update(banda_params)\n format.html { redirect_to @banda, notice: 'Banda was successfully updated.' }\n format.json { render :show, status: :ok, location: @banda }\n else\n format.html { render :edit }\n format.json { render json: @banda.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9b9510ea56adb4b7b6440aa87f82e874", "score": "0.61137", "text": "def update\n respond_to do |format|\n if @api_v1_budget_item.update(api_v1_budget_item_params)\n format.html { redirect_to @api_v1_budget_item, notice: 'Budget item was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_budget_item }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_budget_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6e3d01e6688e56b967f50ecf7c3a14c0", "score": "0.61092174", "text": "def update\n respond_to do |format|\n if @bru.update(bru_params)\n format.html { redirect_to @bru, notice: 'Bru was successfully updated.' }\n format.json { render :show, status: :ok, location: @bru }\n else\n format.html { render :edit }\n format.json { render json: @bru.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f91ab6d11c3039353ce5d607ce9dd385", "score": "0.61067855", "text": "def update\n respond_to do |format|\n if @beet.update(beet_params)\n format.html { redirect_to @beet, notice: 'Beet was successfully updated.' }\n format.json { render :show, status: :ok, location: @beet }\n else\n format.html { render :edit }\n format.json { render json: @beet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "550a4b2811339849a4bbc7d36158912c", "score": "0.6103952", "text": "def update\n @bounty = Bounty.find(params[:id])\n\n respond_to do |format|\n if @bounty.update_attributes(params[:bounty])\n format.html { redirect_to admin_bounties_path, notice: 'Bounty was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bounty.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fbaab05d404770083c1f8641c4fba890", "score": "0.6102736", "text": "def update\r\n respond_to do |format|\r\n if current_brand.update(brand_params)\r\n current_brand.save!\r\n format.html { render json: current_brand } #{ redirect_to dashboard_main_path, notice: I18n.t('Brand was successfully updated.') }\r\n format.json { render :show, status: :ok, location: @brand }\r\n else\r\n format.html { render json: @brand.errors, status: :unprocessable_entity }\r\n format.json { render json: @brand.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "528e059cc8ce3c359b66da9a9524d21e", "score": "0.6100826", "text": "def update\n respond_to do |format|\n if @brand.update(brand_params)\n format.html { redirect_to brand_url(@brand, protocol: redirect_protocol), notice: 'Brand was successfully updated.' }\n format.json { render :show, status: :ok, location: @brand }\n else\n format.html { render :edit }\n format.json { render json: @brand.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "47abb2cddfa1a665018f717cdaaa4164", "score": "0.60975254", "text": "def update!(params)\n res = @client.put(path, {}, params, \"Content-Type\" => \"application/json\")\n\n @attributes = res.json if res.status == 201\n end", "title": "" }, { "docid": "d050c6b39c132e78ce15dbc4def744f6", "score": "0.60965997", "text": "def update\n @boook = Boook.find(params[:id])\n\n respond_to do |format|\n if @boook.update_attributes(params[:boook])\n format.html { redirect_to @boook, notice: 'Boook was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @boook.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8b146a54b113562718ed16d00a5717f2", "score": "0.6094943", "text": "def update\n respond_to do |format|\n if @bike.update(bike_params)\n format.html { redirect_to @bike, notice: 'Bike was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bike.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b2785ee41479a79c44b0218c4d6751ed", "score": "0.6094436", "text": "def update\n @brainstorm = Brainstorm.find(params[:id])\n\n respond_to do |format|\n if @brainstorm.update_attributes(brainstorm_params)\n format.html { redirect_to @brainstorm, notice: 'Brainstorm was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @brainstorm.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "adece6c8dbba6da8d956774b410c645a", "score": "0.6092613", "text": "def update_mobile_carrier(args = {}) \n id = args['id']\n temp_path = \"/mobile.json/{carrierId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"mobileId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "title": "" }, { "docid": "ea0f33557d0c627f5b8afbc3dda2b34c", "score": "0.6092436", "text": "def update\n @sub_brand = SubBrand.find(params[:id])\n\n respond_to do |format|\n if @sub_brand.update_attributes(params[:sub_brand])\n format.html { redirect_to @sub_brand, notice: 'Sub brand was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sub_brand.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "27819ad2c252ebe15a08ad5f92c58b1a", "score": "0.6086954", "text": "def update\n @car_brands = CarBrand.all.order(:name)\n respond_to do |format|\n if @customer.update(customer_params)\n format.html { redirect_to @customer, notice: 'El cliente se ha actualizado correctamente.' }\n format.json { render :show, status: :ok, location: @customer }\n else\n format.html { render :edit }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a82d699007bcb31de2d6b4a7223ae29e", "score": "0.60868037", "text": "def update\n respond_to do |format|\n if @brainstorm.update(brainstorm_params)\n format.html { redirect_to @brainstorm, notice: 'Brainstorm was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @brainstorm.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2ea2c21ba7b9cef9f9d741710b852191", "score": "0.6086449", "text": "def update\r\n @waterbottle = Waterbottle.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @waterbottle.update_attributes(params[:waterbottle])\r\n format.html { redirect_to @waterbottle, notice: 'Waterbottle 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: @waterbottle.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "0dc160848afa814134bd6e1247d449d8", "score": "0.60859835", "text": "def update\n respond_to do |format|\n if @booh.update(booh_params)\n format.html { redirect_to @booh, notice: 'Booh was successfully updated.' }\n format.json { render :show, status: :ok, location: @booh }\n else\n format.html { render :edit }\n format.json { render json: @booh.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "73ed8ef8f8222dc62ed7481a9af541f5", "score": "0.6082641", "text": "def update\n respond_to do |format|\n if @boat.update(boat_params)\n format.html { redirect_to @boat, notice: 'Uppgifter om båten är ändrade.' }\n format.json { render :show, status: :ok, location: @boat }\n else\n format.html { render :edit }\n format.json { render json: @boat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a1fe37ea3b65f9582f0703fafb11644c", "score": "0.6080063", "text": "def update\n respond_to do |format|\n if @bolet.update(bolet_params)\n format.html { redirect_to @bolet, notice: 'Bolet was successfully updated.' }\n format.json { render :show, status: :ok, location: @bolet }\n else\n format.html { render :edit }\n format.json { render json: @bolet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e383df024bc3b62d8d0523ba9ee9682e", "score": "0.6076062", "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": "ae93459a95b357b561b8cbf2cbf253fe", "score": "0.60752696", "text": "def update\n respond_to do |format|\n if @belgium.update(belgium_params)\n format.html { redirect_to @belgium, notice: 'Belgium was successfully updated.' }\n format.json { render :show, status: :ok, location: @belgium }\n else\n format.html { render :edit }\n format.json { render json: @belgium.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "15831058c5e384463bbc72832bc28097", "score": "0.6066784", "text": "def update\n respond_to do |format|\n if @boat.update(boat_params)\n format.html { redirect_to @boat, notice: 'Boat was successfully updated.' }\n format.json { render :show, status: :ok, location: @boat }\n else\n format.html { render :edit }\n format.json { render json: @boat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "15831058c5e384463bbc72832bc28097", "score": "0.6066784", "text": "def update\n respond_to do |format|\n if @boat.update(boat_params)\n format.html { redirect_to @boat, notice: 'Boat was successfully updated.' }\n format.json { render :show, status: :ok, location: @boat }\n else\n format.html { render :edit }\n format.json { render json: @boat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "15831058c5e384463bbc72832bc28097", "score": "0.6066784", "text": "def update\n respond_to do |format|\n if @boat.update(boat_params)\n format.html { redirect_to @boat, notice: 'Boat was successfully updated.' }\n format.json { render :show, status: :ok, location: @boat }\n else\n format.html { render :edit }\n format.json { render json: @boat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e5f40d04598c18bd53bab83ea997c0fb", "score": "0.6065566", "text": "def update\n respond_to do |format|\n if @band.update(band_params)\n format.html { redirect_to @band, notice: 'Band was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @band.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "17536ccb9d9478923d0194e2d04b454b", "score": "0.60618204", "text": "def update\n respond_to do |format|\n if @allbk.update(allbk_params)\n format.html { redirect_to @allbk, notice: 'Allbk was successfully updated.' }\n format.json { render :show, status: :ok, location: @allbk }\n else\n format.html { render :edit }\n format.json { render json: @allbk.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "57691cc8ea4e57cc0b2775319cbd14a0", "score": "0.60586756", "text": "def update\n @blurb = Blurb.find(params[:id])\n\n respond_to do |format|\n if @blurb.update_attributes(blurb_params)\n format.html { redirect_to @blurb, notice: 'Blurb was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @blurb.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cf3f6529c145158565d8eb4a47f59207", "score": "0.60580695", "text": "def update\n respond_to do |format|\n if @bano.update(bano_params)\n format.html { redirect_to @bano, notice: 'Bano was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bano.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4cc370e4d467aa30fc3fc4eae9f23d4a", "score": "0.6056189", "text": "def update\n respond_to do |format|\n if @bargain.update(bargain_params)\n format.html { redirect_to @bargain, notice: 'Bargain was successfully updated.' }\n format.json { render :show, status: :ok, location: @bargain }\n else\n format.html { render :edit }\n format.json { render json: @bargain.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "22523964d6c0dce6bd33b9ffbb97c9b3", "score": "0.60558695", "text": "def update\n respond_to do |format|\n if @besidet.update(besidet_params)\n format.html { redirect_to @besidet, notice: 'Besidet was successfully updated.' }\n format.json { render :show, status: :ok, location: @besidet }\n else\n format.html { render :edit }\n format.json { render json: @besidet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]